diff --git a/.configurations/configuration.dsc.yaml b/.configurations/configuration.dsc.yaml index 780b1dfa959..c41f115aff9 100644 --- a/.configurations/configuration.dsc.yaml +++ b/.configurations/configuration.dsc.yaml @@ -18,17 +18,6 @@ properties: id: OpenJS.NodeJS.LTS version: "20.14.0" source: winget - - resource: NpmDsc/NpmPackage - id: yarn - dependsOn: - - npm - directives: - description: Install Yarn - allowPrerelease: true - settings: - Name: 'yarn' - Global: true - PackageDirectory: '${WinGetConfigRoot}\..\' - resource: Microsoft.WinGet.DSC/WinGetPackage directives: description: Install Python 3.10 @@ -56,7 +45,7 @@ properties: includeRecommended: true components: - Microsoft.VisualStudio.Workload.VCTools - - resource: YarnDsc/YarnInstall + - resource: NpmDsc/NpmInstall dependsOn: - npm directives: diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index bc30d7dbe3b..9be15a6afa1 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -7,8 +7,8 @@ RUN git config --system codespaces-theme.hide-status 1 USER node RUN npm install -g node-gyp -RUN YARN_CACHE="$(yarn cache dir)" && rm -rf "$YARN_CACHE" && ln -s /vscode-dev/yarn-cache "$YARN_CACHE" +RUN NPM_CACHE="$(npm config get cache)" && rm -rf "$NPM_CACHE" && ln -s /vscode-dev/npm-cache "$NPM_CACHE" RUN echo 'export DISPLAY="${DISPLAY:-:1}"' | tee -a ~/.bashrc >> ~/.zshrc USER root -CMD chown node:node /vscode-dev && sudo -u node mkdir -p /vscode-dev/yarn-cache && sleep inf +CMD chown node:node /vscode-dev && sudo -u node mkdir -p /vscode-dev/npm-cache && sleep inf diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 44965693380..5f6e1cd99f3 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -24,7 +24,7 @@ If you already have VS Code and Docker installed, you can click the badge above 4. Press Ctrl/Cmd + Shift + P or F1 and select **Dev Containers: Clone Repository in Container Volume...**. - > **Tip:** While you can use your local source tree instead, operations like `yarn install` can be slow on macOS or when using the Hyper-V engine on Windows. We recommend using the WSL filesystem on Windows or the "clone repository in container" approach on Windows and macOS instead since it uses "named volume" rather than the local filesystem. + > **Tip:** While you can use your local source tree instead, operations like `npm i` can be slow on macOS or when using the Hyper-V engine on Windows. We recommend using the WSL filesystem on Windows or the "clone repository in container" approach on Windows and macOS instead since it uses "named volume" rather than the local filesystem. 5. Type `https://github.com/microsoft/vscode` (or a branch or PR URL) in the input box and press Enter. @@ -85,7 +85,7 @@ To start working with Code - OSS, follow these steps: 1. In your local VS Code client, open a terminal (Ctrl/Cmd + Shift + \`) and type the following commands: ```bash - yarn install + npm i bash scripts/code.sh ``` diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json index cbcde9bb109..fdd03c400cc 100644 --- a/.devcontainer/devcontainer-lock.json +++ b/.devcontainer/devcontainer-lock.json @@ -4,6 +4,11 @@ "version": "1.0.8", "resolved": "ghcr.io/devcontainers/features/desktop-lite@sha256:e7dc4d37ab9e3d6e7ebb221bac741f5bfe07dae47025399d038b17af2ed8ddb7", "integrity": "sha256:e7dc4d37ab9e3d6e7ebb221bac741f5bfe07dae47025399d038b17af2ed8ddb7" + }, + "ghcr.io/devcontainers/features/rust:1": { + "version": "1.1.3", + "resolved": "ghcr.io/devcontainers/features/rust@sha256:aba6f47303b197976902bf544c786b5efecc03c238ff593583e5e74dfa9c7ccb", + "integrity": "sha256:aba6f47303b197976902bf544c786b5efecc03c238ff593583e5e74dfa9c7ccb" } } } \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f5adc4e1c46..75076a0f8b6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,7 +4,8 @@ "dockerfile": "Dockerfile" }, "features": { - "ghcr.io/devcontainers/features/desktop-lite:1": {} + "ghcr.io/devcontainers/features/desktop-lite:1": {}, + "ghcr.io/devcontainers/features/rust:1": {} }, "containerEnv": { "DISPLAY": "" // Allow the Dev Containers extension to set DISPLAY, post-create.sh will add it back in ~/.bashrc and ~/.zshrc if not set. diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 5b2deee6674..4e39a71c49d 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -1,4 +1,4 @@ #!/bin/sh -yarn install --network-timeout 180000 -yarn electron +npm i +npm run electron diff --git a/.eslintignore b/.eslintignore index 12da4a432e1..0299f2c1080 100644 --- a/.eslintignore +++ b/.eslintignore @@ -30,7 +30,15 @@ **/src/vs/*/**/*.d.ts **/src/vs/base/test/common/filters.perf.data.js **/src/vs/loader.js +**/src2/**/dompurify.js +**/src2/**/marked.js +**/src2/**/semver.js +**/src2/typings/**/*.d.ts +**/src2/vs/*/**/*.d.ts +**/src2/vs/base/test/common/filters.perf.data.js +**/src2/vs/loader.js **/test/unit/assert.js +**/test/unit/assert-esm.js **/test/automation/out/** **/typings/** !.vscode diff --git a/.eslintplugin/code-ensure-no-disposables-leak-in-test.ts b/.eslintplugin/code-ensure-no-disposables-leak-in-test.ts index ae3089036a6..9d3044f50f4 100644 --- a/.eslintplugin/code-ensure-no-disposables-leak-in-test.ts +++ b/.eslintplugin/code-ensure-no-disposables-leak-in-test.ts @@ -12,7 +12,8 @@ export = new class EnsureNoDisposablesAreLeakedInTestSuite implements eslint.Rul type: 'problem', messages: { ensure: 'Suites should include a call to `ensureNoDisposablesAreLeakedInTestSuite()` to ensure no disposables are leaked in tests.' - } + }, + fixable: 'code' }; create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { @@ -30,6 +31,10 @@ export = new class EnsureNoDisposablesAreLeakedInTestSuite implements eslint.Rul context.report({ node, messageId: 'ensure', + fix: (fixer) => { + const updatedSrc = src.replace(/(suite\(.*\n)/, '$1\n\tensureNoDisposablesAreLeakedInTestSuite();\n'); + return fixer.replaceText(node, updatedSrc); + } }); } }, diff --git a/.eslintplugin/code-import-patterns.ts b/.eslintplugin/code-import-patterns.ts index 1f08bb4a4e8..460409514bc 100644 --- a/.eslintplugin/code-import-patterns.ts +++ b/.eslintplugin/code-import-patterns.ts @@ -12,19 +12,19 @@ import { createImportRuleListener } from './utils'; const REPO_ROOT = path.normalize(path.join(__dirname, '../')); interface ConditionalPattern { - when?: 'hasBrowser' | 'hasNode' | 'test'; + when?: 'hasBrowser' | 'hasNode' | 'hasElectron' | 'test'; pattern: string; } interface RawImportPatternsConfig { target: string; - layer?: 'common' | 'worker' | 'browser' | 'electron-sandbox' | 'node' | 'electron-main'; + layer?: 'common' | 'worker' | 'browser' | 'electron-sandbox' | 'node' | 'electron-utility' | 'electron-main'; test?: boolean; restrictions: string | (string | ConditionalPattern)[]; } interface LayerAllowRule { - when: 'hasBrowser' | 'hasNode' | 'test'; + when: 'hasBrowser' | 'hasNode' | 'hasElectron' | 'test'; allow: string[]; } @@ -44,7 +44,9 @@ export = new class implements eslint.Rule.RuleModule { readonly meta: eslint.Rule.RuleMetaData = { messages: { badImport: 'Imports violates \'{{restrictions}}\' restrictions. See https://github.com/microsoft/vscode/wiki/Source-Code-Organization', - badFilename: 'Missing definition in `code-import-patterns` for this file. Define rules at https://github.com/microsoft/vscode/blob/main/.eslintrc.json' + badFilename: 'Missing definition in `code-import-patterns` for this file. Define rules at https://github.com/microsoft/vscode/blob/main/.eslintrc.json', + badAbsolute: 'Imports have to be relative to support ESM', + badExtension: 'Imports have to end with `.js` or `.css` to support ESM', }, docs: { url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization' @@ -77,13 +79,14 @@ export = new class implements eslint.Rule.RuleModule { return this._optionsCache.get(options)!; } - type Layer = 'common' | 'worker' | 'browser' | 'electron-sandbox' | 'node' | 'electron-main'; + type Layer = 'common' | 'worker' | 'browser' | 'electron-sandbox' | 'node' | 'electron-utility' | 'electron-main'; interface ILayerRule { layer: Layer; deps: string; isBrowser?: boolean; isNode?: boolean; + isElectron?: boolean; } function orSegment(variants: Layer[]): string { @@ -96,11 +99,13 @@ export = new class implements eslint.Rule.RuleModule { { layer: 'browser', deps: orSegment(['common', 'browser']), isBrowser: true }, { layer: 'electron-sandbox', deps: orSegment(['common', 'browser', 'electron-sandbox']), isBrowser: true }, { layer: 'node', deps: orSegment(['common', 'node']), isNode: true }, - { layer: 'electron-main', deps: orSegment(['common', 'node', 'electron-main']), isNode: true }, + { layer: 'electron-utility', deps: orSegment(['common', 'node', 'electron-utility']), isNode: true, isElectron: true }, + { layer: 'electron-main', deps: orSegment(['common', 'node', 'electron-utility', 'electron-main']), isNode: true, isElectron: true }, ]; let browserAllow: string[] = []; let nodeAllow: string[] = []; + let electronAllow: string[] = []; let testAllow: string[] = []; for (const option of options) { if (isLayerAllowRule(option)) { @@ -108,6 +113,8 @@ export = new class implements eslint.Rule.RuleModule { browserAllow = option.allow.slice(0); } else if (option.when === 'hasNode') { nodeAllow = option.allow.slice(0); + } else if (option.when === 'hasElectron') { + electronAllow = option.allow.slice(0); } else if (option.when === 'test') { testAllow = option.allow.slice(0); } @@ -135,9 +142,13 @@ export = new class implements eslint.Rule.RuleModule { restrictions.push(...nodeAllow); } + if (layerRule.isElectron) { + restrictions.push(...electronAllow); + } + for (const rawRestriction of rawRestrictions) { let importPattern: string; - let when: 'hasBrowser' | 'hasNode' | 'test' | undefined = undefined; + let when: 'hasBrowser' | 'hasNode' | 'hasElectron' | 'test' | undefined = undefined; if (typeof rawRestriction === 'string') { importPattern = rawRestriction; } else { @@ -147,6 +158,7 @@ export = new class implements eslint.Rule.RuleModule { if (typeof when === 'undefined' || (when === 'hasBrowser' && layerRule.isBrowser) || (when === 'hasNode' && layerRule.isNode) + || (when === 'hasElectron' && layerRule.isElectron) ) { restrictions.push(importPattern.replace(/\/\~$/, `/${layerRule.deps}/**`)); testRestrictions.push(importPattern.replace(/\/\~$/, `/test/${layerRule.deps}/**`)); @@ -181,8 +193,8 @@ export = new class implements eslint.Rule.RuleModule { if (targetIsVS) { // Always add "vs/nls" and "vs/amdX" - restrictions.push('vs/nls'); - restrictions.push('vs/amdX'); // TODO@jrieken remove after ESM is real + restrictions.push('vs/nls.js'); + restrictions.push('vs/amdX.js'); // TODO@jrieken remove after ESM is real } if (targetIsVS && option.layer) { @@ -212,6 +224,25 @@ export = new class implements eslint.Rule.RuleModule { } private _checkImport(context: eslint.Rule.RuleContext, config: ImportPatternsConfig, node: TSESTree.Node, importPath: string) { + const targetIsVS = /^src\/vs\//.test(getRelativeFilename(context)); + if (targetIsVS) { + + // ESM: check for import ending with ".js" or ".css" + if (importPath[0] === '.' && !importPath.endsWith('.js') && !importPath.endsWith('.css')) { + context.report({ + loc: node.loc, + messageId: 'badExtension', + }); + } + + // check for import being relative + if (importPath.startsWith('vs/')) { + context.report({ + loc: node.loc, + messageId: 'badAbsolute', + }); + } + } // resolve relative paths if (importPath[0] === '.') { diff --git a/.eslintplugin/code-no-look-behind-regex.ts b/.eslintplugin/code-no-look-behind-regex.ts deleted file mode 100644 index 800b59b6479..00000000000 --- a/.eslintplugin/code-no-look-behind-regex.ts +++ /dev/null @@ -1,50 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as eslint from 'eslint'; -import { TSESTree } from '@typescript-eslint/experimental-utils'; -import * as ESTree from 'estree'; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -const _positiveLookBehind = /\(\?<=.+/; -const _negativeLookBehind = /\(\? { - type RegexLiteral = TSESTree.Literal & { regex: { pattern: string; flags: string } }; - const pattern = (node).regex?.pattern; - if (_containsLookBehind(pattern)) { - context.report({ - node, - message: 'Look behind assertions are not yet supported in all browsers' - }); - } - }, - // new Regex("...") - ['NewExpression[callee.name="RegExp"] Literal']: (node: ESTree.Literal) => { - if (_containsLookBehind(node.value)) { - context.report({ - node, - message: 'Look behind assertions are not yet supported in all browsers' - }); - } - } - }; - } -}; diff --git a/.eslintplugin/code-no-static-self-ref.ts b/.eslintplugin/code-no-static-self-ref.ts new file mode 100644 index 00000000000..7c6e13032ae --- /dev/null +++ b/.eslintplugin/code-no-static-self-ref.ts @@ -0,0 +1,56 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as eslint from 'eslint'; +import { TSESTree } from '@typescript-eslint/experimental-utils'; + +/** + * WORKAROUND for https://github.com/evanw/esbuild/issues/3823 + */ +export = new class implements eslint.Rule.RuleModule { + + create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { + + function checkProperty(inNode: any) { + + const classDeclaration = context.getAncestors().find(node => node.type === 'ClassDeclaration'); + const propertyDefinition = inNode; + + if (!classDeclaration || !classDeclaration.id?.name) { + return; + } + + if (!propertyDefinition.value) { + return; + } + + const classCtor = classDeclaration.body.body.find(node => node.type === 'MethodDefinition' && node.kind === 'constructor') + + if (!classCtor) { + return; + } + + const name = classDeclaration.id.name; + const valueText = context.getSourceCode().getText(propertyDefinition.value) + + if (valueText.includes(name + '.')) { + + if (classCtor.value?.type === 'FunctionExpression' && !classCtor.value.params.find((param: any) => param.type === 'TSParameterProperty' && param.decorators?.length > 0)) { + return + } + + context.report({ + loc: propertyDefinition.value.loc, + message: `Static properties in decorated classes should not reference the class they are defined in. Use 'this' instead. This is a workaround for https://github.com/evanw/esbuild/issues/3823.` + }); + } + + } + + return { + 'PropertyDefinition[static=true]': checkProperty, + }; + } +}; diff --git a/.eslintrc.json b/.eslintrc.json index 209bcee0d97..97333387f86 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -92,9 +92,14 @@ "common", "browser" ], - "electron-main": [ + "electron-utility": [ "common", "node" + ], + "electron-main": [ + "common", + "node", + "electron-utility" ] } ], @@ -141,6 +146,14 @@ ] } }, + { + "files": [ + "src/**/*.ts" + ], + "rules": { + "local/code-no-static-self-ref": "warn" + } + }, { "files": [ "src/vs/**/*.test.ts" @@ -603,12 +616,64 @@ ] } }, + { + "files": [ + "src/**/electron-utility/**/*.ts" + ], + "rules": { + "no-restricted-imports": [ + "warn", + { + "paths": [ + { + "name": "electron", + "importNames": [ + "app", + "autoUpdater", + "BaseWindow", + "BrowserWindow", + "contentTracing", + "desktopCapturer", + "dialog", + "globalShortcut", + "inAppPurchase", + "ipcMain", + "Menu", + "MenuItem", + "MessageChannelMain", + "MessagePortMain", + "nativeTheme", + "netLog", + "Notification", + "powerMonitor", + "powerSaveBlocker", + "protocol", + "pushNotifications", + "safeStorage", + "screen", + "session", + "ShareMenu", + "TouchBar", + "Tray", + "utilityProcess", + "View", + "webContents", + "webFrameMain", + "webContentsView", + "default" + ], + "message": "Only net and system-preferences are allowed to be imported from electron" + } + ] + } + ] + } + }, { "files": [ "src/**/*.ts" ], "rules": { - "local/code-no-look-behind-regex": "warn", "local/code-import-patterns": [ "warn", { @@ -623,10 +688,12 @@ { // imports that are allowed in all files of layers: // - node + // - electron-utility // - electron-main "when": "hasNode", "allow": [ "@parcel/watcher", + "@bpasero/watcher", "@vscode/sqlite3", "@vscode/vscode-languagedetection", "@vscode/ripgrep", @@ -641,13 +708,13 @@ "cookie", "crypto", "dns", - "electron", "events", "fs", "fs/promises", "http", "https", "minimist", + "node:module", "native-keymap", "native-watchdog", "net", @@ -674,17 +741,26 @@ "@xterm/addon-webgl", "@xterm/headless", "@xterm/xterm", - "@floating-ui/dom", "yauzl", "yazl", "zlib" ] }, + { + // imports that are allowed in all files of layers: + // - electron-utility + // - electron-main + "when": "hasElectron", + "allow": [ + "electron" + ] + }, { // imports that are allowed in all /test/ files "when": "test", "allow": [ "vs/css.build", + "vs/css.build.js", "assert", "sinon", "sinon-test" @@ -739,7 +815,8 @@ "vs/platform/*/~", "tas-client-umd", // node module allowed even in /common/ "@microsoft/1ds-core-js", // node module allowed even in /common/ - "@microsoft/1ds-post-js" // node module allowed even in /common/ + "@microsoft/1ds-post-js", // node module allowed even in /common/ + "@xterm/headless" // node module allowed even in /common/ ] }, { @@ -748,7 +825,8 @@ "vs/base/~", "vs/base/parts/*/~", "vs/platform/*/~", - "vs/editor/~" + "vs/editor/~", + "@vscode/tree-sitter-wasm" // node module allowed even in /common/ ] }, { @@ -769,7 +847,8 @@ "vs/platform/*/~", "vs/editor/~", "vs/editor/contrib/*/~", - "vs/editor/standalone/~" + "vs/editor/standalone/~", + "@vscode/tree-sitter-wasm" // type import ] }, { @@ -855,6 +934,7 @@ "tas-client-umd", // node module allowed even in /common/ "vscode-textmate", // node module allowed even in /common/ "@vscode/vscode-languagedetection", // node module allowed even in /common/ + "@vscode/tree-sitter-wasm", // type import { "when": "hasBrowser", "pattern": "@xterm/xterm" @@ -872,6 +952,7 @@ "vs/workbench/~", "vs/workbench/services/*/~", "vs/workbench/contrib/*/~", + "vs/workbench/contrib/terminal/terminalContribExports*", "vscode-notebook-renderer", // Type only import { "when": "hasBrowser", @@ -901,6 +982,7 @@ // Only allow terminalContrib to import from itself, this works because // terminalContrib is one extra folder deep "vs/workbench/contrib/terminalContrib/*/~", + "vs/workbench/contrib/terminal/terminalContribExports*", "vscode-notebook-renderer", // Type only import { "when": "hasBrowser", @@ -913,7 +995,8 @@ { "when": "hasBrowser", "pattern": "vscode-textmate" - } // node module allowed even in /browser/ + }, // node module allowed even in /browser/ + "@xterm/headless" // node module allowed even in /common/ and /browser/ ] }, { @@ -929,6 +1012,18 @@ "when": "hasBrowser", "pattern": "vs/workbench/workbench.web.main" }, + { + "when": "hasBrowser", + "pattern": "vs/workbench/workbench.web.main.js" + }, + { + "when": "hasBrowser", + "pattern": "vs/workbench/workbench.web.main.internal" + }, + { + "when": "hasBrowser", + "pattern": "vs/workbench/workbench.web.main.internal.js" + }, { "when": "hasBrowser", "pattern": "vs/workbench/~" @@ -959,6 +1054,13 @@ "vs/workbench/contrib/**" ] }, + { + "target": "src/vs/workbench/contrib/terminal/terminalContribExports.ts", + "layer": "browser", + "restrictions": [ + "vs/workbench/contrib/terminalContrib/*/~" + ] + }, { "target": "src/vs/workbench/workbench.common.main.ts", "layer": "browser", @@ -969,11 +1071,13 @@ "vs/editor/~", "vs/editor/contrib/*/~", "vs/editor/editor.all", + "vs/editor/editor.all.js", "vs/workbench/~", "vs/workbench/api/~", "vs/workbench/services/*/~", "vs/workbench/contrib/*/~", - "vs/workbench/contrib/terminal/terminal.all" + "vs/workbench/contrib/terminal/terminal.all", + "vs/workbench/contrib/terminal/terminal.all.js" ] }, { @@ -986,11 +1090,32 @@ "vs/editor/~", "vs/editor/contrib/*/~", "vs/editor/editor.all", + "vs/editor/editor.all.js", + "vs/workbench/~", + "vs/workbench/api/~", + "vs/workbench/services/*/~", + "vs/workbench/contrib/*/~", + "vs/workbench/workbench.common.main", + "vs/workbench/workbench.common.main.js" + ] + }, + { + "target": "src/vs/workbench/workbench.web.main.internal.ts", + "layer": "browser", + "restrictions": [ + "vs/base/~", + "vs/base/parts/*/~", + "vs/platform/*/~", + "vs/editor/~", + "vs/editor/contrib/*/~", + "vs/editor/editor.all", + "vs/editor/editor.all.js", "vs/workbench/~", "vs/workbench/api/~", "vs/workbench/services/*/~", "vs/workbench/contrib/*/~", - "vs/workbench/workbench.common.main" + "vs/workbench/workbench.common.main", + "vs/workbench/workbench.common.main.js" ] }, { @@ -1003,11 +1128,13 @@ "vs/editor/~", "vs/editor/contrib/*/~", "vs/editor/editor.all", + "vs/editor/editor.all.js", "vs/workbench/~", "vs/workbench/api/~", "vs/workbench/services/*/~", "vs/workbench/contrib/*/~", - "vs/workbench/workbench.common.main" + "vs/workbench/workbench.common.main", + "vs/workbench/workbench.common.main.js" ] }, { @@ -1017,11 +1144,7 @@ ] }, { - "target": "src/vs/workbench/{workbench.desktop.main.nls.js,workbench.web.main.nls.js}", - "restrictions": [] - }, - { - "target": "src/vs/{loader.d.ts,css.ts,css.build.ts,monaco.d.ts,nls.ts,nls.build.ts,nls.mock.ts}", + "target": "src/vs/{loader.d.ts,css.ts,css.build.ts,monaco.d.ts,nls.ts,nls.messages.ts}", "restrictions": [] }, { @@ -1029,7 +1152,7 @@ "restrictions": [] }, { - "target": "src/{bootstrap-amd.js,bootstrap-fork.js,bootstrap-node.js,bootstrap-window.js,bootstrap.js,cli.js,main.js,server-cli.js,server-main.js}", + "target": "src/{bootstrap-amd.js,bootstrap-fork.js,bootstrap-node.js,bootstrap-window.js,cli.js,main.js,server-cli.js,server-main.js,bootstrap-cli.js,bootstrap-server.js}", "restrictions": [] } ] @@ -1095,7 +1218,9 @@ "local/code-no-runtime-import": [ "error", { - "src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts": ["**/*"] + "src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts": [ + "**/*" + ] } ] } diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index c0c9a544148..203e213b629 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -26,3 +26,6 @@ ee1655a82ebdfd38bf8792088a6602c69f7bbd94 # jrieken: new eslint-rule 4a130c40ed876644ed8af2943809d08221375408 + +# bpasero: ESM migration +6b924c51528e663dda5091a1493229a361676aca diff --git a/.github/workflows/no-package-lock-changes.yml b/.github/workflows/no-package-lock-changes.yml new file mode 100644 index 00000000000..45d5d17407b --- /dev/null +++ b/.github/workflows/no-package-lock-changes.yml @@ -0,0 +1,31 @@ +name: Prevent package-lock.json changes in PRs +on: [pull_request] + +jobs: + main: + name: Prevent package-lock.json changes in PRs + runs-on: ubuntu-latest + steps: + - uses: octokit/request-action@v2.x + id: get_permissions + with: + route: GET /repos/microsoft/vscode/collaborators/{username}/permission + username: ${{ github.event.pull_request.user.login }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set control output variable + id: control + run: | + echo "user: ${{ github.event.pull_request.user.login }}" + echo "role: ${{ fromJson(steps.get_permissions.outputs.data).permission }}" + echo "is dependabot: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}" + echo "should_run: ${{ !contains(fromJson('["admin", "maintain", "write"]'), fromJson(steps.get_permissions.outputs.data).permission) }}" + echo "should_run=${{ !contains(fromJson('["admin", "maintain", "write"]'), fromJson(steps.get_permissions.outputs.data).permission) && github.event.pull_request.user.login != 'dependabot[bot]' }}" >> $GITHUB_OUTPUT + - name: Get file changes + uses: trilom/file-changes-action@ce38c8ce2459ca3c303415eec8cb0409857b4272 + if: ${{ steps.control.outputs.should_run == 'true' }} + - name: Check for lockfile changes + if: ${{ steps.control.outputs.should_run == 'true' }} + run: | + cat $HOME/files.json | jq -e 'any(test("package-lock\\.json$|Cargo\\.lock$")) | not' \ + || (echo "Changes to package-lock.json/Cargo.lock files aren't allowed in PRs." && exit 1) diff --git a/.gitignore b/.gitignore index 123b3567059..b73ce578e7f 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ build/node_modules coverage/ test_data/ test-results/ -yarn-error.log +test-results.xml vscode.lsif vscode.db /.profile-oss diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000000..6ab9824d0be --- /dev/null +++ b/.npmrc @@ -0,0 +1,7 @@ +disturl="https://electronjs.org/headers" +target="30.5.0" +ms_build_id="10198947" +runtime="electron" +build_from_source="true" +legacy-peer-deps="true" +timeout=180000 diff --git a/.nvmrc b/.nvmrc index bc78e9f2695..8ce7030825b 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.12.1 +20.16.0 diff --git a/.vscode-test.js b/.vscode-test.js index f2db8d695fe..89e1b855ee0 100644 --- a/.vscode-test.js +++ b/.vscode-test.js @@ -45,6 +45,10 @@ const extensions = [ label: 'github-authentication', workspaceFolder: path.join(os.tmpdir(), `msft-auth-${Math.floor(Math.random() * 100000)}`), mocha: { timeout: 60_000 } + }, + { + label: 'microsoft-authentication', + mocha: { timeout: 60_000 } } ]; diff --git a/.vscode/extensions/vscode-selfhost-import-aid/.vscode/launch.json b/.vscode/extensions/vscode-selfhost-import-aid/.vscode/launch.json new file mode 100644 index 00000000000..50b8aedaf72 --- /dev/null +++ b/.vscode/extensions/vscode-selfhost-import-aid/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + "configurations": [ + { + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}", + "--enable-proposed-api=ms-vscode.vscode-selfhost-import-aid" + ], + "name": "Launch Extension", + "outFiles": [ + "${workspaceFolder}/out/**/*.js" + ], + "request": "launch", + "type": "extensionHost" + } + ] +} diff --git a/.vscode/extensions/vscode-selfhost-import-aid/.vscode/settings.json b/.vscode/extensions/vscode-selfhost-import-aid/.vscode/settings.json new file mode 100644 index 00000000000..e4429caeee4 --- /dev/null +++ b/.vscode/extensions/vscode-selfhost-import-aid/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "editor.formatOnSave": true, + "editor.defaultFormatter": "vscode.typescript-language-features", + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + } +} diff --git a/.vscode/extensions/vscode-selfhost-import-aid/package-lock.json b/.vscode/extensions/vscode-selfhost-import-aid/package-lock.json new file mode 100644 index 00000000000..5f526aca3e9 --- /dev/null +++ b/.vscode/extensions/vscode-selfhost-import-aid/package-lock.json @@ -0,0 +1,31 @@ +{ + "name": "vscode-selfhost-import-aid", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vscode-selfhost-import-aid", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "typescript": "5.5.4" + }, + "engines": { + "vscode": "^1.88.0" + } + }, + "node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/.vscode/extensions/vscode-selfhost-import-aid/package.json b/.vscode/extensions/vscode-selfhost-import-aid/package.json new file mode 100644 index 00000000000..30f09f9c8e5 --- /dev/null +++ b/.vscode/extensions/vscode-selfhost-import-aid/package.json @@ -0,0 +1,29 @@ +{ + "name": "vscode-selfhost-import-aid", + "displayName": "VS Code Selfhost Import Aid", + "description": "Util to improve dealing with imports", + "engines": { + "vscode": "^1.88.0" + }, + "version": "0.0.1", + "publisher": "ms-vscode", + "categories": [ + "Other" + ], + "activationEvents": [ + "onLanguage:typescript" + ], + "main": "./out/extension.js", + "repository": { + "type": "git", + "url": "https://github.com/microsoft/vscode.git" + }, + "license": "MIT", + "scripts": { + "compile": "gulp compile-extension:vscode-selfhost-import-aid", + "watch": "gulp watch-extension:vscode-selfhost-import-aid" + }, + "dependencies": { + "typescript": "5.5.4" + } +} diff --git a/.vscode/extensions/vscode-selfhost-import-aid/src/extension.ts b/.vscode/extensions/vscode-selfhost-import-aid/src/extension.ts new file mode 100644 index 00000000000..91627e69f34 --- /dev/null +++ b/.vscode/extensions/vscode-selfhost-import-aid/src/extension.ts @@ -0,0 +1,234 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import * as ts from 'typescript'; +import * as path from 'path'; + +export async function activate(context: vscode.ExtensionContext) { + + const fileIndex = new class { + + private _currentRun?: Thenable; + + private _disposables: vscode.Disposable[] = []; + + private readonly _index = new Map(); + + constructor() { + const watcher = vscode.workspace.createFileSystemWatcher('**/*.ts', false, true, false); + this._disposables.push(watcher.onDidChange(e => { this._index.set(e.toString(), e); })); + this._disposables.push(watcher.onDidDelete(e => { this._index.delete(e.toString()); })); + this._disposables.push(watcher); + + this._refresh(false); + } + + dispose(): void { + for (const disposable of this._disposables) { + disposable.dispose(); + } + this._disposables = []; + this._index.clear(); + } + + async all(token: vscode.CancellationToken) { + + await Promise.race([this._currentRun, new Promise(resolve => token.onCancellationRequested(resolve))]); + + if (token.isCancellationRequested) { + return undefined; + } + + return Array.from(this._index.values()); + } + + private _refresh(clear: boolean) { + // TODO@jrieken LATEST API! findFiles2New + this._currentRun = vscode.workspace.findFiles('src/vs/**/*.ts', '{**/node_modules/**,**/extensions/**}').then(all => { + if (clear) { + this._index.clear(); + } + for (const item of all) { + this._index.set(item.toString(), item); + } + }); + } + }; + + const selector: vscode.DocumentSelector = 'typescript'; + + function findNodeAtPosition(document: vscode.TextDocument, node: ts.Node, position: vscode.Position): ts.Node | undefined { + if (node.getStart() <= document.offsetAt(position) && node.getEnd() >= document.offsetAt(position)) { + return ts.forEachChild(node, child => findNodeAtPosition(document, child, position)) || node; + } + return undefined; + } + + function findImportAt(document: vscode.TextDocument, position: vscode.Position): ts.ImportDeclaration | undefined { + const sourceFile = ts.createSourceFile(document.fileName, document.getText(), ts.ScriptTarget.Latest, true); + const node = findNodeAtPosition(document, sourceFile, position); + if (node && ts.isStringLiteral(node) && ts.isImportDeclaration(node.parent)) { + return node.parent; + } + return undefined; + } + + const completionProvider = new class implements vscode.CompletionItemProvider { + async provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise { + + const index = document.getText().lastIndexOf(' from \''); + if (index < 0 || document.positionAt(index).line < position.line) { + // line after last import is before position + // -> no completion, safe a parse call + return undefined; + } + + const node = findImportAt(document, position); + if (!node) { + return undefined; + } + + const range = new vscode.Range(document.positionAt(node.moduleSpecifier.pos), document.positionAt(node.moduleSpecifier.end)); + const uris = await fileIndex.all(token); + + if (!uris) { + return undefined; + } + + const result = new vscode.CompletionList(); + result.isIncomplete = true; + + for (const item of uris) { + + if (!item.path.endsWith('.ts')) { + continue; + } + + let relativePath = path.relative(path.dirname(document.uri.path), item.path); + relativePath = relativePath.startsWith('.') ? relativePath : `./${relativePath}`; + + const label = path.basename(item.path, path.extname(item.path)); + const insertText = ` '${relativePath.replace(/\.ts$/, '.js')}'`; + const filterText = ` '${label}'`; + + const completion = new vscode.CompletionItem({ + label: label, + description: vscode.workspace.asRelativePath(item), + }); + completion.kind = vscode.CompletionItemKind.File; + completion.insertText = insertText; + completion.filterText = filterText; + completion.range = range; + + result.items.push(completion); + } + + return result; + } + }; + + class ImportCodeActions implements vscode.CodeActionProvider { + + static FixKind = vscode.CodeActionKind.QuickFix.append('esmImport'); + + static SourceKind = vscode.CodeActionKind.SourceFixAll.append('esmImport'); + + async provideCodeActions(document: vscode.TextDocument, range: vscode.Range | vscode.Selection, context: vscode.CodeActionContext, token: vscode.CancellationToken): Promise { + + if (context.only && ImportCodeActions.SourceKind.intersects(context.only)) { + return this._provideFixAll(document, context, token); + } + + return this._provideFix(document, range, context, token); + } + + private async _provideFixAll(document: vscode.TextDocument, context: vscode.CodeActionContext, token: vscode.CancellationToken): Promise { + + const diagnostics = context.diagnostics + .filter(d => d.code === 2307) + .sort((a, b) => b.range.start.compareTo(a.range.start)); + + if (diagnostics.length === 0) { + return undefined; + } + + const uris = await fileIndex.all(token); + if (!uris) { + return undefined; + } + + const result = new vscode.CodeAction(`Fix All ESM Imports`, ImportCodeActions.SourceKind); + result.edit = new vscode.WorkspaceEdit(); + result.diagnostics = []; + + for (const diag of diagnostics) { + + const actions = this._provideFixesForDiag(document, diag, uris); + + if (actions.length === 0) { + console.log(`ESM: no fixes for "${diag.message}"`); + continue; + } + + if (actions.length > 1) { + console.log(`ESM: more than one fix for "${diag.message}", taking first`); + console.log(actions); + } + + const [first] = actions; + result.diagnostics.push(diag); + + for (const [uri, edits] of first.edit!.entries()) { + result.edit.set(uri, edits); + } + } + // console.log(result.edit.get(document.uri)); + return [result]; + } + + private async _provideFix(document: vscode.TextDocument, range: vscode.Range | vscode.Selection, context: vscode.CodeActionContext, token: vscode.CancellationToken): Promise { + const uris = await fileIndex.all(token); + if (!uris) { + return []; + } + + const diag = context.diagnostics.find(d => d.code === 2307 && d.range.intersection(range)); + return diag && this._provideFixesForDiag(document, diag, uris); + } + + private _provideFixesForDiag(document: vscode.TextDocument, diag: vscode.Diagnostic, uris: Iterable): vscode.CodeAction[] { + + const node = findImportAt(document, diag.range.start)?.moduleSpecifier; + if (!node || !ts.isStringLiteral(node)) { + return []; + } + + const nodeRange = new vscode.Range(document.positionAt(node.pos), document.positionAt(node.end)); + const name = path.basename(node.text, path.extname(node.text)); + + const result: vscode.CodeAction[] = []; + + for (const item of uris) { + if (path.basename(item.path, path.extname(item.path)) === name) { + let relativePath = path.relative(path.dirname(document.uri.path), item.path).replace(/\.ts$/, '.js'); + relativePath = relativePath.startsWith('.') ? relativePath : `./${relativePath}`; + + const action = new vscode.CodeAction(`Fix to '${relativePath}'`, ImportCodeActions.FixKind); + action.edit = new vscode.WorkspaceEdit(); + action.edit.replace(document.uri, nodeRange, ` '${relativePath}'`); + action.diagnostics = [diag]; + result.push(action); + } + } + + return result; + } + } + + context.subscriptions.push(fileIndex); + context.subscriptions.push(vscode.languages.registerCompletionItemProvider(selector, completionProvider)); + context.subscriptions.push(vscode.languages.registerCodeActionsProvider(selector, new ImportCodeActions(), { providedCodeActionKinds: [ImportCodeActions.FixKind, ImportCodeActions.SourceKind] })); +} diff --git a/.vscode/extensions/vscode-selfhost-import-aid/tsconfig.json b/.vscode/extensions/vscode-selfhost-import-aid/tsconfig.json new file mode 100644 index 00000000000..bbca76708ca --- /dev/null +++ b/.vscode/extensions/vscode-selfhost-import-aid/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../extensions/tsconfig.base.json", + "compilerOptions": { + "outDir": "./out", + "types": [ + "node", + "mocha", + ] + }, + "include": [ + "src/**/*", + "../../../src/vscode-dts/vscode.d.ts" + ] +} diff --git a/.vscode/extensions/vscode-selfhost-test-provider/package-lock.json b/.vscode/extensions/vscode-selfhost-test-provider/package-lock.json new file mode 100644 index 00000000000..a71a68e4e36 --- /dev/null +++ b/.vscode/extensions/vscode-selfhost-test-provider/package-lock.json @@ -0,0 +1,101 @@ +{ + "name": "vscode-selfhost-test-provider", + "version": "0.4.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vscode-selfhost-test-provider", + "version": "0.4.0", + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "ansi-styles": "^5.2.0", + "cockatiel": "^3.1.3", + "istanbul-to-vscode": "^2.0.1" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "20.x" + }, + "engines": { + "vscode": "^1.88.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==" + }, + "node_modules/@types/mocha": { + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", + "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.12.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", + "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cockatiel": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/cockatiel/-/cockatiel-3.1.3.tgz", + "integrity": "sha512-xC759TpZ69d7HhfDp8m2WkRwEUiCkxY8Ee2OQH/3H6zmy2D/5Sm+zSTbPRa+V2QyjDtpMvjOIAOVjA2gp6N1kQ==", + "engines": { + "node": ">=16" + } + }, + "node_modules/istanbul-to-vscode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/istanbul-to-vscode/-/istanbul-to-vscode-2.0.1.tgz", + "integrity": "sha512-V9Hhr7kX3UvkvkaT1lK3AmCRPkaIAIogQBrduTpNiLTkp1eVsybnJhWiDSVeCQap/3aGeZ2019oIivhX9MNsCQ==", + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.6" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/.vscode/extensions/vscode-selfhost-test-provider/package.json b/.vscode/extensions/vscode-selfhost-test-provider/package.json index f472098cd14..3548b00ba81 100644 --- a/.vscode/extensions/vscode-selfhost-test-provider/package.json +++ b/.vscode/extensions/vscode-selfhost-test-provider/package.json @@ -4,6 +4,7 @@ "description": "Test provider for the VS Code project", "enabledApiProposals": [ "testObserver", + "testRelatedCode", "attributableCoverage" ], "engines": { @@ -83,6 +84,7 @@ "dependencies": { "@jridgewell/trace-mapping": "^0.3.25", "ansi-styles": "^5.2.0", + "cockatiel": "^3.1.3", "istanbul-to-vscode": "^2.0.1" } } diff --git a/.vscode/extensions/vscode-selfhost-test-provider/src/extension.ts b/.vscode/extensions/vscode-selfhost-test-provider/src/extension.ts index 491f67ee300..2732ef3b3f6 100644 --- a/.vscode/extensions/vscode-selfhost-test-provider/src/extension.ts +++ b/.vscode/extensions/vscode-selfhost-test-provider/src/extension.ts @@ -20,6 +20,7 @@ import { itemData, } from './testTree'; import { BrowserTestRunner, PlatformTestRunner, VSCodeTestRunner } from './vscodeTestRunner'; +import { ImportGraph } from './importGraph'; const TEST_FILE_PATTERN = 'src/vs/**/*.{test,integrationTest}.ts'; @@ -51,10 +52,15 @@ export async function activate(context: vscode.ExtensionContext) { }, })); - - ctrl.resolveHandler = async test => { + let initialWatchPromise: Promise | undefined; + const resolveHandler = async (test?: vscode.TestItem) => { if (!test) { - context.subscriptions.push(await startWatchingWorkspace(ctrl, fileChangedEmitter)); + if (!initialWatchPromise) { + initialWatchPromise = startWatchingWorkspace(ctrl, fileChangedEmitter); + context.subscriptions.push(await initialWatchPromise); + } else { + await initialWatchPromise; + } return; } @@ -66,10 +72,24 @@ export async function activate(context: vscode.ExtensionContext) { } }; + ctrl.resolveHandler = resolveHandler; + guessWorkspaceFolder().then(folder => { - if (folder) { - context.subscriptions.push(new FailureTracker(context, folder.uri.fsPath)); + if (!folder) { + return; } + + const graph = new ImportGraph( + folder.uri, async () => { + await resolveHandler(); + return [...ctrl.items].map(([, item]) => item); + }, uri => ctrl.items.get(uri.toString().toLowerCase())); + ctrl.relatedCodeProvider = graph; + + context.subscriptions.push( + new FailureTracker(context, folder.uri.fsPath), + fileChangedEmitter.event(e => graph.didChange(e.uri, e.removed)), + ); }); const createRunHandler = ( diff --git a/.vscode/extensions/vscode-selfhost-test-provider/src/importGraph.ts b/.vscode/extensions/vscode-selfhost-test-provider/src/importGraph.ts new file mode 100644 index 00000000000..ab3c25720ac --- /dev/null +++ b/.vscode/extensions/vscode-selfhost-test-provider/src/importGraph.ts @@ -0,0 +1,239 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { join } from 'path'; +import * as vscode from 'vscode'; +import { bulkhead } from 'cockatiel'; +import { promises as fs } from 'fs'; + +const maxInt32 = 2 ** 31 - 1; + +// limit concurrency to avoid overwhelming the filesystem during discovery +const discoverLimiter = bulkhead(8, Infinity); + +// Max import distance when listing related code to improve relevancy. +const defaultMaxDistance = 3; + +/** + * Maintains a graph of imports in the codebase. This works lazily resolving + * imports and re-parsing files only on request. + * + * This is a rough, file-level graph derived from simple regex matching on + * source files to avoid having to parse the AST of every file in the codebase, + * which is possible but more intensive. (See: all the years of work from the + * TS language server.) + * + * A more advanced implementation could use references from the language server. + */ +export class ImportGraph implements vscode.TestRelatedCodeProvider { + private graph = new Map(); + + constructor( + private readonly root: vscode.Uri, + private readonly discoverWorkspaceTests: () => Thenable, + private readonly getTestNodeForDoc: (uri: vscode.Uri) => vscode.TestItem | undefined, + ) { } + + /** @inheritdoc */ + public async provideRelatedCode(test: vscode.TestItem, token: vscode.CancellationToken): Promise { + // this is kind of a stub for this implementation. Naive following imports + // isn't that useful for finding a test's related code. + const node = await this.discoverOutwards(test.uri, new Set(), defaultMaxDistance, token); + if (!node) { + return []; + } + + const imports = new Set(); + const queue = [{ distance: 0, next: node.imports }]; + while (queue.length) { + const { distance, next } = queue.shift()!; + for (const imp of next) { + if (imports.has(imp.path)) { + continue; + } + + imports.add(imp.path); + if (distance < defaultMaxDistance) { + queue.push({ next: imp.imports, distance: distance + 1 }); + } + } + } + + return [...imports].map(importPath => + new vscode.Location( + vscode.Uri.file(join(this.root.fsPath, 'src', `${importPath}.ts`)), + new vscode.Range(0, 0, maxInt32, 0), + ), + ); + } + + /** @inheritdoc */ + public async provideRelatedTests(document: vscode.TextDocument, _position: vscode.Position, token: vscode.CancellationToken): Promise { + // Expand all known tests to ensure imports of this file are realized. + const rootTests = await this.discoverWorkspaceTests(); + const seen = new Set(); + await Promise.all(rootTests.map(v => v.uri && this.discoverOutwards(v.uri, seen, defaultMaxDistance, token))); + + const node = this.getNode(document.uri); + if (!node) { + return []; + } + + const tests: vscode.TestItem[] = []; + const queue: { next: FileNode; distance: number }[] = [{ next: node, distance: 0 }]; + const visited = new Set(); + let maxDistance = Infinity; + + while (queue.length) { + const { next, distance } = queue.shift()!; + if (visited.has(next)) { + continue; + } + + visited.add(next); + const testForDoc = this.getTestNodeForDoc(next.uri); + if (testForDoc) { + tests.push(testForDoc); + // only look for tests half again as far away as the closest test to keep things relevant + if (!Number.isFinite(maxDistance)) { + maxDistance = distance * 3 / 2; + } + } + + if (distance < maxDistance) { + for (const importedByNode of next.importedBy) { + queue.push({ next: importedByNode, distance: distance + 1 }); + } + } + } + + return tests; + } + + public didChange(uri: vscode.Uri, deleted: boolean) { + const rel = this.uriToImportPath(uri); + const node = rel && this.graph.get(rel); + if (!node) { + return; + } + + if (deleted) { + this.graph.delete(rel); + for (const imp of node.imports) { + imp.importedBy.delete(node); + } + } else { + node.isSynced = false; + } + } + + private getNode(uri: vscode.Uri | undefined): FileNode | undefined { + const rel = this.uriToImportPath(uri); + return rel ? this.graph.get(rel) : undefined; + } + + /** Discover all nodes that import the file */ + private async discoverOutwards(uri: vscode.Uri | undefined, seen: Set, maxDistance: number, token: vscode.CancellationToken): Promise { + const rel = this.uriToImportPath(uri); + if (!rel) { + return undefined; + } + + let node = this.graph.get(rel); + if (!node) { + node = new FileNode(uri!, rel); + this.graph.set(rel, node); + } + + await this.discoverOutwardsInner(node, seen, maxDistance, token); + return node; + } + + private async discoverOutwardsInner(node: FileNode, seen: Set, maxDistance: number, token: vscode.CancellationToken) { + if (seen.has(node.path) || maxDistance === 0) { + return; + } + + seen.add(node.path); + if (node.isSynced === false) { + await this.syncNode(node); + } else if (node.isSynced instanceof Promise) { + await node.isSynced; + } + + if (token.isCancellationRequested) { + return; + } + await Promise.all([...node.imports].map(i => this.discoverOutwardsInner(i, seen, maxDistance - 1, token))); + } + + private async syncNode(node: FileNode) { + node.isSynced = discoverLimiter.execute(async () => { + const doc = vscode.workspace.textDocuments.find(d => d.uri.toString() === node.uri.toString()); + + let text: string; + if (doc) { + text = doc.getText(); + } else { + try { + text = await fs.readFile(node.uri.fsPath, 'utf8'); + } catch { + text = ''; + } + } + + for (const imp of node.imports) { + imp.importedBy.delete(node); + } + node.imports.clear(); + + for (const [, importPath] of text.matchAll(IMPORT_RE)) { + let imp = this.graph.get(importPath); + if (!imp) { + imp = new FileNode(this.importPathToUri(importPath), importPath); + this.graph.set(importPath, imp); + } + + imp.importedBy.add(node); + node.imports.add(imp); + } + + node.isSynced = true; + }); + + await node.isSynced; + } + + private uriToImportPath(uri: vscode.Uri | undefined) { + if (!uri) { + return undefined; + } + + const relativePath = vscode.workspace.asRelativePath(uri).replaceAll('\\', '/'); + if (!relativePath.startsWith('src/vs/') || !relativePath.endsWith('.ts')) { + return undefined; + } + + return relativePath.slice('src/'.length, -'.ts'.length); + } + + private importPathToUri(importPath: string) { + return vscode.Uri.file(join(this.root.fsPath, 'src', `${importPath}.ts`)); + } +} + +const IMPORT_RE = /import .*? from ["'](vs\/[^"']+)/g; + +class FileNode { + public imports = new Set(); + public importedBy = new Set(); + public isSynced: boolean | Promise = false; + + // Path is the *import path* starting with `vs/` + constructor( + public readonly uri: vscode.Uri, + public readonly path: string, + ) { } +} diff --git a/.vscode/extensions/vscode-selfhost-test-provider/src/sourceUtils.ts b/.vscode/extensions/vscode-selfhost-test-provider/src/sourceUtils.ts index 56b26cafda8..3ed21cf5810 100644 --- a/.vscode/extensions/vscode-selfhost-test-provider/src/sourceUtils.ts +++ b/.vscode/extensions/vscode-selfhost-test-provider/src/sourceUtils.ts @@ -8,6 +8,7 @@ import * as vscode from 'vscode'; import { TestCase, TestConstruct, TestSuite, VSCodeTest } from './testTree'; const suiteNames = new Set(['suite', 'flakySuite']); +const testNames = new Set(['test']); export const enum Action { Skip, @@ -19,22 +20,19 @@ export const extractTestFromNode = (src: ts.SourceFile, node: ts.Node, parent: V return Action.Recurse; } - let lhs = node.expression; - if (isSkipCall(lhs)) { + const asSuite = identifyCall(node.expression, suiteNames); + const asTest = identifyCall(node.expression, testNames); + const either = asSuite || asTest; + if (either === IdentifiedCall.Skipped) { return Action.Skip; } - - if (isPropertyCall(lhs) && lhs.name.text === 'only') { - lhs = lhs.expression; + if (either === IdentifiedCall.Nothing) { + return Action.Recurse; } const name = node.arguments[0]; const func = node.arguments[1]; - if (!name || !ts.isIdentifier(lhs) || !ts.isStringLiteralLike(name)) { - return Action.Recurse; - } - - if (!func) { + if (!name || !ts.isStringLiteralLike(name) || !func) { return Action.Recurse; } @@ -46,23 +44,45 @@ export const extractTestFromNode = (src: ts.SourceFile, node: ts.Node, parent: V ); const cparent = parent instanceof TestConstruct ? parent : undefined; - if (lhs.escapedText === 'test') { + + // we know this is either a suite or a test because we checked for skipped/nothing above + + if (asTest) { return new TestCase(name.text, range, cparent); } - if (suiteNames.has(lhs.escapedText.toString())) { + if (asSuite) { return new TestSuite(name.text, range, cparent); } - return Action.Recurse; + throw new Error('unreachable'); +}; + +const enum IdentifiedCall { + Nothing, + Skipped, + IsThing, +} + +const identifyCall = (lhs: ts.Node, needles: ReadonlySet): IdentifiedCall => { + if (ts.isIdentifier(lhs)) { + return needles.has(lhs.escapedText || lhs.text) ? IdentifiedCall.IsThing : IdentifiedCall.Nothing; + } + + if (isPropertyCall(lhs) && lhs.name.text === 'skip') { + return needles.has(lhs.expression.text) ? IdentifiedCall.Skipped : IdentifiedCall.Nothing; + } + + if (ts.isParenthesizedExpression(lhs) && ts.isConditionalExpression(lhs.expression)) { + return Math.max(identifyCall(lhs.expression.whenTrue, needles), identifyCall(lhs.expression.whenFalse, needles)); + } + + return IdentifiedCall.Nothing; }; const isPropertyCall = ( - lhs: ts.LeftHandSideExpression + lhs: ts.Node ): lhs is ts.PropertyAccessExpression & { expression: ts.Identifier; name: ts.Identifier } => ts.isPropertyAccessExpression(lhs) && ts.isIdentifier(lhs.expression) && ts.isIdentifier(lhs.name); - -const isSkipCall = (lhs: ts.LeftHandSideExpression) => - isPropertyCall(lhs) && suiteNames.has(lhs.expression.text) && lhs.name.text === 'skip'; diff --git a/.vscode/extensions/vscode-selfhost-test-provider/src/stackTraceParser.ts b/.vscode/extensions/vscode-selfhost-test-provider/src/stackTraceParser.ts new file mode 100644 index 00000000000..ca3236ce96a --- /dev/null +++ b/.vscode/extensions/vscode-selfhost-test-provider/src/stackTraceParser.ts @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +// Copied from https://github.com/microsoft/vscode-js-debug/blob/1d104b5184736677ab5cc280c70bbd227403850c/src/common/stackTraceParser.ts#L18 + +// Either match lines like +// " at fulfilled (/Users/roblou/code/testapp-node2/out/app.js:5:58)" +// or +// " at /Users/roblou/code/testapp-node2/out/app.js:60:23" +// and replace the path in them +const re1 = /^(\W*at .*\()(.*):(\d+):(\d+)(\))$/; +const re2 = /^(\W*at )(.*):(\d+):(\d+)$/; + +const getLabelRe = /^\W*at (.*) \($/; + +/** + * Parses a textual stack trace. + */ +export class StackTraceParser { + /** Gets whether the stacktrace has any locations in it. */ + public static isStackLike(str: string) { + return re1.test(str) || re2.test(str); + } + constructor(private readonly stack: string) { } + + /** Iterates over segments of text and locations in the stack. */ + *[Symbol.iterator]() { + for (const line of this.stack.split('\n')) { + const match = re1.exec(line) || re2.exec(line); + if (!match) { + yield line + '\n'; + continue; + } + + const [, prefix, url, lineNo, columnNo, suffix] = match; + if (prefix) { + yield prefix; + } + + yield new StackTraceLocation(getLabelRe.exec(prefix)?.[1], url, Number(lineNo), Number(columnNo)); + + if (suffix) { + yield suffix; + } + + yield '\n'; + } + } +} + +export class StackTraceLocation { + constructor( + public readonly label: string | undefined, + public readonly path: string, + public readonly lineBase1: number, + public readonly columnBase1: number, + ) { } +} \ No newline at end of file diff --git a/.vscode/extensions/vscode-selfhost-test-provider/src/testOutputScanner.ts b/.vscode/extensions/vscode-selfhost-test-provider/src/testOutputScanner.ts index b5a448aaba1..296ed1e9f12 100644 --- a/.vscode/extensions/vscode-selfhost-test-provider/src/testOutputScanner.ts +++ b/.vscode/extensions/vscode-selfhost-test-provider/src/testOutputScanner.ts @@ -16,6 +16,7 @@ import * as vscode from 'vscode'; import { istanbulCoverageContext, PerTestCoverageTracker } from './coverageProvider'; import { attachTestMessageMetadata } from './metadata'; import { snapshotComment } from './snapshot'; +import { StackTraceLocation, StackTraceParser } from './stackTraceParser'; import { StreamSplitter } from './streamSplitter'; import { getContentFromFilesystem } from './testTree'; import { IScriptCoverage } from './v8CoverageWrangling'; @@ -288,7 +289,7 @@ export async function scanTestOutput( enqueueExitBlocker( (async () => { - const location = await tryDeriveStackLocation(store, rawErr, tcase!); + const stackInfo = await deriveStackLocations(store, rawErr, tcase!); let message: vscode.TestMessage; if (hasDiff) { @@ -310,7 +311,8 @@ export async function scanTestOutput( ); } - message.location = location ?? testFirstLine; + message.location = stackInfo.primary ?? testFirstLine; + message.stackTrace = stackInfo.stack; task.failed(tcase!, message, duration); })() ); @@ -608,44 +610,38 @@ async function replaceAllLocations(store: SourceMapStore, str: string) { return values.join(''); } -async function tryDeriveStackLocation( +async function deriveStackLocations( store: SourceMapStore, stack: string, tcase: vscode.TestItem ) { locationRe.lastIndex = 0; - return new Promise(resolve => { - const matches = [...stack.matchAll(locationRe)]; - let todo = matches.length; - if (todo === 0) { - return resolve(undefined); + const locationsRaw = [...new StackTraceParser(stack)].filter(t => t instanceof StackTraceLocation); + const locationsMapped = await Promise.all(locationsRaw.map(async location => { + const mapped = location.path.startsWith('file:') ? await store.getSourceLocation(location.path, location.lineBase1 - 1, location.columnBase1 - 1) : undefined; + const stack = new vscode.TestMessageStackFrame(location.label || '', mapped?.uri, mapped?.range.start || new vscode.Position(location.lineBase1 - 1, location.columnBase1 - 1)); + return { location: mapped, stack }; + })); + + let best: undefined | { location: vscode.Location; score: number }; + for (const { location } of locationsMapped) { + if (!location) { + continue; } - - let best: undefined | { location: vscode.Location; i: number; score: number }; - for (const [i, match] of matches.entries()) { - deriveSourceLocation(store, match) - .catch(() => undefined) - .then(location => { - if (location) { - let score = 0; - if (tcase.uri && tcase.uri.toString() === location.uri.toString()) { - score = 1; - if (tcase.range && tcase.range.contains(location?.range)) { - score = 2; - } - } - if (!best || score > best.score || (score === best.score && i < best.i)) { - best = { location, i, score }; - } - } - - if (!--todo) { - resolve(best?.location); - } - }); + let score = 0; + if (tcase.uri && tcase.uri.toString() === location.uri.toString()) { + score = 1; + if (tcase.range && tcase.range.contains(location?.range)) { + score = 2; + } + } + if (!best || score > best.score) { + best = { location, score }; } - }); + } + + return { stack: locationsMapped.map(s => s.stack), primary: best?.location }; } async function deriveSourceLocation(store: SourceMapStore, parts: RegExpMatchArray) { @@ -661,4 +657,4 @@ function findLastIndex(arr: T[], predicate: (value: T) => boolean) { } return -1; -} \ No newline at end of file +} diff --git a/.vscode/extensions/vscode-selfhost-test-provider/src/vscodeTestRunner.ts b/.vscode/extensions/vscode-selfhost-test-provider/src/vscodeTestRunner.ts index 954b847f4a8..b5ffd440b33 100644 --- a/.vscode/extensions/vscode-selfhost-test-provider/src/vscodeTestRunner.ts +++ b/.vscode/extensions/vscode-selfhost-test-provider/src/vscodeTestRunner.ts @@ -63,7 +63,7 @@ export abstract class VSCodeTestRunner { const cp = spawn(await this.binaryPath(), args, { cwd: this.repoLocation.uri.fsPath, stdio: 'pipe', - env: this.getEnvironment(), + env: this.getEnvironment(port), }); // Register a descriptor factory that signals the server when any @@ -139,7 +139,7 @@ export abstract class VSCodeTestRunner { }); } - protected getEnvironment(): NodeJS.ProcessEnv { + protected getEnvironment(_remoteDebugPort?: number): NodeJS.ProcessEnv { return { ...process.env, ELECTRON_RUN_AS_NODE: undefined, @@ -261,9 +261,10 @@ export class BrowserTestRunner extends VSCodeTestRunner { } /** @override */ - protected override getEnvironment() { + protected override getEnvironment(remoteDebugPort?: number) { return { - ...super.getEnvironment(), + ...super.getEnvironment(remoteDebugPort), + PLAYWRIGHT_CHROMIUM_DEBUG_PORT: remoteDebugPort ? String(remoteDebugPort) : undefined, ELECTRON_RUN_AS_NODE: '1', }; } diff --git a/.vscode/extensions/vscode-selfhost-test-provider/tsconfig.json b/.vscode/extensions/vscode-selfhost-test-provider/tsconfig.json index 9725e14041e..56d6859c3e3 100644 --- a/.vscode/extensions/vscode-selfhost-test-provider/tsconfig.json +++ b/.vscode/extensions/vscode-selfhost-test-provider/tsconfig.json @@ -11,6 +11,7 @@ "src/**/*", "../../../src/vscode-dts/vscode.d.ts", "../../../src/vscode-dts/vscode.proposed.testObserver.d.ts", + "../../../src/vscode-dts/vscode.proposed.testRelatedCode.d.ts", "../../../src/vscode-dts/vscode.proposed.attributableCoverage.d.ts" ] } diff --git a/.vscode/extensions/vscode-selfhost-test-provider/yarn.lock b/.vscode/extensions/vscode-selfhost-test-provider/yarn.lock deleted file mode 100644 index 50478f52c73..00000000000 --- a/.vscode/extensions/vscode-selfhost-test-provider/yarn.lock +++ /dev/null @@ -1,55 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@jridgewell/resolve-uri@^3.1.0": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" - integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== - -"@jridgewell/sourcemap-codec@^1.4.14": - version "1.4.15" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" - integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== - -"@jridgewell/trace-mapping@^0.3.25": - version "0.3.25" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - -"@types/istanbul-lib-coverage@^2.0.6": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" - integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== - -"@types/mocha@^10.0.6": - version "10.0.6" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.6.tgz#818551d39113081048bdddbef96701b4e8bb9d1b" - integrity sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg== - -"@types/node@20.x": - version "20.12.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.11.tgz#c4ef00d3507000d17690643278a60dc55a9dc9be" - integrity sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw== - dependencies: - undici-types "~5.26.4" - -ansi-styles@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - -istanbul-to-vscode@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/istanbul-to-vscode/-/istanbul-to-vscode-2.0.1.tgz#84994d06e604b68cac7301840f338b1e74eb888b" - integrity sha512-V9Hhr7kX3UvkvkaT1lK3AmCRPkaIAIogQBrduTpNiLTkp1eVsybnJhWiDSVeCQap/3aGeZ2019oIivhX9MNsCQ== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.6" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/.vscode/notebooks/api.github-issues b/.vscode/notebooks/api.github-issues index 957ce5a9ee0..6b6a41f5135 100644 --- a/.vscode/notebooks/api.github-issues +++ b/.vscode/notebooks/api.github-issues @@ -7,7 +7,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPO=repo:microsoft/vscode\n$MILESTONE=milestone:\"June 2024\"" + "value": "$REPO=repo:microsoft/vscode\n$MILESTONE=milestone:\"September 2024\"" }, { "kind": 1, diff --git a/.vscode/notebooks/endgame.github-issues b/.vscode/notebooks/endgame.github-issues index d7836922bad..450ba41835f 100644 --- a/.vscode/notebooks/endgame.github-issues +++ b/.vscode/notebooks/endgame.github-issues @@ -7,7 +7,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS=repo:microsoft/lsprotocol repo:microsoft/monaco-editor repo:microsoft/vscode repo:microsoft/vscode-anycode repo:microsoft/vscode-autopep8 repo:microsoft/vscode-black-formatter repo:microsoft/vscode-copilot repo:microsoft/vscode-copilot-release repo:microsoft/vscode-dev repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-flake8 repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-hexeditor repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-isort repo:microsoft/vscode-js-debug repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-l10n repo:microsoft/vscode-livepreview repo:microsoft/vscode-markdown-languageservice repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-mypy repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-pylint repo:microsoft/vscode-python repo:microsoft/vscode-python-debugger repo:microsoft/vscode-python-tools-extension-template repo:microsoft/vscode-references-view repo:microsoft/vscode-remote-release repo:microsoft/vscode-remote-repositories-github repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-unpkg repo:microsoft/vscode-vsce\n\n$MILESTONE=milestone:\"May 2024\"" + "value": "$REPOS=repo:microsoft/lsprotocol repo:microsoft/monaco-editor repo:microsoft/vscode repo:microsoft/vscode-anycode repo:microsoft/vscode-autopep8 repo:microsoft/vscode-black-formatter repo:microsoft/vscode-copilot repo:microsoft/vscode-copilot-release repo:microsoft/vscode-dev repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-flake8 repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-hexeditor repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-isort repo:microsoft/vscode-js-debug repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-l10n repo:microsoft/vscode-livepreview repo:microsoft/vscode-markdown-languageservice repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-mypy repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-pylint repo:microsoft/vscode-python repo:microsoft/vscode-python-debugger repo:microsoft/vscode-python-tools-extension-template repo:microsoft/vscode-references-view repo:microsoft/vscode-remote-release repo:microsoft/vscode-remote-repositories-github repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-unpkg repo:microsoft/vscode-vsce\n\n$MILESTONE=milestone:\"August 2024\"" }, { "kind": 1, @@ -32,7 +32,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS -$MILESTONE is:issue is:closed reason:completed label:bug label:insiders-released -label:verified -label:*duplicate -label:*as-designed -label:z-author-verified -label:on-testplan" + "value": "$REPOS -$MILESTONE is:issue is:closed reason:completed label:bug label:insiders-released -label:verified -label:*duplicate -label:*as-designed -label:z-author-verified -label:on-testplan -label:error-telemetry" }, { "kind": 1, diff --git a/.vscode/notebooks/my-endgame.github-issues b/.vscode/notebooks/my-endgame.github-issues index ce02ecfa577..df0f8a92998 100644 --- a/.vscode/notebooks/my-endgame.github-issues +++ b/.vscode/notebooks/my-endgame.github-issues @@ -7,7 +7,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS=repo:microsoft/lsprotocol repo:microsoft/monaco-editor repo:microsoft/vscode repo:microsoft/vscode-anycode repo:microsoft/vscode-autopep8 repo:microsoft/vscode-black-formatter repo:microsoft/vscode-copilot repo:microsoft/vscode-copilot-release repo:microsoft/vscode-dev repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-flake8 repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-hexeditor repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-isort repo:microsoft/vscode-js-debug repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-l10n repo:microsoft/vscode-livepreview repo:microsoft/vscode-markdown-languageservice repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-mypy repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-pylint repo:microsoft/vscode-python repo:microsoft/vscode-python-debugger repo:microsoft/vscode-python-tools-extension-template repo:microsoft/vscode-references-view repo:microsoft/vscode-remote-release repo:microsoft/vscode-remote-repositories-github repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-unpkg repo:microsoft/vscode-vsce\n\n$MILESTONE=milestone:\"June 2024\"\n\n$MINE=assignee:@me" + "value": "$REPOS=repo:microsoft/lsprotocol repo:microsoft/monaco-editor repo:microsoft/vscode repo:microsoft/vscode-anycode repo:microsoft/vscode-autopep8 repo:microsoft/vscode-black-formatter repo:microsoft/vscode-copilot repo:microsoft/vscode-copilot-release repo:microsoft/vscode-dev repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-flake8 repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-hexeditor repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-isort repo:microsoft/vscode-js-debug repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-l10n repo:microsoft/vscode-livepreview repo:microsoft/vscode-markdown-languageservice repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-mypy repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-pylint repo:microsoft/vscode-python repo:microsoft/vscode-python-debugger repo:microsoft/vscode-python-tools-extension-template repo:microsoft/vscode-references-view repo:microsoft/vscode-remote-release repo:microsoft/vscode-remote-repositories-github repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-unpkg repo:microsoft/vscode-vsce\n\n$MILESTONE=milestone:\"August 2024\"\n\n$MINE=assignee:@me" }, { "kind": 1, @@ -157,7 +157,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS $MILESTONE -$MINE is:issue is:closed reason:completed sort:updated-asc label:bug -label:unreleased -label:verified -label:z-author-verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:*out-of-scope -label:error-telemetry -label:verification-steps-needed -label:verification-found -author:aeschli -author:alexdima -author:alexr00 -author:AmandaSilver -author:andreamah -author:bamurtaugh -author:bpasero -author:chrisdias -author:chrmarti -author:Chuxel -author:claudiaregio -author:connor4312 -author:dbaeumer -author:deepak1556 -author:devinvalenciano -author:digitarald -author:DonJayamanne -author:egamma -author:fiveisprime -author:gregvanl -author:hediet -author:isidorn -author:joaomoreno -author:joyceerhl -author:jrieken -author:kieferrm -author:lramos15 -author:lszomoru -author:meganrogge -author:misolori -author:mjbvz -author:rebornix -author:roblourens -author:rzhao271 -author:sandy081 -author:sbatten -author:stevencl -author:tanhakabir -author:TylerLeonhardt -author:Tyriar -author:weinand -author:amunger -author:karthiknadig -author:eleanorjboyd -author:Yoyokrazy -author:paulacamargo25 -author:ulugbekna -author:aiday-mar -author:daviddossett -author:bhavyaus -author:justschen -author:benibenj -author:luabud" + "value": "$REPOS $MILESTONE -$MINE is:issue is:closed reason:completed sort:updated-asc label:bug -label:unreleased -label:verified -label:z-author-verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:*out-of-scope -label:error-telemetry -label:verification-steps-needed -label:verification-found -author:aeschli -author:alexdima -author:alexr00 -author:AmandaSilver -author:andreamah -author:bamurtaugh -author:bpasero -author:chrisdias -author:chrmarti -author:Chuxel -author:claudiaregio -author:connor4312 -author:dbaeumer -author:deepak1556 -author:devinvalenciano -author:digitarald -author:DonJayamanne -author:egamma -author:fiveisprime -author:gregvanl -author:hediet -author:isidorn -author:joaomoreno -author:joyceerhl -author:jrieken -author:kieferrm -author:lramos15 -author:lszomoru -author:meganrogge -author:misolori -author:mjbvz -author:rebornix -author:roblourens -author:rzhao271 -author:sandy081 -author:sbatten -author:stevencl -author:tanhakabir -author:TylerLeonhardt -author:Tyriar -author:weinand -author:amunger -author:karthiknadig -author:eleanorjboyd -author:Yoyokrazy -author:paulacamargo25 -author:ulugbekna -author:aiday-mar -author:daviddossett -author:bhavyaus -author:justschen -author:benibenj -author:luabud -author:anthonykim1 -author:joshspicer" }, { "kind": 1, diff --git a/.vscode/notebooks/my-work.github-issues b/.vscode/notebooks/my-work.github-issues index 27fc3c2ecb5..5f54a2e5d91 100644 --- a/.vscode/notebooks/my-work.github-issues +++ b/.vscode/notebooks/my-work.github-issues @@ -7,7 +7,7 @@ { "kind": 2, "language": "github-issues", - "value": "// list of repos we work in\n$REPOS=repo:microsoft/lsprotocol repo:microsoft/monaco-editor repo:microsoft/vscode repo:microsoft/vscode-anycode repo:microsoft/vscode-autopep8 repo:microsoft/vscode-black-formatter repo:microsoft/vscode-copilot repo:microsoft/vscode-copilot-release repo:microsoft/vscode-dev repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-flake8 repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-hexeditor repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-isort repo:microsoft/vscode-js-debug repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-l10n repo:microsoft/vscode-livepreview repo:microsoft/vscode-markdown-languageservice repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-mypy repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-pylint repo:microsoft/vscode-python repo:microsoft/vscode-python-debugger repo:microsoft/vscode-python-tools-extension-template repo:microsoft/vscode-references-view repo:microsoft/vscode-remote-release repo:microsoft/vscode-remote-repositories-github repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-unpkg repo:microsoft/vscode-vsce\n\n// current milestone name\n$MILESTONE=milestone:\"June 2024\"\n" + "value": "// list of repos we work in\n$REPOS=repo:microsoft/lsprotocol repo:microsoft/monaco-editor repo:microsoft/vscode repo:microsoft/vscode-anycode repo:microsoft/vscode-autopep8 repo:microsoft/vscode-black-formatter repo:microsoft/vscode-copilot repo:microsoft/vscode-copilot-release repo:microsoft/vscode-dev repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-flake8 repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-hexeditor repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-isort repo:microsoft/vscode-js-debug repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-l10n repo:microsoft/vscode-livepreview repo:microsoft/vscode-markdown-languageservice repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-mypy repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-pylint repo:microsoft/vscode-python repo:microsoft/vscode-python-debugger repo:microsoft/vscode-python-tools-extension-template repo:microsoft/vscode-references-view repo:microsoft/vscode-remote-release repo:microsoft/vscode-remote-repositories-github repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-unpkg repo:microsoft/vscode-vsce\n\n// current milestone name\n$MILESTONE=milestone:\"September 2024\"\n" }, { "kind": 1, diff --git a/.vscode/notebooks/vscode-dev.github-issues b/.vscode/notebooks/vscode-dev.github-issues index 53fad82e6d9..db480b64bd8 100644 --- a/.vscode/notebooks/vscode-dev.github-issues +++ b/.vscode/notebooks/vscode-dev.github-issues @@ -2,7 +2,7 @@ { "kind": 2, "language": "github-issues", - "value": "$milestone=milestone:\"November 2023\"" + "value": "$milestone=milestone:\"August 2024\"" }, { "kind": 1, diff --git a/.vscode/settings.json b/.vscode/settings.json index ef93d2deda1..d2abaca7005 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -32,16 +32,17 @@ "src/vs/base/test/common/filters.perf.data.js": true, "src/vs/base/test/node/uri.perf.data.txt": true, "src/vs/workbench/api/test/browser/extHostDocumentData.test.perf-data.ts": true, + "src/vs/base/test/node/uri.test.data.txt": true, "src/vs/editor/test/node/diffing/fixtures/**": true, + "build/loader.min": true }, "files.readonlyInclude": { "**/node_modules/**/*.*": true, "**/yarn.lock": true, + "**/package-lock.json": true, "**/Cargo.lock": true, "src/vs/workbench/workbench.web.main.css": true, "src/vs/workbench/workbench.desktop.main.css": true, - "src/vs/workbench/workbench.desktop.main.nls.js": true, - "src/vs/workbench/workbench.web.main.nls.js": true, "build/**/*.js": true, "out/**": true, "out-build/**": true, @@ -52,6 +53,7 @@ "test/smoke/out/**": true, "test/automation/out/**": true, "test/integration/browser/out/**": true, + "src2/**": true, }, "files.readonlyExclude": { "build/builtin/*.js": true, @@ -74,9 +76,8 @@ ], "typescript.tsdk": "node_modules/typescript/lib", "npm.exclude": "**/extensions/**", - "npm.packageManager": "yarn", "emmet.excludeLanguages": [], - "typescript.preferences.importModuleSpecifier": "non-relative", + "typescript.preferences.importModuleSpecifier": "relative", "typescript.preferences.quoteStyle": "single", "json.schemas": [ { @@ -162,14 +163,12 @@ "@xterm/headless", "node-pty", "vscode-notebook-renderer", - "src/vs/workbench/workbench.web.main.ts", - "src/vs/workbench/api/common/extHostTypes.ts" + "src/vs/workbench/workbench.web.main.internal.ts" ], "[github-issues]": { "editor.wordWrap": "on" }, "css.format.spaceAroundSelectorSeparator": true, - "inlineChat.mode": "live", - "inlineChat.experimental.textButtons": true, - "typescript.enablePromptUseWorkspaceTsdk": true + "typescript.enablePromptUseWorkspaceTsdk": true, + "inlineChat.experimental.onlyZoneWidget": true } diff --git a/.vscode/shared.code-snippets b/.vscode/shared.code-snippets index f473425b76f..ba36a9f5fcb 100644 --- a/.vscode/shared.code-snippets +++ b/.vscode/shared.code-snippets @@ -36,5 +36,23 @@ "private readonly _onDid$1 = new Emitter<$2>();", "readonly onDid$1: Event<$2> = this._onDid$1.event;" ], + }, + "esm-comment": { + "scope": "typescript,javascript", + "prefix": "esm-comment", + "body": [ + "// ESM-comment-begin", + "$SELECTION$0", + "// ESM-comment-end", + ] + }, + "esm-uncomment": { + "scope": "typescript,javascript", + "prefix": "esm-uncomment", + "body": [ + "// ESM-uncomment-begin", + "// $SELECTION$0", + "// ESM-uncomment-end", + ] } } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 666edb3fb2c..3bcb5d5c6fc 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -113,7 +113,7 @@ "problemMatcher": [] }, { - "label": "Kill VS Code - Build, Yarn, VS Code - Build", + "label": "Kill VS Code - Build, Npm, VS Code - Build", "dependsOn": [ "Kill VS Code - Build", "npm: install", diff --git a/.yarnrc b/.yarnrc deleted file mode 100644 index b153fa4724f..00000000000 --- a/.yarnrc +++ /dev/null @@ -1,5 +0,0 @@ -disturl "https://electronjs.org/headers" -target "29.4.0" -ms_build_id "9728852" -runtime "electron" -build_from_source "true" diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 2e3f2610f46..664f2b00049 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -263,6 +263,34 @@ suitability for any purpose. --------------------------------------------------------- +cacheable-request 7.0.4 - MIT + + +Copyright (c) cacheable-request authors + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +--------------------------------------------------------- + +--------------------------------------------------------- + Colorsublime-Themes 0.1.0 https://github.com/Colorsublime/Colorsublime-Themes @@ -517,7 +545,7 @@ to the base-name name of the original file, and an extension of txt, html, or si --------------------------------------------------------- -go-syntax 0.6.6 - MIT +go-syntax 0.7.5 - MIT https://github.com/worlpaker/go-syntax MIT License @@ -833,7 +861,7 @@ SOFTWARE. --------------------------------------------------------- -jlelong/vscode-latex-basics 1.7.0 - MIT +jlelong/vscode-latex-basics 1.9.0 - MIT https://github.com/jlelong/vscode-latex-basics Copyright (c) vscode-latex-basics authors @@ -890,7 +918,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -JuliaEditorSupport/atom-language-julia 0.22.1 - MIT +JuliaEditorSupport/atom-language-julia 0.23.0 - MIT https://github.com/JuliaEditorSupport/atom-language-julia The atom-language-julia package is licensed under the MIT "Expat" License: @@ -1241,7 +1269,7 @@ THE SOFTWARE. --------------------------------------------------------- -marked 4.1.0 - MIT +marked 14.0.0 - MIT https://github.com/markedjs/marked information @@ -1506,6 +1534,22 @@ SOFTWARE. --------------------------------------------------------- +RedCMD/YAML-Syntax-Highlighter 1.1.1 - MIT +https://github.com/RedCMD/YAML-Syntax-Highlighter + +MIT License + +Copyright 2024 RedCMD + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +--------------------------------------------------------- + +--------------------------------------------------------- + redhat-developer/vscode-java 1.26.0 - MIT https://github.com/redhat-developer/vscode-java @@ -1928,31 +1972,6 @@ to the base-name name of the original file, and an extension of txt, html, or si --------------------------------------------------------- -textmate/yaml.tmbundle 0.0.0 - TextMate Bundle License -https://github.com/textmate/yaml.tmbundle - -Copyright (c) 2015 FichteFoll - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------------------------------------------------------- - ---------------------------------------------------------- - trond-snekvik/vscode-rst 1.5.3 - MIT https://github.com/trond-snekvik/vscode-rst diff --git a/build/.cachesalt b/build/.cachesalt index 4a19f329eb1..3c6029dc2f4 100644 --- a/build/.cachesalt +++ b/build/.cachesalt @@ -1 +1 @@ -2024-05-25T03:29:59.419Z +2024-09-04T10:21:29.952Z diff --git a/build/.gitignore b/build/.gitignore index 7cc357379e5..61cf49cb9a1 100644 --- a/build/.gitignore +++ b/build/.gitignore @@ -1,2 +1 @@ -.yarnrc *.js.map diff --git a/build/.moduleignore b/build/.moduleignore index 32fb3bd21c5..026c0d3b51d 100644 --- a/build/.moduleignore +++ b/build/.moduleignore @@ -96,10 +96,13 @@ node-pty/lib/*.test.js node-pty/tools/** node-pty/deps/** node-pty/scripts/** +node-pty/third_party/** !node-pty/build/Release/spawn-helper !node-pty/build/Release/*.exe !node-pty/build/Release/*.dll !node-pty/build/Release/*.node +!node-pty/build/Release/conpty/conpty.dll +!node-pty/build/Release/conpty/OpenConsole.exe @parcel/watcher/binding.gyp @parcel/watcher/build/** @@ -107,6 +110,12 @@ node-pty/scripts/** @parcel/watcher/src/** !@parcel/watcher/build/Release/*.node +@bpasero/watcher/binding.gyp +@bpasero/watcher/build/** +@bpasero/watcher/prebuilds/** +@bpasero/watcher/src/** +!@bpasero/watcher/build/Release/*.node + vsda/build/** vsda/ci/** vsda/src/** @@ -160,7 +169,7 @@ typescript/lib/tsserverlibrary.js jschardet/index.js jschardet/src/** -jschardet/dist/jschardet.js +# TODO@esm uncomment when we can use jschardet.min.js again jschardet/dist/jschardet.js es6-promise/lib/** diff --git a/build/.npmrc b/build/.npmrc new file mode 100644 index 00000000000..1b073e71a83 --- /dev/null +++ b/build/.npmrc @@ -0,0 +1,5 @@ +disturl="https://nodejs.org/dist" +runtime="node" +build_from_source="true" +legacy-peer-deps="true" +timeout=180000 diff --git a/build/.webignore b/build/.webignore index 15935edce8a..837366b67f7 100644 --- a/build/.webignore +++ b/build/.webignore @@ -14,7 +14,7 @@ jschardet/index.js jschardet/src/** -jschardet/dist/jschardet.js +# TODO@esm uncomment when we can use jschardet.min.js again jschardet/dist/jschardet.js vscode-textmate/webpack.config.js @@ -38,6 +38,7 @@ vscode-textmate/webpack.config.js # This makes sure the model is included in the package !@vscode/vscode-languagedetection/model/** +!@vscode/tree-sitter-wasm/wasm/** # Ensure only the required telemetry pieces are loaded in web to reduce bundle size @microsoft/1ds-core-js/** @@ -45,7 +46,9 @@ vscode-textmate/webpack.config.js @microsoft/applicationinsights-core-js/** @microsoft/applicationinsights-shims/** !@microsoft/1ds-core-js/dist/ms.core.min.js +!@microsoft/1ds-core-js/bundle/ms.core.min.js !@microsoft/1ds-post-js/dist/ms.post.min.js +!@microsoft/1ds-post-js/bundle/ms.post.min.js !@microsoft/applicationinsights-core-js/browser/applicationinsights-core-js.min.js !@microsoft/applicationinsights-shims/dist/umd/applicationinsights-shims.min.js diff --git a/build/azure-pipelines/alpine/cli-build-alpine.yml b/build/azure-pipelines/alpine/cli-build-alpine.yml index a6442dfe290..07321ebcd97 100644 --- a/build/azure-pipelines/alpine/cli-build-alpine.yml +++ b/build/azure-pipelines/alpine/cli-build-alpine.yml @@ -19,17 +19,9 @@ steps: nodejsMirror: https://github.com/joaomoreno/node-mirror/releases/download - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - # Install yarn as the ARM64 build agent is using vanilla Ubuntu - - ${{ if eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true) }}: - - task: Npm@1 - displayName: Install yarn - inputs: - command: custom - customCommand: install --global yarn - - script: | set -e - yarn --frozen-lockfile --ignore-optional + npm ci workingDirectory: build displayName: Install pipeline build diff --git a/build/azure-pipelines/alpine/product-build-alpine.yml b/build/azure-pipelines/alpine/product-build-alpine.yml index 2c55132a9f9..077ec0ba11b 100644 --- a/build/azure-pipelines/alpine/product-build-alpine.yml +++ b/build/azure-pipelines/alpine/product-build-alpine.yml @@ -7,7 +7,7 @@ steps: - template: ../distro/download-distro.yml@self - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" @@ -27,12 +27,12 @@ steps: condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Registry - - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js alpine $VSCODE_ARCH > .build/yarnlockhash + - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js alpine $VSCODE_ARCH > .build/packagelockhash displayName: Prepare node_modules cache key - task: Cache@2 inputs: - key: '"node_modules" | .build/yarnlockhash' + key: '"node_modules" | .build/packagelockhash' path: .build/node_modules_cache cacheHitVar: NODE_MODULES_RESTORED displayName: Restore node_modules cache @@ -43,18 +43,17 @@ steps: - script: | set -e - npm config set registry "$NPM_REGISTRY" --location=project - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - echo "always-auth=true" >> .npmrc - yarn config set registry "$NPM_REGISTRY" + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + npm config set registry "$NPM_REGISTRY" + echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)" condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: .npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication @@ -75,12 +74,12 @@ steps: - script: | set -e for i in {1..5}; do # try 5 times - yarn --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done env: npm_config_arch: $(NPM_ARCH) @@ -89,7 +88,7 @@ steps: GITHUB_TOKEN: "$(github-distro-mixin-password)" VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME: vscodehub.azurecr.io/vscode-linux-build-agent:alpine-$(VSCODE_ARCH) VSCODE_HOST_MOUNT: "/mnt/vss/_work/1/s" - displayName: Install build dependencies + displayName: Install dependencies condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true')) - script: node build/azure-pipelines/distro/mixin-npm @@ -112,7 +111,7 @@ steps: - script: | set -e TARGET=$([ "$VSCODE_ARCH" == "x64" ] && echo "linux-alpine" || echo "alpine-arm64") # TODO@joaomoreno - yarn gulp vscode-reh-$TARGET-min-ci + npm run gulp vscode-reh-$TARGET-min-ci (cd .. && mv vscode-reh-$TARGET vscode-server-$TARGET) # TODO@joaomoreno ARCHIVE_PATH=".build/linux/server/vscode-server-$TARGET.tar.gz" DIR_PATH="$(realpath ../vscode-server-$TARGET)" @@ -127,7 +126,7 @@ steps: - script: | set -e TARGET=$([ "$VSCODE_ARCH" == "x64" ] && echo "linux-alpine" || echo "alpine-arm64") - yarn gulp vscode-reh-web-$TARGET-min-ci + npm run gulp vscode-reh-web-$TARGET-min-ci (cd .. && mv vscode-reh-web-$TARGET vscode-server-$TARGET-web) # TODO@joaomoreno ARCHIVE_PATH=".build/linux/web/vscode-server-$TARGET-web.tar.gz" DIR_PATH="$(realpath ../vscode-server-$TARGET-web)" diff --git a/build/azure-pipelines/cli/cli-compile.yml b/build/azure-pipelines/cli/cli-compile.yml index 267682f7f6d..e77ba78a999 100644 --- a/build/azure-pipelines/cli/cli-compile.yml +++ b/build/azure-pipelines/cli/cli-compile.yml @@ -49,16 +49,22 @@ steps: export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER="$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc" export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C link-arg=--sysroot=$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/sysroot" export CC_aarch64_unknown_linux_gnu="$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc --sysroot=$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/sysroot" + export PKG_CONFIG_LIBDIR_aarch64_unknown_linux_gnu="$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/sysroot/usr/lib/aarch64-linux-gnu/pkgconfig:$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/sysroot/usr/share/pkgconfig" + export PKG_CONFIG_SYSROOT_DIR_aarch64_unknown_linux_gnu="$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/sysroot" export OBJDUMP="$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/bin/objdump" elif [ "$SYSROOT_ARCH" == "amd64" ]; then export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER="$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/bin/x86_64-linux-gnu-gcc" export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C link-arg=--sysroot=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot -C link-arg=-L$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/usr/lib/x86_64-linux-gnu" export CC_x86_64_unknown_linux_gnu="$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/bin/x86_64-linux-gnu-gcc --sysroot=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot" + export PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu="$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/usr/lib/x86_64-linux-gnu/pkgconfig:$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/usr/share/pkgconfig" + export PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu="$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot" export OBJDUMP="$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/bin/objdump" elif [ "$SYSROOT_ARCH" == "armhf" ]; then export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER="$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc" export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS="-C link-arg=--sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot" export CC_armv7_unknown_linux_gnueabihf="$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc --sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot" + export PKG_CONFIG_LIBDIR_armv7_unknown_linux_gnueabihf="$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot/usr/lib/arm-rpi-linux-gnueabihf/pkgconfig:$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot/usr/share/pkgconfig" + export PKG_CONFIG_SYSROOT_DIR_armv7_unknown_linux_gnueabihf="$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot" export OBJDUMP="$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/bin/objdump" fi fi @@ -78,7 +84,7 @@ steps: fi done < <("$OBJDUMP" -T "$PWD/target/${{ parameters.VSCODE_CLI_TARGET }}/release/code") if [[ "$glibc_version" != "2.17" ]]; then - echo "Error: binary has dependency on GLIBC > 2.17" + echo "Error: binary has dependency on GLIBC > 2.17, found $glibc_version" exit 1 fi fi diff --git a/build/azure-pipelines/cli/cli-darwin-sign.yml b/build/azure-pipelines/cli/cli-darwin-sign.yml index 75a8235ff3a..b6dc424d690 100644 --- a/build/azure-pipelines/cli/cli-darwin-sign.yml +++ b/build/azure-pipelines/cli/cli-darwin-sign.yml @@ -4,7 +4,7 @@ parameters: default: [] steps: - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" diff --git a/build/azure-pipelines/cli/cli-win32-sign.yml b/build/azure-pipelines/cli/cli-win32-sign.yml index f8d11e806f2..e39df13c998 100644 --- a/build/azure-pipelines/cli/cli-win32-sign.yml +++ b/build/azure-pipelines/cli/cli-win32-sign.yml @@ -4,7 +4,7 @@ parameters: default: [] steps: - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" diff --git a/build/azure-pipelines/cli/install-rust-posix.yml b/build/azure-pipelines/cli/install-rust-posix.yml index 89867143938..fee56e028f7 100644 --- a/build/azure-pipelines/cli/install-rust-posix.yml +++ b/build/azure-pipelines/cli/install-rust-posix.yml @@ -1,7 +1,7 @@ parameters: - name: channel type: string - default: 1.77 + default: 1.81 - name: targets default: [] type: object diff --git a/build/azure-pipelines/cli/install-rust-win32.yml b/build/azure-pipelines/cli/install-rust-win32.yml index 22fba8d7f6a..45a1cfd188e 100644 --- a/build/azure-pipelines/cli/install-rust-win32.yml +++ b/build/azure-pipelines/cli/install-rust-win32.yml @@ -1,7 +1,7 @@ parameters: - name: channel type: string - default: 1.77 + default: 1.81 - name: targets default: [] type: object diff --git a/build/azure-pipelines/common/computeNodeModulesCacheKey.js b/build/azure-pipelines/common/computeNodeModulesCacheKey.js index fe84d03e1d7..976e096fad2 100644 --- a/build/azure-pipelines/common/computeNodeModulesCacheKey.js +++ b/build/azure-pipelines/common/computeNodeModulesCacheKey.js @@ -11,9 +11,10 @@ const { dirs } = require('../../npm/dirs'); const ROOT = path.join(__dirname, '../../../'); const shasum = crypto.createHash('sha256'); shasum.update(fs.readFileSync(path.join(ROOT, 'build/.cachesalt'))); -shasum.update(fs.readFileSync(path.join(ROOT, '.yarnrc'))); -shasum.update(fs.readFileSync(path.join(ROOT, 'remote/.yarnrc'))); -// Add `package.json` and `yarn.lock` files +shasum.update(fs.readFileSync(path.join(ROOT, '.npmrc'))); +shasum.update(fs.readFileSync(path.join(ROOT, 'build', '.npmrc'))); +shasum.update(fs.readFileSync(path.join(ROOT, 'remote', '.npmrc'))); +// Add `package.json` and `package-lock.json` files for (const dir of dirs) { const packageJsonPath = path.join(ROOT, dir, 'package.json'); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString()); @@ -25,8 +26,8 @@ for (const dir of dirs) { distro: packageJson.distro }; shasum.update(JSON.stringify(relevantPackageJsonSections)); - const yarnLockPath = path.join(ROOT, dir, 'yarn.lock'); - shasum.update(fs.readFileSync(yarnLockPath)); + const packageLockPath = path.join(ROOT, dir, 'package-lock.json'); + shasum.update(fs.readFileSync(packageLockPath)); } // Add any other command line arguments for (let i = 2; i < process.argv.length; i++) { diff --git a/build/azure-pipelines/common/computeNodeModulesCacheKey.ts b/build/azure-pipelines/common/computeNodeModulesCacheKey.ts index 16bf76796f9..0940c929b54 100644 --- a/build/azure-pipelines/common/computeNodeModulesCacheKey.ts +++ b/build/azure-pipelines/common/computeNodeModulesCacheKey.ts @@ -13,10 +13,11 @@ const ROOT = path.join(__dirname, '../../../'); const shasum = crypto.createHash('sha256'); shasum.update(fs.readFileSync(path.join(ROOT, 'build/.cachesalt'))); -shasum.update(fs.readFileSync(path.join(ROOT, '.yarnrc'))); -shasum.update(fs.readFileSync(path.join(ROOT, 'remote/.yarnrc'))); +shasum.update(fs.readFileSync(path.join(ROOT, '.npmrc'))); +shasum.update(fs.readFileSync(path.join(ROOT, 'build', '.npmrc'))); +shasum.update(fs.readFileSync(path.join(ROOT, 'remote', '.npmrc'))); -// Add `package.json` and `yarn.lock` files +// Add `package.json` and `package-lock.json` files for (const dir of dirs) { const packageJsonPath = path.join(ROOT, dir, 'package.json'); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString()); @@ -29,8 +30,8 @@ for (const dir of dirs) { }; shasum.update(JSON.stringify(relevantPackageJsonSections)); - const yarnLockPath = path.join(ROOT, dir, 'yarn.lock'); - shasum.update(fs.readFileSync(yarnLockPath)); + const packageLockPath = path.join(ROOT, dir, 'package-lock.json'); + shasum.update(fs.readFileSync(packageLockPath)); } // Add any other command line arguments diff --git a/build/azure-pipelines/common/publish.js b/build/azure-pipelines/common/publish.js index c990e3a7146..aa185ed8369 100644 --- a/build/azure-pipelines/common/publish.js +++ b/build/azure-pipelines/common/publish.js @@ -389,14 +389,8 @@ function getPlatform(product, os, arch, type, isLegacy) { } } case 'server': - if (arch === 'arm64') { - throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`); - } return `server-win32-${arch}`; case 'web': - if (arch === 'arm64') { - throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`); - } return `server-win32-${arch}-web`; case 'cli': return `cli-win32-${arch}`; diff --git a/build/azure-pipelines/common/publish.ts b/build/azure-pipelines/common/publish.ts index 75065ffa2d3..652cd168335 100644 --- a/build/azure-pipelines/common/publish.ts +++ b/build/azure-pipelines/common/publish.ts @@ -550,14 +550,8 @@ function getPlatform(product: string, os: string, arch: string, type: string, is } } case 'server': - if (arch === 'arm64') { - throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`); - } return `server-win32-${arch}`; case 'web': - if (arch === 'arm64') { - throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`); - } return `server-win32-${arch}-web`; case 'cli': return `cli-win32-${arch}`; diff --git a/build/azure-pipelines/darwin/helper-plugin-entitlements.plist b/build/azure-pipelines/darwin/helper-plugin-entitlements.plist index 1cc1a152c74..48f7bf5cece 100644 --- a/build/azure-pipelines/darwin/helper-plugin-entitlements.plist +++ b/build/azure-pipelines/darwin/helper-plugin-entitlements.plist @@ -6,8 +6,6 @@ com.apple.security.cs.allow-unsigned-executable-memory - com.apple.security.cs.allow-dyld-environment-variables - com.apple.security.cs.disable-library-validation diff --git a/build/azure-pipelines/darwin/product-build-darwin-cli-sign.yml b/build/azure-pipelines/darwin/product-build-darwin-cli-sign.yml index 80e90a52bac..32615c58463 100644 --- a/build/azure-pipelines/darwin/product-build-darwin-cli-sign.yml +++ b/build/azure-pipelines/darwin/product-build-darwin-cli-sign.yml @@ -17,31 +17,30 @@ steps: - script: | set -e - npm config set registry "$NPM_REGISTRY" --location=project - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - echo "always-auth=true" >> .npmrc - yarn config set registry "$NPM_REGISTRY" - workingDirectory: build + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + npm config set registry "$NPM_REGISTRY" + echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)" condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: build/.npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication - script: | set -e + for i in {1..5}; do # try 5 times - yarn --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done workingDirectory: build displayName: Install build dependencies diff --git a/build/azure-pipelines/darwin/product-build-darwin-sign.yml b/build/azure-pipelines/darwin/product-build-darwin-sign.yml index fb8cf8341c3..82a1e89f2ab 100644 --- a/build/azure-pipelines/darwin/product-build-darwin-sign.yml +++ b/build/azure-pipelines/darwin/product-build-darwin-sign.yml @@ -13,7 +13,7 @@ steps: continueOnError: true displayName: Download ESRPClient - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" diff --git a/build/azure-pipelines/darwin/product-build-darwin-test.yml b/build/azure-pipelines/darwin/product-build-darwin-test.yml index ed6d0236516..937d9d70c3e 100644 --- a/build/azure-pipelines/darwin/product-build-darwin-test.yml +++ b/build/azure-pipelines/darwin/product-build-darwin-test.yml @@ -7,9 +7,12 @@ parameters: type: boolean - name: VSCODE_RUN_SMOKE_TESTS type: boolean + - name: VSCODE_BUILD_AMD + type: boolean + default: false steps: - - script: yarn npm-run-all -lp "electron $(VSCODE_ARCH)" "playwright-install" + - script: npm exec -- npm-run-all -lp "electron $(VSCODE_ARCH)" "playwright-install" env: GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Download Electron and Playwright @@ -17,39 +20,61 @@ steps: - ${{ if eq(parameters.VSCODE_RUN_UNIT_TESTS, true) }}: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - script: ./scripts/test.sh --tfs "Unit Tests" - displayName: Run unit tests (Electron) - timeoutInMinutes: 15 - - - script: yarn test-node - displayName: Run unit tests (node.js) - timeoutInMinutes: 15 - - - script: yarn test-browser-no-install --sequential --browser chromium --browser webkit --tfs "Browser Unit Tests" - env: - DEBUG: "*browser*" - displayName: Run unit tests (Browser, Chromium & Webkit) - timeoutInMinutes: 30 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - script: ./scripts/test-amd.sh --tfs "Unit Tests" + displayName: Run unit tests (Electron) [AMD] + timeoutInMinutes: 15 + - script: npm run test-node-amd + displayName: Run unit tests (node.js) [AMD] + timeoutInMinutes: 15 + - script: npm run test-browser-amd-no-install -- --sequential --browser chromium --browser webkit --tfs "Browser Unit Tests" + env: + DEBUG: "*browser*" + displayName: Run unit tests (Browser, Chromium & Webkit) [AMD] + timeoutInMinutes: 30 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - script: ./scripts/test.sh --tfs "Unit Tests" + displayName: Run unit tests (Electron) + timeoutInMinutes: 15 + - script: npm run test-node + displayName: Run unit tests (node.js) + timeoutInMinutes: 15 + - script: npm run test-browser-no-install -- --sequential --browser chromium --browser webkit --tfs "Browser Unit Tests" + env: + DEBUG: "*browser*" + displayName: Run unit tests (Browser, Chromium & Webkit) + timeoutInMinutes: 30 - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - - script: ./scripts/test.sh --build --tfs "Unit Tests" - displayName: Run unit tests (Electron) - timeoutInMinutes: 15 - - - script: yarn test-node --build - displayName: Run unit tests (node.js) - timeoutInMinutes: 15 - - - script: yarn test-browser-no-install --sequential --build --browser chromium --browser webkit --tfs "Browser Unit Tests" - env: - DEBUG: "*browser*" - displayName: Run unit tests (Browser, Chromium & Webkit) - timeoutInMinutes: 30 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - script: ./scripts/test-amd.sh --build --tfs "Unit Tests" + displayName: Run unit tests (Electron) [AMD] + timeoutInMinutes: 15 + - script: npm run test-node-amd -- --build + displayName: Run unit tests (node.js) [AMD] + timeoutInMinutes: 15 + - script: npm run test-browser-amd-no-install -- --sequential --build --browser chromium --browser webkit --tfs "Browser Unit Tests" + env: + DEBUG: "*browser*" + displayName: Run unit tests (Browser, Chromium & Webkit) [AMD] + timeoutInMinutes: 30 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - script: ./scripts/test.sh --build --tfs "Unit Tests" + displayName: Run unit tests (Electron) + timeoutInMinutes: 15 + - script: npm run test-node -- --build + displayName: Run unit tests (node.js) + timeoutInMinutes: 15 + - script: npm run test-browser-no-install -- --sequential --build --browser chromium --browser webkit --tfs "Browser Unit Tests" + env: + DEBUG: "*browser*" + displayName: Run unit tests (Browser, Chromium & Webkit) + timeoutInMinutes: 30 - ${{ if eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true) }}: - script: | set -e - yarn gulp \ + npm run gulp \ compile-extension:configuration-editing \ compile-extension:css-language-features-server \ compile-extension:emmet \ @@ -59,7 +84,6 @@ steps: compile-extension:ipynb \ compile-extension:notebook-renderers \ compile-extension:json-language-features-server \ - compile-extension:markdown-language-features-server \ compile-extension:markdown-language-features \ compile-extension-media \ compile-extension:microsoft-authentication \ @@ -70,24 +94,44 @@ steps: displayName: Build integration tests - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - script: ./scripts/test-integration.sh --tfs "Integration Tests" - displayName: Run integration tests (Electron) - timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - script: ./scripts/test-integration-amd.sh --tfs "Integration Tests" + displayName: Run integration tests (Electron) [AMD] + timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - script: ./scripts/test-integration --tfs "Integration Tests" + displayName: Run integration tests (Electron) + timeoutInMinutes: 20 - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - - script: | - # Figure out the full absolute path of the product we just built - # including the remote server and configure the integration tests - # to run with these builds instead of running out of sources. - set -e - APP_ROOT="$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)" - APP_NAME="`ls $APP_ROOT | head -n 1`" - INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \ - ./scripts/test-integration.sh --build --tfs "Integration Tests" - env: - VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH) - displayName: Run integration tests (Electron) - timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - script: | + # Figure out the full absolute path of the product we just built + # including the remote server and configure the integration tests + # to run with these builds instead of running out of sources. + set -e + APP_ROOT="$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)" + APP_NAME="`ls $APP_ROOT | head -n 1`" + INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \ + ./scripts/test-integration-amd.sh --build --tfs "Integration Tests" + env: + VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH) + displayName: Run integration tests (Electron) [AMD] + timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - script: | + # Figure out the full absolute path of the product we just built + # including the remote server and configure the integration tests + # to run with these builds instead of running out of sources. + set -e + APP_ROOT="$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)" + APP_NAME="`ls $APP_ROOT | head -n 1`" + INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \ + ./scripts/test-integration.sh --build --tfs "Integration Tests" + env: + VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH) + displayName: Run integration tests (Electron) + timeoutInMinutes: 20 - script: ./scripts/test-web-integration.sh --browser webkit env: @@ -113,13 +157,14 @@ steps: condition: succeededOrFailed() - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - script: yarn --cwd test/smoke compile + - script: npm run compile + workingDirectory: test/smoke displayName: Compile smoke tests - - script: yarn gulp compile-extension-media + - script: npm run gulp compile-extension-media displayName: Compile extensions for smoke tests - - script: yarn smoketest-no-compile --tracing + - script: npm run smoketest-no-compile -- --tracing timeoutInMinutes: 20 displayName: Run smoke tests (Electron) @@ -128,11 +173,11 @@ steps: set -e APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH) APP_NAME="`ls $APP_ROOT | head -n 1`" - yarn smoketest-no-compile --tracing --build "$APP_ROOT/$APP_NAME" + npm run smoketest-no-compile -- --tracing --build "$APP_ROOT/$APP_NAME" timeoutInMinutes: 20 displayName: Run smoke tests (Electron) - - script: yarn smoketest-no-compile --web --tracing --headless + - script: npm run smoketest-no-compile -- --web --tracing --headless env: VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)-web timeoutInMinutes: 20 @@ -140,10 +185,10 @@ steps: - script: | set -e - yarn gulp compile-extension:vscode-test-resolver + npm run gulp compile-extension:vscode-test-resolver APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH) APP_NAME="`ls $APP_ROOT | head -n 1`" - yarn smoketest-no-compile --tracing --remote --build "$APP_ROOT/$APP_NAME" + npm run smoketest-no-compile -- --tracing --remote --build "$APP_ROOT/$APP_NAME" env: VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH) timeoutInMinutes: 20 diff --git a/build/azure-pipelines/darwin/product-build-darwin-universal.yml b/build/azure-pipelines/darwin/product-build-darwin-universal.yml index f8b201f40d4..f8c10a03cec 100644 --- a/build/azure-pipelines/darwin/product-build-darwin-universal.yml +++ b/build/azure-pipelines/darwin/product-build-darwin-universal.yml @@ -7,7 +7,7 @@ steps: - template: ../distro/download-distro.yml@self - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" @@ -20,31 +20,30 @@ steps: - script: | set -e - npm config set registry "$NPM_REGISTRY" --location=project - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - echo "always-auth=true" >> .npmrc - yarn config set registry "$NPM_REGISTRY" - workingDirectory: build + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + npm config set registry "$NPM_REGISTRY" + echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)" condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: build/.npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication - script: | set -e + for i in {1..5}; do # try 5 times - yarn --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done workingDirectory: build displayName: Install build dependencies diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index 8b4bda1c6a2..a76ab27b520 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -9,6 +9,9 @@ parameters: type: boolean - name: VSCODE_RUN_SMOKE_TESTS type: boolean + - name: VSCODE_BUILD_AMD + type: boolean + default: false steps: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: @@ -25,7 +28,7 @@ steps: - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - template: ../distro/download-distro.yml@self - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" @@ -45,12 +48,12 @@ steps: condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Registry - - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js darwin $VSCODE_ARCH > .build/yarnlockhash + - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js darwin $VSCODE_ARCH > .build/packagelockhash displayName: Prepare node_modules cache key - task: Cache@2 inputs: - key: '"node_modules" | .build/yarnlockhash' + key: '"node_modules" | .build/packagelockhash' path: .build/node_modules_cache cacheHitVar: NODE_MODULES_RESTORED displayName: Restore node_modules cache @@ -61,38 +64,50 @@ steps: - script: | set -e - npm config set registry "$NPM_REGISTRY" --location=project - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - echo "always-auth=true" >> .npmrc - yarn config set registry "$NPM_REGISTRY" + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + npm config set registry "$NPM_REGISTRY" + echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)" condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: .npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication - script: | set -e + # Refs https://github.com/microsoft/vscode/issues/219893#issuecomment-2209313109 + sudo xcode-select --switch /Applications/Xcode_15.2.app + condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true')) + displayName: Switch to Xcode >= 15.1 + + - script: | + set -e + c++ --version python3 -m pip install setuptools for i in {1..5}; do # try 5 times - yarn --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done env: npm_config_arch: $(VSCODE_ARCH) ELECTRON_SKIP_BINARY_DOWNLOAD: 1 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 GITHUB_TOKEN: "$(github-distro-mixin-password)" + # Avoid using dlopen to load Kerberos on macOS which can cause missing libraries + # https://github.com/mongodb-js/kerberos/commit/04044d2814ad1d01e77f1ce87f26b03d86692cf2 + # flipped the default to support legacy linux distros which shouldn't happen + # on macOS. + GYP_DEFINES: "kerberos_use_rtld=false" displayName: Install dependencies condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true')) @@ -118,7 +133,7 @@ steps: - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - script: | set -e - yarn gulp vscode-darwin-$(VSCODE_ARCH)-min-ci + npm run gulp vscode-darwin-$(VSCODE_ARCH)-min-ci echo "##vso[task.setvariable variable=BUILT_CLIENT]true" env: GITHUB_TOKEN: "$(github-distro-mixin-password)" @@ -126,7 +141,7 @@ steps: - script: | set -e - yarn gulp vscode-reh-darwin-$(VSCODE_ARCH)-min-ci + npm run gulp vscode-reh-darwin-$(VSCODE_ARCH)-min-ci mv ../vscode-reh-darwin-$(VSCODE_ARCH) ../vscode-server-darwin-$(VSCODE_ARCH) # TODO@joaomoreno ARCHIVE_PATH=".build/darwin/server/vscode-server-darwin-$(VSCODE_ARCH).zip" mkdir -p $(dirname $ARCHIVE_PATH) @@ -138,7 +153,7 @@ steps: - script: | set -e - yarn gulp vscode-reh-web-darwin-$(VSCODE_ARCH)-min-ci + npm run gulp vscode-reh-web-darwin-$(VSCODE_ARCH)-min-ci mv ../vscode-reh-web-darwin-$(VSCODE_ARCH) ../vscode-server-darwin-$(VSCODE_ARCH)-web # TODO@joaomoreno ARCHIVE_PATH=".build/darwin/server/vscode-server-darwin-$(VSCODE_ARCH)-web.zip" mkdir -p $(dirname $ARCHIVE_PATH) @@ -149,7 +164,7 @@ steps: displayName: Build server (web) - ${{ else }}: - - script: yarn gulp transpile-client-swc transpile-extensions + - script: npm run gulp transpile-client-swc transpile-extensions env: GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Transpile @@ -161,6 +176,7 @@ steps: VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }} VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }} VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }} + VSCODE_BUILD_AMD: ${{ parameters.VSCODE_BUILD_AMD }} - ${{ elseif and(ne(parameters.VSCODE_CIBUILD, true), ne(parameters.VSCODE_QUALITY, 'oss')) }}: - task: DownloadPipelineArtifact@2 diff --git a/build/azure-pipelines/distro/download-distro.yml b/build/azure-pipelines/distro/download-distro.yml index a703992aab2..92325762a60 100644 --- a/build/azure-pipelines/distro/download-distro.yml +++ b/build/azure-pipelines/distro/download-distro.yml @@ -1,5 +1,5 @@ steps: - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" @@ -51,6 +51,5 @@ steps: unzip $ArchivePath -d .build mv .build/microsoft-vscode-distro-$DistroVersion .build/distro - cp remote/.yarnrc .build/distro/npm/remote/.yarnrc condition: and(succeeded(), not(contains(variables['Agent.OS'], 'windows'))) displayName: Download distro (non-Windows) diff --git a/build/azure-pipelines/linux/apt-retry.sh b/build/azure-pipelines/linux/apt-retry.sh new file mode 100755 index 00000000000..358f34cd308 --- /dev/null +++ b/build/azure-pipelines/linux/apt-retry.sh @@ -0,0 +1,42 @@ +#!/bin/sh +################################################################################ +## Copied from https://github.com/actions/runner-images/blob/ubuntu22/20240825.1/images/ubuntu/scripts/build/configure-apt-mock.sh +################################################################################ + +i=1 +while [ $i -le 30 ];do + err=$(mktemp) + "$@" 2>$err + + # no errors, break the loop and continue normal flow + test -f $err || break + cat $err >&2 + + retry=false + + if grep -q 'Could not get lock' $err;then + # apt db locked needs retry + retry=true + elif grep -q 'Could not open file /var/lib/apt/lists' $err;then + # apt update is not completed, needs retry + retry=true + elif grep -q 'IPC connect call failed' $err;then + # the delay should help with gpg-agent not ready + retry=true + elif grep -q 'Temporary failure in name resolution' $err;then + # It looks like DNS is not updated with random generated hostname yet + retry=true + elif grep -q 'dpkg frontend is locked by another process' $err;then + # dpkg process is busy by another process + retry=true + fi + + rm $err + if [ $retry = false ]; then + break + fi + + sleep 5 + echo "...retry $i" + i=$((i + 1)) +done diff --git a/build/azure-pipelines/linux/cli-build-linux.yml b/build/azure-pipelines/linux/cli-build-linux.yml index f3e2ef88b9d..89bc8a39e24 100644 --- a/build/azure-pipelines/linux/cli-build-linux.yml +++ b/build/azure-pipelines/linux/cli-build-linux.yml @@ -40,24 +40,23 @@ steps: displayName: Extract openssl prebuilt - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - - script: node build/setup-npm-registry.js $NPM_REGISTRY + - script: node build/setup-npm-registry.js $NPM_REGISTRY build condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Registry - script: | set -e - npm config set registry "$NPM_REGISTRY" --location=project - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - echo "always-auth=true" >> .npmrc - yarn config set registry "$NPM_REGISTRY" + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + npm config set registry "$NPM_REGISTRY" + echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)" condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: .npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication @@ -65,13 +64,14 @@ steps: set -e for i in {1..5}; do # try 5 times - yarn --cwd build --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done + workingDirectory: build displayName: Install build dependencies - script: | diff --git a/build/azure-pipelines/linux/product-build-linux-legacy-server.yml b/build/azure-pipelines/linux/product-build-linux-legacy-server.yml index 921bf2a9370..ce9d71a5290 100644 --- a/build/azure-pipelines/linux/product-build-linux-legacy-server.yml +++ b/build/azure-pipelines/linux/product-build-linux-legacy-server.yml @@ -5,6 +5,9 @@ parameters: type: boolean - name: VSCODE_ARCH type: string + - name: VSCODE_BUILD_AMD + type: boolean + default: false steps: - task: NodeTool@0 @@ -15,7 +18,7 @@ steps: - template: ../distro/download-distro.yml - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" @@ -34,8 +37,8 @@ steps: - script: | set -e # Start X server - sudo apt-get update - sudo apt-get install -y pkg-config \ + ./build/azure-pipelines/linux/apt-retry.sh sudo apt-get update + ./build/azure-pipelines/linux/apt-retry.sh sudo apt-get install -y pkg-config \ dbus \ xvfb \ libgtk-3-0 \ @@ -59,18 +62,17 @@ steps: - script: | set -e - npm config set registry "$NPM_REGISTRY" --location=project - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - echo "always-auth=true" >> .npmrc - yarn config set registry "$NPM_REGISTRY" + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + npm config set registry "$NPM_REGISTRY" + echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)" condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: .npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication @@ -84,40 +86,33 @@ steps: imageName: vscode-linux-build-agent:centos7-devtoolset8-$(VSCODE_ARCH) containerCommand: uname - - ${{ if eq(parameters.VSCODE_ARCH, 'armhf') }}: - - task: Docker@1 - displayName: "Pull Docker image" - inputs: - azureSubscriptionEndpoint: "vscode-builds-subscription" - azureContainerRegistry: vscodehub.azurecr.io - command: "Run an image" - imageName: vscode-linux-build-agent:bionic-arm32v7 - containerCommand: uname - - script: | set -e - # To workaround the issue of yarn not respecting the registry value from .npmrc - yarn config set registry "$NPM_REGISTRY" for i in {1..5}; do # try 5 times - yarn --cwd build --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done + workingDirectory: build + displayName: Install build dependencies + + - script: | + set -e export VSCODE_SYSROOT_PREFIX='-glibc-2.17' source ./build/azure-pipelines/linux/setup-env.sh --only-remote for i in {1..5}; do # try 5 times - yarn --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done env: npm_config_arch: $(NPM_ARCH) @@ -129,8 +124,6 @@ steps: VSCODE_HOST_MOUNT: "/mnt/vss/_work/1/s" ${{ if or(eq(parameters.VSCODE_ARCH, 'x64'), eq(parameters.VSCODE_ARCH, 'arm64')) }}: VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME: vscodehub.azurecr.io/vscode-linux-build-agent:centos7-devtoolset8-$(VSCODE_ARCH) - ${{ if eq(parameters.VSCODE_ARCH, 'armhf') }}: - VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME: vscodehub.azurecr.io/vscode-linux-build-agent:bionic-arm32v7 displayName: Install dependencies - script: node build/azure-pipelines/distro/mixin-npm @@ -143,7 +136,7 @@ steps: - script: | set -e - yarn gulp vscode-linux-$(VSCODE_ARCH)-min-ci + npm run gulp vscode-linux-$(VSCODE_ARCH)-min-ci ARCHIVE_PATH=".build/linux/client/code-${{ parameters.VSCODE_QUALITY }}-$(VSCODE_ARCH)-$(date +%s).tar.gz" mkdir -p $(dirname $ARCHIVE_PATH) echo "##vso[task.setvariable variable=CLIENT_PATH]$ARCHIVE_PATH" @@ -161,7 +154,7 @@ steps: - script: | set -e export VSCODE_NODE_GLIBC="-glibc-2.17" - yarn gulp vscode-reh-linux-$(VSCODE_ARCH)-min-ci + npm run gulp vscode-reh-linux-$(VSCODE_ARCH)-min-ci mv ../vscode-reh-linux-$(VSCODE_ARCH) ../vscode-server-linux-$(VSCODE_ARCH) # TODO@joaomoreno ARCHIVE_PATH=".build/linux/server/vscode-server-linux-legacy-$(VSCODE_ARCH).tar.gz" UNARCHIVE_PATH="`pwd`/../vscode-server-linux-$(VSCODE_ARCH)" @@ -176,7 +169,7 @@ steps: - script: | set -e export VSCODE_NODE_GLIBC="-glibc-2.17" - yarn gulp vscode-reh-web-linux-$(VSCODE_ARCH)-min-ci + npm run gulp vscode-reh-web-linux-$(VSCODE_ARCH)-min-ci mv ../vscode-reh-web-linux-$(VSCODE_ARCH) ../vscode-server-linux-$(VSCODE_ARCH)-web # TODO@joaomoreno ARCHIVE_PATH=".build/linux/web/vscode-server-linux-legacy-$(VSCODE_ARCH)-web.tar.gz" mkdir -p $(dirname $ARCHIVE_PATH) @@ -199,7 +192,7 @@ steps: - ${{ else }}: - script: | set -e - EXPECTED_GLIBC_VERSION="2.28" \ + EXPECTED_GLIBC_VERSION="2.17" \ EXPECTED_GLIBCXX_VERSION="3.4.22" \ ./build/azure-pipelines/linux/verify-glibc-requirements.sh env: @@ -213,6 +206,7 @@ steps: VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }} VSCODE_RUN_SMOKE_TESTS: false + VSCODE_BUILD_AMD: ${{ parameters.VSCODE_BUILD_AMD }} ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1 diff --git a/build/azure-pipelines/linux/product-build-linux-test.yml b/build/azure-pipelines/linux/product-build-linux-test.yml index f5c00aa0cf0..2443e2b1299 100644 --- a/build/azure-pipelines/linux/product-build-linux-test.yml +++ b/build/azure-pipelines/linux/product-build-linux-test.yml @@ -10,9 +10,12 @@ parameters: - name: PUBLISH_TASK_NAME type: string default: PublishPipelineArtifact@0 + - name: VSCODE_BUILD_AMD + type: boolean + default: false steps: - - script: yarn npm-run-all -lp "electron $(VSCODE_ARCH)" "playwright-install" + - script: npm exec -- npm-run-all -lp "electron $(VSCODE_ARCH)" "playwright-install" env: GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Download Electron and Playwright @@ -33,41 +36,66 @@ steps: - ${{ if eq(parameters.VSCODE_RUN_UNIT_TESTS, true) }}: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - script: ./scripts/test.sh --tfs "Unit Tests" - env: - DISPLAY: ":10" - displayName: Run unit tests (Electron) - timeoutInMinutes: 15 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - script: ./scripts/test-amd.sh --tfs "Unit Tests" + env: + DISPLAY: ":10" + displayName: Run unit tests (Electron) [AMD] + timeoutInMinutes: 15 + - script: npm run test-node-amd + displayName: Run unit tests (node.js) [AMD] + timeoutInMinutes: 15 + - script: npm run test-browser-amd-no-install -- --browser chromium --tfs "Browser Unit Tests" + env: + DEBUG: "*browser*" + displayName: Run unit tests (Browser, Chromium) [AMD] + timeoutInMinutes: 15 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - script: ./scripts/test.sh --tfs "Unit Tests" + env: + DISPLAY: ":10" + displayName: Run unit tests (Electron) + timeoutInMinutes: 15 + - script: npm run test-node + displayName: Run unit tests (node.js) + timeoutInMinutes: 15 + - script: npm run test-browser-no-install -- --browser chromium --tfs "Browser Unit Tests" + env: + DEBUG: "*browser*" + displayName: Run unit tests (Browser, Chromium) + timeoutInMinutes: 15 - - script: yarn test-node - displayName: Run unit tests (node.js) - timeoutInMinutes: 15 - - - script: yarn test-browser-no-install --browser chromium --tfs "Browser Unit Tests" - env: - DEBUG: "*browser*" - displayName: Run unit tests (Browser, Chromium) - timeoutInMinutes: 15 - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - - script: ./scripts/test.sh --build --tfs "Unit Tests" - displayName: Run unit tests (Electron) - timeoutInMinutes: 15 - - - script: yarn test-node --build - displayName: Run unit tests (node.js) - timeoutInMinutes: 15 - - - script: yarn test-browser-no-install --build --browser chromium --tfs "Browser Unit Tests" - env: - DEBUG: "*browser*" - displayName: Run unit tests (Browser, Chromium) - timeoutInMinutes: 15 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - script: ./scripts/test-amd.sh --build --tfs "Unit Tests" + displayName: Run unit tests (Electron) [AMD] + timeoutInMinutes: 15 + - script: npm run test-node-amd -- --build + displayName: Run unit tests (node.js) [AMD] + timeoutInMinutes: 15 + - script: npm run test-browser-amd-no-install -- --build --browser chromium --tfs "Browser Unit Tests" + env: + DEBUG: "*browser*" + displayName: Run unit tests (Browser, Chromium) [AMD] + timeoutInMinutes: 15 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - script: ./scripts/test.sh --build --tfs "Unit Tests" + displayName: Run unit tests (Electron) + timeoutInMinutes: 15 + - script: npm run test-node -- --build + displayName: Run unit tests (node.js) + timeoutInMinutes: 15 + - script: npm run test-browser-no-install -- --build --browser chromium --tfs "Browser Unit Tests" + env: + DEBUG: "*browser*" + displayName: Run unit tests (Browser, Chromium) + timeoutInMinutes: 15 - ${{ if eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true) }}: - script: | set -e - yarn gulp \ + npm run gulp \ compile-extension:configuration-editing \ compile-extension:css-language-features-server \ compile-extension:emmet \ @@ -77,7 +105,6 @@ steps: compile-extension:ipynb \ compile-extension:notebook-renderers \ compile-extension:json-language-features-server \ - compile-extension:markdown-language-features-server \ compile-extension:markdown-language-features \ compile-extension-media \ compile-extension:microsoft-authentication \ @@ -89,11 +116,18 @@ steps: - ${{ if eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true) }}: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - script: ./scripts/test-integration.sh --tfs "Integration Tests" - env: - DISPLAY: ":10" - displayName: Run integration tests (Electron) - timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - script: ./scripts/test-integration-amd.sh --tfs "Integration Tests" + env: + DISPLAY: ":10" + displayName: Run integration tests (Electron) [AMD] + timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - script: ./scripts/test-integration.sh --tfs "Integration Tests" + env: + DISPLAY: ":10" + displayName: Run integration tests (Electron) + timeoutInMinutes: 20 - script: ./scripts/test-web-integration.sh --browser chromium displayName: Run integration tests (Browser, Chromium) @@ -104,20 +138,36 @@ steps: timeoutInMinutes: 20 - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - - script: | - # Figure out the full absolute path of the product we just built - # including the remote server and configure the integration tests - # to run with these builds instead of running out of sources. - set -e - APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH) - APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName") - INTEGRATION_TEST_APP_NAME="$APP_NAME" \ - INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \ - ./scripts/test-integration.sh --build --tfs "Integration Tests" - env: - VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH) - displayName: Run integration tests (Electron) - timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - script: | + # Figure out the full absolute path of the product we just built + # including the remote server and configure the integration tests + # to run with these builds instead of running out of sources. + set -e + APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH) + APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName") + INTEGRATION_TEST_APP_NAME="$APP_NAME" \ + INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \ + ./scripts/test-integration-amd.sh --build --tfs "Integration Tests" + env: + VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH) + displayName: Run integration tests (Electron) [AMD] + timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - script: | + # Figure out the full absolute path of the product we just built + # including the remote server and configure the integration tests + # to run with these builds instead of running out of sources. + set -e + APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH) + APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName") + INTEGRATION_TEST_APP_NAME="$APP_NAME" \ + INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \ + ./scripts/test-integration.sh --build --tfs "Integration Tests" + env: + VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH) + displayName: Run integration tests (Electron) + timeoutInMinutes: 20 - script: ./scripts/test-web-integration.sh --browser chromium env: @@ -148,34 +198,35 @@ steps: condition: succeededOrFailed() - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - script: yarn --cwd test/smoke compile + - script: npm run compile + workingDirectory: test/smoke displayName: Compile smoke tests - - script: yarn gulp compile-extension:markdown-language-features compile-extension-media compile-extension:vscode-test-resolver + - script: npm run gulp compile-extension:markdown-language-features compile-extension:ipynb compile-extension-media compile-extension:vscode-test-resolver displayName: Build extensions for smoke tests - - script: yarn gulp node + - script: npm run gulp node displayName: Download node.js for remote smoke tests retryCountOnTaskFailure: 3 - - script: yarn smoketest-no-compile --tracing + - script: npm run smoketest-no-compile -- --tracing timeoutInMinutes: 20 displayName: Run smoke tests (Electron) - - script: yarn smoketest-no-compile --web --tracing --headless --electronArgs="--disable-dev-shm-usage" + - script: npm run smoketest-no-compile -- --web --tracing --headless --electronArgs="--disable-dev-shm-usage" timeoutInMinutes: 20 displayName: Run smoke tests (Browser, Chromium) - - script: yarn smoketest-no-compile --remote --tracing + - script: npm run smoketest-no-compile -- --remote --tracing timeoutInMinutes: 20 displayName: Run smoke tests (Remote) - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - - script: yarn smoketest-no-compile --tracing --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)" + - script: npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)" timeoutInMinutes: 20 displayName: Run smoke tests (Electron) - - script: yarn smoketest-no-compile --web --tracing --headless --electronArgs="--disable-dev-shm-usage" + - script: npm run smoketest-no-compile -- --web --tracing --headless --electronArgs="--disable-dev-shm-usage" env: VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)-web timeoutInMinutes: 20 @@ -183,10 +234,10 @@ steps: - script: | set -e - yarn gulp compile-extension:vscode-test-resolver + npm run gulp compile-extension:vscode-test-resolver APP_PATH=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH) VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)" \ - yarn smoketest-no-compile --tracing --remote --build "$APP_PATH" + npm run smoketest-no-compile -- --tracing --remote --build "$APP_PATH" timeoutInMinutes: 20 displayName: Run smoke tests (Remote) diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index d1d6bdb9191..3f53731b70a 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -11,6 +11,9 @@ parameters: type: boolean - name: VSCODE_ARCH type: string + - name: VSCODE_BUILD_AMD + type: boolean + default: false steps: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: @@ -27,7 +30,7 @@ steps: - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - template: ../distro/download-distro.yml@self - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" @@ -46,8 +49,8 @@ steps: - script: | set -e # Start X server - sudo apt-get update - sudo apt-get install -y pkg-config \ + ./build/azure-pipelines/linux/apt-retry.sh sudo apt-get update + ./build/azure-pipelines/linux/apt-retry.sh sudo apt-get install -y pkg-config \ dbus \ xvfb \ libgtk-3-0 \ @@ -69,12 +72,12 @@ steps: condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Registry - - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js linux $VSCODE_ARCH > .build/yarnlockhash + - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js linux $VSCODE_ARCH > .build/packagelockhash displayName: Prepare node_modules cache key - task: Cache@2 inputs: - key: '"node_modules" | .build/yarnlockhash' + key: '"node_modules" | .build/packagelockhash' path: .build/node_modules_cache cacheHitVar: NODE_MODULES_RESTORED displayName: Restore node_modules cache @@ -85,18 +88,17 @@ steps: - script: | set -e - npm config set registry "$NPM_REGISTRY" --location=project - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - echo "always-auth=true" >> .npmrc - yarn config set registry "$NPM_REGISTRY" + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + npm config set registry "$NPM_REGISTRY" + echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)" condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: .npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication @@ -104,23 +106,44 @@ steps: set -e for i in {1..5}; do # try 5 times - yarn --cwd build --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done + workingDirectory: build + displayName: Install build dependencies + condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true')) + + # Step will be used by both Install dependencies and building rpm package, + # hence avoid adding it behind NODE_MODULES_RESTORED condition. + - script: | + set -e + SYSROOT_ARCH=$VSCODE_ARCH + if [ "$SYSROOT_ARCH" == "x64" ]; then + SYSROOT_ARCH="amd64" + fi + export VSCODE_SYSROOT_DIR=$(Build.SourcesDirectory)/.build/sysroots + SYSROOT_ARCH="$SYSROOT_ARCH" node -e '(async () => { const { getVSCodeSysroot } = require("./build/linux/debian/install-sysroot.js"); await getVSCodeSysroot(process.env["SYSROOT_ARCH"]); })()' + env: + VSCODE_ARCH: $(VSCODE_ARCH) + GITHUB_TOKEN: "$(github-distro-mixin-password)" + displayName: Download vscode sysroots + + - script: | + set -e source ./build/azure-pipelines/linux/setup-env.sh for i in {1..5}; do # try 5 times - yarn --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done env: npm_config_arch: $(NPM_ARCH) @@ -167,7 +190,7 @@ steps: - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - script: | set -e - yarn gulp vscode-linux-$(VSCODE_ARCH)-min-ci + npm run gulp vscode-linux-$(VSCODE_ARCH)-min-ci ARCHIVE_PATH=".build/linux/client/code-${{ parameters.VSCODE_QUALITY }}-$(VSCODE_ARCH)-$(date +%s).tar.gz" mkdir -p $(dirname $ARCHIVE_PATH) echo "##vso[task.setvariable variable=CLIENT_PATH]$ARCHIVE_PATH" @@ -200,7 +223,7 @@ steps: - script: | set -e - yarn gulp vscode-reh-linux-$(VSCODE_ARCH)-min-ci + npm run gulp vscode-reh-linux-$(VSCODE_ARCH)-min-ci mv ../vscode-reh-linux-$(VSCODE_ARCH) ../vscode-server-linux-$(VSCODE_ARCH) # TODO@joaomoreno ARCHIVE_PATH=".build/linux/server/vscode-server-linux-$(VSCODE_ARCH).tar.gz" UNARCHIVE_PATH="`pwd`/../vscode-server-linux-$(VSCODE_ARCH)" @@ -214,7 +237,7 @@ steps: - script: | set -e - yarn gulp vscode-reh-web-linux-$(VSCODE_ARCH)-min-ci + npm run gulp vscode-reh-web-linux-$(VSCODE_ARCH)-min-ci mv ../vscode-reh-web-linux-$(VSCODE_ARCH) ../vscode-server-linux-$(VSCODE_ARCH)-web # TODO@joaomoreno ARCHIVE_PATH=".build/linux/web/vscode-server-linux-$(VSCODE_ARCH)-web.tar.gz" mkdir -p $(dirname $ARCHIVE_PATH) @@ -255,7 +278,7 @@ steps: displayName: Check GLIBC and GLIBCXX dependencies in server archive - ${{ else }}: - - script: yarn gulp "transpile-client-swc" "transpile-extensions" + - script: npm run gulp "transpile-client-swc" "transpile-extensions" env: GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Transpile client and extensions @@ -267,37 +290,50 @@ steps: VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }} VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }} VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }} + VSCODE_BUILD_AMD: ${{ parameters.VSCODE_BUILD_AMD }} ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1 - ${{ if and(ne(parameters.VSCODE_CIBUILD, true), ne(parameters.VSCODE_QUALITY, 'oss')) }}: - script: | set -e - yarn gulp "vscode-linux-$(VSCODE_ARCH)-prepare-deb" + npm run gulp "vscode-linux-$(VSCODE_ARCH)-prepare-deb" env: GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Prepare deb package - script: | set -e - yarn gulp "vscode-linux-$(VSCODE_ARCH)-build-deb" + npm run gulp "vscode-linux-$(VSCODE_ARCH)-build-deb" echo "##vso[task.setvariable variable=DEB_PATH]$(ls .build/linux/deb/*/deb/*.deb)" displayName: Build deb package - script: | set -e - yarn gulp "vscode-linux-$(VSCODE_ARCH)-prepare-rpm" + TRIPLE="" + if [ "$VSCODE_ARCH" == "x64" ]; then + TRIPLE="x86_64-linux-gnu" + elif [ "$VSCODE_ARCH" == "arm64" ]; then + TRIPLE="aarch64-linux-gnu" + elif [ "$VSCODE_ARCH" == "armhf" ]; then + TRIPLE="arm-rpi-linux-gnueabihf" + fi + export VSCODE_SYSROOT_DIR=$(Build.SourcesDirectory)/.build/sysroots + export STRIP="$VSCODE_SYSROOT_DIR/$TRIPLE/$TRIPLE/bin/strip" + npm run gulp "vscode-linux-$(VSCODE_ARCH)-prepare-rpm" + env: + VSCODE_ARCH: $(VSCODE_ARCH) displayName: Prepare rpm package - script: | set -e - yarn gulp "vscode-linux-$(VSCODE_ARCH)-build-rpm" + npm run gulp "vscode-linux-$(VSCODE_ARCH)-build-rpm" echo "##vso[task.setvariable variable=RPM_PATH]$(ls .build/linux/rpm/*/*.rpm)" displayName: Build rpm package - script: | set -e - yarn gulp "vscode-linux-$(VSCODE_ARCH)-prepare-snap" + npm run gulp "vscode-linux-$(VSCODE_ARCH)-prepare-snap" ARCHIVE_PATH=".build/linux/snap-tarball/snap-$(VSCODE_ARCH).tar.gz" mkdir -p $(dirname $ARCHIVE_PATH) tar -czf $ARCHIVE_PATH -C .build/linux snap diff --git a/build/azure-pipelines/linux/setup-env.sh b/build/azure-pipelines/linux/setup-env.sh index 9bfbf9ab41a..1ce3ba742c1 100755 --- a/build/azure-pipelines/linux/setup-env.sh +++ b/build/azure-pipelines/linux/setup-env.sh @@ -8,12 +8,17 @@ if [ "$SYSROOT_ARCH" == "x64" ]; then fi export VSCODE_SYSROOT_DIR=$PWD/.build/sysroots -SYSROOT_ARCH="$SYSROOT_ARCH" node -e '(async () => { const { getVSCodeSysroot } = require("./build/linux/debian/install-sysroot.js"); await getVSCodeSysroot(process.env["SYSROOT_ARCH"]); })()' +if [ -d "$VSCODE_SYSROOT_DIR" ]; then + echo "Using cached sysroot" +else + echo "Downloading sysroot" + SYSROOT_ARCH="$SYSROOT_ARCH" node -e '(async () => { const { getVSCodeSysroot } = require("./build/linux/debian/install-sysroot.js"); await getVSCodeSysroot(process.env["SYSROOT_ARCH"]); })()' +fi if [ "$npm_config_arch" == "x64" ]; then if [ "$(echo "$@" | grep -c -- "--only-remote")" -eq 0 ]; then # Download clang based on chromium revision used by vscode - curl -s https://raw.githubusercontent.com/chromium/chromium/122.0.6261.156/tools/clang/scripts/update.py | python - --output-dir=$PWD/.build/CR_Clang --host-os=linux + curl -s https://raw.githubusercontent.com/chromium/chromium/124.0.6367.243/tools/clang/scripts/update.py | python - --output-dir=$PWD/.build/CR_Clang --host-os=linux # Download libcxx headers and objects from upstream electron releases DEBUG=libcxx-fetcher \ @@ -25,9 +30,9 @@ if [ "$npm_config_arch" == "x64" ]; then # Set compiler toolchain # Flags for the client build are based on - # https://source.chromium.org/chromium/chromium/src/+/refs/tags/122.0.6261.156:build/config/arm.gni - # https://source.chromium.org/chromium/chromium/src/+/refs/tags/122.0.6261.156:build/config/compiler/BUILD.gn - # https://source.chromium.org/chromium/chromium/src/+/refs/tags/122.0.6261.156:build/config/c++/BUILD.gn + # https://source.chromium.org/chromium/chromium/src/+/refs/tags/124.0.6367.243:build/config/arm.gni + # https://source.chromium.org/chromium/chromium/src/+/refs/tags/124.0.6367.243:build/config/compiler/BUILD.gn + # https://source.chromium.org/chromium/chromium/src/+/refs/tags/124.0.6367.243:build/config/c++/BUILD.gn export CC="$PWD/.build/CR_Clang/bin/clang --gcc-toolchain=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu" export CXX="$PWD/.build/CR_Clang/bin/clang++ --gcc-toolchain=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu" export CXXFLAGS="-nostdinc++ -D__NO_INLINE__ -I$PWD/.build/libcxx_headers -isystem$PWD/.build/libcxx_headers/include -isystem$PWD/.build/libcxxabi_headers/include -fPIC -flto=thin -fsplit-lto-unit -D_LIBCPP_ABI_NAMESPACE=Cr -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE --sysroot=$VSCODE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot" @@ -54,17 +59,15 @@ elif [ "$npm_config_arch" == "arm64" ]; then export VSCODE_REMOTE_LDFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/sysroot -L$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/sysroot/usr/lib/aarch64-linux-gnu -L$VSCODE_SYSROOT_DIR/aarch64-linux-gnu/aarch64-linux-gnu/sysroot/lib/aarch64-linux-gnu" fi elif [ "$npm_config_arch" == "arm" ]; then - if [ "$(echo "$@" | grep -c -- "--only-remote")" -eq 0 ]; then - # Set compiler toolchain for client native modules - export CC=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc - export CXX=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-g++ - export CXXFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot" - export LDFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot -L$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf -L$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot/lib/arm-linux-gnueabihf" + # Set compiler toolchain for client native modules + export CC=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc + export CXX=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-g++ + export CXXFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot" + export LDFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot -L$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf -L$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot/lib/arm-linux-gnueabihf" - # Set compiler toolchain for remote server - export VSCODE_REMOTE_CC=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc - export VSCODE_REMOTE_CXX=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-g++ - export VSCODE_REMOTE_CXXFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot" - export VSCODE_REMOTE_LDFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot -L$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf -L$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot/lib/arm-linux-gnueabihf" - fi + # Set compiler toolchain for remote server + export VSCODE_REMOTE_CC=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc + export VSCODE_REMOTE_CXX=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-g++ + export VSCODE_REMOTE_CXXFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot" + export VSCODE_REMOTE_LDFLAGS="--sysroot=$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot -L$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf -L$VSCODE_SYSROOT_DIR/arm-rpi-linux-gnueabihf/arm-rpi-linux-gnueabihf/sysroot/lib/arm-linux-gnueabihf" fi diff --git a/build/azure-pipelines/linux/snap-build-linux.yml b/build/azure-pipelines/linux/snap-build-linux.yml index 033058163f9..3582be07cca 100644 --- a/build/azure-pipelines/linux/snap-build-linux.yml +++ b/build/azure-pipelines/linux/snap-build-linux.yml @@ -5,11 +5,11 @@ steps: versionFilePath: .nvmrc nodejsMirror: https://github.com/joaomoreno/node-mirror/releases/download - - task: DownloadPipelineArtifact@0 + - task: DownloadPipelineArtifact@2 displayName: "Download Pipeline Artifact" inputs: - artifactName: snap-$(VSCODE_ARCH) - targetPath: .build/linux/snap-tarball + artifact: snap-$(VSCODE_ARCH) + path: .build/linux/snap-tarball - script: | set -e @@ -22,17 +22,11 @@ steps: sudo apt-get upgrade -y sudo apt-get install -y curl apt-transport-https ca-certificates - # Yarn - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list - sudo apt-get update - sudo apt-get install -y yarn - # Define variables SNAP_ROOT="$(pwd)/.build/linux/snap/$(VSCODE_ARCH)" # Install build dependencies - (cd build && yarn) + (cd build && npm ci) # Unpack snap tarball artifact, in order to preserve file perms (cd .build/linux && tar -xzf snap-tarball/snap-$(VSCODE_ARCH).tar.gz) diff --git a/build/azure-pipelines/linux/verify-glibc-requirements.sh b/build/azure-pipelines/linux/verify-glibc-requirements.sh index 19482c242ea..c655ce74c7e 100755 --- a/build/azure-pipelines/linux/verify-glibc-requirements.sh +++ b/build/azure-pipelines/linux/verify-glibc-requirements.sh @@ -10,7 +10,7 @@ elif [ "$VSCODE_ARCH" == "armhf" ]; then fi # Get all files with .node extension from server folder -files=$(find $SEARCH_PATH -name "*.node" -not -path "*prebuilds*" -o -type f -executable -name "node") +files=$(find $SEARCH_PATH -name "*.node" -not -path "*prebuilds*" -not -path "*extensions/node_modules/@parcel/watcher*" -o -type f -executable -name "node") echo "Verifying requirements for files: $files" diff --git a/build/azure-pipelines/oss/product-build-pr-cache-linux.yml b/build/azure-pipelines/oss/product-build-pr-cache-linux.yml index 9f207f75220..6609e80ed28 100644 --- a/build/azure-pipelines/oss/product-build-pr-cache-linux.yml +++ b/build/azure-pipelines/oss/product-build-pr-cache-linux.yml @@ -13,12 +13,12 @@ steps: condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Registry - - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js linux $VSCODE_ARCH > .build/yarnlockhash + - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js linux $VSCODE_ARCH > .build/packagelockhash displayName: Prepare node_modules cache key - task: Cache@2 inputs: - key: '"node_modules" | .build/yarnlockhash' + key: '"node_modules" | .build/packagelockhash' path: .build/node_modules_cache cacheHitVar: NODE_MODULES_RESTORED displayName: Restore node_modules cache @@ -29,18 +29,17 @@ steps: - script: | set -e - npm config set registry "$NPM_REGISTRY" --location=project - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - echo "always-auth=true" >> .npmrc - yarn config set registry "$NPM_REGISTRY" + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + npm config set registry "$NPM_REGISTRY" + echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)" condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: .npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication @@ -51,12 +50,12 @@ steps: - script: | set -e for i in {1..5}; do # try 5 times - yarn --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done env: ELECTRON_SKIP_BINARY_DOWNLOAD: 1 diff --git a/build/azure-pipelines/oss/product-build-pr-cache-win32.yml b/build/azure-pipelines/oss/product-build-pr-cache-win32.yml index b084c5e97c5..e1c8305bbb2 100644 --- a/build/azure-pipelines/oss/product-build-pr-cache-win32.yml +++ b/build/azure-pipelines/oss/product-build-pr-cache-win32.yml @@ -15,12 +15,12 @@ steps: - pwsh: | mkdir .build -ea 0 - node build/azure-pipelines/common/computeNodeModulesCacheKey.js win32 $(VSCODE_ARCH) > .build/yarnlockhash + node build/azure-pipelines/common/computeNodeModulesCacheKey.js win32 $(VSCODE_ARCH) > .build/packagelockhash displayName: Prepare node_modules cache key - task: Cache@2 inputs: - key: '"node_modules" | .build/yarnlockhash' + key: '"node_modules" | .build/packagelockhash' path: .build/node_modules_cache cacheHitVar: NODE_MODULES_RESTORED displayName: Restore node_modules cache @@ -32,18 +32,18 @@ steps: - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" - exec { npm config set registry "$env:NPM_REGISTRY" --location=project } - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - exec { Add-Content -Path .npmrc -Value "always-auth=true" } - exec { yarn config set registry "$env:NPM_REGISTRY" } + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + exec { npm config set registry "$env:NPM_REGISTRY" } + $NpmrcPath = (npm config get userconfig) + echo "##vso[task.setvariable variable=NPMRC_PATH]$NpmrcPath" condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: .npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication @@ -53,7 +53,7 @@ steps: $ErrorActionPreference = "Stop" $env:npm_config_arch="$(VSCODE_ARCH)" $env:CHILD_CONCURRENCY="1" - retry { exec { yarn --frozen-lockfile --check-files } } + retry { exec { npm ci } } env: ELECTRON_SKIP_BINARY_DOWNLOAD: 1 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 diff --git a/build/azure-pipelines/product-build-pr.yml b/build/azure-pipelines/product-build-pr.yml index 7dce4d20265..025a1eeac67 100644 --- a/build/azure-pipelines/product-build-pr.yml +++ b/build/azure-pipelines/product-build-pr.yml @@ -21,12 +21,14 @@ variables: value: oss - name: VSCODE_STEP_ON_IT value: false + - name: VSCODE_BUILD_AMD + value: false jobs: - ${{ if ne(variables['VSCODE_CIBUILD'], true) }}: - job: Compile displayName: Compile & Hygiene - pool: 1es-oss-ubuntu-20.04-x64 + pool: 1es-oss-ubuntu-22.04-x64 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 @@ -37,7 +39,7 @@ jobs: - job: Linuxx64UnitTest displayName: Linux (Unit Tests) - pool: 1es-oss-ubuntu-20.04-x64 + pool: 1es-oss-ubuntu-22.04-x64 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 @@ -48,6 +50,7 @@ jobs: parameters: VSCODE_ARCH: x64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: true VSCODE_RUN_INTEGRATION_TESTS: false @@ -55,7 +58,7 @@ jobs: - job: Linuxx64IntegrationTest displayName: Linux (Integration Tests) - pool: 1es-oss-ubuntu-20.04-x64 + pool: 1es-oss-ubuntu-22.04-x64 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 @@ -66,6 +69,7 @@ jobs: parameters: VSCODE_ARCH: x64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: true @@ -73,7 +77,7 @@ jobs: - job: Linuxx64SmokeTest displayName: Linux (Smoke Tests) - pool: 1es-oss-ubuntu-20.04-x64 + pool: 1es-oss-ubuntu-22.04-x64 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 @@ -84,6 +88,7 @@ jobs: parameters: VSCODE_ARCH: x64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false @@ -91,14 +96,14 @@ jobs: - job: LinuxCLI displayName: Linux (CLI) - pool: 1es-oss-ubuntu-20.04-x64 + pool: 1es-oss-ubuntu-22.04-x64 timeoutInMinutes: 30 steps: - template: cli/test.yml@self - job: Windowsx64UnitTests displayName: Windows (Unit Tests) - pool: 1es-oss-windows-2019-x64 + pool: 1es-oss-windows-2022-x64 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 @@ -107,6 +112,7 @@ jobs: - template: win32/product-build-win32.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_ARCH: x64 VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: true @@ -115,8 +121,8 @@ jobs: - job: Windowsx64IntegrationTests displayName: Windows (Integration Tests) - pool: 1es-oss-windows-2019-x64 - timeoutInMinutes: 30 + pool: 1es-oss-windows-2022-x64 + timeoutInMinutes: 60 variables: VSCODE_ARCH: x64 NPM_ARCH: x64 @@ -124,6 +130,7 @@ jobs: - template: win32/product-build-win32.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_ARCH: x64 VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false @@ -132,7 +139,7 @@ jobs: # - job: Windowsx64SmokeTests # displayName: Windows (Smoke Tests) - # pool: 1es-oss-windows-2019-x64 + # pool: 1es-oss-windows-2022-x64 # timeoutInMinutes: 30 # variables: # VSCODE_ARCH: x64 @@ -149,7 +156,7 @@ jobs: - ${{ if eq(variables['VSCODE_CIBUILD'], true) }}: - job: Linuxx64MaintainNodeModulesCache displayName: Linux (Maintain node_modules cache) - pool: 1es-oss-ubuntu-20.04-x64 + pool: 1es-oss-ubuntu-22.04-x64 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 @@ -158,7 +165,7 @@ jobs: - job: Windowsx64MaintainNodeModulesCache displayName: Windows (Maintain node_modules cache) - pool: 1es-oss-windows-2019-x64 + pool: 1es-oss-windows-2022-x64 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index 5357697484e..d4038dced08 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -100,6 +100,10 @@ parameters: displayName: "Skip tests" type: boolean default: false + - name: VSCODE_BUILD_AMD # TODO@bpasero TODO@esm remove me once AMD is removed + displayName: "️❗ Build as AMD (!FOR EMERGENCY ONLY!) ️❗" + type: boolean + default: false variables: - name: VSCODE_PRIVATE_BUILD @@ -110,6 +114,8 @@ variables: value: ${{ parameters.CARGO_REGISTRY }} - name: VSCODE_QUALITY value: ${{ parameters.VSCODE_QUALITY }} + - name: VSCODE_BUILD_AMD + value: ${{ parameters.VSCODE_BUILD_AMD }} - name: VSCODE_BUILD_STAGE_WINDOWS value: ${{ or(eq(parameters.VSCODE_BUILD_WIN32, true), eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }} - name: VSCODE_BUILD_STAGE_LINUX @@ -148,6 +154,8 @@ variables: value: microsoft/vscode-distro - name: skipComponentGovernanceDetection value: true + - name: ComponentDetection.Timeout + value: 600 - name: Codeql.SkipTaskAutoInjection value: true - name: ARTIFACT_PREFIX @@ -182,9 +190,10 @@ extends: validateToolOutput: None allTools: true codeql: - compiled: - enabled: true runSourceLanguagesInSourceAnalysis: true + compiled: + enabled: false + justificationForDisabling: "CodeQL breaks ESRP CodeSign on macOS (ICM #520035761, githubcustomers/microsoft-codeql-support#198)" credscan: suppressionsFile: $(Build.SourcesDirectory)/build/azure-pipelines/config/CredScanSuppressions.json eslint: @@ -192,6 +201,7 @@ extends: enableExclusions: true exclusionsFilePath: $(Build.SourcesDirectory)/.eslintignore sourceAnalysisPool: 1es-windows-2022-x64 + createAdoIssuesForJustificationsForDisablement: false containers: snapcraft: image: vscodehub.azurecr.io/vscode-linux-build-agent:snapcraft-x64 @@ -207,7 +217,7 @@ extends: - job: Compile timeoutInMinutes: 90 pool: - name: 1es-ubuntu-20.04-x64 + name: 1es-ubuntu-22.04-x64 os: linux variables: VSCODE_ARCH: x64 @@ -215,123 +225,130 @@ extends: - template: build/azure-pipelines/product-compile.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} - - stage: CompileCLI - dependsOn: [] - jobs: - - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: - - job: CLILinuxX64 - pool: - name: 1es-ubuntu-20.04-x64 - os: linux - steps: - - template: build/azure-pipelines/linux/cli-build-linux.yml@self - parameters: - VSCODE_CHECK_ONLY: ${{ variables.VSCODE_CIBUILD }} - VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} - VSCODE_BUILD_LINUX: ${{ parameters.VSCODE_BUILD_LINUX }} + - ${{ if or(eq(parameters.VSCODE_BUILD_LINUX, true),eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true),eq(parameters.VSCODE_BUILD_LINUX_ARM64, true),eq(parameters.VSCODE_BUILD_ALPINE, true),eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true),eq(parameters.VSCODE_BUILD_MACOS, true),eq(parameters.VSCODE_BUILD_MACOS_ARM64, true),eq(parameters.VSCODE_BUILD_WIN32, true),eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}: + - stage: CompileCLI + dependsOn: [] + jobs: + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - job: CLILinuxX64 + pool: + name: 1es-ubuntu-22.04-x64 + os: linux + steps: + - template: build/azure-pipelines/linux/cli-build-linux.yml@self + parameters: + VSCODE_CHECK_ONLY: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_LINUX: ${{ parameters.VSCODE_BUILD_LINUX }} - - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), or(eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true), eq(parameters.VSCODE_BUILD_LINUX_ARM64, true))) }}: - - job: CLILinuxGnuARM - pool: - name: 1es-ubuntu-20.04-x64 - os: linux - steps: - - template: build/azure-pipelines/linux/cli-build-linux.yml@self - parameters: - VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} - VSCODE_BUILD_LINUX_ARMHF: ${{ parameters.VSCODE_BUILD_LINUX_ARMHF }} - VSCODE_BUILD_LINUX_ARM64: ${{ parameters.VSCODE_BUILD_LINUX_ARM64 }} - - - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_ALPINE, true)) }}: - - job: CLIAlpineX64 - pool: - name: 1es-ubuntu-20.04-x64 - os: linux - steps: - - template: build/azure-pipelines/alpine/cli-build-alpine.yml@self - parameters: - VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} - VSCODE_BUILD_ALPINE: ${{ parameters.VSCODE_BUILD_ALPINE }} - - - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true)) }}: - - job: CLIAlpineARM64 - pool: - name: 1es-mariner-2.0-arm64 - os: linux - hostArchitecture: arm64 - container: ubuntu-2004-arm64 - steps: - - template: build/azure-pipelines/alpine/cli-build-alpine.yml@self - parameters: - VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} - VSCODE_BUILD_ALPINE_ARM64: ${{ parameters.VSCODE_BUILD_ALPINE_ARM64 }} - - - ${{ if eq(parameters.VSCODE_BUILD_MACOS, true) }}: - - job: CLIMacOSX64 - pool: - name: Azure Pipelines - image: macOS-13 - os: macOS - steps: - - template: build/azure-pipelines/darwin/cli-build-darwin.yml@self - parameters: - VSCODE_CHECK_ONLY: ${{ variables.VSCODE_CIBUILD }} - VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} - VSCODE_BUILD_MACOS: ${{ parameters.VSCODE_BUILD_MACOS }} - - - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_MACOS_ARM64, true)) }}: - - job: CLIMacOSARM64 - pool: - name: Azure Pipelines - image: macOS-13 - os: macOS - steps: - - template: build/azure-pipelines/darwin/cli-build-darwin.yml@self - parameters: - VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} - VSCODE_BUILD_MACOS_ARM64: ${{ parameters.VSCODE_BUILD_MACOS_ARM64 }} + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), or(eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true), eq(parameters.VSCODE_BUILD_LINUX_ARM64, true))) }}: + - job: CLILinuxGnuARM + pool: + name: 1es-ubuntu-22.04-x64 + os: linux + steps: + - template: build/azure-pipelines/linux/cli-build-linux.yml@self + parameters: + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_LINUX_ARMHF: ${{ parameters.VSCODE_BUILD_LINUX_ARMHF }} + VSCODE_BUILD_LINUX_ARM64: ${{ parameters.VSCODE_BUILD_LINUX_ARM64 }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_ALPINE, true)) }}: + - job: CLIAlpineX64 + pool: + name: 1es-ubuntu-22.04-x64 + os: linux + steps: + - template: build/azure-pipelines/alpine/cli-build-alpine.yml@self + parameters: + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_ALPINE: ${{ parameters.VSCODE_BUILD_ALPINE }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true)) }}: + - job: CLIAlpineARM64 + pool: + name: 1es-mariner-2.0-arm64 + os: linux + hostArchitecture: arm64 + container: ubuntu-2004-arm64 + steps: + - template: build/azure-pipelines/alpine/cli-build-alpine.yml@self + parameters: + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_ALPINE_ARM64: ${{ parameters.VSCODE_BUILD_ALPINE_ARM64 }} + + - ${{ if eq(parameters.VSCODE_BUILD_MACOS, true) }}: + - job: CLIMacOSX64 + pool: + name: Azure Pipelines + image: macOS-13 + os: macOS + steps: + - template: build/azure-pipelines/darwin/cli-build-darwin.yml@self + parameters: + VSCODE_CHECK_ONLY: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_MACOS: ${{ parameters.VSCODE_BUILD_MACOS }} - - ${{ if eq(parameters.VSCODE_BUILD_WIN32, true) }}: - - job: CLIWindowsX64 - pool: - name: 1es-windows-2019-x64 - os: windows - steps: - - template: build/azure-pipelines/win32/cli-build-win32.yml@self - parameters: - VSCODE_CHECK_ONLY: ${{ variables.VSCODE_CIBUILD }} - VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} - VSCODE_BUILD_WIN32: ${{ parameters.VSCODE_BUILD_WIN32 }} + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_MACOS_ARM64, true)) }}: + - job: CLIMacOSARM64 + pool: + name: Azure Pipelines + image: macOS-13 + os: macOS + steps: + - template: build/azure-pipelines/darwin/cli-build-darwin.yml@self + parameters: + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_MACOS_ARM64: ${{ parameters.VSCODE_BUILD_MACOS_ARM64 }} + + - ${{ if eq(parameters.VSCODE_BUILD_WIN32, true) }}: + - job: CLIWindowsX64 + pool: + name: 1es-windows-2019-x64 + os: windows + steps: + - template: build/azure-pipelines/win32/cli-build-win32.yml@self + parameters: + VSCODE_CHECK_ONLY: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_WIN32: ${{ parameters.VSCODE_BUILD_WIN32 }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}: + - job: CLIWindowsARM64 + pool: + name: 1es-windows-2019-x64 + os: windows + steps: + - template: build/azure-pipelines/win32/cli-build-win32.yml@self + parameters: + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_WIN32_ARM64: ${{ parameters.VSCODE_BUILD_WIN32_ARM64 }} - - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}: - - job: CLIWindowsARM64 - pool: - name: 1es-windows-2019-x64 - os: windows + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_COMPILE_ONLY, false)) }}: + - stage: CustomSDL + dependsOn: [] + pool: + name: 1es-windows-2019-x64 + os: windows + jobs: + - job: WindowsSDL + variables: + - group: 'API Scan' steps: - - template: build/azure-pipelines/win32/cli-build-win32.yml@self + - template: build/azure-pipelines/win32/sdl-scan-win32.yml@self parameters: + VSCODE_ARCH: x64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} - VSCODE_BUILD_WIN32_ARM64: ${{ parameters.VSCODE_BUILD_WIN32_ARM64 }} - - - stage: CustomSDL - dependsOn: [] - pool: - name: 1es-windows-2019-x64 - os: windows - jobs: - - job: WindowsSDL - variables: - - group: 'API Scan' - steps: - - template: build/azure-pipelines/sdl-scan.yml@self - ${{ if and(eq(parameters.VSCODE_COMPILE_ONLY, false), eq(variables['VSCODE_BUILD_STAGE_WINDOWS'], true)) }}: - stage: Windows dependsOn: - Compile - - CompileCLI + - ${{ if or(eq(parameters.VSCODE_BUILD_LINUX, true),eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true),eq(parameters.VSCODE_BUILD_LINUX_ARM64, true),eq(parameters.VSCODE_BUILD_ALPINE, true),eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true),eq(parameters.VSCODE_BUILD_MACOS, true),eq(parameters.VSCODE_BUILD_MACOS_ARM64, true),eq(parameters.VSCODE_BUILD_WIN32, true),eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}: + - CompileCLI pool: name: 1es-windows-2019-x64 os: windows @@ -346,6 +363,7 @@ extends: - template: build/azure-pipelines/win32/product-build-win32.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_ARCH: x64 VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: true @@ -360,6 +378,7 @@ extends: - template: build/azure-pipelines/win32/product-build-win32.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_ARCH: x64 VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false @@ -374,6 +393,7 @@ extends: - template: build/azure-pipelines/win32/product-build-win32.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_ARCH: x64 VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false @@ -389,6 +409,7 @@ extends: - template: build/azure-pipelines/win32/product-build-win32.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_ARCH: x64 VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} @@ -412,6 +433,7 @@ extends: - template: build/azure-pipelines/win32/product-build-win32.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_ARCH: arm64 VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false @@ -422,9 +444,10 @@ extends: - stage: Linux dependsOn: - Compile - - CompileCLI + - ${{ if or(eq(parameters.VSCODE_BUILD_LINUX, true),eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true),eq(parameters.VSCODE_BUILD_LINUX_ARM64, true),eq(parameters.VSCODE_BUILD_ALPINE, true),eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true),eq(parameters.VSCODE_BUILD_MACOS, true),eq(parameters.VSCODE_BUILD_MACOS_ARM64, true),eq(parameters.VSCODE_BUILD_WIN32, true),eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}: + - CompileCLI pool: - name: 1es-ubuntu-20.04-x64 + name: 1es-ubuntu-22.04-x64 os: linux jobs: - ${{ if eq(variables['VSCODE_CIBUILD'], true) }}: @@ -439,6 +462,7 @@ extends: parameters: VSCODE_ARCH: x64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: true VSCODE_RUN_INTEGRATION_TESTS: false @@ -454,6 +478,7 @@ extends: parameters: VSCODE_ARCH: x64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: true @@ -469,6 +494,7 @@ extends: parameters: VSCODE_ARCH: x64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false @@ -486,6 +512,7 @@ extends: parameters: VSCODE_ARCH: x64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} @@ -511,6 +538,7 @@ extends: parameters: VSCODE_ARCH: armhf VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false @@ -526,6 +554,7 @@ extends: parameters: VSCODE_ARCH: arm64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false @@ -550,6 +579,7 @@ extends: parameters: VSCODE_ARCH: x64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARMHF_LEGACY_SERVER, true) }}: @@ -562,6 +592,7 @@ extends: parameters: VSCODE_ARCH: armhf VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_RUN_INTEGRATION_TESTS: false - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64_LEGACY_SERVER, true) }}: @@ -574,15 +605,17 @@ extends: parameters: VSCODE_ARCH: arm64 VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_RUN_INTEGRATION_TESTS: false - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_COMPILE_ONLY, false), eq(variables['VSCODE_BUILD_STAGE_ALPINE'], true)) }}: - stage: Alpine dependsOn: - Compile - - CompileCLI + - ${{ if or(eq(parameters.VSCODE_BUILD_LINUX, true),eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true),eq(parameters.VSCODE_BUILD_LINUX_ARM64, true),eq(parameters.VSCODE_BUILD_ALPINE, true),eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true),eq(parameters.VSCODE_BUILD_MACOS, true),eq(parameters.VSCODE_BUILD_MACOS_ARM64, true),eq(parameters.VSCODE_BUILD_WIN32, true),eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}: + - CompileCLI pool: - name: 1es-ubuntu-20.04-x64 + name: 1es-ubuntu-22.04-x64 os: linux jobs: - ${{ if eq(parameters.VSCODE_BUILD_ALPINE, true) }}: @@ -606,7 +639,8 @@ extends: - stage: macOS dependsOn: - Compile - - CompileCLI + - ${{ if or(eq(parameters.VSCODE_BUILD_LINUX, true),eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true),eq(parameters.VSCODE_BUILD_LINUX_ARM64, true),eq(parameters.VSCODE_BUILD_ALPINE, true),eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true),eq(parameters.VSCODE_BUILD_MACOS, true),eq(parameters.VSCODE_BUILD_MACOS_ARM64, true),eq(parameters.VSCODE_BUILD_WIN32, true),eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}: + - CompileCLI pool: name: Azure Pipelines image: macOS-13 @@ -624,6 +658,7 @@ extends: - template: build/azure-pipelines/darwin/product-build-darwin.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: true VSCODE_RUN_INTEGRATION_TESTS: false @@ -637,6 +672,7 @@ extends: - template: build/azure-pipelines/darwin/product-build-darwin.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: true @@ -650,6 +686,7 @@ extends: - template: build/azure-pipelines/darwin/product-build-darwin.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false @@ -664,6 +701,7 @@ extends: - template: build/azure-pipelines/darwin/product-build-darwin.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false @@ -678,6 +716,7 @@ extends: - template: build/azure-pipelines/darwin/product-build-darwin.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} @@ -709,6 +748,7 @@ extends: - template: build/azure-pipelines/darwin/product-build-darwin.yml@self parameters: VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }} VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} VSCODE_RUN_UNIT_TESTS: false VSCODE_RUN_INTEGRATION_TESTS: false @@ -748,7 +788,7 @@ extends: dependsOn: - Compile pool: - name: 1es-ubuntu-20.04-x64 + name: 1es-ubuntu-22.04-x64 os: linux jobs: - ${{ if eq(parameters.VSCODE_BUILD_WEB, true) }}: @@ -778,7 +818,7 @@ extends: - stage: ApproveRelease dependsOn: [] # run in parallel to compile stage pool: - name: 1es-ubuntu-20.04-x64 + name: 1es-ubuntu-22.04-x64 os: linux jobs: - deployment: ApproveRelease @@ -799,7 +839,7 @@ extends: - ${{ if and(parameters.VSCODE_RELEASE, eq(variables['VSCODE_PRIVATE_BUILD'], false)) }}: - ApproveRelease pool: - name: 1es-ubuntu-20.04-x64 + name: 1es-ubuntu-22.04-x64 os: linux jobs: - job: ReleaseBuild diff --git a/build/azure-pipelines/product-compile.yml b/build/azure-pipelines/product-compile.yml index 9a3748ed6fc..ca8b6a7b3ea 100644 --- a/build/azure-pipelines/product-compile.yml +++ b/build/azure-pipelines/product-compile.yml @@ -1,6 +1,9 @@ parameters: - name: VSCODE_QUALITY type: string + - name: VSCODE_BUILD_AMD + type: boolean + default: false steps: - task: NodeTool@0 @@ -12,7 +15,7 @@ steps: - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - template: ./distro/download-distro.yml@self - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" @@ -23,12 +26,12 @@ steps: condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Registry - - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js compile > .build/yarnlockhash + - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js compile > .build/packagelockhash displayName: Prepare node_modules cache key - task: Cache@2 inputs: - key: '"node_modules" | .build/yarnlockhash' + key: '"node_modules" | .build/packagelockhash' path: .build/node_modules_cache cacheHitVar: NODE_MODULES_RESTORED displayName: Restore node_modules cache @@ -39,18 +42,17 @@ steps: - script: | set -e - npm config set registry "$NPM_REGISTRY" --location=project - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - echo "always-auth=true" >> .npmrc - yarn config set registry "$NPM_REGISTRY" + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + npm config set registry "$NPM_REGISTRY" + echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)" condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: .npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication @@ -60,15 +62,14 @@ steps: - script: | set -e - npm i -g node-gyp@9.4.0 for i in {1..5}; do # try 5 times - yarn --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done env: ELECTRON_SKIP_BINARY_DOWNLOAD: 1 @@ -91,34 +92,47 @@ steps: displayName: Create node_modules archive - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - script: yarn --cwd build compile && ./.github/workflows/check-clean-git-state.sh + - script: npm run compile + workingDirectory: build + displayName: Compile /build/ folder + + - script: .github/workflows/check-clean-git-state.sh displayName: Check /build/ folder - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - script: node build/azure-pipelines/distro/mixin-quality displayName: Mixin distro quality + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - script: node migrate.mjs --disable-watch --enable-esm-to-amd + displayName: Migrate ESM -> AMD + - template: common/install-builtin-extensions.yml@self - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - script: yarn npm-run-all -lp core-ci-pr extensions-ci-pr hygiene eslint valid-layers-check vscode-dts-compile-check tsec-compile-check + - script: npm exec -- npm-run-all -lp core-ci-pr extensions-ci-pr hygiene eslint valid-layers-check vscode-dts-compile-check tsec-compile-check env: GITHUB_TOKEN: "$(github-distro-mixin-password)" - DISABLE_V8_COMPILE_CACHE: 1 # Disable v8 cache used by yarn v1.x, refs https://github.com/nodejs/node/issues/51555 displayName: Compile & Hygiene (OSS) - ${{ else }}: - - script: yarn npm-run-all -lp core-ci extensions-ci hygiene eslint valid-layers-check vscode-dts-compile-check tsec-compile-check + - script: npm exec -- npm-run-all -lp core-ci extensions-ci hygiene eslint valid-layers-check vscode-dts-compile-check tsec-compile-check env: GITHUB_TOKEN: "$(github-distro-mixin-password)" - DISABLE_V8_COMPILE_CACHE: 1 # Disable v8 cache used by yarn v1.x, refs https://github.com/nodejs/node/issues/51555 displayName: Compile & Hygiene (non-OSS) - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - script: | set -e - yarn --cwd test/smoke compile - yarn --cwd test/integration/browser compile - displayName: Compile test suites (non-OSS) + npm run compile + displayName: Compile smoke test suites (non-OSS) + workingDirectory: test/smoke + condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + + - script: | + set -e + npm run compile + displayName: Compile integration test suites (non-OSS) + workingDirectory: test/integration/browser condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - task: AzureCLI@2 @@ -164,7 +178,7 @@ steps: sbomEnabled: false displayName: Publish compilation artifact - - script: yarn download-builtin-extensions-cg + - script: npm run download-builtin-extensions-cg env: GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Download component details of built-in extensions diff --git a/build/azure-pipelines/product-publish.yml b/build/azure-pipelines/product-publish.yml index 2c57e131c1a..59012a938ac 100644 --- a/build/azure-pipelines/product-publish.yml +++ b/build/azure-pipelines/product-publish.yml @@ -8,14 +8,14 @@ steps: - task: SFP.build-tasks.esrpclient-tools-task.EsrpClientTool@2 displayName: "Use EsrpClient" - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" KeyVaultName: vscode-build-secrets SecretsFilter: "github-distro-mixin-password,esrp-aad-username,esrp-aad-password" - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" @@ -26,10 +26,8 @@ steps: - pwsh: Write-Host "##vso[build.addbuildtag]🚀" displayName: Add build tag - - pwsh: node build/npm/setupBuildYarnrc - displayName: Prepare build dependencies - - - pwsh: yarn + - pwsh: | + npm ci workingDirectory: build displayName: Install build dependencies diff --git a/build/azure-pipelines/product-release.yml b/build/azure-pipelines/product-release.yml index dc084f5a04c..8afdcf10053 100644 --- a/build/azure-pipelines/product-release.yml +++ b/build/azure-pipelines/product-release.yml @@ -23,7 +23,12 @@ steps: - script: | set -e - (cd build ; yarn) + npm ci + workingDirectory: build + displayName: Install /build dependencies + + - script: | + set -e AZURE_TENANT_ID="$(AZURE_TENANT_ID)" \ AZURE_CLIENT_ID="$(AZURE_CLIENT_ID)" \ AZURE_CLIENT_SECRET="$(AZURE_CLIENT_SECRET)" \ diff --git a/build/azure-pipelines/publish-types/publish-types.yml b/build/azure-pipelines/publish-types/publish-types.yml index 4fc31fb6b37..5f60ae5a262 100644 --- a/build/azure-pipelines/publish-types/publish-types.yml +++ b/build/azure-pipelines/publish-types/publish-types.yml @@ -34,7 +34,7 @@ steps: - bash: | # Install build dependencies - (cd build && yarn) + (cd build && npm ci) node build/azure-pipelines/publish-types/check-version.js displayName: Check version diff --git a/build/azure-pipelines/upload-configuration.js b/build/azure-pipelines/upload-configuration.js deleted file mode 100644 index 39a44dc5c41..00000000000 --- a/build/azure-pipelines/upload-configuration.js +++ /dev/null @@ -1,112 +0,0 @@ -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getSettingsSearchBuildId = exports.shouldSetupSettingsSearch = void 0; -const path = require("path"); -const os = require("os"); -const cp = require("child_process"); -const vfs = require("vinyl-fs"); -const util = require("../lib/util"); -const identity_1 = require("@azure/identity"); -const azure = require('gulp-azure-storage'); -const packageJson = require("../../package.json"); -const commit = process.env['BUILD_SOURCEVERSION']; -function generateVSCodeConfigurationTask() { - return new Promise((resolve, reject) => { - const buildDir = process.env['AGENT_BUILDDIRECTORY']; - if (!buildDir) { - return reject(new Error('$AGENT_BUILDDIRECTORY not set')); - } - if (!shouldSetupSettingsSearch()) { - console.log(`Only runs on main and release branches, not ${process.env.BUILD_SOURCEBRANCH}`); - return resolve(undefined); - } - if (process.env.VSCODE_QUALITY !== 'insider' && process.env.VSCODE_QUALITY !== 'stable') { - console.log(`Only runs on insider and stable qualities, not ${process.env.VSCODE_QUALITY}`); - return resolve(undefined); - } - const result = path.join(os.tmpdir(), 'configuration.json'); - const userDataDir = path.join(os.tmpdir(), 'tmpuserdata'); - const extensionsDir = path.join(os.tmpdir(), 'tmpextdir'); - const arch = process.env['VSCODE_ARCH']; - const appRoot = path.join(buildDir, `VSCode-darwin-${arch}`); - const appName = process.env.VSCODE_QUALITY === 'insider' ? 'Visual\\ Studio\\ Code\\ -\\ Insiders.app' : 'Visual\\ Studio\\ Code.app'; - const appPath = path.join(appRoot, appName, 'Contents', 'Resources', 'app', 'bin', 'code'); - const codeProc = cp.exec(`${appPath} --export-default-configuration='${result}' --wait --user-data-dir='${userDataDir}' --extensions-dir='${extensionsDir}'`, (err, stdout, stderr) => { - clearTimeout(timer); - if (err) { - console.log(`err: ${err} ${err.message} ${err.toString()}`); - reject(err); - } - if (stdout) { - console.log(`stdout: ${stdout}`); - } - if (stderr) { - console.log(`stderr: ${stderr}`); - } - resolve(result); - }); - const timer = setTimeout(() => { - codeProc.kill(); - reject(new Error('export-default-configuration process timed out')); - }, 60 * 1000); - codeProc.on('error', err => { - clearTimeout(timer); - reject(err); - }); - }); -} -function shouldSetupSettingsSearch() { - const branch = process.env.BUILD_SOURCEBRANCH; - return !!(branch && (/\/main$/.test(branch) || branch.indexOf('/release/') >= 0)); -} -exports.shouldSetupSettingsSearch = shouldSetupSettingsSearch; -function getSettingsSearchBuildId(packageJson) { - try { - const branch = process.env.BUILD_SOURCEBRANCH; - const branchId = branch.indexOf('/release/') >= 0 ? 0 : - /\/main$/.test(branch) ? 1 : - 2; // Some unexpected branch - const out = cp.execSync(`git rev-list HEAD --count`); - const count = parseInt(out.toString()); - // - // 1.25.1, 1,234,567 commits, main = 1250112345671 - return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId; - } - catch (e) { - throw new Error('Could not determine build number: ' + e.toString()); - } -} -exports.getSettingsSearchBuildId = getSettingsSearchBuildId; -async function main() { - const configPath = await generateVSCodeConfigurationTask(); - if (!configPath) { - return; - } - const settingsSearchBuildId = getSettingsSearchBuildId(packageJson); - if (!settingsSearchBuildId) { - throw new Error('Failed to compute build number'); - } - const credential = new identity_1.ClientSecretCredential(process.env['AZURE_TENANT_ID'], process.env['AZURE_CLIENT_ID'], process.env['AZURE_CLIENT_SECRET']); - return new Promise((c, e) => { - vfs.src(configPath) - .pipe(azure.upload({ - account: process.env.AZURE_STORAGE_ACCOUNT, - credential, - container: 'configuration', - prefix: `${settingsSearchBuildId}/${commit}/` - })) - .on('end', () => c()) - .on('error', (err) => e(err)); - }); -} -if (require.main === module) { - main().catch(err => { - console.error(err); - process.exit(1); - }); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXBsb2FkLWNvbmZpZ3VyYXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJ1cGxvYWQtY29uZmlndXJhdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7OztnR0FHZ0c7OztBQUVoRyw2QkFBNkI7QUFDN0IseUJBQXlCO0FBQ3pCLG9DQUFvQztBQUNwQyxnQ0FBZ0M7QUFDaEMsb0NBQW9DO0FBQ3BDLDhDQUF5RDtBQUN6RCxNQUFNLEtBQUssR0FBRyxPQUFPLENBQUMsb0JBQW9CLENBQUMsQ0FBQztBQUM1QyxrREFBa0Q7QUFFbEQsTUFBTSxNQUFNLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxxQkFBcUIsQ0FBQyxDQUFDO0FBRWxELFNBQVMsK0JBQStCO0lBQ3ZDLE9BQU8sSUFBSSxPQUFPLENBQUMsQ0FBQyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQUU7UUFDdEMsTUFBTSxRQUFRLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDO1FBQ3JELElBQUksQ0FBQyxRQUFRLEVBQUU7WUFDZCxPQUFPLE1BQU0sQ0FBQyxJQUFJLEtBQUssQ0FBQywrQkFBK0IsQ0FBQyxDQUFDLENBQUM7U0FDMUQ7UUFFRCxJQUFJLENBQUMseUJBQXlCLEVBQUUsRUFBRTtZQUNqQyxPQUFPLENBQUMsR0FBRyxDQUFDLCtDQUErQyxPQUFPLENBQUMsR0FBRyxDQUFDLGtCQUFrQixFQUFFLENBQUMsQ0FBQztZQUM3RixPQUFPLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztTQUMxQjtRQUVELElBQUksT0FBTyxDQUFDLEdBQUcsQ0FBQyxjQUFjLEtBQUssU0FBUyxJQUFJLE9BQU8sQ0FBQyxHQUFHLENBQUMsY0FBYyxLQUFLLFFBQVEsRUFBRTtZQUN4RixPQUFPLENBQUMsR0FBRyxDQUFDLGtEQUFrRCxPQUFPLENBQUMsR0FBRyxDQUFDLGNBQWMsRUFBRSxDQUFDLENBQUM7WUFDNUYsT0FBTyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7U0FDMUI7UUFFRCxNQUFNLE1BQU0sR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxNQUFNLEVBQUUsRUFBRSxvQkFBb0IsQ0FBQyxDQUFDO1FBQzVELE1BQU0sV0FBVyxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLE1BQU0sRUFBRSxFQUFFLGFBQWEsQ0FBQyxDQUFDO1FBQzFELE1BQU0sYUFBYSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLE1BQU0sRUFBRSxFQUFFLFdBQVcsQ0FBQyxDQUFDO1FBQzFELE1BQU0sSUFBSSxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsYUFBYSxDQUFDLENBQUM7UUFDeEMsTUFBTSxPQUFPLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQyxRQUFRLEVBQUUsaUJBQWlCLElBQUksRUFBRSxDQUFDLENBQUM7UUFDN0QsTUFBTSxPQUFPLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxjQUFjLEtBQUssU0FBUyxDQUFDLENBQUMsQ0FBQywyQ0FBMkMsQ0FBQyxDQUFDLENBQUMsNEJBQTRCLENBQUM7UUFDdEksTUFBTSxPQUFPLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQyxPQUFPLEVBQUUsT0FBTyxFQUFFLFVBQVUsRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLENBQUMsQ0FBQztRQUMzRixNQUFNLFFBQVEsR0FBRyxFQUFFLENBQUMsSUFBSSxDQUN2QixHQUFHLE9BQU8sb0NBQW9DLE1BQU0sNkJBQTZCLFdBQVcsdUJBQXVCLGFBQWEsR0FBRyxFQUNuSSxDQUFDLEdBQUcsRUFBRSxNQUFNLEVBQUUsTUFBTSxFQUFFLEVBQUU7WUFDdkIsWUFBWSxDQUFDLEtBQUssQ0FBQyxDQUFDO1lBQ3BCLElBQUksR0FBRyxFQUFFO2dCQUNSLE9BQU8sQ0FBQyxHQUFHLENBQUMsUUFBUSxHQUFHLElBQUksR0FBRyxDQUFDLE9BQU8sSUFBSSxHQUFHLENBQUMsUUFBUSxFQUFFLEVBQUUsQ0FBQyxDQUFDO2dCQUM1RCxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUM7YUFDWjtZQUVELElBQUksTUFBTSxFQUFFO2dCQUNYLE9BQU8sQ0FBQyxHQUFHLENBQUMsV0FBVyxNQUFNLEVBQUUsQ0FBQyxDQUFDO2FBQ2pDO1lBRUQsSUFBSSxNQUFNLEVBQUU7Z0JBQ1gsT0FBTyxDQUFDLEdBQUcsQ0FBQyxXQUFXLE1BQU0sRUFBRSxDQUFDLENBQUM7YUFDakM7WUFFRCxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDakIsQ0FBQyxDQUNELENBQUM7UUFDRixNQUFNLEtBQUssR0FBRyxVQUFVLENBQUMsR0FBRyxFQUFFO1lBQzdCLFFBQVEsQ0FBQyxJQUFJLEVBQUUsQ0FBQztZQUNoQixNQUFNLENBQUMsSUFBSSxLQUFLLENBQUMsZ0RBQWdELENBQUMsQ0FBQyxDQUFDO1FBQ3JFLENBQUMsRUFBRSxFQUFFLEdBQUcsSUFBSSxDQUFDLENBQUM7UUFFZCxRQUFRLENBQUMsRUFBRSxDQUFDLE9BQU8sRUFBRSxHQUFHLENBQUMsRUFBRTtZQUMxQixZQUFZLENBQUMsS0FBSyxDQUFDLENBQUM7WUFDcEIsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQ2IsQ0FBQyxDQUFDLENBQUM7SUFDSixDQUFDLENBQUMsQ0FBQztBQUNKLENBQUM7QUFFRCxTQUFnQix5QkFBeUI7SUFDeEMsTUFBTSxNQUFNLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxrQkFBa0IsQ0FBQztJQUM5QyxPQUFPLENBQUMsQ0FBQyxDQUFDLE1BQU0sSUFBSSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksTUFBTSxDQUFDLE9BQU8sQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25GLENBQUM7QUFIRCw4REFHQztBQUVELFNBQWdCLHdCQUF3QixDQUFDLFdBQWdDO0lBQ3hFLElBQUk7UUFDSCxNQUFNLE1BQU0sR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLGtCQUFtQixDQUFDO1FBQy9DLE1BQU0sUUFBUSxHQUFHLE1BQU0sQ0FBQyxPQUFPLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztZQUN0RCxTQUFTLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztnQkFDM0IsQ0FBQyxDQUFDLENBQUMseUJBQXlCO1FBRTlCLE1BQU0sR0FBRyxHQUFHLEVBQUUsQ0FBQyxRQUFRLENBQUMsMkJBQTJCLENBQUMsQ0FBQztRQUNyRCxNQUFNLEtBQUssR0FBRyxRQUFRLENBQUMsR0FBRyxDQUFDLFFBQVEsRUFBRSxDQUFDLENBQUM7UUFFdkMsc0VBQXNFO1FBQ3RFLGtEQUFrRDtRQUNsRCxPQUFPLElBQUksQ0FBQyxxQkFBcUIsQ0FBQyxXQUFXLENBQUMsT0FBTyxDQUFDLEdBQUcsR0FBRyxHQUFHLEtBQUssR0FBRyxFQUFFLEdBQUcsUUFBUSxDQUFDO0tBQ3JGO0lBQUMsT0FBTyxDQUFDLEVBQUU7UUFDWCxNQUFNLElBQUksS0FBSyxDQUFDLG9DQUFvQyxHQUFHLENBQUMsQ0FBQyxRQUFRLEVBQUUsQ0FBQyxDQUFDO0tBQ3JFO0FBQ0YsQ0FBQztBQWhCRCw0REFnQkM7QUFFRCxLQUFLLFVBQVUsSUFBSTtJQUNsQixNQUFNLFVBQVUsR0FBRyxNQUFNLCtCQUErQixFQUFFLENBQUM7SUFFM0QsSUFBSSxDQUFDLFVBQVUsRUFBRTtRQUNoQixPQUFPO0tBQ1A7SUFFRCxNQUFNLHFCQUFxQixHQUFHLHdCQUF3QixDQUFDLFdBQVcsQ0FBQyxDQUFDO0lBRXBFLElBQUksQ0FBQyxxQkFBcUIsRUFBRTtRQUMzQixNQUFNLElBQUksS0FBSyxDQUFDLGdDQUFnQyxDQUFDLENBQUM7S0FDbEQ7SUFFRCxNQUFNLFVBQVUsR0FBRyxJQUFJLGlDQUFzQixDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsaUJBQWlCLENBQUUsRUFBRSxPQUFPLENBQUMsR0FBRyxDQUFDLGlCQUFpQixDQUFFLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxxQkFBcUIsQ0FBRSxDQUFDLENBQUM7SUFFckosT0FBTyxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtRQUMzQixHQUFHLENBQUMsR0FBRyxDQUFDLFVBQVUsQ0FBQzthQUNqQixJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sQ0FBQztZQUNsQixPQUFPLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxxQkFBcUI7WUFDMUMsVUFBVTtZQUNWLFNBQVMsRUFBRSxlQUFlO1lBQzFCLE1BQU0sRUFBRSxHQUFHLHFCQUFxQixJQUFJLE1BQU0sR0FBRztTQUM3QyxDQUFDLENBQUM7YUFDRixFQUFFLENBQUMsS0FBSyxFQUFFLEdBQUcsRUFBRSxDQUFDLENBQUMsRUFBRSxDQUFDO2FBQ3BCLEVBQUUsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxHQUFRLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO0lBQ3JDLENBQUMsQ0FBQyxDQUFDO0FBQ0osQ0FBQztBQUVELElBQUksT0FBTyxDQUFDLElBQUksS0FBSyxNQUFNLEVBQUU7SUFDNUIsSUFBSSxFQUFFLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1FBQ2xCLE9BQU8sQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUM7UUFDbkIsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUNqQixDQUFDLENBQUMsQ0FBQztDQUNIIn0= \ No newline at end of file diff --git a/build/azure-pipelines/upload-nlsmetadata.js b/build/azure-pipelines/upload-nlsmetadata.js index 34c2005a30f..5b6cd3ed1fd 100644 --- a/build/azure-pipelines/upload-nlsmetadata.js +++ b/build/azure-pipelines/upload-nlsmetadata.js @@ -16,13 +16,33 @@ const commit = process.env['BUILD_SOURCEVERSION']; const credential = new identity_1.ClientSecretCredential(process.env['AZURE_TENANT_ID'], process.env['AZURE_CLIENT_ID'], process.env['AZURE_CLIENT_SECRET']); function main() { return new Promise((c, e) => { - es.merge(vfs.src('out-vscode-web-min/nls.metadata.json', { base: 'out-vscode-web-min' }), vfs.src('.build/extensions/**/nls.metadata.json', { base: '.build/extensions' }), vfs.src('.build/extensions/**/nls.metadata.header.json', { base: '.build/extensions' }), vfs.src('.build/extensions/**/package.nls.json', { base: '.build/extensions' })) + const combinedMetadataJson = es.merge( + // vscode: we are not using `out-build/nls.metadata.json` here because + // it includes metadata for translators for `keys`. but for our purpose + // we want only the `keys` and `messages` as `string`. + es.merge(vfs.src('out-build/nls.keys.json', { base: 'out-build' }), vfs.src('out-build/nls.messages.json', { base: 'out-build' })) .pipe(merge({ + fileName: 'vscode.json', + jsonSpace: '', + concatArrays: true, + edit: (parsedJson, file) => { + if (file.base === 'out-build') { + if (file.basename === 'nls.keys.json') { + return { keys: parsedJson }; + } + else { + return { messages: parsedJson }; + } + } + } + })), + // extensions + vfs.src('.build/extensions/**/nls.metadata.json', { base: '.build/extensions' }), vfs.src('.build/extensions/**/nls.metadata.header.json', { base: '.build/extensions' }), vfs.src('.build/extensions/**/package.nls.json', { base: '.build/extensions' })).pipe(merge({ fileName: 'combined.nls.metadata.json', jsonSpace: '', concatArrays: true, edit: (parsedJson, file) => { - if (file.base === 'out-vscode-web-min') { + if (file.basename === 'vscode.json') { return { vscode: parsedJson }; } // Handle extensions and follow the same structure as the Core nls file. @@ -72,13 +92,15 @@ function main() { const key = manifestJson.publisher + '.' + manifestJson.name; return { [key]: parsedJson }; }, - })) + })); + const nlsMessagesJs = vfs.src('out-build/nls.messages.js', { base: 'out-build' }); + es.merge(combinedMetadataJson, nlsMessagesJs) .pipe(gzip({ append: false })) .pipe(vfs.dest('./nlsMetadata')) .pipe(es.through(function (data) { console.log(`Uploading ${data.path}`); // trigger artifact upload - console.log(`##vso[artifact.upload containerfolder=nlsmetadata;artifactname=combined.nls.metadata.json]${data.path}`); + console.log(`##vso[artifact.upload containerfolder=nlsmetadata;artifactname=${data.basename}]${data.path}`); this.emit('data', data); })) .pipe(azure.upload({ diff --git a/build/azure-pipelines/upload-nlsmetadata.ts b/build/azure-pipelines/upload-nlsmetadata.ts index 416d0eec408..030cc8f0e5a 100644 --- a/build/azure-pipelines/upload-nlsmetadata.ts +++ b/build/azure-pipelines/upload-nlsmetadata.ts @@ -24,79 +24,103 @@ interface NlsMetadata { function main(): Promise { return new Promise((c, e) => { + const combinedMetadataJson = es.merge( + // vscode: we are not using `out-build/nls.metadata.json` here because + // it includes metadata for translators for `keys`. but for our purpose + // we want only the `keys` and `messages` as `string`. + es.merge( + vfs.src('out-build/nls.keys.json', { base: 'out-build' }), + vfs.src('out-build/nls.messages.json', { base: 'out-build' })) + .pipe(merge({ + fileName: 'vscode.json', + jsonSpace: '', + concatArrays: true, + edit: (parsedJson, file) => { + if (file.base === 'out-build') { + if (file.basename === 'nls.keys.json') { + return { keys: parsedJson }; + } else { + return { messages: parsedJson }; + } + } + } + })), - es.merge( - vfs.src('out-vscode-web-min/nls.metadata.json', { base: 'out-vscode-web-min' }), + // extensions vfs.src('.build/extensions/**/nls.metadata.json', { base: '.build/extensions' }), vfs.src('.build/extensions/**/nls.metadata.header.json', { base: '.build/extensions' }), - vfs.src('.build/extensions/**/package.nls.json', { base: '.build/extensions' })) - .pipe(merge({ - fileName: 'combined.nls.metadata.json', - jsonSpace: '', - concatArrays: true, - edit: (parsedJson, file) => { - if (file.base === 'out-vscode-web-min') { - return { vscode: parsedJson }; - } + vfs.src('.build/extensions/**/package.nls.json', { base: '.build/extensions' }) + ).pipe(merge({ + fileName: 'combined.nls.metadata.json', + jsonSpace: '', + concatArrays: true, + edit: (parsedJson, file) => { + if (file.basename === 'vscode.json') { + return { vscode: parsedJson }; + } - // Handle extensions and follow the same structure as the Core nls file. - switch (file.basename) { - case 'package.nls.json': - // put package.nls.json content in Core NlsMetadata format - // language packs use the key "package" to specify that - // translations are for the package.json file - parsedJson = { - messages: { - package: Object.values(parsedJson) - }, - keys: { - package: Object.keys(parsedJson) - }, - bundles: { - main: ['package'] - } - }; - break; + // Handle extensions and follow the same structure as the Core nls file. + switch (file.basename) { + case 'package.nls.json': + // put package.nls.json content in Core NlsMetadata format + // language packs use the key "package" to specify that + // translations are for the package.json file + parsedJson = { + messages: { + package: Object.values(parsedJson) + }, + keys: { + package: Object.keys(parsedJson) + }, + bundles: { + main: ['package'] + } + }; + break; - case 'nls.metadata.header.json': - parsedJson = { header: parsedJson }; - break; + case 'nls.metadata.header.json': + parsedJson = { header: parsedJson }; + break; - case 'nls.metadata.json': { - // put nls.metadata.json content in Core NlsMetadata format - const modules = Object.keys(parsedJson); + case 'nls.metadata.json': { + // put nls.metadata.json content in Core NlsMetadata format + const modules = Object.keys(parsedJson); - const json: NlsMetadata = { - keys: {}, - messages: {}, - bundles: { - main: [] - } - }; - for (const module of modules) { - json.messages[module] = parsedJson[module].messages; - json.keys[module] = parsedJson[module].keys; - json.bundles.main.push(module); + const json: NlsMetadata = { + keys: {}, + messages: {}, + bundles: { + main: [] } - parsedJson = json; - break; + }; + for (const module of modules) { + json.messages[module] = parsedJson[module].messages; + json.keys[module] = parsedJson[module].keys; + json.bundles.main.push(module); } + parsedJson = json; + break; } + } - // Get extension id and use that as the key - const folderPath = path.join(file.base, file.relative.split('/')[0]); - const manifest = readFileSync(path.join(folderPath, 'package.json'), 'utf-8'); - const manifestJson = JSON.parse(manifest); - const key = manifestJson.publisher + '.' + manifestJson.name; - return { [key]: parsedJson }; - }, - })) + // Get extension id and use that as the key + const folderPath = path.join(file.base, file.relative.split('/')[0]); + const manifest = readFileSync(path.join(folderPath, 'package.json'), 'utf-8'); + const manifestJson = JSON.parse(manifest); + const key = manifestJson.publisher + '.' + manifestJson.name; + return { [key]: parsedJson }; + }, + })); + + const nlsMessagesJs = vfs.src('out-build/nls.messages.js', { base: 'out-build' }); + + es.merge(combinedMetadataJson, nlsMessagesJs) .pipe(gzip({ append: false })) .pipe(vfs.dest('./nlsMetadata')) .pipe(es.through(function (data: Vinyl) { console.log(`Uploading ${data.path}`); // trigger artifact upload - console.log(`##vso[artifact.upload containerfolder=nlsmetadata;artifactname=combined.nls.metadata.json]${data.path}`); + console.log(`##vso[artifact.upload containerfolder=nlsmetadata;artifactname=${data.basename}]${data.path}`); this.emit('data', data); })) .pipe(azure.upload({ diff --git a/build/azure-pipelines/upload-sourcemaps.js b/build/azure-pipelines/upload-sourcemaps.js index 7cd68398734..2a01ab79d6b 100644 --- a/build/azure-pipelines/upload-sourcemaps.js +++ b/build/azure-pipelines/upload-sourcemaps.js @@ -8,6 +8,7 @@ const path = require("path"); const es = require("event-stream"); const vfs = require("vinyl-fs"); const util = require("../lib/util"); +const amd_1 = require("../lib/amd"); // @ts-ignore const deps = require("../lib/dependencies"); const identity_1 = require("@azure/identity"); @@ -25,13 +26,16 @@ function src(base, maps = `${base}/**/*.map`) { })); } function main() { + if ((0, amd_1.isAMD)()) { + return Promise.resolve(); // in AMD we run into some issues, but we want to unblock the build for recovery + } const sources = []; // vscode client maps (default) if (!base) { const vs = src('out-vscode-min'); // client source-maps only sources.push(vs); const productionDependencies = deps.getProductionDependencies(root); - const productionDependenciesSrc = productionDependencies.map(d => path.relative(root, d.path)).map(d => `./${d}/**/*.map`); + const productionDependenciesSrc = productionDependencies.map(d => path.relative(root, d)).map(d => `./${d}/**/*.map`); const nodeModules = vfs.src(productionDependenciesSrc, { base: '.' }) .pipe(util.cleanNodeModules(path.join(root, 'build', '.moduleignore'))) .pipe(util.cleanNodeModules(path.join(root, 'build', `.moduleignore.${process.platform}`))); diff --git a/build/azure-pipelines/upload-sourcemaps.ts b/build/azure-pipelines/upload-sourcemaps.ts index 366ad945499..aed6446d7e5 100644 --- a/build/azure-pipelines/upload-sourcemaps.ts +++ b/build/azure-pipelines/upload-sourcemaps.ts @@ -8,6 +8,7 @@ import * as es from 'event-stream'; import * as Vinyl from 'vinyl'; import * as vfs from 'vinyl-fs'; import * as util from '../lib/util'; +import { isAMD } from '../lib/amd'; // @ts-ignore import * as deps from '../lib/dependencies'; import { ClientSecretCredential } from '@azure/identity'; @@ -29,6 +30,9 @@ function src(base: string, maps = `${base}/**/*.map`) { } function main(): Promise { + if (isAMD()) { + return Promise.resolve(); // in AMD we run into some issues, but we want to unblock the build for recovery + } const sources: any[] = []; // vscode client maps (default) @@ -36,8 +40,8 @@ function main(): Promise { const vs = src('out-vscode-min'); // client source-maps only sources.push(vs); - const productionDependencies: { name: string; path: string; version: string }[] = deps.getProductionDependencies(root); - const productionDependenciesSrc = productionDependencies.map(d => path.relative(root, d.path)).map(d => `./${d}/**/*.map`); + const productionDependencies = deps.getProductionDependencies(root); + const productionDependenciesSrc = productionDependencies.map(d => path.relative(root, d)).map(d => `./${d}/**/*.map`); const nodeModules = vfs.src(productionDependenciesSrc, { base: '.' }) .pipe(util.cleanNodeModules(path.join(root, 'build', '.moduleignore'))) .pipe(util.cleanNodeModules(path.join(root, 'build', `.moduleignore.${process.platform}`))); diff --git a/build/azure-pipelines/web/product-build-web.yml b/build/azure-pipelines/web/product-build-web.yml index 5e423d077c7..75cf20bfc94 100644 --- a/build/azure-pipelines/web/product-build-web.yml +++ b/build/azure-pipelines/web/product-build-web.yml @@ -7,7 +7,7 @@ steps: - template: ../distro/download-distro.yml@self - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" @@ -27,12 +27,12 @@ steps: condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Registry - - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js web > .build/yarnlockhash + - script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js web > .build/packagelockhash displayName: Prepare node_modules cache key - task: Cache@2 inputs: - key: '"node_modules" | .build/yarnlockhash' + key: '"node_modules" | .build/packagelockhash' path: .build/node_modules_cache cacheHitVar: NODE_MODULES_RESTORED displayName: Restore node_modules cache @@ -43,18 +43,17 @@ steps: - script: | set -e - npm config set registry "$NPM_REGISTRY" --location=project - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - echo "always-auth=true" >> .npmrc - yarn config set registry "$NPM_REGISTRY" + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + npm config set registry "$NPM_REGISTRY" + echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)" condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: .npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication @@ -65,12 +64,12 @@ steps: - script: | set -e for i in {1..5}; do # try 5 times - yarn --frozen-lockfile --check-files && break - if [ $i -eq 3 ]; then - echo "Yarn failed too many times" >&2 + npm ci && break + if [ $i -eq 5 ]; then + echo "Npm install failed too many times" >&2 exit 1 fi - echo "Yarn failed $i, trying again..." + echo "Npm install failed $i, trying again..." done env: ELECTRON_SKIP_BINARY_DOWNLOAD: 1 @@ -98,13 +97,12 @@ steps: - script: | set -e - yarn gulp vscode-web-min-ci + npm run gulp vscode-web-min-ci ARCHIVE_PATH=".build/web/vscode-web.tar.gz" mkdir -p $(dirname $ARCHIVE_PATH) tar --owner=0 --group=0 -czf $ARCHIVE_PATH -C .. vscode-web echo "##vso[task.setvariable variable=WEB_PATH]$ARCHIVE_PATH" env: - DISABLE_V8_COMPILE_CACHE: 1 # Disable v8 cache used by yarn v1.x, refs https://github.com/nodejs/node/issues/51555 GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Build @@ -152,7 +150,7 @@ steps: - script: | set -e - AZURE_STORAGE_ACCOUNT="ticino" \ + AZURE_STORAGE_ACCOUNT="vscodeweb" \ AZURE_TENANT_ID="$(AZURE_TENANT_ID)" \ AZURE_CLIENT_ID="$(AZURE_CLIENT_ID)" \ AZURE_CLIENT_SECRET="$(AZURE_CLIENT_SECRET)" \ diff --git a/build/azure-pipelines/win32/product-build-win32-cli-sign.yml b/build/azure-pipelines/win32/product-build-win32-cli-sign.yml index 3b5668d0082..62b1b715af2 100644 --- a/build/azure-pipelines/win32/product-build-win32-cli-sign.yml +++ b/build/azure-pipelines/win32/product-build-win32-cli-sign.yml @@ -17,21 +17,20 @@ steps: displayName: Setup NPM Registry - powershell: | - . azure-pipelines/win32/exec.ps1 + . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" - exec { npm config set registry "$env:NPM_REGISTRY" --location=project } - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - exec { Add-Content -Path .npmrc -Value "always-auth=true" } - exec { yarn config set registry "$env:NPM_REGISTRY" } - workingDirectory: build + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + exec { npm config set registry "$env:NPM_REGISTRY" } + $NpmrcPath = (npm config get userconfig) + echo "##vso[task.setvariable variable=NPMRC_PATH]$NpmrcPath" condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: build/.npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication @@ -40,7 +39,7 @@ steps: . azure-pipelines/win32/retry.ps1 $ErrorActionPreference = "Stop" $env:CHILD_CONCURRENCY="1" - retry { exec { yarn --frozen-lockfile --check-files } } + retry { exec { npm ci } } workingDirectory: build displayName: Install build dependencies diff --git a/build/azure-pipelines/win32/product-build-win32-test.yml b/build/azure-pipelines/win32/product-build-win32-test.yml index ce791c094e6..6c6a0949d0d 100644 --- a/build/azure-pipelines/win32/product-build-win32-test.yml +++ b/build/azure-pipelines/win32/product-build-win32-test.yml @@ -12,9 +12,12 @@ parameters: - name: PUBLISH_TASK_NAME type: string default: PublishPipelineArtifact@0 + - name: VSCODE_BUILD_AMD + type: boolean + default: false steps: - - powershell: yarn npm-run-all -lp "electron $(VSCODE_ARCH)" "playwright-install" + - powershell: npm exec -- npm-run-all -lp "electron $(VSCODE_ARCH)" "playwright-install" env: GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Download Electron and Playwright @@ -22,36 +25,54 @@ steps: - ${{ if eq(parameters.VSCODE_RUN_UNIT_TESTS, true) }}: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - powershell: .\scripts\test.bat --tfs "Unit Tests" - displayName: Run unit tests (Electron) - timeoutInMinutes: 15 - - - powershell: yarn test-node - displayName: Run unit tests (node.js) - timeoutInMinutes: 15 - - - powershell: node test/unit/browser/index.js --sequential --browser chromium --tfs "Browser Unit Tests" - displayName: Run unit tests (Browser, Chromium) - timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - powershell: .\scripts\test-amd.bat --tfs "Unit Tests" + displayName: Run unit tests (Electron) [AMD] + timeoutInMinutes: 15 + - powershell: npm run test-node-amd + displayName: Run unit tests (node.js) [AMD] + timeoutInMinutes: 15 + - powershell: node test/unit/browser/index.amd.js --sequential --browser chromium --tfs "Browser Unit Tests" + displayName: Run unit tests (Browser, Chromium) [AMD] + timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - powershell: .\scripts\test.bat --tfs "Unit Tests" + displayName: Run unit tests (Electron) + timeoutInMinutes: 15 + - powershell: npm run test-node + displayName: Run unit tests (node.js) + timeoutInMinutes: 15 + - powershell: node test/unit/browser/index.js --sequential --browser chromium --tfs "Browser Unit Tests" + displayName: Run unit tests (Browser, Chromium) + timeoutInMinutes: 20 - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - - powershell: .\scripts\test.bat --build --tfs "Unit Tests" - displayName: Run unit tests (Electron) - timeoutInMinutes: 15 - - - powershell: yarn test-node --build - displayName: Run unit tests (node.js) - timeoutInMinutes: 15 - - - powershell: yarn test-browser-no-install --sequential --build --browser chromium --tfs "Browser Unit Tests" - displayName: Run unit tests (Browser, Chromium) - timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - powershell: .\scripts\test-amd.bat --build --tfs "Unit Tests" + displayName: Run unit tests (Electron) [AMD] + timeoutInMinutes: 15 + - script: npm run test-node-amd -- --build + displayName: Run unit tests (node.js) [AMD] + timeoutInMinutes: 15 + - powershell: npm run test-browser-amd-no-install -- --sequential --build --browser chromium --tfs "Browser Unit Tests" + displayName: Run unit tests (Browser, Chromium) [AMD] + timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - powershell: .\scripts\test.bat --build --tfs "Unit Tests" + displayName: Run unit tests (Electron) + timeoutInMinutes: 15 + - powershell: npm run test-node -- --build + displayName: Run unit tests (node.js) + timeoutInMinutes: 15 + - powershell: npm run test-browser-no-install -- --sequential --build --browser chromium --tfs "Browser Unit Tests" + displayName: Run unit tests (Browser, Chromium) + timeoutInMinutes: 20 - ${{ if eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true) }}: - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" - exec { yarn gulp ` + exec { npm run gulp ` compile-extension:configuration-editing ` compile-extension:css-language-features-server ` compile-extension:emmet ` @@ -61,7 +82,6 @@ steps: compile-extension:ipynb ` compile-extension:notebook-renderers ` compile-extension:json-language-features-server ` - compile-extension:markdown-language-features-server ` compile-extension:markdown-language-features ` compile-extension-media ` compile-extension:microsoft-authentication ` @@ -78,12 +98,17 @@ steps: condition: succeededOrFailed() - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - powershell: .\scripts\test-integration.bat --tfs "Integration Tests" - displayName: Run integration tests (Electron) - timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - powershell: .\scripts\test-integration-amd.bat --tfs "Integration Tests" + displayName: Run integration tests (Electron) [AMD] + timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - powershell: .\scripts\test-integration.bat --tfs "Integration Tests" + displayName: Run integration tests (Electron) + timeoutInMinutes: 20 - - powershell: .\scripts\test-web-integration.bat --browser firefox - displayName: Run integration tests (Browser, Firefox) + - powershell: .\scripts\test-web-integration.bat --browser chromium + displayName: Run integration tests (Browser, Chromium) timeoutInMinutes: 20 - powershell: .\scripts\test-remote-integration.bat @@ -91,20 +116,36 @@ steps: timeoutInMinutes: 20 - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - - powershell: | - # Figure out the full absolute path of the product we just built - # including the remote server and configure the integration tests - # to run with these builds instead of running out of sources. - . build/azure-pipelines/win32/exec.ps1 - $ErrorActionPreference = "Stop" - $AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)" - $AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json - $AppNameShort = $AppProductJson.nameShort - $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe" - $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)" - exec { .\scripts\test-integration.bat --build --tfs "Integration Tests" } - displayName: Run integration tests (Electron) - timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}: + - powershell: | + # Figure out the full absolute path of the product we just built + # including the remote server and configure the integration tests + # to run with these builds instead of running out of sources. + . build/azure-pipelines/win32/exec.ps1 + $ErrorActionPreference = "Stop" + $AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)" + $AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json + $AppNameShort = $AppProductJson.nameShort + $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe" + $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)" + exec { .\scripts\test-integration-amd.bat --build --tfs "Integration Tests" } + displayName: Run integration tests (Electron) [AMD] + timeoutInMinutes: 20 + - ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}: + - powershell: | + # Figure out the full absolute path of the product we just built + # including the remote server and configure the integration tests + # to run with these builds instead of running out of sources. + . build/azure-pipelines/win32/exec.ps1 + $ErrorActionPreference = "Stop" + $AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)" + $AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json + $AppNameShort = $AppProductJson.nameShort + $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe" + $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)" + exec { .\scripts\test-integration.bat --build --tfs "Integration Tests" } + displayName: Run integration tests (Electron) + timeoutInMinutes: 20 - powershell: | . build/azure-pipelines/win32/exec.ps1 @@ -138,32 +179,33 @@ steps: condition: succeededOrFailed() - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - powershell: yarn --cwd test/smoke compile + - powershell: npm run compile + workingDirectory: test/smoke displayName: Compile smoke tests - - powershell: yarn gulp compile-extension-media + - powershell: npm run gulp compile-extension-media displayName: Build extensions for smoke tests - - powershell: yarn smoketest-no-compile --tracing + - powershell: npm run smoketest-no-compile -- --tracing displayName: Run smoke tests (Electron) timeoutInMinutes: 20 - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - - powershell: yarn smoketest-no-compile --tracing --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)" + - powershell: npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)" displayName: Run smoke tests (Electron) timeoutInMinutes: 20 - - powershell: yarn smoketest-no-compile --web --tracing --headless + - powershell: npm run smoketest-no-compile -- --web --tracing --headless env: VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)-web displayName: Run smoke tests (Browser, Chromium) timeoutInMinutes: 20 - - powershell: yarn gulp compile-extension:vscode-test-resolver + - powershell: npm run gulp compile-extension:vscode-test-resolver displayName: Compile test resolver extension timeoutInMinutes: 20 - - powershell: yarn smoketest-no-compile --tracing --remote --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)" + - powershell: npm run smoketest-no-compile -- --tracing --remote --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)" env: VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH) displayName: Run smoke tests (Remote) diff --git a/build/azure-pipelines/win32/product-build-win32.yml b/build/azure-pipelines/win32/product-build-win32.yml index d3827b930f8..dddcb34a894 100644 --- a/build/azure-pipelines/win32/product-build-win32.yml +++ b/build/azure-pipelines/win32/product-build-win32.yml @@ -11,6 +11,9 @@ parameters: type: boolean - name: VSCODE_RUN_SMOKE_TESTS type: boolean + - name: VSCODE_BUILD_AMD + type: boolean + default: false steps: - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: @@ -32,7 +35,7 @@ steps: - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: - template: ../distro/download-distro.yml@self - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" @@ -57,12 +60,12 @@ steps: - pwsh: | mkdir .build -ea 0 - node build/azure-pipelines/common/computeNodeModulesCacheKey.js win32 $(VSCODE_ARCH) > .build/yarnlockhash + node build/azure-pipelines/common/computeNodeModulesCacheKey.js win32 $(VSCODE_ARCH) > .build/packagelockhash displayName: Prepare node_modules cache key - task: Cache@2 inputs: - key: '"node_modules" | .build/yarnlockhash' + key: '"node_modules" | .build/packagelockhash' path: .build/node_modules_cache cacheHitVar: NODE_MODULES_RESTORED displayName: Restore node_modules cache @@ -74,18 +77,18 @@ steps: - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" - exec { npm config set registry "$env:NPM_REGISTRY" --location=project } - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - exec { Add-Content -Path .npmrc -Value "always-auth=true" } - exec { yarn config set registry "$env:NPM_REGISTRY" } + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + exec { npm config set registry "$env:NPM_REGISTRY" } + $NpmrcPath = (npm config get userconfig) + echo "##vso[task.setvariable variable=NPMRC_PATH]$NpmrcPath" condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) - displayName: Setup NPM & Yarn + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: .npmrc + workingFile: $(NPMRC_PATH) condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication @@ -93,7 +96,7 @@ steps: . build/azure-pipelines/win32/exec.ps1 . build/azure-pipelines/win32/retry.ps1 $ErrorActionPreference = "Stop" - retry { exec { yarn --frozen-lockfile --check-files } } + retry { exec { npm ci } } env: npm_config_arch: $(VSCODE_ARCH) CHILD_CONCURRENCY: 1 @@ -129,7 +132,7 @@ steps: retryCountOnTaskFailure: 3 - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}: - - powershell: yarn gulp "transpile-client-swc" "transpile-extensions" + - powershell: npm run gulp "transpile-client-swc" "transpile-extensions" env: GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Transpile client and extensions @@ -142,8 +145,8 @@ steps: - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" - exec { yarn gulp "vscode-win32-$(VSCODE_ARCH)-min-ci" } - exec { yarn gulp "vscode-win32-$(VSCODE_ARCH)-inno-updater" } + exec { npm run gulp "vscode-win32-$(VSCODE_ARCH)-min-ci" } + exec { npm run gulp "vscode-win32-$(VSCODE_ARCH)-inno-updater" } echo "##vso[task.setvariable variable=BUILT_CLIENT]true" echo "##vso[task.setvariable variable=CodeSigningFolderPath]$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)" env: @@ -153,25 +156,23 @@ steps: - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" - exec { yarn gulp "vscode-reh-win32-$(VSCODE_ARCH)-min-ci" } + exec { npm run gulp "vscode-reh-win32-$(VSCODE_ARCH)-min-ci" } mv ..\vscode-reh-win32-$(VSCODE_ARCH) ..\vscode-server-win32-$(VSCODE_ARCH) # TODO@joaomoreno echo "##vso[task.setvariable variable=BUILT_SERVER]true" echo "##vso[task.setvariable variable=CodeSigningFolderPath]$(CodeSigningFolderPath),$(agent.builddirectory)/vscode-server-win32-$(VSCODE_ARCH)" env: GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Build server - condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'arm64')) - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" - exec { yarn gulp "vscode-reh-web-win32-$(VSCODE_ARCH)-min-ci" } + exec { npm run gulp "vscode-reh-web-win32-$(VSCODE_ARCH)-min-ci" } mv ..\vscode-reh-web-win32-$(VSCODE_ARCH) ..\vscode-server-win32-$(VSCODE_ARCH)-web # TODO@joaomoreno echo "##vso[task.setvariable variable=BUILT_WEB]true" env: GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Build server (web) - condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'arm64')) - ${{ if or(eq(parameters.VSCODE_RUN_UNIT_TESTS, true), eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true), eq(parameters.VSCODE_RUN_SMOKE_TESTS, true)) }}: - template: product-build-win32-test.yml@self @@ -181,6 +182,7 @@ steps: VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }} VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }} VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }} + VSCODE_BUILD_AMD: ${{ parameters.VSCODE_BUILD_AMD }} ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}: PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1 @@ -273,7 +275,7 @@ steps: $env:ESRPPKI = "$(ESRP-PKI)" $env:ESRPAADUsername = "$(esrp-aad-username)" $env:ESRPAADPassword = "$(esrp-aad-password)" - exec { yarn gulp "vscode-win32-$(VSCODE_ARCH)-system-setup" --sign } + exec { npm run -- gulp "vscode-win32-$(VSCODE_ARCH)-system-setup" --sign } $SetupPath = ".build\win32-$(VSCODE_ARCH)\system-setup\VSCodeSetup-$(VSCODE_ARCH)-$(VSCODE_VERSION).exe" mv .build\win32-$(VSCODE_ARCH)\system-setup\VSCodeSetup.exe $SetupPath echo "##vso[task.setvariable variable=SYSTEM_SETUP_PATH]$SetupPath" @@ -285,7 +287,7 @@ steps: $env:ESRPPKI = "$(ESRP-PKI)" $env:ESRPAADUsername = "$(esrp-aad-username)" $env:ESRPAADPassword = "$(esrp-aad-password)" - exec { yarn gulp "vscode-win32-$(VSCODE_ARCH)-user-setup" --sign } + exec { npm run -- gulp "vscode-win32-$(VSCODE_ARCH)-user-setup" --sign } $SetupPath = ".build\win32-$(VSCODE_ARCH)\user-setup\VSCodeUserSetup-$(VSCODE_ARCH)-$(VSCODE_VERSION).exe" mv .build\win32-$(VSCODE_ARCH)\user-setup\VSCodeSetup.exe $SetupPath echo "##vso[task.setvariable variable=USER_SETUP_PATH]$SetupPath" @@ -312,7 +314,7 @@ steps: sbomBuildDropPath: $(Agent.BuildDirectory)/vscode-server-win32-$(VSCODE_ARCH) sbomPackageName: "VS Code Windows $(VSCODE_ARCH) Server" sbomPackageVersion: $(Build.SourceVersion) - condition: and(succeededOrFailed(), ne(variables['SERVER_PATH'], ''), ne(variables['VSCODE_ARCH'], 'arm64')) + condition: and(succeededOrFailed(), ne(variables['SERVER_PATH'], '')) displayName: Publish server archive - task: 1ES.PublishPipelineArtifact@1 @@ -322,7 +324,7 @@ steps: sbomBuildDropPath: $(Agent.BuildDirectory)/vscode-server-win32-$(VSCODE_ARCH)-web sbomPackageName: "VS Code Windows $(VSCODE_ARCH) Web" sbomPackageVersion: $(Build.SourceVersion) - condition: and(succeededOrFailed(), ne(variables['WEB_PATH'], ''), ne(variables['VSCODE_ARCH'], 'arm64')) + condition: and(succeededOrFailed(), ne(variables['WEB_PATH'], '')) displayName: Publish web server archive - task: 1ES.PublishPipelineArtifact@1 diff --git a/build/azure-pipelines/sdl-scan.yml b/build/azure-pipelines/win32/sdl-scan-win32.yml similarity index 51% rename from build/azure-pipelines/sdl-scan.yml rename to build/azure-pipelines/win32/sdl-scan-win32.yml index af20a305d9c..fc40b9a0e60 100644 --- a/build/azure-pipelines/sdl-scan.yml +++ b/build/azure-pipelines/win32/sdl-scan-win32.yml @@ -1,14 +1,8 @@ parameters: - - name: NPM_REGISTRY - displayName: "Custom NPM Registry" - type: string - default: "https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/npm/registry/" - - name: NPM_ARCH - type: string - default: x64 - name: VSCODE_ARCH type: string - default: x64 + - name: VSCODE_QUALITY + type: string steps: - task: NodeTool@0 @@ -17,49 +11,48 @@ steps: versionFilePath: .nvmrc nodejsMirror: https://github.com/joaomoreno/node-mirror/releases/download - - template: ./distro/download-distro.yml + - task: UsePythonVersion@0 + inputs: + versionSpec: "3.x" + addToPath: true + + - template: ../distro/download-distro.yml@self - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 displayName: "Azure Key Vault: Get Secrets" inputs: azureSubscription: "vscode-builds-subscription" KeyVaultName: vscode-build-secrets SecretsFilter: "github-distro-mixin-password" + - powershell: node build/setup-npm-registry.js $env:NPM_REGISTRY + condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) + displayName: Setup NPM Registry + - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" - exec { npm config set registry "${{ parameters.NPM_REGISTRY }}" --location=project } - # npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb - # following is a workaround for yarn to send authorization header - # for GET requests to the registry. - exec { Add-Content -Path .npmrc -Value "always-auth=true" } - exec { yarn config set registry "${{ parameters.NPM_REGISTRY }}" } - condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne('${{ parameters.NPM_REGISTRY }}', 'none')) - displayName: Setup NPM & Yarn + # Set the private NPM registry to the global npmrc file + # so that authentication works for subfolders like build/, remote/, extensions/ etc + # which does not have their own .npmrc file + exec { npm config set registry "$env:NPM_REGISTRY" } + $NpmrcPath = (npm config get userconfig) + echo "##vso[task.setvariable variable=NPMRC_PATH]$NpmrcPath" + condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) + displayName: Setup NPM - task: npmAuthenticate@0 inputs: - workingFile: .npmrc - condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne('${{ parameters.NPM_REGISTRY }}', 'none')) + workingFile: $(NPMRC_PATH) + condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none')) displayName: Setup NPM Authentication - - powershell: | - . build/azure-pipelines/win32/exec.ps1 - $ErrorActionPreference = "Stop" - exec { node build/setup-npm-registry.js "${{ parameters.NPM_REGISTRY }}" } - condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne('${{ parameters.NPM_REGISTRY }}', 'none')) - displayName: Setup NPM Registry - - pwsh: | $includes = @' { 'target_defaults': { 'conditions': [ ['OS=="win"', { - 'msvs_configuration_attributes': { - 'SpectreMitigation': 'Spectre' - }, 'msvs_settings': { 'VCCLCompilerTool': { 'AdditionalOptions': [ @@ -89,11 +82,13 @@ steps: . build/azure-pipelines/win32/exec.ps1 . build/azure-pipelines/win32/retry.ps1 $ErrorActionPreference = "Stop" - retry { exec { yarn --frozen-lockfile --check-files } } + retry { exec { npm ci } } env: + npm_config_arch: ${{ parameters.VSCODE_ARCH }} + CHILD_CONCURRENCY: 1 + ELECTRON_SKIP_BINARY_DOWNLOAD: 1 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 GITHUB_TOKEN: "$(github-distro-mixin-password)" - CHILD_CONCURRENCY: 1 displayName: Install dependencies - script: node build/azure-pipelines/distro/mixin-npm @@ -102,46 +97,62 @@ steps: - script: node build/azure-pipelines/distro/mixin-quality displayName: Mixin distro quality env: - VSCODE_QUALITY: stable + VSCODE_QUALITY: ${{ parameters.VSCODE_QUALITY }} - - powershell: yarn compile + - powershell: npm run compile displayName: Compile - - powershell: yarn gulp "vscode-symbols-win32-${{ parameters.VSCODE_ARCH }}" + - powershell: | + Get-ChildItem '$(Build.SourcesDirectory)' -Recurse -Filter "*.exe" + Get-ChildItem '$(Build.SourcesDirectory)' -Recurse -Filter "*.dll" + Get-ChildItem '$(Build.SourcesDirectory)' -Recurse -Filter "*.node" + Get-ChildItem '$(Build.SourcesDirectory)' -Recurse -Filter "*.pdb" + displayName: List files + + - powershell: npm run gulp "vscode-symbols-win32-${{ parameters.VSCODE_ARCH }}" env: GITHUB_TOKEN: "$(github-distro-mixin-password)" displayName: Download Symbols + - powershell: | + Get-ChildItem '$(Agent.BuildDirectory)\scanbin' -Recurse -Filter "*.exe" + Get-ChildItem '$(Agent.BuildDirectory)\scanbin' -Recurse -Filter "*.dll" + Get-ChildItem '$(Agent.BuildDirectory)\scanbin' -Recurse -Filter "*.node" + Get-ChildItem '$(Agent.BuildDirectory)\scanbin' -Recurse -Filter "*.pdb" + displayName: List files again + - task: BinSkim@4 inputs: InputType: "Basic" Function: "analyze" TargetPattern: "guardianGlob" AnalyzeIgnorePdbLoadError: true - AnalyzeTargetGlob: '$(agent.builddirectory)\scanbin\**.dll;$(agent.builddirectory)\scanbin\**.exe;$(agent.builddirectory)\scanbin\**.node' - AnalyzeLocalSymbolDirectories: '$(agent.builddirectory)\scanbin\VSCode-win32-${{ parameters.VSCODE_ARCH }}\pdb' + AnalyzeTargetGlob: '$(Agent.BuildDirectory)\scanbin\**.dll;$(Agent.BuildDirectory)\scanbin\**.exe;$(Agent.BuildDirectory)\scanbin\**.node' + AnalyzeLocalSymbolDirectories: '$(Agent.BuildDirectory)\scanbin\VSCode-win32-${{ parameters.VSCODE_ARCH }}\pdb' - task: CopyFiles@2 displayName: 'Collect Symbols for API Scan' inputs: SourceFolder: $(Agent.BuildDirectory) Contents: 'scanbin\**\*.pdb' - TargetFolder: '$(agent.builddirectory)\symbols' + TargetFolder: '$(Agent.BuildDirectory)\symbols' flattenFolders: true condition: succeeded() - # - task: APIScan@2 - # inputs: - # softwareFolder: $(agent.builddirectory)\scanbin - # softwareName: 'vscode-client' - # softwareVersionNum: '1' - # symbolsFolder: 'SRV*http://symweb;$(agent.builddirectory)\symbols' - # isLargeApp: false - # toolVersion: 'Latest' - # displayName: Run ApiScan - # condition: succeeded() - # env: - # AzureServicesAuthConnectionString: $(apiscan-connectionstring) + - task: APIScan@2 + inputs: + softwareFolder: $(Agent.BuildDirectory)\scanbin + softwareName: 'vscode-client' + softwareVersionNum: '1' + symbolsFolder: 'srv*https://symweb.azurefd.net;$(Agent.BuildDirectory)\symbols' + isLargeApp: false + toolVersion: 'Latest' + azureSubscription: 'vscode-apiscan' + displayName: Run ApiScan + condition: succeeded() + env: + AzureServicesAuthConnectionString: $(apiscan-connectionstring) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) - task: PublishSecurityAnalysisLogs@3 inputs: diff --git a/build/buildfile.js b/build/buildfile.js new file mode 100644 index 00000000000..0e323ac0faf --- /dev/null +++ b/build/buildfile.js @@ -0,0 +1,120 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +const { isAMD } = require('./lib/amd'); + +/** + * @param {string} name + * @param {string[]=} exclude + * @returns {import('./lib/bundle').IEntryPoint} + */ +function createModuleDescription(name, exclude) { + + let excludes = ['vs/css']; + if (Array.isArray(exclude) && exclude.length > 0) { + excludes = excludes.concat(exclude); + } + + return { + name: name, + include: [], + exclude: excludes + }; +} + +/** + * @param {string} name + */ +function createEditorWorkerModuleDescription(name) { + const amdVariant = createModuleDescription(name, ['vs/base/common/worker/simpleWorker', 'vs/editor/common/services/editorSimpleWorker']); + amdVariant.target = 'amd'; + + const esmVariant = { ...amdVariant, dest: undefined }; + esmVariant.target = 'esm'; + esmVariant.name = `${esmVariant.name}.esm`; + + return [amdVariant, esmVariant]; +} + +// TODO@esm take the editor simple worker top level and rename away from "base" +exports.base = [ + { + name: 'vs/editor/common/services/editorSimpleWorker', + include: ['vs/base/common/worker/simpleWorker'], + exclude: [], + prepend: [ + { path: 'vs/loader.js' }, + { path: 'vs/base/worker/workerMain.js' } + ], + dest: 'vs/base/worker/workerMain.js', + target: 'amd' + }, + { + name: 'vs/editor/common/services/editorSimpleWorker.esm', + target: 'esm' + }, + { + name: 'vs/base/common/worker/simpleWorker', + exclude: [], + target: 'amd' + } +]; + +exports.workerExtensionHost = createEditorWorkerModuleDescription('vs/workbench/api/worker/extensionHostWorker'); +exports.workerNotebook = createEditorWorkerModuleDescription('vs/workbench/contrib/notebook/common/services/notebookSimpleWorker'); +exports.workerLanguageDetection = createEditorWorkerModuleDescription('vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker'); +exports.workerLocalFileSearch = createEditorWorkerModuleDescription('vs/workbench/services/search/worker/localFileSearch'); +exports.workerProfileAnalysis = createEditorWorkerModuleDescription('vs/platform/profiling/electron-sandbox/profileAnalysisWorker'); +exports.workerOutputLinks = createEditorWorkerModuleDescription('vs/workbench/contrib/output/common/outputLinkComputer'); +exports.workerBackgroundTokenization = createEditorWorkerModuleDescription('vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker'); + +exports.workbenchDesktop = function () { + return !isAMD() ? [ + createModuleDescription('vs/workbench/contrib/debug/node/telemetryApp'), + createModuleDescription('vs/platform/files/node/watcher/watcherMain'), + createModuleDescription('vs/platform/terminal/node/ptyHostMain'), + createModuleDescription('vs/workbench/api/node/extensionHostProcess'), + createModuleDescription('vs/workbench/contrib/issue/electron-sandbox/issueReporterMain'), + createModuleDescription('vs/workbench/workbench.desktop.main') + ] : [ + ...createEditorWorkerModuleDescription('vs/workbench/contrib/output/common/outputLinkComputer'), + ...createEditorWorkerModuleDescription('vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker'), + createModuleDescription('vs/workbench/contrib/debug/node/telemetryApp'), + createModuleDescription('vs/platform/files/node/watcher/watcherMain'), + createModuleDescription('vs/platform/terminal/node/ptyHostMain'), + createModuleDescription('vs/workbench/api/node/extensionHostProcess'), + createModuleDescription('vs/workbench/contrib/issue/electron-sandbox/issueReporterMain'), + ]; +}; + +exports.workbenchWeb = function () { + return !isAMD() ? [ + createModuleDescription('vs/workbench/workbench.web.main') + ] : [ + ...createEditorWorkerModuleDescription('vs/workbench/contrib/output/common/outputLinkComputer'), + ...createEditorWorkerModuleDescription('vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker'), + createModuleDescription('vs/code/browser/workbench/workbench', ['vs/workbench/workbench.web.main.internal']) + ]; +}; + +exports.keyboardMaps = [ + createModuleDescription('vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux'), + createModuleDescription('vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin'), + createModuleDescription('vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win') +]; + +exports.code = [ + createModuleDescription('vs/code/electron-main/main'), + createModuleDescription('vs/code/node/cli'), + createModuleDescription('vs/code/node/cliProcessMain', ['vs/code/node/cli']), + createModuleDescription('vs/code/electron-utility/sharedProcess/sharedProcessMain'), + createModuleDescription('vs/code/electron-sandbox/processExplorer/processExplorerMain') +]; + +exports.codeWeb = [ + createModuleDescription('vs/code/browser/workbench/workbench') +]; + +exports.entrypoint = createModuleDescription; diff --git a/build/checksums/electron.txt b/build/checksums/electron.txt index a80aa1531f1..43943ccac3b 100644 --- a/build/checksums/electron.txt +++ b/build/checksums/electron.txt @@ -1,75 +1,75 @@ -3d3d8bb185d7b63b0db910661fdd69d6381afb8c97742bbd2526a9c932e1f8ca *chromedriver-v29.4.0-darwin-arm64.zip -c3d075943d87604ffa50382cc8d5798485349544ca391cab88c892f889d3b14c *chromedriver-v29.4.0-darwin-x64.zip -6d62d2dba55e4419fa003d45f93dad1324ec29a4d3eb84fd9fd5fd7a64339389 *chromedriver-v29.4.0-linux-arm64.zip -81bb3d362331c7296f700b1b0e8f07c4c7739b1151f698cd56af927bedda59e7 *chromedriver-v29.4.0-linux-armv7l.zip -ab593cc39aefac8c5abd259e31f6add4b2b70c52231724a6c08ac1872b4a0edf *chromedriver-v29.4.0-linux-x64.zip -705d42ccc05b2c48b0673b9dcf63eb78772bb79dba078a523d384ed2481bc9c0 *chromedriver-v29.4.0-mas-arm64.zip -956a7caa28eeeb0c02eb7638a53215ffd89b4f12880f0893ff10f497ca1a8117 *chromedriver-v29.4.0-mas-x64.zip -1f070176aa33e0139d61a3d758fd2f015f09bb275577293fe93564749b6310ba *chromedriver-v29.4.0-win32-arm64.zip -38a71526d243bcb73c28cb648bd4816d70b5e643df52f9f86a83416014589744 *chromedriver-v29.4.0-win32-ia32.zip -f90750d3589cb3c9f6f0ebc70d5e025cf81c382e8c23fa47a54570696a478ef0 *chromedriver-v29.4.0-win32-x64.zip -05dffc90dd1341cc7a6b50127985e4e217fef7f50a173c7d0ff34039dd2d81b6 *electron-api.json -7f63f7cf675ba6dec3a5e4173d729bd53c75f81e612f809641d9d0c4d9791649 *electron-v29.4.0-darwin-arm64-dsym-snapshot.zip -aa29530fcafa4db364978d4f414a6ec2005ea695f7fee70ffbe5e114e9e453f0 *electron-v29.4.0-darwin-arm64-dsym.zip -8d12fb6d9bcdf5bbfc93dbcd1cac348735dc6f98aa450ee03ec7837a01a8a938 *electron-v29.4.0-darwin-arm64-symbols.zip -c16d05f1231bb3c77da05ab236b454b3a2b6a642403be51e7c9b16cd2c421a19 *electron-v29.4.0-darwin-arm64.zip -2dfc1017831ab2f6e9ddb575d3b9cff5a0d56f16a335a3c0df508e964e2db963 *electron-v29.4.0-darwin-x64-dsym-snapshot.zip -025de6aa39d98762928e1b700f46177e74be20101b27457659b938e2c69db326 *electron-v29.4.0-darwin-x64-dsym.zip -ec4eb0a618207233985ceaab297be34b3d4f0813d88801d5637295b238dd661a *electron-v29.4.0-darwin-x64-symbols.zip -8ed7924f77a5c43c137a57097c5c47c2e8e9a78197e18af11a767c98035c123e *electron-v29.4.0-darwin-x64.zip -bde1772fa8ac4850e108012a9edd3bd93472bad8f68ddd55fca355dad81dde4f *electron-v29.4.0-linux-arm64-debug.zip -dfe7852a7423196efb2205c788d942db3ffc9de6ce52577e173bcf7ca6973d48 *electron-v29.4.0-linux-arm64-symbols.zip -c3764d6c3799950e3418e8e5a5a5b2c41abe421dd8bcdebf054c7c85798d9860 *electron-v29.4.0-linux-arm64.zip -bde1772fa8ac4850e108012a9edd3bd93472bad8f68ddd55fca355dad81dde4f *electron-v29.4.0-linux-armv7l-debug.zip -360668ba669cb2c01c2f960cdee76c29670e6ce907ccc0718e971a04af594ce9 *electron-v29.4.0-linux-armv7l-symbols.zip -c5e92943ad78b4e41a32ae53c679e148ea2ae09f95f914b1834dbdbae578ba91 *electron-v29.4.0-linux-armv7l.zip -375be885426bcbd272bd068bfcef41a83296c2f8e61e633233d2a9e9a69242fc *electron-v29.4.0-linux-x64-debug.zip -847e0f75624616c2918b33de2eefeec63419bd250685610d3f52fa115527d2b9 *electron-v29.4.0-linux-x64-symbols.zip -91e5eb374c2c85a07c2d4e99a89eb18515ff0169a49c3fa75289800e1225729e *electron-v29.4.0-linux-x64.zip -098f973537c3d9679a69409d0b84bcc1a6113bb2002ee60068e2c22f335a3855 *electron-v29.4.0-mas-arm64-dsym-snapshot.zip -2724aa32eb441eea21680d95fc1efdd75ac473fa19623c7acf3d546419e96154 *electron-v29.4.0-mas-arm64-dsym.zip -98dd81914752a57da4cbaad1f0aa94b16335f9b8f997be9aa049be90b96b2886 *electron-v29.4.0-mas-arm64-symbols.zip -fd2663f65c1f995304e3eb65870b7146adfefef07cf82bf44de75855fd4f36e8 *electron-v29.4.0-mas-arm64.zip -237983b2169e69bb73aa0987e871e3e486755904b71ebe36c3e902377f92754a *electron-v29.4.0-mas-x64-dsym-snapshot.zip -a5d59599827d32ef322b99eee8416e39235f4c7a0ada78342a885665e0b732dd *electron-v29.4.0-mas-x64-dsym.zip -5182e7697ac0591e0b95c33f70316af24093c9100f442be2cee0039660e959ac *electron-v29.4.0-mas-x64-symbols.zip -e0ee7057aff0240a70b9ed75ff44d55aeae9af67fbc8915f741711a8bb6fe744 *electron-v29.4.0-mas-x64.zip -2802872dfc6de0f0e2e8cef9d2f4f384e3d82b20ad36fc981c4e725dd2f2abcd *electron-v29.4.0-win32-arm64-pdb.zip -d49c954dc25ae9e4c75e61af80b9718014c52f016f43a29071913f0e7100c7bd *electron-v29.4.0-win32-arm64-symbols.zip -c9f31ae6408aa6936b5d683eda601773789185890375cd097e61e924d4fed77a *electron-v29.4.0-win32-arm64-toolchain-profile.zip -483d692efbe4fb1231ff63afb8a236b2e22b486fbe5ac6abbc8b208abf94a4d3 *electron-v29.4.0-win32-arm64.zip -98458f49ba67a08e473d475a68a2818d9df076a5246fbc9b45403e8796f9d35b *electron-v29.4.0-win32-ia32-pdb.zip -69d505d4ae59d9dddf83c4e530e45dd7c5bc64d6da90cf4f851e523be9e51014 *electron-v29.4.0-win32-ia32-symbols.zip -c9f31ae6408aa6936b5d683eda601773789185890375cd097e61e924d4fed77a *electron-v29.4.0-win32-ia32-toolchain-profile.zip -d5a21a17a64e9638f49f057356af23b51f56bd6a7fea3c2e0a28ff3186a7bc41 *electron-v29.4.0-win32-ia32.zip -521ee7b3398c4dc395b43dac86cd099e86a6123de2b43636ee805b7da014ed3f *electron-v29.4.0-win32-x64-pdb.zip -e33848ebd6c6e4ce431aa367bef887050947a136e883677cfc524ca5cabc1e98 *electron-v29.4.0-win32-x64-symbols.zip -c9f31ae6408aa6936b5d683eda601773789185890375cd097e61e924d4fed77a *electron-v29.4.0-win32-x64-toolchain-profile.zip -e4ef85aa3608221f8a3e011c1b1c2d2d36093ad19bda12d16b3816929fb6c99b *electron-v29.4.0-win32-x64.zip -707ee08593289ee83514b4fc55123611309f995788f38a5ec03e285741aac1c8 *electron.d.ts -281b5f4a49de55fdb86b1662530f07f2ced1252c878eb7a941c88ede545339e0 *ffmpeg-v29.4.0-darwin-arm64.zip -0b735912df9b2ff3d03eb23942e03bc0116d82f1291d0a45cbde14177c2f3066 *ffmpeg-v29.4.0-darwin-x64.zip -4e2ba537d7c131abbd34168bce2c28cc9ef6262b217d5f4085afccfdf9635da6 *ffmpeg-v29.4.0-linux-arm64.zip -4aa56ad5d849f4e61af22678a179346b68aec9100282e1b8a43df25d95721677 *ffmpeg-v29.4.0-linux-armv7l.zip -0558e6e1f78229d303e16d4d8c290794baa9adc619fdd2ddccadb3ea241a1df4 *ffmpeg-v29.4.0-linux-x64.zip -224f15d8f96c75348cd7f1b85c4eab63468fae1e50ff4b1381e08011cf76e4f7 *ffmpeg-v29.4.0-mas-arm64.zip -175ec79f0dc4c5966d9a0ca6ec1674106340ecc64503585c12c2f854249af06f *ffmpeg-v29.4.0-mas-x64.zip -5fa13744b87fef1bfd24a37513677f446143e085504541f8ce97466803bd1893 *ffmpeg-v29.4.0-win32-arm64.zip -d7ba316bb7e13025c9db29e0acafebb540b7716c9f111e469733615d8521186a *ffmpeg-v29.4.0-win32-ia32.zip -35c70a28bcfd4f0b1f8c985d3d1348936bd60767d231ce28ba38f3daeeef64bb *ffmpeg-v29.4.0-win32-x64.zip -8c7228ea0ecab25a1f7fcd1ba9680684d19f9671a497113d71a851a53867b048 *hunspell_dictionaries.zip -7552547c8d585b9bc43518d239d7ce3ad7c5cad0346b07cdcfc1eab638b2b794 *libcxx-objects-v29.4.0-linux-arm64.zip -76054a779d4845ad752b625213ce8990f08dcc5b89aa20660dd4f2e817ba30a8 *libcxx-objects-v29.4.0-linux-armv7l.zip -761c317a9c874bd3d1118d0ecad33c4be23727f538cfbb42a08dd87c68da6039 *libcxx-objects-v29.4.0-linux-x64.zip -f98f9972cc30200b8e05815f5a9cd5cec04bdeee0e48ae2143cdaeff5db9d71d *libcxx_headers.zip -f0b0dd2be579baaf97901322ef489d03fae69a0b8524ea77b24fb3c896f73dd9 *libcxxabi_headers.zip -5da864ea23d70538298a40e0d037a5a461a6b74984e72fd4f0cd20904bccaed1 *mksnapshot-v29.4.0-darwin-arm64.zip -bde97bd7c69209ed6bf4cf1cdf7de622e3a9f50fe6b4dc4b5618eee868f47c62 *mksnapshot-v29.4.0-darwin-x64.zip -a3df9b9e6ef14efe5827d0256d8ecaebe6d8be130cfc3faac0dea76eb53b9b11 *mksnapshot-v29.4.0-linux-arm64-x64.zip -648b9dbca21194d663ddb706e6086a166e691263c764c80f836ae02c27e3657a *mksnapshot-v29.4.0-linux-armv7l-x64.zip -e7a4201cda3956380facc2b5b9d0b1020cc5e654fba44129fc7429a982411cc1 *mksnapshot-v29.4.0-linux-x64.zip -ffb44c45733675e0378f45fce25dafa95697d0c86179f8e46742ada16bc11aa1 *mksnapshot-v29.4.0-mas-arm64.zip -0242da3ca193206e56b88eb108502244bae35dcc587210bd0a32d9fa4cb71041 *mksnapshot-v29.4.0-mas-x64.zip -1445806dca6effbc60072bbde7997cefb62bdb7a9e295a090d26f27c3882685f *mksnapshot-v29.4.0-win32-arm64-x64.zip -09599adc3afb0a13ae87fc4b8ab97c729fe3689faa6a4f5f7a4a3cf0d9cc49d3 *mksnapshot-v29.4.0-win32-ia32.zip -84f80683d95665d29284386509bb104e840ff0b797bfbbd19da86b84d370aa49 *mksnapshot-v29.4.0-win32-x64.zip +a010e3d6e90e3ae1d7df517044510db0419500c25b0243ac371b2cdc34264fe5 *chromedriver-v30.5.0-darwin-arm64.zip +bb5444359e6214a393ab2b9ee6d096e4202fd32050c05bc0868d3f220501efb9 *chromedriver-v30.5.0-darwin-x64.zip +bb02fee91d901cd2ff24200c6488691330d946277cb8fbd5681eb7fe04d6b70a *chromedriver-v30.5.0-linux-arm64.zip +3337363abe08a74d30c0a4eb990c35c97bb5692e1c28afd2ab732ac9c51fcf10 *chromedriver-v30.5.0-linux-armv7l.zip +bb9c1b5b11712b52e7cbdbf38aa6f180bd4acc9866a3c9a023d443ac93a1bfd3 *chromedriver-v30.5.0-linux-x64.zip +c81eec95055c6fc553cddcbe405ce6a4aa9b2e397f65f551ce8a69772dacc80e *chromedriver-v30.5.0-mas-arm64.zip +cce049c0bcaeeb82656971363cf2dcce9eae38cbbee558a5204085cac2b700fa *chromedriver-v30.5.0-mas-x64.zip +474cee6b6ab8d8ff4d5beb834981b694aedfa6434e89c77391fb50fd9940421f *chromedriver-v30.5.0-win32-arm64.zip +e841d999d224c6562422657a669b1e807f9e1fd99fbfdad9275e86637ee77a2b *chromedriver-v30.5.0-win32-ia32.zip +3e62f30a511ae9058a4e665e56613b7412af1640e15e9b0cbf7237fa0fa5ac1b *chromedriver-v30.5.0-win32-x64.zip +928586b78c1b59cdeab32542c0dcc7763a3eacaa2b21f3fcb6345af522e2600a *electron-api.json +12f0d3689ac7be36b312ef81cffb99ac2ed35eecd6650aefc691085317942bce *electron-v30.5.0-darwin-arm64-dsym-snapshot.zip +84eb4590e500f85ec854fed4e2ea479c118b075a546e3398ac95d093cdd4f49c *electron-v30.5.0-darwin-arm64-dsym.zip +bac4837a937f620ae3f6290bb2e2c0d29f051d10b968e3e247751b727ceaf3d3 *electron-v30.5.0-darwin-arm64-symbols.zip +1715379e74d5c5983cf74059eae174cc59bb48ef774d32d6a23fa2e52ae8f8da *electron-v30.5.0-darwin-arm64.zip +f1849de448bd973118572dd0e70ea6f8b862e0ed09879323a872f4d4d8c84ff0 *electron-v30.5.0-darwin-x64-dsym-snapshot.zip +1d2677b2b01cda73480d87a02dfbf8ef3b39c0d9c7f785b88edc0bbb9ded0bf4 *electron-v30.5.0-darwin-x64-dsym.zip +34592256b3d940fb6828edcb23cd0f241605dbaa9423d429aa2472143a6c908f *electron-v30.5.0-darwin-x64-symbols.zip +135aaa5c7b9cbd6128a6fb43df522d9bc4894c6ceb115e1db5caa2b2e2f2c9f4 *electron-v30.5.0-darwin-x64.zip +7115b03c3aed17f5d9b1b134f7daf3ffb838f5180f4223358acf3061cf7e8eea *electron-v30.5.0-linux-arm64-debug.zip +75c9532cf91c468dd37c2c961d1e7dbce133f8fe3565cc391f5eea66ae843b4f *electron-v30.5.0-linux-arm64-symbols.zip +a3857bdf84379d8a4984955368b3940df9b1b1d098ed6c6120d34cde950e41c6 *electron-v30.5.0-linux-arm64.zip +7115b03c3aed17f5d9b1b134f7daf3ffb838f5180f4223358acf3061cf7e8eea *electron-v30.5.0-linux-armv7l-debug.zip +6de5b4aee19b2da78444cca76d35a3a20d72252dd9e31055ab96c727629007be *electron-v30.5.0-linux-armv7l-symbols.zip +ba4cad948732d39242d934dade317785ea8239fed6175fe143f7ad747c8524d9 *electron-v30.5.0-linux-armv7l.zip +2b447d516777af53809ee80820a7c93e704ebaa3b253e7d5b4ecf5f104f2b855 *electron-v30.5.0-linux-x64-debug.zip +9abc7246ab2e29424700ff30c03a72d9f8508d7819ea5d924a606b4ee16e74fd *electron-v30.5.0-linux-x64-symbols.zip +167d48e0c6b9714d3e1bcf66cc37f81a886694038e12c754866db313c1c7c90e *electron-v30.5.0-linux-x64.zip +5aef36099d1fd316c6593bcf9895641fe79e97d3e2191a6c00e63a033e9d628b *electron-v30.5.0-mas-arm64-dsym-snapshot.zip +cafae0c4d8b00424a7edf1234587a4a5f49ed209c649a5773131eb805790fdc4 *electron-v30.5.0-mas-arm64-dsym.zip +c859b5d4e0fb117e6666db858878efbe77e9cf835125ba69b68099ad3d8975c0 *electron-v30.5.0-mas-arm64-symbols.zip +7458cd6f830640fcfbf262bf207113ff7a4ff62951f3ee2f24075059b141821b *electron-v30.5.0-mas-arm64.zip +894697a4588bcac62565c5416f43e3ea96efe65436c660c0473e382d6ff7075d *electron-v30.5.0-mas-x64-dsym-snapshot.zip +37ef7ac94c20a30be8a53346fb2949429e3adbd5485e9c7cd440b821bd8e3a49 *electron-v30.5.0-mas-x64-dsym.zip +b18452e34e0569adc647ebf749712bbe1c7ac60d63624015607f1eb4d3d8f3f6 *electron-v30.5.0-mas-x64-symbols.zip +3fbff016735efd6313be0fcfcbf1856d1e0b25329c9219e7da3fa3585f075f04 *electron-v30.5.0-mas-x64.zip +fdf4e69f7601dbe12eb09cca968ff261e3efc8c718f5a74f5805108420abb7b8 *electron-v30.5.0-win32-arm64-pdb.zip +e0ce8ed7dc7cb633ed2fcd8f9d2a28dfbd180235b4e2f20747a12eaf397b8808 *electron-v30.5.0-win32-arm64-symbols.zip +7351fa5cb892853a7d4b67d8858d0f9cc6506c554a2e42c9ad7e8d5e29ae2743 *electron-v30.5.0-win32-arm64-toolchain-profile.zip +61ea193db53d4f5ae95a758b53fbd8675e9b87d5e8c97549ce716eb7830f71a3 *electron-v30.5.0-win32-arm64.zip +3f3133f4db5384a10611f778b3e4d8f759d88d0f93fc1226066bd2324805cef2 *electron-v30.5.0-win32-ia32-pdb.zip +206f84d0a1a4096e793e4152609792fbd6e118d9b3fe96db40b22c6c83f822f8 *electron-v30.5.0-win32-ia32-symbols.zip +7351fa5cb892853a7d4b67d8858d0f9cc6506c554a2e42c9ad7e8d5e29ae2743 *electron-v30.5.0-win32-ia32-toolchain-profile.zip +8ab671665fad3eb50c0ba79201944dc6a1cc08dd1ec89a5aa458415671307178 *electron-v30.5.0-win32-ia32.zip +adc776f542ae6c8f2030a99a0eb4c55857d065708620d52119cc067c264cc08a *electron-v30.5.0-win32-x64-pdb.zip +b1fa7b22af5e31f49278ece5cb60d1ce310547db154802c74baa30264b9aaf69 *electron-v30.5.0-win32-x64-symbols.zip +7351fa5cb892853a7d4b67d8858d0f9cc6506c554a2e42c9ad7e8d5e29ae2743 *electron-v30.5.0-win32-x64-toolchain-profile.zip +2b9007396722c03d6b064e7f277b502990bc2a060066ed202dea4f4ede77a820 *electron-v30.5.0-win32-x64.zip +4acb73a8e98f769c14910e6a16f7902e1281291ecec0c80598ce07bf97878238 *electron.d.ts +dded5f95e489ec68829ba2ea2f851601ecc30e534c5fb16c9bee97c196e6eba0 *ffmpeg-v30.5.0-darwin-arm64.zip +3b26980535e45e6fd23b34f464f85263edf434e749722bec70f07a5538dadaf3 *ffmpeg-v30.5.0-darwin-x64.zip +93f433080429f0edffb838a1655c4faacdb49efae24acf97b35c9eccd87abc63 *ffmpeg-v30.5.0-linux-arm64.zip +4f7583513d48b48c44a2cbc4430cbc9a33d8f9728622166db688e3de61190821 *ffmpeg-v30.5.0-linux-armv7l.zip +42aa45bcfebac623904082fbe74a94a9d115237118493baa9845bb4ed63a1ffe *ffmpeg-v30.5.0-linux-x64.zip +dded5f95e489ec68829ba2ea2f851601ecc30e534c5fb16c9bee97c196e6eba0 *ffmpeg-v30.5.0-mas-arm64.zip +3b26980535e45e6fd23b34f464f85263edf434e749722bec70f07a5538dadaf3 *ffmpeg-v30.5.0-mas-x64.zip +418ac6118a1d0f4fe245bfd3f7db59293629db0c81ad4dcf27a15197c49b0835 *ffmpeg-v30.5.0-win32-arm64.zip +c5980cb28dcef56e7674c754b8863c9b5e67ecdb6684f71e32d10a335b92c5fb *ffmpeg-v30.5.0-win32-ia32.zip +7dffa8b18aa0a7941a2d03d8ac393b865a39dd93ad408e9efdd8e51061798c12 *ffmpeg-v30.5.0-win32-x64.zip +2abc27d8460ca60a336767634ab608b9c5450d0ac9720a6fbbdd9e83f837163d *hunspell_dictionaries.zip +7d3254bf7242ea858cadc17686c2ba1c2b7239e00628c8ae260373e9e35617b2 *libcxx-objects-v30.5.0-linux-arm64.zip +94cc5ba1b3fe4e1db1b4f0ce4140cc3cdf42d54d6e8150d4c1dc98508f7cdad2 *libcxx-objects-v30.5.0-linux-armv7l.zip +21193d743044c1f3052d69efaf11fc1475e5d27f014d0f701127e6da1501bee3 *libcxx-objects-v30.5.0-linux-x64.zip +24ec523a5a5bac709f0df9bb198f52fa786be4b6c828a7cf0117012ffa28f1ce *libcxx_headers.zip +eae200a0d1fd0d4b881358bdef600111891c75ecc4db679b680b0cbaf87ecfc3 *libcxxabi_headers.zip +cdd3c02c5998ae39eda53af1627a7f069db29dc13b0287bcfba6197bd9a1f52e *mksnapshot-v30.5.0-darwin-arm64.zip +4212dc901cdaa3e65a905a69c246efe8012318ad9e4141b0e1508f7befadc615 *mksnapshot-v30.5.0-darwin-x64.zip +41ba980d159d59705187fc9a383014cb68a642044c8c39c68f9396bab4fda168 *mksnapshot-v30.5.0-linux-arm64-x64.zip +fa2b974e8016ab576c23262c89aa910208542ecec3a2d4344df3f79a0bbb0b30 *mksnapshot-v30.5.0-linux-armv7l-x64.zip +cdb205f80890cccc0e3c23bbe8bfa4777171b989f10c532ff488c5a4657a9cf2 *mksnapshot-v30.5.0-linux-x64.zip +be468e8c0a3175541e1234d66b50db2932434e77a22d6a6ad3649f36c530aff1 *mksnapshot-v30.5.0-mas-arm64.zip +f0bb8d110295ccc0cd0938a63f6a372cf6e80dd511cc1309fd4a7a1bde23dce2 *mksnapshot-v30.5.0-mas-x64.zip +65ed62069016fa0ae0928d394c55678fa530978d1d7fa74a8b02b6b09d7a6e50 *mksnapshot-v30.5.0-win32-arm64-x64.zip +918bf0cc88f4830af21bc7621fde1e32df8869751d898af0ad34e19c63f677a7 *mksnapshot-v30.5.0-win32-ia32.zip +6d6badd9e8ea6df7531e3c1533939686e78c33983cf24e9c98357c2a6d7e6206 *mksnapshot-v30.5.0-win32-x64.zip diff --git a/build/checksums/nodejs.txt b/build/checksums/nodejs.txt index bcc9340406d..3436ff37cc5 100644 --- a/build/checksums/nodejs.txt +++ b/build/checksums/nodejs.txt @@ -1,7 +1,7 @@ -e0065c61f340e85106a99c4b54746c5cee09d59b08c5712f67f99e92aa44995d node-v20.11.1-darwin-arm64.tar.gz -c52e7fb0709dbe63a4cbe08ac8af3479188692937a7bd8e776e0eedfa33bb848 node-v20.11.1-darwin-x64.tar.gz -e34ab2fc2726b4abd896bcbff0250e9b2da737cbd9d24267518a802ed0606f3b node-v20.11.1-linux-arm64.tar.gz -e42791f76ece283c7a4b97fbf716da72c5128c54a9779f10f03ae74a4bcfb8f6 node-v20.11.1-linux-armv7l.tar.gz -bf3a779bef19452da90fb88358ec2c57e0d2f882839b20dc6afc297b6aafc0d7 node-v20.11.1-linux-x64.tar.gz -a5a9d30a8f7d56e00ccb27c1a7d24c8d0bc96a2689ebba8eb7527698793496f1 win-arm64/node.exe -bc585910690318aaebe3c57669cb83ca9d1e5791efd63195e238f54686e6c2ec win-x64/node.exe +fc7355e778b181575153b7dea4879e8021776eeb376c43c50f65893d2ea70aa3 node-v20.16.0-darwin-arm64.tar.gz +e18942cd706e4d69a4845ddacee2f1c17a72e853a229e3d2623d2edeb7efde72 node-v20.16.0-darwin-x64.tar.gz +551588f8f5ca05c04efb53f1b2bb7d9834603327bdc82d60a944d385569866e1 node-v20.16.0-linux-arm64.tar.gz +1c77c52ab507ddee479012f0b4bf523dd8400df4504447d623632353076e2e27 node-v20.16.0-linux-armv7l.tar.gz +b3f874ea84e440d69ed02ca92429d0eccd17737fde86db69c1c153d16ec654f2 node-v20.16.0-linux-x64.tar.gz +7e773fba3a19eac5ccbe85c1f87a05d7b112ecf41440076e6b6de1c7bffa0fdf win-arm64/node.exe +ba221658a3b68bd583e3068903eb675b5206d86a883c084ed95502e8f634b82a win-x64/node.exe diff --git a/build/darwin/create-universal-app.js b/build/darwin/create-universal-app.js index 7da8e55c908..a3daf1878b0 100644 --- a/build/darwin/create-universal-app.js +++ b/build/darwin/create-universal-app.js @@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const path = require("path"); const fs = require("fs"); +const minimatch = require("minimatch"); const vscode_universal_bundler_1 = require("vscode-universal-bundler"); const cross_spawn_promise_1 = require("@malept/cross-spawn-promise"); const root = path.dirname(path.dirname(__dirname)); @@ -18,26 +19,29 @@ async function main(buildDir) { const appName = product.nameLong + '.app'; const x64AppPath = path.join(buildDir, 'VSCode-darwin-x64', appName); const arm64AppPath = path.join(buildDir, 'VSCode-darwin-arm64', appName); - const x64AsarPath = path.join(x64AppPath, 'Contents', 'Resources', 'app', 'node_modules.asar'); - const arm64AsarPath = path.join(arm64AppPath, 'Contents', 'Resources', 'app', 'node_modules.asar'); + const asarRelativePath = path.join('Contents', 'Resources', 'app', 'node_modules.asar'); const outAppPath = path.join(buildDir, `VSCode-darwin-${arch}`, appName); const productJsonPath = path.resolve(outAppPath, 'Contents', 'Resources', 'app', 'product.json'); + const filesToSkip = [ + '**/CodeResources', + '**/Credits.rtf', + ]; await (0, vscode_universal_bundler_1.makeUniversalApp)({ x64AppPath, arm64AppPath, - x64AsarPath, - arm64AsarPath, - filesToSkip: [ - 'product.json', - 'Credits.rtf', - 'CodeResources', - 'fsevents.node', - 'Info.plist', // TODO@deepak1556: regressed with 11.4.2 internal builds - 'MainMenu.nib', // Generated sequence is not deterministic with Xcode 13 - '.npmrc' - ], + asarPath: asarRelativePath, outAppPath, - force: true + force: true, + mergeASARs: true, + x64ArchFiles: '*/kerberos.node', + filesToSkipComparison: (file) => { + for (const expected of filesToSkip) { + if (minimatch(file, expected)) { + return true; + } + } + return false; + } }); const productJson = JSON.parse(fs.readFileSync(productJsonPath, 'utf8')); Object.assign(productJson, { diff --git a/build/darwin/create-universal-app.ts b/build/darwin/create-universal-app.ts index ffba8952cd8..94b8a23b9e5 100644 --- a/build/darwin/create-universal-app.ts +++ b/build/darwin/create-universal-app.ts @@ -5,6 +5,7 @@ import * as path from 'path'; import * as fs from 'fs'; +import * as minimatch from 'minimatch'; import { makeUniversalApp } from 'vscode-universal-bundler'; import { spawn } from '@malept/cross-spawn-promise'; @@ -21,27 +22,31 @@ async function main(buildDir?: string) { const appName = product.nameLong + '.app'; const x64AppPath = path.join(buildDir, 'VSCode-darwin-x64', appName); const arm64AppPath = path.join(buildDir, 'VSCode-darwin-arm64', appName); - const x64AsarPath = path.join(x64AppPath, 'Contents', 'Resources', 'app', 'node_modules.asar'); - const arm64AsarPath = path.join(arm64AppPath, 'Contents', 'Resources', 'app', 'node_modules.asar'); + const asarRelativePath = path.join('Contents', 'Resources', 'app', 'node_modules.asar'); const outAppPath = path.join(buildDir, `VSCode-darwin-${arch}`, appName); const productJsonPath = path.resolve(outAppPath, 'Contents', 'Resources', 'app', 'product.json'); + const filesToSkip = [ + '**/CodeResources', + '**/Credits.rtf', + ]; + await makeUniversalApp({ x64AppPath, arm64AppPath, - x64AsarPath, - arm64AsarPath, - filesToSkip: [ - 'product.json', - 'Credits.rtf', - 'CodeResources', - 'fsevents.node', - 'Info.plist', // TODO@deepak1556: regressed with 11.4.2 internal builds - 'MainMenu.nib', // Generated sequence is not deterministic with Xcode 13 - '.npmrc' - ], + asarPath: asarRelativePath, outAppPath, - force: true + force: true, + mergeASARs: true, + x64ArchFiles: '*/kerberos.node', + filesToSkipComparison: (file: string) => { + for (const expected of filesToSkip) { + if (minimatch(file, expected)) { + return true; + } + } + return false; + } }); const productJson = JSON.parse(fs.readFileSync(productJsonPath, 'utf8')); diff --git a/build/darwin/sign.js b/build/darwin/sign.js index f5913b73ab8..feb5834ff85 100644 --- a/build/darwin/sign.js +++ b/build/darwin/sign.js @@ -10,8 +10,8 @@ const codesign = require("electron-osx-sign"); const cross_spawn_promise_1 = require("@malept/cross-spawn-promise"); const root = path.dirname(path.dirname(__dirname)); function getElectronVersion() { - const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8'); - const target = /^target "(.*)"$/m.exec(yarnrc)[1]; + const npmrc = fs.readFileSync(path.join(root, '.npmrc'), 'utf8'); + const target = /^target="(.*)"$/m.exec(npmrc)[1]; return target; } async function main(buildDir) { diff --git a/build/darwin/sign.ts b/build/darwin/sign.ts index 01e9ebf2d4b..5b3413b79e1 100644 --- a/build/darwin/sign.ts +++ b/build/darwin/sign.ts @@ -11,8 +11,8 @@ import { spawn } from '@malept/cross-spawn-promise'; const root = path.dirname(path.dirname(__dirname)); function getElectronVersion(): string { - const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8'); - const target = /^target "(.*)"$/m.exec(yarnrc)![1]; + const npmrc = fs.readFileSync(path.join(root, '.npmrc'), 'utf8'); + const target = /^target="(.*)"$/m.exec(npmrc)![1]; return target; } diff --git a/build/filters.js b/build/filters.js index c7be2d818d9..4e5049f23f0 100644 --- a/build/filters.js +++ b/build/filters.js @@ -77,7 +77,9 @@ module.exports.indentationFilter = [ '!src/vs/base/common/semver/semver.js', '!src/vs/base/node/terminateProcess.sh', '!src/vs/base/node/cpuUsage.sh', + '!src/vs/editor/common/languages/highlights/*.scm', '!test/unit/assert.js', + '!test/unit/assert-esm.js', '!resources/linux/snap/electron-launch', '!build/ext.js', '!build/npm/gyp/patches/gyp_spectre_mitigation_support.patch', @@ -99,8 +101,7 @@ module.exports.indentationFilter = [ // except multiple specific files '!**/package.json', - '!**/yarn.lock', - '!**/yarn-error.log', + '!**/package-lock.json', // except multiple specific folders '!**/codicon/**', @@ -117,7 +118,7 @@ module.exports.indentationFilter = [ '!src/vs/*/**/*.d.ts', '!src/typings/**/*.d.ts', '!extensions/**/*.d.ts', - '!**/*.{svg,exe,png,bmp,jpg,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns,plist,opus,admx,adml,wasm}', + '!**/*.{svg,exe,png,bmp,jpg,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,psm1,template,yaml,yml,d.ts.recipe,ico,icns,plist,opus,admx,adml,wasm}', '!build/{lib,download,linux,darwin}/**/*.js', '!build/**/*.sh', '!build/azure-pipelines/**/*.js', @@ -199,7 +200,7 @@ module.exports.eslintFilter = [ .toString().split(/\r\n|\n/) .filter(line => !line.startsWith('#')) .filter(line => !!line) - .map(line => `!${line}`) + .map(line => line.startsWith('!') ? line.slice(1) : `!${line}`) ]; module.exports.stylelintFilter = [ diff --git a/build/gulpfile.cli.js b/build/gulpfile.cli.js index 86646fdb274..592fc74516c 100644 --- a/build/gulpfile.cli.js +++ b/build/gulpfile.cli.js @@ -5,8 +5,6 @@ 'use strict'; -//@ts-check - const es = require('event-stream'); const gulp = require('gulp'); const path = require('path'); @@ -24,7 +22,6 @@ const createReporter = require('./lib/reporter').createReporter; const root = 'cli'; const rootAbs = path.resolve(__dirname, '..', root); const src = `${root}/src`; -const targetCliPath = path.join(root, 'target', 'debug', process.platform === 'win32' ? 'code.exe' : 'code'); const platformOpensslDirName = process.platform === 'win32' ? ( diff --git a/build/gulpfile.compile.js b/build/gulpfile.compile.js index c4947e76cbf..a8d8fb094b2 100644 --- a/build/gulpfile.compile.js +++ b/build/gulpfile.compile.js @@ -3,20 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +//@ts-check 'use strict'; const gulp = require('gulp'); const util = require('./lib/util'); +const date = require('./lib/date'); +const amd = require('./lib/amd'); const task = require('./lib/task'); const compilation = require('./lib/compilation'); const optimize = require('./lib/optimize'); +const isAMDBuild = typeof process.env.VSCODE_BUILD_AMD === 'string' && process.env.VSCODE_BUILD_AMD.toLowerCase() === 'true'; + +/** + * @param {boolean} disableMangle + */ function makeCompileBuildTask(disableMangle) { return task.series( util.rimraf('out-build'), util.buildWebNodePaths('out-build'), + date.writeISODate('out-build'), + amd.setAMD(isAMDBuild), compilation.compileApiProposalNamesTask, - compilation.compileTask('src', 'out-build', true, { disableMangle }), + compilation.compileTask(isAMDBuild ? 'src2' : 'src', 'out-build', true, { disableMangle }), optimize.optimizeLoaderTask('out-build', 'out-build', true) ); } diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index 22b70a953df..0d55982a8aa 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -29,19 +29,17 @@ const editorEntryPoints = [ { name: 'vs/editor/editor.main', include: [], - exclude: ['vs/css', 'vs/nls'], + exclude: ['vs/css'], prepend: [ - { path: 'out-editor-build/vs/css.js', amdModuleId: 'vs/css' }, - { path: 'out-editor-build/vs/nls.js', amdModuleId: 'vs/nls' } + { path: 'out-editor-build/vs/css.js', amdModuleId: 'vs/css' } ], }, { name: 'vs/base/common/worker/simpleWorker', include: ['vs/editor/common/services/editorSimpleWorker'], - exclude: ['vs/nls'], + exclude: [], prepend: [ { path: 'vs/loader.js' }, - { path: 'vs/nls.js', amdModuleId: 'vs/nls' }, { path: 'vs/base/worker/workerMain.js' } ], dest: 'vs/base/worker/workerMain.js' @@ -79,14 +77,17 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => { extrausages ], shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers - importIgnorePattern: /(^vs\/css!)/, + importIgnorePattern: /\.css$/, destRoot: path.join(root, 'out-editor-src'), - redirects: [] + redirects: { + '@vscode/tree-sitter-wasm': '../node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-web', + } }); }); // Disable mangling for the editor, as it complicates debugging & quite a few users rely on private/protected fields. -const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true, { disableMangle: true })); +// Disable NLS task to remove english strings to preserve backwards compatibility when we removed the `vs/nls!` AMD plugin. +const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true, { disableMangle: true, preserveEnglish: true })); const optimizeEditorAMDTask = task.define('optimize-editor-amd', optimize.optimizeTask( { @@ -99,7 +100,6 @@ const optimizeEditorAMDTask = task.define('optimize-editor-amd', optimize.optimi paths: { 'vs': 'out-editor-build/vs', 'vs/css': 'out-editor-build/vs/css.build', - 'vs/nls': 'out-editor-build/vs/nls.build', 'vscode': 'empty:' } }, @@ -124,7 +124,6 @@ const createESMSourcesAndResourcesTask = task.define('extract-editor-esm', () => 'vs/base/worker/workerMain.ts', ], renames: { - 'vs/nls.mock.ts': 'vs/nls.ts' } }); }); @@ -136,7 +135,8 @@ const compileEditorESMTask = task.define('compile-editor-esm', () => { let result; if (process.platform === 'win32') { result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, { - cwd: path.join(__dirname, '../out-editor-esm') + cwd: path.join(__dirname, '../out-editor-esm'), + shell: true }); } else { result = cp.spawnSync(`node`, [`../node_modules/.bin/tsc`], { @@ -198,49 +198,11 @@ const compileEditorESMTask = task.define('compile-editor-esm', () => { } console.log(`Open in VS Code the folder at '${destPath}' and you can analyze the compilation error`); - throw new Error('Standalone Editor compilation failed. If this is the build machine, simply launch `yarn run gulp editor-distro` on your machine to further analyze the compilation problem.'); + throw new Error('Standalone Editor compilation failed. If this is the build machine, simply launch `npm run gulp editor-distro` on your machine to further analyze the compilation problem.'); }); } }); -/** - * Go over all .js files in `/out-monaco-editor-core/esm/` and make sure that all imports - * use `.js` at the end in order to be ESM compliant. - */ -const appendJSToESMImportsTask = task.define('append-js-to-esm-imports', () => { - const SRC_DIR = path.join(__dirname, '../out-monaco-editor-core/esm'); - const files = util.rreddir(SRC_DIR); - for (const file of files) { - const filePath = path.join(SRC_DIR, file); - if (!/\.js$/.test(filePath)) { - continue; - } - - const contents = fs.readFileSync(filePath).toString(); - const lines = contents.split(/\r\n|\r|\n/g); - const /** @type {string[]} */result = []; - for (const line of lines) { - if (!/^import/.test(line) && !/^export \* from/.test(line)) { - // not an import - result.push(line); - continue; - } - if (/^import '[^']+\.css';/.test(line)) { - // CSS import - result.push(line); - continue; - } - const modifiedLine = ( - line - .replace(/^import(.*)\'([^']+)\'/, `import$1'$2.js'`) - .replace(/^export \* from \'([^']+)\'/, `export * from '$1.js'`) - ); - result.push(modifiedLine); - } - fs.writeFileSync(filePath, result.join('\n')); - } -}); - /** * @param {string} contents */ @@ -413,7 +375,6 @@ gulp.task('editor-distro', task.series( createESMSourcesAndResourcesTask, compileEditorESMTask, - appendJSToESMImportsTask ) ), finalEditorResourcesTask @@ -430,7 +391,6 @@ gulp.task('editor-esm', extractEditorSrcTask, createESMSourcesAndResourcesTask, compileEditorESMTask, - appendJSToESMImportsTask, ) ); diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index a95c38b90a7..3c6a9621dda 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -49,7 +49,6 @@ const compilations = [ 'extensions/json-language-features/client/tsconfig.json', 'extensions/json-language-features/server/tsconfig.json', 'extensions/markdown-language-features/preview-src/tsconfig.json', - 'extensions/markdown-language-features/server/tsconfig.json', 'extensions/markdown-language-features/tsconfig.json', 'extensions/markdown-math/tsconfig.json', 'extensions/media-preview/tsconfig.json', @@ -70,6 +69,7 @@ const compilations = [ 'extensions/vscode-test-resolver/tsconfig.json', '.vscode/extensions/vscode-selfhost-test-provider/tsconfig.json', + '.vscode/extensions/vscode-selfhost-import-aid/tsconfig.json', ]; const getBaseUrl = out => `https://main.vscode-cdn.net/sourcemaps/${commit}/${out}`; @@ -102,7 +102,6 @@ const tasks = compilations.map(function (tsconfigFile) { } function createPipeline(build, emitError, transpileOnly) { - const nlsDev = require('vscode-nls-dev'); const tsb = require('./lib/tsb'); const sourcemaps = require('gulp-sourcemaps'); @@ -127,7 +126,6 @@ const tasks = compilations.map(function (tsconfigFile) { .pipe(tsFilter) .pipe(util.loadSourcemaps()) .pipe(compilation()) - .pipe(build ? nlsDev.rewriteLocalizeCalls() : es.through()) .pipe(build ? util.stripSourceMappingURL() : es.through()) .pipe(sourcemaps.write('.', { sourceMappingURL: !build ? null : f => `${baseUrl}/${f.relative}.map`, @@ -137,9 +135,6 @@ const tasks = compilations.map(function (tsconfigFile) { sourceRoot: '../src/', })) .pipe(tsFilter.restore) - .pipe(build ? nlsDev.bundleMetaDataFiles(headerId, headerOut) : es.through()) - // Filter out *.nls.json file. We needed them only to bundle meta data file. - .pipe(filter(['**', '!**/*.nls.json'], { dot: true })) .pipe(reporter.end(emitError)); return es.duplex(input, output); diff --git a/build/gulpfile.js b/build/gulpfile.js index e945c06eed4..5f7b71a40f2 100644 --- a/build/gulpfile.js +++ b/build/gulpfile.js @@ -34,11 +34,15 @@ gulp.task(compileClientTask); const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), task.parallel(watchTask('out', false), watchApiProposalNamesTask))); gulp.task(watchClientTask); +const watchClientAMDTask = task.define('watch-client-amd', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), task.parallel(watchTask('out', false, 'src2'), watchApiProposalNamesTask))); +gulp.task(watchClientAMDTask); + // All const _compileTask = task.define('compile', task.parallel(monacoTypecheckTask, compileClientTask, compileExtensionsTask, compileExtensionMediaTask)); gulp.task(_compileTask); gulp.task(task.define('watch', task.parallel(/* monacoTypecheckWatchTask, */ watchClientTask, watchExtensionsTask))); +gulp.task(task.define('watch-amd', task.parallel(/* monacoTypecheckWatchTask, */ watchClientAMDTask, watchExtensionsTask))); // Default gulp.task('default', _compileTask); diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js index a6cfbe5a61d..e3147945f84 100644 --- a/build/gulpfile.reh.js +++ b/build/gulpfile.reh.js @@ -12,11 +12,13 @@ const util = require('./lib/util'); const { getVersion } = require('./lib/getVersion'); const task = require('./lib/task'); const optimize = require('./lib/optimize'); +const { inlineMeta } = require('./lib/inlineMeta'); const product = require('../product.json'); const rename = require('gulp-rename'); const replace = require('gulp-replace'); const filter = require('gulp-filter'); const { getProductionDependencies } = require('./lib/dependencies'); +const { readISODate } = require('./lib/date'); const vfs = require('vinyl-fs'); const packageJson = require('../package.json'); const flatmap = require('gulp-flatmap'); @@ -26,9 +28,11 @@ const fs = require('fs'); const glob = require('glob'); const { compileBuildTask } = require('./gulpfile.compile'); const { compileExtensionsBuildTask, compileExtensionMediaBuildTask } = require('./gulpfile.extensions'); -const { vscodeWebEntryPoints, vscodeWebResourceIncludes, createVSCodeWebFileContentMapper } = require('./gulpfile.vscode.web'); +const { vscodeWebResourceIncludes, createVSCodeWebFileContentMapper } = require('./gulpfile.vscode.web'); const cp = require('child_process'); const log = require('fancy-log'); +const { isAMD } = require('./lib/amd'); +const buildfile = require('./buildfile'); const REPO_ROOT = path.dirname(__dirname); const commit = getVersion(REPO_ROOT); @@ -39,6 +43,7 @@ const REMOTE_FOLDER = path.join(REPO_ROOT, 'remote'); const BUILD_TARGETS = [ { platform: 'win32', arch: 'x64' }, + { platform: 'win32', arch: 'arm64' }, { platform: 'darwin', arch: 'x64' }, { platform: 'darwin', arch: 'arm64' }, { platform: 'linux', arch: 'x64' }, @@ -50,96 +55,127 @@ const BUILD_TARGETS = [ { platform: 'linux', arch: 'alpine' }, ]; -const serverResources = [ - - // Bootstrap - 'out-build/bootstrap.js', - 'out-build/bootstrap-fork.js', - 'out-build/bootstrap-amd.js', - 'out-build/bootstrap-node.js', +const serverResourceIncludes = [ - // Performance - 'out-build/vs/base/common/performance.js', + // NLS + 'out-build/nls.messages.json', // Process monitor 'out-build/vs/base/node/cpuUsage.sh', 'out-build/vs/base/node/ps.sh', // Terminal shell integration - 'out-build/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1', - 'out-build/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh', - 'out-build/vs/workbench/contrib/terminal/browser/media/shellIntegration-env.zsh', - 'out-build/vs/workbench/contrib/terminal/browser/media/shellIntegration-profile.zsh', - 'out-build/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh', - 'out-build/vs/workbench/contrib/terminal/browser/media/shellIntegration-login.zsh', - 'out-build/vs/workbench/contrib/terminal/browser/media/fish_xdg_data/fish/vendor_conf.d/shellIntegration.fish', + 'out-build/vs/workbench/contrib/terminal/common/scripts/shellIntegration.ps1', + 'out-build/vs/workbench/contrib/terminal/common/scripts/CodeTabExpansion.psm1', + 'out-build/vs/workbench/contrib/terminal/common/scripts/GitTabExpansion.psm1', + 'out-build/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh', + 'out-build/vs/workbench/contrib/terminal/common/scripts/shellIntegration-env.zsh', + 'out-build/vs/workbench/contrib/terminal/common/scripts/shellIntegration-profile.zsh', + 'out-build/vs/workbench/contrib/terminal/common/scripts/shellIntegration-rc.zsh', + 'out-build/vs/workbench/contrib/terminal/common/scripts/shellIntegration-login.zsh', + 'out-build/vs/workbench/contrib/terminal/common/scripts/fish_xdg_data/fish/vendor_conf.d/shellIntegration.fish', - '!**/test/**' ]; -const serverWithWebResources = [ +const serverResourceExcludes = [ + '!out-build/vs/**/{electron-sandbox,electron-main,electron-utility}/**', + '!out-build/vs/editor/standalone/**', + '!out-build/vs/workbench/**/*-tb.png', + '!**/test/**' +]; - // Include all of server... - ...serverResources, +const serverResources = [ + ...serverResourceIncludes, + ...serverResourceExcludes +]; - // ...and all of web +const serverWithWebResourceIncludes = !isAMD() ? [ + ...serverResourceIncludes, + 'out-build/vs/code/browser/workbench/*.html', + ...vscodeWebResourceIncludes +] : [ + ...serverResourceIncludes, ...vscodeWebResourceIncludes ]; +const serverWithWebResourceExcludes = [ + ...serverResourceExcludes, + '!out-build/vs/code/**/*-dev.html', + '!out-build/vs/code/**/*-dev.esm.html', +]; + +const serverWithWebResources = [ + ...serverWithWebResourceIncludes, + ...serverWithWebResourceExcludes +]; + const serverEntryPoints = [ { name: 'vs/server/node/server.main', - exclude: ['vs/css', 'vs/nls'] + exclude: ['vs/css'] }, { name: 'vs/server/node/server.cli', - exclude: ['vs/css', 'vs/nls'] + exclude: ['vs/css'] }, { name: 'vs/workbench/api/node/extensionHostProcess', - exclude: ['vs/css', 'vs/nls'] + exclude: ['vs/css'] }, { name: 'vs/platform/files/node/watcher/watcherMain', - exclude: ['vs/css', 'vs/nls'] + exclude: ['vs/css'] }, { name: 'vs/platform/terminal/node/ptyHostMain', - exclude: ['vs/css', 'vs/nls'] + exclude: ['vs/css'] } ]; +const webEntryPoints = !isAMD() ? [ + buildfile.base, + buildfile.workerExtensionHost, + buildfile.workerNotebook, + buildfile.workerLanguageDetection, + buildfile.workerLocalFileSearch, + buildfile.workerOutputLinks, + buildfile.workerBackgroundTokenization, + buildfile.keyboardMaps, + buildfile.codeWeb +].flat() : [ + buildfile.entrypoint('vs/workbench/workbench.web.main.internal'), + buildfile.base, + buildfile.workerExtensionHost, + buildfile.workerNotebook, + buildfile.workerLanguageDetection, + buildfile.workerLocalFileSearch, + buildfile.keyboardMaps, + buildfile.workbenchWeb() +].flat(); + const serverWithWebEntryPoints = [ // Include all of server ...serverEntryPoints, - // Include workbench web - ...vscodeWebEntryPoints + // Include all of web + ...webEntryPoints, +].flat(); + +const commonJSEntryPoints = [ + 'out-build/server-main.js', + 'out-build/server-cli.js', + 'out-build/bootstrap-fork.js', ]; function getNodeVersion() { - const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8'); - const nodeVersion = /^target "(.*)"$/m.exec(yarnrc)[1]; - const internalNodeVersion = /^ms_build_id "(.*)"$/m.exec(yarnrc)[1]; + const npmrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.npmrc'), 'utf8'); + const nodeVersion = /^target="(.*)"$/m.exec(npmrc)[1]; + const internalNodeVersion = /^ms_build_id="(.*)"$/m.exec(npmrc)[1]; return { nodeVersion, internalNodeVersion }; } -function getNodeChecksum(nodeVersion, platform, arch, glibcPrefix) { - let expectedName; - switch (platform) { - case 'win32': - expectedName = product.nodejsRepository !== 'https://nodejs.org' ? - `win-${arch}-node.exe` : `win-${arch}/node.exe`; - break; - - case 'darwin': - case 'alpine': - case 'linux': - expectedName = `node-v${nodeVersion}${glibcPrefix}-${platform}-${arch}.tar.gz`; - break; - } - +function getNodeChecksum(expectedName) { const nodeJsChecksums = fs.readFileSync(path.join(REPO_ROOT, 'build', 'checksums', 'nodejs.txt'), 'utf8'); for (const line of nodeJsChecksums.split('\n')) { const [checksum, name] = line.split(/\s+/); @@ -183,7 +219,6 @@ if (defaultNodeTask) { function nodejs(platform, arch) { const { fetchUrls, fetchGithub } = require('./lib/fetch'); const untar = require('gulp-untar'); - const crypto = require('crypto'); if (arch === 'armhf') { arch = 'armv7l'; @@ -195,7 +230,24 @@ function nodejs(platform, arch) { log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from ${product.nodejsRepository}...`); const glibcPrefix = process.env['VSCODE_NODE_GLIBC'] ?? ''; - const checksumSha256 = getNodeChecksum(nodeVersion, platform, arch, glibcPrefix); + let expectedName; + switch (platform) { + case 'win32': + expectedName = product.nodejsRepository !== 'https://nodejs.org' ? + `win-${arch}-node.exe` : `win-${arch}/node.exe`; + break; + + case 'darwin': + expectedName = `node-v${nodeVersion}-${platform}-${arch}.tar.gz`; + break; + case 'linux': + expectedName = `node-v${nodeVersion}${glibcPrefix}-${platform}-${arch}.tar.gz`; + break; + case 'alpine': + expectedName = `node-v${nodeVersion}-linux-${arch}-musl.tar.gz`; + break; + } + const checksumSha256 = getNodeChecksum(expectedName); if (checksumSha256) { log(`Using SHA256 checksum for checking integrity: ${checksumSha256}`); @@ -206,13 +258,13 @@ function nodejs(platform, arch) { switch (platform) { case 'win32': return (product.nodejsRepository !== 'https://nodejs.org' ? - fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: `win-${arch}-node.exe`, checksumSha256 }) : + fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: expectedName, checksumSha256 }) : fetchUrls(`/dist/v${nodeVersion}/win-${arch}/node.exe`, { base: 'https://nodejs.org', checksumSha256 })) .pipe(rename('node.exe')); case 'darwin': case 'linux': return (product.nodejsRepository !== 'https://nodejs.org' ? - fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: `node-v${nodeVersion}${glibcPrefix}-${platform}-${arch}.tar.gz`, checksumSha256 }) : + fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: expectedName, checksumSha256 }) : fetchUrls(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', checksumSha256 }) ).pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar()))) .pipe(filter('**/node')) @@ -220,7 +272,7 @@ function nodejs(platform, arch) { .pipe(rename('node')); case 'alpine': return product.nodejsRepository !== 'https://nodejs.org' ? - fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: `node-v${nodeVersion}-${platform}-${arch}.tar.gz`, checksumSha256 }) + fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: expectedName, checksumSha256 }) .pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar()))) .pipe(filter('**/node')) .pipe(util.setExecutableBit('**')) @@ -289,23 +341,32 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa } const name = product.nameShort; - const packageJsonStream = gulp.src(['remote/package.json'], { base: 'remote' }) - .pipe(json({ name, version, dependencies: undefined, optionalDependencies: undefined })); - const date = new Date().toISOString(); + let packageJsonContents; + const packageJsonStream = gulp.src(['remote/package.json'], { base: 'remote' }) + .pipe(json({ name, version, dependencies: undefined, optionalDependencies: undefined, ...(!isAMD() ? { type: 'module' } : {}) })) // TODO@esm this should be configured in the top level package.json + .pipe(es.through(function (file) { + packageJsonContents = file.contents.toString(); + this.emit('data', file); + })); + let productJsonContents; const productJsonStream = gulp.src(['product.json'], { base: '.' }) - .pipe(json({ commit, date, version })); + .pipe(json({ commit, date: readISODate('out-build'), version })) + .pipe(es.through(function (file) { + productJsonContents = file.contents.toString(); + this.emit('data', file); + })); const license = gulp.src(['remote/LICENSE'], { base: 'remote', allowEmpty: true }); const jsFilter = util.filter(data => !data.isDirectory() && /\.js$/.test(data.path)); const productionDependencies = getProductionDependencies(REMOTE_FOLDER); - const dependenciesSrc = productionDependencies.map(d => path.relative(REPO_ROOT, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`, `!${d}/.bin/**`]).flat(); + const dependenciesSrc = productionDependencies.map(d => path.relative(REPO_ROOT, d)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`, `!${d}/.bin/**`]).flat(); const deps = gulp.src(dependenciesSrc, { base: 'remote', dot: true }) // filter out unnecessary files, no source maps in server build - .pipe(filter(['**', '!**/package-lock.json', '!**/yarn.lock', '!**/*.js.map'])) + .pipe(filter(['**', '!**/package-lock.json', '!**/*.js.map'])) .pipe(util.cleanNodeModules(path.join(__dirname, '.moduleignore'))) .pipe(util.cleanNodeModules(path.join(__dirname, `.moduleignore.${process.platform}`))) .pipe(jsFilter) @@ -388,6 +449,12 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa ); } + result = inlineMeta(result, { + targetPaths: commonJSEntryPoints, + packageJsonFn: () => packageJsonContents, + productJsonFn: () => productJsonContents + }); + return result.pipe(vfs.dest(destination)); }; } @@ -419,16 +486,14 @@ function tweakProductForServerWeb(product) { }, commonJS: { src: 'out-build', - entryPoints: [ - 'out-build/server-main.js', - 'out-build/server-cli.js' - ], + entryPoints: commonJSEntryPoints, platform: 'node', external: [ 'minimist', - // TODO: we cannot inline `product.json` because + // We cannot inline `product.json` from here because // it is being changed during build time at a later // point in time (such as `checksums`) + // We have a manual step to inline these later. '../product.json', '../package.json' ] diff --git a/build/gulpfile.scan.js b/build/gulpfile.scan.js index 6f8144b0954..be685a8b145 100644 --- a/build/gulpfile.scan.js +++ b/build/gulpfile.scan.js @@ -26,6 +26,9 @@ const BUILD_TARGETS = [ { platform: 'linux', arch: 'arm64' }, ]; +// The following files do not have PDBs downloaded for them during the download symbols process. +const excludedCheckList = ['d3dcompiler_47.dll']; + BUILD_TARGETS.forEach(buildTarget => { const dashed = (/** @type {string | null} */ str) => (str ? `-${str}` : ``); const platform = buildTarget.platform; @@ -46,7 +49,6 @@ BUILD_TARGETS.forEach(buildTarget => { if (platform === 'win32') { tasks.push( () => electron.dest(destinationPdb, { ...config, platform, arch: arch === 'armhf' ? 'arm' : arch, pdbs: true }), - util.rimraf(path.join(destinationExe, 'd3dcompiler_47.dll')), () => confirmPdbsExist(destinationExe, destinationPdb) ); } @@ -71,7 +73,7 @@ BUILD_TARGETS.forEach(buildTarget => { function nodeModules(destinationExe, destinationPdb, platform) { const productionDependencies = deps.getProductionDependencies(root); - const dependenciesSrc = productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`]).flat(); + const dependenciesSrc = productionDependencies.map(d => path.relative(root, d)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`]).flat(); const exe = () => { return gulp.src(dependenciesSrc, { base: '.', dot: true }) @@ -81,7 +83,8 @@ function nodeModules(destinationExe, destinationPdb, platform) { // We don't build the prebuilt node files so we don't scan them '!**/prebuilds/**/*.node', // These are 3rd party modules that we should ignore - '!**/@parcel/watcher/**/*'])) + '!**/@parcel/watcher/**/*', + '!**/@bpasero/watcher/**/*'])) .pipe(gulp.dest(destinationExe)); }; @@ -110,6 +113,10 @@ function nodeModules(destinationExe, destinationPdb, platform) { function confirmPdbsExist(destinationExe, destinationPdb) { readdirSync(destinationExe).forEach(file => { + if (excludedCheckList.includes(file)) { + return; + } + if (file.endsWith('.dll') || file.endsWith('.exe')) { const pdb = `${file}.pdb`; if (!existsSync(path.join(destinationPdb, pdb))) { diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index c6202c70883..9dfb6a3848c 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -6,10 +6,7 @@ 'use strict'; const gulp = require('gulp'); -const merge = require('gulp-merge-json'); const fs = require('fs'); -const os = require('os'); -const cp = require('child_process'); const path = require('path'); const es = require('event-stream'); const vfs = require('vinyl-fs'); @@ -18,9 +15,11 @@ const replace = require('gulp-replace'); const filter = require('gulp-filter'); const util = require('./lib/util'); const { getVersion } = require('./lib/getVersion'); +const { readISODate } = require('./lib/date'); const task = require('./lib/task'); -const buildfile = require('../src/buildfile'); +const buildfile = require('./buildfile'); const optimize = require('./lib/optimize'); +const { inlineMeta } = require('./lib/inlineMeta'); const root = path.dirname(__dirname); const commit = getVersion(root); const packageJson = require('../package.json'); @@ -34,11 +33,23 @@ const minimist = require('minimist'); const { compileBuildTask } = require('./gulpfile.compile'); const { compileExtensionsBuildTask, compileExtensionMediaBuildTask } = require('./gulpfile.extensions'); const { promisify } = require('util'); +const { isAMD } = require('./lib/amd'); const glob = promisify(require('glob')); const rcedit = promisify(require('rcedit')); // Build -const vscodeEntryPoints = [ +const vscodeEntryPoints = !isAMD() ? [ + buildfile.base, + buildfile.workerExtensionHost, + buildfile.workerNotebook, + buildfile.workerLanguageDetection, + buildfile.workerLocalFileSearch, + buildfile.workerProfileAnalysis, + buildfile.workerOutputLinks, + buildfile.workerBackgroundTokenization, + buildfile.workbenchDesktop(), + buildfile.code +].flat() : [ buildfile.entrypoint('vs/workbench/workbench.desktop.main'), buildfile.base, buildfile.workerExtensionHost, @@ -46,21 +57,72 @@ const vscodeEntryPoints = [ buildfile.workerLanguageDetection, buildfile.workerLocalFileSearch, buildfile.workerProfileAnalysis, - buildfile.workbenchDesktop, + buildfile.workbenchDesktop(), buildfile.code ].flat(); -const vscodeResources = [ - 'out-build/bootstrap.js', - 'out-build/bootstrap-fork.js', - 'out-build/bootstrap-amd.js', - 'out-build/bootstrap-node.js', - 'out-build/bootstrap-window.js', +const vscodeResourceIncludes = !isAMD() ? [ + + // NLS + 'out-build/nls.messages.json', + 'out-build/nls.keys.json', + + // Workbench + 'out-build/vs/code/electron-sandbox/workbench/workbench.esm.html', + + // Electron Preload + 'out-build/vs/base/parts/sandbox/electron-sandbox/preload.js', + 'out-build/vs/base/parts/sandbox/electron-sandbox/preload-aux.js', + + // Node Scripts + 'out-build/vs/base/node/{terminateProcess.sh,cpuUsage.sh,ps.sh}', + + // Touchbar + 'out-build/vs/workbench/browser/parts/editor/media/*.png', + 'out-build/vs/workbench/contrib/debug/browser/media/*.png', + + // External Terminal + 'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt', + + // Terminal shell integration + 'out-build/vs/workbench/contrib/terminal/common/scripts/fish_xdg_data/fish/vendor_conf.d/*.fish', + 'out-build/vs/workbench/contrib/terminal/common/scripts/*.ps1', + 'out-build/vs/workbench/contrib/terminal/common/scripts/*.psm1', + 'out-build/vs/workbench/contrib/terminal/common/scripts/*.sh', + 'out-build/vs/workbench/contrib/terminal/common/scripts/*.zsh', + + // Accessibility Signals + 'out-build/vs/platform/accessibilitySignal/browser/media/*.mp3', + + // Welcome + 'out-build/vs/workbench/contrib/welcomeGettingStarted/common/media/**/*.{svg,png}', + + // Extensions + 'out-build/vs/workbench/contrib/extensions/browser/media/{theme-icon.png,language-icon.svg}', + 'out-build/vs/workbench/services/extensionManagement/common/media/*.{svg,png}', + + // Webview + 'out-build/vs/workbench/contrib/webview/browser/pre/*.{js,html}', + + // Extension Host Worker + 'out-build/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html', + + // Process Explorer + 'out-build/vs/code/electron-sandbox/processExplorer/processExplorer.esm.html', + + // Tree Sitter highlights + 'out-build/vs/editor/common/languages/highlights/*.scm', + + // Issue Reporter + 'out-build/vs/workbench/contrib/issue/electron-sandbox/issueReporter.esm.html' +] : [ + 'out-build/nls.messages.json', + 'out-build/nls.keys.json', 'out-build/vs/**/*.{svg,png,html,jpg,mp3}', '!out-build/vs/code/browser/**/*.html', '!out-build/vs/code/**/*-dev.html', + '!out-build/vs/code/**/*-dev.esm.html', '!out-build/vs/editor/standalone/**/*.svg', - 'out-build/vs/base/common/performance.js', 'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh,ps.sh}', 'out-build/vs/base/browser/ui/codicons/codicon/**', 'out-build/vs/base/parts/sandbox/electron-sandbox/preload.js', @@ -68,25 +130,48 @@ const vscodeResources = [ 'out-build/vs/workbench/browser/media/*-theme.css', 'out-build/vs/workbench/contrib/debug/**/*.json', 'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt', - 'out-build/vs/workbench/contrib/terminal/browser/media/fish_xdg_data/fish/vendor_conf.d/*.fish', - 'out-build/vs/workbench/contrib/terminal/browser/media/*.ps1', - 'out-build/vs/workbench/contrib/terminal/browser/media/*.sh', - 'out-build/vs/workbench/contrib/terminal/browser/media/*.zsh', + 'out-build/vs/workbench/contrib/terminal/common/scripts/fish_xdg_data/fish/vendor_conf.d/*.fish', + 'out-build/vs/workbench/contrib/terminal/common/scripts/*.ps1', + 'out-build/vs/workbench/contrib/terminal/common/scripts/*.psm1', + 'out-build/vs/workbench/contrib/terminal/common/scripts/*.sh', + 'out-build/vs/workbench/contrib/terminal/common/scripts/*.zsh', 'out-build/vs/workbench/contrib/webview/browser/pre/*.js', - '!out-build/vs/workbench/contrib/issue/browser/*.html', '!out-build/vs/workbench/contrib/issue/**/*-dev.html', + '!out-build/vs/workbench/contrib/issue/**/*-dev.esm.html', + 'out-build/vs/editor/common/languages/highlights/*.scm', 'out-build/vs/**/markdown.css', 'out-build/vs/workbench/contrib/tasks/**/*.json', '!**/test/**' ]; +const vscodeResources = [ + + // Includes + ...vscodeResourceIncludes, + + // Excludes + '!out-build/vs/code/browser/**', + '!out-build/vs/editor/standalone/**', + '!out-build/vs/code/**/*-dev.html', + '!out-build/vs/code/**/*-dev.esm.html', + '!out-build/vs/workbench/contrib/issue/**/*-dev.html', + '!out-build/vs/workbench/contrib/issue/**/*-dev.esm.html', + '!**/test/**' +]; + // Do not change the order of these files! They will // be inlined into the target window file in this order // and they depend on each other in this way. -const windowBootstrapFiles = [ - 'out-build/bootstrap.js', - 'out-build/vs/loader.js', - 'out-build/bootstrap-window.js' +const windowBootstrapFiles = []; +if (isAMD()) { + windowBootstrapFiles.push('out-build/vs/loader.js'); +} +windowBootstrapFiles.push('out-build/bootstrap-window.js'); + +const commonJSEntryPoints = [ + 'out-build/main.js', + 'out-build/cli.js', + 'out-build/bootstrap-fork.js' ]; const optimizeVSCodeTask = task.define('optimize-vscode', task.series( @@ -107,17 +192,16 @@ const optimizeVSCodeTask = task.define('optimize-vscode', task.series( }, commonJS: { src: 'out-build', - entryPoints: [ - 'out-build/main.js', - 'out-build/cli.js' - ], + entryPoints: commonJSEntryPoints, platform: 'node', external: [ 'electron', 'minimist', - // TODO: we cannot inline `product.json` because + 'original-fs', + // We cannot inline `product.json` from here because // it is being changed during build time at a later // point in time (such as `checksums`) + // We have a manual step to inline these later. '../product.json', '../package.json', ] @@ -212,7 +296,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op 'vs/workbench/workbench.desktop.main.js', 'vs/workbench/workbench.desktop.main.css', 'vs/workbench/api/node/extensionHostProcess.js', - 'vs/code/electron-sandbox/workbench/workbench.html', + !isAMD() ? 'vs/code/electron-sandbox/workbench/workbench.esm.html' : 'vs/code/electron-sandbox/workbench/workbench.html', 'vs/code/electron-sandbox/workbench/workbench.js' ]); @@ -242,21 +326,28 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op } const name = product.nameShort; - const packageJsonUpdates = { name, version }; + const packageJsonUpdates = { name, version, ...(!isAMD() ? { type: 'module', main: 'out/main.js' } : {}) }; // TODO@esm this should be configured in the top level package.json // for linux url handling if (platform === 'linux') { packageJsonUpdates.desktopName = `${product.applicationName}-url-handler.desktop`; } + let packageJsonContents; const packageJsonStream = gulp.src(['package.json'], { base: '.' }) - .pipe(json(packageJsonUpdates)); - - const date = new Date().toISOString(); - const productJsonUpdate = { commit, date, checksums, version }; + .pipe(json(packageJsonUpdates)) + .pipe(es.through(function (file) { + packageJsonContents = file.contents.toString(); + this.emit('data', file); + })); + let productJsonContents; const productJsonStream = gulp.src(['product.json'], { base: '.' }) - .pipe(json(productJsonUpdate)); + .pipe(json({ commit, date: readISODate('out-build'), checksums, version })) + .pipe(es.through(function (file) { + productJsonContents = file.contents.toString(); + this.emit('data', file); + })); const license = gulp.src([product.licenseFileName, 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true }); @@ -268,7 +359,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op const jsFilter = util.filter(data => !data.isDirectory() && /\.js$/.test(data.path)); const root = path.resolve(path.join(__dirname, '..')); const productionDependencies = getProductionDependencies(root); - const dependenciesSrc = productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`]).flat(); + const dependenciesSrc = productionDependencies.map(d => path.relative(root, d)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`, `!**/*.mk`]).flat(); const deps = gulp.src(dependenciesSrc, { base: '.', dot: true }) .pipe(filter(['**', `!**/${config.version}/**`, '!**/bin/darwin-arm64-87/**', '!**/package-lock.json', '!**/yarn.lock', '!**/*.js.map'])) @@ -281,10 +372,18 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op '**/*.node', '**/@vscode/ripgrep/bin/*', '**/node-pty/build/Release/*', + '**/node-pty/build/Release/conpty/*', '**/node-pty/lib/worker/conoutSocketWorker.js', '**/node-pty/lib/shared/conout.js', '**/*.wasm', '**/@vscode/vsce-sign/bin/*', + ], isAMD() ? [ + '**/*.mk', + ] : [ + '**/*.mk', + '!node_modules/vsda/**' // stay compatible with extensions that depend on us shipping `vsda` into ASAR + ], isAMD() ? [] : [ + 'node_modules/vsda/**' // retain copy of `vsda` in node_modules for internal use ], 'node_modules.asar')); let all = es.merge( @@ -389,6 +488,12 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op .pipe(rename('bin/' + product.applicationName))); } + result = inlineMeta(result, { + targetPaths: commonJSEntryPoints, + packageJsonFn: () => packageJsonContents, + productJsonFn: () => productJsonContents + }); + return result.pipe(vfs.dest(destination)); }; } @@ -397,7 +502,7 @@ function patchWin32DependenciesTask(destinationFolderName) { const cwd = path.join(path.dirname(root), destinationFolderName); return async () => { - const deps = await glob('**/*.node', { cwd }); + const deps = await glob('**/*.node', { cwd, ignore: 'extensions/node_modules/@parcel/watcher/**' }); const packageJson = JSON.parse(await fs.promises.readFile(path.join(cwd, 'resources', 'app', 'package.json'), 'utf8')); const product = JSON.parse(await fs.promises.readFile(path.join(cwd, 'resources', 'app', 'product.json'), 'utf8')); const baseVersion = packageJson.version.replace(/-.*$/, ''); @@ -496,17 +601,12 @@ gulp.task(task.define( core, compileExtensionsBuildTask, function () { - const pathToMetadata = './out-vscode/nls.metadata.json'; - const pathToRehWebMetadata = './out-vscode-reh-web/nls.metadata.json'; + const pathToMetadata = './out-build/nls.metadata.json'; const pathToExtensions = '.build/extensions/*'; const pathToSetup = 'build/win32/i18n/messages.en.isl'; return es.merge( - gulp.src([pathToMetadata, pathToRehWebMetadata]).pipe(merge({ - fileName: 'nls.metadata.json', - jsonSpace: '', - concatArrays: true - })).pipe(i18n.createXlfFilesForCoreBundle()), + gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()), gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()), gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions()) ).pipe(vfs.dest('../vscode-translations-export')); diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index 28ddfb04c3d..5fa5a5d136e 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -108,7 +108,11 @@ function prepareDebPackage(arch) { .pipe(replace('@@NAME@@', product.applicationName)) .pipe(rename('DEBIAN/postinst')); - const all = es.merge(control, postinst, postrm, prerm, desktops, appdata, workspaceMime, icon, bash_completion, zsh_completion, code); + const templates = gulp.src('resources/linux/debian/templates.template', { base: '.' }) + .pipe(replace('@@NAME@@', product.applicationName)) + .pipe(rename('DEBIAN/templates')); + + const all = es.merge(control, templates, postinst, postrm, prerm, desktops, appdata, workspaceMime, icon, bash_completion, zsh_completion, code); return all.pipe(vfs.dest(destination)); }; @@ -148,6 +152,7 @@ function getRpmPackageArch(arch) { function prepareRpmPackage(arch) { const binaryDir = '../VSCode-linux-' + arch; const rpmArch = getRpmPackageArch(arch); + const stripBinary = process.env['STRIP'] ?? '/usr/bin/strip'; return function () { const desktop = gulp.src('resources/linux/code.desktop', { base: '.' }) @@ -204,6 +209,7 @@ function prepareRpmPackage(arch) { .pipe(replace('@@QUALITY@@', product.quality || '@@QUALITY@@')) .pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@')) .pipe(replace('@@DEPENDENCIES@@', dependencies.join(', '))) + .pipe(replace('@@STRIP@@', stripBinary)) .pipe(rename('SPECS/' + product.applicationName + '.spec')) .pipe(es.through(function (f) { that.emit('data', f); }, function () { that.emit('end'); })); })); diff --git a/build/gulpfile.vscode.web.js b/build/gulpfile.vscode.web.js index 50c7e6fb631..80b7fc559a4 100644 --- a/build/gulpfile.vscode.web.js +++ b/build/gulpfile.vscode.web.js @@ -12,15 +12,17 @@ const util = require('./lib/util'); const { getVersion } = require('./lib/getVersion'); const task = require('./lib/task'); const optimize = require('./lib/optimize'); +const { readISODate } = require('./lib/date'); const product = require('../product.json'); const rename = require('gulp-rename'); const filter = require('gulp-filter'); const { getProductionDependencies } = require('./lib/dependencies'); const vfs = require('vinyl-fs'); -const replace = require('gulp-replace'); const packageJson = require('../package.json'); const { compileBuildTask } = require('./gulpfile.compile'); const extensions = require('./lib/extensions'); +const { isAMD } = require('./lib/amd'); +const VinylFile = require('vinyl'); const REPO_ROOT = path.dirname(__dirname); const BUILD_ROOT = path.dirname(REPO_ROOT); @@ -30,13 +32,40 @@ const commit = getVersion(REPO_ROOT); const quality = product.quality; const version = (quality && quality !== 'stable') ? `${packageJson.version}-${quality}` : packageJson.version; -const vscodeWebResourceIncludes = [ +const vscodeWebResourceIncludes = !isAMD() ? [ + + // NLS + 'out-build/nls.messages.js', + + // Accessibility Signals + 'out-build/vs/platform/accessibilitySignal/browser/media/*.mp3', + + // Welcome + 'out-build/vs/workbench/contrib/welcomeGettingStarted/common/media/**/*.{svg,png}', + + // Extensions + 'out-build/vs/workbench/contrib/extensions/browser/media/{theme-icon.png,language-icon.svg}', + 'out-build/vs/workbench/services/extensionManagement/common/media/*.{svg,png}', + + // Webview + 'out-build/vs/workbench/contrib/webview/browser/pre/*.{js,html}', + + // Tree Sitter highlights + 'out-build/vs/editor/common/languages/highlights/*.scm', + + // Extension Host Worker + 'out-build/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html', +] : [ + // Workbench 'out-build/vs/{base,platform,editor,workbench}/**/*.{svg,png,jpg,mp3}', 'out-build/vs/code/browser/workbench/*.html', 'out-build/vs/base/browser/ui/codicons/codicon/**/*.ttf', 'out-build/vs/**/markdown.css', + // NLS + 'out-build/nls.messages.js', + // Webview 'out-build/vs/workbench/contrib/webview/browser/pre/*.js', 'out-build/vs/workbench/contrib/webview/browser/pre/*.html', @@ -44,6 +73,9 @@ const vscodeWebResourceIncludes = [ // Extension Worker 'out-build/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html', + // Tree Sitter highlights + 'out-build/vs/editor/common/languages/highlights/*.scm', + // Web node paths (needed for integration tests) 'out-build/vs/webPackagePaths.js', ]; @@ -55,28 +87,37 @@ const vscodeWebResources = [ ...vscodeWebResourceIncludes, // Excludes - '!out-build/vs/**/{node,electron-sandbox,electron-main}/**', + '!out-build/vs/**/{node,electron-sandbox,electron-main,electron-utility}/**', '!out-build/vs/editor/standalone/**', '!out-build/vs/workbench/**/*-tb.png', + '!out-build/vs/code/**/*-dev.html', + '!out-build/vs/code/**/*-dev.esm.html', '!**/test/**' ]; -const buildfile = require('../src/buildfile'); +const buildfile = require('./buildfile'); -const vscodeWebEntryPoints = [ - buildfile.entrypoint('vs/workbench/workbench.web.main'), +const vscodeWebEntryPoints = !isAMD() ? [ buildfile.base, buildfile.workerExtensionHost, buildfile.workerNotebook, buildfile.workerLanguageDetection, buildfile.workerLocalFileSearch, - buildfile.workerProfileAnalysis, + buildfile.workerOutputLinks, + buildfile.workerBackgroundTokenization, buildfile.keyboardMaps, - buildfile.workbenchWeb + buildfile.workbenchWeb(), + buildfile.entrypoint('vs/workbench/workbench.web.main.internal') // TODO@esm remove line when we stop supporting web-amd-esm-bridge +].flat() : [ + buildfile.entrypoint('vs/workbench/workbench.web.main.internal'), + buildfile.base, + buildfile.workerExtensionHost, + buildfile.workerNotebook, + buildfile.workerLanguageDetection, + buildfile.workerLocalFileSearch, + buildfile.keyboardMaps, + buildfile.workbenchWeb() ].flat(); -exports.vscodeWebEntryPoints = vscodeWebEntryPoints; - -const buildDate = new Date().toISOString(); /** * @param {object} product The parsed product.json file contents @@ -93,7 +134,7 @@ const createVSCodeWebProductConfigurationPatcher = (product) => { ...product, version, commit, - date: buildDate + date: readISODate('out-build') }); return content.replace('/*BUILD->INSERT_PRODUCT_CONFIGURATION*/', () => productConfiguration.substr(1, productConfiguration.length - 2) /* without { and }*/); } @@ -190,8 +231,21 @@ function packageTask(sourceFolderName, destinationFolderName) { const extensions = gulp.src('.build/web/extensions/**', { base: '.build/web', dot: true }); - const sources = es.merge(src, extensions) - .pipe(filter(['**', '!**/*.js.map'], { dot: true })); + const loader = gulp.src('build/loader.min', { base: 'build', dot: true }).pipe(rename('out/vs/loader.js')); // TODO@esm remove line when we stop supporting web-amd-esm-bridge + + const sources = es.merge(...(!isAMD() ? [src, extensions, loader] : [src, extensions])) + .pipe(filter(['**', '!**/*.js.map'], { dot: true })) + // TODO@esm remove me once we stop supporting our web-esm-bridge + .pipe(es.through(function (file) { + if (file.relative === 'out/vs/workbench/workbench.web.main.internal.css') { + this.emit('data', new VinylFile({ + contents: file.contents, + path: file.path.replace('workbench.web.main.internal.css', 'workbench.web.main.css'), + base: file.base + })); + } + this.emit('data', file); + })); const name = product.nameShort; const packageJsonStream = gulp.src(['remote/web/package.json'], { base: 'remote/web' }) @@ -200,7 +254,7 @@ function packageTask(sourceFolderName, destinationFolderName) { const license = gulp.src(['remote/LICENSE'], { base: 'remote', allowEmpty: true }); const productionDependencies = getProductionDependencies(WEB_FOLDER); - const dependenciesSrc = productionDependencies.map(d => path.relative(REPO_ROOT, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`, `!${d}/.bin/**`]).flat(); + const dependenciesSrc = productionDependencies.map(d => path.relative(REPO_ROOT, d)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`, `!${d}/.bin/**`]).flat(); const deps = gulp.src(dependenciesSrc, { base: 'remote/web', dot: true }) .pipe(filter(['**', '!**/package-lock.json'])) diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js index 5adfdfbfe18..98175f530dd 100644 --- a/build/gulpfile.vscode.win32.js +++ b/build/gulpfile.vscode.win32.js @@ -16,7 +16,6 @@ const pkg = require('../package.json'); const product = require('../product.json'); const vfs = require('vinyl-fs'); const rcedit = require('rcedit'); -const mkdirp = require('mkdirp'); const repoPath = path.dirname(__dirname); const buildPath = (/** @type {string} */ arch) => path.join(path.dirname(repoPath), `VSCode-win32-${arch}`); @@ -75,7 +74,7 @@ function buildWin32Setup(arch, target) { const sourcePath = buildPath(arch); const outputPath = setupDir(arch, target); - mkdirp.sync(outputPath); + fs.mkdirSync(outputPath, { recursive: true }); const originalProductJsonPath = path.join(sourcePath, 'resources/app/product.json'); const productJsonPath = path.join(outputPath, 'product.json'); diff --git a/build/hygiene.js b/build/hygiene.js index bc64a11f8e9..010967c49ff 100644 --- a/build/hygiene.js +++ b/build/hygiene.js @@ -145,11 +145,13 @@ function hygiene(some, linting = true) { const productJsonFilter = filter('product.json', { restore: true }); const snapshotFilter = filter(['**', '!**/*.snap', '!**/*.snap.actual']); + const yarnLockFilter = filter(['**', '!**/yarn.lock']); const unicodeFilterStream = filter(unicodeFilter, { restore: true }); const result = input .pipe(filter((f) => !f.stat.isDirectory())) .pipe(snapshotFilter) + .pipe(yarnLockFilter) .pipe(productJsonFilter) .pipe(process.env['BUILD_SOURCEVERSION'] ? es.through() : productJson) .pipe(productJsonFilter.restore) diff --git a/build/lib/amd.js b/build/lib/amd.js new file mode 100644 index 00000000000..8d4e428f830 --- /dev/null +++ b/build/lib/amd.js @@ -0,0 +1,41 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setAMD = setAMD; +exports.isAMD = isAMD; +const path = require("path"); +const fs = require("fs"); +// TODO@esm remove this +const outDirectory = path.join(__dirname, '..', '..', 'out-build'); +const amdMarkerFile = path.join(outDirectory, 'amd'); +function setAMD(enabled) { + const result = () => new Promise((resolve, _) => { + if (enabled) { + fs.mkdirSync(outDirectory, { recursive: true }); + fs.writeFileSync(amdMarkerFile, 'true', 'utf8'); + console.warn(`Setting build to AMD: true`); + } + else { + console.warn(`Setting build to AMD: false`); + } + resolve(); + }); + result.taskName = 'set-amd'; + return result; +} +function isAMD(logWarning) { + try { + const res = (typeof process.env.VSCODE_BUILD_AMD === 'string' && process.env.VSCODE_BUILD_AMD.toLowerCase() === 'true') || (fs.readFileSync(amdMarkerFile, 'utf8') === 'true'); + if (res && logWarning) { + console.warn(`[amd] ${logWarning}`); + } + return res; + } + catch (error) { + return false; + } +} +//# sourceMappingURL=amd.js.map \ No newline at end of file diff --git a/build/lib/amd.ts b/build/lib/amd.ts new file mode 100644 index 00000000000..5373024c6a0 --- /dev/null +++ b/build/lib/amd.ts @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as path from 'path'; +import * as fs from 'fs'; + +// TODO@esm remove this + +const outDirectory = path.join(__dirname, '..', '..', 'out-build'); +const amdMarkerFile = path.join(outDirectory, 'amd'); + +export function setAMD(enabled: boolean) { + const result = () => new Promise((resolve, _) => { + if (enabled) { + fs.mkdirSync(outDirectory, { recursive: true }); + fs.writeFileSync(amdMarkerFile, 'true', 'utf8'); + console.warn(`Setting build to AMD: true`); + } else { + console.warn(`Setting build to AMD: false`); + } + + resolve(); + }); + result.taskName = 'set-amd'; + return result; +} + +export function isAMD(logWarning?: string): boolean { + try { + const res = (typeof process.env.VSCODE_BUILD_AMD === 'string' && process.env.VSCODE_BUILD_AMD.toLowerCase() === 'true') || (fs.readFileSync(amdMarkerFile, 'utf8') === 'true'); + if (res && logWarning) { + console.warn(`[amd] ${logWarning}`); + } + return res; + } catch (error) { + return false; + } +} diff --git a/build/lib/asar.js b/build/lib/asar.js index 31845f2f2dd..19285ef7100 100644 --- a/build/lib/asar.js +++ b/build/lib/asar.js @@ -11,7 +11,7 @@ const pickle = require('chromium-pickle-js'); const Filesystem = require('asar/lib/filesystem'); const VinylFile = require("vinyl"); const minimatch = require("minimatch"); -function createAsar(folderPath, unpackGlobs, destFilename) { +function createAsar(folderPath, unpackGlobs, skipGlobs, duplicateGlobs, destFilename) { const shouldUnpackFile = (file) => { for (let i = 0; i < unpackGlobs.length; i++) { if (minimatch(file.relative, unpackGlobs[i])) { @@ -20,6 +20,24 @@ function createAsar(folderPath, unpackGlobs, destFilename) { } return false; }; + const shouldSkipFile = (file) => { + for (const skipGlob of skipGlobs) { + if (minimatch(file.relative, skipGlob)) { + return true; + } + } + return false; + }; + // Files that should be duplicated between + // node_modules.asar and node_modules + const shouldDuplicateFile = (file) => { + for (const duplicateGlob of duplicateGlobs) { + if (minimatch(file.relative, duplicateGlob)) { + return true; + } + } + return false; + }; const filesystem = new Filesystem(folderPath); const out = []; // Keep track of pending inserts @@ -64,6 +82,23 @@ function createAsar(folderPath, unpackGlobs, destFilename) { if (!file.stat.isFile()) { throw new Error(`unknown item in stream!`); } + if (shouldSkipFile(file)) { + this.queue(new VinylFile({ + base: '.', + path: file.path, + stat: file.stat, + contents: file.contents + })); + return; + } + if (shouldDuplicateFile(file)) { + this.queue(new VinylFile({ + base: '.', + path: file.path, + stat: file.stat, + contents: file.contents + })); + } const shouldUnpack = shouldUnpackFile(file); insertFile(file.relative, { size: file.contents.length, mode: file.stat.mode }, shouldUnpack); if (shouldUnpack) { diff --git a/build/lib/asar.ts b/build/lib/asar.ts index 44a6416bdfb..0b225ab1624 100644 --- a/build/lib/asar.ts +++ b/build/lib/asar.ts @@ -17,7 +17,7 @@ declare class AsarFilesystem { insertFile(path: string, shouldUnpack: boolean, file: { stat: { size: number; mode: number } }, options: {}): Promise; } -export function createAsar(folderPath: string, unpackGlobs: string[], destFilename: string): NodeJS.ReadWriteStream { +export function createAsar(folderPath: string, unpackGlobs: string[], skipGlobs: string[], duplicateGlobs: string[], destFilename: string): NodeJS.ReadWriteStream { const shouldUnpackFile = (file: VinylFile): boolean => { for (let i = 0; i < unpackGlobs.length; i++) { @@ -28,6 +28,26 @@ export function createAsar(folderPath: string, unpackGlobs: string[], destFilena return false; }; + const shouldSkipFile = (file: VinylFile): boolean => { + for (const skipGlob of skipGlobs) { + if (minimatch(file.relative, skipGlob)) { + return true; + } + } + return false; + }; + + // Files that should be duplicated between + // node_modules.asar and node_modules + const shouldDuplicateFile = (file: VinylFile): boolean => { + for (const duplicateGlob of duplicateGlobs) { + if (minimatch(file.relative, duplicateGlob)) { + return true; + } + } + return false; + }; + const filesystem = new Filesystem(folderPath); const out: Buffer[] = []; @@ -78,6 +98,23 @@ export function createAsar(folderPath: string, unpackGlobs: string[], destFilena if (!file.stat.isFile()) { throw new Error(`unknown item in stream!`); } + if (shouldSkipFile(file)) { + this.queue(new VinylFile({ + base: '.', + path: file.path, + stat: file.stat, + contents: file.contents + })); + return; + } + if (shouldDuplicateFile(file)) { + this.queue(new VinylFile({ + base: '.', + path: file.path, + stat: file.stat, + contents: file.contents + })); + } const shouldUnpack = shouldUnpackFile(file); insertFile(file.relative, { size: file.contents.length, mode: file.stat.mode }, shouldUnpack); diff --git a/build/lib/builtInExtensions.js b/build/lib/builtInExtensions.js index 463ce16e18d..ac784c03506 100644 --- a/build/lib/builtInExtensions.js +++ b/build/lib/builtInExtensions.js @@ -16,7 +16,6 @@ const vfs = require("vinyl-fs"); const ext = require("./extensions"); const fancyLog = require("fancy-log"); const ansiColors = require("ansi-colors"); -const mkdirp = require('mkdirp'); const root = path.dirname(path.dirname(__dirname)); const productjson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8')); const builtInExtensions = productjson.builtInExtensions || []; @@ -107,7 +106,7 @@ function readControlFile() { } } function writeControlFile(control) { - mkdirp.sync(path.dirname(controlFilePath)); + fs.mkdirSync(path.dirname(controlFilePath), { recursive: true }); fs.writeFileSync(controlFilePath, JSON.stringify(control, null, 2)); } function getBuiltInExtensions() { diff --git a/build/lib/builtInExtensions.ts b/build/lib/builtInExtensions.ts index fefed436bb9..8b831d42d44 100644 --- a/build/lib/builtInExtensions.ts +++ b/build/lib/builtInExtensions.ts @@ -15,8 +15,6 @@ import * as fancyLog from 'fancy-log'; import * as ansiColors from 'ansi-colors'; import { Stream } from 'stream'; -const mkdirp = require('mkdirp'); - export interface IExtensionDefinition { name: string; version: string; @@ -147,7 +145,7 @@ function readControlFile(): IControlFile { } function writeControlFile(control: IControlFile): void { - mkdirp.sync(path.dirname(controlFilePath)); + fs.mkdirSync(path.dirname(controlFilePath), { recursive: true }); fs.writeFileSync(controlFilePath, JSON.stringify(control, null, 2)); } diff --git a/build/lib/builtInExtensionsCG.js b/build/lib/builtInExtensionsCG.js index 30b6791b3a0..6a1e5ea539e 100644 --- a/build/lib/builtInExtensionsCG.js +++ b/build/lib/builtInExtensionsCG.js @@ -15,7 +15,7 @@ const builtInExtensions = productjson.builtInExtensions || []; const webBuiltInExtensions = productjson.webBuiltInExtensions || []; const token = process.env['GITHUB_TOKEN']; const contentBasePath = 'raw.githubusercontent.com'; -const contentFileNames = ['package.json', 'package-lock.json', 'yarn.lock']; +const contentFileNames = ['package.json', 'package-lock.json']; async function downloadExtensionDetails(extension) { const extensionLabel = `${extension.name}@${extension.version}`; const repository = url.parse(extension.repo).path.substr(1); @@ -58,9 +58,8 @@ async function downloadExtensionDetails(extension) { if (!results.find(r => r.fileName === 'package.json')?.body) { // throw new Error(`The "package.json" file could not be found for the built-in extension - ${extensionLabel}`); } - if (!results.find(r => r.fileName === 'package-lock.json')?.body && - !results.find(r => r.fileName === 'yarn.lock')?.body) { - // throw new Error(`The "package-lock.json"/"yarn.lock" could not be found for the built-in extension - ${extensionLabel}`); + if (!results.find(r => r.fileName === 'package-lock.json')?.body) { + // throw new Error(`The "package-lock.json" could not be found for the built-in extension - ${extensionLabel}`); } } async function main() { diff --git a/build/lib/builtInExtensionsCG.ts b/build/lib/builtInExtensionsCG.ts index 62d09498221..9d11dea3dca 100644 --- a/build/lib/builtInExtensionsCG.ts +++ b/build/lib/builtInExtensionsCG.ts @@ -17,7 +17,7 @@ const webBuiltInExtensions = productjson.webBuiltInExten const token = process.env['GITHUB_TOKEN']; const contentBasePath = 'raw.githubusercontent.com'; -const contentFileNames = ['package.json', 'package-lock.json', 'yarn.lock']; +const contentFileNames = ['package.json', 'package-lock.json']; async function downloadExtensionDetails(extension: IExtensionDefinition): Promise { const extensionLabel = `${extension.name}@${extension.version}`; @@ -61,9 +61,8 @@ async function downloadExtensionDetails(extension: IExtensionDefinition): Promis if (!results.find(r => r.fileName === 'package.json')?.body) { // throw new Error(`The "package.json" file could not be found for the built-in extension - ${extensionLabel}`); } - if (!results.find(r => r.fileName === 'package-lock.json')?.body && - !results.find(r => r.fileName === 'yarn.lock')?.body) { - // throw new Error(`The "package-lock.json"/"yarn.lock" could not be found for the built-in extension - ${extensionLabel}`); + if (!results.find(r => r.fileName === 'package-lock.json')?.body) { + // throw new Error(`The "package-lock.json" could not be found for the built-in extension - ${extensionLabel}`); } } diff --git a/build/lib/bundle.js b/build/lib/bundle.js index 1a2f870991f..627b9966700 100644 --- a/build/lib/bundle.js +++ b/build/lib/bundle.js @@ -5,6 +5,7 @@ *--------------------------------------------------------------------------------------------*/ Object.defineProperty(exports, "__esModule", { value: true }); exports.bundle = bundle; +exports.removeAllTSBoilerplate = removeAllTSBoilerplate; const fs = require("fs"); const path = require("path"); const vm = require("vm"); @@ -36,14 +37,10 @@ function bundle(entryPoints, config, callback) { const loader = loaderModule.exports; config.isBuild = true; config.paths = config.paths || {}; - if (!config.paths['vs/nls']) { - config.paths['vs/nls'] = 'out-build/vs/nls.build'; - } if (!config.paths['vs/css']) { config.paths['vs/css'] = 'out-build/vs/css.build'; } config.buildForceInvokeFactory = config.buildForceInvokeFactory || {}; - config.buildForceInvokeFactory['vs/nls'] = true; config.buildForceInvokeFactory['vs/css'] = true; loader.config(config); loader(['require'], (localRequire) => { @@ -53,15 +50,11 @@ function bundle(entryPoints, config, callback) { r += '.js'; } // avoid packaging the build version of plugins: - r = r.replace('vs/nls.build.js', 'vs/nls.js'); r = r.replace('vs/css.build.js', 'vs/css.js'); return { path: r, amdModuleId: entry.amdModuleId }; }; for (const moduleId in entryPointsMap) { const entryPoint = entryPointsMap[moduleId]; - if (entryPoint.append) { - entryPoint.append = entryPoint.append.map(resolvePath); - } if (entryPoint.prepend) { entryPoint.prepend = entryPoint.prepend.map(resolvePath); } @@ -109,7 +102,7 @@ function emitEntryPoints(modules, entryPoints) { return allDependencies[module]; }); bundleData.bundles[moduleToBundle] = includedModules; - const res = emitEntryPoint(modulesMap, modulesGraph, moduleToBundle, includedModules, info.prepend || [], info.append || [], info.dest); + const res = emitEntryPoint(modulesMap, modulesGraph, moduleToBundle, includedModules, info.prepend || [], info.dest); result = result.concat(res.files); for (const pluginName in res.usedPlugins) { usedPlugins[pluginName] = usedPlugins[pluginName] || res.usedPlugins[pluginName]; @@ -132,7 +125,7 @@ function emitEntryPoints(modules, entryPoints) { }); return { // TODO@TS 2.1.2 - files: extractStrings(removeDuplicateTSBoilerplate(result)), + files: extractStrings(removeAllDuplicateTSBoilerplate(result)), bundleData: bundleData }; } @@ -221,61 +214,68 @@ function extractStrings(destFiles) { }); return destFiles; } -function removeDuplicateTSBoilerplate(destFiles) { - // Taken from typescript compiler => emitFiles - const BOILERPLATE = [ - { start: /^var __extends/, end: /^}\)\(\);$/ }, - { start: /^var __assign/, end: /^};$/ }, - { start: /^var __decorate/, end: /^};$/ }, - { start: /^var __metadata/, end: /^};$/ }, - { start: /^var __param/, end: /^};$/ }, - { start: /^var __awaiter/, end: /^};$/ }, - { start: /^var __generator/, end: /^};$/ }, - { start: /^var __createBinding/, end: /^}\)\);$/ }, - { start: /^var __setModuleDefault/, end: /^}\);$/ }, - { start: /^var __importStar/, end: /^};$/ }, - ]; +function removeAllDuplicateTSBoilerplate(destFiles) { destFiles.forEach((destFile) => { const SEEN_BOILERPLATE = []; destFile.sources.forEach((source) => { - const lines = source.contents.split(/\r\n|\n|\r/); - const newLines = []; - let IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE; - for (let i = 0; i < lines.length; i++) { - const line = lines[i]; - if (IS_REMOVING_BOILERPLATE) { - newLines.push(''); - if (END_BOILERPLATE.test(line)) { - IS_REMOVING_BOILERPLATE = false; - } - } - else { - for (let j = 0; j < BOILERPLATE.length; j++) { - const boilerplate = BOILERPLATE[j]; - if (boilerplate.start.test(line)) { - if (SEEN_BOILERPLATE[j]) { - IS_REMOVING_BOILERPLATE = true; - END_BOILERPLATE = boilerplate.end; - } - else { - SEEN_BOILERPLATE[j] = true; - } - } - } - if (IS_REMOVING_BOILERPLATE) { - newLines.push(''); + source.contents = removeDuplicateTSBoilerplate(source.contents, SEEN_BOILERPLATE); + }); + }); + return destFiles; +} +function removeAllTSBoilerplate(source) { + const seen = new Array(BOILERPLATE.length).fill(true, 0, 10); + return removeDuplicateTSBoilerplate(source, seen); +} +// Taken from typescript compiler => emitFiles +const BOILERPLATE = [ + { start: /^var __extends/, end: /^}\)\(\);$/ }, + { start: /^var __assign/, end: /^};$/ }, + { start: /^var __decorate/, end: /^};$/ }, + { start: /^var __metadata/, end: /^};$/ }, + { start: /^var __param/, end: /^};$/ }, + { start: /^var __awaiter/, end: /^};$/ }, + { start: /^var __generator/, end: /^};$/ }, + { start: /^var __createBinding/, end: /^}\)\);$/ }, + { start: /^var __setModuleDefault/, end: /^}\);$/ }, + { start: /^var __importStar/, end: /^};$/ }, +]; +function removeDuplicateTSBoilerplate(source, SEEN_BOILERPLATE = []) { + const lines = source.split(/\r\n|\n|\r/); + const newLines = []; + let IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE; + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + if (IS_REMOVING_BOILERPLATE) { + newLines.push(''); + if (END_BOILERPLATE.test(line)) { + IS_REMOVING_BOILERPLATE = false; + } + } + else { + for (let j = 0; j < BOILERPLATE.length; j++) { + const boilerplate = BOILERPLATE[j]; + if (boilerplate.start.test(line)) { + if (SEEN_BOILERPLATE[j]) { + IS_REMOVING_BOILERPLATE = true; + END_BOILERPLATE = boilerplate.end; } else { - newLines.push(line); + SEEN_BOILERPLATE[j] = true; } } } - source.contents = newLines.join('\n'); - }); - }); - return destFiles; + if (IS_REMOVING_BOILERPLATE) { + newLines.push(''); + } + else { + newLines.push(line); + } + } + } + return newLines.join('\n'); } -function emitEntryPoint(modulesMap, deps, entryPoint, includedModules, prepend, append, dest) { +function emitEntryPoint(modulesMap, deps, entryPoint, includedModules, prepend, dest) { if (!dest) { dest = entryPoint + '.js'; } @@ -349,8 +349,7 @@ function emitEntryPoint(modulesMap, deps, entryPoint, includedModules, prepend, }; }; const toPrepend = (prepend || []).map(toIFile); - const toAppend = (append || []).map(toIFile); - mainResult.sources = toPrepend.concat(mainResult.sources).concat(toAppend); + mainResult.sources = toPrepend.concat(mainResult.sources); return { files: results, usedPlugins: usedPlugins diff --git a/build/lib/bundle.ts b/build/lib/bundle.ts index 2efa081b471..6e3f96a5062 100644 --- a/build/lib/bundle.ts +++ b/build/lib/bundle.ts @@ -52,8 +52,8 @@ export interface IEntryPoint { include?: string[]; exclude?: string[]; prepend?: IExtraFile[]; - append?: IExtraFile[]; dest?: string; + target?: 'amd' | 'esm'; } interface IEntryPointMap { @@ -138,14 +138,10 @@ export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callba const loader: any = loaderModule.exports; config.isBuild = true; config.paths = config.paths || {}; - if (!config.paths['vs/nls']) { - config.paths['vs/nls'] = 'out-build/vs/nls.build'; - } if (!config.paths['vs/css']) { config.paths['vs/css'] = 'out-build/vs/css.build'; } config.buildForceInvokeFactory = config.buildForceInvokeFactory || {}; - config.buildForceInvokeFactory['vs/nls'] = true; config.buildForceInvokeFactory['vs/css'] = true; loader.config(config); @@ -156,15 +152,11 @@ export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callba r += '.js'; } // avoid packaging the build version of plugins: - r = r.replace('vs/nls.build.js', 'vs/nls.js'); r = r.replace('vs/css.build.js', 'vs/css.js'); return { path: r, amdModuleId: entry.amdModuleId }; }; for (const moduleId in entryPointsMap) { const entryPoint = entryPointsMap[moduleId]; - if (entryPoint.append) { - entryPoint.append = entryPoint.append.map(resolvePath); - } if (entryPoint.prepend) { entryPoint.prepend = entryPoint.prepend.map(resolvePath); } @@ -228,7 +220,6 @@ function emitEntryPoints(modules: IBuildModuleInfo[], entryPoints: IEntryPointMa moduleToBundle, includedModules, info.prepend || [], - info.append || [], info.dest ); @@ -256,7 +247,7 @@ function emitEntryPoints(modules: IBuildModuleInfo[], entryPoints: IEntryPointMa return { // TODO@TS 2.1.2 - files: extractStrings(removeDuplicateTSBoilerplate(result)), + files: extractStrings(removeAllDuplicateTSBoilerplate(result)), bundleData: bundleData }; } @@ -355,61 +346,70 @@ function extractStrings(destFiles: IConcatFile[]): IConcatFile[] { return destFiles; } -function removeDuplicateTSBoilerplate(destFiles: IConcatFile[]): IConcatFile[] { - // Taken from typescript compiler => emitFiles - const BOILERPLATE = [ - { start: /^var __extends/, end: /^}\)\(\);$/ }, - { start: /^var __assign/, end: /^};$/ }, - { start: /^var __decorate/, end: /^};$/ }, - { start: /^var __metadata/, end: /^};$/ }, - { start: /^var __param/, end: /^};$/ }, - { start: /^var __awaiter/, end: /^};$/ }, - { start: /^var __generator/, end: /^};$/ }, - { start: /^var __createBinding/, end: /^}\)\);$/ }, - { start: /^var __setModuleDefault/, end: /^}\);$/ }, - { start: /^var __importStar/, end: /^};$/ }, - ]; - +function removeAllDuplicateTSBoilerplate(destFiles: IConcatFile[]): IConcatFile[] { destFiles.forEach((destFile) => { const SEEN_BOILERPLATE: boolean[] = []; destFile.sources.forEach((source) => { - const lines = source.contents.split(/\r\n|\n|\r/); - const newLines: string[] = []; - let IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE: RegExp; - - for (let i = 0; i < lines.length; i++) { - const line = lines[i]; - if (IS_REMOVING_BOILERPLATE) { - newLines.push(''); - if (END_BOILERPLATE!.test(line)) { - IS_REMOVING_BOILERPLATE = false; - } - } else { - for (let j = 0; j < BOILERPLATE.length; j++) { - const boilerplate = BOILERPLATE[j]; - if (boilerplate.start.test(line)) { - if (SEEN_BOILERPLATE[j]) { - IS_REMOVING_BOILERPLATE = true; - END_BOILERPLATE = boilerplate.end; - } else { - SEEN_BOILERPLATE[j] = true; - } - } - } - if (IS_REMOVING_BOILERPLATE) { - newLines.push(''); - } else { - newLines.push(line); - } - } - } - source.contents = newLines.join('\n'); + source.contents = removeDuplicateTSBoilerplate(source.contents, SEEN_BOILERPLATE); }); }); return destFiles; } +export function removeAllTSBoilerplate(source: string) { + const seen = new Array(BOILERPLATE.length).fill(true, 0, 10); + return removeDuplicateTSBoilerplate(source, seen); +} + +// Taken from typescript compiler => emitFiles +const BOILERPLATE = [ + { start: /^var __extends/, end: /^}\)\(\);$/ }, + { start: /^var __assign/, end: /^};$/ }, + { start: /^var __decorate/, end: /^};$/ }, + { start: /^var __metadata/, end: /^};$/ }, + { start: /^var __param/, end: /^};$/ }, + { start: /^var __awaiter/, end: /^};$/ }, + { start: /^var __generator/, end: /^};$/ }, + { start: /^var __createBinding/, end: /^}\)\);$/ }, + { start: /^var __setModuleDefault/, end: /^}\);$/ }, + { start: /^var __importStar/, end: /^};$/ }, +]; + +function removeDuplicateTSBoilerplate(source: string, SEEN_BOILERPLATE: boolean[] = []): string { + const lines = source.split(/\r\n|\n|\r/); + const newLines: string[] = []; + let IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE: RegExp; + + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + if (IS_REMOVING_BOILERPLATE) { + newLines.push(''); + if (END_BOILERPLATE!.test(line)) { + IS_REMOVING_BOILERPLATE = false; + } + } else { + for (let j = 0; j < BOILERPLATE.length; j++) { + const boilerplate = BOILERPLATE[j]; + if (boilerplate.start.test(line)) { + if (SEEN_BOILERPLATE[j]) { + IS_REMOVING_BOILERPLATE = true; + END_BOILERPLATE = boilerplate.end; + } else { + SEEN_BOILERPLATE[j] = true; + } + } + } + if (IS_REMOVING_BOILERPLATE) { + newLines.push(''); + } else { + newLines.push(line); + } + } + } + return newLines.join('\n'); +} + interface IPluginMap { [moduleId: string]: ILoaderPlugin; } @@ -425,7 +425,6 @@ function emitEntryPoint( entryPoint: string, includedModules: string[], prepend: IExtraFile[], - append: IExtraFile[], dest: string | undefined ): IEmitEntryPointResult { if (!dest) { @@ -511,9 +510,8 @@ function emitEntryPoint( }; const toPrepend = (prepend || []).map(toIFile); - const toAppend = (append || []).map(toIFile); - mainResult.sources = toPrepend.concat(mainResult.sources).concat(toAppend); + mainResult.sources = toPrepend.concat(mainResult.sources); return { files: results, diff --git a/build/lib/compilation.js b/build/lib/compilation.js index 2f408d562ce..e6fe4b592a6 100644 --- a/build/lib/compilation.js +++ b/build/lib/compilation.js @@ -41,7 +41,7 @@ function getTypeScriptCompilerOptions(src) { options.newLine = /\r\n/.test(fs.readFileSync(__filename, 'utf8')) ? 0 : 1; return options; } -function createCompile(src, build, emitError, transpileOnly) { +function createCompile(src, { build, emitError, transpileOnly, preserveEnglish }) { const tsb = require('./tsb'); const sourcemaps = require('gulp-sourcemaps'); const projectPath = path.join(__dirname, '../../', src, 'tsconfig.json'); @@ -71,7 +71,7 @@ function createCompile(src, build, emitError, transpileOnly) { .pipe(util.loadSourcemaps()) .pipe(compilation(token)) .pipe(noDeclarationsFilter) - .pipe(util.$if(build, nls.nls())) + .pipe(util.$if(build, nls.nls({ preserveEnglish }))) .pipe(noDeclarationsFilter.restore) .pipe(util.$if(!transpileOnly, sourcemaps.write('.', { addComment: false, @@ -90,7 +90,7 @@ function createCompile(src, build, emitError, transpileOnly) { } function transpileTask(src, out, swc) { const task = () => { - const transpile = createCompile(src, false, true, { swc }); + const transpile = createCompile(src, { build: false, emitError: true, transpileOnly: { swc }, preserveEnglish: false }); const srcPipe = gulp.src(`${src}/**`, { base: `${src}` }); return srcPipe .pipe(transpile()) @@ -104,7 +104,7 @@ function compileTask(src, out, build, options = {}) { if (os.totalmem() < 4_000_000_000) { throw new Error('compilation requires 4GB of RAM'); } - const compile = createCompile(src, build, true, false); + const compile = createCompile(src, { build, emitError: true, transpileOnly: false, preserveEnglish: !!options.preserveEnglish }); const srcPipe = gulp.src(`${src}/**`, { base: `${src}` }); const generator = new MonacoGenerator(false); if (src === 'src') { @@ -139,11 +139,11 @@ function compileTask(src, out, build, options = {}) { task.taskName = `compile-${path.basename(src)}`; return task; } -function watchTask(out, build) { +function watchTask(out, build, srcPath = 'src') { const task = () => { - const compile = createCompile('src', build, false, false); - const src = gulp.src('src/**', { base: 'src' }); - const watchSrc = watch('src/**', { base: 'src', readDelay: 200 }); + const compile = createCompile(srcPath, { build, emitError: false, transpileOnly: false, preserveEnglish: false }); + const src = gulp.src(`${srcPath}/**`, { base: srcPath }); + const watchSrc = watch(`${srcPath}/**`, { base: srcPath, readDelay: 200 }); const generator = new MonacoGenerator(true); generator.execute(); return watchSrc diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts index 3b6fa2df339..978fb15df9e 100644 --- a/build/lib/compilation.ts +++ b/build/lib/compilation.ts @@ -42,7 +42,14 @@ function getTypeScriptCompilerOptions(src: string): ts.CompilerOptions { return options; } -function createCompile(src: string, build: boolean, emitError: boolean, transpileOnly: boolean | { swc: boolean }) { +interface ICompileTaskOptions { + readonly build: boolean; + readonly emitError: boolean; + readonly transpileOnly: boolean | { swc: boolean }; + readonly preserveEnglish: boolean; +} + +function createCompile(src: string, { build, emitError, transpileOnly, preserveEnglish }: ICompileTaskOptions) { const tsb = require('./tsb') as typeof import('./tsb'); const sourcemaps = require('gulp-sourcemaps') as typeof import('gulp-sourcemaps'); @@ -79,7 +86,7 @@ function createCompile(src: string, build: boolean, emitError: boolean, transpil .pipe(util.loadSourcemaps()) .pipe(compilation(token)) .pipe(noDeclarationsFilter) - .pipe(util.$if(build, nls.nls())) + .pipe(util.$if(build, nls.nls({ preserveEnglish }))) .pipe(noDeclarationsFilter.restore) .pipe(util.$if(!transpileOnly, sourcemaps.write('.', { addComment: false, @@ -102,7 +109,7 @@ export function transpileTask(src: string, out: string, swc: boolean): task.Stre const task = () => { - const transpile = createCompile(src, false, true, { swc }); + const transpile = createCompile(src, { build: false, emitError: true, transpileOnly: { swc }, preserveEnglish: false }); const srcPipe = gulp.src(`${src}/**`, { base: `${src}` }); return srcPipe @@ -114,7 +121,7 @@ export function transpileTask(src: string, out: string, swc: boolean): task.Stre return task; } -export function compileTask(src: string, out: string, build: boolean, options: { disableMangle?: boolean } = {}): task.StreamTask { +export function compileTask(src: string, out: string, build: boolean, options: { disableMangle?: boolean; preserveEnglish?: boolean } = {}): task.StreamTask { const task = () => { @@ -122,7 +129,7 @@ export function compileTask(src: string, out: string, build: boolean, options: { throw new Error('compilation requires 4GB of RAM'); } - const compile = createCompile(src, build, true, false); + const compile = createCompile(src, { build, emitError: true, transpileOnly: false, preserveEnglish: !!options.preserveEnglish }); const srcPipe = gulp.src(`${src}/**`, { base: `${src}` }); const generator = new MonacoGenerator(false); if (src === 'src') { @@ -163,13 +170,13 @@ export function compileTask(src: string, out: string, build: boolean, options: { return task; } -export function watchTask(out: string, build: boolean): task.StreamTask { +export function watchTask(out: string, build: boolean, srcPath: string = 'src'): task.StreamTask { const task = () => { - const compile = createCompile('src', build, false, false); + const compile = createCompile(srcPath, { build, emitError: false, transpileOnly: false, preserveEnglish: false }); - const src = gulp.src('src/**', { base: 'src' }); - const watchSrc = watch('src/**', { base: 'src', readDelay: 200 }); + const src = gulp.src(`${srcPath}/**`, { base: srcPath }); + const watchSrc = watch(`${srcPath}/**`, { base: srcPath, readDelay: 200 }); const generator = new MonacoGenerator(true); generator.execute(); diff --git a/build/lib/date.js b/build/lib/date.js new file mode 100644 index 00000000000..77fff0e5073 --- /dev/null +++ b/build/lib/date.js @@ -0,0 +1,32 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeISODate = writeISODate; +exports.readISODate = readISODate; +const path = require("path"); +const fs = require("fs"); +const root = path.join(__dirname, '..', '..'); +/** + * Writes a `outDir/date` file with the contents of the build + * so that other tasks during the build process can use it and + * all use the same date. + */ +function writeISODate(outDir) { + const result = () => new Promise((resolve, _) => { + const outDirectory = path.join(root, outDir); + fs.mkdirSync(outDirectory, { recursive: true }); + const date = new Date().toISOString(); + fs.writeFileSync(path.join(outDirectory, 'date'), date, 'utf8'); + resolve(); + }); + result.taskName = 'build-date-file'; + return result; +} +function readISODate(outDir) { + const outDirectory = path.join(root, outDir); + return fs.readFileSync(path.join(outDirectory, 'date'), 'utf8'); +} +//# sourceMappingURL=date.js.map \ No newline at end of file diff --git a/build/lib/date.ts b/build/lib/date.ts new file mode 100644 index 00000000000..998e89f8e6a --- /dev/null +++ b/build/lib/date.ts @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as path from 'path'; +import * as fs from 'fs'; + +const root = path.join(__dirname, '..', '..'); + +/** + * Writes a `outDir/date` file with the contents of the build + * so that other tasks during the build process can use it and + * all use the same date. + */ +export function writeISODate(outDir: string) { + const result = () => new Promise((resolve, _) => { + const outDirectory = path.join(root, outDir); + fs.mkdirSync(outDirectory, { recursive: true }); + + const date = new Date().toISOString(); + fs.writeFileSync(path.join(outDirectory, 'date'), date, 'utf8'); + + resolve(); + }); + result.taskName = 'build-date-file'; + return result; +} + +export function readISODate(outDir: string): string { + const outDirectory = path.join(root, outDir); + return fs.readFileSync(path.join(outDirectory, 'date'), 'utf8'); +} diff --git a/build/lib/dependencies.js b/build/lib/dependencies.js index 1f2dd75d68c..9bcd1204eab 100644 --- a/build/lib/dependencies.js +++ b/build/lib/dependencies.js @@ -8,64 +8,43 @@ exports.getProductionDependencies = getProductionDependencies; const fs = require("fs"); const path = require("path"); const cp = require("child_process"); -const parseSemver = require('parse-semver'); const root = fs.realpathSync(path.dirname(path.dirname(__dirname))); -function asYarnDependency(prefix, tree) { - let parseResult; +function getNpmProductionDependencies(folder) { + let raw; try { - parseResult = parseSemver(tree.name); + raw = cp.execSync('npm ls --all --omit=dev --parseable', { cwd: folder, encoding: 'utf8', env: { ...process.env, NODE_ENV: 'production' }, stdio: [null, null, null] }); } catch (err) { - err.message += `: ${tree.name}`; - console.warn(`Could not parse semver: ${tree.name}`); - return null; - } - // not an actual dependency in disk - if (parseResult.version !== parseResult.range) { - return null; - } - const name = parseResult.name; - const version = parseResult.version; - const dependencyPath = path.join(prefix, name); - const children = []; - for (const child of (tree.children || [])) { - const dep = asYarnDependency(path.join(prefix, name, 'node_modules'), child); - if (dep) { - children.push(dep); + const regex = /^npm ERR! .*$/gm; + let match; + while (match = regex.exec(err.message)) { + if (/ELSPROBLEMS/.test(match[0])) { + continue; + } + else if (/invalid: xterm/.test(match[0])) { + continue; + } + else if (/A complete log of this run/.test(match[0])) { + continue; + } + else { + throw err; + } } + raw = err.stdout; } - return { name, version, path: dependencyPath, children }; -} -function getYarnProductionDependencies(folderPath) { - const raw = cp.execSync('yarn list --json', { cwd: folderPath, encoding: 'utf8', env: { ...process.env, NODE_ENV: 'production' }, stdio: [null, null, 'inherit'] }); - const match = /^{"type":"tree".*$/m.exec(raw); - if (!match || match.length !== 1) { - throw new Error('Could not parse result of `yarn list --json`'); - } - const trees = JSON.parse(match[0]).data.trees; - return trees - .map(tree => asYarnDependency(path.join(folderPath, 'node_modules'), tree)) - .filter((dep) => !!dep); + return raw.split(/\r?\n/).filter(line => { + return !!line.trim() && path.relative(root, line) !== path.relative(root, folder); + }); } function getProductionDependencies(folderPath) { - const result = []; - const deps = getYarnProductionDependencies(folderPath); - const flatten = (dep) => { result.push({ name: dep.name, version: dep.version, path: dep.path }); dep.children.forEach(flatten); }; - deps.forEach(flatten); + const result = getNpmProductionDependencies(folderPath); // Account for distro npm dependencies const realFolderPath = fs.realpathSync(folderPath); const relativeFolderPath = path.relative(root, realFolderPath); - const distroPackageJsonPath = `${root}/.build/distro/npm/${relativeFolderPath}/package.json`; - if (fs.existsSync(distroPackageJsonPath)) { - const distroPackageJson = JSON.parse(fs.readFileSync(distroPackageJsonPath, 'utf8')); - const distroDependencyNames = Object.keys(distroPackageJson.dependencies ?? {}); - for (const name of distroDependencyNames) { - result.push({ - name, - version: distroPackageJson.dependencies[name], - path: path.join(realFolderPath, 'node_modules', name) - }); - } + const distroFolderPath = `${root}/.build/distro/npm/${relativeFolderPath}`; + if (fs.existsSync(distroFolderPath)) { + result.push(...getNpmProductionDependencies(distroFolderPath)); } return [...new Set(result)]; } diff --git a/build/lib/dependencies.ts b/build/lib/dependencies.ts index 3b314e7d0c5..45368ffd26d 100644 --- a/build/lib/dependencies.ts +++ b/build/lib/dependencies.ts @@ -6,93 +6,46 @@ import * as fs from 'fs'; import * as path from 'path'; import * as cp from 'child_process'; -const parseSemver = require('parse-semver'); const root = fs.realpathSync(path.dirname(path.dirname(__dirname))); -interface Tree { - readonly name: string; - readonly children?: Tree[]; -} - -interface FlatDependency { - readonly name: string; - readonly version: string; - readonly path: string; -} - -interface Dependency extends FlatDependency { - readonly children: Dependency[]; -} - -function asYarnDependency(prefix: string, tree: Tree): Dependency | null { - let parseResult; +function getNpmProductionDependencies(folder: string): string[] { + let raw: string; try { - parseResult = parseSemver(tree.name); + raw = cp.execSync('npm ls --all --omit=dev --parseable', { cwd: folder, encoding: 'utf8', env: { ...process.env, NODE_ENV: 'production' }, stdio: [null, null, null] }); } catch (err) { - err.message += `: ${tree.name}`; - console.warn(`Could not parse semver: ${tree.name}`); - return null; - } - - // not an actual dependency in disk - if (parseResult.version !== parseResult.range) { - return null; - } - - const name = parseResult.name; - const version = parseResult.version; - const dependencyPath = path.join(prefix, name); - const children = []; - - for (const child of (tree.children || [])) { - const dep = asYarnDependency(path.join(prefix, name, 'node_modules'), child); - - if (dep) { - children.push(dep); + const regex = /^npm ERR! .*$/gm; + let match: RegExpExecArray | null; + + while (match = regex.exec(err.message)) { + if (/ELSPROBLEMS/.test(match[0])) { + continue; + } else if (/invalid: xterm/.test(match[0])) { + continue; + } else if (/A complete log of this run/.test(match[0])) { + continue; + } else { + throw err; + } } - } - - return { name, version, path: dependencyPath, children }; -} -function getYarnProductionDependencies(folderPath: string): Dependency[] { - const raw = cp.execSync('yarn list --json', { cwd: folderPath, encoding: 'utf8', env: { ...process.env, NODE_ENV: 'production' }, stdio: [null, null, 'inherit'] }); - const match = /^{"type":"tree".*$/m.exec(raw); - - if (!match || match.length !== 1) { - throw new Error('Could not parse result of `yarn list --json`'); + raw = err.stdout; } - const trees = JSON.parse(match[0]).data.trees as Tree[]; - - return trees - .map(tree => asYarnDependency(path.join(folderPath, 'node_modules'), tree)) - .filter((dep): dep is Dependency => !!dep); + return raw.split(/\r?\n/).filter(line => { + return !!line.trim() && path.relative(root, line) !== path.relative(root, folder); + }); } -export function getProductionDependencies(folderPath: string): FlatDependency[] { - const result: FlatDependency[] = []; - const deps = getYarnProductionDependencies(folderPath); - const flatten = (dep: Dependency) => { result.push({ name: dep.name, version: dep.version, path: dep.path }); dep.children.forEach(flatten); }; - deps.forEach(flatten); - +export function getProductionDependencies(folderPath: string): string[] { + const result = getNpmProductionDependencies(folderPath); // Account for distro npm dependencies const realFolderPath = fs.realpathSync(folderPath); const relativeFolderPath = path.relative(root, realFolderPath); - const distroPackageJsonPath = `${root}/.build/distro/npm/${relativeFolderPath}/package.json`; + const distroFolderPath = `${root}/.build/distro/npm/${relativeFolderPath}`; - if (fs.existsSync(distroPackageJsonPath)) { - const distroPackageJson = JSON.parse(fs.readFileSync(distroPackageJsonPath, 'utf8')); - const distroDependencyNames = Object.keys(distroPackageJson.dependencies ?? {}); - - for (const name of distroDependencyNames) { - result.push({ - name, - version: distroPackageJson.dependencies[name], - path: path.join(realFolderPath, 'node_modules', name) - }); - } + if (fs.existsSync(distroFolderPath)) { + result.push(...getNpmProductionDependencies(distroFolderPath)); } return [...new Set(result)]; diff --git a/build/lib/extensions.js b/build/lib/extensions.js index 58d4d3e9a7f..fbf11ee1ee4 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -97,7 +97,12 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName, disableMangle) { } } } - vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Yarn, packagedDependencies }).then(fileNames => { + // TODO: add prune support based on packagedDependencies to vsce.PackageManager.Npm similar + // to vsce.PackageManager.Yarn. + // A static analysis showed there are no webpack externals that are dependencies of the current + // local extensions so we can use the vsce.PackageManager.None config to ignore dependencies list + // as a temporary workaround. + vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.None, packagedDependencies }).then(fileNames => { const files = fileNames .map(fileName => path.join(extensionPath, fileName)) .map(filePath => new File({ @@ -178,7 +183,7 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName, disableMangle) { function fromLocalNormal(extensionPath) { const vsce = require('@vscode/vsce'); const result = es.through(); - vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Yarn }) + vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Npm }) .then(fileNames => { const files = fileNames .map(fileName => path.join(extensionPath, fileName)) @@ -303,7 +308,7 @@ function packageLocalExtensionsStream(forWeb, disableMangle) { else { // also include shared production node modules const productionDependencies = (0, dependencies_1.getProductionDependencies)('extensions/'); - const dependenciesSrc = productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`]).flat(); + const dependenciesSrc = productionDependencies.map(d => path.relative(root, d)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`]).flat(); result = es.merge(localExtensionsStream, gulp.src(dependenciesSrc, { base: '.' }) .pipe(util2.cleanNodeModules(path.join(root, 'build', '.moduleignore'))) .pipe(util2.cleanNodeModules(path.join(root, 'build', `.moduleignore.${process.platform}`)))); @@ -482,9 +487,6 @@ async function esbuildExtensions(taskName, isWatch, scripts) { return reject(error); } reporter(stderr, script); - if (stderr) { - return reject(); - } return resolve(); }); proc.stdout.on('data', (data) => { diff --git a/build/lib/extensions.ts b/build/lib/extensions.ts index 0582e0cb11e..628cf90c4c9 100644 --- a/build/lib/extensions.ts +++ b/build/lib/extensions.ts @@ -101,7 +101,12 @@ function fromLocalWebpack(extensionPath: string, webpackConfigFileName: string, } } - vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Yarn, packagedDependencies }).then(fileNames => { + // TODO: add prune support based on packagedDependencies to vsce.PackageManager.Npm similar + // to vsce.PackageManager.Yarn. + // A static analysis showed there are no webpack externals that are dependencies of the current + // local extensions so we can use the vsce.PackageManager.None config to ignore dependencies list + // as a temporary workaround. + vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.None, packagedDependencies }).then(fileNames => { const files = fileNames .map(fileName => path.join(extensionPath, fileName)) .map(filePath => new File({ @@ -196,7 +201,7 @@ function fromLocalNormal(extensionPath: string): Stream { const vsce = require('@vscode/vsce') as typeof import('@vscode/vsce'); const result = es.through(); - vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Yarn }) + vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Npm }) .then(fileNames => { const files = fileNames .map(fileName => path.join(extensionPath, fileName)) @@ -354,7 +359,7 @@ export function packageLocalExtensionsStream(forWeb: boolean, disableMangle: boo } else { // also include shared production node modules const productionDependencies = getProductionDependencies('extensions/'); - const dependenciesSrc = productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`]).flat(); + const dependenciesSrc = productionDependencies.map(d => path.relative(root, d)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`]).flat(); result = es.merge( localExtensionsStream, @@ -563,9 +568,6 @@ async function esbuildExtensions(taskName: string, isWatch: boolean, scripts: { return reject(error); } reporter(stderr, script); - if (stderr) { - return reject(); - } return resolve(); }); diff --git a/build/lib/fetch.js b/build/lib/fetch.js index 2fed63bca0e..b7da65f4af2 100644 --- a/build/lib/fetch.js +++ b/build/lib/fetch.js @@ -33,7 +33,7 @@ function fetchUrls(urls, options) { })); } async function fetchUrl(url, options, retries = 10, retryDelay = 1000) { - const verbose = !!options.verbose ?? (!!process.env['CI'] || !!process.env['BUILD_ARTIFACTSTAGINGDIRECTORY']); + const verbose = !!options.verbose || !!process.env['CI'] || !!process.env['BUILD_ARTIFACTSTAGINGDIRECTORY']; try { let startTime = 0; if (verbose) { diff --git a/build/lib/fetch.ts b/build/lib/fetch.ts index dc1de777e04..0c44b8e567f 100644 --- a/build/lib/fetch.ts +++ b/build/lib/fetch.ts @@ -42,7 +42,7 @@ export function fetchUrls(urls: string[] | string, options: IFetchOptions): es.T } export async function fetchUrl(url: string, options: IFetchOptions, retries = 10, retryDelay = 1000): Promise { - const verbose = !!options.verbose ?? (!!process.env['CI'] || !!process.env['BUILD_ARTIFACTSTAGINGDIRECTORY']); + const verbose = !!options.verbose || !!process.env['CI'] || !!process.env['BUILD_ARTIFACTSTAGINGDIRECTORY']; try { let startTime = 0; if (verbose) { diff --git a/build/lib/i18n.js b/build/lib/i18n.js index c33994987f0..6964616291b 100644 --- a/build/lib/i18n.js +++ b/build/lib/i18n.js @@ -23,6 +23,7 @@ const fancyLog = require("fancy-log"); const ansiColors = require("ansi-colors"); const iconv = require("@vscode/iconv-lite-umd"); const l10n_dev_1 = require("@vscode/l10n-dev"); +const REPO_ROOT_PATH = path.join(__dirname, '../..'); function log(message, ...rest) { fancyLog(ansiColors.green('[i18n]'), message, ...rest); } @@ -63,6 +64,17 @@ var BundledFormat; } BundledFormat.is = is; })(BundledFormat || (BundledFormat = {})); +var NLSKeysFormat; +(function (NLSKeysFormat) { + function is(value) { + if (value === undefined) { + return false; + } + const candidate = value; + return Array.isArray(candidate) && Array.isArray(candidate[1]); + } + NLSKeysFormat.is = is; +})(NLSKeysFormat || (NLSKeysFormat = {})); class Line { buffer = []; constructor(indent = 0) { @@ -265,67 +277,8 @@ function stripComments(content) { }); return result; } -function escapeCharacters(value) { - const result = []; - for (let i = 0; i < value.length; i++) { - const ch = value.charAt(i); - switch (ch) { - case '\'': - result.push('\\\''); - break; - case '"': - result.push('\\"'); - break; - case '\\': - result.push('\\\\'); - break; - case '\n': - result.push('\\n'); - break; - case '\r': - result.push('\\r'); - break; - case '\t': - result.push('\\t'); - break; - case '\b': - result.push('\\b'); - break; - case '\f': - result.push('\\f'); - break; - default: - result.push(ch); - } - } - return result.join(''); -} -function processCoreBundleFormat(fileHeader, languages, json, emitter) { - const keysSection = json.keys; - const messageSection = json.messages; - const bundleSection = json.bundles; - const statistics = Object.create(null); - const defaultMessages = Object.create(null); - const modules = Object.keys(keysSection); - modules.forEach((module) => { - const keys = keysSection[module]; - const messages = messageSection[module]; - if (!messages || keys.length !== messages.length) { - emitter.emit('error', `Message for module ${module} corrupted. Mismatch in number of keys and messages.`); - return; - } - const messageMap = Object.create(null); - defaultMessages[module] = messageMap; - keys.map((key, i) => { - if (typeof key === 'string') { - messageMap[key] = messages[i]; - } - else { - messageMap[key.key] = messages[i]; - } - }); - }); - const languageDirectory = path.join(__dirname, '..', '..', '..', 'vscode-loc', 'i18n'); +function processCoreBundleFormat(base, fileHeader, languages, json, emitter) { + const languageDirectory = path.join(REPO_ROOT_PATH, '..', 'vscode-loc', 'i18n'); if (!fs.existsSync(languageDirectory)) { log(`No VS Code localization repository found. Looking at ${languageDirectory}`); log(`To bundle translations please check out the vscode-loc repository as a sibling of the vscode repository.`); @@ -335,8 +288,6 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) { if (process.env['VSCODE_BUILD_VERBOSE']) { log(`Generating nls bundles for: ${language.id}`); } - statistics[language.id] = 0; - const localizedModules = Object.create(null); const languageFolderName = language.translationId || language.id; const i18nFile = path.join(languageDirectory, `vscode-language-pack-${languageFolderName}`, 'translations', 'main.i18n.json'); let allMessages; @@ -344,87 +295,36 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) { const content = stripComments(fs.readFileSync(i18nFile, 'utf8')); allMessages = JSON.parse(content); } - modules.forEach((module) => { - const order = keysSection[module]; - let moduleMessage; - if (allMessages) { - moduleMessage = allMessages.contents[module]; + let nlsIndex = 0; + const nlsResult = []; + for (const [moduleId, nlsKeys] of json) { + const moduleTranslations = allMessages?.contents[moduleId]; + for (const nlsKey of nlsKeys) { + nlsResult.push(moduleTranslations?.[nlsKey]); // pushing `undefined` is fine, as we keep english strings as fallback for monaco editor in the build + nlsIndex++; } - if (!moduleMessage) { - if (process.env['VSCODE_BUILD_VERBOSE']) { - log(`No localized messages found for module ${module}. Using default messages.`); - } - moduleMessage = defaultMessages[module]; - statistics[language.id] = statistics[language.id] + Object.keys(moduleMessage).length; - } - const localizedMessages = []; - order.forEach((keyInfo) => { - let key = null; - if (typeof keyInfo === 'string') { - key = keyInfo; - } - else { - key = keyInfo.key; - } - let message = moduleMessage[key]; - if (!message) { - if (process.env['VSCODE_BUILD_VERBOSE']) { - log(`No localized message found for key ${key} in module ${module}. Using default message.`); - } - message = defaultMessages[module][key]; - statistics[language.id] = statistics[language.id] + 1; - } - localizedMessages.push(message); - }); - localizedModules[module] = localizedMessages; - }); - Object.keys(bundleSection).forEach((bundle) => { - const modules = bundleSection[bundle]; - const contents = [ - fileHeader, - `define("${bundle}.nls.${language.id}", {` - ]; - modules.forEach((module, index) => { - contents.push(`\t"${module}": [`); - const messages = localizedModules[module]; - if (!messages) { - emitter.emit('error', `Didn't find messages for module ${module}.`); - return; - } - messages.forEach((message, index) => { - contents.push(`\t\t"${escapeCharacters(message)}${index < messages.length ? '",' : '"'}`); - }); - contents.push(index < modules.length - 1 ? '\t],' : '\t]'); - }); - contents.push('});'); - emitter.queue(new File({ path: bundle + '.nls.' + language.id + '.js', contents: Buffer.from(contents.join('\n'), 'utf-8') })); - }); - }); - Object.keys(statistics).forEach(key => { - const value = statistics[key]; - log(`${key} has ${value} untranslated strings.`); - }); - sortedLanguages.forEach(language => { - const stats = statistics[language.id]; - if (!stats) { - log(`\tNo translations found for language ${language.id}. Using default language instead.`); } + emitter.queue(new File({ + contents: Buffer.from(`${fileHeader} +globalThis._VSCODE_NLS_MESSAGES=${JSON.stringify(nlsResult)}; +globalThis._VSCODE_NLS_LANGUAGE=${JSON.stringify(language.id)};`), + base, + path: `${base}/nls.messages.${language.id}.js` + })); }); } function processNlsFiles(opts) { return (0, event_stream_1.through)(function (file) { const fileName = path.basename(file.path); - if (fileName === 'nls.metadata.json') { - let json = null; - if (file.isBuffer()) { - json = JSON.parse(file.contents.toString('utf8')); - } - else { - this.emit('error', `Failed to read component file: ${file.relative}`); - return; + if (fileName === 'bundleInfo.json') { // pick a root level file to put the core bundles (TODO@esm this file is not created anymore, pick another) + try { + const json = JSON.parse(fs.readFileSync(path.join(REPO_ROOT_PATH, opts.out, 'nls.keys.json')).toString()); + if (NLSKeysFormat.is(json)) { + processCoreBundleFormat(file.base, opts.fileHeader, opts.languages, json, this); + } } - if (BundledFormat.is(json)) { - processCoreBundleFormat(opts.fileHeader, opts.languages, json, this); + catch (error) { + this.emit('error', `Failed to read component file: ${error}`); } } this.queue(file); diff --git a/build/lib/i18n.resources.json b/build/lib/i18n.resources.json index 219436efb3d..ad6a53b745e 100644 --- a/build/lib/i18n.resources.json +++ b/build/lib/i18n.resources.json @@ -186,14 +186,6 @@ "name": "vs/workbench/contrib/astNavigation", "project": "vscode-workbench" }, - { - "name": "vs/workbench/contrib/aideChat", - "project": "vscode-workbench" - }, - { - "name": "vs/workbench/contrib/inlineAideChat", - "project": "vscode-workbench" - }, { "name": "vs/workbench/contrib/aideProbe", "project": "vscode-workbench" @@ -589,6 +581,14 @@ { "name": "vs/workbench/contrib/authentication", "project": "vscode-workbench" + }, + { + "name": "vs/workbench/contrib/replNotebook", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/contrib/list", + "project": "vscode-workbench" } ] } diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index 444e3abe59c..cd7e522ad36 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -16,6 +16,8 @@ import * as ansiColors from 'ansi-colors'; import * as iconv from '@vscode/iconv-lite-umd'; import { l10nJsonFormat, getL10nXlf, l10nJsonDetails, getL10nFilesFromXlf, getL10nJson } from '@vscode/l10n-dev'; +const REPO_ROOT_PATH = path.join(__dirname, '../..'); + function log(message: any, ...rest: any[]): void { fancyLog(ansiColors.green('[i18n]'), message, ...rest); } @@ -91,6 +93,19 @@ module BundledFormat { } } +type NLSKeysFormat = [string /* module ID */, string[] /* keys */]; + +module NLSKeysFormat { + export function is(value: any): value is NLSKeysFormat { + if (value === undefined) { + return false; + } + + const candidate = value as NLSKeysFormat; + return Array.isArray(candidate) && Array.isArray(candidate[1]); + } +} + interface BundledExtensionFormat { [key: string]: { messages: string[]; @@ -329,70 +344,8 @@ function stripComments(content: string): string { return result; } -function escapeCharacters(value: string): string { - const result: string[] = []; - for (let i = 0; i < value.length; i++) { - const ch = value.charAt(i); - switch (ch) { - case '\'': - result.push('\\\''); - break; - case '"': - result.push('\\"'); - break; - case '\\': - result.push('\\\\'); - break; - case '\n': - result.push('\\n'); - break; - case '\r': - result.push('\\r'); - break; - case '\t': - result.push('\\t'); - break; - case '\b': - result.push('\\b'); - break; - case '\f': - result.push('\\f'); - break; - default: - result.push(ch); - } - } - return result.join(''); -} - -function processCoreBundleFormat(fileHeader: string, languages: Language[], json: BundledFormat, emitter: ThroughStream) { - const keysSection = json.keys; - const messageSection = json.messages; - const bundleSection = json.bundles; - - const statistics: Record = Object.create(null); - - const defaultMessages: Record> = Object.create(null); - const modules = Object.keys(keysSection); - modules.forEach((module) => { - const keys = keysSection[module]; - const messages = messageSection[module]; - if (!messages || keys.length !== messages.length) { - emitter.emit('error', `Message for module ${module} corrupted. Mismatch in number of keys and messages.`); - return; - } - const messageMap: Record = Object.create(null); - defaultMessages[module] = messageMap; - keys.map((key, i) => { - if (typeof key === 'string') { - messageMap[key] = messages[i]; - } else { - messageMap[key.key] = messages[i]; - } - }); - }); - - const languageDirectory = path.join(__dirname, '..', '..', '..', 'vscode-loc', 'i18n'); +function processCoreBundleFormat(base: string, fileHeader: string, languages: Language[], json: NLSKeysFormat, emitter: ThroughStream) { + const languageDirectory = path.join(REPO_ROOT_PATH, '..', 'vscode-loc', 'i18n'); if (!fs.existsSync(languageDirectory)) { log(`No VS Code localization repository found. Looking at ${languageDirectory}`); log(`To bundle translations please check out the vscode-loc repository as a sibling of the vscode repository.`); @@ -403,8 +356,6 @@ function processCoreBundleFormat(fileHeader: string, languages: Language[], json log(`Generating nls bundles for: ${language.id}`); } - statistics[language.id] = 0; - const localizedModules: Record = Object.create(null); const languageFolderName = language.translationId || language.id; const i18nFile = path.join(languageDirectory, `vscode-language-pack-${languageFolderName}`, 'translations', 'main.i18n.json'); let allMessages: I18nFormat | undefined; @@ -412,86 +363,38 @@ function processCoreBundleFormat(fileHeader: string, languages: Language[], json const content = stripComments(fs.readFileSync(i18nFile, 'utf8')); allMessages = JSON.parse(content); } - modules.forEach((module) => { - const order = keysSection[module]; - let moduleMessage: { [messageKey: string]: string } | undefined; - if (allMessages) { - moduleMessage = allMessages.contents[module]; - } - if (!moduleMessage) { - if (process.env['VSCODE_BUILD_VERBOSE']) { - log(`No localized messages found for module ${module}. Using default messages.`); - } - moduleMessage = defaultMessages[module]; - statistics[language.id] = statistics[language.id] + Object.keys(moduleMessage).length; + + let nlsIndex = 0; + const nlsResult: Array = []; + for (const [moduleId, nlsKeys] of json) { + const moduleTranslations = allMessages?.contents[moduleId]; + for (const nlsKey of nlsKeys) { + nlsResult.push(moduleTranslations?.[nlsKey]); // pushing `undefined` is fine, as we keep english strings as fallback for monaco editor in the build + nlsIndex++; } - const localizedMessages: string[] = []; - order.forEach((keyInfo) => { - let key: string | null = null; - if (typeof keyInfo === 'string') { - key = keyInfo; - } else { - key = keyInfo.key; - } - let message: string = moduleMessage![key]; - if (!message) { - if (process.env['VSCODE_BUILD_VERBOSE']) { - log(`No localized message found for key ${key} in module ${module}. Using default message.`); - } - message = defaultMessages[module][key]; - statistics[language.id] = statistics[language.id] + 1; - } - localizedMessages.push(message); - }); - localizedModules[module] = localizedMessages; - }); - Object.keys(bundleSection).forEach((bundle) => { - const modules = bundleSection[bundle]; - const contents: string[] = [ - fileHeader, - `define("${bundle}.nls.${language.id}", {` - ]; - modules.forEach((module, index) => { - contents.push(`\t"${module}": [`); - const messages = localizedModules[module]; - if (!messages) { - emitter.emit('error', `Didn't find messages for module ${module}.`); - return; - } - messages.forEach((message, index) => { - contents.push(`\t\t"${escapeCharacters(message)}${index < messages.length ? '",' : '"'}`); - }); - contents.push(index < modules.length - 1 ? '\t],' : '\t]'); - }); - contents.push('});'); - emitter.queue(new File({ path: bundle + '.nls.' + language.id + '.js', contents: Buffer.from(contents.join('\n'), 'utf-8') })); - }); - }); - Object.keys(statistics).forEach(key => { - const value = statistics[key]; - log(`${key} has ${value} untranslated strings.`); - }); - sortedLanguages.forEach(language => { - const stats = statistics[language.id]; - if (!stats) { - log(`\tNo translations found for language ${language.id}. Using default language instead.`); } + + emitter.queue(new File({ + contents: Buffer.from(`${fileHeader} +globalThis._VSCODE_NLS_MESSAGES=${JSON.stringify(nlsResult)}; +globalThis._VSCODE_NLS_LANGUAGE=${JSON.stringify(language.id)};`), + base, + path: `${base}/nls.messages.${language.id}.js` + })); }); } -export function processNlsFiles(opts: { fileHeader: string; languages: Language[] }): ThroughStream { +export function processNlsFiles(opts: { out: string; fileHeader: string; languages: Language[] }): ThroughStream { return through(function (this: ThroughStream, file: File) { const fileName = path.basename(file.path); - if (fileName === 'nls.metadata.json') { - let json = null; - if (file.isBuffer()) { - json = JSON.parse((file.contents).toString('utf8')); - } else { - this.emit('error', `Failed to read component file: ${file.relative}`); - return; - } - if (BundledFormat.is(json)) { - processCoreBundleFormat(opts.fileHeader, opts.languages, json, this); + if (fileName === 'bundleInfo.json') { // pick a root level file to put the core bundles (TODO@esm this file is not created anymore, pick another) + try { + const json = JSON.parse(fs.readFileSync(path.join(REPO_ROOT_PATH, opts.out, 'nls.keys.json')).toString()); + if (NLSKeysFormat.is(json)) { + processCoreBundleFormat(file.base, opts.fileHeader, opts.languages, json, this); + } + } catch (error) { + this.emit('error', `Failed to read component file: ${error}`); } } this.queue(file); diff --git a/build/lib/inlineMeta.js b/build/lib/inlineMeta.js new file mode 100644 index 00000000000..f1dbfa83a7e --- /dev/null +++ b/build/lib/inlineMeta.js @@ -0,0 +1,48 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.inlineMeta = inlineMeta; +const es = require("event-stream"); +const path_1 = require("path"); +const packageJsonMarkerId = 'BUILD_INSERT_PACKAGE_CONFIGURATION'; +// TODO@bpasero in order to inline `product.json`, more work is +// needed to ensure that we cover all cases where modifications +// are done to the product configuration during build. There are +// at least 2 more changes that kick in very late: +// - a `darwinUniversalAssetId` is added in`create-universal-app.ts` +// - a `target` is added in `gulpfile.vscode.win32.js` +// const productJsonMarkerId = 'BUILD_INSERT_PRODUCT_CONFIGURATION'; +function inlineMeta(result, ctx) { + return result.pipe(es.through(function (file) { + if (matchesFile(file, ctx)) { + let content = file.contents.toString(); + let markerFound = false; + const packageMarker = `${packageJsonMarkerId}:"${packageJsonMarkerId}"`; // this needs to be the format after esbuild has processed the file (e.g. double quotes) + if (content.includes(packageMarker)) { + content = content.replace(packageMarker, JSON.stringify(JSON.parse(ctx.packageJsonFn())).slice(1, -1) /* trim braces */); + markerFound = true; + } + // const productMarker = `${productJsonMarkerId}:"${productJsonMarkerId}"`; // this needs to be the format after esbuild has processed the file (e.g. double quotes) + // if (content.includes(productMarker)) { + // content = content.replace(productMarker, JSON.stringify(JSON.parse(ctx.productJsonFn())).slice(1, -1) /* trim braces */); + // markerFound = true; + // } + if (markerFound) { + file.contents = Buffer.from(content); + } + } + this.emit('data', file); + })); +} +function matchesFile(file, ctx) { + for (const targetPath of ctx.targetPaths) { + if (file.basename === (0, path_1.basename)(targetPath)) { // TODO would be nicer to figure out root relative path to not match on false positives + return true; + } + } + return false; +} +//# sourceMappingURL=inlineMeta.js.map \ No newline at end of file diff --git a/build/lib/inlineMeta.ts b/build/lib/inlineMeta.ts new file mode 100644 index 00000000000..ef3987fc32e --- /dev/null +++ b/build/lib/inlineMeta.ts @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as es from 'event-stream'; +import { basename } from 'path'; +import * as File from 'vinyl'; + +export interface IInlineMetaContext { + readonly targetPaths: string[]; + readonly packageJsonFn: () => string; + readonly productJsonFn: () => string; +} + +const packageJsonMarkerId = 'BUILD_INSERT_PACKAGE_CONFIGURATION'; + +// TODO@bpasero in order to inline `product.json`, more work is +// needed to ensure that we cover all cases where modifications +// are done to the product configuration during build. There are +// at least 2 more changes that kick in very late: +// - a `darwinUniversalAssetId` is added in`create-universal-app.ts` +// - a `target` is added in `gulpfile.vscode.win32.js` +// const productJsonMarkerId = 'BUILD_INSERT_PRODUCT_CONFIGURATION'; + +export function inlineMeta(result: NodeJS.ReadWriteStream, ctx: IInlineMetaContext): NodeJS.ReadWriteStream { + return result.pipe(es.through(function (file: File) { + if (matchesFile(file, ctx)) { + let content = file.contents.toString(); + let markerFound = false; + + const packageMarker = `${packageJsonMarkerId}:"${packageJsonMarkerId}"`; // this needs to be the format after esbuild has processed the file (e.g. double quotes) + if (content.includes(packageMarker)) { + content = content.replace(packageMarker, JSON.stringify(JSON.parse(ctx.packageJsonFn())).slice(1, -1) /* trim braces */); + markerFound = true; + } + + // const productMarker = `${productJsonMarkerId}:"${productJsonMarkerId}"`; // this needs to be the format after esbuild has processed the file (e.g. double quotes) + // if (content.includes(productMarker)) { + // content = content.replace(productMarker, JSON.stringify(JSON.parse(ctx.productJsonFn())).slice(1, -1) /* trim braces */); + // markerFound = true; + // } + + if (markerFound) { + file.contents = Buffer.from(content); + } + } + + this.emit('data', file); + })); +} + +function matchesFile(file: File, ctx: IInlineMetaContext): boolean { + for (const targetPath of ctx.targetPaths) { + if (file.basename === basename(targetPath)) { // TODO would be nicer to figure out root relative path to not match on false positives + return true; + } + } + return false; +} diff --git a/build/lib/layersChecker.js b/build/lib/layersChecker.js index 7494b71bb66..98241a368b5 100644 --- a/build/lib/layersChecker.js +++ b/build/lib/layersChecker.js @@ -69,7 +69,10 @@ const CORE_TYPES = [ 'RequestInit', 'Headers', 'Response', - '__global' + '__global', + 'PerformanceMark', + 'PerformanceObserver', + 'ImportMeta' ]; // Types that are defined in a common layer but are known to be only // available in native environments should not be allowed in browser @@ -232,6 +235,22 @@ const RULES = [ '@types/node' // no node.js ] }, + // Electron (utility) + { + target: '**/vs/**/electron-utility/**', + allowedTypes: [ + ...CORE_TYPES, + // --> types from electron.d.ts that duplicate from lib.dom.d.ts + 'Event', + 'Request' + ], + disallowedTypes: [ + 'ipcMain' // not allowed, use validatedIpcMain instead + ], + disallowedDefinitions: [ + 'lib.dom.d.ts' // no DOM + ] + }, // Electron (main) { target: '**/vs/**/electron-main/**', diff --git a/build/lib/layersChecker.ts b/build/lib/layersChecker.ts index 4861fa6d86e..26a18a48da7 100644 --- a/build/lib/layersChecker.ts +++ b/build/lib/layersChecker.ts @@ -70,7 +70,10 @@ const CORE_TYPES = [ 'RequestInit', 'Headers', 'Response', - '__global' + '__global', + 'PerformanceMark', + 'PerformanceObserver', + 'ImportMeta' ]; // Types that are defined in a common layer but are known to be only @@ -254,6 +257,24 @@ const RULES: IRule[] = [ ] }, + // Electron (utility) + { + target: '**/vs/**/electron-utility/**', + allowedTypes: [ + ...CORE_TYPES, + + // --> types from electron.d.ts that duplicate from lib.dom.d.ts + 'Event', + 'Request' + ], + disallowedTypes: [ + 'ipcMain' // not allowed, use validatedIpcMain instead + ], + disallowedDefinitions: [ + 'lib.dom.d.ts' // no DOM + ] + }, + // Electron (main) { target: '**/vs/**/electron-main/**', diff --git a/build/lib/mangle/index.js b/build/lib/mangle/index.js index bb6b414e845..f429712f100 100644 --- a/build/lib/mangle/index.js +++ b/build/lib/mangle/index.js @@ -14,7 +14,8 @@ const ts = require("typescript"); const url_1 = require("url"); const workerpool = require("workerpool"); const staticLanguageServiceHost_1 = require("./staticLanguageServiceHost"); -const buildfile = require('../../../src/buildfile'); +const amd_1 = require("../amd"); +const buildfile = require('../../buildfile'); class ShortIdent { prefix; static _keywords = new Set(['await', 'break', 'case', 'catch', 'class', 'const', 'continue', 'debugger', @@ -247,36 +248,51 @@ function isNameTakenInFile(node, name) { } return false; } -const skippedExportMangledFiles = [ - // Build - 'css.build', - 'nls.build', - // Monaco - 'editorCommon', - 'editorOptions', - 'editorZoom', - 'standaloneEditor', - 'standaloneEnums', - 'standaloneLanguages', - // Generated - 'extensionsApiProposals', - // Module passed around as type - 'pfs', - // entry points - ...[ - buildfile.entrypoint('vs/server/node/server.main', []), - buildfile.entrypoint('vs/workbench/workbench.desktop.main', []), - buildfile.base, - buildfile.workerExtensionHost, - buildfile.workerNotebook, - buildfile.workerLanguageDetection, - buildfile.workerLocalFileSearch, - buildfile.workerProfileAnalysis, - buildfile.workbenchDesktop, - buildfile.workbenchWeb, - buildfile.code - ].flat().map(x => x.name), -]; +const skippedExportMangledFiles = function () { + return [ + // Build + 'css.build', + // Monaco + 'editorCommon', + 'editorOptions', + 'editorZoom', + 'standaloneEditor', + 'standaloneEnums', + 'standaloneLanguages', + // Generated + 'extensionsApiProposals', + // Module passed around as type + 'pfs', + // entry points + ...!(0, amd_1.isAMD)() ? [ + buildfile.entrypoint('vs/server/node/server.main'), + buildfile.base, + buildfile.workerExtensionHost, + buildfile.workerNotebook, + buildfile.workerLanguageDetection, + buildfile.workerLocalFileSearch, + buildfile.workerProfileAnalysis, + buildfile.workerOutputLinks, + buildfile.workerBackgroundTokenization, + buildfile.workbenchDesktop(), + buildfile.workbenchWeb(), + buildfile.code, + buildfile.codeWeb + ].flat().map(x => x.name) : [ + buildfile.entrypoint('vs/server/node/server.main'), + buildfile.entrypoint('vs/workbench/workbench.desktop.main'), + buildfile.base, + buildfile.workerExtensionHost, + buildfile.workerNotebook, + buildfile.workerLanguageDetection, + buildfile.workerLocalFileSearch, + buildfile.workerProfileAnalysis, + buildfile.workbenchDesktop(), + buildfile.workbenchWeb(), + buildfile.code + ].flat().map(x => x.name), + ]; +}; const skippedExportMangledProjects = [ // Test projects 'vscode-api-tests', @@ -520,7 +536,7 @@ class Mangler { for (const data of this.allExportedSymbols.values()) { if (data.fileName.endsWith('.d.ts') || skippedExportMangledProjects.some(proj => data.fileName.includes(proj)) - || skippedExportMangledFiles.some(file => data.fileName.endsWith(file + '.ts'))) { + || skippedExportMangledFiles().some(file => data.fileName.endsWith(file + '.ts'))) { continue; } if (!data.shouldMangle(data.replacementName)) { diff --git a/build/lib/mangle/index.ts b/build/lib/mangle/index.ts index 4a7544f162b..ecede4cc108 100644 --- a/build/lib/mangle/index.ts +++ b/build/lib/mangle/index.ts @@ -12,7 +12,8 @@ import * as ts from 'typescript'; import { pathToFileURL } from 'url'; import * as workerpool from 'workerpool'; import { StaticLanguageServiceHost } from './staticLanguageServiceHost'; -const buildfile = require('../../../src/buildfile'); +import { isAMD } from '../amd'; +const buildfile = require('../../buildfile'); class ShortIdent { @@ -279,41 +280,55 @@ function isNameTakenInFile(node: ts.Node, name: string): boolean { return false; } - -const skippedExportMangledFiles = [ - // Build - 'css.build', - 'nls.build', - - // Monaco - 'editorCommon', - 'editorOptions', - 'editorZoom', - 'standaloneEditor', - 'standaloneEnums', - 'standaloneLanguages', - - // Generated - 'extensionsApiProposals', - - // Module passed around as type - 'pfs', - - // entry points - ...[ - buildfile.entrypoint('vs/server/node/server.main', []), - buildfile.entrypoint('vs/workbench/workbench.desktop.main', []), - buildfile.base, - buildfile.workerExtensionHost, - buildfile.workerNotebook, - buildfile.workerLanguageDetection, - buildfile.workerLocalFileSearch, - buildfile.workerProfileAnalysis, - buildfile.workbenchDesktop, - buildfile.workbenchWeb, - buildfile.code - ].flat().map(x => x.name), -]; +const skippedExportMangledFiles = function () { // using a function() to ensure late isAMD() check + return [ + // Build + 'css.build', + + // Monaco + 'editorCommon', + 'editorOptions', + 'editorZoom', + 'standaloneEditor', + 'standaloneEnums', + 'standaloneLanguages', + + // Generated + 'extensionsApiProposals', + + // Module passed around as type + 'pfs', + + // entry points + ...!isAMD() ? [ + buildfile.entrypoint('vs/server/node/server.main'), + buildfile.base, + buildfile.workerExtensionHost, + buildfile.workerNotebook, + buildfile.workerLanguageDetection, + buildfile.workerLocalFileSearch, + buildfile.workerProfileAnalysis, + buildfile.workerOutputLinks, + buildfile.workerBackgroundTokenization, + buildfile.workbenchDesktop(), + buildfile.workbenchWeb(), + buildfile.code, + buildfile.codeWeb + ].flat().map(x => x.name) : [ + buildfile.entrypoint('vs/server/node/server.main'), + buildfile.entrypoint('vs/workbench/workbench.desktop.main'), + buildfile.base, + buildfile.workerExtensionHost, + buildfile.workerNotebook, + buildfile.workerLanguageDetection, + buildfile.workerLocalFileSearch, + buildfile.workerProfileAnalysis, + buildfile.workbenchDesktop(), + buildfile.workbenchWeb(), + buildfile.code + ].flat().map(x => x.name), + ]; +}; const skippedExportMangledProjects = [ // Test projects @@ -610,7 +625,7 @@ export class Mangler { for (const data of this.allExportedSymbols.values()) { if (data.fileName.endsWith('.d.ts') || skippedExportMangledProjects.some(proj => data.fileName.includes(proj)) - || skippedExportMangledFiles.some(file => data.fileName.endsWith(file + '.ts')) + || skippedExportMangledFiles().some(file => data.fileName.endsWith(file + '.ts')) ) { continue; } diff --git a/build/lib/nls.js b/build/lib/nls.js index 48ca84f2433..00b9c9262fa 100644 --- a/build/lib/nls.js +++ b/build/lib/nls.js @@ -10,6 +10,8 @@ const event_stream_1 = require("event-stream"); const File = require("vinyl"); const sm = require("source-map"); const path = require("path"); +const sort = require("gulp-sort"); +const amd_1 = require("./amd"); var CollectStepResult; (function (CollectStepResult) { CollectStepResult[CollectStepResult["Yes"] = 0] = "Yes"; @@ -38,23 +40,15 @@ function clone(object) { } return result; } -function template(lines) { - let indent = '', wrap = ''; - if (lines.length > 1) { - indent = '\t'; - wrap = '\n'; - } - return `/*--------------------------------------------------------- - * Copyright (C) Microsoft Corporation. All rights reserved. - *--------------------------------------------------------*/ -define([], [${wrap + lines.map(l => indent + l).join(',\n') + wrap}]);`; -} /** * Returns a stream containing the patched JavaScript and source maps. */ -function nls() { +function nls(options) { + let base; const input = (0, event_stream_1.through)(); - const output = input.pipe((0, event_stream_1.through)(function (f) { + const output = input + .pipe(sort()) // IMPORTANT: to ensure stable NLS metadata generation, we must sort the files because NLS messages are globally extracted and indexed across all files + .pipe((0, event_stream_1.through)(function (f) { if (!f.sourceMap) { return this.emit('error', new Error(`File ${f.relative} does not have sourcemaps.`)); } @@ -70,7 +64,40 @@ function nls() { if (!typescript) { return this.emit('error', new Error(`File ${f.relative} does not have the original content in the source map.`)); } - _nls.patchFiles(f, typescript).forEach(f => this.emit('data', f)); + base = f.base; + this.emit('data', _nls.patchFile(f, typescript, options)); + }, function () { + for (const file of [ + new File({ + contents: Buffer.from(JSON.stringify({ + keys: _nls.moduleToNLSKeys, + messages: _nls.moduleToNLSMessages, + }, null, '\t')), + base, + path: `${base}/nls.metadata.json` + }), + new File({ + contents: Buffer.from(JSON.stringify(_nls.allNLSMessages)), + base, + path: `${base}/nls.messages.json` + }), + new File({ + contents: Buffer.from(JSON.stringify(_nls.allNLSModulesAndKeys)), + base, + path: `${base}/nls.keys.json` + }), + new File({ + contents: Buffer.from(`/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +globalThis._VSCODE_NLS_MESSAGES=${JSON.stringify(_nls.allNLSMessages)};`), + base, + path: `${base}/nls.messages.js` + }) + ]) { + this.emit('data', file); + } + this.emit('end'); })); return (0, event_stream_1.duplex)(input, output); } @@ -79,6 +106,11 @@ function isImportNode(ts, node) { } var _nls; (function (_nls) { + _nls.moduleToNLSKeys = {}; + _nls.moduleToNLSMessages = {}; + _nls.allNLSMessages = []; + _nls.allNLSModulesAndKeys = []; + let allNLSMessagesIndex = 0; function fileFrom(file, contents, path = file.path) { return new File({ contents: Buffer.from(contents), @@ -138,21 +170,24 @@ var _nls; .filter(n => n.kind === ts.SyntaxKind.ImportEqualsDeclaration) .map(n => n) .filter(d => d.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) - .filter(d => d.moduleReference.expression.getText() === '\'vs/nls\''); + .filter(d => { + if (!(0, amd_1.isAMD)()) { + return d.moduleReference.expression.getText().endsWith(`/nls.js'`); + } + return d.moduleReference.expression.getText().endsWith(`/nls'`); + }); // import ... from 'vs/nls'; const importDeclarations = imports .filter(n => n.kind === ts.SyntaxKind.ImportDeclaration) .map(n => n) .filter(d => d.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral) - .filter(d => d.moduleSpecifier.getText() === '\'vs/nls\'') + .filter(d => { + if (!(0, amd_1.isAMD)()) { + return d.moduleSpecifier.getText().endsWith(`/nls.js'`); + } + return d.moduleSpecifier.getText().endsWith(`/nls'`); + }) .filter(d => !!d.importClause && !!d.importClause.namedBindings); - const nlsExpressions = importEqualsDeclarations - .map(d => d.moduleReference.expression) - .concat(importDeclarations.map(d => d.moduleSpecifier)) - .map(d => ({ - start: ts.getLineAndCharacterOfPosition(sourceFile, d.getStart()), - end: ts.getLineAndCharacterOfPosition(sourceFile, d.getEnd()) - })); // `nls.localize(...)` calls const nlsLocalizeCallExpressions = importDeclarations .filter(d => !!(d.importClause && d.importClause.namedBindings && d.importClause.namedBindings.kind === ts.SyntaxKind.NamespaceImport)) @@ -206,8 +241,7 @@ var _nls; value: a[1].getText() })); return { - localizeCalls: localizeCalls.toArray(), - nlsExpressions: nlsExpressions.toArray() + localizeCalls: localizeCalls.toArray() }; } class TextModel { @@ -262,14 +296,10 @@ var _nls; .flatten().toArray().join(''); } } - function patchJavascript(patches, contents, moduleId) { + function patchJavascript(patches, contents) { const model = new TextModel(contents); // patch the localize calls lazy(patches).reverse().each(p => model.apply(p)); - // patch the 'vs/nls' imports - const firstLine = model.get(0); - const patchedFirstLine = firstLine.replace(/(['"])vs\/nls\1/g, `$1vs/nls!${moduleId}$1`); - model.set(0, patchedFirstLine); return model.toString(); } function patchSourcemap(patches, rsm, smc) { @@ -307,14 +337,21 @@ var _nls; } return JSON.parse(smg.toString()); } - function patch(ts, moduleId, typescript, javascript, sourcemap) { - const { localizeCalls, nlsExpressions } = analyze(ts, typescript, 'localize'); - const { localizeCalls: localize2Calls, nlsExpressions: nls2Expressions } = analyze(ts, typescript, 'localize2'); + function parseLocalizeKeyOrValue(sourceExpression) { + // sourceValue can be "foo", 'foo', `foo` or { .... } + // in its evalulated form + // we want to return either the string or the object + // eslint-disable-next-line no-eval + return eval(`(${sourceExpression})`); + } + function patch(ts, typescript, javascript, sourcemap, options) { + const { localizeCalls } = analyze(ts, typescript, 'localize'); + const { localizeCalls: localize2Calls } = analyze(ts, typescript, 'localize2'); if (localizeCalls.length === 0 && localize2Calls.length === 0) { return { javascript, sourcemap }; } - const nlsKeys = template(localizeCalls.map(lc => lc.key).concat(localize2Calls.map(lc => lc.key))); - const nls = template(localizeCalls.map(lc => lc.value).concat(localize2Calls.map(lc => lc.value))); + const nlsKeys = localizeCalls.map(lc => parseLocalizeKeyOrValue(lc.key)).concat(localize2Calls.map(lc => parseLocalizeKeyOrValue(lc.key))); + const nlsMessages = localizeCalls.map(lc => parseLocalizeKeyOrValue(lc.value)).concat(localize2Calls.map(lc => parseLocalizeKeyOrValue(lc.value))); const smc = new sm.SourceMapConsumer(sourcemap); const positionFrom = mappedPositionFrom.bind(null, sourcemap.sources[0]); // build patches @@ -323,16 +360,18 @@ var _nls; const end = lcFrom(smc.generatedPositionFor(positionFrom(c.range.end))); return { span: { start, end }, content: c.content }; }; - let i = 0; const localizePatches = lazy(localizeCalls) - .map(lc => ([ - { range: lc.keySpan, content: '' + (i++) }, + .map(lc => (options.preserveEnglish ? [ + { range: lc.keySpan, content: `${allNLSMessagesIndex++}` } // localize('key', "message") => localize(, "message") + ] : [ + { range: lc.keySpan, content: `${allNLSMessagesIndex++}` }, // localize('key', "message") => localize(, null) { range: lc.valueSpan, content: 'null' } ])) .flatten() .map(toPatch); const localize2Patches = lazy(localize2Calls) - .map(lc => ({ range: lc.keySpan, content: '' + (i++) })) + .map(lc => ({ range: lc.keySpan, content: `${allNLSMessagesIndex++}` } // localize2('key', "message") => localize(, "message") + )) .map(toPatch); // Sort patches by their start position const patches = localizePatches.concat(localize2Patches).toArray().sort((a, b) => { @@ -352,34 +391,29 @@ var _nls; return 0; } }); - javascript = patchJavascript(patches, javascript, moduleId); - // since imports are not within the sourcemap information, - // we must do this MacGyver style - if (nlsExpressions.length || nls2Expressions.length) { - javascript = javascript.replace(/^define\(.*$/m, line => { - return line.replace(/(['"])vs\/nls\1/g, `$1vs/nls!${moduleId}$1`); - }); - } + javascript = patchJavascript(patches, javascript); sourcemap = patchSourcemap(patches, sourcemap, smc); - return { javascript, sourcemap, nlsKeys, nls }; + return { javascript, sourcemap, nlsKeys, nlsMessages }; } - function patchFiles(javascriptFile, typescript) { + function patchFile(javascriptFile, typescript, options) { const ts = require('typescript'); // hack? const moduleId = javascriptFile.relative .replace(/\.js$/, '') .replace(/\\/g, '/'); - const { javascript, sourcemap, nlsKeys, nls } = patch(ts, moduleId, typescript, javascriptFile.contents.toString(), javascriptFile.sourceMap); - const result = [fileFrom(javascriptFile, javascript)]; - result[0].sourceMap = sourcemap; + const { javascript, sourcemap, nlsKeys, nlsMessages } = patch(ts, typescript, javascriptFile.contents.toString(), javascriptFile.sourceMap, options); + const result = fileFrom(javascriptFile, javascript); + result.sourceMap = sourcemap; if (nlsKeys) { - result.push(fileFrom(javascriptFile, nlsKeys, javascriptFile.path.replace(/\.js$/, '.nls.keys.js'))); + _nls.moduleToNLSKeys[moduleId] = nlsKeys; + _nls.allNLSModulesAndKeys.push([moduleId, nlsKeys.map(nlsKey => typeof nlsKey === 'string' ? nlsKey : nlsKey.key)]); } - if (nls) { - result.push(fileFrom(javascriptFile, nls, javascriptFile.path.replace(/\.js$/, '.nls.js'))); + if (nlsMessages) { + _nls.moduleToNLSMessages[moduleId] = nlsMessages; + _nls.allNLSMessages.push(...nlsMessages); } return result; } - _nls.patchFiles = patchFiles; + _nls.patchFile = patchFile; })(_nls || (_nls = {})); //# sourceMappingURL=nls.js.map \ No newline at end of file diff --git a/build/lib/nls.ts b/build/lib/nls.ts index c4ee031b2eb..a861122b1bb 100644 --- a/build/lib/nls.ts +++ b/build/lib/nls.ts @@ -8,7 +8,9 @@ import * as lazy from 'lazy.js'; import { duplex, through } from 'event-stream'; import * as File from 'vinyl'; import * as sm from 'source-map'; -import * as path from 'path'; +import * as path from 'path'; +import * as sort from 'gulp-sort'; +import { isAMD } from './amd'; declare class FileSourceMap extends File { public sourceMap: sm.RawSourceMap; @@ -48,47 +50,70 @@ function clone(object: T): T { return result; } -function template(lines: string[]): string { - let indent = '', wrap = ''; - - if (lines.length > 1) { - indent = '\t'; - wrap = '\n'; - } - - return `/*--------------------------------------------------------- - * Copyright (C) Microsoft Corporation. All rights reserved. - *--------------------------------------------------------*/ -define([], [${wrap + lines.map(l => indent + l).join(',\n') + wrap}]);`; -} - /** * Returns a stream containing the patched JavaScript and source maps. */ -export function nls(): NodeJS.ReadWriteStream { +export function nls(options: { preserveEnglish: boolean }): NodeJS.ReadWriteStream { + let base: string; const input = through(); - const output = input.pipe(through(function (f: FileSourceMap) { - if (!f.sourceMap) { - return this.emit('error', new Error(`File ${f.relative} does not have sourcemaps.`)); - } + const output = input + .pipe(sort()) // IMPORTANT: to ensure stable NLS metadata generation, we must sort the files because NLS messages are globally extracted and indexed across all files + .pipe(through(function (f: FileSourceMap) { + if (!f.sourceMap) { + return this.emit('error', new Error(`File ${f.relative} does not have sourcemaps.`)); + } - let source = f.sourceMap.sources[0]; - if (!source) { - return this.emit('error', new Error(`File ${f.relative} does not have a source in the source map.`)); - } + let source = f.sourceMap.sources[0]; + if (!source) { + return this.emit('error', new Error(`File ${f.relative} does not have a source in the source map.`)); + } - const root = f.sourceMap.sourceRoot; - if (root) { - source = path.join(root, source); - } + const root = f.sourceMap.sourceRoot; + if (root) { + source = path.join(root, source); + } - const typescript = f.sourceMap.sourcesContent![0]; - if (!typescript) { - return this.emit('error', new Error(`File ${f.relative} does not have the original content in the source map.`)); - } + const typescript = f.sourceMap.sourcesContent![0]; + if (!typescript) { + return this.emit('error', new Error(`File ${f.relative} does not have the original content in the source map.`)); + } - _nls.patchFiles(f, typescript).forEach(f => this.emit('data', f)); - })); + base = f.base; + this.emit('data', _nls.patchFile(f, typescript, options)); + }, function () { + for (const file of [ + new File({ + contents: Buffer.from(JSON.stringify({ + keys: _nls.moduleToNLSKeys, + messages: _nls.moduleToNLSMessages, + }, null, '\t')), + base, + path: `${base}/nls.metadata.json` + }), + new File({ + contents: Buffer.from(JSON.stringify(_nls.allNLSMessages)), + base, + path: `${base}/nls.messages.json` + }), + new File({ + contents: Buffer.from(JSON.stringify(_nls.allNLSModulesAndKeys)), + base, + path: `${base}/nls.keys.json` + }), + new File({ + contents: Buffer.from(`/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +globalThis._VSCODE_NLS_MESSAGES=${JSON.stringify(_nls.allNLSMessages)};`), + base, + path: `${base}/nls.messages.js` + }) + ]) { + this.emit('data', file); + } + + this.emit('end'); + })); return duplex(input, output); } @@ -99,11 +124,19 @@ function isImportNode(ts: typeof import('typescript'), node: ts.Node): boolean { module _nls { - interface INlsStringResult { + export const moduleToNLSKeys: { [name: string /* module ID */]: ILocalizeKey[] /* keys */ } = {}; + export const moduleToNLSMessages: { [name: string /* module ID */]: string[] /* messages */ } = {}; + export const allNLSMessages: string[] = []; + export const allNLSModulesAndKeys: Array<[string /* module ID */, string[] /* keys */]> = []; + let allNLSMessagesIndex = 0; + + type ILocalizeKey = string | { key: string }; // key might contain metadata for translators and then is not just a string + + interface INlsPatchResult { javascript: string; sourcemap: sm.RawSourceMap; - nls?: string; - nlsKeys?: string; + nlsMessages?: string[]; + nlsKeys?: ILocalizeKey[]; } interface ISpan { @@ -120,7 +153,6 @@ module _nls { interface ILocalizeAnalysisResult { localizeCalls: ILocalizeCall[]; - nlsExpressions: ISpan[]; } interface IPatch { @@ -200,24 +232,26 @@ module _nls { .filter(n => n.kind === ts.SyntaxKind.ImportEqualsDeclaration) .map(n => n) .filter(d => d.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) - .filter(d => (d.moduleReference).expression.getText() === '\'vs/nls\''); + .filter(d => { + if (!isAMD()) { + return (d.moduleReference).expression.getText().endsWith(`/nls.js'`); + } + return (d.moduleReference).expression.getText().endsWith(`/nls'`); + }); // import ... from 'vs/nls'; const importDeclarations = imports .filter(n => n.kind === ts.SyntaxKind.ImportDeclaration) .map(n => n) .filter(d => d.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral) - .filter(d => d.moduleSpecifier.getText() === '\'vs/nls\'') + .filter(d => { + if (!isAMD()) { + return d.moduleSpecifier.getText().endsWith(`/nls.js'`); + } + return d.moduleSpecifier.getText().endsWith(`/nls'`); + }) .filter(d => !!d.importClause && !!d.importClause.namedBindings); - const nlsExpressions = importEqualsDeclarations - .map(d => (d.moduleReference).expression) - .concat(importDeclarations.map(d => d.moduleSpecifier)) - .map(d => ({ - start: ts.getLineAndCharacterOfPosition(sourceFile, d.getStart()), - end: ts.getLineAndCharacterOfPosition(sourceFile, d.getEnd()) - })); - // `nls.localize(...)` calls const nlsLocalizeCallExpressions = importDeclarations .filter(d => !!(d.importClause && d.importClause.namedBindings && d.importClause.namedBindings.kind === ts.SyntaxKind.NamespaceImport)) @@ -280,8 +314,7 @@ module _nls { })); return { - localizeCalls: localizeCalls.toArray(), - nlsExpressions: nlsExpressions.toArray() + localizeCalls: localizeCalls.toArray() }; } @@ -351,17 +384,12 @@ module _nls { } } - function patchJavascript(patches: IPatch[], contents: string, moduleId: string): string { + function patchJavascript(patches: IPatch[], contents: string): string { const model = new TextModel(contents); // patch the localize calls lazy(patches).reverse().each(p => model.apply(p)); - // patch the 'vs/nls' imports - const firstLine = model.get(0); - const patchedFirstLine = firstLine.replace(/(['"])vs\/nls\1/g, `$1vs/nls!${moduleId}$1`); - model.set(0, patchedFirstLine); - return model.toString(); } @@ -410,16 +438,24 @@ module _nls { return JSON.parse(smg.toString()); } - function patch(ts: typeof import('typescript'), moduleId: string, typescript: string, javascript: string, sourcemap: sm.RawSourceMap): INlsStringResult { - const { localizeCalls, nlsExpressions } = analyze(ts, typescript, 'localize'); - const { localizeCalls: localize2Calls, nlsExpressions: nls2Expressions } = analyze(ts, typescript, 'localize2'); + function parseLocalizeKeyOrValue(sourceExpression: string) { + // sourceValue can be "foo", 'foo', `foo` or { .... } + // in its evalulated form + // we want to return either the string or the object + // eslint-disable-next-line no-eval + return eval(`(${sourceExpression})`); + } + + function patch(ts: typeof import('typescript'), typescript: string, javascript: string, sourcemap: sm.RawSourceMap, options: { preserveEnglish: boolean }): INlsPatchResult { + const { localizeCalls } = analyze(ts, typescript, 'localize'); + const { localizeCalls: localize2Calls } = analyze(ts, typescript, 'localize2'); if (localizeCalls.length === 0 && localize2Calls.length === 0) { return { javascript, sourcemap }; } - const nlsKeys = template(localizeCalls.map(lc => lc.key).concat(localize2Calls.map(lc => lc.key))); - const nls = template(localizeCalls.map(lc => lc.value).concat(localize2Calls.map(lc => lc.value))); + const nlsKeys = localizeCalls.map(lc => parseLocalizeKeyOrValue(lc.key)).concat(localize2Calls.map(lc => parseLocalizeKeyOrValue(lc.key))); + const nlsMessages = localizeCalls.map(lc => parseLocalizeKeyOrValue(lc.value)).concat(localize2Calls.map(lc => parseLocalizeKeyOrValue(lc.value))); const smc = new sm.SourceMapConsumer(sourcemap); const positionFrom = mappedPositionFrom.bind(null, sourcemap.sources[0]); @@ -430,18 +466,20 @@ module _nls { return { span: { start, end }, content: c.content }; }; - let i = 0; const localizePatches = lazy(localizeCalls) - .map(lc => ([ - { range: lc.keySpan, content: '' + (i++) }, - { range: lc.valueSpan, content: 'null' } - ])) + .map(lc => ( + options.preserveEnglish ? [ + { range: lc.keySpan, content: `${allNLSMessagesIndex++}` } // localize('key', "message") => localize(, "message") + ] : [ + { range: lc.keySpan, content: `${allNLSMessagesIndex++}` }, // localize('key', "message") => localize(, null) + { range: lc.valueSpan, content: 'null' } + ])) .flatten() .map(toPatch); const localize2Patches = lazy(localize2Calls) .map(lc => ( - { range: lc.keySpan, content: '' + (i++) } + { range: lc.keySpan, content: `${allNLSMessagesIndex++}` } // localize2('key', "message") => localize(, "message") )) .map(toPatch); @@ -460,45 +498,39 @@ module _nls { } }); - javascript = patchJavascript(patches, javascript, moduleId); - - // since imports are not within the sourcemap information, - // we must do this MacGyver style - if (nlsExpressions.length || nls2Expressions.length) { - javascript = javascript.replace(/^define\(.*$/m, line => { - return line.replace(/(['"])vs\/nls\1/g, `$1vs/nls!${moduleId}$1`); - }); - } + javascript = patchJavascript(patches, javascript); sourcemap = patchSourcemap(patches, sourcemap, smc); - return { javascript, sourcemap, nlsKeys, nls }; + return { javascript, sourcemap, nlsKeys, nlsMessages }; } - export function patchFiles(javascriptFile: File, typescript: string): File[] { + export function patchFile(javascriptFile: File, typescript: string, options: { preserveEnglish: boolean }): File { const ts = require('typescript') as typeof import('typescript'); // hack? const moduleId = javascriptFile.relative .replace(/\.js$/, '') .replace(/\\/g, '/'); - const { javascript, sourcemap, nlsKeys, nls } = patch( + const { javascript, sourcemap, nlsKeys, nlsMessages } = patch( ts, - moduleId, typescript, javascriptFile.contents.toString(), - (javascriptFile).sourceMap + (javascriptFile).sourceMap, + options ); - const result: File[] = [fileFrom(javascriptFile, javascript)]; - (result[0]).sourceMap = sourcemap; + const result = fileFrom(javascriptFile, javascript); + (result).sourceMap = sourcemap; if (nlsKeys) { - result.push(fileFrom(javascriptFile, nlsKeys, javascriptFile.path.replace(/\.js$/, '.nls.keys.js'))); + moduleToNLSKeys[moduleId] = nlsKeys; + allNLSModulesAndKeys.push([moduleId, nlsKeys.map(nlsKey => typeof nlsKey === 'string' ? nlsKey : nlsKey.key)]); } - if (nls) { - result.push(fileFrom(javascriptFile, nls, javascriptFile.path.replace(/\.js$/, '.nls.js'))); + if (nlsMessages) { + moduleToNLSMessages[moduleId] = nlsMessages; + allNLSMessages.push(...nlsMessages); } return result; diff --git a/build/lib/node.js b/build/lib/node.js index 7209dffc134..74a54a3c170 100644 --- a/build/lib/node.js +++ b/build/lib/node.js @@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); const path = require("path"); const fs = require("fs"); const root = path.dirname(path.dirname(__dirname)); -const yarnrcPath = path.join(root, 'remote', '.yarnrc'); -const yarnrc = fs.readFileSync(yarnrcPath, 'utf8'); -const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1]; +const npmrcPath = path.join(root, 'remote', '.npmrc'); +const npmrc = fs.readFileSync(npmrcPath, 'utf8'); +const version = /^target="(.*)"$/m.exec(npmrc)[1]; const platform = process.platform; const arch = process.arch; const node = platform === 'win32' ? 'node.exe' : 'node'; diff --git a/build/lib/node.ts b/build/lib/node.ts index d1b0039b022..4beb13ae91b 100644 --- a/build/lib/node.ts +++ b/build/lib/node.ts @@ -7,9 +7,9 @@ import * as path from 'path'; import * as fs from 'fs'; const root = path.dirname(path.dirname(__dirname)); -const yarnrcPath = path.join(root, 'remote', '.yarnrc'); -const yarnrc = fs.readFileSync(yarnrcPath, 'utf8'); -const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)![1]; +const npmrcPath = path.join(root, 'remote', '.npmrc'); +const npmrc = fs.readFileSync(npmrcPath, 'utf8'); +const version = /^target="(.*)"$/m.exec(npmrc)![1]; const platform = process.platform; const arch = process.arch; diff --git a/build/lib/optimize.js b/build/lib/optimize.js index d48235ebf15..1d6d48afd64 100644 --- a/build/lib/optimize.js +++ b/build/lib/optimize.js @@ -15,6 +15,7 @@ const filter = require("gulp-filter"); const fancyLog = require("fancy-log"); const ansiColors = require("ansi-colors"); const path = require("path"); +const fs = require("fs"); const pump = require("pump"); const VinylFile = require("vinyl"); const bundle = require("./bundle"); @@ -22,6 +23,9 @@ const i18n_1 = require("./i18n"); const stats_1 = require("./stats"); const util = require("./util"); const postcss_1 = require("./postcss"); +const esbuild = require("esbuild"); +const sourcemaps = require("gulp-sourcemaps"); +const amd_1 = require("./amd"); const REPO_ROOT_PATH = path.join(__dirname, '../..'); function log(prefix, message) { fancyLog(ansiColors.cyan('[' + prefix + ']'), message); @@ -53,7 +57,7 @@ function loaderPlugin(src, base, amdModuleId) { function loader(src, bundledFileHeader, bundleLoader, externalLoaderInfo) { let loaderStream = gulp.src(`${src}/vs/loader.js`, { base: `${src}` }); if (bundleLoader) { - loaderStream = es.merge(loaderStream, loaderPlugin(`${src}/vs/css.js`, `${src}`, 'vs/css'), loaderPlugin(`${src}/vs/nls.js`, `${src}`, 'vs/nls')); + loaderStream = es.merge(loaderStream, loaderPlugin(`${src}/vs/css.js`, `${src}`, 'vs/css')); } const files = []; const order = (f) => { @@ -63,10 +67,7 @@ function loader(src, bundledFileHeader, bundleLoader, externalLoaderInfo) { if (f.path.endsWith('css.js')) { return 1; } - if (f.path.endsWith('nls.js')) { - return 2; - } - return 3; + return 2; }; return (loaderStream .pipe(es.through(function (data) { @@ -151,12 +152,11 @@ const DEFAULT_FILE_HEADER = [ ].join('\n'); function optimizeAMDTask(opts) { const src = opts.src; - const entryPoints = opts.entryPoints; + const entryPoints = opts.entryPoints.filter(d => d.target !== 'esm'); const resources = opts.resources; const loaderConfig = opts.loaderConfig; const bundledFileHeader = opts.header || DEFAULT_FILE_HEADER; const fileContentMapper = opts.fileContentMapper || ((contents, _path) => contents); - const sourcemaps = require('gulp-sourcemaps'); const bundlesStream = es.through(); // this stream will contain the bundled files const resourcesStream = es.through(); // this stream will contain the resources const bundleInfoStream = es.through(); // this stream will contain bundleInfo.json @@ -192,12 +192,132 @@ function optimizeAMDTask(opts) { includeContent: true })) .pipe(opts.languages && opts.languages.length ? (0, i18n_1.processNlsFiles)({ + out: opts.src, fileHeader: bundledFileHeader, languages: opts.languages }) : es.through()); } +function optimizeESMTask(opts, cjsOpts) { + const resourcesStream = es.through(); // this stream will contain the resources + const bundlesStream = es.through(); // this stream will contain the bundled files + const entryPoints = opts.entryPoints.filter(d => d.target !== 'amd'); + if (cjsOpts) { + cjsOpts.entryPoints.forEach(entryPoint => entryPoints.push({ name: path.parse(entryPoint).name })); + } + const allMentionedModules = new Set(); + for (const entryPoint of entryPoints) { + allMentionedModules.add(entryPoint.name); + entryPoint.include?.forEach(allMentionedModules.add, allMentionedModules); + entryPoint.exclude?.forEach(allMentionedModules.add, allMentionedModules); + } + allMentionedModules.delete('vs/css'); // TODO@esm remove this when vs/css is removed + const bundleAsync = async () => { + const files = []; + const tasks = []; + for (const entryPoint of entryPoints) { + console.log(`[bundle] '${entryPoint.name}'`); + // support for 'dest' via esbuild#in/out + const dest = entryPoint.dest?.replace(/\.[^/.]+$/, '') ?? entryPoint.name; + // boilerplate massage + const banner = { js: '' }; + const tslibPath = path.join(require.resolve('tslib'), '../tslib.es6.js'); + banner.js += await fs.promises.readFile(tslibPath, 'utf-8'); + const boilerplateTrimmer = { + name: 'boilerplate-trimmer', + setup(build) { + build.onLoad({ filter: /\.js$/ }, async (args) => { + const contents = await fs.promises.readFile(args.path, 'utf-8'); + const newContents = bundle.removeAllTSBoilerplate(contents); + return { contents: newContents }; + }); + } + }; + // support for 'preprend' via the esbuild#banner + if (entryPoint.prepend?.length) { + for (const item of entryPoint.prepend) { + const fullpath = path.join(REPO_ROOT_PATH, opts.src, item.path); + const source = await fs.promises.readFile(fullpath, 'utf8'); + banner.js += source + '\n'; + } + } + const task = esbuild.build({ + bundle: true, + external: entryPoint.exclude, + packages: 'external', // "external all the things", see https://esbuild.github.io/api/#packages + platform: 'neutral', // makes esm + format: 'esm', + sourcemap: 'external', + plugins: [boilerplateTrimmer], + target: ['es2022'], + loader: { + '.ttf': 'file', + '.svg': 'file', + '.png': 'file', + '.sh': 'file', + }, + assetNames: 'media/[name]', // moves media assets into a sub-folder "media" + banner: entryPoint.name === 'vs/workbench/workbench.web.main' ? undefined : banner, // TODO@esm remove line when we stop supporting web-amd-esm-bridge + entryPoints: [ + { + in: path.join(REPO_ROOT_PATH, opts.src, `${entryPoint.name}.js`), + out: dest, + } + ], + outdir: path.join(REPO_ROOT_PATH, opts.src), + write: false, // enables res.outputFiles + metafile: true, // enables res.metafile + }).then(res => { + for (const file of res.outputFiles) { + let contents = file.contents; + let sourceMapFile = undefined; + if (file.path.endsWith('.js')) { + if (opts.fileContentMapper) { + // UGLY the fileContentMapper is per file but at this point we have all files + // bundled already. So, we call the mapper for the same contents but each file + // that has been included in the bundle... + let newText = file.text; + for (const input of Object.keys(res.metafile.inputs)) { + newText = opts.fileContentMapper(newText, input); + } + contents = Buffer.from(newText); + } + sourceMapFile = res.outputFiles.find(f => f.path === `${file.path}.map`); + } + const fileProps = { + contents: Buffer.from(contents), + sourceMap: sourceMapFile ? JSON.parse(sourceMapFile.text) : undefined, // support gulp-sourcemaps + path: file.path, + base: path.join(REPO_ROOT_PATH, opts.src) + }; + files.push(new VinylFile(fileProps)); + } + }); + // await task; // FORCE serial bundling (makes debugging easier) + tasks.push(task); + } + await Promise.all(tasks); + return { files }; + }; + bundleAsync().then((output) => { + // bundle output (JS, CSS, SVG...) + es.readArray(output.files).pipe(bundlesStream); + // forward all resources + gulp.src(opts.resources, { base: `${opts.src}`, allowEmpty: true }).pipe(resourcesStream); + }); + const result = es.merge(bundlesStream, resourcesStream); + return result + .pipe(sourcemaps.write('./', { + sourceRoot: undefined, + addComment: true, + includeContent: true + })) + .pipe(opts.languages && opts.languages.length ? (0, i18n_1.processNlsFiles)({ + out: opts.src, + fileHeader: opts.header || DEFAULT_FILE_HEADER, + languages: opts.languages + }) : es.through()); +} function optimizeCommonJSTask(opts) { - const esbuild = require('esbuild'); const src = opts.src; const entryPoints = opts.entryPoints; return gulp.src(entryPoints, { base: `${src}`, allowEmpty: true }) @@ -228,9 +348,15 @@ function optimizeLoaderTask(src, out, bundleLoader, bundledFileHeader = '', exte } function optimizeTask(opts) { return function () { - const optimizers = [optimizeAMDTask(opts.amd)]; - if (opts.commonJS) { - optimizers.push(optimizeCommonJSTask(opts.commonJS)); + const optimizers = []; + if (!(0, amd_1.isAMD)()) { + optimizers.push(optimizeESMTask(opts.amd, opts.commonJS)); + } + else { + optimizers.push(optimizeAMDTask(opts.amd)); + if (opts.commonJS) { + optimizers.push(optimizeCommonJSTask(opts.commonJS)); + } } if (opts.manual) { optimizers.push(optimizeManualTask(opts.manual)); @@ -239,11 +365,9 @@ function optimizeTask(opts) { }; } function minifyTask(src, sourceMapBaseUrl) { - const esbuild = require('esbuild'); const sourceMappingURL = sourceMapBaseUrl ? ((f) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined; return cb => { const cssnano = require('cssnano'); - const sourcemaps = require('gulp-sourcemaps'); const svgmin = require('gulp-svgmin'); const jsFilter = filter('**/*.js', { restore: true }); const cssFilter = filter('**/*.css', { restore: true }); @@ -255,7 +379,7 @@ function minifyTask(src, sourceMapBaseUrl) { sourcemap: 'external', outdir: '.', platform: 'node', - target: ['esnext'], + target: ['es2022'], write: false }).then(res => { const jsFile = res.outputFiles.find(f => /\.js$/.test(f.path)); @@ -271,12 +395,7 @@ function minifyTask(src, sourceMapBaseUrl) { cb(undefined, f); } }, cb); - }), jsFilter.restore, cssFilter, (0, postcss_1.gulpPostcss)([cssnano({ preset: 'default' })]), cssFilter.restore, svgFilter, svgmin(), svgFilter.restore, sourcemaps.mapSources((sourcePath) => { - if (sourcePath === 'bootstrap-fork.js') { - return 'bootstrap-fork.orig.js'; - } - return sourcePath; - }), sourcemaps.write('./', { + }), jsFilter.restore, cssFilter, (0, postcss_1.gulpPostcss)([cssnano({ preset: 'default' })]), cssFilter.restore, svgFilter, svgmin(), svgFilter.restore, sourcemaps.write('./', { sourceMappingURL, sourceRoot: undefined, includeContent: true, diff --git a/build/lib/optimize.ts b/build/lib/optimize.ts index 5b6dee9bf65..a5b4efe2823 100644 --- a/build/lib/optimize.ts +++ b/build/lib/optimize.ts @@ -10,6 +10,7 @@ import * as filter from 'gulp-filter'; import * as fancyLog from 'fancy-log'; import * as ansiColors from 'ansi-colors'; import * as path from 'path'; +import * as fs from 'fs'; import * as pump from 'pump'; import * as VinylFile from 'vinyl'; import * as bundle from './bundle'; @@ -17,6 +18,9 @@ import { Language, processNlsFiles } from './i18n'; import { createStatsStream } from './stats'; import * as util from './util'; import { gulpPostcss } from './postcss'; +import * as esbuild from 'esbuild'; +import * as sourcemaps from 'gulp-sourcemaps'; +import { isAMD } from './amd'; const REPO_ROOT_PATH = path.join(__dirname, '../..'); @@ -60,8 +64,7 @@ function loader(src: string, bundledFileHeader: string, bundleLoader: boolean, e if (bundleLoader) { loaderStream = es.merge( loaderStream, - loaderPlugin(`${src}/vs/css.js`, `${src}`, 'vs/css'), - loaderPlugin(`${src}/vs/nls.js`, `${src}`, 'vs/nls'), + loaderPlugin(`${src}/vs/css.js`, `${src}`, 'vs/css') ); } @@ -73,10 +76,7 @@ function loader(src: string, bundledFileHeader: string, bundleLoader: boolean, e if (f.path.endsWith('css.js')) { return 1; } - if (f.path.endsWith('nls.js')) { - return 2; - } - return 3; + return 2; }; return ( @@ -217,14 +217,12 @@ const DEFAULT_FILE_HEADER = [ function optimizeAMDTask(opts: IOptimizeAMDTaskOpts): NodeJS.ReadWriteStream { const src = opts.src; - const entryPoints = opts.entryPoints; + const entryPoints = opts.entryPoints.filter(d => d.target !== 'esm'); const resources = opts.resources; const loaderConfig = opts.loaderConfig; const bundledFileHeader = opts.header || DEFAULT_FILE_HEADER; const fileContentMapper = opts.fileContentMapper || ((contents: string, _path: string) => contents); - const sourcemaps = require('gulp-sourcemaps') as typeof import('gulp-sourcemaps'); - const bundlesStream = es.through(); // this stream will contain the bundled files const resourcesStream = es.through(); // this stream will contain the resources const bundleInfoStream = es.through(); // this stream will contain bundleInfo.json @@ -269,11 +267,161 @@ function optimizeAMDTask(opts: IOptimizeAMDTaskOpts): NodeJS.ReadWriteStream { includeContent: true })) .pipe(opts.languages && opts.languages.length ? processNlsFiles({ + out: opts.src, fileHeader: bundledFileHeader, languages: opts.languages }) : es.through()); } +function optimizeESMTask(opts: IOptimizeAMDTaskOpts, cjsOpts?: IOptimizeCommonJSTaskOpts): NodeJS.ReadWriteStream { + const resourcesStream = es.through(); // this stream will contain the resources + const bundlesStream = es.through(); // this stream will contain the bundled files + + const entryPoints = opts.entryPoints.filter(d => d.target !== 'amd'); + if (cjsOpts) { + cjsOpts.entryPoints.forEach(entryPoint => entryPoints.push({ name: path.parse(entryPoint).name })); + } + + const allMentionedModules = new Set(); + for (const entryPoint of entryPoints) { + allMentionedModules.add(entryPoint.name); + entryPoint.include?.forEach(allMentionedModules.add, allMentionedModules); + entryPoint.exclude?.forEach(allMentionedModules.add, allMentionedModules); + } + + allMentionedModules.delete('vs/css'); // TODO@esm remove this when vs/css is removed + + const bundleAsync = async () => { + + const files: VinylFile[] = []; + const tasks: Promise[] = []; + + for (const entryPoint of entryPoints) { + + console.log(`[bundle] '${entryPoint.name}'`); + + // support for 'dest' via esbuild#in/out + const dest = entryPoint.dest?.replace(/\.[^/.]+$/, '') ?? entryPoint.name; + + // boilerplate massage + const banner = { js: '' }; + const tslibPath = path.join(require.resolve('tslib'), '../tslib.es6.js'); + banner.js += await fs.promises.readFile(tslibPath, 'utf-8'); + + const boilerplateTrimmer: esbuild.Plugin = { + name: 'boilerplate-trimmer', + setup(build) { + build.onLoad({ filter: /\.js$/ }, async args => { + const contents = await fs.promises.readFile(args.path, 'utf-8'); + const newContents = bundle.removeAllTSBoilerplate(contents); + return { contents: newContents }; + }); + } + }; + + // support for 'preprend' via the esbuild#banner + if (entryPoint.prepend?.length) { + for (const item of entryPoint.prepend) { + const fullpath = path.join(REPO_ROOT_PATH, opts.src, item.path); + const source = await fs.promises.readFile(fullpath, 'utf8'); + banner.js += source + '\n'; + } + } + + const task = esbuild.build({ + bundle: true, + external: entryPoint.exclude, + packages: 'external', // "external all the things", see https://esbuild.github.io/api/#packages + platform: 'neutral', // makes esm + format: 'esm', + sourcemap: 'external', + plugins: [boilerplateTrimmer], + target: ['es2022'], + loader: { + '.ttf': 'file', + '.svg': 'file', + '.png': 'file', + '.sh': 'file', + }, + assetNames: 'media/[name]', // moves media assets into a sub-folder "media" + banner: entryPoint.name === 'vs/workbench/workbench.web.main' ? undefined : banner, // TODO@esm remove line when we stop supporting web-amd-esm-bridge + entryPoints: [ + { + in: path.join(REPO_ROOT_PATH, opts.src, `${entryPoint.name}.js`), + out: dest, + } + ], + outdir: path.join(REPO_ROOT_PATH, opts.src), + write: false, // enables res.outputFiles + metafile: true, // enables res.metafile + + }).then(res => { + for (const file of res.outputFiles) { + + let contents = file.contents; + let sourceMapFile: esbuild.OutputFile | undefined = undefined; + + if (file.path.endsWith('.js')) { + + if (opts.fileContentMapper) { + // UGLY the fileContentMapper is per file but at this point we have all files + // bundled already. So, we call the mapper for the same contents but each file + // that has been included in the bundle... + let newText = file.text; + for (const input of Object.keys(res.metafile.inputs)) { + newText = opts.fileContentMapper(newText, input); + } + contents = Buffer.from(newText); + } + + sourceMapFile = res.outputFiles.find(f => f.path === `${file.path}.map`); + } + + const fileProps = { + contents: Buffer.from(contents), + sourceMap: sourceMapFile ? JSON.parse(sourceMapFile.text) : undefined, // support gulp-sourcemaps + path: file.path, + base: path.join(REPO_ROOT_PATH, opts.src) + }; + files.push(new VinylFile(fileProps)); + } + }); + + // await task; // FORCE serial bundling (makes debugging easier) + tasks.push(task); + } + + await Promise.all(tasks); + return { files }; + }; + + bundleAsync().then((output) => { + + // bundle output (JS, CSS, SVG...) + es.readArray(output.files).pipe(bundlesStream); + + // forward all resources + gulp.src(opts.resources, { base: `${opts.src}`, allowEmpty: true }).pipe(resourcesStream); + }); + + const result = es.merge( + bundlesStream, + resourcesStream + ); + + return result + .pipe(sourcemaps.write('./', { + sourceRoot: undefined, + addComment: true, + includeContent: true + })) + .pipe(opts.languages && opts.languages.length ? processNlsFiles({ + out: opts.src, + fileHeader: opts.header || DEFAULT_FILE_HEADER, + languages: opts.languages + }) : es.through()); +} + export interface IOptimizeCommonJSTaskOpts { /** * The paths to consider for optimizing. @@ -294,8 +442,6 @@ export interface IOptimizeCommonJSTaskOpts { } function optimizeCommonJSTask(opts: IOptimizeCommonJSTaskOpts): NodeJS.ReadWriteStream { - const esbuild = require('esbuild') as typeof import('esbuild'); - const src = opts.src; const entryPoints = opts.entryPoints; @@ -363,9 +509,15 @@ export interface IOptimizeTaskOpts { export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream { return function () { - const optimizers = [optimizeAMDTask(opts.amd)]; - if (opts.commonJS) { - optimizers.push(optimizeCommonJSTask(opts.commonJS)); + const optimizers: NodeJS.ReadWriteStream[] = []; + if (!isAMD()) { + optimizers.push(optimizeESMTask(opts.amd, opts.commonJS)); + } else { + optimizers.push(optimizeAMDTask(opts.amd)); + + if (opts.commonJS) { + optimizers.push(optimizeCommonJSTask(opts.commonJS)); + } } if (opts.manual) { @@ -377,12 +529,10 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr } export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) => void { - const esbuild = require('esbuild') as typeof import('esbuild'); const sourceMappingURL = sourceMapBaseUrl ? ((f: any) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined; return cb => { const cssnano = require('cssnano') as typeof import('cssnano'); - const sourcemaps = require('gulp-sourcemaps') as typeof import('gulp-sourcemaps'); const svgmin = require('gulp-svgmin') as typeof import('gulp-svgmin'); const jsFilter = filter('**/*.js', { restore: true }); @@ -400,7 +550,7 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) => sourcemap: 'external', outdir: '.', platform: 'node', - target: ['esnext'], + target: ['es2022'], write: false }).then(res => { const jsFile = res.outputFiles.find(f => /\.js$/.test(f.path))!; @@ -425,13 +575,6 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) => svgFilter, svgmin(), svgFilter.restore, - (sourcemaps).mapSources((sourcePath: string) => { - if (sourcePath === 'bootstrap-fork.js') { - return 'bootstrap-fork.orig.js'; - } - - return sourcePath; - }), sourcemaps.write('./', { sourceMappingURL, sourceRoot: undefined, diff --git a/build/lib/preLaunch.js b/build/lib/preLaunch.js index 1bfe7f573f6..4791514fdfe 100644 --- a/build/lib/preLaunch.js +++ b/build/lib/preLaunch.js @@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const path = require("path"); const child_process_1 = require("child_process"); const fs_1 = require("fs"); -const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn'; +const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'; const rootDir = path.resolve(__dirname, '..', '..'); function runProcess(command, args = []) { return new Promise((resolve, reject) => { @@ -28,15 +28,15 @@ async function exists(subdir) { } async function ensureNodeModules() { if (!(await exists('node_modules'))) { - await runProcess(yarn); + await runProcess(npm, ['ci']); } } async function getElectron() { - await runProcess(yarn, ['electron']); + await runProcess(npm, ['run', 'electron']); } async function ensureCompiled() { if (!(await exists('out'))) { - await runProcess(yarn, ['compile']); + await runProcess(npm, ['run', 'compile']); } } async function main() { diff --git a/build/lib/preLaunch.ts b/build/lib/preLaunch.ts index d6776e62798..e0ea274458a 100644 --- a/build/lib/preLaunch.ts +++ b/build/lib/preLaunch.ts @@ -9,7 +9,7 @@ import * as path from 'path'; import { spawn } from 'child_process'; import { promises as fs } from 'fs'; -const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn'; +const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'; const rootDir = path.resolve(__dirname, '..', '..'); function runProcess(command: string, args: ReadonlyArray = []) { @@ -31,17 +31,17 @@ async function exists(subdir: string) { async function ensureNodeModules() { if (!(await exists('node_modules'))) { - await runProcess(yarn); + await runProcess(npm, ['ci']); } } async function getElectron() { - await runProcess(yarn, ['electron']); + await runProcess(npm, ['run', 'electron']); } async function ensureCompiled() { if (!(await exists('out'))) { - await runProcess(yarn, ['compile']); + await runProcess(npm, ['run', 'compile']); } } diff --git a/build/lib/standalone.js b/build/lib/standalone.js index dbc47db0833..b724a009e8a 100644 --- a/build/lib/standalone.js +++ b/build/lib/standalone.js @@ -51,7 +51,12 @@ function extractEditor(options) { // Add extra .d.ts files from `node_modules/@types/` if (Array.isArray(options.compilerOptions?.types)) { options.compilerOptions.types.forEach((type) => { - options.typings.push(`../node_modules/@types/${type}/index.d.ts`); + if (type === '@webgpu/types') { + options.typings.push(`../node_modules/${type}/dist/index.d.ts`); + } + else { + options.typings.push(`../node_modules/@types/${type}/index.d.ts`); + } }); } const result = tss.shake(options); @@ -79,13 +84,7 @@ function extractEditor(options) { const info = ts.preProcessFile(fileContents); for (let i = info.importedFiles.length - 1; i >= 0; i--) { const importedFileName = info.importedFiles[i].fileName; - let importedFilePath; - if (/^vs\/css!/.test(importedFileName)) { - importedFilePath = importedFileName.substr('vs/css!'.length) + '.css'; - } - else { - importedFilePath = importedFileName; - } + let importedFilePath = importedFileName; if (/(^\.\/)|(^\.\.\/)/.test(importedFilePath)) { importedFilePath = path.join(path.dirname(fileName), importedFilePath); } @@ -93,8 +92,9 @@ function extractEditor(options) { transportCSS(importedFilePath, copyFile, writeOutputFile); } else { - if (fs.existsSync(path.join(options.sourcesRoot, importedFilePath + '.js'))) { - copyFile(importedFilePath + '.js'); + const pathToCopy = path.join(options.sourcesRoot, importedFilePath); + if (fs.existsSync(pathToCopy) && !fs.statSync(pathToCopy).isDirectory()) { + copyFile(importedFilePath); } } } @@ -106,14 +106,10 @@ function extractEditor(options) { 'vs/css.build.ts', 'vs/css.ts', 'vs/loader.js', - 'vs/loader.d.ts', - 'vs/nls.build.ts', - 'vs/nls.ts', - 'vs/nls.mock.ts', + 'vs/loader.d.ts' ].forEach(copyFile); } function createESMSourcesAndResources2(options) { - const ts = require('typescript'); const SRC_FOLDER = path.join(REPO_ROOT, options.srcFolder); const OUT_FOLDER = path.join(REPO_ROOT, options.outFolder); const OUT_RESOURCES_FOLDER = path.join(REPO_ROOT, options.outResourcesFolder); @@ -134,58 +130,16 @@ function createESMSourcesAndResources2(options) { } if (file === 'tsconfig.json') { const tsConfig = JSON.parse(fs.readFileSync(path.join(SRC_FOLDER, file)).toString()); - tsConfig.compilerOptions.module = 'es6'; + tsConfig.compilerOptions.module = 'es2022'; tsConfig.compilerOptions.outDir = path.join(path.relative(OUT_FOLDER, OUT_RESOURCES_FOLDER), 'vs').replace(/\\/g, '/'); write(getDestAbsoluteFilePath(file), JSON.stringify(tsConfig, null, '\t')); continue; } - if (/\.d\.ts$/.test(file) || /\.css$/.test(file) || /\.js$/.test(file) || /\.ttf$/.test(file)) { + if (/\.ts$/.test(file) || /\.d\.ts$/.test(file) || /\.css$/.test(file) || /\.js$/.test(file) || /\.ttf$/.test(file)) { // Transport the files directly write(getDestAbsoluteFilePath(file), fs.readFileSync(path.join(SRC_FOLDER, file))); continue; } - if (/\.ts$/.test(file)) { - // Transform the .ts file - let fileContents = fs.readFileSync(path.join(SRC_FOLDER, file)).toString(); - const info = ts.preProcessFile(fileContents); - for (let i = info.importedFiles.length - 1; i >= 0; i--) { - const importedFilename = info.importedFiles[i].fileName; - const pos = info.importedFiles[i].pos; - const end = info.importedFiles[i].end; - let importedFilepath; - if (/^vs\/css!/.test(importedFilename)) { - importedFilepath = importedFilename.substr('vs/css!'.length) + '.css'; - } - else { - importedFilepath = importedFilename; - } - if (/(^\.\/)|(^\.\.\/)/.test(importedFilepath)) { - importedFilepath = path.join(path.dirname(file), importedFilepath); - } - let relativePath; - if (importedFilepath === path.dirname(file).replace(/\\/g, '/')) { - relativePath = '../' + path.basename(path.dirname(file)); - } - else if (importedFilepath === path.dirname(path.dirname(file)).replace(/\\/g, '/')) { - relativePath = '../../' + path.basename(path.dirname(path.dirname(file))); - } - else { - relativePath = path.relative(path.dirname(file), importedFilepath); - } - relativePath = relativePath.replace(/\\/g, '/'); - if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) { - relativePath = './' + relativePath; - } - fileContents = (fileContents.substring(0, pos + 1) - + relativePath - + fileContents.substring(end + 1)); - } - fileContents = fileContents.replace(/import ([a-zA-Z0-9]+) = require\(('[^']+')\);/g, function (_, m1, m2) { - return `import * as ${m1} from ${m2};`; - }); - write(getDestAbsoluteFilePath(file), fileContents); - continue; - } console.log(`UNKNOWN FILE: ${file}`); } function walkDirRecursive(dir) { diff --git a/build/lib/standalone.ts b/build/lib/standalone.ts index 775a1be5996..9563cd6670b 100644 --- a/build/lib/standalone.ts +++ b/build/lib/standalone.ts @@ -59,7 +59,11 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str // Add extra .d.ts files from `node_modules/@types/` if (Array.isArray(options.compilerOptions?.types)) { options.compilerOptions.types.forEach((type: string) => { - options.typings.push(`../node_modules/@types/${type}/index.d.ts`); + if (type === '@webgpu/types') { + options.typings.push(`../node_modules/${type}/dist/index.d.ts`); + } else { + options.typings.push(`../node_modules/@types/${type}/index.d.ts`); + } }); } @@ -90,12 +94,7 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str for (let i = info.importedFiles.length - 1; i >= 0; i--) { const importedFileName = info.importedFiles[i].fileName; - let importedFilePath: string; - if (/^vs\/css!/.test(importedFileName)) { - importedFilePath = importedFileName.substr('vs/css!'.length) + '.css'; - } else { - importedFilePath = importedFileName; - } + let importedFilePath = importedFileName; if (/(^\.\/)|(^\.\.\/)/.test(importedFilePath)) { importedFilePath = path.join(path.dirname(fileName), importedFilePath); } @@ -103,8 +102,9 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str if (/\.css$/.test(importedFilePath)) { transportCSS(importedFilePath, copyFile, writeOutputFile); } else { - if (fs.existsSync(path.join(options.sourcesRoot, importedFilePath + '.js'))) { - copyFile(importedFilePath + '.js'); + const pathToCopy = path.join(options.sourcesRoot, importedFilePath); + if (fs.existsSync(pathToCopy) && !fs.statSync(pathToCopy).isDirectory()) { + copyFile(importedFilePath); } } } @@ -118,10 +118,7 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str 'vs/css.build.ts', 'vs/css.ts', 'vs/loader.js', - 'vs/loader.d.ts', - 'vs/nls.build.ts', - 'vs/nls.ts', - 'vs/nls.mock.ts', + 'vs/loader.d.ts' ].forEach(copyFile); } @@ -134,7 +131,6 @@ export interface IOptions2 { } export function createESMSourcesAndResources2(options: IOptions2): void { - const ts = require('typescript') as typeof import('typescript'); const SRC_FOLDER = path.join(REPO_ROOT, options.srcFolder); const OUT_FOLDER = path.join(REPO_ROOT, options.outFolder); @@ -160,66 +156,18 @@ export function createESMSourcesAndResources2(options: IOptions2): void { if (file === 'tsconfig.json') { const tsConfig = JSON.parse(fs.readFileSync(path.join(SRC_FOLDER, file)).toString()); - tsConfig.compilerOptions.module = 'es6'; + tsConfig.compilerOptions.module = 'es2022'; tsConfig.compilerOptions.outDir = path.join(path.relative(OUT_FOLDER, OUT_RESOURCES_FOLDER), 'vs').replace(/\\/g, '/'); write(getDestAbsoluteFilePath(file), JSON.stringify(tsConfig, null, '\t')); continue; } - if (/\.d\.ts$/.test(file) || /\.css$/.test(file) || /\.js$/.test(file) || /\.ttf$/.test(file)) { + if (/\.ts$/.test(file) || /\.d\.ts$/.test(file) || /\.css$/.test(file) || /\.js$/.test(file) || /\.ttf$/.test(file)) { // Transport the files directly write(getDestAbsoluteFilePath(file), fs.readFileSync(path.join(SRC_FOLDER, file))); continue; } - if (/\.ts$/.test(file)) { - // Transform the .ts file - let fileContents = fs.readFileSync(path.join(SRC_FOLDER, file)).toString(); - - const info = ts.preProcessFile(fileContents); - - for (let i = info.importedFiles.length - 1; i >= 0; i--) { - const importedFilename = info.importedFiles[i].fileName; - const pos = info.importedFiles[i].pos; - const end = info.importedFiles[i].end; - - let importedFilepath: string; - if (/^vs\/css!/.test(importedFilename)) { - importedFilepath = importedFilename.substr('vs/css!'.length) + '.css'; - } else { - importedFilepath = importedFilename; - } - if (/(^\.\/)|(^\.\.\/)/.test(importedFilepath)) { - importedFilepath = path.join(path.dirname(file), importedFilepath); - } - - let relativePath: string; - if (importedFilepath === path.dirname(file).replace(/\\/g, '/')) { - relativePath = '../' + path.basename(path.dirname(file)); - } else if (importedFilepath === path.dirname(path.dirname(file)).replace(/\\/g, '/')) { - relativePath = '../../' + path.basename(path.dirname(path.dirname(file))); - } else { - relativePath = path.relative(path.dirname(file), importedFilepath); - } - relativePath = relativePath.replace(/\\/g, '/'); - if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) { - relativePath = './' + relativePath; - } - fileContents = ( - fileContents.substring(0, pos + 1) - + relativePath - + fileContents.substring(end + 1) - ); - } - - fileContents = fileContents.replace(/import ([a-zA-Z0-9]+) = require\(('[^']+')\);/g, function (_, m1, m2) { - return `import * as ${m1} from ${m2};`; - }); - - write(getDestAbsoluteFilePath(file), fileContents); - continue; - } - console.log(`UNKNOWN FILE: ${file}`); } diff --git a/build/lib/stylelint/vscode-known-variables.json b/build/lib/stylelint/vscode-known-variables.json index e482a5ca5af..56aa02ebfb7 100644 --- a/build/lib/stylelint/vscode-known-variables.json +++ b/build/lib/stylelint/vscode-known-variables.json @@ -17,12 +17,6 @@ "--vscode-activityBarTop-dropBorder", "--vscode-activityBarTop-foreground", "--vscode-activityBarTop-inactiveForeground", - "--vscode-aideChat-avatarBackground", - "--vscode-aideChat-avatarForeground", - "--vscode-aideChat-requestBackground", - "--vscode-aideChat-requestBorder", - "--vscode-aideChat-slashCommandBackground", - "--vscode-aideChat-slashCommandForeground", "--vscode-badge-background", "--vscode-badge-foreground", "--vscode-banner-background", @@ -144,6 +138,7 @@ "--vscode-editor-findRangeHighlightBorder", "--vscode-editor-focusedStackFrameHighlightBackground", "--vscode-editor-foldBackground", + "--vscode-editor-foldPlaceholderForeground", "--vscode-editor-foreground", "--vscode-editor-hoverHighlightBackground", "--vscode-editor-inactiveSelectionBackground", @@ -172,6 +167,10 @@ "--vscode-editor-wordHighlightStrongBorder", "--vscode-editor-wordHighlightTextBackground", "--vscode-editor-wordHighlightTextBorder", + "--vscode-editorActionList-background", + "--vscode-editorActionList-focusBackground", + "--vscode-editorActionList-focusForeground", + "--vscode-editorActionList-foreground", "--vscode-editorActiveLineNumber-foreground", "--vscode-editorBracketHighlight-foreground1", "--vscode-editorBracketHighlight-foreground2", @@ -536,11 +535,25 @@ "--vscode-quickInputList-focusForeground", "--vscode-quickInputList-focusIconForeground", "--vscode-quickInputTitle-background", + "--vscode-radio-activeBackground", + "--vscode-radio-activeBorder", + "--vscode-radio-activeForeground", + "--vscode-radio-inactiveBackground", + "--vscode-radio-inactiveBorder", + "--vscode-radio-inactiveForeground", + "--vscode-radio-inactiveHoverBackground", "--vscode-sash-hoverBorder", - "--vscode-scm-historyItemAdditionsForeground", - "--vscode-scm-historyItemDeletionsForeground", - "--vscode-scm-historyItemSelectedStatisticsBorder", - "--vscode-scm-historyItemStatisticsBorder", + "--vscode-scmGraph-foreground1", + "--vscode-scmGraph-foreground2", + "--vscode-scmGraph-foreground3", + "--vscode-scmGraph-historyItemBaseRefColor", + "--vscode-scmGraph-historyItemRefColor", + "--vscode-scmGraph-historyItemRemoteRefColor", + "--vscode-scmGraph-historyItemHoverAdditionsForeground", + "--vscode-scmGraph-historyItemHoverDefaultLabelBackground", + "--vscode-scmGraph-historyItemHoverDefaultLabelForeground", + "--vscode-scmGraph-historyItemHoverDeletionsForeground", + "--vscode-scmGraph-historyItemHoverLabelForeground", "--vscode-scrollbar-shadow", "--vscode-scrollbarSlider-activeBackground", "--vscode-scrollbarSlider-background", @@ -716,8 +729,10 @@ "--vscode-terminalCommandDecoration-defaultBackground", "--vscode-terminalCommandDecoration-errorBackground", "--vscode-terminalCommandDecoration-successBackground", + "--vscode-terminalCommandGuide-foreground", "--vscode-terminalCursor-background", "--vscode-terminalCursor-foreground", + "--vscode-terminalOverviewRuler-border", "--vscode-terminalOverviewRuler-cursorForeground", "--vscode-terminalOverviewRuler-findMatchForeground", "--vscode-terminalStickyScroll-background", @@ -787,7 +802,6 @@ "--vscode-window-inactiveBorder" ], "others": [ - "--size", "--background-dark", "--background-light", "--dropdown-padding-bottom", @@ -817,6 +831,7 @@ "--testMessageDecorationFontFamily", "--testMessageDecorationFontSize", "--title-border-bottom-color", + "--title-wco-width", "--vscode-chat-list-background", "--vscode-editorCodeLens-fontFamily", "--vscode-editorCodeLens-fontFamilyDefault", @@ -841,6 +856,8 @@ "--vscode-editorStickyScroll-scrollableWidth", "--vscode-editorStickyScroll-foldingOpacityTransition", "--window-border-color", + "--vscode-parameterHintsWidget-editorFontFamily", + "--vscode-parameterHintsWidget-editorFontFamilyDefault", "--workspace-trust-check-color", "--workspace-trust-selected-color", "--workspace-trust-unselected-color", diff --git a/build/lib/treeshaking.js b/build/lib/treeshaking.js index c8e95511877..af06f4e3ec5 100644 --- a/build/lib/treeshaking.js +++ b/build/lib/treeshaking.js @@ -100,35 +100,36 @@ function discoverAndReadFiles(ts, options) { options.entryPoints.forEach((entryPoint) => enqueue(entryPoint)); while (queue.length > 0) { const moduleId = queue.shift(); - const dts_filename = path.join(options.sourcesRoot, moduleId + '.d.ts'); + let redirectedModuleId = moduleId; + if (options.redirects[moduleId]) { + redirectedModuleId = options.redirects[moduleId]; + } + const dts_filename = path.join(options.sourcesRoot, redirectedModuleId + '.d.ts'); if (fs.existsSync(dts_filename)) { const dts_filecontents = fs.readFileSync(dts_filename).toString(); FILES[`${moduleId}.d.ts`] = dts_filecontents; continue; } - const js_filename = path.join(options.sourcesRoot, moduleId + '.js'); + const js_filename = path.join(options.sourcesRoot, redirectedModuleId + '.js'); if (fs.existsSync(js_filename)) { // This is an import for a .js file, so ignore it... continue; } - let ts_filename; - if (options.redirects[moduleId]) { - ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts'); - } - else { - ts_filename = path.join(options.sourcesRoot, moduleId + '.ts'); - } + const ts_filename = path.join(options.sourcesRoot, redirectedModuleId + '.ts'); const ts_filecontents = fs.readFileSync(ts_filename).toString(); const info = ts.preProcessFile(ts_filecontents); for (let i = info.importedFiles.length - 1; i >= 0; i--) { const importedFileName = info.importedFiles[i].fileName; if (options.importIgnorePattern.test(importedFileName)) { - // Ignore vs/css! imports + // Ignore *.css imports continue; } let importedModuleId = importedFileName; if (/(^\.\/)|(^\.\.\/)/.test(importedModuleId)) { importedModuleId = path.join(path.dirname(moduleId), importedModuleId); + if (importedModuleId.endsWith('.js')) { // ESM: code imports require to be relative and have a '.js' file extension + importedModuleId = importedModuleId.substr(0, importedModuleId.length - 3); + } } enqueue(importedModuleId); } @@ -455,6 +456,9 @@ function markNodes(ts, languageService, options) { const nodeSourceFile = node.getSourceFile(); let fullPath; if (/(^\.\/)|(^\.\.\/)/.test(importText)) { + if (importText.endsWith('.js')) { // ESM: code imports require to be relative and to have a '.js' file extension + importText = importText.substr(0, importText.length - 3); + } fullPath = path.join(path.dirname(nodeSourceFile.fileName), importText) + '.ts'; } else { diff --git a/build/lib/treeshaking.ts b/build/lib/treeshaking.ts index 020e567eb72..cd17c5f0278 100644 --- a/build/lib/treeshaking.ts +++ b/build/lib/treeshaking.ts @@ -53,7 +53,7 @@ export interface ITreeShakingOptions { */ shakeLevel: ShakeLevel; /** - * regex pattern to ignore certain imports e.g. `vs/css!` imports + * regex pattern to ignore certain imports e.g. `.css` imports */ importIgnorePattern: RegExp; @@ -155,38 +155,43 @@ function discoverAndReadFiles(ts: typeof import('typescript'), options: ITreeSha while (queue.length > 0) { const moduleId = queue.shift()!; - const dts_filename = path.join(options.sourcesRoot, moduleId + '.d.ts'); + let redirectedModuleId: string = moduleId; + if (options.redirects[moduleId]) { + redirectedModuleId = options.redirects[moduleId]; + } + + const dts_filename = path.join(options.sourcesRoot, redirectedModuleId + '.d.ts'); if (fs.existsSync(dts_filename)) { const dts_filecontents = fs.readFileSync(dts_filename).toString(); FILES[`${moduleId}.d.ts`] = dts_filecontents; continue; } - const js_filename = path.join(options.sourcesRoot, moduleId + '.js'); + + const js_filename = path.join(options.sourcesRoot, redirectedModuleId + '.js'); if (fs.existsSync(js_filename)) { // This is an import for a .js file, so ignore it... continue; } - let ts_filename: string; - if (options.redirects[moduleId]) { - ts_filename = path.join(options.sourcesRoot, options.redirects[moduleId] + '.ts'); - } else { - ts_filename = path.join(options.sourcesRoot, moduleId + '.ts'); - } + const ts_filename = path.join(options.sourcesRoot, redirectedModuleId + '.ts'); + const ts_filecontents = fs.readFileSync(ts_filename).toString(); const info = ts.preProcessFile(ts_filecontents); for (let i = info.importedFiles.length - 1; i >= 0; i--) { const importedFileName = info.importedFiles[i].fileName; if (options.importIgnorePattern.test(importedFileName)) { - // Ignore vs/css! imports + // Ignore *.css imports continue; } let importedModuleId = importedFileName; if (/(^\.\/)|(^\.\.\/)/.test(importedModuleId)) { importedModuleId = path.join(path.dirname(moduleId), importedModuleId); + if (importedModuleId.endsWith('.js')) { // ESM: code imports require to be relative and have a '.js' file extension + importedModuleId = importedModuleId.substr(0, importedModuleId.length - 3); + } } enqueue(importedModuleId); } @@ -565,6 +570,9 @@ function markNodes(ts: typeof import('typescript'), languageService: ts.Language const nodeSourceFile = node.getSourceFile(); let fullPath: string; if (/(^\.\/)|(^\.\.\/)/.test(importText)) { + if (importText.endsWith('.js')) { // ESM: code imports require to be relative and to have a '.js' file extension + importText = importText.substr(0, importText.length - 3); + } fullPath = path.join(path.dirname(nodeSourceFile.fileName), importText) + '.ts'; } else { fullPath = importText + '.ts'; diff --git a/build/lib/tsb/builder.js b/build/lib/tsb/builder.js index fc74bfa8acc..cee2758e896 100644 --- a/build/lib/tsb/builder.js +++ b/build/lib/tsb/builder.js @@ -355,7 +355,7 @@ function createTypeScriptBuilder(config, projectFile, cmd) { // print stats const headNow = process.memoryUsage().heapUsed; const MB = 1024 * 1024; - _log('[tsb]', `time: ${colors.yellow((Date.now() - t1) + 'ms')} + \nmem: ${colors.cyan(Math.ceil(headNow / MB) + 'MB')} ${colors.bgCyan('delta: ' + Math.ceil((headNow - headUsed) / MB))}`); + _log('[tsb]', `time: ${colors.yellow((Date.now() - t1) + 'ms')} + \nmem: ${colors.cyan(Math.ceil(headNow / MB) + 'MB')} ${colors.bgcyan('delta: ' + Math.ceil((headNow - headUsed) / MB))}`); headUsed = headNow; }); } @@ -550,7 +550,10 @@ class LanguageServiceHost { let found = false; while (!found && dirname.indexOf(stopDirname) === 0) { dirname = path.dirname(dirname); - const resolvedPath = path.resolve(dirname, ref.fileName); + let resolvedPath = path.resolve(dirname, ref.fileName); + if (resolvedPath.endsWith('.js')) { + resolvedPath = resolvedPath.slice(0, -3); + } const normalizedPath = normalize(resolvedPath); if (this.getScriptSnapshot(normalizedPath + '.ts')) { this._dependencies.inertEdge(filename, normalizedPath + '.ts'); diff --git a/build/lib/tsb/builder.ts b/build/lib/tsb/builder.ts index 9fc476ae702..70c71591a6e 100644 --- a/build/lib/tsb/builder.ts +++ b/build/lib/tsb/builder.ts @@ -427,7 +427,7 @@ export function createTypeScriptBuilder(config: IConfiguration, projectFile: str const MB = 1024 * 1024; _log( '[tsb]', - `time: ${colors.yellow((Date.now() - t1) + 'ms')} + \nmem: ${colors.cyan(Math.ceil(headNow / MB) + 'MB')} ${colors.bgCyan('delta: ' + Math.ceil((headNow - headUsed) / MB))}` + `time: ${colors.yellow((Date.now() - t1) + 'ms')} + \nmem: ${colors.cyan(Math.ceil(headNow / MB) + 'MB')} ${colors.bgcyan('delta: ' + Math.ceil((headNow - headUsed) / MB))}` ); headUsed = headNow; }); @@ -660,7 +660,10 @@ class LanguageServiceHost implements ts.LanguageServiceHost { while (!found && dirname.indexOf(stopDirname) === 0) { dirname = path.dirname(dirname); - const resolvedPath = path.resolve(dirname, ref.fileName); + let resolvedPath = path.resolve(dirname, ref.fileName); + if (resolvedPath.endsWith('.js')) { + resolvedPath = resolvedPath.slice(0, -3); + } const normalizedPath = normalize(resolvedPath); if (this.getScriptSnapshot(normalizedPath + '.ts')) { diff --git a/build/lib/util.js b/build/lib/util.js index 02ce049b00b..09df0e69e3f 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -315,9 +315,9 @@ function streamToPromise(stream) { }); } function getElectronVersion() { - const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8'); - const electronVersion = /^target "(.*)"$/m.exec(yarnrc)[1]; - const msBuildId = /^ms_build_id "(.*)"$/m.exec(yarnrc)[1]; + const npmrc = fs.readFileSync(path.join(root, '.npmrc'), 'utf8'); + const electronVersion = /^target="(.*)"$/m.exec(npmrc)[1]; + const msBuildId = /^ms_build_id="(.*)"$/m.exec(npmrc)[1]; return { electronVersion, msBuildId }; } function acquireWebNodePaths() { diff --git a/build/lib/util.ts b/build/lib/util.ts index 6648ce42364..4cbe8f552ce 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -385,9 +385,9 @@ export function streamToPromise(stream: NodeJS.ReadWriteStream): Promise { } export function getElectronVersion(): Record { - const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8'); - const electronVersion = /^target "(.*)"$/m.exec(yarnrc)![1]; - const msBuildId = /^ms_build_id "(.*)"$/m.exec(yarnrc)![1]; + const npmrc = fs.readFileSync(path.join(root, '.npmrc'), 'utf8'); + const electronVersion = /^target="(.*)"$/m.exec(npmrc)![1]; + const msBuildId = /^ms_build_id="(.*)"$/m.exec(npmrc)![1]; return { electronVersion, msBuildId }; } diff --git a/build/linux/debian/dep-lists.js b/build/linux/debian/dep-lists.js index d843c090063..3bb58fb1215 100644 --- a/build/linux/debian/dep-lists.js +++ b/build/linux/debian/dep-lists.js @@ -31,6 +31,7 @@ exports.referenceGeneratedDepsByArch = { 'libc6 (>= 2.16)', 'libc6 (>= 2.17)', 'libc6 (>= 2.2.5)', + 'libc6 (>= 2.25)', 'libc6 (>= 2.28)', 'libcairo2 (>= 1.6.0)', 'libcurl3-gnutls | libcurl3-nss | libcurl4 | libcurl3', @@ -39,10 +40,8 @@ exports.referenceGeneratedDepsByArch = { 'libexpat1 (>= 2.1~beta3)', 'libgbm1 (>= 17.1.0~rc2)', 'libglib2.0-0 (>= 2.37.3)', - 'libgssapi-krb5-2 (>= 1.17)', 'libgtk-3-0 (>= 3.9.10)', 'libgtk-3-0 (>= 3.9.10) | libgtk-4-1', - 'libkrb5-3 (>= 1.6.dfsg.2)', 'libnspr4 (>= 2:4.9-2~)', 'libnss3 (>= 2:3.30)', 'libnss3 (>= 3.26)', @@ -67,6 +66,7 @@ exports.referenceGeneratedDepsByArch = { 'libatspi2.0-0 (>= 2.9.90)', 'libc6 (>= 2.16)', 'libc6 (>= 2.17)', + 'libc6 (>= 2.25)', 'libc6 (>= 2.28)', 'libc6 (>= 2.4)', 'libc6 (>= 2.9)', @@ -77,10 +77,8 @@ exports.referenceGeneratedDepsByArch = { 'libexpat1 (>= 2.1~beta3)', 'libgbm1 (>= 17.1.0~rc2)', 'libglib2.0-0 (>= 2.37.3)', - 'libgssapi-krb5-2 (>= 1.17)', 'libgtk-3-0 (>= 3.9.10)', 'libgtk-3-0 (>= 3.9.10) | libgtk-4-1', - 'libkrb5-3 (>= 1.6.dfsg.2)', 'libnspr4 (>= 2:4.9-2~)', 'libnss3 (>= 2:3.30)', 'libnss3 (>= 3.26)', @@ -108,6 +106,7 @@ exports.referenceGeneratedDepsByArch = { 'libatk1.0-0 (>= 2.2.0)', 'libatspi2.0-0 (>= 2.9.90)', 'libc6 (>= 2.17)', + 'libc6 (>= 2.25)', 'libc6 (>= 2.28)', 'libcairo2 (>= 1.6.0)', 'libcurl3-gnutls | libcurl3-nss | libcurl4 | libcurl3', @@ -116,10 +115,8 @@ exports.referenceGeneratedDepsByArch = { 'libexpat1 (>= 2.1~beta3)', 'libgbm1 (>= 17.1.0~rc2)', 'libglib2.0-0 (>= 2.37.3)', - 'libgssapi-krb5-2 (>= 1.17)', 'libgtk-3-0 (>= 3.9.10)', 'libgtk-3-0 (>= 3.9.10) | libgtk-4-1', - 'libkrb5-3 (>= 1.6.dfsg.2)', 'libnspr4 (>= 2:4.9-2~)', 'libnss3 (>= 2:3.30)', 'libnss3 (>= 3.26)', diff --git a/build/linux/debian/dep-lists.ts b/build/linux/debian/dep-lists.ts index 4028370cd02..e3d78d1139a 100644 --- a/build/linux/debian/dep-lists.ts +++ b/build/linux/debian/dep-lists.ts @@ -31,6 +31,7 @@ export const referenceGeneratedDepsByArch = { 'libc6 (>= 2.16)', 'libc6 (>= 2.17)', 'libc6 (>= 2.2.5)', + 'libc6 (>= 2.25)', 'libc6 (>= 2.28)', 'libcairo2 (>= 1.6.0)', 'libcurl3-gnutls | libcurl3-nss | libcurl4 | libcurl3', @@ -39,10 +40,8 @@ export const referenceGeneratedDepsByArch = { 'libexpat1 (>= 2.1~beta3)', 'libgbm1 (>= 17.1.0~rc2)', 'libglib2.0-0 (>= 2.37.3)', - 'libgssapi-krb5-2 (>= 1.17)', 'libgtk-3-0 (>= 3.9.10)', 'libgtk-3-0 (>= 3.9.10) | libgtk-4-1', - 'libkrb5-3 (>= 1.6.dfsg.2)', 'libnspr4 (>= 2:4.9-2~)', 'libnss3 (>= 2:3.30)', 'libnss3 (>= 3.26)', @@ -67,6 +66,7 @@ export const referenceGeneratedDepsByArch = { 'libatspi2.0-0 (>= 2.9.90)', 'libc6 (>= 2.16)', 'libc6 (>= 2.17)', + 'libc6 (>= 2.25)', 'libc6 (>= 2.28)', 'libc6 (>= 2.4)', 'libc6 (>= 2.9)', @@ -77,10 +77,8 @@ export const referenceGeneratedDepsByArch = { 'libexpat1 (>= 2.1~beta3)', 'libgbm1 (>= 17.1.0~rc2)', 'libglib2.0-0 (>= 2.37.3)', - 'libgssapi-krb5-2 (>= 1.17)', 'libgtk-3-0 (>= 3.9.10)', 'libgtk-3-0 (>= 3.9.10) | libgtk-4-1', - 'libkrb5-3 (>= 1.6.dfsg.2)', 'libnspr4 (>= 2:4.9-2~)', 'libnss3 (>= 2:3.30)', 'libnss3 (>= 3.26)', @@ -108,6 +106,7 @@ export const referenceGeneratedDepsByArch = { 'libatk1.0-0 (>= 2.2.0)', 'libatspi2.0-0 (>= 2.9.90)', 'libc6 (>= 2.17)', + 'libc6 (>= 2.25)', 'libc6 (>= 2.28)', 'libcairo2 (>= 1.6.0)', 'libcurl3-gnutls | libcurl3-nss | libcurl4 | libcurl3', @@ -116,10 +115,8 @@ export const referenceGeneratedDepsByArch = { 'libexpat1 (>= 2.1~beta3)', 'libgbm1 (>= 17.1.0~rc2)', 'libglib2.0-0 (>= 2.37.3)', - 'libgssapi-krb5-2 (>= 1.17)', 'libgtk-3-0 (>= 3.9.10)', 'libgtk-3-0 (>= 3.9.10) | libgtk-4-1', - 'libkrb5-3 (>= 1.6.dfsg.2)', 'libnspr4 (>= 2:4.9-2~)', 'libnss3 (>= 2:3.30)', 'libnss3 (>= 3.26)', diff --git a/build/linux/debian/install-sysroot.js b/build/linux/debian/install-sysroot.js index feca7d3fa9d..77ff92151e8 100644 --- a/build/linux/debian/install-sysroot.js +++ b/build/linux/debian/install-sysroot.js @@ -29,9 +29,9 @@ const ghDownloadHeaders = { Accept: 'application/octet-stream', }; function getElectronVersion() { - const yarnrc = fs.readFileSync(path.join(REPO_ROOT, '.yarnrc'), 'utf8'); - const electronVersion = /^target "(.*)"$/m.exec(yarnrc)[1]; - const msBuildId = /^ms_build_id "(.*)"$/m.exec(yarnrc)[1]; + const npmrc = fs.readFileSync(path.join(REPO_ROOT, '.npmrc'), 'utf8'); + const electronVersion = /^target="(.*)"$/m.exec(npmrc)[1]; + const msBuildId = /^ms_build_id="(.*)"$/m.exec(npmrc)[1]; return { electronVersion, msBuildId }; } function getSha(filename) { diff --git a/build/linux/debian/install-sysroot.ts b/build/linux/debian/install-sysroot.ts index aa417dcc722..76a31d63cdb 100644 --- a/build/linux/debian/install-sysroot.ts +++ b/build/linux/debian/install-sysroot.ts @@ -38,9 +38,9 @@ interface IFetchOptions { } function getElectronVersion(): Record { - const yarnrc = fs.readFileSync(path.join(REPO_ROOT, '.yarnrc'), 'utf8'); - const electronVersion = /^target "(.*)"$/m.exec(yarnrc)![1]; - const msBuildId = /^ms_build_id "(.*)"$/m.exec(yarnrc)![1]; + const npmrc = fs.readFileSync(path.join(REPO_ROOT, '.npmrc'), 'utf8'); + const electronVersion = /^target="(.*)"$/m.exec(npmrc)![1]; + const msBuildId = /^ms_build_id="(.*)"$/m.exec(npmrc)![1]; return { electronVersion, msBuildId }; } diff --git a/build/linux/dependencies-generator.js b/build/linux/dependencies-generator.js index 0e7953b8e89..99453bc588b 100644 --- a/build/linux/dependencies-generator.js +++ b/build/linux/dependencies-generator.js @@ -15,6 +15,7 @@ const dep_lists_2 = require("./rpm/dep-lists"); const types_1 = require("./debian/types"); const types_2 = require("./rpm/types"); const product = require("../../product.json"); +const amd_1 = require("../lib/amd"); // A flag that can easily be toggled. // Make sure to compile the build directory after toggling the value. // If false, we warn about new dependencies if they show up @@ -23,7 +24,7 @@ const product = require("../../product.json"); // The reference dependencies, which one has to update when the new dependencies // are valid, are in dep-lists.ts const FAIL_BUILD_FOR_NEW_DEPENDENCIES = true; -// Based on https://source.chromium.org/chromium/chromium/src/+/refs/tags/122.0.6261.156:chrome/installer/linux/BUILD.gn;l=64-80 +// Based on https://source.chromium.org/chromium/chromium/src/+/refs/tags/124.0.6367.243:chrome/installer/linux/BUILD.gn;l=64-80 // and the Linux Archive build // Shared library dependencies that we already bundle. const bundledDeps = [ @@ -43,7 +44,8 @@ async function getDependencies(packageType, buildDir, applicationName, arch) { throw new Error('Invalid RPM arch string ' + arch); } // Get the files for which we want to find dependencies. - const nativeModulesPath = path.join(buildDir, 'resources', 'app', 'node_modules.asar.unpacked'); + const canAsar = (0, amd_1.isAMD)(); // TODO@esm ASAR disabled in ESM + const nativeModulesPath = path.join(buildDir, 'resources', 'app', canAsar ? 'node_modules.asar.unpacked' : 'node_modules'); const findResult = (0, child_process_1.spawnSync)('find', [nativeModulesPath, '-name', '*.node']); if (findResult.status) { console.error('Error finding files:'); diff --git a/build/linux/dependencies-generator.ts b/build/linux/dependencies-generator.ts index 226310e1258..d390818dc54 100644 --- a/build/linux/dependencies-generator.ts +++ b/build/linux/dependencies-generator.ts @@ -15,6 +15,7 @@ import { referenceGeneratedDepsByArch as rpmGeneratedDeps } from './rpm/dep-list import { DebianArchString, isDebianArchString } from './debian/types'; import { isRpmArchString, RpmArchString } from './rpm/types'; import product = require('../../product.json'); +import { isAMD } from '../lib/amd'; // A flag that can easily be toggled. // Make sure to compile the build directory after toggling the value. @@ -25,7 +26,7 @@ import product = require('../../product.json'); // are valid, are in dep-lists.ts const FAIL_BUILD_FOR_NEW_DEPENDENCIES: boolean = true; -// Based on https://source.chromium.org/chromium/chromium/src/+/refs/tags/122.0.6261.156:chrome/installer/linux/BUILD.gn;l=64-80 +// Based on https://source.chromium.org/chromium/chromium/src/+/refs/tags/124.0.6367.243:chrome/installer/linux/BUILD.gn;l=64-80 // and the Linux Archive build // Shared library dependencies that we already bundle. const bundledDeps = [ @@ -47,7 +48,8 @@ export async function getDependencies(packageType: 'deb' | 'rpm', buildDir: stri } // Get the files for which we want to find dependencies. - const nativeModulesPath = path.join(buildDir, 'resources', 'app', 'node_modules.asar.unpacked'); + const canAsar = isAMD(); // TODO@esm ASAR disabled in ESM + const nativeModulesPath = path.join(buildDir, 'resources', 'app', canAsar ? 'node_modules.asar.unpacked' : 'node_modules'); const findResult = spawnSync('find', [nativeModulesPath, '-name', '*.node']); if (findResult.status) { console.error('Error finding files:'); diff --git a/build/linux/rpm/dep-lists.js b/build/linux/rpm/dep-lists.js index 8be477290bb..fa393808c53 100644 --- a/build/linux/rpm/dep-lists.js +++ b/build/linux/rpm/dep-lists.js @@ -45,12 +45,14 @@ exports.referenceGeneratedDepsByArch = { 'libc.so.6(GLIBC_2.17)(64bit)', 'libc.so.6(GLIBC_2.18)(64bit)', 'libc.so.6(GLIBC_2.2.5)(64bit)', + 'libc.so.6(GLIBC_2.25)(64bit)', 'libc.so.6(GLIBC_2.28)(64bit)', 'libc.so.6(GLIBC_2.3)(64bit)', 'libc.so.6(GLIBC_2.3.2)(64bit)', 'libc.so.6(GLIBC_2.3.3)(64bit)', 'libc.so.6(GLIBC_2.3.4)(64bit)', 'libc.so.6(GLIBC_2.4)(64bit)', + 'libc.so.6(GLIBC_2.5)(64bit)', 'libc.so.6(GLIBC_2.6)(64bit)', 'libc.so.6(GLIBC_2.7)(64bit)', 'libc.so.6(GLIBC_2.8)(64bit)', @@ -71,11 +73,7 @@ exports.referenceGeneratedDepsByArch = { 'libgio-2.0.so.0()(64bit)', 'libglib-2.0.so.0()(64bit)', 'libgobject-2.0.so.0()(64bit)', - 'libgssapi_krb5.so.2()(64bit)', - 'libgssapi_krb5.so.2(gssapi_krb5_2_MIT)(64bit)', 'libgtk-3.so.0()(64bit)', - 'libkrb5.so.3()(64bit)', - 'libkrb5.so.3(krb5_3_MIT)(64bit)', 'libm.so.6()(64bit)', 'libm.so.6(GLIBC_2.2.5)(64bit)', 'libnspr4.so()(64bit)', @@ -140,8 +138,10 @@ exports.referenceGeneratedDepsByArch = { 'libc.so.6(GLIBC_2.16)', 'libc.so.6(GLIBC_2.17)', 'libc.so.6(GLIBC_2.18)', + 'libc.so.6(GLIBC_2.25)', 'libc.so.6(GLIBC_2.28)', 'libc.so.6(GLIBC_2.4)', + 'libc.so.6(GLIBC_2.5)', 'libc.so.6(GLIBC_2.6)', 'libc.so.6(GLIBC_2.7)', 'libc.so.6(GLIBC_2.8)', @@ -162,12 +162,8 @@ exports.referenceGeneratedDepsByArch = { 'libgio-2.0.so.0', 'libglib-2.0.so.0', 'libgobject-2.0.so.0', - 'libgssapi_krb5.so.2', - 'libgssapi_krb5.so.2(gssapi_krb5_2_MIT)', 'libgtk-3.so.0', 'libgtk-3.so.0()(64bit)', - 'libkrb5.so.3', - 'libkrb5.so.3(krb5_3_MIT)', 'libm.so.6', 'libm.so.6(GLIBC_2.4)', 'libnspr4.so', @@ -241,6 +237,7 @@ exports.referenceGeneratedDepsByArch = { 'libc.so.6()(64bit)', 'libc.so.6(GLIBC_2.17)(64bit)', 'libc.so.6(GLIBC_2.18)(64bit)', + 'libc.so.6(GLIBC_2.25)(64bit)', 'libc.so.6(GLIBC_2.28)(64bit)', 'libcairo.so.2()(64bit)', 'libcurl.so.4()(64bit)', @@ -259,11 +256,7 @@ exports.referenceGeneratedDepsByArch = { 'libgio-2.0.so.0()(64bit)', 'libglib-2.0.so.0()(64bit)', 'libgobject-2.0.so.0()(64bit)', - 'libgssapi_krb5.so.2()(64bit)', - 'libgssapi_krb5.so.2(gssapi_krb5_2_MIT)(64bit)', 'libgtk-3.so.0()(64bit)', - 'libkrb5.so.3()(64bit)', - 'libkrb5.so.3(krb5_3_MIT)(64bit)', 'libm.so.6()(64bit)', 'libm.so.6(GLIBC_2.17)(64bit)', 'libnspr4.so()(64bit)', diff --git a/build/linux/rpm/dep-lists.ts b/build/linux/rpm/dep-lists.ts index 24b18d504c8..9eed3a79f7e 100644 --- a/build/linux/rpm/dep-lists.ts +++ b/build/linux/rpm/dep-lists.ts @@ -44,12 +44,14 @@ export const referenceGeneratedDepsByArch = { 'libc.so.6(GLIBC_2.17)(64bit)', 'libc.so.6(GLIBC_2.18)(64bit)', 'libc.so.6(GLIBC_2.2.5)(64bit)', + 'libc.so.6(GLIBC_2.25)(64bit)', 'libc.so.6(GLIBC_2.28)(64bit)', 'libc.so.6(GLIBC_2.3)(64bit)', 'libc.so.6(GLIBC_2.3.2)(64bit)', 'libc.so.6(GLIBC_2.3.3)(64bit)', 'libc.so.6(GLIBC_2.3.4)(64bit)', 'libc.so.6(GLIBC_2.4)(64bit)', + 'libc.so.6(GLIBC_2.5)(64bit)', 'libc.so.6(GLIBC_2.6)(64bit)', 'libc.so.6(GLIBC_2.7)(64bit)', 'libc.so.6(GLIBC_2.8)(64bit)', @@ -70,11 +72,7 @@ export const referenceGeneratedDepsByArch = { 'libgio-2.0.so.0()(64bit)', 'libglib-2.0.so.0()(64bit)', 'libgobject-2.0.so.0()(64bit)', - 'libgssapi_krb5.so.2()(64bit)', - 'libgssapi_krb5.so.2(gssapi_krb5_2_MIT)(64bit)', 'libgtk-3.so.0()(64bit)', - 'libkrb5.so.3()(64bit)', - 'libkrb5.so.3(krb5_3_MIT)(64bit)', 'libm.so.6()(64bit)', 'libm.so.6(GLIBC_2.2.5)(64bit)', 'libnspr4.so()(64bit)', @@ -139,8 +137,10 @@ export const referenceGeneratedDepsByArch = { 'libc.so.6(GLIBC_2.16)', 'libc.so.6(GLIBC_2.17)', 'libc.so.6(GLIBC_2.18)', + 'libc.so.6(GLIBC_2.25)', 'libc.so.6(GLIBC_2.28)', 'libc.so.6(GLIBC_2.4)', + 'libc.so.6(GLIBC_2.5)', 'libc.so.6(GLIBC_2.6)', 'libc.so.6(GLIBC_2.7)', 'libc.so.6(GLIBC_2.8)', @@ -161,12 +161,8 @@ export const referenceGeneratedDepsByArch = { 'libgio-2.0.so.0', 'libglib-2.0.so.0', 'libgobject-2.0.so.0', - 'libgssapi_krb5.so.2', - 'libgssapi_krb5.so.2(gssapi_krb5_2_MIT)', 'libgtk-3.so.0', 'libgtk-3.so.0()(64bit)', - 'libkrb5.so.3', - 'libkrb5.so.3(krb5_3_MIT)', 'libm.so.6', 'libm.so.6(GLIBC_2.4)', 'libnspr4.so', @@ -240,6 +236,7 @@ export const referenceGeneratedDepsByArch = { 'libc.so.6()(64bit)', 'libc.so.6(GLIBC_2.17)(64bit)', 'libc.so.6(GLIBC_2.18)(64bit)', + 'libc.so.6(GLIBC_2.25)(64bit)', 'libc.so.6(GLIBC_2.28)(64bit)', 'libcairo.so.2()(64bit)', 'libcurl.so.4()(64bit)', @@ -258,11 +255,7 @@ export const referenceGeneratedDepsByArch = { 'libgio-2.0.so.0()(64bit)', 'libglib-2.0.so.0()(64bit)', 'libgobject-2.0.so.0()(64bit)', - 'libgssapi_krb5.so.2()(64bit)', - 'libgssapi_krb5.so.2(gssapi_krb5_2_MIT)(64bit)', 'libgtk-3.so.0()(64bit)', - 'libkrb5.so.3()(64bit)', - 'libkrb5.so.3(krb5_3_MIT)(64bit)', 'libm.so.6()(64bit)', 'libm.so.6(GLIBC_2.17)(64bit)', 'libnspr4.so()(64bit)', diff --git a/build/loader.min b/build/loader.min new file mode 100644 index 00000000000..f9d21b58282 --- /dev/null +++ b/build/loader.min @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +"use strict";const _amdLoaderGlobal=this,_commonjsGlobal=typeof global=="object"?global:{};var AMDLoader;(function(d){d.global=_amdLoaderGlobal;class _{get isWindows(){return this._detect(),this._isWindows}get isNode(){return this._detect(),this._isNode}get isElectronRenderer(){return this._detect(),this._isElectronRenderer}get isWebWorker(){return this._detect(),this._isWebWorker}get isElectronNodeIntegrationWebWorker(){return this._detect(),this._isElectronNodeIntegrationWebWorker}constructor(){this._detected=!1,this._isWindows=!1,this._isNode=!1,this._isElectronRenderer=!1,this._isWebWorker=!1,this._isElectronNodeIntegrationWebWorker=!1}_detect(){this._detected||(this._detected=!0,this._isWindows=_._isWindows(),this._isNode=typeof module<"u"&&!!module.exports,this._isElectronRenderer=typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.electron<"u"&&process.type==="renderer",this._isWebWorker=typeof d.global.importScripts=="function",this._isElectronNodeIntegrationWebWorker=this._isWebWorker&&typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.electron<"u"&&process.type==="worker")}static _isWindows(){return typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.indexOf("Windows")>=0?!0:typeof process<"u"?process.platform==="win32":!1}}d.Environment=_})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(d){class _{constructor(n,c,a){this.type=n,this.detail=c,this.timestamp=a}}d.LoaderEvent=_;class v{constructor(n){this._events=[new _(1,"",n)]}record(n,c){this._events.push(new _(n,c,d.Utilities.getHighPerformanceTimestamp()))}getEvents(){return this._events}}d.LoaderEventRecorder=v;class f{record(n,c){}getEvents(){return[]}}f.INSTANCE=new f,d.NullLoaderEventRecorder=f})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(d){class _{static fileUriToFilePath(f,h){if(h=decodeURI(h).replace(/%23/g,"#"),f){if(/^file:\/\/\//.test(h))return h.substr(8);if(/^file:\/\//.test(h))return h.substr(5)}else if(/^file:\/\//.test(h))return h.substr(7);return h}static startsWith(f,h){return f.length>=h.length&&f.substr(0,h.length)===h}static endsWith(f,h){return f.length>=h.length&&f.substr(f.length-h.length)===h}static containsQueryString(f){return/^[^\#]*\?/gi.test(f)}static isAbsolutePath(f){return/^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(f)}static forEachProperty(f,h){if(f){let n;for(n in f)f.hasOwnProperty(n)&&h(n,f[n])}}static isEmpty(f){let h=!0;return _.forEachProperty(f,()=>{h=!1}),h}static recursiveClone(f){if(!f||typeof f!="object"||f instanceof RegExp||!Array.isArray(f)&&Object.getPrototypeOf(f)!==Object.prototype)return f;let h=Array.isArray(f)?[]:{};return _.forEachProperty(f,(n,c)=>{c&&typeof c=="object"?h[n]=_.recursiveClone(c):h[n]=c}),h}static generateAnonymousModule(){return"===anonymous"+_.NEXT_ANONYMOUS_ID+++"==="}static isAnonymousModule(f){return _.startsWith(f,"===anonymous")}static getHighPerformanceTimestamp(){return this.PERFORMANCE_NOW_PROBED||(this.PERFORMANCE_NOW_PROBED=!0,this.HAS_PERFORMANCE_NOW=d.global.performance&&typeof d.global.performance.now=="function"),this.HAS_PERFORMANCE_NOW?d.global.performance.now():Date.now()}}_.NEXT_ANONYMOUS_ID=1,_.PERFORMANCE_NOW_PROBED=!1,_.HAS_PERFORMANCE_NOW=!1,d.Utilities=_})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(d){function _(h){if(h instanceof Error)return h;const n=new Error(h.message||String(h)||"Unknown Error");return h.stack&&(n.stack=h.stack),n}d.ensureError=_;class v{static validateConfigurationOptions(n){function c(a){if(a.phase==="loading"){console.error('Loading "'+a.moduleId+'" failed'),console.error(a),console.error("Here are the modules that depend on it:"),console.error(a.neededBy);return}if(a.phase==="factory"){console.error('The factory function of "'+a.moduleId+'" has thrown an exception'),console.error(a),console.error("Here are the modules that depend on it:"),console.error(a.neededBy);return}}if(n=n||{},typeof n.baseUrl!="string"&&(n.baseUrl=""),typeof n.isBuild!="boolean"&&(n.isBuild=!1),typeof n.paths!="object"&&(n.paths={}),typeof n.config!="object"&&(n.config={}),typeof n.catchError>"u"&&(n.catchError=!1),typeof n.recordStats>"u"&&(n.recordStats=!1),typeof n.urlArgs!="string"&&(n.urlArgs=""),typeof n.onError!="function"&&(n.onError=c),Array.isArray(n.ignoreDuplicateModules)||(n.ignoreDuplicateModules=[]),n.baseUrl.length>0&&(d.Utilities.endsWith(n.baseUrl,"/")||(n.baseUrl+="/")),typeof n.cspNonce!="string"&&(n.cspNonce=""),typeof n.preferScriptTags>"u"&&(n.preferScriptTags=!1),n.nodeCachedData&&typeof n.nodeCachedData=="object"&&(typeof n.nodeCachedData.seed!="string"&&(n.nodeCachedData.seed="seed"),(typeof n.nodeCachedData.writeDelay!="number"||n.nodeCachedData.writeDelay<0)&&(n.nodeCachedData.writeDelay=1e3*7),!n.nodeCachedData.path||typeof n.nodeCachedData.path!="string")){const a=_(new Error("INVALID cached data configuration, 'path' MUST be set"));a.phase="configuration",n.onError(a),n.nodeCachedData=void 0}return n}static mergeConfigurationOptions(n=null,c=null){let a=d.Utilities.recursiveClone(c||{});return d.Utilities.forEachProperty(n,(t,e)=>{t==="ignoreDuplicateModules"&&typeof a.ignoreDuplicateModules<"u"?a.ignoreDuplicateModules=a.ignoreDuplicateModules.concat(e):t==="paths"&&typeof a.paths<"u"?d.Utilities.forEachProperty(e,(i,s)=>a.paths[i]=s):t==="config"&&typeof a.config<"u"?d.Utilities.forEachProperty(e,(i,s)=>a.config[i]=s):a[t]=d.Utilities.recursiveClone(e)}),v.validateConfigurationOptions(a)}}d.ConfigurationOptionsUtil=v;class f{constructor(n,c){if(this._env=n,this.options=v.mergeConfigurationOptions(c),this._createIgnoreDuplicateModulesMap(),this._createSortedPathsRules(),this.options.baseUrl===""&&this.options.nodeRequire&&this.options.nodeRequire.main&&this.options.nodeRequire.main.filename&&this._env.isNode){let a=this.options.nodeRequire.main.filename,t=Math.max(a.lastIndexOf("/"),a.lastIndexOf("\\"));this.options.baseUrl=a.substring(0,t+1)}}_createIgnoreDuplicateModulesMap(){this.ignoreDuplicateModulesMap={};for(let n=0;n{Array.isArray(c)?this.sortedPathsRules.push({from:n,to:c}):this.sortedPathsRules.push({from:n,to:[c]})}),this.sortedPathsRules.sort((n,c)=>c.from.length-n.from.length)}cloneAndMerge(n){return new f(this._env,v.mergeConfigurationOptions(n,this.options))}getOptionsLiteral(){return this.options}_applyPaths(n){let c;for(let a=0,t=this.sortedPathsRules.length;athis.triggerCallback(i),u=>this.triggerErrorback(i,u))}triggerCallback(e){let i=this._callbackMap[e];delete this._callbackMap[e];for(let s=0;s{e.removeEventListener("load",o),e.removeEventListener("error",u)},o=l=>{r(),i()},u=l=>{r(),s(l)};e.addEventListener("load",o),e.addEventListener("error",u)}load(e,i,s,r){if(/^node\|/.test(i)){let o=e.getConfig().getOptionsLiteral(),u=c(e.getRecorder(),o.nodeRequire||d.global.nodeRequire),l=i.split("|"),g=null;try{g=u(l[1])}catch(p){r(p);return}e.enqueueDefineAnonymousModule([],()=>g),s()}else{let o=document.createElement("script");o.setAttribute("async","async"),o.setAttribute("type","text/javascript"),this.attachListeners(o,s,r);const{trustedTypesPolicy:u}=e.getConfig().getOptionsLiteral();u&&(i=u.createScriptURL(i)),o.setAttribute("src",i);const{cspNonce:l}=e.getConfig().getOptionsLiteral();l&&o.setAttribute("nonce",l),document.getElementsByTagName("head")[0].appendChild(o)}}}function f(t){const{trustedTypesPolicy:e}=t.getConfig().getOptionsLiteral();try{return(e?self.eval(e.createScript("","true")):new Function("true")).call(self),!0}catch{return!1}}class h{constructor(){this._cachedCanUseEval=null}_canUseEval(e){return this._cachedCanUseEval===null&&(this._cachedCanUseEval=f(e)),this._cachedCanUseEval}load(e,i,s,r){if(/^node\|/.test(i)){const o=e.getConfig().getOptionsLiteral(),u=c(e.getRecorder(),o.nodeRequire||d.global.nodeRequire),l=i.split("|");let g=null;try{g=u(l[1])}catch(p){r(p);return}e.enqueueDefineAnonymousModule([],function(){return g}),s()}else{const{trustedTypesPolicy:o}=e.getConfig().getOptionsLiteral();if(!(/^((http:)|(https:)|(file:))/.test(i)&&i.substring(0,self.origin.length)!==self.origin)&&this._canUseEval(e)){fetch(i).then(l=>{if(l.status!==200)throw new Error(l.statusText);return l.text()}).then(l=>{l=`${l} +//# sourceURL=${i}`,(o?self.eval(o.createScript("",l)):new Function(l)).call(self),s()}).then(void 0,r);return}try{o&&(i=o.createScriptURL(i)),importScripts(i),s()}catch(l){r(l)}}}}class n{constructor(e){this._env=e,this._didInitialize=!1,this._didPatchNodeRequire=!1}_init(e){this._didInitialize||(this._didInitialize=!0,this._fs=e("fs"),this._vm=e("vm"),this._path=e("path"),this._crypto=e("crypto"))}_initNodeRequire(e,i){const{nodeCachedData:s}=i.getConfig().getOptionsLiteral();if(!s||this._didPatchNodeRequire)return;this._didPatchNodeRequire=!0;const r=this,o=e("module");function u(l){const g=l.constructor;let p=function(y){try{return l.require(y)}finally{}};return p.resolve=function(y,E){return g._resolveFilename(y,l,!1,E)},p.resolve.paths=function(y){return g._resolveLookupPaths(y,l)},p.main=process.mainModule,p.extensions=g._extensions,p.cache=g._cache,p}o.prototype._compile=function(l,g){const p=o.wrap(l.replace(/^#!.*/,"")),m=i.getRecorder(),y=r._getCachedDataPath(s,g),E={filename:g};let R;try{const x=r._fs.readFileSync(y);R=x.slice(0,16),E.cachedData=x.slice(16),m.record(60,y)}catch{m.record(61,y)}const C=new r._vm.Script(p,E),I=C.runInThisContext(E),w=r._path.dirname(g),b=u(this),U=[this.exports,b,this,g,w,process,_commonjsGlobal,Buffer],P=I.apply(this.exports,U);return r._handleCachedData(C,p,y,!E.cachedData,i),r._verifyCachedData(C,p,y,R,i),P}}load(e,i,s,r){const o=e.getConfig().getOptionsLiteral(),u=c(e.getRecorder(),o.nodeRequire||d.global.nodeRequire),l=o.nodeInstrumenter||function(p){return p};this._init(u),this._initNodeRequire(u,e);let g=e.getRecorder();if(/^node\|/.test(i)){let p=i.split("|"),m=null;try{m=u(p[1])}catch(y){r(y);return}e.enqueueDefineAnonymousModule([],()=>m),s()}else{i=d.Utilities.fileUriToFilePath(this._env.isWindows,i);const p=this._path.normalize(i),m=this._getElectronRendererScriptPathOrUri(p),y=!!o.nodeCachedData,E=y?this._getCachedDataPath(o.nodeCachedData,i):void 0;this._readSourceAndCachedData(p,E,g,(R,C,I,w)=>{if(R){r(R);return}let b;C.charCodeAt(0)===n._BOM?b=n._PREFIX+C.substring(1)+n._SUFFIX:b=n._PREFIX+C+n._SUFFIX,b=l(b,p);const U={filename:m,cachedData:I},P=this._createAndEvalScript(e,b,U,s,r);this._handleCachedData(P,b,E,y&&!I,e),this._verifyCachedData(P,b,E,w,e)})}}_createAndEvalScript(e,i,s,r,o){const u=e.getRecorder();u.record(31,s.filename);const l=new this._vm.Script(i,s),g=l.runInThisContext(s),p=e.getGlobalAMDDefineFunc();let m=!1;const y=function(){return m=!0,p.apply(null,arguments)};return y.amd=p.amd,g.call(d.global,e.getGlobalAMDRequireFunc(),y,s.filename,this._path.dirname(s.filename)),u.record(32,s.filename),m?r():o(new Error(`Didn't receive define call in ${s.filename}!`)),l}_getElectronRendererScriptPathOrUri(e){if(!this._env.isElectronRenderer)return e;let i=e.match(/^([a-z])\:(.*)/i);return i?`file:///${(i[1].toUpperCase()+":"+i[2]).replace(/\\/g,"/")}`:`file://${e}`}_getCachedDataPath(e,i){const s=this._crypto.createHash("md5").update(i,"utf8").update(e.seed,"utf8").update(process.arch,"").digest("hex"),r=this._path.basename(i).replace(/\.js$/,"");return this._path.join(e.path,`${r}-${s}.code`)}_handleCachedData(e,i,s,r,o){e.cachedDataRejected?this._fs.unlink(s,u=>{o.getRecorder().record(62,s),this._createAndWriteCachedData(e,i,s,o),u&&o.getConfig().onError(u)}):r&&this._createAndWriteCachedData(e,i,s,o)}_createAndWriteCachedData(e,i,s,r){let o=Math.ceil(r.getConfig().getOptionsLiteral().nodeCachedData.writeDelay*(1+Math.random())),u=-1,l=0,g;const p=()=>{setTimeout(()=>{g||(g=this._crypto.createHash("md5").update(i,"utf8").digest());const m=e.createCachedData();if(!(m.length===0||m.length===u||l>=5)){if(m.length{y&&r.getConfig().onError(y),r.getRecorder().record(63,s),p()})}},o*Math.pow(4,l++))};p()}_readSourceAndCachedData(e,i,s,r){if(!i)this._fs.readFile(e,{encoding:"utf8"},r);else{let o,u,l,g=2;const p=m=>{m?r(m):--g===0&&r(void 0,o,u,l)};this._fs.readFile(e,{encoding:"utf8"},(m,y)=>{o=y,p(m)}),this._fs.readFile(i,(m,y)=>{!m&&y&&y.length>0?(l=y.slice(0,16),u=y.slice(16),s.record(60,i)):s.record(61,i),p()})}}_verifyCachedData(e,i,s,r,o){r&&(e.cachedDataRejected||setTimeout(()=>{const u=this._crypto.createHash("md5").update(i,"utf8").digest();r.equals(u)||(o.getConfig().onError(new Error(`FAILED TO VERIFY CACHED DATA, deleting stale '${s}' now, but a RESTART IS REQUIRED`)),this._fs.unlink(s,l=>{l&&o.getConfig().onError(l)}))},Math.ceil(5e3*(1+Math.random()))))}}n._BOM=65279,n._PREFIX="(function (require, define, __filename, __dirname) { ",n._SUFFIX=` +});`;function c(t,e){if(e.__$__isRecorded)return e;const i=function(r){t.record(33,r);try{return e(r)}finally{t.record(34,r)}};return i.__$__isRecorded=!0,i}d.ensureRecordedNodeRequire=c;function a(t){return new _(t)}d.createScriptLoader=a})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(d){class _{constructor(t){let e=t.lastIndexOf("/");e!==-1?this.fromModulePath=t.substr(0,e+1):this.fromModulePath=""}static _normalizeModuleId(t){let e=t,i;for(i=/\/\.\//;i.test(e);)e=e.replace(i,"/");for(e=e.replace(/^\.\//g,""),i=/\/(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//;i.test(e);)e=e.replace(i,"/");return e=e.replace(/^(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//,""),e}resolveModule(t){let e=t;return d.Utilities.isAbsolutePath(e)||(d.Utilities.startsWith(e,"./")||d.Utilities.startsWith(e,"../"))&&(e=_._normalizeModuleId(this.fromModulePath+e)),e}}_.ROOT=new _(""),d.ModuleIdResolver=_;class v{constructor(t,e,i,s,r,o){this.id=t,this.strId=e,this.dependencies=i,this._callback=s,this._errorback=r,this.moduleIdResolver=o,this.exports={},this.error=null,this.exportsPassedIn=!1,this.unresolvedDependenciesCount=this.dependencies.length,this._isComplete=!1}static _safeInvokeFunction(t,e){try{return{returnedValue:t.apply(d.global,e),producedError:null}}catch(i){return{returnedValue:null,producedError:i}}}static _invokeFactory(t,e,i,s){return t.shouldInvokeFactory(e)?t.shouldCatchError()?this._safeInvokeFunction(i,s):{returnedValue:i.apply(d.global,s),producedError:null}:{returnedValue:null,producedError:null}}complete(t,e,i,s){this._isComplete=!0;let r=null;if(this._callback)if(typeof this._callback=="function"){t.record(21,this.strId);let o=v._invokeFactory(e,this.strId,this._callback,i);r=o.producedError,t.record(22,this.strId),!r&&typeof o.returnedValue<"u"&&(!this.exportsPassedIn||d.Utilities.isEmpty(this.exports))&&(this.exports=o.returnedValue)}else this.exports=this._callback;if(r){let o=d.ensureError(r);o.phase="factory",o.moduleId=this.strId,o.neededBy=s(this.id),this.error=o,e.onError(o)}this.dependencies=null,this._callback=null,this._errorback=null,this.moduleIdResolver=null}onDependencyError(t){return this._isComplete=!0,this.error=t,this._errorback?(this._errorback(t),!0):!1}isComplete(){return this._isComplete}}d.Module=v;class f{constructor(){this._nextId=0,this._strModuleIdToIntModuleId=new Map,this._intModuleIdToStrModuleId=[],this.getModuleId("exports"),this.getModuleId("module"),this.getModuleId("require")}getMaxModuleId(){return this._nextId}getModuleId(t){let e=this._strModuleIdToIntModuleId.get(t);return typeof e>"u"&&(e=this._nextId++,this._strModuleIdToIntModuleId.set(t,e),this._intModuleIdToStrModuleId[e]=t),e}getStrModuleId(t){return this._intModuleIdToStrModuleId[t]}}class h{constructor(t){this.id=t}}h.EXPORTS=new h(0),h.MODULE=new h(1),h.REQUIRE=new h(2),d.RegularDependency=h;class n{constructor(t,e,i){this.id=t,this.pluginId=e,this.pluginParam=i}}d.PluginDependency=n;class c{constructor(t,e,i,s,r=0){this._env=t,this._scriptLoader=e,this._loaderAvailableTimestamp=r,this._defineFunc=i,this._requireFunc=s,this._moduleIdProvider=new f,this._config=new d.Configuration(this._env),this._hasDependencyCycle=!1,this._modules2=[],this._knownModules2=[],this._inverseDependencies2=[],this._inversePluginDependencies2=new Map,this._currentAnonymousDefineCall=null,this._recorder=null,this._buildInfoPath=[],this._buildInfoDefineStack=[],this._buildInfoDependencies=[],this._requireFunc.moduleManager=this}reset(){return new c(this._env,this._scriptLoader,this._defineFunc,this._requireFunc,this._loaderAvailableTimestamp)}getGlobalAMDDefineFunc(){return this._defineFunc}getGlobalAMDRequireFunc(){return this._requireFunc}static _findRelevantLocationInStack(t,e){let i=o=>o.replace(/\\/g,"/"),s=i(t),r=e.split(/\n/);for(let o=0;othis._moduleIdProvider.getStrModuleId(g.id))),this._resolve(l)}_normalizeDependency(t,e){if(t==="exports")return h.EXPORTS;if(t==="module")return h.MODULE;if(t==="require")return h.REQUIRE;let i=t.indexOf("!");if(i>=0){let s=e.resolveModule(t.substr(0,i)),r=e.resolveModule(t.substr(i+1)),o=this._moduleIdProvider.getModuleId(s+"!"+r),u=this._moduleIdProvider.getModuleId(s);return new n(o,u,r)}return new h(this._moduleIdProvider.getModuleId(e.resolveModule(t)))}_normalizeDependencies(t,e){let i=[],s=0;for(let r=0,o=t.length;rthis._moduleIdProvider.getStrModuleId(o));const r=d.ensureError(e);return r.phase="loading",r.moduleId=i,r.neededBy=s,r}_onLoadError(t,e){const i=this._createLoadError(t,e);this._modules2[t]||(this._modules2[t]=new v(t,this._moduleIdProvider.getStrModuleId(t),[],()=>{},null,null));let s=[];for(let u=0,l=this._moduleIdProvider.getMaxModuleId();u0;){let u=o.shift(),l=this._modules2[u];l&&(r=l.onDependencyError(i)||r);let g=this._inverseDependencies2[u];if(g)for(let p=0,m=g.length;p0;){let u=r.shift().dependencies;if(u)for(let l=0,g=u.length;lthis._relativeRequire(t,i,s,r);return e.toUrl=i=>this._config.requireToUrl(t.resolveModule(i)),e.getStats=()=>this.getLoaderEvents(),e.hasDependencyCycle=()=>this._hasDependencyCycle,e.config=(i,s=!1)=>{this.configure(i,s)},e.__$__nodeRequire=d.global.nodeRequire,e}_loadModule(t){if(this._modules2[t]||this._knownModules2[t])return;this._knownModules2[t]=!0;let e=this._moduleIdProvider.getStrModuleId(t),i=this._config.moduleIdToPaths(e),s=/^@[^\/]+\/[^\/]+$/;this._env.isNode&&(e.indexOf("/")===-1||s.test(e))&&i.push("node|"+e);let r=-1,o=u=>{if(r++,r>=i.length)this._onLoadError(t,u);else{let l=i[r],g=this.getRecorder();if(this._config.isBuild()&&l==="empty:"){this._buildInfoPath[t]=l,this.defineModule(this._moduleIdProvider.getStrModuleId(t),[],null,null,null),this._onLoad(t);return}g.record(10,l),this._scriptLoader.load(this,l,()=>{this._config.isBuild()&&(this._buildInfoPath[t]=l),g.record(11,l),this._onLoad(t)},p=>{g.record(12,l),o(p)})}};o(null)}_loadPluginDependency(t,e){if(this._modules2[e.id]||this._knownModules2[e.id])return;this._knownModules2[e.id]=!0;let i=s=>{this.defineModule(this._moduleIdProvider.getStrModuleId(e.id),[],s,null,null)};i.error=s=>{this._config.onError(this._createLoadError(e.id,s))},t.load(e.pluginParam,this._createRequire(_.ROOT),i,this._config.getOptionsLiteral())}_resolve(t){let e=t.dependencies;if(e)for(let i=0,s=e.length;ithis._moduleIdProvider.getStrModuleId(l)).join(` => +`)),t.unresolvedDependenciesCount--;continue}if(this._inverseDependencies2[r.id]=this._inverseDependencies2[r.id]||[],this._inverseDependencies2[r.id].push(t.id),r instanceof n){let u=this._modules2[r.pluginId];if(u&&u.isComplete()){this._loadPluginDependency(u.exports,r);continue}let l=this._inversePluginDependencies2.get(r.pluginId);l||(l=[],this._inversePluginDependencies2.set(r.pluginId,l)),l.push(r),this._loadModule(r.pluginId);continue}this._loadModule(r.id)}t.unresolvedDependenciesCount===0&&this._onModuleComplete(t)}_onModuleComplete(t){let e=this.getRecorder();if(t.isComplete())return;let i=t.dependencies,s=[];if(i)for(let l=0,g=i.length;lthis._config.getConfigForModule(t.strId)};continue}if(p===h.REQUIRE){s[l]=this._createRequire(t.moduleIdResolver);continue}let m=this._modules2[p.id];if(m){s[l]=m.exports;continue}s[l]=null}const r=l=>(this._inverseDependencies2[l]||[]).map(g=>this._moduleIdProvider.getStrModuleId(g));t.complete(e,this._config,s,r);let o=this._inverseDependencies2[t.id];if(this._inverseDependencies2[t.id]=null,o)for(let l=0,g=o.length;l"u"&&c())})(AMDLoader||(AMDLoader={})),define("vs/css",["require","exports"],function(d,_){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.load=v;function v(a,t,e,i){if(i=i||{},(i["vs/css"]||{}).disabled){e({});return}const r=t.toUrl(a+".css");f(a,r,()=>{e({})},o=>{typeof e.error=="function"&&e.error("Could not find "+r+".")})}function f(a,t,e,i){if(h(a,t)){e();return}n(a,t,e,i)}function h(a,t){const e=window.document.getElementsByTagName("link");for(let i=0,s=e.length;i{t.removeEventListener("load",r),t.removeEventListener("error",o)},r=u=>{s(),e()},o=u=>{s(),i(u)};t.addEventListener("load",r),t.addEventListener("error",o)}}),function(){const d=require.getConfig().baseUrl||"https://main.vscode-cdn.net/insider/336db9ece67f682159078ea1b54212de7636d88a/out";require.config({baseUrl:d,recordStats:!0,paths:{"@microsoft/1ds-core-js":"../node_modules/@microsoft/1ds-core-js/dist/ms.core.min.js","@microsoft/1ds-post-js":"../node_modules/@microsoft/1ds-post-js/dist/ms.post.min.js","@vscode/iconv-lite-umd":"../node_modules/@vscode/iconv-lite-umd/lib/iconv-lite-umd.js","@vscode/tree-sitter-wasm":"../node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter.js","@vscode/vscode-languagedetection":"../node_modules/@vscode/vscode-languagedetection/dist/lib/index.js","@xterm/addon-clipboard":"../node_modules/@xterm/addon-clipboard/lib/addon-clipboard.js","@xterm/addon-image":"../node_modules/@xterm/addon-image/lib/addon-image.js","@xterm/addon-search":"../node_modules/@xterm/addon-search/lib/addon-search.js","@xterm/addon-serialize":"../node_modules/@xterm/addon-serialize/lib/addon-serialize.js","@xterm/addon-unicode11":"../node_modules/@xterm/addon-unicode11/lib/addon-unicode11.js","@xterm/addon-webgl":"../node_modules/@xterm/addon-webgl/lib/addon-webgl.js","@xterm/xterm":"../node_modules/@xterm/xterm/lib/xterm.js",jschardet:"../node_modules/jschardet/dist/jschardet.min.js","tas-client-umd":"../node_modules/tas-client-umd/lib/tas-client-umd.js","vscode-oniguruma":"../node_modules/vscode-oniguruma/release/main.js","vscode-textmate":"../node_modules/vscode-textmate/release/main.js","vscode-regexp-languagedetection":"../node_modules/vscode-regexp-languagedetection/dist/index.js",vsda:"../node_modules/vsda/rust/web/vsda.js","@microsoft/dynamicproto-js":"../node_modules/@microsoft/dynamicproto-js/lib/dist/umd/dynamicproto-js.min.js","@microsoft/applicationinsights-shims":"../node_modules/@microsoft/applicationinsights-shims/dist/umd/applicationinsights-shims.min.js","@microsoft/applicationinsights-core-js":"../node_modules/@microsoft/applicationinsights-core-js/browser/applicationinsights-core-js.min.js"}})}(); + +//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/336db9ece67f682159078ea1b54212de7636d88a/core/vs/loader.js.map diff --git a/build/monaco/monaco.d.ts.recipe b/build/monaco/monaco.d.ts.recipe index a6eb3b7128f..ef5c2e39ae5 100644 --- a/build/monaco/monaco.d.ts.recipe +++ b/build/monaco/monaco.d.ts.recipe @@ -92,7 +92,7 @@ declare namespace monaco.editor { #includeAll(vs/editor/standalone/browser/standaloneEditor;languages.Token=>Token): #include(vs/editor/standalone/common/standaloneTheme): BuiltinTheme, IStandaloneThemeData, IColors #include(vs/editor/common/languages/supports/tokenization): ITokenThemeRule -#include(vs/editor/browser/services/webWorker): MonacoWebWorker, IWebWorkerOptions +#include(vs/editor/standalone/browser/standaloneWebWorker): MonacoWebWorker, IWebWorkerOptions #include(vs/editor/standalone/browser/standaloneCodeEditor): IActionDescriptor, IGlobalEditorOptions, IStandaloneEditorConstructionOptions, IStandaloneDiffEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor export interface ICommandHandler { (...args: any[]): void; diff --git a/build/npm/dirs.js b/build/npm/dirs.js index 60a6609767a..379c81310b5 100644 --- a/build/npm/dirs.js +++ b/build/npm/dirs.js @@ -5,7 +5,7 @@ const fs = require('fs'); -// Complete list of directories where yarn should be executed to install node modules +// Complete list of directories where npm should be executed to install node modules const dirs = [ '', 'build', @@ -30,7 +30,6 @@ const dirs = [ 'extensions/jake', 'extensions/json-language-features', 'extensions/json-language-features/server', - 'extensions/markdown-language-features/server', 'extensions/markdown-language-features', 'extensions/markdown-math', 'extensions/media-preview', @@ -53,6 +52,7 @@ const dirs = [ 'test/integration/browser', 'test/monaco', 'test/smoke', + '.vscode/extensions/vscode-selfhost-import-aid', '.vscode/extensions/vscode-selfhost-test-provider', ]; diff --git a/build/npm/gyp/package-lock.json b/build/npm/gyp/package-lock.json new file mode 100644 index 00000000000..a20d85c70dc --- /dev/null +++ b/build/npm/gyp/package-lock.json @@ -0,0 +1,1321 @@ +{ + "name": "code-oss-dev-build", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "code-oss-dev-build", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "node-gyp": "^10.1.0" + } + }, + "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, + "license": "ISC", + "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/@npmcli/agent": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-2.2.2.tgz", + "integrity": "sha512-OrcNPXdpSl9UX7qPVRWbmWMCSXrcDa2M9DvrbOTj7ao1S4PlqVFYv9/yLKMkrJKZ/V5A/kDBC690or307i26Og==", + "dev": true, + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/fs": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.1.tgz", + "integrity": "sha512-q9CRWjpHCMIh5sVyefoD1cA7PkvILqCZsnSOEUUivORLjxCO/Irmue2DprETiNgEqktDBZaM1Bi+jrarx1XdCg==", + "dev": true, + "license": "ISC", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "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, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/abbrev": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", + "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "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, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/cacache": { + "version": "18.0.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.3.tgz", + "integrity": "sha512-qXCd4rh6I07cnDqh8V48/94Tc/WSfj+o3Gn6NZ0aZovS255bUx8O13uKxRFd2eWG0xgsco7+YItQNPaa5E85hg==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "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, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "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, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-spawn/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "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, + "license": "MIT" + }, + "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==", + "dev": true, + "license": "MIT" + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true, + "license": "MIT" + }, + "node_modules/exponential-backoff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz", + "integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/foreground-child": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", + "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/glob": { + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz", + "integrity": "sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==", + "dev": true, + "license": "ISC", + "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" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true, + "license": "ISC" + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/jackspeak": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", + "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.0.tgz", + "integrity": "sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/make-fetch-happen": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.1.tgz", + "integrity": "sha512-cKTUFc/rbKUd/9meOvgrpJ2WrNzymt6jfRDdwg5UCnVzv9dTpEj9JS5m3wtziXVCjluIXyL8pcaukYqezIzZQA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "proc-log": "^4.2.0", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/proc-log": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.2.0.tgz", + "integrity": "sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-collect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", + "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-fetch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.5.tgz", + "integrity": "sha512-2N8elDQAtSnFV0Dk7gt15KHsS0Fyz6CbYZ360h0WTYV1Ty46li3rAXVOQj1THMNLdmrD9Vt5pBPtWtVkpwGBqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-flush/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-gyp": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-10.1.0.tgz", + "integrity": "sha512-B4J5M1cABxPc5PwfjhbV5hoy2DP9p8lFXASnEN6hugXOa61416tnTZ29x9sSwAd0o99XNIcpvDDy1swAExsVKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "glob": "^10.3.10", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^13.0.0", + "nopt": "^7.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^4.0.0" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/nopt": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz", + "integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==", + "dev": true, + "license": "ISC", + "dependencies": { + "abbrev": "^2.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "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, + "license": "BlueOak-1.0.0" + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "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, + "license": "BlueOak-1.0.0", + "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/proc-log": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", + "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", + "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/ssri": { + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.6.tgz", + "integrity": "sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.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, + "license": "MIT", + "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, + "license": "MIT", + "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/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "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, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/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, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "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, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "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, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "dev": true, + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/unique-filename": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", + "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", + "dev": true, + "license": "ISC", + "dependencies": { + "unique-slug": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/unique-slug": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", + "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "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-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "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, + "license": "MIT", + "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/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, + "license": "MIT" + }, + "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, + "license": "MIT", + "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-cjs/node_modules/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, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + } + } +} diff --git a/build/npm/gyp/package.json b/build/npm/gyp/package.json index 3961e955a5f..a1564133a1e 100644 --- a/build/npm/gyp/package.json +++ b/build/npm/gyp/package.json @@ -4,7 +4,7 @@ "private": true, "license": "MIT", "devDependencies": { - "node-gyp": "^9.4.0" + "node-gyp": "^10.1.0" }, "scripts": {} } diff --git a/build/npm/gyp/yarn.lock b/build/npm/gyp/yarn.lock deleted file mode 100644 index 96d132e7943..00000000000 --- a/build/npm/gyp/yarn.lock +++ /dev/null @@ -1,812 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@isaacs/cliui@^8.0.2": - version "8.0.2" - resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" - integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== - 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" - -"@npmcli/fs@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-3.1.0.tgz#233d43a25a91d68c3a863ba0da6a3f00924a173e" - integrity sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w== - dependencies: - semver "^7.3.5" - -"@pkgjs/parseargs@^0.11.0": - version "0.11.0" - resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" - integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== - -"@tootallnate/once@2": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" - integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== - -abbrev@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -agent-base@6, agent-base@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -agentkeepalive@^4.2.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.3.0.tgz#bb999ff07412653c1803b3ced35e50729830a255" - integrity sha512-7Epl1Blf4Sy37j4v9f9FjICCh4+KAQOyXgHEwlyBiAQLbhKdq/i2QQU3amQalS/wPhdPzDXPL5DMR5bkn+YeWg== - dependencies: - debug "^4.1.0" - depd "^2.0.0" - humanize-ms "^1.2.1" - -aggregate-error@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" - integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== - dependencies: - clean-stack "^2.0.0" - indent-string "^4.0.0" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-regex@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" - integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== - -ansi-styles@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-styles@^6.1.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" - integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== - -"aproba@^1.0.3 || ^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" - integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== - -are-we-there-yet@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz#679df222b278c64f2cdba1175cdc00b0d96164bd" - integrity sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg== - dependencies: - delegates "^1.0.0" - readable-stream "^3.6.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -cacache@^17.0.0: - version "17.1.3" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-17.1.3.tgz#c6ac23bec56516a7c0c52020fd48b4909d7c7044" - integrity sha512-jAdjGxmPxZh0IipMdR7fK/4sDSrHMLUV0+GvVUsjwyGNKHsh79kW/otg+GkbXwl6Uzvy9wsvHOX4nUoWldeZMg== - dependencies: - "@npmcli/fs" "^3.1.0" - fs-minipass "^3.0.0" - glob "^10.2.2" - lru-cache "^7.7.1" - minipass "^5.0.0" - minipass-collect "^1.0.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.4" - p-map "^4.0.0" - ssri "^10.0.0" - tar "^6.1.11" - unique-filename "^3.0.0" - -chownr@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" - integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== - -clean-stack@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" - integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -color-support@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" - integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -console-control-strings@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== - -cross-spawn@^7.0.0: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -debug@4, debug@^4.1.0, debug@^4.3.3: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== - -depd@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -eastasianwidth@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" - integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -emoji-regex@^9.2.2: - version "9.2.2" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" - integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== - -encoding@^0.1.13: - version "0.1.13" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" - integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== - dependencies: - iconv-lite "^0.6.2" - -env-paths@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" - integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== - -err-code@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" - integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== - -exponential-backoff@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6" - integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw== - -foreground-child@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" - integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== - dependencies: - cross-spawn "^7.0.0" - signal-exit "^4.0.1" - -fs-minipass@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" - integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== - dependencies: - minipass "^3.0.0" - -fs-minipass@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-3.0.2.tgz#5b383858efa8c1eb8c33b39e994f7e8555b8b3a3" - integrity sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g== - dependencies: - minipass "^5.0.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -gauge@^4.0.3: - version "4.0.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-4.0.4.tgz#52ff0652f2bbf607a989793d53b751bef2328dce" - integrity sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg== - dependencies: - aproba "^1.0.3 || ^2.0.0" - color-support "^1.1.3" - console-control-strings "^1.1.0" - has-unicode "^2.0.1" - signal-exit "^3.0.7" - string-width "^4.2.3" - strip-ansi "^6.0.1" - wide-align "^1.1.5" - -glob@^10.2.2: - version "10.3.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.3.tgz#8360a4ffdd6ed90df84aa8d52f21f452e86a123b" - integrity sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw== - dependencies: - foreground-child "^3.1.0" - jackspeak "^2.0.3" - minimatch "^9.0.1" - minipass "^5.0.0 || ^6.0.2 || ^7.0.0" - path-scurry "^1.10.1" - -glob@^7.1.3, glob@^7.1.4: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.2.6: - version "4.2.10" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" - integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== - -has-unicode@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== - -http-cache-semantics@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" - integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== - -http-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" - integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== - dependencies: - "@tootallnate/once" "2" - agent-base "6" - debug "4" - -https-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - -humanize-ms@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" - integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== - dependencies: - ms "^2.0.0" - -iconv-lite@^0.6.2: - version "0.6.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== - -indent-string@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" - integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ip@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.1.tgz#e8f3595d33a3ea66490204234b77636965307105" - integrity sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-lambda@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" - integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -jackspeak@^2.0.3: - version "2.2.2" - resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.2.2.tgz#707c62733924b8dc2a0a629dc6248577788b5385" - integrity sha512-mgNtVv4vUuaKA97yxUHoA3+FkuhtxkjdXEWOyB/N76fjy0FjezEt34oy3epBtvCvS+7DyKwqCFWx/oJLV5+kCg== - dependencies: - "@isaacs/cliui" "^8.0.2" - optionalDependencies: - "@pkgjs/parseargs" "^0.11.0" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -lru-cache@^7.7.1: - version "7.18.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" - integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== - -"lru-cache@^9.1.1 || ^10.0.0": - version "10.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.0.tgz#b9e2a6a72a129d81ab317202d93c7691df727e61" - integrity sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw== - -make-fetch-happen@^11.0.3: - version "11.1.1" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-11.1.1.tgz#85ceb98079584a9523d4bf71d32996e7e208549f" - integrity sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w== - dependencies: - agentkeepalive "^4.2.1" - cacache "^17.0.0" - http-cache-semantics "^4.1.1" - http-proxy-agent "^5.0.0" - https-proxy-agent "^5.0.0" - is-lambda "^1.0.1" - lru-cache "^7.7.1" - minipass "^5.0.0" - minipass-fetch "^3.0.0" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.4" - negotiator "^0.6.3" - promise-retry "^2.0.1" - socks-proxy-agent "^7.0.0" - ssri "^10.0.0" - -minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^9.0.1: - version "9.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" - integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== - dependencies: - brace-expansion "^2.0.1" - -minipass-collect@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" - integrity sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA== - dependencies: - minipass "^3.0.0" - -minipass-fetch@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-3.0.3.tgz#d9df70085609864331b533c960fd4ffaa78d15ce" - integrity sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ== - dependencies: - minipass "^5.0.0" - minipass-sized "^1.0.3" - minizlib "^2.1.2" - optionalDependencies: - encoding "^0.1.13" - -minipass-flush@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/minipass-flush/-/minipass-flush-1.0.5.tgz#82e7135d7e89a50ffe64610a787953c4c4cbb373" - integrity sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw== - dependencies: - minipass "^3.0.0" - -minipass-pipeline@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" - integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== - dependencies: - minipass "^3.0.0" - -minipass-sized@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/minipass-sized/-/minipass-sized-1.0.3.tgz#70ee5a7c5052070afacfbc22977ea79def353b70" - integrity sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g== - dependencies: - minipass "^3.0.0" - -minipass@^3.0.0: - version "3.3.6" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" - integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== - dependencies: - yallist "^4.0.0" - -minipass@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" - integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== - -"minipass@^5.0.0 || ^6.0.2 || ^7.0.0": - version "7.0.2" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.2.tgz#58a82b7d81c7010da5bd4b2c0c85ac4b4ec5131e" - integrity sha512-eL79dXrE1q9dBbDCLg7xfn/vl7MS4F1gvJAgjJrQli/jbQWdUttuVawphqpffoIYfRdq78LHx6GP4bU/EQ2ATA== - -minizlib@^2.1.1, minizlib@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" - integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== - dependencies: - minipass "^3.0.0" - yallist "^4.0.0" - -mkdirp@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@^2.0.0: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -negotiator@^0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" - integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== - -node-gyp@^9.4.0: - version "9.4.0" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-9.4.0.tgz#2a7a91c7cba4eccfd95e949369f27c9ba704f369" - integrity sha512-dMXsYP6gc9rRbejLXmTbVRYjAHw7ppswsKyMxuxJxxOHzluIO1rGp9TOQgjFJ+2MCqcOcQTOPB/8Xwhr+7s4Eg== - dependencies: - env-paths "^2.2.0" - exponential-backoff "^3.1.1" - glob "^7.1.4" - graceful-fs "^4.2.6" - make-fetch-happen "^11.0.3" - nopt "^6.0.0" - npmlog "^6.0.0" - rimraf "^3.0.2" - semver "^7.3.5" - tar "^6.1.2" - which "^2.0.2" - -nopt@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-6.0.0.tgz#245801d8ebf409c6df22ab9d95b65e1309cdb16d" - integrity sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g== - dependencies: - abbrev "^1.0.0" - -npmlog@^6.0.0: - version "6.0.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-6.0.2.tgz#c8166017a42f2dea92d6453168dd865186a70830" - integrity sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg== - dependencies: - are-we-there-yet "^3.0.0" - console-control-strings "^1.1.0" - gauge "^4.0.3" - set-blocking "^2.0.0" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -p-map@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" - integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== - dependencies: - aggregate-error "^3.0.0" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-scurry@^1.10.1: - version "1.10.1" - resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698" - integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ== - dependencies: - lru-cache "^9.1.1 || ^10.0.0" - minipass "^5.0.0 || ^6.0.2 || ^7.0.0" - -promise-retry@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22" - integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g== - dependencies: - err-code "^2.0.2" - retry "^0.12.0" - -readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -retry@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" - integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -"safer-buffer@>= 2.1.2 < 3.0.0": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@^7.3.5: - version "7.5.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -signal-exit@^3.0.7: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - -signal-exit@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" - integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== - -smart-buffer@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" - integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== - -socks-proxy-agent@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz#dc069ecf34436621acb41e3efa66ca1b5fed15b6" - integrity sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww== - dependencies: - agent-base "^6.0.2" - debug "^4.3.3" - socks "^2.6.2" - -socks@^2.6.2: - version "2.7.1" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.7.1.tgz#d8e651247178fde79c0663043e07240196857d55" - integrity sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ== - dependencies: - ip "^2.0.0" - smart-buffer "^4.2.0" - -ssri@^10.0.0: - version "10.0.4" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-10.0.4.tgz#5a20af378be586df139ddb2dfb3bf992cf0daba6" - integrity sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ== - dependencies: - minipass "^5.0.0" - -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^5.0.1, string-width@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" - integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== - dependencies: - eastasianwidth "^0.2.0" - emoji-regex "^9.2.2" - strip-ansi "^7.0.1" - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^7.0.1: - version "7.1.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" - integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== - dependencies: - ansi-regex "^6.0.1" - -tar@^6.1.11, tar@^6.1.2: - version "6.2.1" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" - integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A== - dependencies: - chownr "^2.0.0" - fs-minipass "^2.0.0" - minipass "^5.0.0" - minizlib "^2.1.1" - mkdirp "^1.0.3" - yallist "^4.0.0" - -unique-filename@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-3.0.0.tgz#48ba7a5a16849f5080d26c760c86cf5cf05770ea" - integrity sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g== - dependencies: - unique-slug "^4.0.0" - -unique-slug@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-4.0.0.tgz#6bae6bb16be91351badd24cdce741f892a6532e3" - integrity sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ== - dependencies: - imurmurhash "^0.1.4" - -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -which@^2.0.1, which@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" - integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== - dependencies: - string-width "^1.0.2 || 2 || 3 || 4" - -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" - integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== - dependencies: - ansi-styles "^6.1.0" - string-width "^5.0.1" - strip-ansi "^7.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js index bcac781e265..e38c2cb003e 100644 --- a/build/npm/postinstall.js +++ b/build/npm/postinstall.js @@ -8,12 +8,19 @@ const path = require('path'); const os = require('os'); const cp = require('child_process'); const { dirs } = require('./dirs'); -const { setupBuildYarnrc } = require('./setupBuildYarnrc'); -const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn'; +const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'; const root = path.dirname(path.dirname(__dirname)); +function log(dir, message) { + if (process.stdout.isTTY) { + console.log(`\x1b[34m[${dir}]\x1b[0m`, message); + } else { + console.log(`[${dir}]`, message); + } +} + function run(command, args, opts) { - console.log('$ ' + command + ' ' + args.join(' ')); + log(opts.cwd || '.', '$ ' + command + ' ' + args.join(' ')); const result = cp.spawnSync(command, args, opts); @@ -30,7 +37,7 @@ function run(command, args, opts) { * @param {string} dir * @param {*} [opts] */ -function yarnInstall(dir, opts) { +function npmInstall(dir, opts) { opts = { env: { ...process.env }, ...(opts ?? {}), @@ -39,97 +46,95 @@ function yarnInstall(dir, opts) { shell: true }; - const raw = process.env['npm_config_argv'] || '{}'; - const argv = JSON.parse(raw); - const original = argv.original || []; - const args = original.filter(arg => arg === '--ignore-optional' || arg === '--frozen-lockfile' || arg === '--check-files'); - - if (opts.ignoreEngines) { - args.push('--ignore-engines'); - delete opts.ignoreEngines; - } + const command = process.env['npm_command'] || 'install'; if (process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'] && /^(.build\/distro\/npm\/)?remote$/.test(dir)) { const userinfo = os.userInfo(); - console.log(`Installing dependencies in ${dir} inside container ${process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME']}...`); + log(dir, `Installing dependencies inside container ${process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME']}...`); opts.cwd = root; - if (process.env['npm_config_arch'] === 'arm64' || process.env['npm_config_arch'] === 'arm') { + if (process.env['npm_config_arch'] === 'arm64') { run('sudo', ['docker', 'run', '--rm', '--privileged', 'multiarch/qemu-user-static', '--reset', '-p', 'yes'], opts); } - if (process.env['npm_config_arch'] === 'arm') { - run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/home/builduser`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/home/builduser/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts); - } else { - run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/root/vscode`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/root/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts); - } - run('sudo', ['chown', '-R', `${userinfo.uid}:${userinfo.gid}`, `${dir}/node_modules`], opts); + run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/root/vscode`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/root/.netrc`, '-w', path.resolve('/root/vscode', dir), process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'sh', '-c', `\"chown -R root:root ${path.resolve('/root/vscode', dir)} && npm i -g node-gyp-build && npm ci\"`], opts); + run('sudo', ['chown', '-R', `${userinfo.uid}:${userinfo.gid}`, `${path.resolve(root, dir)}`], opts); } else { - console.log(`Installing dependencies in ${dir}...`); - run(yarn, args, opts); + log(dir, 'Installing dependencies...'); + run(npm, [command], opts); } } -for (let dir of dirs) { +function setNpmrcConfig(dir, env) { + const npmrcPath = path.join(root, dir, '.npmrc'); + const lines = fs.readFileSync(npmrcPath, 'utf8').split('\n'); - if (dir === '') { - // `yarn` already executed in root - continue; + for (const line of lines) { + const trimmedLine = line.trim(); + if (trimmedLine && !trimmedLine.startsWith('#')) { + const [key, value] = trimmedLine.split('='); + env[`npm_config_${key}`] = value.replace(/^"(.*)"$/, '$1'); + } } - if (/^.build\/distro\/npm(\/?)/.test(dir)) { - const ossPath = path.relative('.build/distro/npm', dir); - const ossYarnRc = path.join(ossPath, '.yarnrc'); - - if (fs.existsSync(ossYarnRc)) { - fs.cpSync(ossYarnRc, path.join(dir, '.yarnrc')); - } + if (dir === 'build') { + env['npm_config_target'] = process.versions.node; + env['npm_config_arch'] = process.arch; } +} - if (/^(.build\/distro\/npm\/)?remote/.test(dir) && process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64')) { - // windows arm: do not execute `yarn` on remote folder +for (let dir of dirs) { + + if (dir === '') { + // already executed in root continue; } let opts; if (dir === 'build') { - const env = { ...process.env }; - setupBuildYarnrc(); - opts = { env }; - if (process.env['CC']) { env['CC'] = 'gcc'; } - if (process.env['CXX']) { env['CXX'] = 'g++'; } - if (process.env['CXXFLAGS']) { env['CXXFLAGS'] = ''; } - if (process.env['LDFLAGS']) { env['LDFLAGS'] = ''; } - yarnInstall('build', opts); + opts = { + env: { + ...process.env + }, + } + if (process.env['CC']) { opts.env['CC'] = 'gcc'; } + if (process.env['CXX']) { opts.env['CXX'] = 'g++'; } + if (process.env['CXXFLAGS']) { opts.env['CXXFLAGS'] = ''; } + if (process.env['LDFLAGS']) { opts.env['LDFLAGS'] = ''; } + + setNpmrcConfig('build', opts.env); + npmInstall('build', opts); continue; } if (/^(.build\/distro\/npm\/)?remote$/.test(dir)) { // node modules used by vscode server - const env = { ...process.env }; + opts = { + env: { + ...process.env + }, + } if (process.env['VSCODE_REMOTE_CC']) { - env['CC'] = process.env['VSCODE_REMOTE_CC']; + opts.env['CC'] = process.env['VSCODE_REMOTE_CC']; } else { - delete env['CC']; + delete opts.env['CC']; } if (process.env['VSCODE_REMOTE_CXX']) { - env['CXX'] = process.env['VSCODE_REMOTE_CXX']; + opts.env['CXX'] = process.env['VSCODE_REMOTE_CXX']; } else { - delete env['CXX']; + delete opts.env['CXX']; } - if (process.env['CXXFLAGS']) { delete env['CXXFLAGS']; } - if (process.env['CFLAGS']) { delete env['CFLAGS']; } - if (process.env['LDFLAGS']) { delete env['LDFLAGS']; } - if (process.env['VSCODE_REMOTE_CXXFLAGS']) { env['CXXFLAGS'] = process.env['VSCODE_REMOTE_CXXFLAGS']; } - if (process.env['VSCODE_REMOTE_LDFLAGS']) { env['LDFLAGS'] = process.env['VSCODE_REMOTE_LDFLAGS']; } - if (process.env['VSCODE_REMOTE_NODE_GYP']) { env['npm_config_node_gyp'] = process.env['VSCODE_REMOTE_NODE_GYP']; } - - opts = { env }; - } else if (/^extensions\//.test(dir)) { - opts = { ignoreEngines: true }; + if (process.env['CXXFLAGS']) { delete opts.env['CXXFLAGS']; } + if (process.env['CFLAGS']) { delete opts.env['CFLAGS']; } + if (process.env['LDFLAGS']) { delete opts.env['LDFLAGS']; } + if (process.env['VSCODE_REMOTE_CXXFLAGS']) { opts.env['CXXFLAGS'] = process.env['VSCODE_REMOTE_CXXFLAGS']; } + if (process.env['VSCODE_REMOTE_LDFLAGS']) { opts.env['LDFLAGS'] = process.env['VSCODE_REMOTE_LDFLAGS']; } + if (process.env['VSCODE_REMOTE_NODE_GYP']) { opts.env['npm_config_node_gyp'] = process.env['VSCODE_REMOTE_NODE_GYP']; } + + setNpmrcConfig('remote', opts.env); } - yarnInstall(dir, opts); + npmInstall(dir, opts); } cp.execSync('git config pull.rebase merges'); diff --git a/build/npm/preinstall.js b/build/npm/preinstall.js index fdb01f579d6..b98f22977bf 100644 --- a/build/npm/preinstall.js +++ b/build/npm/preinstall.js @@ -2,7 +2,6 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -let err = false; const nodeVersion = /^(\d+)\.(\d+)\.(\d+)/.exec(process.versions.node); const majorNodeVersion = parseInt(nodeVersion[1]); @@ -12,48 +11,25 @@ const patchNodeVersion = parseInt(nodeVersion[3]); if (!process.env['VSCODE_SKIP_NODE_VERSION_CHECK']) { if (majorNodeVersion < 20) { console.error('\x1b[1;31m*** Please use latest Node.js v20 LTS for development.\x1b[0;0m'); - err = true; + throw new Error(); } } +if (process.env['npm_execpath'].includes('yarn')) { + console.error('\x1b[1;31m*** Seems like you are using `yarn` which is not supported in this repo any more, please use `npm i` instead. ***\x1b[0;0m'); + throw new Error(); +} + const path = require('path'); const fs = require('fs'); const cp = require('child_process'); -const yarnVersion = cp.execSync('yarn -v', { encoding: 'utf8' }).trim(); -const parsedYarnVersion = /^(\d+)\.(\d+)\.(\d+)/.exec(yarnVersion); -const majorYarnVersion = parseInt(parsedYarnVersion[1]); -const minorYarnVersion = parseInt(parsedYarnVersion[2]); -const patchYarnVersion = parseInt(parsedYarnVersion[3]); - -if ( - majorYarnVersion < 1 || - majorYarnVersion === 1 && ( - minorYarnVersion < 10 || (minorYarnVersion === 10 && patchYarnVersion < 1) - ) || - majorYarnVersion >= 2 -) { - console.error('\x1b[1;31m*** Please use yarn >=1.10.1 and <2.\x1b[0;0m'); - err = true; -} - -if (!/yarn[\w-.]*\.c?js$|yarnpkg$/.test(process.env['npm_execpath'])) { - console.error('\x1b[1;31m*** Please use yarn to install dependencies.\x1b[0;0m'); - err = true; -} if (process.platform === 'win32') { if (!hasSupportedVisualStudioVersion()) { console.error('\x1b[1;31m*** Invalid C/C++ Compiler Toolchain. Please check https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites.\x1b[0;0m'); - err = true; - } - if (!err) { - installHeaders(); + throw new Error(); } -} - -if (err) { - console.error(''); - process.exit(1); + installHeaders(); } function hasSupportedVisualStudioVersion() { @@ -73,9 +49,9 @@ function hasSupportedVisualStudioVersion() { const programFiles86Path = process.env['ProgramFiles(x86)']; const programFiles64Path = process.env['ProgramFiles']; + const vsTypes = ['Enterprise', 'Professional', 'Community', 'Preview', 'BuildTools', 'IntPreview']; if (programFiles64Path) { vsPath = `${programFiles64Path}/Microsoft Visual Studio/${version}`; - const vsTypes = ['Enterprise', 'Professional', 'Community', 'Preview', 'BuildTools']; if (vsTypes.some(vsType => fs.existsSync(path.join(vsPath, vsType)))) { availableVersions.push(version); break; @@ -84,7 +60,6 @@ function hasSupportedVisualStudioVersion() { if (programFiles86Path) { vsPath = `${programFiles86Path}/Microsoft Visual Studio/${version}`; - const vsTypes = ['Enterprise', 'Professional', 'Community', 'Preview', 'BuildTools']; if (vsTypes.some(vsType => fs.existsSync(path.join(vsPath, vsType)))) { availableVersions.push(version); break; @@ -95,47 +70,28 @@ function hasSupportedVisualStudioVersion() { } function installHeaders() { - const yarn = 'yarn.cmd'; - const yarnResult = cp.spawnSync(yarn, ['install'], { + cp.execSync(`npm.cmd ${process.env['npm_command'] || 'ci'}`, { env: process.env, cwd: path.join(__dirname, 'gyp'), - stdio: 'inherit', - shell: true + stdio: 'inherit' }); - if (yarnResult.error || yarnResult.status !== 0) { - console.error(`Installing node-gyp failed`); - err = true; - return; - } - // The node gyp package got installed using the above yarn command using the gyp/package.json + // The node gyp package got installed using the above npm command using the gyp/package.json // file checked into our repository. So from that point it is save to construct the path // to that executable const node_gyp = path.join(__dirname, 'gyp', 'node_modules', '.bin', 'node-gyp.cmd'); const result = cp.execFileSync(node_gyp, ['list'], { encoding: 'utf8', shell: true }); const versions = new Set(result.split(/\n/g).filter(line => !line.startsWith('gyp info')).map(value => value)); - const local = getHeaderInfo(path.join(__dirname, '..', '..', '.yarnrc')); - const remote = getHeaderInfo(path.join(__dirname, '..', '..', 'remote', '.yarnrc')); + const local = getHeaderInfo(path.join(__dirname, '..', '..', '.npmrc')); + const remote = getHeaderInfo(path.join(__dirname, '..', '..', 'remote', '.npmrc')); if (local !== undefined && !versions.has(local.target)) { // Both disturl and target come from a file checked into our repository cp.execFileSync(node_gyp, ['install', '--dist-url', local.disturl, local.target], { shell: true }); } - // Avoid downloading headers for Windows arm64 till we move to Nodejs v19 in remote - // which is the first official release with support for the architecture. Downloading - // the headers for older versions now redirect to https://origin.nodejs.org/404.html - // which causes checksum validation error in node-gyp. - // - // gyp http 200 https://origin.nodejs.org/404.html - // gyp WARN install got an error, rolling back install - // gyp ERR! install error - // gyp ERR! stack Error: win-arm64/node.lib local checksum 4c62bed7a032f7b36984321b7ffdd60b596fac870672037ff879ae9ac9548fb7 not match remote undefined - // - if (remote !== undefined && !versions.has(remote.target) && - process.env['npm_config_arch'] !== "arm64" && - process.arch !== "arm64") { + if (remote !== undefined && !versions.has(remote.target)) { // Both disturl and target come from a file checked into our repository cp.execFileSync(node_gyp, ['install', '--dist-url', remote.disturl, remote.target], { shell: true }); } @@ -149,11 +105,11 @@ function getHeaderInfo(rcFile) { const lines = fs.readFileSync(rcFile, 'utf8').split(/\r\n?/g); let disturl, target; for (const line of lines) { - let match = line.match(/\s*disturl\s*\"(.*)\"\s*$/); + let match = line.match(/\s*disturl=*\"(.*)\"\s*$/); if (match !== null && match.length >= 1) { disturl = match[1]; } - match = line.match(/\s*target\s*\"(.*)\"\s*$/); + match = line.match(/\s*target=*\"(.*)\"\s*$/); if (match !== null && match.length >= 1) { target = match[1]; } diff --git a/build/npm/setupBuildYarnrc.js b/build/npm/setupBuildYarnrc.js deleted file mode 100644 index f8027dcfcb0..00000000000 --- a/build/npm/setupBuildYarnrc.js +++ /dev/null @@ -1,25 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const path = require('path'); -const fs = require('fs'); - -// make sure we install the deps of build for the system installed -// node, since that is the driver of gulp -function setupBuildYarnrc() { - const yarnrcPath = path.join(path.dirname(__dirname), '.yarnrc'); - const yarnrc = `disturl "https://nodejs.org/download/release" -target "${process.versions.node}" -runtime "node" -arch "${process.arch}"`; - - fs.writeFileSync(yarnrcPath, yarnrc, 'utf8'); -} - -exports.setupBuildYarnrc = setupBuildYarnrc; - -if (require.main === module) { - setupBuildYarnrc(); -} diff --git a/build/npm/update-all-grammars.mjs b/build/npm/update-all-grammars.mjs index e0d34e42beb..7e303a655f7 100644 --- a/build/npm/update-all-grammars.mjs +++ b/build/npm/update-all-grammars.mjs @@ -16,7 +16,7 @@ async function spawn(cmd, args, opts) { } async function main() { - await spawn('yarn', [], { cwd: 'extensions' }); + await spawn('npm', ['ci'], { cwd: 'extensions' }); for (const extension of readdirSync('extensions')) { try { diff --git a/build/package-lock.json b/build/package-lock.json new file mode 100644 index 00000000000..4499f7cf541 --- /dev/null +++ b/build/package-lock.json @@ -0,0 +1,4630 @@ +{ + "name": "code-oss-dev-build", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "code-oss-dev-build", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@azure/cosmos": "^3", + "@azure/identity": "^4.2.1", + "@azure/storage-blob": "^12.17.0", + "@electron/get": "^2.0.0", + "@types/ansi-colors": "^3.2.0", + "@types/byline": "^4.2.32", + "@types/debounce": "^1.0.0", + "@types/debug": "^4.1.5", + "@types/fancy-log": "^1.3.0", + "@types/fs-extra": "^9.0.12", + "@types/glob": "^7.1.1", + "@types/gulp": "^4.0.17", + "@types/gulp-concat": "^0.0.32", + "@types/gulp-filter": "^3.0.32", + "@types/gulp-gzip": "^0.0.31", + "@types/gulp-json-editor": "^2.2.31", + "@types/gulp-rename": "^0.0.33", + "@types/gulp-sort": "^2.0.4", + "@types/gulp-sourcemaps": "^0.0.32", + "@types/mime": "0.0.29", + "@types/minimatch": "^3.0.3", + "@types/minimist": "^1.2.1", + "@types/mocha": "^9.1.1", + "@types/node": "20.x", + "@types/pump": "^1.0.1", + "@types/rimraf": "^2.0.4", + "@types/through": "^0.0.29", + "@types/through2": "^2.0.36", + "@types/tmp": "^0.2.1", + "@types/workerpool": "^6.4.0", + "@types/xml2js": "0.0.33", + "@vscode/iconv-lite-umd": "0.7.0", + "@vscode/vsce": "2.20.1", + "byline": "^5.0.0", + "colors": "^1.4.0", + "commander": "^7.0.0", + "debug": "^4.3.2", + "electron-osx-sign": "^0.4.16", + "esbuild": "0.23.0", + "extract-zip": "^2.0.1", + "gulp-merge-json": "^2.1.1", + "gulp-sort": "^2.0.0", + "jsonc-parser": "^2.3.0", + "mime": "^1.4.1", + "source-map": "0.6.1", + "ternary-stream": "^3.0.0", + "through2": "^4.0.2", + "tmp": "^0.2.1", + "vscode-universal-bundler": "^0.1.3", + "workerpool": "^6.4.0", + "yauzl": "^2.10.0" + }, + "optionalDependencies": { + "tree-sitter": "^0.20.5", + "tree-sitter-typescript": "^0.20.5", + "vscode-gulp-watch": "^5.0.3" + } + }, + "node_modules/@azure/abort-controller": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.2.tgz", + "integrity": "sha512-XUyTo+bcyxHEf+jlN2MXA7YU9nxVehaubngHV1MIZZaqYmZqykkoeAz/JMMEeR7t3TcyDwbFa3Zw8BZywmIx4g==", + "dev": true, + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@azure/core-asynciterator-polyfill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz", + "integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==", + "dev": true + }, + "node_modules/@azure/core-auth": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.5.0.tgz", + "integrity": "sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-util": "^1.1.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@azure/core-client": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.5.0.tgz", + "integrity": "sha512-YNk8i9LT6YcFdFO+RRU0E4Ef+A8Y5lhXo6lz61rwbG8Uo7kSqh0YqK04OexiilM43xd6n3Y9yBhLnb1NFNI9dA==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-asynciterator-polyfill": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.5.0", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/logger": "^1.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-client/node_modules/@azure/core-tracing": { + "version": "1.0.0-preview.13", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", + "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.1", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-http": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-3.0.4.tgz", + "integrity": "sha512-Fok9VVhMdxAFOtqiiAtg74fL0UJkt0z3D+ouUUxcRLzZNBioPRAMJFVxiWoJljYpXsRi4GDQHzQHDc9AiYaIUQ==", + "deprecated": "deprecating as we migrated to core v2", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/core-util": "^1.1.1", + "@azure/logger": "^1.0.0", + "@types/node-fetch": "^2.5.0", + "@types/tunnel": "^0.0.3", + "form-data": "^4.0.0", + "node-fetch": "^2.6.7", + "process": "^0.11.10", + "tslib": "^2.2.0", + "tunnel": "^0.0.6", + "uuid": "^8.3.0", + "xml2js": "^0.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@azure/core-http/node_modules/@azure/core-tracing": { + "version": "1.0.0-preview.13", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", + "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.1", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-lro": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.1.tgz", + "integrity": "sha512-HE6PBl+mlKa0eBsLwusHqAqjLc5n9ByxeDo3Hz4kF3B1hqHvRkBr4oMgoT6tX7Hc3q97KfDctDUon7EhvoeHPA==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/logger": "^1.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-lro/node_modules/@azure/core-tracing": { + "version": "1.0.0-preview.13", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", + "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.1", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-paging": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.1.3.tgz", + "integrity": "sha512-his7Ah40ThEYORSpIAwuh6B8wkGwO/zG7gqVtmSE4WAJ46e36zUDXTKReUCLBDc6HmjjApQQxxcRFy5FruG79A==", + "dev": true, + "dependencies": { + "@azure/core-asynciterator-polyfill": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@azure/core-rest-pipeline": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.7.0.tgz", + "integrity": "sha512-e2awPzwMKHrmvYgZ0qIKNkqnCM1QoDs7A0rOiS3OSAlOQOz/kL7PPKHXwFMuBeaRvS8i7fgobJn79q2Cji5f+Q==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/logger": "^1.0.0", + "form-data": "^4.0.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "tslib": "^2.2.0", + "uuid": "^8.3.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-rest-pipeline/node_modules/@azure/core-tracing": { + "version": "1.0.0-preview.13", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", + "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.1", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-tracing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz", + "integrity": "sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==", + "dev": true, + "dependencies": { + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-util": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.9.0.tgz", + "integrity": "sha512-AfalUQ1ZppaKuxPPMsFEUdX6GZPB3d9paR9d/TTL7Ow2De8cJaC7ibi7kWVlFAVPCYo31OcnGymc0R89DX8Oaw==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-util/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/cosmos": { + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-3.17.3.tgz", + "integrity": "sha512-wBglkQ6Irjv5Vo2iw8fd6eYj60WYRSSg4/0DBkeOP6BwQ4RA91znsOHd6s3qG6UAbNgYuzC9Nnq07vlFFZkHEw==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.2.0", + "@azure/core-tracing": "^1.0.0", + "debug": "^4.1.1", + "fast-json-stable-stringify": "^2.1.0", + "jsbi": "^3.1.3", + "node-abort-controller": "^3.0.0", + "priorityqueuejs": "^1.0.0", + "semaphore": "^1.0.5", + "tslib": "^2.2.0", + "universal-user-agent": "^6.0.0", + "uuid": "^8.3.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@azure/identity": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.2.1.tgz", + "integrity": "sha512-U8hsyC9YPcEIzoaObJlRDvp7KiF0MGS7xcWbyJSVvXRkC/HXo1f0oYeBYmEvVgRfacw7GHf6D6yAoh9JHz6A5Q==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-auth": "^1.5.0", + "@azure/core-client": "^1.4.0", + "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.3.0", + "@azure/logger": "^1.0.0", + "@azure/msal-browser": "^3.11.1", + "@azure/msal-node": "^2.9.2", + "events": "^3.0.0", + "jws": "^4.0.0", + "open": "^8.0.0", + "stoppable": "^1.1.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/logger": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.1.tgz", + "integrity": "sha512-QYQeaJ+A5x6aMNu8BG5qdsVBnYBop9UMwgUvGihSjf1PdZZXB+c/oMdM2ajKwzobLBh9e9QuMQkN9iL+IxLBLA==", + "dev": true, + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@azure/msal-browser": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.17.0.tgz", + "integrity": "sha512-csccKXmW2z7EkZ0I3yAoW/offQt+JECdTIV/KrnRoZyM7wCSsQWODpwod8ZhYy7iOyamcHApR9uCh0oD1M+0/A==", + "dev": true, + "dependencies": { + "@azure/msal-common": "14.12.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@azure/msal-common": { + "version": "14.12.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.12.0.tgz", + "integrity": "sha512-IDDXmzfdwmDkv4SSmMEyAniJf6fDu3FJ7ncOjlxkDuT85uSnLEhZi3fGZpoR7T4XZpOMx9teM9GXBgrfJgyeBw==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@azure/msal-node": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.9.2.tgz", + "integrity": "sha512-8tvi6Cos3m+0KmRbPjgkySXi+UQU/QiuVRFnrxIwt5xZlEEFa69O04RTaNESGgImyBBlYbo2mfE8/U8Bbdk1WQ==", + "dev": true, + "dependencies": { + "@azure/msal-common": "14.12.0", + "jsonwebtoken": "^9.0.0", + "uuid": "^8.3.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@azure/storage-blob": { + "version": "12.17.0", + "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.17.0.tgz", + "integrity": "sha512-sM4vpsCpcCApagRW5UIjQNlNylo02my2opgp0Emi8x888hZUvJ3dN69Oq20cEGXkMUWnoCrBaB0zyS3yeB87sQ==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-http": "^3.0.0", + "@azure/core-lro": "^2.2.0", + "@azure/core-paging": "^1.1.1", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/logger": "^1.0.0", + "events": "^3.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@azure/storage-blob/node_modules/@azure/core-tracing": { + "version": "1.0.0-preview.13", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", + "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.1", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@electron/asar": { + "version": "3.2.10", + "resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.10.tgz", + "integrity": "sha512-mvBSwIBUeiRscrCeJE1LwctAriBj65eUDm0Pc11iE5gRwzkmsdbS7FnZ1XUWjpSeQWL1L5g12Fc/SchPM9DUOw==", + "dev": true, + "dependencies": { + "commander": "^5.0.0", + "glob": "^7.1.6", + "minimatch": "^3.0.4" + }, + "bin": { + "asar": "bin/asar.js" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/@electron/asar/node_modules/commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@electron/get": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.3.tgz", + "integrity": "sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "env-paths": "^2.2.0", + "fs-extra": "^8.1.0", + "got": "^11.8.5", + "progress": "^2.0.3", + "semver": "^6.2.0", + "sumchecker": "^3.0.1" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "global-agent": "^3.0.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz", + "integrity": "sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.0.tgz", + "integrity": "sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.0.tgz", + "integrity": "sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.0.tgz", + "integrity": "sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.0.tgz", + "integrity": "sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.0.tgz", + "integrity": "sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.0.tgz", + "integrity": "sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.0.tgz", + "integrity": "sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.0.tgz", + "integrity": "sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.0.tgz", + "integrity": "sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.0.tgz", + "integrity": "sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.0.tgz", + "integrity": "sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.0.tgz", + "integrity": "sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.0.tgz", + "integrity": "sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.0.tgz", + "integrity": "sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.0.tgz", + "integrity": "sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.0.tgz", + "integrity": "sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.0.tgz", + "integrity": "sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.0.tgz", + "integrity": "sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.0.tgz", + "integrity": "sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.0.tgz", + "integrity": "sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.0.tgz", + "integrity": "sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.0.tgz", + "integrity": "sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.0.tgz", + "integrity": "sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@malept/cross-spawn-promise": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@malept/cross-spawn-promise/-/cross-spawn-promise-2.0.0.tgz", + "integrity": "sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/malept" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/subscription/pkg/npm-.malept-cross-spawn-promise?utm_medium=referral&utm_source=npm_fund" + } + ], + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "engines": { + "node": ">= 12.13.0" + } + }, + "node_modules/@opentelemetry/api": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.3.tgz", + "integrity": "sha512-puWxACExDe9nxbBB3lOymQFrLYml2dVOrd7USiVRnSbgXE+KwBu+HxFvxrzfqsiSda9IWsXJG1ef7C1O2/GmKQ==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@szmarczak/http-timer": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "dev": true, + "dependencies": { + "defer-to-connect": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/ansi-colors": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@types/ansi-colors/-/ansi-colors-3.2.0.tgz", + "integrity": "sha512-0caWAhXht9N2lOdMzJLXybsSkYCx1QOdxx6pae48tswI9QV3DFX26AoOpy0JxwhCb+zISTqmd6H8t9Zby9BoZg==", + "dev": true + }, + "node_modules/@types/byline": { + "version": "4.2.32", + "resolved": "https://registry.npmjs.org/@types/byline/-/byline-4.2.32.tgz", + "integrity": "sha512-qtlm/J6XOO9p+Ep/ZB5+mCFEDhzWDDHWU4a1eReN7lkPZXW9rkloq2jcAhvKKmlO5tL2GSvKROb+PTsNVhBiyQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cacheable-request": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", + "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", + "dev": true, + "dependencies": { + "@types/http-cache-semantics": "*", + "@types/keyv": "^3.1.4", + "@types/node": "*", + "@types/responselike": "^1.0.0" + } + }, + "node_modules/@types/debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/debounce/-/debounce-1.0.0.tgz", + "integrity": "sha1-QXVgIAMx4buE1y2oU5EQLC/NYbc= sha512-B7FcD9ry40L831t7iuHQyDfYi+qVEV75qkEI2ROOyfjb2PfkAspL+NK6B2A0BceMuNhiYRmtKTNnNP7Ul4N2Pg==", + "dev": true + }, + "node_modules/@types/debug": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz", + "integrity": "sha512-8Hz50m2eoS56ldRlepxSBa6PWEVCtzUo/92HgLc2qTMnotJNIm7xP+UZhyWoYsyOdd5dxZ+NZLb24rsKyFs2ow==", + "dev": true, + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/events": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", + "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==", + "dev": true + }, + "node_modules/@types/expect": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", + "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", + "dev": true + }, + "node_modules/@types/fancy-log": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@types/fancy-log/-/fancy-log-1.3.0.tgz", + "integrity": "sha512-mQjDxyOM1Cpocd+vm1kZBP7smwKZ4TNokFeds9LV7OZibmPJFEzY3+xZMrKfUdNT71lv8GoCPD6upKwHxubClw==", + "dev": true + }, + "node_modules/@types/fs-extra": { + "version": "9.0.12", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.12.tgz", + "integrity": "sha512-I+bsBr67CurCGnSenZZ7v94gd3tc3+Aj2taxMT4yu4ABLuOgOjeFxX3dokG24ztSRg5tnT00sL8BszO7gSMoIw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "dependencies": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@types/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha512-RHv6ZQjcTncXo3thYZrsbAVwoy4vSKosSWhuhuQxLOTv74OJuFQxXkmUuZCr3q9uNBEVCvIzmZL/FeRNbHZGUg==", + "dev": true, + "dependencies": { + "@types/glob": "*", + "@types/node": "*" + } + }, + "node_modules/@types/gulp": { + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/@types/gulp/-/gulp-4.0.17.tgz", + "integrity": "sha512-+pKQynu2C/HS16kgmDlAicjtFYP8kaa86eE9P0Ae7GB5W29we/E2TIdbOWtEZD5XkpY+jr8fyqfwO6SWZecLpQ==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/undertaker": ">=1.2.6", + "@types/vinyl-fs": "*", + "chokidar": "^3.3.1" + } + }, + "node_modules/@types/gulp-concat": { + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/@types/gulp-concat/-/gulp-concat-0.0.32.tgz", + "integrity": "sha512-CUCFADlITzzBfBa2bdGzhKtvBr4eFh+evb+4igVbvPoO5RyPfHifmyQlZl6lM7q19+OKncRlFXDU7B4X9Ayo2g==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/gulp-filter": { + "version": "3.0.32", + "resolved": "https://registry.npmjs.org/@types/gulp-filter/-/gulp-filter-3.0.32.tgz", + "integrity": "sha512-JvY4qTxXehoK2yCUxYVxTMvckVbDM5TWHWeUoYJyX31gwFqw4YDD6JNzhuTxI3yHPUTY4BBRTqgm6puQEZVCNg==", + "dev": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*", + "@types/vinyl": "*" + } + }, + "node_modules/@types/gulp-gzip": { + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/@types/gulp-gzip/-/gulp-gzip-0.0.31.tgz", + "integrity": "sha512-KQjHz1FTqLse8/EiktfhN/vo33vamX4gVAQhMTp55STDBA7UToW5CJqYyP7iRorkHK9/aJ2nL2hLkNZkY4M8+w==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/gulp-json-editor": { + "version": "2.2.31", + "resolved": "https://registry.npmjs.org/@types/gulp-json-editor/-/gulp-json-editor-2.2.31.tgz", + "integrity": "sha512-piis0ImYAy0dt18R4EtTbAY+RV8jwTq5VisnUV6OfP8kD4743aHGkAdAd08No4NY3rFa5mD6ytIu8L0YU7nL9w==", + "dev": true, + "dependencies": { + "@types/js-beautify": "*", + "@types/node": "*" + } + }, + "node_modules/@types/gulp-rename": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/gulp-rename/-/gulp-rename-0.0.33.tgz", + "integrity": "sha512-FIZQvbZJj6V1gHPTzO+g/BCWpDur7fJrroae4gwV3LaoHBQ+MrR9sB+2HssK8fHv4WdY6hVNxkcft9bYatuPIA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/gulp-sort": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/gulp-sort/-/gulp-sort-2.0.4.tgz", + "integrity": "sha512-HUHxH+oMox1ct0SnxPqCXBni0MSws1ygcSAoLO4ISRmR/UuvNIz40rgNveZxwxQk+p78kw09z/qKQkgKJmNUOQ==", + "dev": true, + "dependencies": { + "@types/gulp-util": "*", + "@types/node": "*" + } + }, + "node_modules/@types/gulp-sourcemaps": { + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/@types/gulp-sourcemaps/-/gulp-sourcemaps-0.0.32.tgz", + "integrity": "sha512-+7BAmptW2bxyJnJcCEuie7vLoop3FwWgCdBMzyv7MYXED/HeNMeQuX7uPCkp4vfU1TTu4CYFH0IckNPvo0VePA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/gulp-util": { + "version": "3.0.41", + "resolved": "https://registry.npmjs.org/@types/gulp-util/-/gulp-util-3.0.41.tgz", + "integrity": "sha512-BK0kJZ8euQNlISsmD6mBr/1RZkB0mljdtBsz2usv+QHPV10alH2AJw5p05S9LU6S+VdTjbFmGU0OxpH++2W9/Q==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/through2": "*", + "@types/vinyl": "*", + "chalk": "^2.2.0" + } + }, + "node_modules/@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", + "dev": true + }, + "node_modules/@types/js-beautify": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@types/js-beautify/-/js-beautify-1.8.0.tgz", + "integrity": "sha512-/siF86XrwDKLuHe8l7h6NhrAWgLdgqbxmjZv9NvGWmgYRZoTipkjKiWb0SQHy/jcR+ee0GvbG6uGd+LEBMGNvA==", + "dev": true + }, + "node_modules/@types/keyv": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", + "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/mime": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-0.0.29.tgz", + "integrity": "sha1-+8/TMFc7kS71nu7hRgK/rOYwdUs= sha512-EqWQSlonwbNgLMq2dMkokuzv/pwevb4q0JrPjfc7zzieG/cpqt+HsCE9dYoQd1snp2zlksl6k3rQ4LLfyQbQdA==", + "dev": true + }, + "node_modules/@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "node_modules/@types/minimist": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", + "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==", + "dev": true + }, + "node_modules/@types/mocha": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", + "dev": true + }, + "node_modules/@types/ms": { + "version": "0.7.32", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.32.tgz", + "integrity": "sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.8.tgz", + "integrity": "sha512-fbjI6ja0N5ZA8TV53RUqzsKNkl9fv8Oj3T7zxW7FGv1GSH7gwJaNF8dzCjrqKaxKeUpTz4yT1DaJFq/omNpGfw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "form-data": "^3.0.0" + } + }, + "node_modules/@types/node-fetch/node_modules/form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/pump": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/pump/-/pump-1.0.1.tgz", + "integrity": "sha1-roFXzv7wTRpNJMHMkdQDwvXaXNA= sha512-WGcg4jdczx60mEh0pWLUhw/2215BFYfSob5fHp/fJFZ+UFOiOxIqCnqRGSLWRsJ6Hvh4u2SBokxHDQ0wF9ujqQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/responselike": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", + "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/rimraf": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-2.0.4.tgz", + "integrity": "sha512-8gBudvllD2A/c0CcEX/BivIDorHFt5UI5m46TsNj8DjWCCTTZT74kEe4g+QsY7P/B9WdO98d82zZgXO/RQzu2Q==", + "dev": true, + "dependencies": { + "@types/glob": "*", + "@types/node": "*" + } + }, + "node_modules/@types/through": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.29.tgz", + "integrity": "sha512-9a7C5VHh+1BKblaYiq+7Tfc+EOmjMdZaD1MYtkQjSoxgB69tBjW98ry6SKsi4zEIWztLOMRuL87A3bdT/Fc/4w==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/through2": { + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/@types/through2/-/through2-2.0.36.tgz", + "integrity": "sha512-vuifQksQHJXhV9McpVsXKuhnf3lsoX70PnhcqIAbs9dqLH2NgrGz0DzZPDY3+Yh6eaRqcE1gnCQ6QhBn1/PT5A==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@types/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-7cTXwKP/HLOPVgjg+YhBdQ7bMiobGMuoBmrGmqwIWJv8elC6t1DfVc/mn4fD9UE1IjhwmhaQ5pGVXkmXbH0rhg==", + "dev": true + }, + "node_modules/@types/tunnel": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz", + "integrity": "sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/undertaker": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@types/undertaker/-/undertaker-1.2.11.tgz", + "integrity": "sha512-j1Z0V2ByRHr8ZK7eOeGq0LGkkdthNFW0uAZGY22iRkNQNL9/vAV0yFPr1QN3FM/peY5bxs9P+1f0PYJTQVa5iA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/undertaker-registry": "*", + "async-done": "~1.3.2" + } + }, + "node_modules/@types/undertaker-registry": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "integrity": "sha512-Z4TYuEKn9+RbNVk1Ll2SS4x1JeLHecolIbM/a8gveaHsW0Hr+RQMraZACwTO2VD7JvepgA6UO1A1VrbktQrIbQ==", + "dev": true + }, + "node_modules/@types/vinyl": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.12.tgz", + "integrity": "sha512-Sr2fYMBUVGYq8kj3UthXFAu5UN6ZW+rYr4NACjZQJvHvj+c8lYv0CahmZ2P/r7iUkN44gGUBwqxZkrKXYPb7cw==", + "dev": true, + "dependencies": { + "@types/expect": "^1.20.4", + "@types/node": "*" + } + }, + "node_modules/@types/vinyl-fs": { + "version": "2.4.9", + "resolved": "https://registry.npmjs.org/@types/vinyl-fs/-/vinyl-fs-2.4.9.tgz", + "integrity": "sha512-Q0EXd6c1fORjiOuK4ZaKdfFcMyFzJlTi56dqktwaWVLIDAzE49wUs3bKnYbZwzyMWoH+NcMWnRuR73S9A0jnRA==", + "dev": true, + "dependencies": { + "@types/events": "*", + "@types/glob-stream": "*", + "@types/node": "*", + "@types/vinyl": "*" + } + }, + "node_modules/@types/workerpool": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@types/workerpool/-/workerpool-6.4.0.tgz", + "integrity": "sha512-SIF2/169pDsLKeM8GQGHkOFifGalDbZgiBSaLUnnlVSRsAOenkAvQ6h4uhV2W+PZZczS+8LQxACwNkSykdT91A==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/xml2js": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.0.33.tgz", + "integrity": "sha1-IMXdZGAkUoTWSlVpABW5XkCft94= sha512-6dx6V6EdddqLjhxGdQrNdSu+O+3F7tOlyj660SpkO4/5uDSZM+LXcGQKAFnIJbvTzkQ6d2g3rWxyEXVwYAUoJg==", + "dev": true + }, + "node_modules/@types/yauzl": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.2.tgz", + "integrity": "sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==", + "dev": true, + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@vscode/iconv-lite-umd": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz", + "integrity": "sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg==", + "dev": true + }, + "node_modules/@vscode/vsce": { + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.20.1.tgz", + "integrity": "sha512-ilbvoqvR/1/zseRPBAzYR6aKqSJ+jvda4/BqIwOqTxajpvLtEpK3kMLs77+dJdrlygS+VrP7Yhad8j0ukyD96g==", + "dev": true, + "dependencies": { + "azure-devops-node-api": "^11.0.1", + "chalk": "^2.4.2", + "cheerio": "^1.0.0-rc.9", + "commander": "^6.1.0", + "glob": "^7.0.6", + "hosted-git-info": "^4.0.2", + "jsonc-parser": "^3.2.0", + "leven": "^3.1.0", + "markdown-it": "^12.3.2", + "mime": "^1.3.4", + "minimatch": "^3.0.3", + "parse-semver": "^1.1.1", + "read": "^1.0.7", + "semver": "^7.5.2", + "tmp": "^0.2.1", + "typed-rest-client": "^1.8.4", + "url-join": "^4.0.1", + "xml2js": "^0.5.0", + "yauzl": "^2.3.1", + "yazl": "^2.2.2" + }, + "bin": { + "vsce": "vsce" + }, + "engines": { + "node": ">= 14" + }, + "optionalDependencies": { + "keytar": "^7.7.0" + } + }, + "node_modules/@vscode/vsce/node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@vscode/vsce/node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "dev": true + }, + "node_modules/@vscode/vsce/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@xmldom/xmldom": { + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz", + "integrity": "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/ansi-colors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", + "devOptional": true, + "dependencies": { + "ansi-wrap": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE= sha512-HrgGIZUl8h2EHuZaU9hTR/cU5nhKxpVE1V6kdGsQ8e4zirElJ5fvtfc8N7Q1oq1aatO275i8pUFUCpNWCAnVWw==", + "optional": true, + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768= sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw==", + "devOptional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "devOptional": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", + "devOptional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "devOptional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", + "devOptional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/async-done": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^2.0.0", + "stream-exhaust": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k= sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/azure-devops-node-api": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-11.2.0.tgz", + "integrity": "sha512-XdiGPhrpaT5J8wdERRKs5g8E0Zy1pvOYTli7z9E8nmOn3YGp4FhtjhrOyFmX/8veWCwdI69mCHKJw6l+4J/bHA==", + "dev": true, + "dependencies": { + "tunnel": "0.0.6", + "typed-rest-client": "^1.8.4" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "devOptional": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "devOptional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "optional": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, + "node_modules/boolean": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.1.2.tgz", + "integrity": "sha512-YN6UmV0FfLlBVvRvNPx3pz5W/mUoYB24J4WSXOKP/OOJpi+Oq6WYqPaNTHzjI0QzwWtnvEd5CGYyQPgp1jFxnw==", + "dev": true, + "optional": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "devOptional": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true, + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-alloc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "dev": true, + "dependencies": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "node_modules/buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "dev": true + }, + "node_modules/buffer-fill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw= sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==", + "dev": true + }, + "node_modules/byline": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", + "integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cacheable-lookup": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", + "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", + "dev": true, + "engines": { + "node": ">=10.6.0" + } + }, + "node_modules/cacheable-request": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", + "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", + "dev": true, + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^4.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "dev": true, + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" + }, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/chokidar": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", + "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "devOptional": true, + "dependencies": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.1" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "optional": true + }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "devOptional": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg= sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g==", + "devOptional": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + } + }, + "node_modules/clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag==", + "devOptional": true + }, + "node_modules/cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "devOptional": true, + "dependencies": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "node_modules/cloneable-readable/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "devOptional": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "optional": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.0.0.tgz", + "integrity": "sha512-ovx/7NkTrnPuIV8sqk/GjUIIM1+iUQeqA3ye2VNpq9sVoiZsooObWlQy+OPWGI17GDaEoybuAGJm6U8yC077BA==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/compare-version": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/compare-version/-/compare-version-0.1.2.tgz", + "integrity": "sha1-AWLsLZNR9d3VmpICy6k1NmpyUIA= sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "devOptional": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "devOptional": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "devOptional": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "optional": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "optional": true, + "dependencies": { + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk= sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-node": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", + "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", + "dev": true, + "optional": true + }, + "node_modules/dir-compare": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dir-compare/-/dir-compare-4.2.0.tgz", + "integrity": "sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==", + "dev": true, + "dependencies": { + "minimatch": "^3.0.5", + "p-limit": "^3.1.0 " + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", + "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.1" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/duplexify": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", + "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/electron-osx-sign": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.16.tgz", + "integrity": "sha512-ziMWfc3NmQlwnWLW6EaZq8nH2BWVng/atX5GWsGwhexJYpdW6hsg//MkAfRTRx1kR3Veiqkeiog1ibkbA4x0rg==", + "deprecated": "Please use @electron/osx-sign moving forward. Be aware the API is slightly different", + "dev": true, + "dependencies": { + "bluebird": "^3.5.0", + "compare-version": "^0.1.2", + "debug": "^2.6.8", + "isbinaryfile": "^3.0.2", + "minimist": "^1.2.0", + "plist": "^3.0.1" + }, + "bin": { + "electron-osx-flat": "bin/electron-osx-flat.js", + "electron-osx-sign": "bin/electron-osx-sign.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/electron-osx-sign/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/electron-osx-sign/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "devOptional": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/entities": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", + "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true, + "optional": true + }, + "node_modules/esbuild": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz", + "integrity": "sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.0", + "@esbuild/android-arm": "0.23.0", + "@esbuild/android-arm64": "0.23.0", + "@esbuild/android-x64": "0.23.0", + "@esbuild/darwin-arm64": "0.23.0", + "@esbuild/darwin-x64": "0.23.0", + "@esbuild/freebsd-arm64": "0.23.0", + "@esbuild/freebsd-x64": "0.23.0", + "@esbuild/linux-arm": "0.23.0", + "@esbuild/linux-arm64": "0.23.0", + "@esbuild/linux-ia32": "0.23.0", + "@esbuild/linux-loong64": "0.23.0", + "@esbuild/linux-mips64el": "0.23.0", + "@esbuild/linux-ppc64": "0.23.0", + "@esbuild/linux-riscv64": "0.23.0", + "@esbuild/linux-s390x": "0.23.0", + "@esbuild/linux-x64": "0.23.0", + "@esbuild/netbsd-x64": "0.23.0", + "@esbuild/openbsd-arm64": "0.23.0", + "@esbuild/openbsd-x64": "0.23.0", + "@esbuild/sunos-x64": "0.23.0", + "@esbuild/win32-arm64": "0.23.0", + "@esbuild/win32-ia32": "0.23.0", + "@esbuild/win32-x64": "0.23.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/events": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", + "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "devOptional": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/fancy-log": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", + "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", + "optional": true, + "dependencies": { + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "parse-node-version": "^1.0.0", + "time-stamp": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "devOptional": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/first-chunk-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", + "integrity": "sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA= sha512-X8Z+b/0L4lToKYq+lwnKqi9X/Zek0NibLpsJgVsSxpoYq7JtiCtRb5HqKVEjEw/qAb/4AKKRLOwwKHlWNpm2Eg==", + "optional": true, + "dependencies": { + "readable-stream": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/first-chunk-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "optional": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/fork-stream": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/fork-stream/-/fork-stream-0.0.4.tgz", + "integrity": "sha512-Pqq5NnT78ehvUnAk/We/Jr22vSvanRlFTpAmQ88xBY/M1TlHe+P0ILuEyXS595ysdGfaj22634LBkGMA2GTcpA==", + "dev": true + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "optional": true + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8= sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4= sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "optional": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "devOptional": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", + "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", + "dev": true, + "optional": true, + "dependencies": { + "boolean": "^3.0.1", + "es6-error": "^4.1.1", + "matcher": "^3.0.0", + "roarr": "^2.15.3", + "semver": "^7.3.2", + "serialize-error": "^7.0.1" + }, + "engines": { + "node": ">=10.0" + } + }, + "node_modules/global-agent/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "optional": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/globalthis": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.2.tgz", + "integrity": "sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ==", + "dev": true, + "optional": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/got": { + "version": "11.8.6", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", + "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^4.0.0", + "@szmarczak/http-timer": "^4.0.5", + "@types/cacheable-request": "^6.0.1", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^5.0.3", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "http2-wrapper": "^1.0.0-beta.5.2", + "lowercase-keys": "^2.0.0", + "p-cancelable": "^2.0.0", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=10.19.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", + "devOptional": true + }, + "node_modules/gulp-merge-json": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/gulp-merge-json/-/gulp-merge-json-2.1.1.tgz", + "integrity": "sha512-VhvAlcf+dcCb94j/2yDPWxJ3X7x4P/Xwcrv1dhjYuRgvADwFJmaQwl4zbuq+GDZvzMacbVncWtEdsETpUSkhYw==", + "dev": true, + "dependencies": { + "json5": "^2.1.3", + "lodash.mergewith": "^4.6.1", + "plugin-error": "^1.0.1", + "through": "^2.3.8", + "vinyl": "^2.1.0" + } + }, + "node_modules/gulp-sort": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/gulp-sort/-/gulp-sort-2.0.0.tgz", + "integrity": "sha512-MyTel3FXOdh1qhw1yKhpimQrAmur9q1X0ZigLmCOxouQD+BD3za9/89O+HfbgBQvvh4igEbp0/PUWO+VqGYG1g==", + "dev": true, + "dependencies": { + "through2": "^2.0.1" + } + }, + "node_modules/gulp-sort/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/gulp-sort/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0= sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/htmlparser2": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz", + "integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "entities": "^4.3.0" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http2-wrapper": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", + "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "dev": true, + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.0.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "devOptional": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "optional": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "devOptional": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "devOptional": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "devOptional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "devOptional": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "devOptional": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "devOptional": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", + "optional": true + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "devOptional": true + }, + "node_modules/isbinaryfile": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.3.tgz", + "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==", + "dev": true, + "dependencies": { + "buffer-alloc": "^1.2.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8= sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "devOptional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jsbi": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-3.1.4.tgz", + "integrity": "sha512-52QRRFSsi9impURE8ZUbzAMCLjPm4THO7H2fcuIvaaeFTbSysvkodbQQXIVsNgq/ypDbq6dJiuGKL0vZ/i9hUg==", + "dev": true + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true, + "optional": true + }, + "node_modules/json5": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.2.tgz", + "integrity": "sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonc-parser": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.0.tgz", + "integrity": "sha512-b0EBt8SWFNnixVdvoR2ZtEGa9ZqLhbJnOjezn+WP+8kspFm+PFYDN8Z4Bc7pRlDjvuVcADSUkroIuTWWn/YiIA==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", + "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==", + "dev": true, + "dependencies": { + "jws": "^3.2.2", + "lodash": "^4.17.21", + "ms": "^2.1.1", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dev": true, + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jsonwebtoken/node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dev": true, + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jsonwebtoken/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "dev": true, + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "dev": true, + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/keytar": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/keytar/-/keytar-7.9.0.tgz", + "integrity": "sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "node-addon-api": "^4.3.0", + "prebuild-install": "^7.0.1" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dev": true, + "dependencies": { + "uc.micro": "^1.0.1" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", + "dev": true + }, + "node_modules/lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "devOptional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/markdown-it/node_modules/entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "dev": true, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/matcher": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", + "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", + "dev": true, + "optional": true, + "dependencies": { + "escape-string-regexp": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/matcher/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "optional": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", + "dev": true + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.28", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", + "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", + "dev": true, + "dependencies": { + "mime-db": "1.45.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "devOptional": true + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "optional": true + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "node_modules/nan": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.19.0.tgz", + "integrity": "sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==", + "optional": true + }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "optional": true + }, + "node_modules/node-abi": { + "version": "3.30.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.30.0.tgz", + "integrity": "sha512-qWO5l3SCqbwQavymOmtTVuCWZE23++S+rxyoHjXqUmPyzRcaoI4lA2gO55/drddGnedAyjA7sk76SfQ5lfUMnw==", + "optional": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-abi/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "optional": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-abort-controller": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", + "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", + "dev": true + }, + "node_modules/node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", + "dev": true, + "optional": true + }, + "node_modules/node-fetch": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz", + "integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "devOptional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-url": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E= sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "devOptional": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/open": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", + "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", + "dev": true, + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-cancelable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", + "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "optional": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/parse-semver": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/parse-semver/-/parse-semver-1.1.1.tgz", + "integrity": "sha512-Eg1OuNntBMH0ojvEKSrvDSnwLmvVuUOSdylH/pSCPNMIspLlweJyIWXCE+k/5hm3cj/EBUYwmWkjhBALNP4LXQ==", + "dev": true, + "dependencies": { + "semver": "^5.1.0" + } + }, + "node_modules/parse-semver/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "dev": true, + "dependencies": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18= sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA= sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "devOptional": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/plist": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz", + "integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==", + "dev": true, + "dependencies": { + "@xmldom/xmldom": "^0.8.8", + "base64-js": "^1.5.1", + "xmlbuilder": "^15.1.1" + }, + "engines": { + "node": ">=10.4.0" + } + }, + "node_modules/plugin-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz", + "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==", + "devOptional": true, + "dependencies": { + "ansi-colors": "^1.0.1", + "arr-diff": "^4.0.0", + "arr-union": "^3.1.0", + "extend-shallow": "^3.0.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/prebuild-install": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/priorityqueuejs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/priorityqueuejs/-/priorityqueuejs-1.0.0.tgz", + "integrity": "sha1-LuTyPCVgkT4IwHzlzN1t498sWvg= sha512-lg++21mreCEOuGWTbO5DnJKAdxfjrdN0S9ysoW9SzdSJvbkWpkaDdpG/cdsPCsEnoLUwmd9m3WcZhngW7yKA2g==", + "dev": true + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI= sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "devOptional": true + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "devOptional": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "optional": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==", + "dev": true, + "dependencies": { + "mute-stream": "~0.0.4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "devOptional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "devOptional": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8= sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==", + "devOptional": true + }, + "node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "devOptional": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "dev": true + }, + "node_modules/responselike": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", + "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", + "dev": true, + "dependencies": { + "lowercase-keys": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/roarr": { + "version": "2.15.4", + "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", + "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", + "dev": true, + "optional": true, + "dependencies": { + "boolean": "^3.0.1", + "detect-node": "^2.0.4", + "globalthis": "^1.0.1", + "json-stringify-safe": "^5.0.1", + "semver-compare": "^1.0.0", + "sprintf-js": "^1.1.2" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "devOptional": true + }, + "node_modules/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "node_modules/semaphore": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", + "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w= sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", + "dev": true, + "optional": true + }, + "node_modules/serialize-error": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", + "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", + "dev": true, + "optional": true, + "dependencies": { + "type-fest": "^0.13.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true, + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", + "dev": true, + "optional": true + }, + "node_modules/stoppable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", + "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", + "dev": true, + "engines": { + "node": ">=4", + "npm": ">=6" + } + }, + "node_modules/stream-exhaust": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", + "dev": true + }, + "node_modules/stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "devOptional": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", + "optional": true, + "dependencies": { + "is-utf8": "^0.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-bom-buf": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz", + "integrity": "sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI= sha512-1sUIL1jck0T1mhOLP2c696BIznzT525Lkub+n4jjMHjhjhoAQA6Ye659DxdlZBr0aLDMQoTxKIpnlqxgtwjsuQ==", + "optional": true, + "dependencies": { + "is-utf8": "^0.2.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-bom-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz", + "integrity": "sha1-+H217yYT9paKpUWr/h7HKLaoKco= sha512-yH0+mD8oahBZWnY43vxs4pSinn8SMKAdml/EOGBewoe1Y0Eitd0h2Mg3ZRiXruUW6L4P+lvZiEgbh0NgUGia1w==", + "optional": true, + "dependencies": { + "first-chunk-stream": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo= sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sumchecker": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", + "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", + "dev": true, + "dependencies": { + "debug": "^4.1.0" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "optional": true, + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "optional": true, + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ternary-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ternary-stream/-/ternary-stream-3.0.0.tgz", + "integrity": "sha512-oIzdi+UL/JdktkT+7KU5tSIQjj8pbShj3OASuvDEhm0NT5lppsm7aXWAmAq4/QMaBIyfuEcNLbAQA+HpaISobQ==", + "dev": true, + "dependencies": { + "duplexify": "^4.1.1", + "fork-stream": "^0.0.4", + "merge-stream": "^2.0.0", + "through2": "^3.0.1" + } + }, + "node_modules/ternary-stream/node_modules/through2": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "2 || 3" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true + }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "dependencies": { + "readable-stream": "3" + } + }, + "node_modules/time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= sha512-gLCeArryy2yNTRzTGKbZbloctj64jkZ57hj5zdraXue6aFgd6PmvVtEyiUU+hvU0v7q08oVv8r8ev0tRo6bvgw==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tmp": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "dev": true, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "devOptional": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/tree-sitter": { + "version": "0.20.6", + "resolved": "https://registry.npmjs.org/tree-sitter/-/tree-sitter-0.20.6.tgz", + "integrity": "sha512-GxJodajVpfgb3UREzzIbtA1hyRnTxVbWVXrbC6sk4xTMH5ERMBJk9HJNq4c8jOJeUaIOmLcwg+t6mez/PDvGqg==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "nan": "^2.18.0", + "prebuild-install": "^7.1.1" + } + }, + "node_modules/tree-sitter-typescript": { + "version": "0.20.5", + "resolved": "https://registry.npmjs.org/tree-sitter-typescript/-/tree-sitter-typescript-0.20.5.tgz", + "integrity": "sha512-RzK/Pc6k4GiXvInIBlo8ZggekP6rODfW2P6KHFCTSUHENsw6ynh+iacFhfkJRa4MT8EIN2WHygFJ7076/+eHKg==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "nan": "^2.18.0", + "tree-sitter": "^0.20.6" + } + }, + "node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "dev": true + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "optional": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-rest-client": { + "version": "1.8.11", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.11.tgz", + "integrity": "sha512-5UvfMpd1oelmUPRbbaVnq+rHP7ng2cE4qoQkQeAqxRL6PklkxsM0g32/HL0yfvruK6ojQ5x8EE+HF4YV6DtuCA==", + "dev": true, + "dependencies": { + "qs": "^6.9.1", + "tunnel": "0.0.6", + "underscore": "^1.12.1" + } + }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, + "node_modules/underscore": { + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", + "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==", + "dev": true + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/url-join": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", + "dev": true + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "devOptional": true + }, + "node_modules/uuid": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.1.tgz", + "integrity": "sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "devOptional": true, + "dependencies": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-file": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/vinyl-file/-/vinyl-file-3.0.0.tgz", + "integrity": "sha1-sQTZ5ECf+jJfqt1SBkLQo7SIs2U= sha512-BoJDj+ca3D9xOuPEM6RWVtWQtvEPQiQYn82LvdxhLWplfQsBzBqtgK0yhCP0s1BNTi6dH9BO+dzybvyQIacifg==", + "optional": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "pify": "^2.3.0", + "strip-bom-buf": "^1.0.0", + "strip-bom-stream": "^2.0.0", + "vinyl": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/vscode-gulp-watch": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/vscode-gulp-watch/-/vscode-gulp-watch-5.0.3.tgz", + "integrity": "sha512-MTUp2yLE9CshhkNSNV58EQNxQSeF8lIj3mkXZX9a1vAk+EQNM2PAYdPUDSd/P/08W3PMHGznEiZyfK7JAjLosg==", + "optional": true, + "dependencies": { + "ansi-colors": "4.1.1", + "anymatch": "^3.1.1", + "chokidar": "3.5.1", + "fancy-log": "^1.3.3", + "glob-parent": "^5.1.1", + "normalize-path": "^3.0.0", + "object-assign": "^4.1.1", + "plugin-error": "1.0.1", + "readable-stream": "^3.6.0", + "vinyl": "^2.2.0", + "vinyl-file": "^3.0.0" + } + }, + "node_modules/vscode-gulp-watch/node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/vscode-universal-bundler": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/vscode-universal-bundler/-/vscode-universal-bundler-0.1.3.tgz", + "integrity": "sha512-USXJqgD+ySROqgjl+KrGjlF7MvNnqsI6my1kUOsAXARmNqBjXk38w8g2BF6PEXVOYOQ+npRcTA7athXNU4Jjog==", + "dev": true, + "dependencies": { + "@electron/asar": "^3.2.7", + "@malept/cross-spawn-promise": "^2.0.0", + "debug": "^4.3.1", + "dir-compare": "^4.2.0", + "fs-extra": "^11.1.1", + "minimatch": "^9.0.3", + "plist": "^3.1.0" + }, + "engines": { + "node": ">=16.4" + } + }, + "node_modules/vscode-universal-bundler/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/vscode-universal-bundler/node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/vscode-universal-bundler/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/vscode-universal-bundler/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/vscode-universal-bundler/node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0= sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/workerpool": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.0.tgz", + "integrity": "sha512-r64Ea3glXY2RVzMeNxB+4J+0YHAVzUdV4cM5nHi4BBC2LvnO1pWFAIYKYuGcPElbg1/7eEiaPtZ/jzCjIUuGBg==", + "dev": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "devOptional": true + }, + "node_modules/xml2js": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", + "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", + "dev": true, + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xml2js/node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/xmlbuilder": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", + "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", + "dev": true, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "devOptional": true + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/yazl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", + "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/build/package.json b/build/package.json index 0bbeed3f136..7017b9144e0 100644 --- a/build/package.json +++ b/build/package.json @@ -20,11 +20,11 @@ "@types/gulp-gzip": "^0.0.31", "@types/gulp-json-editor": "^2.2.31", "@types/gulp-rename": "^0.0.33", + "@types/gulp-sort": "^2.0.4", "@types/gulp-sourcemaps": "^0.0.32", "@types/mime": "0.0.29", "@types/minimatch": "^3.0.3", "@types/minimist": "^1.2.1", - "@types/mkdirp": "^1.0.1", "@types/mocha": "^9.1.1", "@types/node": "20.x", "@types/pump": "^1.0.1", @@ -35,26 +35,27 @@ "@types/workerpool": "^6.4.0", "@types/xml2js": "0.0.33", "@vscode/iconv-lite-umd": "0.7.0", - "@vscode/vsce": "^2.16.0", + "@vscode/vsce": "2.20.1", "byline": "^5.0.0", "colors": "^1.4.0", "commander": "^7.0.0", "debug": "^4.3.2", "electron-osx-sign": "^0.4.16", - "esbuild": "0.20.0", + "esbuild": "0.23.0", "extract-zip": "^2.0.1", "gulp-merge-json": "^2.1.1", + "gulp-sort": "^2.0.0", "jsonc-parser": "^2.3.0", "mime": "^1.4.1", - "mkdirp": "^1.0.4", "source-map": "0.6.1", "ternary-stream": "^3.0.0", "through2": "^4.0.2", "tmp": "^0.2.1", - "vscode-universal-bundler": "^0.0.2", + "vscode-universal-bundler": "^0.1.3", "workerpool": "^6.4.0", "yauzl": "^2.10.0" }, + "type": "commonjs", "scripts": { "compile": "../node_modules/.bin/tsc -p tsconfig.build.json", "watch": "../node_modules/.bin/tsc -p tsconfig.build.json --watch", diff --git a/build/setup-npm-registry.js b/build/setup-npm-registry.js index 98bc836b072..24c850dbb84 100644 --- a/build/setup-npm-registry.js +++ b/build/setup-npm-registry.js @@ -8,7 +8,7 @@ const fs = require('fs').promises; const path = require('path'); -async function* getYarnLockFiles(dir) { +async function* getPackageLockFiles(dir) { const files = await fs.readdir(dir); for (const file of files) { @@ -16,8 +16,8 @@ async function* getYarnLockFiles(dir) { const stat = await fs.stat(fullPath); if (stat.isDirectory()) { - yield* getYarnLockFiles(fullPath); - } else if (file === 'yarn.lock') { + yield* getPackageLockFiles(fullPath); + } else if (file === 'package-lock.json') { yield fullPath; } } @@ -32,7 +32,7 @@ async function setup(url, file) { async function main(url, dir) { const root = dir ?? process.cwd(); - for await (const file of getYarnLockFiles(root)) { + for await (const file of getPackageLockFiles(root)) { console.log(`Enabling custom NPM registry: ${path.relative(root, file)}`); await setup(url, file); } diff --git a/build/yarn.lock b/build/yarn.lock deleted file mode 100644 index d0c7960a11e..00000000000 --- a/build/yarn.lock +++ /dev/null @@ -1,2758 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@azure/abort-controller@^1.0.0": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@azure/abort-controller/-/abort-controller-1.0.2.tgz#822405c966b2aec16fb62c1b19d37eaccf231995" - integrity sha512-XUyTo+bcyxHEf+jlN2MXA7YU9nxVehaubngHV1MIZZaqYmZqykkoeAz/JMMEeR7t3TcyDwbFa3Zw8BZywmIx4g== - dependencies: - tslib "^2.0.0" - -"@azure/abort-controller@^2.0.0": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@azure/abort-controller/-/abort-controller-2.1.2.tgz#42fe0ccab23841d9905812c58f1082d27784566d" - integrity sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA== - dependencies: - tslib "^2.6.2" - -"@azure/core-asynciterator-polyfill@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz#dcccebb88406e5c76e0e1d52e8cc4c43a68b3ee7" - integrity sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg== - -"@azure/core-auth@^1.3.0", "@azure/core-auth@^1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@azure/core-auth/-/core-auth-1.5.0.tgz#a41848c5c31cb3b7c84c409885267d55a2c92e44" - integrity sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw== - dependencies: - "@azure/abort-controller" "^1.0.0" - "@azure/core-util" "^1.1.0" - tslib "^2.2.0" - -"@azure/core-client@^1.4.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@azure/core-client/-/core-client-1.5.0.tgz#7aabb87d20e08db3683a117191c844bc19adb74e" - integrity sha512-YNk8i9LT6YcFdFO+RRU0E4Ef+A8Y5lhXo6lz61rwbG8Uo7kSqh0YqK04OexiilM43xd6n3Y9yBhLnb1NFNI9dA== - dependencies: - "@azure/abort-controller" "^1.0.0" - "@azure/core-asynciterator-polyfill" "^1.0.0" - "@azure/core-auth" "^1.3.0" - "@azure/core-rest-pipeline" "^1.5.0" - "@azure/core-tracing" "1.0.0-preview.13" - "@azure/logger" "^1.0.0" - tslib "^2.2.0" - -"@azure/core-http@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@azure/core-http/-/core-http-3.0.0.tgz#345845f9ba479a5ee41efc3fd7a13e82d2a0ec47" - integrity sha512-BxI2SlGFPPz6J1XyZNIVUf0QZLBKFX+ViFjKOkzqD18J1zOINIQ8JSBKKr+i+v8+MB6LacL6Nn/sP/TE13+s2Q== - dependencies: - "@azure/abort-controller" "^1.0.0" - "@azure/core-auth" "^1.3.0" - "@azure/core-tracing" "1.0.0-preview.13" - "@azure/core-util" "^1.1.1" - "@azure/logger" "^1.0.0" - "@types/node-fetch" "^2.5.0" - "@types/tunnel" "^0.0.3" - form-data "^4.0.0" - node-fetch "^2.6.7" - process "^0.11.10" - tslib "^2.2.0" - tunnel "^0.0.6" - uuid "^8.3.0" - xml2js "^0.4.19" - -"@azure/core-lro@^2.2.0": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@azure/core-lro/-/core-lro-2.2.1.tgz#5527b41037c658d3aefc19d68633e51e53d6e6a3" - integrity sha512-HE6PBl+mlKa0eBsLwusHqAqjLc5n9ByxeDo3Hz4kF3B1hqHvRkBr4oMgoT6tX7Hc3q97KfDctDUon7EhvoeHPA== - dependencies: - "@azure/abort-controller" "^1.0.0" - "@azure/core-tracing" "1.0.0-preview.13" - "@azure/logger" "^1.0.0" - tslib "^2.2.0" - -"@azure/core-paging@^1.1.1": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@azure/core-paging/-/core-paging-1.1.3.tgz#3587c9898a0530cacb64bab216d7318468aa5efc" - integrity sha512-his7Ah40ThEYORSpIAwuh6B8wkGwO/zG7gqVtmSE4WAJ46e36zUDXTKReUCLBDc6HmjjApQQxxcRFy5FruG79A== - dependencies: - "@azure/core-asynciterator-polyfill" "^1.0.0" - -"@azure/core-rest-pipeline@^1.1.0", "@azure/core-rest-pipeline@^1.2.0", "@azure/core-rest-pipeline@^1.5.0": - version "1.7.0" - resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.7.0.tgz#71f42c19af160422cc84513809ff9668d8047087" - integrity sha512-e2awPzwMKHrmvYgZ0qIKNkqnCM1QoDs7A0rOiS3OSAlOQOz/kL7PPKHXwFMuBeaRvS8i7fgobJn79q2Cji5f+Q== - dependencies: - "@azure/abort-controller" "^1.0.0" - "@azure/core-auth" "^1.3.0" - "@azure/core-tracing" "1.0.0-preview.13" - "@azure/logger" "^1.0.0" - form-data "^4.0.0" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - tslib "^2.2.0" - uuid "^8.3.0" - -"@azure/core-tracing@1.0.0-preview.13": - version "1.0.0-preview.13" - resolved "https://registry.yarnpkg.com/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz#55883d40ae2042f6f1e12b17dd0c0d34c536d644" - integrity sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ== - dependencies: - "@opentelemetry/api" "^1.0.1" - tslib "^2.2.0" - -"@azure/core-tracing@^1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@azure/core-tracing/-/core-tracing-1.0.1.tgz#352a38cbea438c4a83c86b314f48017d70ba9503" - integrity sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw== - dependencies: - tslib "^2.2.0" - -"@azure/core-util@^1.1.0", "@azure/core-util@^1.1.1", "@azure/core-util@^1.3.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.9.0.tgz#469afd7e6452d5388b189f90d33f7756b0b210d1" - integrity sha512-AfalUQ1ZppaKuxPPMsFEUdX6GZPB3d9paR9d/TTL7Ow2De8cJaC7ibi7kWVlFAVPCYo31OcnGymc0R89DX8Oaw== - dependencies: - "@azure/abort-controller" "^2.0.0" - tslib "^2.6.2" - -"@azure/cosmos@^3": - version "3.17.3" - resolved "https://registry.yarnpkg.com/@azure/cosmos/-/cosmos-3.17.3.tgz#380398496af8ef3473ae0a9ad8cdbab32d91eb08" - integrity sha512-wBglkQ6Irjv5Vo2iw8fd6eYj60WYRSSg4/0DBkeOP6BwQ4RA91znsOHd6s3qG6UAbNgYuzC9Nnq07vlFFZkHEw== - dependencies: - "@azure/abort-controller" "^1.0.0" - "@azure/core-auth" "^1.3.0" - "@azure/core-rest-pipeline" "^1.2.0" - "@azure/core-tracing" "^1.0.0" - debug "^4.1.1" - fast-json-stable-stringify "^2.1.0" - jsbi "^3.1.3" - node-abort-controller "^3.0.0" - priorityqueuejs "^1.0.0" - semaphore "^1.0.5" - tslib "^2.2.0" - universal-user-agent "^6.0.0" - uuid "^8.3.0" - -"@azure/identity@^4.2.1": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-4.2.1.tgz#22b366201e989b7b41c0e1690e103bd579c31e4c" - integrity sha512-U8hsyC9YPcEIzoaObJlRDvp7KiF0MGS7xcWbyJSVvXRkC/HXo1f0oYeBYmEvVgRfacw7GHf6D6yAoh9JHz6A5Q== - dependencies: - "@azure/abort-controller" "^1.0.0" - "@azure/core-auth" "^1.5.0" - "@azure/core-client" "^1.4.0" - "@azure/core-rest-pipeline" "^1.1.0" - "@azure/core-tracing" "^1.0.0" - "@azure/core-util" "^1.3.0" - "@azure/logger" "^1.0.0" - "@azure/msal-browser" "^3.11.1" - "@azure/msal-node" "^2.9.2" - events "^3.0.0" - jws "^4.0.0" - open "^8.0.0" - stoppable "^1.1.0" - tslib "^2.2.0" - -"@azure/logger@^1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@azure/logger/-/logger-1.0.1.tgz#19b333203d1b2931353d8879e814b64a7274837a" - integrity sha512-QYQeaJ+A5x6aMNu8BG5qdsVBnYBop9UMwgUvGihSjf1PdZZXB+c/oMdM2ajKwzobLBh9e9QuMQkN9iL+IxLBLA== - dependencies: - tslib "^2.0.0" - -"@azure/msal-browser@^3.11.1": - version "3.17.0" - resolved "https://registry.yarnpkg.com/@azure/msal-browser/-/msal-browser-3.17.0.tgz#dee9ccae586239e7e0708b261f7ffa5bc7e00fb7" - integrity sha512-csccKXmW2z7EkZ0I3yAoW/offQt+JECdTIV/KrnRoZyM7wCSsQWODpwod8ZhYy7iOyamcHApR9uCh0oD1M+0/A== - dependencies: - "@azure/msal-common" "14.12.0" - -"@azure/msal-common@14.12.0": - version "14.12.0" - resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-14.12.0.tgz#844abe269b071f8fa8949dadc2a7b65bbb147588" - integrity sha512-IDDXmzfdwmDkv4SSmMEyAniJf6fDu3FJ7ncOjlxkDuT85uSnLEhZi3fGZpoR7T4XZpOMx9teM9GXBgrfJgyeBw== - -"@azure/msal-node@^2.9.2": - version "2.9.2" - resolved "https://registry.yarnpkg.com/@azure/msal-node/-/msal-node-2.9.2.tgz#e6d3c1661012c1bd0ef68e328f73a2fdede52931" - integrity sha512-8tvi6Cos3m+0KmRbPjgkySXi+UQU/QiuVRFnrxIwt5xZlEEFa69O04RTaNESGgImyBBlYbo2mfE8/U8Bbdk1WQ== - dependencies: - "@azure/msal-common" "14.12.0" - jsonwebtoken "^9.0.0" - uuid "^8.3.0" - -"@azure/storage-blob@^12.17.0": - version "12.17.0" - resolved "https://registry.yarnpkg.com/@azure/storage-blob/-/storage-blob-12.17.0.tgz#04aad7f59cb08dbbe5b1b672a9f5b6256c8c9006" - integrity sha512-sM4vpsCpcCApagRW5UIjQNlNylo02my2opgp0Emi8x888hZUvJ3dN69Oq20cEGXkMUWnoCrBaB0zyS3yeB87sQ== - dependencies: - "@azure/abort-controller" "^1.0.0" - "@azure/core-http" "^3.0.0" - "@azure/core-lro" "^2.2.0" - "@azure/core-paging" "^1.1.1" - "@azure/core-tracing" "1.0.0-preview.13" - "@azure/logger" "^1.0.0" - events "^3.0.0" - tslib "^2.2.0" - -"@electron/get@^2.0.0": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@electron/get/-/get-2.0.3.tgz#fba552683d387aebd9f3fcadbcafc8e12ee4f960" - integrity sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ== - dependencies: - debug "^4.1.1" - env-paths "^2.2.0" - fs-extra "^8.1.0" - got "^11.8.5" - progress "^2.0.3" - semver "^6.2.0" - sumchecker "^3.0.1" - optionalDependencies: - global-agent "^3.0.0" - -"@esbuild/aix-ppc64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.20.0.tgz#509621cca4e67caf0d18561a0c56f8b70237472f" - integrity sha512-fGFDEctNh0CcSwsiRPxiaqX0P5rq+AqE0SRhYGZ4PX46Lg1FNR6oCxJghf8YgY0WQEgQuh3lErUFE4KxLeRmmw== - -"@esbuild/android-arm64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.20.0.tgz#109a6fdc4a2783fc26193d2687827045d8fef5ab" - integrity sha512-aVpnM4lURNkp0D3qPoAzSG92VXStYmoVPOgXveAUoQBWRSuQzt51yvSju29J6AHPmwY1BjH49uR29oyfH1ra8Q== - -"@esbuild/android-arm@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.20.0.tgz#1397a2c54c476c4799f9b9073550ede496c94ba5" - integrity sha512-3bMAfInvByLHfJwYPJRlpTeaQA75n8C/QKpEaiS4HrFWFiJlNI0vzq/zCjBrhAYcPyVPG7Eo9dMrcQXuqmNk5g== - -"@esbuild/android-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.20.0.tgz#2b615abefb50dc0a70ac313971102f4ce2fdb3ca" - integrity sha512-uK7wAnlRvjkCPzh8jJ+QejFyrP8ObKuR5cBIsQZ+qbMunwR8sbd8krmMbxTLSrDhiPZaJYKQAU5Y3iMDcZPhyQ== - -"@esbuild/darwin-arm64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.20.0.tgz#5c122ed799eb0c35b9d571097f77254964c276a2" - integrity sha512-AjEcivGAlPs3UAcJedMa9qYg9eSfU6FnGHJjT8s346HSKkrcWlYezGE8VaO2xKfvvlZkgAhyvl06OJOxiMgOYQ== - -"@esbuild/darwin-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.20.0.tgz#9561d277002ba8caf1524f209de2b22e93d170c1" - integrity sha512-bsgTPoyYDnPv8ER0HqnJggXK6RyFy4PH4rtsId0V7Efa90u2+EifxytE9pZnsDgExgkARy24WUQGv9irVbTvIw== - -"@esbuild/freebsd-arm64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.0.tgz#84178986a3138e8500d17cc380044868176dd821" - integrity sha512-kQ7jYdlKS335mpGbMW5tEe3IrQFIok9r84EM3PXB8qBFJPSc6dpWfrtsC/y1pyrz82xfUIn5ZrnSHQQsd6jebQ== - -"@esbuild/freebsd-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.20.0.tgz#3f9ce53344af2f08d178551cd475629147324a83" - integrity sha512-uG8B0WSepMRsBNVXAQcHf9+Ko/Tr+XqmK7Ptel9HVmnykupXdS4J7ovSQUIi0tQGIndhbqWLaIL/qO/cWhXKyQ== - -"@esbuild/linux-arm64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.20.0.tgz#24efa685515689df4ecbc13031fa0a9dda910a11" - integrity sha512-uTtyYAP5veqi2z9b6Gr0NUoNv9F/rOzI8tOD5jKcCvRUn7T60Bb+42NDBCWNhMjkQzI0qqwXkQGo1SY41G52nw== - -"@esbuild/linux-arm@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.20.0.tgz#6b586a488e02e9b073a75a957f2952b3b6e87b4c" - integrity sha512-2ezuhdiZw8vuHf1HKSf4TIk80naTbP9At7sOqZmdVwvvMyuoDiZB49YZKLsLOfKIr77+I40dWpHVeY5JHpIEIg== - -"@esbuild/linux-ia32@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.20.0.tgz#84ce7864f762708dcebc1b123898a397dea13624" - integrity sha512-c88wwtfs8tTffPaoJ+SQn3y+lKtgTzyjkD8NgsyCtCmtoIC8RDL7PrJU05an/e9VuAke6eJqGkoMhJK1RY6z4w== - -"@esbuild/linux-loong64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.20.0.tgz#1922f571f4cae1958e3ad29439c563f7d4fd9037" - integrity sha512-lR2rr/128/6svngnVta6JN4gxSXle/yZEZL3o4XZ6esOqhyR4wsKyfu6qXAL04S4S5CgGfG+GYZnjFd4YiG3Aw== - -"@esbuild/linux-mips64el@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.20.0.tgz#7ca1bd9df3f874d18dbf46af009aebdb881188fe" - integrity sha512-9Sycc+1uUsDnJCelDf6ZNqgZQoK1mJvFtqf2MUz4ujTxGhvCWw+4chYfDLPepMEvVL9PDwn6HrXad5yOrNzIsQ== - -"@esbuild/linux-ppc64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.20.0.tgz#8f95baf05f9486343bceeb683703875d698708a4" - integrity sha512-CoWSaaAXOZd+CjbUTdXIJE/t7Oz+4g90A3VBCHLbfuc5yUQU/nFDLOzQsN0cdxgXd97lYW/psIIBdjzQIwTBGw== - -"@esbuild/linux-riscv64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.20.0.tgz#ca63b921d5fe315e28610deb0c195e79b1a262ca" - integrity sha512-mlb1hg/eYRJUpv8h/x+4ShgoNLL8wgZ64SUr26KwglTYnwAWjkhR2GpoKftDbPOCnodA9t4Y/b68H4J9XmmPzA== - -"@esbuild/linux-s390x@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.20.0.tgz#cb3d069f47dc202f785c997175f2307531371ef8" - integrity sha512-fgf9ubb53xSnOBqyvWEY6ukBNRl1mVX1srPNu06B6mNsNK20JfH6xV6jECzrQ69/VMiTLvHMicQR/PgTOgqJUQ== - -"@esbuild/linux-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.20.0.tgz#ac617e0dc14e9758d3d7efd70288c14122557dc7" - integrity sha512-H9Eu6MGse++204XZcYsse1yFHmRXEWgadk2N58O/xd50P9EvFMLJTQLg+lB4E1cF2xhLZU5luSWtGTb0l9UeSg== - -"@esbuild/netbsd-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.20.0.tgz#6cc778567f1513da6e08060e0aeb41f82eb0f53c" - integrity sha512-lCT675rTN1v8Fo+RGrE5KjSnfY0x9Og4RN7t7lVrN3vMSjy34/+3na0q7RIfWDAj0e0rCh0OL+P88lu3Rt21MQ== - -"@esbuild/openbsd-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.20.0.tgz#76848bcf76b4372574fb4d06cd0ed1fb29ec0fbe" - integrity sha512-HKoUGXz/TOVXKQ+67NhxyHv+aDSZf44QpWLa3I1lLvAwGq8x1k0T+e2HHSRvxWhfJrFxaaqre1+YyzQ99KixoA== - -"@esbuild/sunos-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.20.0.tgz#ea4cd0639bf294ad51bc08ffbb2dac297e9b4706" - integrity sha512-GDwAqgHQm1mVoPppGsoq4WJwT3vhnz/2N62CzhvApFD1eJyTroob30FPpOZabN+FgCjhG+AgcZyOPIkR8dfD7g== - -"@esbuild/win32-arm64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.20.0.tgz#a5c171e4a7f7e4e8be0e9947a65812c1535a7cf0" - integrity sha512-0vYsP8aC4TvMlOQYozoksiaxjlvUcQrac+muDqj1Fxy6jh9l9CZJzj7zmh8JGfiV49cYLTorFLxg7593pGldwQ== - -"@esbuild/win32-ia32@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.20.0.tgz#f8ac5650c412d33ea62d7551e0caf82da52b7f85" - integrity sha512-p98u4rIgfh4gdpV00IqknBD5pC84LCub+4a3MO+zjqvU5MVXOc3hqR2UgT2jI2nh3h8s9EQxmOsVI3tyzv1iFg== - -"@esbuild/win32-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.20.0.tgz#2efddf82828aac85e64cef62482af61c29561bee" - integrity sha512-NgJnesu1RtWihtTtXGFMU5YSE6JyyHPMxCwBZK7a6/8d31GuSo9l0Ss7w1Jw5QnKUawG6UEehs883kcXf5fYwg== - -"@malept/cross-spawn-promise@^1.1.0": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@malept/cross-spawn-promise/-/cross-spawn-promise-1.1.1.tgz#504af200af6b98e198bce768bc1730c6936ae01d" - integrity sha512-RTBGWL5FWQcg9orDOCcp4LvItNzUPcyEU9bwaeJX0rJ1IQxzucC48Y0/sQLp/g6t99IQgAlGIaesJS+gTn7tVQ== - dependencies: - cross-spawn "^7.0.1" - -"@opentelemetry/api@^1.0.1": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.0.3.tgz#13a12ae9e05c2a782f7b5e84c3cbfda4225eaf80" - integrity sha512-puWxACExDe9nxbBB3lOymQFrLYml2dVOrd7USiVRnSbgXE+KwBu+HxFvxrzfqsiSda9IWsXJG1ef7C1O2/GmKQ== - -"@sindresorhus/is@^4.0.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" - integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== - -"@szmarczak/http-timer@^4.0.5": - version "4.0.6" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" - integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== - dependencies: - defer-to-connect "^2.0.0" - -"@tootallnate/once@1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" - integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== - -"@types/ansi-colors@^3.2.0": - version "3.2.0" - resolved "https://registry.yarnpkg.com/@types/ansi-colors/-/ansi-colors-3.2.0.tgz#3e4fe85d9131ce1c6994f3040bd0b25306c16a6e" - integrity sha512-0caWAhXht9N2lOdMzJLXybsSkYCx1QOdxx6pae48tswI9QV3DFX26AoOpy0JxwhCb+zISTqmd6H8t9Zby9BoZg== - -"@types/byline@^4.2.32": - version "4.2.32" - resolved "https://registry.yarnpkg.com/@types/byline/-/byline-4.2.32.tgz#9d35ec15968056118548412ee24c2c3026c997dc" - integrity sha512-qtlm/J6XOO9p+Ep/ZB5+mCFEDhzWDDHWU4a1eReN7lkPZXW9rkloq2jcAhvKKmlO5tL2GSvKROb+PTsNVhBiyQ== - dependencies: - "@types/node" "*" - -"@types/cacheable-request@^6.0.1": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" - integrity sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw== - dependencies: - "@types/http-cache-semantics" "*" - "@types/keyv" "^3.1.4" - "@types/node" "*" - "@types/responselike" "^1.0.0" - -"@types/debounce@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/debounce/-/debounce-1.0.0.tgz#417560200331e1bb84d72da85391102c2fcd61b7" - integrity sha1-QXVgIAMx4buE1y2oU5EQLC/NYbc= - -"@types/debug@^4.1.5": - version "4.1.9" - resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.9.tgz#906996938bc672aaf2fb8c0d3733ae1dda05b005" - integrity sha512-8Hz50m2eoS56ldRlepxSBa6PWEVCtzUo/92HgLc2qTMnotJNIm7xP+UZhyWoYsyOdd5dxZ+NZLb24rsKyFs2ow== - dependencies: - "@types/ms" "*" - -"@types/events@*": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86" - integrity sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA== - -"@types/expect@^1.20.4": - version "1.20.4" - resolved "https://registry.yarnpkg.com/@types/expect/-/expect-1.20.4.tgz#8288e51737bf7e3ab5d7c77bfa695883745264e5" - integrity sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg== - -"@types/fancy-log@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@types/fancy-log/-/fancy-log-1.3.0.tgz#a61ab476e5e628cd07a846330df53b85e05c8ce0" - integrity sha512-mQjDxyOM1Cpocd+vm1kZBP7smwKZ4TNokFeds9LV7OZibmPJFEzY3+xZMrKfUdNT71lv8GoCPD6upKwHxubClw== - -"@types/fs-extra@^9.0.12": - version "9.0.12" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-9.0.12.tgz#9b8f27973df8a7a3920e8461517ebf8a7d4fdfaf" - integrity sha512-I+bsBr67CurCGnSenZZ7v94gd3tc3+Aj2taxMT4yu4ABLuOgOjeFxX3dokG24ztSRg5tnT00sL8BszO7gSMoIw== - dependencies: - "@types/node" "*" - -"@types/glob-stream@*": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@types/glob-stream/-/glob-stream-6.1.0.tgz#7ede8a33e59140534f8d8adfb8ac9edfb31897bc" - integrity sha512-RHv6ZQjcTncXo3thYZrsbAVwoy4vSKosSWhuhuQxLOTv74OJuFQxXkmUuZCr3q9uNBEVCvIzmZL/FeRNbHZGUg== - dependencies: - "@types/glob" "*" - "@types/node" "*" - -"@types/glob@*", "@types/glob@^7.1.1": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" - integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== - dependencies: - "@types/events" "*" - "@types/minimatch" "*" - "@types/node" "*" - -"@types/gulp-concat@^0.0.32": - version "0.0.32" - resolved "https://registry.yarnpkg.com/@types/gulp-concat/-/gulp-concat-0.0.32.tgz#72486028b1cf5faa94c8c1cf34c626531cecacd6" - integrity sha512-CUCFADlITzzBfBa2bdGzhKtvBr4eFh+evb+4igVbvPoO5RyPfHifmyQlZl6lM7q19+OKncRlFXDU7B4X9Ayo2g== - dependencies: - "@types/node" "*" - -"@types/gulp-filter@^3.0.32": - version "3.0.32" - resolved "https://registry.yarnpkg.com/@types/gulp-filter/-/gulp-filter-3.0.32.tgz#eeff3e9dbc092268fed01f2421ab00f6c8cb4848" - integrity sha512-JvY4qTxXehoK2yCUxYVxTMvckVbDM5TWHWeUoYJyX31gwFqw4YDD6JNzhuTxI3yHPUTY4BBRTqgm6puQEZVCNg== - dependencies: - "@types/minimatch" "*" - "@types/node" "*" - "@types/vinyl" "*" - -"@types/gulp-gzip@^0.0.31": - version "0.0.31" - resolved "https://registry.yarnpkg.com/@types/gulp-gzip/-/gulp-gzip-0.0.31.tgz#9358def25540442138fd61a7227f40d4c1e26760" - integrity sha512-KQjHz1FTqLse8/EiktfhN/vo33vamX4gVAQhMTp55STDBA7UToW5CJqYyP7iRorkHK9/aJ2nL2hLkNZkY4M8+w== - dependencies: - "@types/node" "*" - -"@types/gulp-json-editor@^2.2.31": - version "2.2.31" - resolved "https://registry.yarnpkg.com/@types/gulp-json-editor/-/gulp-json-editor-2.2.31.tgz#3c1a8950556c109a0e2d0ab11d5f2a2443665ed2" - integrity sha512-piis0ImYAy0dt18R4EtTbAY+RV8jwTq5VisnUV6OfP8kD4743aHGkAdAd08No4NY3rFa5mD6ytIu8L0YU7nL9w== - dependencies: - "@types/js-beautify" "*" - "@types/node" "*" - -"@types/gulp-rename@^0.0.33": - version "0.0.33" - resolved "https://registry.yarnpkg.com/@types/gulp-rename/-/gulp-rename-0.0.33.tgz#38d146e97786569f74f5391a1b1f9b5198674b6c" - integrity sha512-FIZQvbZJj6V1gHPTzO+g/BCWpDur7fJrroae4gwV3LaoHBQ+MrR9sB+2HssK8fHv4WdY6hVNxkcft9bYatuPIA== - dependencies: - "@types/node" "*" - -"@types/gulp-sourcemaps@^0.0.32": - version "0.0.32" - resolved "https://registry.yarnpkg.com/@types/gulp-sourcemaps/-/gulp-sourcemaps-0.0.32.tgz#e79ee617e0cb15729874be4533fe59c07793a175" - integrity sha512-+7BAmptW2bxyJnJcCEuie7vLoop3FwWgCdBMzyv7MYXED/HeNMeQuX7uPCkp4vfU1TTu4CYFH0IckNPvo0VePA== - dependencies: - "@types/node" "*" - -"@types/gulp@^4.0.17": - version "4.0.17" - resolved "https://registry.yarnpkg.com/@types/gulp/-/gulp-4.0.17.tgz#b314c3762d08d8d69b7c0b86f78d069bafd65009" - integrity sha512-+pKQynu2C/HS16kgmDlAicjtFYP8kaa86eE9P0Ae7GB5W29we/E2TIdbOWtEZD5XkpY+jr8fyqfwO6SWZecLpQ== - dependencies: - "@types/node" "*" - "@types/undertaker" ">=1.2.6" - "@types/vinyl-fs" "*" - chokidar "^3.3.1" - -"@types/http-cache-semantics@*": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz#b979ebad3919799c979b17c72621c0bc0a31c6c4" - integrity sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA== - -"@types/js-beautify@*": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@types/js-beautify/-/js-beautify-1.8.0.tgz#0369d3d0e1f35a6aec07cb4da2ee2bcda111367c" - integrity sha512-/siF86XrwDKLuHe8l7h6NhrAWgLdgqbxmjZv9NvGWmgYRZoTipkjKiWb0SQHy/jcR+ee0GvbG6uGd+LEBMGNvA== - -"@types/keyv@^3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" - integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== - dependencies: - "@types/node" "*" - -"@types/mime@0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-0.0.29.tgz#fbcfd330573b912ef59eeee14602bface630754b" - integrity sha1-+8/TMFc7kS71nu7hRgK/rOYwdUs= - -"@types/minimatch@*", "@types/minimatch@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" - integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== - -"@types/minimist@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.1.tgz#283f669ff76d7b8260df8ab7a4262cc83d988256" - integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg== - -"@types/mkdirp@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-1.0.1.tgz#0930b948914a78587de35458b86c907b6e98bbf6" - integrity sha512-HkGSK7CGAXncr8Qn/0VqNtExEE+PHMWb+qlR1faHMao7ng6P3tAaoWWBMdva0gL5h4zprjIO89GJOLXsMcDm1Q== - dependencies: - "@types/node" "*" - -"@types/mocha@^9.1.1": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" - integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== - -"@types/ms@*": - version "0.7.32" - resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.32.tgz#f6cd08939ae3ad886fcc92ef7f0109dacddf61ab" - integrity sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g== - -"@types/node-fetch@^2.5.0": - version "2.5.8" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.8.tgz#e199c835d234c7eb0846f6618012e558544ee2fb" - integrity sha512-fbjI6ja0N5ZA8TV53RUqzsKNkl9fv8Oj3T7zxW7FGv1GSH7gwJaNF8dzCjrqKaxKeUpTz4yT1DaJFq/omNpGfw== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "8.0.51" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb" - integrity sha512-El3+WJk2D/ppWNd2X05aiP5l2k4EwF7KwheknQZls+I26eSICoWRhRIJ56jGgw2dqNGQ5LtNajmBU2ajS28EvQ== - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@types/pump@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/pump/-/pump-1.0.1.tgz#ae8157cefef04d1a4d24c1cc91d403c2f5da5cd0" - integrity sha1-roFXzv7wTRpNJMHMkdQDwvXaXNA= - dependencies: - "@types/node" "*" - -"@types/responselike@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.3.tgz#cc29706f0a397cfe6df89debfe4bf5cea159db50" - integrity sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw== - dependencies: - "@types/node" "*" - -"@types/rimraf@^2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-2.0.4.tgz#403887b0b53c6100a6c35d2ab24f6ccc042fec46" - integrity sha512-8gBudvllD2A/c0CcEX/BivIDorHFt5UI5m46TsNj8DjWCCTTZT74kEe4g+QsY7P/B9WdO98d82zZgXO/RQzu2Q== - dependencies: - "@types/glob" "*" - "@types/node" "*" - -"@types/through2@^2.0.36": - version "2.0.36" - resolved "https://registry.yarnpkg.com/@types/through2/-/through2-2.0.36.tgz#35fda0db635827d44c0e08e2c94653e647574a00" - integrity sha512-vuifQksQHJXhV9McpVsXKuhnf3lsoX70PnhcqIAbs9dqLH2NgrGz0DzZPDY3+Yh6eaRqcE1gnCQ6QhBn1/PT5A== - dependencies: - "@types/node" "*" - -"@types/through@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/through/-/through-0.0.29.tgz#72943aac922e179339c651fa34a4428a4d722f93" - integrity sha512-9a7C5VHh+1BKblaYiq+7Tfc+EOmjMdZaD1MYtkQjSoxgB69tBjW98ry6SKsi4zEIWztLOMRuL87A3bdT/Fc/4w== - dependencies: - "@types/node" "*" - -"@types/tmp@^0.2.1": - version "0.2.1" - resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.2.1.tgz#83ecf4ec22a8c218c71db25f316619fe5b986011" - integrity sha512-7cTXwKP/HLOPVgjg+YhBdQ7bMiobGMuoBmrGmqwIWJv8elC6t1DfVc/mn4fD9UE1IjhwmhaQ5pGVXkmXbH0rhg== - -"@types/tunnel@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@types/tunnel/-/tunnel-0.0.3.tgz#f109e730b072b3136347561fc558c9358bb8c6e9" - integrity sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA== - dependencies: - "@types/node" "*" - -"@types/undertaker-registry@*": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/undertaker-registry/-/undertaker-registry-1.0.1.tgz#4306d4a03d7acedb974b66530832b90729e1d1da" - integrity sha512-Z4TYuEKn9+RbNVk1Ll2SS4x1JeLHecolIbM/a8gveaHsW0Hr+RQMraZACwTO2VD7JvepgA6UO1A1VrbktQrIbQ== - -"@types/undertaker@>=1.2.6": - version "1.2.11" - resolved "https://registry.yarnpkg.com/@types/undertaker/-/undertaker-1.2.11.tgz#d9e08b72c4bea5fc40e5bad63ad5a1a2b675e3ca" - integrity sha512-j1Z0V2ByRHr8ZK7eOeGq0LGkkdthNFW0uAZGY22iRkNQNL9/vAV0yFPr1QN3FM/peY5bxs9P+1f0PYJTQVa5iA== - dependencies: - "@types/node" "*" - "@types/undertaker-registry" "*" - async-done "~1.3.2" - -"@types/vinyl-fs@*": - version "2.4.9" - resolved "https://registry.yarnpkg.com/@types/vinyl-fs/-/vinyl-fs-2.4.9.tgz#d312c24b5ba8d2db456d23ee4a66f9d016af82ea" - integrity sha512-Q0EXd6c1fORjiOuK4ZaKdfFcMyFzJlTi56dqktwaWVLIDAzE49wUs3bKnYbZwzyMWoH+NcMWnRuR73S9A0jnRA== - dependencies: - "@types/events" "*" - "@types/glob-stream" "*" - "@types/node" "*" - "@types/vinyl" "*" - -"@types/vinyl@*": - version "2.0.12" - resolved "https://registry.yarnpkg.com/@types/vinyl/-/vinyl-2.0.12.tgz#17642ca9a8ae10f3db018e9f885da4188db4c6e6" - integrity sha512-Sr2fYMBUVGYq8kj3UthXFAu5UN6ZW+rYr4NACjZQJvHvj+c8lYv0CahmZ2P/r7iUkN44gGUBwqxZkrKXYPb7cw== - dependencies: - "@types/expect" "^1.20.4" - "@types/node" "*" - -"@types/workerpool@^6.4.0": - version "6.4.0" - resolved "https://registry.yarnpkg.com/@types/workerpool/-/workerpool-6.4.0.tgz#c79292915dd08350d10e78e74687b6f401f270b8" - integrity sha512-SIF2/169pDsLKeM8GQGHkOFifGalDbZgiBSaLUnnlVSRsAOenkAvQ6h4uhV2W+PZZczS+8LQxACwNkSykdT91A== - dependencies: - "@types/node" "*" - -"@types/xml2js@0.0.33": - version "0.0.33" - resolved "https://registry.yarnpkg.com/@types/xml2js/-/xml2js-0.0.33.tgz#20c5dd6460245284d64a55690015b95e409fb7de" - integrity sha1-IMXdZGAkUoTWSlVpABW5XkCft94= - -"@types/yauzl@^2.9.1": - version "2.9.2" - resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.2.tgz#c48e5d56aff1444409e39fa164b0b4d4552a7b7a" - integrity sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA== - dependencies: - "@types/node" "*" - -"@vscode/iconv-lite-umd@0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz#d2f1e0664ee6036408f9743fee264ea0699b0e48" - integrity sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg== - -"@vscode/vsce@^2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@vscode/vsce/-/vsce-2.16.0.tgz#a3ddcf7e84914576f35d891e236bc496c568776f" - integrity sha512-BhJ0zO7UxShLFBZM6jwOLt1ZVoqQ4r5Lj/kHNeYp0ICPXhz/erqBSMQnHkRgkjn2L/bh+TYFGkZyguhu/SKsjw== - dependencies: - azure-devops-node-api "^11.0.1" - chalk "^2.4.2" - cheerio "^1.0.0-rc.9" - commander "^6.1.0" - glob "^7.0.6" - hosted-git-info "^4.0.2" - leven "^3.1.0" - markdown-it "^12.3.2" - mime "^1.3.4" - minimatch "^3.0.3" - parse-semver "^1.1.1" - read "^1.0.7" - semver "^5.1.0" - tmp "^0.2.1" - typed-rest-client "^1.8.4" - url-join "^4.0.1" - xml2js "^0.4.23" - yauzl "^2.3.1" - yazl "^2.2.2" - optionalDependencies: - keytar "^7.7.0" - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -ansi-colors@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-colors@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" - integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA== - dependencies: - ansi-wrap "^0.1.0" - -ansi-gray@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" - integrity sha1-KWLPVOyXksSFEKPetSRDaGHvclE= - dependencies: - ansi-wrap "0.1.0" - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-wrap@0.1.0, ansi-wrap@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" - integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= - -anymatch@^3.1.1, anymatch@~3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -asar@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/asar/-/asar-3.0.3.tgz#1fef03c2d6d2de0cbad138788e4f7ae03b129c7b" - integrity sha512-k7zd+KoR+n8pl71PvgElcoKHrVNiSXtw7odKbyNpmgKe7EGRF9Pnu3uLOukD37EvavKwVFxOUpqXTIZC5B5Pmw== - dependencies: - chromium-pickle-js "^0.2.0" - commander "^5.0.0" - glob "^7.1.6" - minimatch "^3.0.4" - optionalDependencies: - "@types/glob" "^7.1.1" - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -async-done@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" - integrity sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.2" - process-nextick-args "^2.0.0" - stream-exhaust "^1.0.1" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -at-least-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" - integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== - -azure-devops-node-api@^11.0.1: - version "11.2.0" - resolved "https://registry.yarnpkg.com/azure-devops-node-api/-/azure-devops-node-api-11.2.0.tgz#bf04edbef60313117a0507415eed4790a420ad6b" - integrity sha512-XdiGPhrpaT5J8wdERRKs5g8E0Zy1pvOYTli7z9E8nmOn3YGp4FhtjhrOyFmX/8veWCwdI69mCHKJw6l+4J/bHA== - dependencies: - tunnel "0.0.6" - typed-rest-client "^1.8.4" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base64-js@^1.3.1, base64-js@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -bl@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - -bluebird@^3.5.0: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - -boolbase@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" - integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== - -boolean@^3.0.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/boolean/-/boolean-3.1.2.tgz#e30f210a26b02458482a8cc353ab06f262a780c2" - integrity sha512-YN6UmV0FfLlBVvRvNPx3pz5W/mUoYB24J4WSXOKP/OOJpi+Oq6WYqPaNTHzjI0QzwWtnvEd5CGYyQPgp1jFxnw== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-crc32@~0.2.3: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= - -buffer-equal-constant-time@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" - integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= - -buffer-equal@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" - integrity sha1-WWFrSYME1Var1GaWayLu2j7KX74= - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= - -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -byline@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" - integrity sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= - -cacheable-lookup@^5.0.3: - version "5.0.4" - resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" - integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== - -cacheable-request@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.4.tgz#7a33ebf08613178b403635be7b899d3e69bbe817" - integrity sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^4.0.0" - lowercase-keys "^2.0.0" - normalize-url "^6.0.1" - responselike "^2.0.0" - -call-bind@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -cheerio-select@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cheerio-select/-/cheerio-select-2.1.0.tgz#4d8673286b8126ca2a8e42740d5e3c4884ae21b4" - integrity sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g== - dependencies: - boolbase "^1.0.0" - css-select "^5.1.0" - css-what "^6.1.0" - domelementtype "^2.3.0" - domhandler "^5.0.3" - domutils "^3.0.1" - -cheerio@^1.0.0-rc.9: - version "1.0.0-rc.12" - resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.12.tgz#788bf7466506b1c6bf5fae51d24a2c4d62e47683" - integrity sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q== - dependencies: - cheerio-select "^2.1.0" - dom-serializer "^2.0.0" - domhandler "^5.0.3" - domutils "^3.0.1" - htmlparser2 "^8.0.1" - parse5 "^7.0.0" - parse5-htmlparser2-tree-adapter "^7.0.0" - -chokidar@3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" - integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.5.0" - optionalDependencies: - fsevents "~2.3.1" - -chokidar@^3.3.1: - version "3.6.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" - integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -chromium-pickle-js@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz#04a106672c18b085ab774d983dfa3ea138f22205" - integrity sha1-BKEGZywYsIWrd02YPfo+oTjyIgU= - -clone-buffer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" - integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= - -clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= - dependencies: - mimic-response "^1.0.0" - -clone-stats@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" - integrity sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= - -clone@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= - -cloneable-readable@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" - integrity sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ== - dependencies: - inherits "^2.0.1" - process-nextick-args "^2.0.0" - readable-stream "^2.3.5" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-support@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" - integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== - -colors@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" - integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= - -colors@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - integrity sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q= - dependencies: - graceful-readlink ">= 1.0.0" - -commander@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" - integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== - -commander@^6.1.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" - integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== - -commander@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.0.0.tgz#3e2bbfd8bb6724760980988fb5b22b7ee6b71ab2" - integrity sha512-ovx/7NkTrnPuIV8sqk/GjUIIM1+iUQeqA3ye2VNpq9sVoiZsooObWlQy+OPWGI17GDaEoybuAGJm6U8yC077BA== - -compare-version@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/compare-version/-/compare-version-0.1.2.tgz#0162ec2d9351f5ddd59a9202cba935366a725080" - integrity sha1-AWLsLZNR9d3VmpICy6k1NmpyUIA= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -cross-spawn@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -css-select@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-5.1.0.tgz#b8ebd6554c3637ccc76688804ad3f6a6fdaea8a6" - integrity sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg== - dependencies: - boolbase "^1.0.0" - css-what "^6.1.0" - domhandler "^5.0.2" - domutils "^3.0.1" - nth-check "^2.0.1" - -css-what@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" - integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== - -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -debug@^2.6.8: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -decompress-response@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" - integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== - dependencies: - mimic-response "^3.1.0" - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -defer-to-connect@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" - integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== - -define-lazy-prop@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" - integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== - -define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -detect-libc@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.1.tgz#e1897aa88fa6ad197862937fbc0441ef352ee0cd" - integrity sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w== - -detect-node@^2.0.4: - version "2.1.0" - resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" - integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== - -dir-compare@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/dir-compare/-/dir-compare-2.4.0.tgz#785c41dc5f645b34343a4eafc50b79bac7f11631" - integrity sha512-l9hmu8x/rjVC9Z2zmGzkhOEowZvW7pmYws5CWHutg8u1JgvsKWMx7Q/UODeu4djLZ4FgW5besw5yvMQnBHzuCA== - dependencies: - buffer-equal "1.0.0" - colors "1.0.3" - commander "2.9.0" - minimatch "3.0.4" - -dom-serializer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" - integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== - dependencies: - domelementtype "^2.3.0" - domhandler "^5.0.2" - entities "^4.2.0" - -domelementtype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" - integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== - -domhandler@^5.0.1, domhandler@^5.0.2, domhandler@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" - integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== - dependencies: - domelementtype "^2.3.0" - -domutils@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.0.1.tgz#696b3875238338cb186b6c0612bd4901c89a4f1c" - integrity sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q== - dependencies: - dom-serializer "^2.0.0" - domelementtype "^2.3.0" - domhandler "^5.0.1" - -duplexify@^4.1.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.2.tgz#18b4f8d28289132fa0b9573c898d9f903f81c7b0" - integrity sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw== - dependencies: - end-of-stream "^1.4.1" - inherits "^2.0.3" - readable-stream "^3.1.1" - stream-shift "^1.0.0" - -ecdsa-sig-formatter@1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" - integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== - dependencies: - safe-buffer "^5.0.1" - -electron-osx-sign@^0.4.16: - version "0.4.16" - resolved "https://registry.yarnpkg.com/electron-osx-sign/-/electron-osx-sign-0.4.16.tgz#0be8e579b2d9fa4c12d2a21f063898294b3434aa" - integrity sha512-ziMWfc3NmQlwnWLW6EaZq8nH2BWVng/atX5GWsGwhexJYpdW6hsg//MkAfRTRx1kR3Veiqkeiog1ibkbA4x0rg== - dependencies: - bluebird "^3.5.0" - compare-version "^0.1.2" - debug "^2.6.8" - isbinaryfile "^3.0.2" - minimist "^1.2.0" - plist "^3.0.1" - -end-of-stream@^1.1.0, end-of-stream@^1.4.1: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -entities@^4.2.0, entities@^4.3.0, entities@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-4.4.0.tgz#97bdaba170339446495e653cfd2db78962900174" - integrity sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA== - -entities@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" - integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== - -env-paths@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" - integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== - -es6-error@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" - integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== - -esbuild@0.20.0: - version "0.20.0" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.20.0.tgz#a7170b63447286cd2ff1f01579f09970e6965da4" - integrity sha512-6iwE3Y2RVYCME1jLpBqq7LQWK3MW6vjV2bZy6gt/WrqkY+WE74Spyc0ThAOYpMtITvnjX09CrC6ym7A/m9mebA== - optionalDependencies: - "@esbuild/aix-ppc64" "0.20.0" - "@esbuild/android-arm" "0.20.0" - "@esbuild/android-arm64" "0.20.0" - "@esbuild/android-x64" "0.20.0" - "@esbuild/darwin-arm64" "0.20.0" - "@esbuild/darwin-x64" "0.20.0" - "@esbuild/freebsd-arm64" "0.20.0" - "@esbuild/freebsd-x64" "0.20.0" - "@esbuild/linux-arm" "0.20.0" - "@esbuild/linux-arm64" "0.20.0" - "@esbuild/linux-ia32" "0.20.0" - "@esbuild/linux-loong64" "0.20.0" - "@esbuild/linux-mips64el" "0.20.0" - "@esbuild/linux-ppc64" "0.20.0" - "@esbuild/linux-riscv64" "0.20.0" - "@esbuild/linux-s390x" "0.20.0" - "@esbuild/linux-x64" "0.20.0" - "@esbuild/netbsd-x64" "0.20.0" - "@esbuild/openbsd-x64" "0.20.0" - "@esbuild/sunos-x64" "0.20.0" - "@esbuild/win32-arm64" "0.20.0" - "@esbuild/win32-ia32" "0.20.0" - "@esbuild/win32-x64" "0.20.0" - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -events@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379" - integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== - -expand-template@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" - integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== - -extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extract-zip@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" - integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== - dependencies: - debug "^4.1.1" - get-stream "^5.1.0" - yauzl "^2.10.0" - optionalDependencies: - "@types/yauzl" "^2.9.1" - -fancy-log@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" - integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== - dependencies: - ansi-gray "^0.1.1" - color-support "^1.1.3" - parse-node-version "^1.0.0" - time-stamp "^1.0.0" - -fast-json-stable-stringify@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fd-slicer@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= - dependencies: - pend "~1.2.0" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -first-chunk-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz#1bdecdb8e083c0664b91945581577a43a9f31d70" - integrity sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA= - dependencies: - readable-stream "^2.0.2" - -fork-stream@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/fork-stream/-/fork-stream-0.0.4.tgz#db849fce77f6708a5f8f386ae533a0907b54ae70" - integrity sha512-Pqq5NnT78ehvUnAk/We/Jr22vSvanRlFTpAmQ88xBY/M1TlHe+P0ILuEyXS595ysdGfaj22634LBkGMA2GTcpA== - -form-data@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" - integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - -fs-extra@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-extra@^9.0.1: - version "9.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@~2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -fsevents@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -get-intrinsic@^1.0.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" - integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.3" - -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -github-from-package@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" - integrity sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4= - -glob-parent@^5.1.1, glob-parent@~5.1.0, glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@^7.0.6: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.3, glob@^7.1.6: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -global-agent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/global-agent/-/global-agent-3.0.0.tgz#ae7cd31bd3583b93c5a16437a1afe27cc33a1ab6" - integrity sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q== - dependencies: - boolean "^3.0.1" - es6-error "^4.1.1" - matcher "^3.0.0" - roarr "^2.15.3" - semver "^7.3.2" - serialize-error "^7.0.1" - -globalthis@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.2.tgz#2a235d34f4d8036219f7e34929b5de9e18166b8b" - integrity sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ== - dependencies: - define-properties "^1.1.3" - -got@^11.8.5: - version "11.8.6" - resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" - integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g== - dependencies: - "@sindresorhus/is" "^4.0.0" - "@szmarczak/http-timer" "^4.0.5" - "@types/cacheable-request" "^6.0.1" - "@types/responselike" "^1.0.0" - cacheable-lookup "^5.0.3" - cacheable-request "^7.0.2" - decompress-response "^6.0.0" - http2-wrapper "^1.0.0-beta.5.2" - lowercase-keys "^2.0.0" - p-cancelable "^2.0.0" - responselike "^2.0.0" - -graceful-fs@^4.1.2: - version "4.2.10" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" - integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== - -graceful-fs@^4.1.6, graceful-fs@^4.2.0: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== - -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= - -gulp-merge-json@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/gulp-merge-json/-/gulp-merge-json-2.1.1.tgz#cfb1d066467577545b8c1c289a278e6ef4b4e0de" - integrity sha512-VhvAlcf+dcCb94j/2yDPWxJ3X7x4P/Xwcrv1dhjYuRgvADwFJmaQwl4zbuq+GDZvzMacbVncWtEdsETpUSkhYw== - dependencies: - json5 "^2.1.3" - lodash.mergewith "^4.6.1" - plugin-error "^1.0.1" - through "^2.3.8" - vinyl "^2.1.0" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -hosted-git-info@^4.0.2: - version "4.1.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" - integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== - dependencies: - lru-cache "^6.0.0" - -htmlparser2@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-8.0.1.tgz#abaa985474fcefe269bc761a779b544d7196d010" - integrity sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA== - dependencies: - domelementtype "^2.3.0" - domhandler "^5.0.2" - domutils "^3.0.1" - entities "^4.3.0" - -http-cache-semantics@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" - integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== - -http-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" - integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== - dependencies: - "@tootallnate/once" "1" - agent-base "6" - debug "4" - -http2-wrapper@^1.0.0-beta.5.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" - integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== - dependencies: - quick-lru "^5.1.1" - resolve-alpn "^1.0.0" - -https-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - -ieee754@^1.1.13: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ini@~1.3.0: - version "1.3.8" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" - integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-docker@^2.0.0, is-docker@^2.1.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-glob@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-utf8@^0.2.0, is-utf8@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= - -is-wsl@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isbinaryfile@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" - integrity sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw== - dependencies: - buffer-alloc "^1.2.0" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -jsbi@^3.1.3: - version "3.1.4" - resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.1.4.tgz#9654dd02207a66a4911b4e4bb74265bc2cbc9dd0" - integrity sha512-52QRRFSsi9impURE8ZUbzAMCLjPm4THO7H2fcuIvaaeFTbSysvkodbQQXIVsNgq/ypDbq6dJiuGKL0vZ/i9hUg== - -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - -json-stringify-safe@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -json5@^2.1.3: - version "2.2.2" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab" - integrity sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ== - -jsonc-parser@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.3.0.tgz#7c7fc988ee1486d35734faaaa866fadb00fa91ee" - integrity sha512-b0EBt8SWFNnixVdvoR2ZtEGa9ZqLhbJnOjezn+WP+8kspFm+PFYDN8Z4Bc7pRlDjvuVcADSUkroIuTWWn/YiIA== - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - -jsonwebtoken@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz#d0faf9ba1cc3a56255fe49c0961a67e520c1926d" - integrity sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw== - dependencies: - jws "^3.2.2" - lodash "^4.17.21" - ms "^2.1.1" - semver "^7.3.8" - -jwa@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a" - integrity sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA== - dependencies: - buffer-equal-constant-time "1.0.1" - ecdsa-sig-formatter "1.0.11" - safe-buffer "^5.0.1" - -jwa@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/jwa/-/jwa-2.0.0.tgz#a7e9c3f29dae94027ebcaf49975c9345593410fc" - integrity sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA== - dependencies: - buffer-equal-constant-time "1.0.1" - ecdsa-sig-formatter "1.0.11" - safe-buffer "^5.0.1" - -jws@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" - integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA== - dependencies: - jwa "^1.4.1" - safe-buffer "^5.0.1" - -jws@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jws/-/jws-4.0.0.tgz#2d4e8cf6a318ffaa12615e9dec7e86e6c97310f4" - integrity sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg== - dependencies: - jwa "^2.0.0" - safe-buffer "^5.0.1" - -keytar@^7.7.0: - version "7.9.0" - resolved "https://registry.yarnpkg.com/keytar/-/keytar-7.9.0.tgz#4c6225708f51b50cbf77c5aae81721964c2918cb" - integrity sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ== - dependencies: - node-addon-api "^4.3.0" - prebuild-install "^7.0.1" - -keyv@^4.0.0: - version "4.5.4" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" - integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== - dependencies: - json-buffer "3.0.1" - -leven@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - -linkify-it@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" - integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== - dependencies: - uc.micro "^1.0.1" - -lodash.mergewith@^4.6.1: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55" - integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ== - -lodash@^4.17.21: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -markdown-it@^12.3.2: - version "12.3.2" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" - integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== - dependencies: - argparse "^2.0.1" - entities "~2.1.0" - linkify-it "^3.0.1" - mdurl "^1.0.1" - uc.micro "^1.0.5" - -matcher@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/matcher/-/matcher-3.0.0.tgz#bd9060f4c5b70aa8041ccc6f80368760994f30ca" - integrity sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng== - dependencies: - escape-string-regexp "^4.0.0" - -mdurl@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" - integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -mime-db@1.45.0: - version "1.45.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.45.0.tgz#cceeda21ccd7c3a745eba2decd55d4b73e7879ea" - integrity sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w== - -mime-types@^2.1.12: - version "2.1.28" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.28.tgz#1160c4757eab2c5363888e005273ecf79d2a0ecd" - integrity sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ== - dependencies: - mime-db "1.45.0" - -mime@^1.3.4, mime@^1.4.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mimic-response@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - -mimic-response@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" - integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== - -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^3.0.3, minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.0, minimist@^1.2.3: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== - -mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" - integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== - -mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -mute-stream@~0.0.4: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - -nan@^2.18.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.19.0.tgz#bb58122ad55a6c5bc973303908d5b16cfdd5a8c0" - integrity sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw== - -napi-build-utils@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" - integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== - -node-abi@^3.3.0: - version "3.30.0" - resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.30.0.tgz#d84687ad5d24ca81cdfa912a36f2c5c19b137359" - integrity sha512-qWO5l3SCqbwQavymOmtTVuCWZE23++S+rxyoHjXqUmPyzRcaoI4lA2gO55/drddGnedAyjA7sk76SfQ5lfUMnw== - dependencies: - semver "^7.3.5" - -node-abort-controller@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/node-abort-controller/-/node-abort-controller-3.1.1.tgz#a94377e964a9a37ac3976d848cb5c765833b8548" - integrity sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ== - -node-addon-api@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" - integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== - -node-fetch@^2.6.7: - version "2.6.9" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.9.tgz#7c7f744b5cc6eb5fd404e0c7a9fec630a55657e6" - integrity sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg== - dependencies: - whatwg-url "^5.0.0" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -normalize-url@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" - integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== - -nth-check@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" - integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== - dependencies: - boolbase "^1.0.0" - -object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-inspect@^1.9.0: - version "1.12.2" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" - integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== - -object-keys@^1.0.12: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -open@^8.0.0: - version "8.4.0" - resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8" - integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q== - dependencies: - define-lazy-prop "^2.0.0" - is-docker "^2.1.1" - is-wsl "^2.2.0" - -p-cancelable@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" - integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== - -parse-node-version@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" - integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== - -parse-semver@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/parse-semver/-/parse-semver-1.1.1.tgz#9a4afd6df063dc4826f93fba4a99cf223f666cb8" - integrity sha512-Eg1OuNntBMH0ojvEKSrvDSnwLmvVuUOSdylH/pSCPNMIspLlweJyIWXCE+k/5hm3cj/EBUYwmWkjhBALNP4LXQ== - dependencies: - semver "^5.1.0" - -parse5-htmlparser2-tree-adapter@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz#23c2cc233bcf09bb7beba8b8a69d46b08c62c2f1" - integrity sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g== - dependencies: - domhandler "^5.0.2" - parse5 "^7.0.0" - -parse5@^7.0.0: - version "7.1.2" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" - integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== - dependencies: - entities "^4.4.0" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= - -picomatch@^2.0.4: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== - -picomatch@^2.2.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== - -plist@^3.0.1: - version "3.0.5" - resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.5.tgz#2cbeb52d10e3cdccccf0c11a63a85d830970a987" - integrity sha512-83vX4eYdQp3vP9SxuYgEM/G/pJQqLUz/V/xzPrzruLs7fz7jxGQ1msZ/mg1nwZxUSuOp4sb+/bEIbRrbzZRxDA== - dependencies: - base64-js "^1.5.1" - xmlbuilder "^9.0.7" - -plugin-error@1.0.1, plugin-error@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c" - integrity sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA== - dependencies: - ansi-colors "^1.0.1" - arr-diff "^4.0.0" - arr-union "^3.1.0" - extend-shallow "^3.0.2" - -prebuild-install@^7.0.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45" - integrity sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw== - dependencies: - detect-libc "^2.0.0" - expand-template "^2.0.3" - github-from-package "0.0.0" - minimist "^1.2.3" - mkdirp-classic "^0.5.3" - napi-build-utils "^1.0.1" - node-abi "^3.3.0" - pump "^3.0.0" - rc "^1.2.7" - simple-get "^4.0.0" - tar-fs "^2.0.0" - tunnel-agent "^0.6.0" - -prebuild-install@^7.1.1: - version "7.1.2" - resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.2.tgz#a5fd9986f5a6251fbc47e1e5c65de71e68c0a056" - integrity sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ== - dependencies: - detect-libc "^2.0.0" - expand-template "^2.0.3" - github-from-package "0.0.0" - minimist "^1.2.3" - mkdirp-classic "^0.5.3" - napi-build-utils "^1.0.1" - node-abi "^3.3.0" - pump "^3.0.0" - rc "^1.2.7" - simple-get "^4.0.0" - tar-fs "^2.0.0" - tunnel-agent "^0.6.0" - -priorityqueuejs@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/priorityqueuejs/-/priorityqueuejs-1.0.0.tgz#2ee4f23c2560913e08c07ce5ccdd6de3df2c5af8" - integrity sha1-LuTyPCVgkT4IwHzlzN1t498sWvg= - -process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= - -progress@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -qs@^6.9.1: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== - dependencies: - side-channel "^1.0.4" - -quick-lru@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" - integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -read@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" - integrity sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ== - dependencies: - mute-stream "~0.0.4" - -"readable-stream@2 || 3", readable-stream@3, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-stream@^2.0.2, readable-stream@^2.3.5: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdirp@~3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" - integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== - dependencies: - picomatch "^2.2.1" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -replace-ext@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.1.tgz#2d6d996d04a15855d967443631dd5f77825b016a" - integrity sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw== - -resolve-alpn@^1.0.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" - integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== - -responselike@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" - integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== - dependencies: - lowercase-keys "^2.0.0" - -rimraf@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -roarr@^2.15.3: - version "2.15.4" - resolved "https://registry.yarnpkg.com/roarr/-/roarr-2.15.4.tgz#f5fe795b7b838ccfe35dc608e0282b9eba2e7afd" - integrity sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A== - dependencies: - boolean "^3.0.1" - detect-node "^2.0.4" - globalthis "^1.0.1" - json-stringify-safe "^5.0.1" - semver-compare "^1.0.0" - sprintf-js "^1.1.2" - -safe-buffer@^5.0.1, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -sax@>=0.6.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - -semaphore@^1.0.5: - version "1.1.0" - resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" - integrity sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA== - -semver-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" - integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= - -semver@^5.1.0: - version "5.7.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" - integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== - -semver@^6.2.0: - version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^7.3.2, semver@^7.3.5, semver@^7.3.8: - version "7.5.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - -serialize-error@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-7.0.1.tgz#f1360b0447f61ffb483ec4157c737fab7d778e18" - integrity sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw== - dependencies: - type-fest "^0.13.1" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -simple-concat@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" - integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== - -simple-get@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" - integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== - dependencies: - decompress-response "^6.0.0" - once "^1.3.1" - simple-concat "^1.0.0" - -source-map@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -sprintf-js@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673" - integrity sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug== - -stoppable@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/stoppable/-/stoppable-1.1.0.tgz#32da568e83ea488b08e4d7ea2c3bcc9d75015d5b" - integrity sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw== - -stream-exhaust@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" - integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== - -stream-shift@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" - integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-bom-buf@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz#1cb45aaf57530f4caf86c7f75179d2c9a51dd572" - integrity sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI= - dependencies: - is-utf8 "^0.2.1" - -strip-bom-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz#f87db5ef2613f6968aa545abfe1ec728b6a829ca" - integrity sha1-+H217yYT9paKpUWr/h7HKLaoKco= - dependencies: - first-chunk-stream "^2.0.0" - strip-bom "^2.0.0" - -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= - dependencies: - is-utf8 "^0.2.0" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -sumchecker@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-3.0.1.tgz#6377e996795abb0b6d348e9b3e1dfb24345a8e42" - integrity sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg== - dependencies: - debug "^4.1.0" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -tar-fs@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" - integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng== - dependencies: - chownr "^1.1.1" - mkdirp-classic "^0.5.2" - pump "^3.0.0" - tar-stream "^2.1.4" - -tar-stream@^2.1.4: - version "2.2.0" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" - integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== - dependencies: - bl "^4.0.3" - end-of-stream "^1.4.1" - fs-constants "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.1.1" - -ternary-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ternary-stream/-/ternary-stream-3.0.0.tgz#7951930ea9e823924d956f03d516151a2d516253" - integrity sha512-oIzdi+UL/JdktkT+7KU5tSIQjj8pbShj3OASuvDEhm0NT5lppsm7aXWAmAq4/QMaBIyfuEcNLbAQA+HpaISobQ== - dependencies: - duplexify "^4.1.1" - fork-stream "^0.0.4" - merge-stream "^2.0.0" - through2 "^3.0.1" - -through2@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.2.tgz#99f88931cfc761ec7678b41d5d7336b5b6a07bf4" - integrity sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ== - dependencies: - inherits "^2.0.4" - readable-stream "2 || 3" - -through2@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" - integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== - dependencies: - readable-stream "3" - -through@^2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== - -time-stamp@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" - integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= - -tmp@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" - integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== - dependencies: - rimraf "^3.0.0" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - -tree-sitter-typescript@^0.20.5: - version "0.20.5" - resolved "https://registry.yarnpkg.com/tree-sitter-typescript/-/tree-sitter-typescript-0.20.5.tgz#29e30c052bcb06cb992ffd2d392e010b0e1768b3" - integrity sha512-RzK/Pc6k4GiXvInIBlo8ZggekP6rODfW2P6KHFCTSUHENsw6ynh+iacFhfkJRa4MT8EIN2WHygFJ7076/+eHKg== - dependencies: - nan "^2.18.0" - tree-sitter "^0.20.6" - -tree-sitter@^0.20.5, tree-sitter@^0.20.6: - version "0.20.6" - resolved "https://registry.yarnpkg.com/tree-sitter/-/tree-sitter-0.20.6.tgz#fec52e5d7cc6c583135756479f2440dd89b25cbe" - integrity sha512-GxJodajVpfgb3UREzzIbtA1hyRnTxVbWVXrbC6sk4xTMH5ERMBJk9HJNq4c8jOJeUaIOmLcwg+t6mez/PDvGqg== - dependencies: - nan "^2.18.0" - prebuild-install "^7.1.1" - -tslib@^2.0.0, tslib@^2.2.0, tslib@^2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" - integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tunnel@0.0.6, tunnel@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" - integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== - -type-fest@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" - integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== - -typed-rest-client@^1.8.4: - version "1.8.9" - resolved "https://registry.yarnpkg.com/typed-rest-client/-/typed-rest-client-1.8.9.tgz#e560226bcadfe71b0fb5c416b587f8da3b8f92d8" - integrity sha512-uSmjE38B80wjL85UFX3sTYEUlvZ1JgCRhsWj/fJ4rZ0FqDUFoIuodtiVeE+cUqiVTOKPdKrp/sdftD15MDek6g== - dependencies: - qs "^6.9.1" - tunnel "0.0.6" - underscore "^1.12.1" - -uc.micro@^1.0.1, uc.micro@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" - integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== - -underscore@^1.12.1: - version "1.13.6" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.6.tgz#04786a1f589dc6c09f761fc5f45b89e935136441" - integrity sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -universal-user-agent@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" - integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== - -url-join@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7" - integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -uuid@^8.3.0: - version "8.3.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31" - integrity sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg== - -vinyl-file@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/vinyl-file/-/vinyl-file-3.0.0.tgz#b104d9e4409ffa325faadd520642d0a3b488b365" - integrity sha1-sQTZ5ECf+jJfqt1SBkLQo7SIs2U= - dependencies: - graceful-fs "^4.1.2" - pify "^2.3.0" - strip-bom-buf "^1.0.0" - strip-bom-stream "^2.0.0" - vinyl "^2.0.1" - -vinyl@^2.0.1, vinyl@^2.1.0, vinyl@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.1.tgz#23cfb8bbab5ece3803aa2c0a1eb28af7cbba1974" - integrity sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw== - dependencies: - clone "^2.1.1" - clone-buffer "^1.0.0" - clone-stats "^1.0.0" - cloneable-readable "^1.0.0" - remove-trailing-separator "^1.0.1" - replace-ext "^1.0.0" - -vscode-gulp-watch@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/vscode-gulp-watch/-/vscode-gulp-watch-5.0.3.tgz#1ca1c03581d43692ecb1fe0b9afd4256faeb701b" - integrity sha512-MTUp2yLE9CshhkNSNV58EQNxQSeF8lIj3mkXZX9a1vAk+EQNM2PAYdPUDSd/P/08W3PMHGznEiZyfK7JAjLosg== - dependencies: - ansi-colors "4.1.1" - anymatch "^3.1.1" - chokidar "3.5.1" - fancy-log "^1.3.3" - glob-parent "^5.1.1" - normalize-path "^3.0.0" - object-assign "^4.1.1" - plugin-error "1.0.1" - readable-stream "^3.6.0" - vinyl "^2.2.0" - vinyl-file "^3.0.0" - -vscode-universal-bundler@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/vscode-universal-bundler/-/vscode-universal-bundler-0.0.2.tgz#2c988dac681d3ffe6baec6defac0995cb833c55a" - integrity sha512-FPJcvKnQGBqFzy6M6Nm2yvAczNLUeXsfYM6GwCex/pUOkvIM2icIHmiSvtMJINlLW1iG+oEwE3/LVbABmcjEmQ== - dependencies: - "@malept/cross-spawn-promise" "^1.1.0" - asar "^3.0.3" - debug "^4.3.1" - dir-compare "^2.4.0" - fs-extra "^9.0.1" - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -workerpool@^6.4.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.0.tgz#f8474762c5e2f81646994aa113685f6c424a2416" - integrity sha512-r64Ea3glXY2RVzMeNxB+4J+0YHAVzUdV4cM5nHi4BBC2LvnO1pWFAIYKYuGcPElbg1/7eEiaPtZ/jzCjIUuGBg== - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -xml2js@^0.4.19, xml2js@^0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" - integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug== - dependencies: - sax ">=0.6.0" - xmlbuilder "~11.0.0" - -xmlbuilder@^9.0.7: - version "9.0.7" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" - integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= - -xmlbuilder@~11.0.0: - version "11.0.1" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" - integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yauzl@^2.10.0, yauzl@^2.3.1: - version "2.10.0" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" - -yazl@^2.2.2: - version "2.5.1" - resolved "https://registry.yarnpkg.com/yazl/-/yazl-2.5.1.tgz#a3d65d3dd659a5b0937850e8609f22fffa2b5c35" - integrity sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw== - dependencies: - buffer-crc32 "~0.2.3" diff --git a/cglicenses.json b/cglicenses.json index d90d55d7315..0b4e03e502b 100644 --- a/cglicenses.json +++ b/cglicenses.json @@ -1,7 +1,7 @@ // ----------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------- // This file overrides licenses only for OSS components which do not appear in `cgmanifest.json`. -// i.e. for OSS components that are detected from `yarn.lock` or `Cargo.lock` files. +// i.e. for OSS components that are detected from `package-lock.json` or `Cargo.lock` files. // // DO NOT EDIT THIS FILE UNLESS THE OSS TOOL INDICATES THAT YOU SHOULD. // @@ -40,12 +40,6 @@ "Copyright (c) Microsoft Corporation. All rights reserved." ] }, - { - "name": "big-integer", - "prependLicenseText": [ - "Copyright released to public domain" - ] - }, { // Reason: The license cannot be found by the tool due to access controls on the repository "name": "vscode-tas-client", @@ -247,33 +241,6 @@ "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." ] }, - { - // Reason: The substack org has been deleted on GH - "name": "mkdirp", - "fullLicenseText": [ - "Copyright 2010 James Halliday (mail@substack.net)", - "", - "This project is free software released under the MIT/X11 license:", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and associated documentation files (the \"Software\"), to deal", - "in the Software without restriction, including without limitation the rights", - "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", - "copies of the Software, and to permit persons to whom the Software is", - "furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in", - "all copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", - "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", - "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", - "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN", - "THE SOFTWARE." - ] - }, { // Reason: repo URI is wrong on crate, pending https://github.com/warp-tech/russh/pull/53 "name": "russh-cryptovec", @@ -567,6 +534,32 @@ "SOFTWARE" ] }, + { + "name":"vscode-markdown-languageserver", + "fullLicenseText": [ + "MIT License", + "", + "Copyright (c) Microsoft Corporation.", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and associated documentation files (the \"Software\"), to deal", + "in the Software without restriction, including without limitation the rights", + "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", + "copies of the Software, and to permit persons to whom the Software is", + "furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in all", + "copies or substantial portions of the Software.", + "", + "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", + "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", + "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", + "SOFTWARE" + ] + }, { // Reason: mono-repo where the individual packages are also dual-licensed under MIT and Apache-2.0 "name": "system-configuration", diff --git a/cgmanifest.json b/cgmanifest.json index 61747342eef..0f786874887 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "chromium", "repositoryUrl": "https://chromium.googlesource.com/chromium/src", - "commitHash": "f1a45d7ded05d64ca8136cc142ddc0c271b1dd43" + "commitHash": "7fa4f6e14e0707c0e604cf7c1da33566e78169ce" } }, "licenseDetail": [ @@ -40,7 +40,7 @@ "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ], "isOnlyProductionDependency": true, - "version": "122.0.6261.156" + "version": "124.0.6367.243" }, { "component": { @@ -48,7 +48,7 @@ "git": { "name": "ffmpeg", "repositoryUrl": "https://chromium.googlesource.com/chromium/third_party/ffmpeg", - "commitHash": "17525de887d54b970ffdd421a0879c1db1952307" + "commitHash": "52d8ef3799b2f16b66351dd0972bb0bcee1648ac" } }, "isOnlyProductionDependency": true, @@ -516,11 +516,11 @@ "git": { "name": "nodejs", "repositoryUrl": "https://github.com/nodejs/node", - "commitHash": "9b1bf44ea9e7785e38c93b7d22d32dbca262df6c" + "commitHash": "1968ef32415607643770efb320d7d4e941baaa25" } }, "isOnlyProductionDependency": true, - "version": "20.11.1" + "version": "20.16.0" }, { "component": { @@ -528,12 +528,12 @@ "git": { "name": "electron", "repositoryUrl": "https://github.com/electron/electron", - "commitHash": "f9ed0eaee4b172733872c2f84e5061882dd08e5c" + "commitHash": "5955d53c480a627b016c592931d9d0345ee2564f" } }, "isOnlyProductionDependency": true, "license": "MIT", - "version": "29.4.0" + "version": "30.5.0" }, { "component": { @@ -732,6 +732,39 @@ "SOFTWARE." ], "license": "MIT" + }, + { + "component": { + "type": "npm", + "npm": { + "name": "cacheable-request", + "version": "7.0.4" + } + }, + "licenseDetail": [ + "Copyright (c) cacheable-request authors", + "", + "MIT License", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and associated documentation files (the \"Software\"), to", + "deal in the Software without restriction, including without limitation the", + "rights to use, copy, modify, merge, publish, distribute, sublicense, and/or", + "sell copies of the Software, and to permit persons to whom the Software is", + "furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Software.", + "", + "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", + "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING", + "FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER", + "DEALINGS IN THE SOFTWARE." + ], + "license": "MIT" } ], "version": 1 diff --git a/cli/Cargo.lock b/cli/Cargo.lock index 3be3815a748..27fe79896a2 100644 --- a/cli/Cargo.lock +++ b/cli/Cargo.lock @@ -1571,9 +1571,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.5.0", "cfg-if", @@ -1603,9 +1603,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index b820ffcc50f..2907ff3d7e7 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -81,4 +81,5 @@ codegen-units = 1 [features] default = [] +vsda = [] vscode-encrypt = [] diff --git a/cli/ThirdPartyNotices.txt b/cli/ThirdPartyNotices.txt index 7a74fb503c5..4a58801fa12 100644 --- a/cli/ThirdPartyNotices.txt +++ b/cli/ThirdPartyNotices.txt @@ -22,31 +22,16 @@ required to debug changes to any libraries licensed under the GNU Lesser General addr2line 0.21.0 - Apache-2.0 OR MIT https://github.com/gimli-rs/addr2line -Copyright (c) 2016-2018 The gimli Developers +Licensed under either of -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: + * Apache License, Version 2.0 ([`LICENSE-APACHE`](./LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([`LICENSE-MIT`](./LICENSE-MIT) or https://opensource.org/licenses/MIT) -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. +at your option. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. --------------------------------------------------------- --------------------------------------------------------- @@ -292,27 +277,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. async-broadcast 0.5.1 - MIT OR Apache-2.0 https://github.com/smol-rs/async-broadcast -The MIT License (MIT) - -Copyright (c) 2020 Yoshua Wuyts - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + +Licensed under either of Apache License, Version +2.0 (LICENSE-APACHE) or MIT license (LICENSE-MIT) at your option. + -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in this crate by you, as defined in the Apache-2.0 license, shall +be dual licensed as above, without any additional terms or conditions. + --------------------------------------------------------- --------------------------------------------------------- @@ -320,29 +296,18 @@ SOFTWARE. async-channel 2.3.1 - Apache-2.0 OR MIT https://github.com/smol-rs/async-channel -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: +Licensed under either of -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. + * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +at your option. + +#### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. --------------------------------------------------------- --------------------------------------------------------- @@ -382,29 +347,18 @@ async-lock 2.8.0 - Apache-2.0 OR MIT async-lock 3.3.0 - Apache-2.0 OR MIT https://github.com/smol-rs/async-lock -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: +Licensed under either of -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. + * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +at your option. + +#### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. --------------------------------------------------------- --------------------------------------------------------- @@ -412,29 +366,18 @@ DEALINGS IN THE SOFTWARE. async-process 1.8.1 - Apache-2.0 OR MIT https://github.com/smol-rs/async-process -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: +Licensed under either of -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. + * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +at your option. + +#### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. --------------------------------------------------------- --------------------------------------------------------- @@ -442,29 +385,13 @@ DEALINGS IN THE SOFTWARE. async-recursion 1.1.1 - MIT OR Apache-2.0 https://github.com/dcchut/async-recursion -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. +Licensed under either of + * Apache License, Version 2.0 + ([LICENSE-APACHE](LICENSE-APACHE) or ) + * MIT license + ([LICENSE-MIT](LICENSE-MIT) or ) -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +at your option. --------------------------------------------------------- --------------------------------------------------------- @@ -502,29 +429,18 @@ DEALINGS IN THE SOFTWARE. async-task 4.7.1 - Apache-2.0 OR MIT https://github.com/smol-rs/async-task -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: +Licensed under either of -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. + * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +at your option. + +#### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. --------------------------------------------------------- --------------------------------------------------------- @@ -1341,7 +1257,7 @@ SOFTWARE. --------------------------------------------------------- clap_derive 4.5.4 - MIT OR Apache-2.0 -https://github.com/clap-rs/clap/tree/master/clap_derive +https://github.com/clap-rs/clap Copyright (c) Individual contributors @@ -1367,7 +1283,7 @@ SOFTWARE. --------------------------------------------------------- clap_lex 0.7.0 - MIT OR Apache-2.0 -https://github.com/clap-rs/clap/tree/master/clap_lex +https://github.com/clap-rs/clap Copyright (c) Individual contributors @@ -3396,7 +3312,7 @@ https://github.com/hyperium/http-body The MIT License (MIT) -Copyright (c) 2019 Hyper Contributors +Copyright (c) 2019-2024 Sean McArthur & Hyper Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated @@ -3428,7 +3344,7 @@ DEALINGS IN THE SOFTWARE. httparse 1.8.0 - MIT/Apache-2.0 https://github.com/seanmonstar/httparse -Copyright (c) 2015-2021 Sean McArthur +Copyright (c) 2015-2024 Sean McArthur Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -4896,7 +4812,7 @@ OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------- -openssl 0.10.64 - Apache-2.0 +openssl 0.10.66 - Apache-2.0 https://github.com/sfackler/rust-openssl Copyright 2011-2017 Google Inc. @@ -4975,7 +4891,7 @@ DEALINGS IN THE SOFTWARE. --------------------------------------------------------- -openssl-sys 0.9.102 - MIT +openssl-sys 0.9.103 - MIT https://github.com/sfackler/rust-openssl The MIT License (MIT) @@ -8507,6 +8423,7 @@ subtle 2.5.0 - BSD-3-Clause https://github.com/dalek-cryptography/subtle Copyright (c) 2016-2017 Isis Agora Lovecruft, Henry de Valence. All rights reserved. +Copyright (c) 2016-2024 Isis Agora Lovecruft. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10790,33 +10707,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI zbus 3.15.2 - MIT https://github.com/dbus2/zbus/ -The MIT License (MIT) - -Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +LICENSE-MIT --------------------------------------------------------- --------------------------------------------------------- @@ -10824,33 +10715,7 @@ DEALINGS IN THE SOFTWARE. zbus_macros 3.15.2 - MIT https://github.com/dbus2/zbus/ -The MIT License (MIT) - -Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +LICENSE-MIT --------------------------------------------------------- --------------------------------------------------------- @@ -10858,33 +10723,7 @@ DEALINGS IN THE SOFTWARE. zbus_names 2.6.1 - MIT https://github.com/dbus2/zbus/ -The MIT License (MIT) - -Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +LICENSE-MIT --------------------------------------------------------- --------------------------------------------------------- @@ -10977,33 +10816,7 @@ licences; see files named LICENSE.*.txt for details. zvariant 3.15.2 - MIT https://github.com/dbus2/zbus/ -The MIT License (MIT) - -Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +LICENSE-MIT --------------------------------------------------------- --------------------------------------------------------- @@ -11011,33 +10824,7 @@ DEALINGS IN THE SOFTWARE. zvariant_derive 3.15.2 - MIT https://github.com/dbus2/zbus/ -The MIT License (MIT) - -Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +LICENSE-MIT --------------------------------------------------------- --------------------------------------------------------- @@ -11045,31 +10832,5 @@ DEALINGS IN THE SOFTWARE. zvariant_utils 1.0.1 - MIT https://github.com/dbus2/zbus/ -The MIT License (MIT) - -Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +LICENSE-MIT --------------------------------------------------------- \ No newline at end of file diff --git a/cli/src/async_pipe.rs b/cli/src/async_pipe.rs index e9b710c1d68..78aed6fe3e7 100644 --- a/cli/src/async_pipe.rs +++ b/cli/src/async_pipe.rs @@ -227,7 +227,7 @@ impl hyper::server::accept::Accept for PollableAsyncListener { } } -/// Gets a random name for a pipe/socket on the paltform +/// Gets a random name for a pipe/socket on the platform pub fn get_socket_name() -> PathBuf { cfg_if::cfg_if! { if #[cfg(unix)] { diff --git a/cli/src/auth.rs b/cli/src/auth.rs index 67f1bfa6bc7..51942c96c75 100644 --- a/cli/src/auth.rs +++ b/cli/src/auth.rs @@ -287,7 +287,7 @@ impl StorageImplementation for ThreadKeyringStorage { #[derive(Default)] struct KeyringStorage { - // keywring storage can be split into multiple entries due to entry length limits + // keyring storage can be split into multiple entries due to entry length limits // on Windows https://github.com/microsoft/vscode-cli/issues/358 entries: Vec, } @@ -723,7 +723,7 @@ impl Auth { match &init_code_json.message { Some(m) => self.log.result(m), - None => self.log.result(&format!( + None => self.log.result(format!( "To grant access to the server, please log into {} and use code {}", init_code_json.verification_uri, init_code_json.user_code )), diff --git a/cli/src/commands/args.rs b/cli/src/commands/args.rs index 79c4d3767a1..7a8cf1f4f62 100644 --- a/cli/src/commands/args.rs +++ b/cli/src/commands/args.rs @@ -64,7 +64,7 @@ pub struct IntegratedCli { pub core: CliCore, } -/// Common CLI shared between intergated and standalone interfaces. +/// Common CLI shared between integrated and standalone interfaces. #[derive(Args, Debug, Default, Clone)] pub struct CliCore { /// One or more files, folders, or URIs to open. @@ -226,12 +226,15 @@ pub struct ServeWebArgs { #[derive(Args, Debug, Clone)] pub struct CommandShellArgs { + #[clap(flatten)] + pub server_args: BaseServerArgs, + /// Listen on a socket instead of stdin/stdout. #[clap(long)] pub on_socket: bool, /// Listen on a host/port instead of stdin/stdout. - #[clap(long, num_args = 0..=1, default_missing_value = "0")] - pub on_port: Option, + #[clap(long, num_args = 0..=2, default_missing_value = "0")] + pub on_port: Vec, /// Listen on a host/port instead of stdin/stdout. #[clap[long]] pub on_host: Option, @@ -619,7 +622,7 @@ pub enum OutputFormat { #[derive(Args, Clone, Debug, Default)] pub struct ExistingTunnelArgs { /// Name you'd like to assign preexisting tunnel to use to connect the tunnel - /// Old option, new code sohuld just use `--name`. + /// Old option, new code should just use `--name`. #[clap(long, hide = true)] pub tunnel_name: Option, @@ -638,6 +641,9 @@ pub struct ExistingTunnelArgs { #[derive(Args, Debug, Clone, Default)] pub struct TunnelServeArgs { + #[clap(flatten)] + pub server_args: BaseServerArgs, + /// Optional details to connect to an existing tunnel #[clap(flatten, next_help_heading = Some("ADVANCED OPTIONS"))] pub tunnel: ExistingTunnelArgs, @@ -661,7 +667,10 @@ pub struct TunnelServeArgs { /// If set, the user accepts the server license terms and the server will be started without a user prompt. #[clap(long)] pub accept_server_license_terms: bool, +} +#[derive(Args, Debug, Clone, Default)] +pub struct BaseServerArgs { /// Requests that extensions be preloaded and installed on connecting servers. #[clap(long)] pub install_extension: Vec, @@ -675,8 +684,8 @@ pub struct TunnelServeArgs { pub extensions_dir: Option, } -impl TunnelServeArgs { - pub fn apply_to_server_args(&self, csa: &mut CodeServerArgs) { +impl BaseServerArgs { + pub fn apply_to(&self, csa: &mut CodeServerArgs) { csa.install_extensions .extend_from_slice(&self.install_extension); diff --git a/cli/src/commands/serve_web.rs b/cli/src/commands/serve_web.rs index 12c0cdafec9..4acb9a18c73 100644 --- a/cli/src/commands/serve_web.rs +++ b/cli/src/commands/serve_web.rs @@ -15,7 +15,7 @@ use std::time::{Duration, Instant}; use hyper::service::{make_service_fn, service_fn}; use hyper::{Body, Request, Response, Server}; use tokio::io::{AsyncBufReadExt, BufReader}; -use tokio::pin; +use tokio::{pin, time}; use crate::async_pipe::{ get_socket_name, get_socket_rw_stream, listen_socket_rw_stream, AsyncPipe, @@ -50,7 +50,7 @@ const SERVER_IDLE_TIMEOUT_SECS: u64 = 60 * 60; /// (should be large enough to basically never happen) const SERVER_ACTIVE_TIMEOUT_SECS: u64 = SERVER_IDLE_TIMEOUT_SECS * 24 * 30 * 12; /// How long to cache the "latest" version we get from the update service. -const RELEASE_CACHE_SECS: u64 = 60 * 60; +const RELEASE_CHECK_INTERVAL: u64 = 60 * 60; /// Number of bytes for the secret keys. See workbench.ts for their usage. const SECRET_KEY_BYTES: usize = 32; @@ -71,16 +71,26 @@ pub async fn serve_web(ctx: CommandContext, mut args: ServeWebArgs) -> Result = ConnectionManager::new(&ctx, platform, args.clone()); + let update_check_interval = 3600; + cm.clone() + .start_update_checker(Duration::from_secs(update_check_interval)); + let key = get_server_key_half(&ctx.paths); let make_svc = move || { let ctx = HandleContext { @@ -169,7 +179,7 @@ async fn handle_proxied(ctx: &HandleContext, req: Request) -> Response r, Err(e) => { error!(ctx.log, "error getting latest version: {}", e); @@ -532,21 +542,67 @@ impl ConnectionManager { pub fn new(ctx: &CommandContext, platform: Platform, args: ServeWebArgs) -> Arc { let base_path = normalize_base_path(args.server_base_path.as_deref().unwrap_or_default()); + let cache = DownloadCache::new(ctx.paths.web_server_storage()); + let target_kind = TargetKind::Web; + + let quality = VSCODE_CLI_QUALITY.map_or(Quality::Stable, |q| match Quality::try_from(q) { + Ok(q) => q, + Err(_) => Quality::Stable, + }); + + let latest_version = tokio::sync::Mutex::new(cache.get().first().map(|latest_commit| { + ( + Instant::now() - Duration::from_secs(RELEASE_CHECK_INTERVAL), + Release { + name: String::from("0.0.0"), // Version information not stored on cache + commit: latest_commit.clone(), + platform, + target: target_kind, + quality, + }, + ) + })); + Arc::new(Self { platform, args, base_path, log: ctx.log.clone(), - cache: DownloadCache::new(ctx.paths.web_server_storage()), + cache, update_service: UpdateService::new( ctx.log.clone(), Arc::new(ReqwestSimpleHttp::with_client(ctx.http.clone())), ), state: ConnectionStateMap::default(), - latest_version: tokio::sync::Mutex::default(), + latest_version, }) } + // spawns a task that checks for updates every n seconds duration + pub fn start_update_checker(self: Arc, duration: Duration) { + tokio::spawn(async move { + let mut interval = time::interval(duration); + loop { + interval.tick().await; + + if let Err(e) = self.get_latest_release().await { + warning!(self.log, "error getting latest version: {}", e); + } + } + }); + } + + // Returns the latest release from the cache, if one exists. + pub async fn get_release_from_cache(&self) -> Result { + let latest = self.latest_version.lock().await; + if let Some((_, release)) = &*latest { + return Ok(release.clone()); + } + + drop(latest); + self.get_latest_release().await + } + /// Gets a connection to a server version pub async fn get_connection( &self, @@ -565,11 +621,7 @@ impl ConnectionManager { pub async fn get_latest_release(&self) -> Result { let mut latest = self.latest_version.lock().await; let now = Instant::now(); - if let Some((checked_at, release)) = &*latest { - if checked_at.elapsed() < Duration::from_secs(RELEASE_CACHE_SECS) { - return Ok(release.clone()); - } - } + let target_kind = TargetKind::Web; let quality = VSCODE_CLI_QUALITY .ok_or_else(|| CodeError::UpdatesNotConfigured("no configured quality")) @@ -579,13 +631,14 @@ impl ConnectionManager { let release = self .update_service - .get_latest_commit(self.platform, TargetKind::Web, quality) + .get_latest_commit(self.platform, target_kind, quality) .await .map_err(|e| CodeError::UpdateCheckFailed(e.to_string())); // If the update service is unavailable and we have stale data, use that - if let (Err(e), Some((_, previous))) = (&release, &*latest) { + if let (Err(e), Some((_, previous))) = (&release, latest.clone()) { warning!(self.log, "error getting latest release, using stale: {}", e); + *latest = Some((now, previous.clone())); return Ok(previous.clone()); } diff --git a/cli/src/commands/tunnels.rs b/cli/src/commands/tunnels.rs index 688f603f593..dc4206e8316 100644 --- a/cli/src/commands/tunnels.rs +++ b/cli/src/commands/tunnels.rs @@ -155,43 +155,54 @@ pub async fn command_shell(ctx: CommandContext, args: CommandShellArgs) -> Resul code_server_args: (&ctx.args).into(), }; - let mut listener: Box = match (args.on_port, &args.on_host, args.on_socket) - { - (_, _, true) => { - let socket = get_socket_name(); - let listener = listen_socket_rw_stream(&socket) - .await - .map_err(|e| wrap(e, "error listening on socket"))?; + args.server_args.apply_to(&mut params.code_server_args); - params - .log - .result(format!("Listening on {}", socket.display())); + let mut listener: Box = + match (args.on_port.first(), &args.on_host, args.on_socket) { + (_, _, true) => { + let socket = get_socket_name(); + let listener = listen_socket_rw_stream(&socket) + .await + .map_err(|e| wrap(e, "error listening on socket"))?; - Box::new(listener) - } - (Some(_), _, _) | (_, Some(_), _) => { - let addr = SocketAddr::new( - args.on_host + params + .log + .result(format!("Listening on {}", socket.display())); + + Box::new(listener) + } + (Some(_), _, _) | (_, Some(_), _) => { + let host = args + .on_host .as_ref() .map(|h| h.parse().map_err(CodeError::InvalidHostAddress)) - .unwrap_or(Ok(IpAddr::V4(Ipv4Addr::LOCALHOST)))?, - args.on_port.unwrap_or_default(), - ); - let listener = tokio::net::TcpListener::bind(addr) - .await - .map_err(|e| wrap(e, "error listening on port"))?; - - params - .log - .result(format!("Listening on {}", listener.local_addr().unwrap())); - - Box::new(listener) - } - _ => { - serve_stream(tokio::io::stdin(), tokio::io::stderr(), params).await; - return Ok(0); - } - }; + .unwrap_or(Ok(IpAddr::V4(Ipv4Addr::LOCALHOST)))?; + + let lower_port = args.on_port.first().copied().unwrap_or_default(); + let port_no = if let Some(upper) = args.on_port.get(1) { + find_unused_port(&host, lower_port, *upper) + .await + .unwrap_or_default() + } else { + lower_port + }; + + let addr = SocketAddr::new(host, port_no); + let listener = tokio::net::TcpListener::bind(addr) + .await + .map_err(|e| wrap(e, "error listening on port"))?; + + params + .log + .result(format!("Listening on {}", listener.local_addr().unwrap())); + + Box::new(listener) + } + _ => { + serve_stream(tokio::io::stdin(), tokio::io::stderr(), params).await; + return Ok(0); + } + }; let mut servers = FuturesUnordered::new(); @@ -216,6 +227,21 @@ pub async fn command_shell(ctx: CommandContext, args: CommandShellArgs) -> Resul } } +async fn find_unused_port(host: &IpAddr, start_port: u16, end_port: u16) -> Option { + for port in start_port..=end_port { + if is_port_available(*host, port).await { + return Some(port); + } + } + None +} + +async fn is_port_available(host: IpAddr, port: u16) -> bool { + tokio::net::TcpListener::bind(SocketAddr::new(host, port)) + .await + .is_ok() +} + pub async fn service( ctx: CommandContext, service_args: TunnelServiceSubCommands, @@ -416,7 +442,7 @@ pub async fn serve(ctx: CommandContext, gateway_args: TunnelServeArgs) -> Result legal::require_consent(&paths, gateway_args.accept_server_license_terms)?; let mut csa = (&args).into(); - gateway_args.apply_to_server_args(&mut csa); + gateway_args.server_args.apply_to(&mut csa); let result = serve_with_csa(paths, log, gateway_args, csa, TUNNEL_CLI_LOCK_NAME).await; drop(no_sleep); @@ -563,7 +589,7 @@ async fn serve_with_csa( Ok(SingletonConnection::Client(stream)) => { debug!(log, "starting as client to singleton"); if gateway_args.name.is_some() - || !gateway_args.install_extension.is_empty() + || !gateway_args.server_args.install_extension.is_empty() || gateway_args.tunnel.tunnel_id.is_some() { warning!( diff --git a/cli/src/constants.rs b/cli/src/constants.rs index 6f604e8876e..1e277a89d6a 100644 --- a/cli/src/constants.rs +++ b/cli/src/constants.rs @@ -13,7 +13,7 @@ use crate::options::Quality; pub const CONTROL_PORT: u16 = 31545; -/// Protocol version sent to clients. This can be used to indiciate new or +/// Protocol version sent to clients. This can be used to indicate new or /// changed capabilities that clients may wish to leverage. /// 1 - Initial protocol version /// 2 - Addition of `serve.compressed` property to control whether servermsg's diff --git a/cli/src/download_cache.rs b/cli/src/download_cache.rs index d3f05d2237f..cd02b02d75a 100644 --- a/cli/src/download_cache.rs +++ b/cli/src/download_cache.rs @@ -20,6 +20,7 @@ const KEEP_LRU: usize = 5; const STAGING_SUFFIX: &str = ".staging"; const RENAME_ATTEMPTS: u32 = 20; const RENAME_DELAY: std::time::Duration = std::time::Duration::from_millis(200); +const PERSISTED_STATE_FILE_NAME: &str = "lru.json"; #[derive(Clone)] pub struct DownloadCache { @@ -30,11 +31,16 @@ pub struct DownloadCache { impl DownloadCache { pub fn new(path: PathBuf) -> DownloadCache { DownloadCache { - state: PersistedState::new(path.join("lru.json")), + state: PersistedState::new(path.join(PERSISTED_STATE_FILE_NAME)), path, } } + /// Gets the value stored on the state + pub fn get(&self) -> Vec { + self.state.load() + } + /// Gets the download cache path. Names of cache entries can be formed by /// joining them to the path. pub fn path(&self) -> &Path { diff --git a/cli/src/tunnels/code_server.rs b/cli/src/tunnels/code_server.rs index 0579f8ef0dc..465f6e24230 100644 --- a/cli/src/tunnels/code_server.rs +++ b/cli/src/tunnels/code_server.rs @@ -674,7 +674,7 @@ where let write_line = |line: &str| -> std::io::Result<()> { if let Some(mut f) = log_file.as_ref() { f.write_all(line.as_bytes())?; - f.write_all(&[b'\n'])?; + f.write_all(b"\n")?; } if write_directly { println!("{}", line); diff --git a/cli/src/update_service.rs b/cli/src/update_service.rs index 4bec13d6e86..90339148188 100644 --- a/cli/src/update_service.rs +++ b/cli/src/update_service.rs @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -use std::{ffi::OsStr, fmt, path::Path}; +use std::{fmt, path::Path}; use serde::{Deserialize, Serialize}; @@ -11,10 +11,11 @@ use crate::{ constants::VSCODE_CLI_UPDATE_ENDPOINT, debug, log, options, spanf, util::{ - errors::{AnyError, CodeError, WrappedError}, + errors::{wrap, AnyError, CodeError, WrappedError}, http::{BoxedHttp, SimpleResponse}, io::ReportCopyProgress, - tar, zipper, + tar::{self, has_gzip_header}, + zipper, }, }; @@ -178,10 +179,10 @@ pub fn unzip_downloaded_release( where T: ReportCopyProgress, { - if compressed_file.extension() == Some(OsStr::new("zip")) { - zipper::unzip_file(compressed_file, target_dir, reporter) - } else { - tar::decompress_tarball(compressed_file, target_dir, reporter) + match has_gzip_header(compressed_file) { + Ok((f, true)) => tar::decompress_tarball(f, target_dir, reporter), + Ok((f, false)) => zipper::unzip_file(f, target_dir, reporter), + Err(e) => Err(wrap(e, "error checking for gzip header")), } } @@ -249,7 +250,7 @@ impl Platform { Platform::DarwinARM64 => "server-darwin-arm64", Platform::WindowsX64 => "server-win32-x64", Platform::WindowsX86 => "server-win32", - Platform::WindowsARM64 => "server-win32-x64", // we don't publish an arm64 server build yet + Platform::WindowsARM64 => "server-win32-arm64", } .to_owned() } diff --git a/cli/src/util/errors.rs b/cli/src/util/errors.rs index 7d28ce9f741..67519d5437e 100644 --- a/cli/src/util/errors.rs +++ b/cli/src/util/errors.rs @@ -512,6 +512,8 @@ pub enum CodeError { // todo: can be specialized when update service is moved to CodeErrors #[error("Could not check for update: {0}")] UpdateCheckFailed(String), + #[error("Could not read connection token file: {0}")] + CouldNotReadConnectionTokenFile(std::io::Error), #[error("Could not write connection token file: {0}")] CouldNotCreateConnectionTokenFile(std::io::Error), #[error("A tunnel with the name {0} exists and is in-use. Please pick a different name or stop the existing tunnel.")] diff --git a/cli/src/util/prereqs.rs b/cli/src/util/prereqs.rs index 5d4953acbb2..0f49ab20887 100644 --- a/cli/src/util/prereqs.rs +++ b/cli/src/util/prereqs.rs @@ -19,12 +19,22 @@ lazy_static! { static ref GENERIC_VERSION_RE: Regex = Regex::new(r"^([0-9]+)\.([0-9]+)$").unwrap(); static ref LIBSTD_CXX_VERSION_RE: BinRegex = BinRegex::new(r"GLIBCXX_([0-9]+)\.([0-9]+)(?:\.([0-9]+))?").unwrap(); - static ref MIN_CXX_VERSION: SimpleSemver = SimpleSemver::new(3, 4, 25); - static ref MIN_LEGACY_CXX_VERSION: SimpleSemver = SimpleSemver::new(3, 4, 19); static ref MIN_LDD_VERSION: SimpleSemver = SimpleSemver::new(2, 28, 0); static ref MIN_LEGACY_LDD_VERSION: SimpleSemver = SimpleSemver::new(2, 17, 0); } +#[cfg(target_arch = "arm")] +lazy_static! { + static ref MIN_CXX_VERSION: SimpleSemver = SimpleSemver::new(3, 4, 26); + static ref MIN_LEGACY_CXX_VERSION: SimpleSemver = SimpleSemver::new(3, 4, 22); +} + +#[cfg(not(target_arch = "arm"))] +lazy_static! { + static ref MIN_CXX_VERSION: SimpleSemver = SimpleSemver::new(3, 4, 25); + static ref MIN_LEGACY_CXX_VERSION: SimpleSemver = SimpleSemver::new(3, 4, 19); +} + const NIXOS_TEST_PATH: &str = "/etc/NIXOS"; pub struct PreReqChecker {} diff --git a/cli/src/util/tar.rs b/cli/src/util/tar.rs index fe4d4269700..10577140325 100644 --- a/cli/src/util/tar.rs +++ b/cli/src/util/tar.rs @@ -5,8 +5,8 @@ use crate::util::errors::{wrap, WrappedError}; use flate2::read::GzDecoder; -use std::fs; -use std::io::Seek; +use std::fs::{self, File}; +use std::io::{Read, Seek}; use std::path::{Path, PathBuf}; use tar::Archive; @@ -57,16 +57,13 @@ fn should_skip_first_segment(file: &fs::File) -> Result<(bool, u64), WrappedErro } pub fn decompress_tarball( - path: &Path, + mut tar_gz: File, parent_path: &Path, mut reporter: T, ) -> Result<(), WrappedError> where T: ReportCopyProgress, { - let mut tar_gz = fs::File::open(path) - .map_err(|e| wrap(e, format!("error opening file {}", path.display())))?; - let (skip_first, num_entries) = should_skip_first_segment(&tar_gz)?; let report_progress_every = num_entries / 20; let mut entries_so_far = 0; @@ -81,7 +78,7 @@ where let mut archive = Archive::new(tar); archive .entries() - .map_err(|e| wrap(e, format!("error opening archive {}", path.display())))? + .map_err(|e| wrap(e, "error opening archive"))? .filter_map(|e| e.ok()) .try_for_each::<_, Result<_, WrappedError>>(|mut entry| { // approximate progress based on where we are in the archive: @@ -118,3 +115,13 @@ where Ok(()) } + +pub fn has_gzip_header(path: &Path) -> std::io::Result<(File, bool)> { + let mut file = fs::File::open(path)?; + let mut header = [0; 2]; + let _ = file.read_exact(&mut header); + + file.rewind()?; + + Ok((file, header[0] == 0x1f && header[1] == 0x8b)) +} diff --git a/cli/src/util/zipper.rs b/cli/src/util/zipper.rs index 69bcf2d23f6..5521fa42c54 100644 --- a/cli/src/util/zipper.rs +++ b/cli/src/util/zipper.rs @@ -44,15 +44,12 @@ fn should_skip_first_segment(archive: &mut ZipArchive) -> bool { archive.len() > 1 // prefix removal is invalid if there's only a single file } -pub fn unzip_file(path: &Path, parent_path: &Path, mut reporter: T) -> Result<(), WrappedError> +pub fn unzip_file(file: File, parent_path: &Path, mut reporter: T) -> Result<(), WrappedError> where T: ReportCopyProgress, { - let file = fs::File::open(path) - .map_err(|e| wrap(e, format!("unable to open file {}", path.display())))?; - - let mut archive = zip::ZipArchive::new(file) - .map_err(|e| wrap(e, format!("failed to open zip archive {}", path.display())))?; + let mut archive = + zip::ZipArchive::new(file).map_err(|e| wrap(e, "failed to open zip archive"))?; let skip_segments_no = usize::from(should_skip_first_segment(&mut archive)); let report_progress_every = archive.len() / 20; diff --git a/extensions/bat/yarn.lock b/extensions/bat/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/bat/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/clojure/yarn.lock b/extensions/clojure/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/clojure/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/codestory/package-lock.json b/extensions/codestory/package-lock.json new file mode 100644 index 00000000000..aaba6f28bf2 --- /dev/null +++ b/extensions/codestory/package-lock.json @@ -0,0 +1,1730 @@ +{ + "name": "codestoryai", + "version": "0.6.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "codestoryai", + "version": "0.6.1", + "license": "UNLICENSED", + "dependencies": { + "@google-cloud/storage": "^7.0.1", + "diff": "^5.1.0", + "js-levenshtein": "^1.1.6", + "lodash": "^4.17.21", + "lru-cache": "^10.2.0", + "node-fetch": "^3.3.2", + "openai": "^4.0.1", + "posthog-node": "^3.1.1", + "ts-morph": "^19.0.0", + "web-tree-sitter": "^0.20.8", + "winston": "^3.10.0", + "winston-vscode": "^1.0.0" + }, + "devDependencies": { + "@types/diff": "^5.0.3", + "@types/js-levenshtein": "^1.1.3", + "@types/lodash": "^4.14.202", + "@types/node": "18.x", + "@types/uuid": "^9.0.2" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@dabh/diagnostics": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", + "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", + "dependencies": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" + } + }, + "node_modules/@google-cloud/paginator": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-5.0.2.tgz", + "integrity": "sha512-DJS3s0OVH4zFDB1PzjxAsHqJT6sKVbRwwML0ZBP9PbU7Yebtu/7SWMRzvO2J3nUi9pRNITCfu4LJeooM2w4pjg==", + "dependencies": { + "arrify": "^2.0.0", + "extend": "^3.0.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/projectify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-4.0.0.tgz", + "integrity": "sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/promisify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.0.0.tgz", + "integrity": "sha512-Orxzlfb9c67A15cq2JQEyVc7wEsmFBmHjZWZYQMUyJ1qivXyMwdyNOs9odi79hze+2zqdTtu1E19IM/FtqZ10g==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.12.1.tgz", + "integrity": "sha512-Z3ZzOnF3YKLuvpkvF+TjQ6lztxcAyTILp+FjKonmVpEwPa9vFvxpZjubLR4sB6bf19i/8HL2AXRjA0YFgHFRmQ==", + "dependencies": { + "@google-cloud/paginator": "^5.0.0", + "@google-cloud/projectify": "^4.0.0", + "@google-cloud/promisify": "^4.0.0", + "abort-controller": "^3.0.0", + "async-retry": "^1.3.3", + "duplexify": "^4.1.3", + "fast-xml-parser": "^4.4.1", + "gaxios": "^6.0.2", + "google-auth-library": "^9.6.3", + "html-entities": "^2.5.2", + "mime": "^3.0.0", + "p-limit": "^3.0.1", + "retry-request": "^7.0.0", + "teeny-request": "^9.0.0", + "uuid": "^8.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ts-morph/common": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.20.0.tgz", + "integrity": "sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q==", + "dependencies": { + "fast-glob": "^3.2.12", + "minimatch": "^7.4.3", + "mkdirp": "^2.1.6", + "path-browserify": "^1.0.1" + } + }, + "node_modules/@types/caseless": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz", + "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==" + }, + "node_modules/@types/diff": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@types/diff/-/diff-5.2.2.tgz", + "integrity": "sha512-qVqLpd49rmJA2nZzLVsmfS/aiiBpfVE95dHhPVwG0NmSBAt+riPxnj53wq2oBq5m4Q2RF1IWFEUpnZTgrQZfEQ==", + "dev": true + }, + "node_modules/@types/js-levenshtein": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz", + "integrity": "sha512-jd+Q+sD20Qfu9e2aEXogiO3vpOC1PYJOUdyN9gvs4Qrvkg4wF43L5OhqrPeokdv8TL0/mXoYfpkcoGZMNN2pkQ==", + "dev": true + }, + "node_modules/@types/lodash": { + "version": "4.17.7", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.7.tgz", + "integrity": "sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==", + "dev": true + }, + "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==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "node_modules/@types/qs": { + "version": "6.9.16", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.16.tgz", + "integrity": "sha512-7i+zxXdPD0T4cKDuxCUXJ4wHcsJLwENa6Z3dCu8cfCK743OGy5Nu1RmAGqDPsoTDINVEcdXKRvR/zre+P2Ku1A==" + }, + "node_modules/@types/request": { + "version": "2.48.12", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.12.tgz", + "integrity": "sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw==", + "dependencies": { + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + } + }, + "node_modules/@types/request/node_modules/form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==" + }, + "node_modules/@types/triple-beam": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==" + }, + "node_modules/@types/uuid": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", + "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", + "dev": true + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/agentkeepalive": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", + "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "engines": { + "node": ">=8" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==" + }, + "node_modules/async-retry": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", + "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", + "dependencies": { + "retry": "0.13.1" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "engines": { + "node": "*" + } + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/code-block-writer": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-12.0.0.tgz", + "integrity": "sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==" + }, + "node_modules/color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "dependencies": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/colorspace": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", + "dependencies": { + "color": "^3.1.3", + "text-hex": "1.0.x" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/duplexify": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", + "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", + "dependencies": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.2" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/enabled": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-xml-parser": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz", + "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fecha": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==" + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fn.name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data-encoder": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", + "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==" + }, + "node_modules/formdata-node": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", + "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "dependencies": { + "node-domexception": "1.0.0", + "web-streams-polyfill": "4.0.0-beta.3" + }, + "engines": { + "node": ">= 12.20" + } + }, + "node_modules/formdata-node/node_modules/web-streams-polyfill": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", + "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "engines": { + "node": ">= 14" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gaxios": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", + "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/gaxios/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/gaxios/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/gcp-metadata": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz", + "integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==", + "dependencies": { + "gaxios": "^6.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/google-auth-library": { + "version": "9.14.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.14.1.tgz", + "integrity": "sha512-Rj+PMjoNFGFTmtItH7gHfbHpGVSb3vmnGK3nwNBqxQF9NoBpttSZI/rc0WiM63ma2uGDQtYEkMHkK9U6937NiA==", + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "^6.1.1", + "gcp-metadata": "^6.1.0", + "gtoken": "^7.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gtoken": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", + "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", + "dependencies": { + "gaxios": "^6.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html-entities": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", + "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ] + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/kuler": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/logform": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.1.tgz", + "integrity": "sha512-CdaO738xRapbKIMVn2m4F6KTj4j7ooJ8POVnebSgKo3KBz5axNXRAL7ZdRjIV6NOr2Uf4vjtRkxrFETOioCqSA==", + "dependencies": { + "@colors/colors": "1.6.0", + "@types/triple-beam": "^1.3.2", + "fecha": "^4.2.0", + "ms": "^2.1.1", + "safe-stable-stringify": "^2.3.1", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "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==" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", + "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mkdirp": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", + "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/one-time": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "dependencies": { + "fn.name": "1.x.x" + } + }, + "node_modules/openai": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.61.1.tgz", + "integrity": "sha512-jZ2WRn+f4QWZkYnrUS+xzEUIBllsGN75dUCaXmMIHcv2W9yn7O8amaReTbGHCNEYkL43vuDOcxPUWfNPUmoD3Q==", + "dependencies": { + "@types/node": "^18.11.18", + "@types/node-fetch": "^2.6.4", + "@types/qs": "^6.9.15", + "abort-controller": "^3.0.0", + "agentkeepalive": "^4.2.1", + "form-data-encoder": "1.7.2", + "formdata-node": "^4.3.2", + "node-fetch": "^2.6.7", + "qs": "^6.10.3" + }, + "bin": { + "openai": "bin/cli" + }, + "peerDependencies": { + "zod": "^3.23.8" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + } + } + }, + "node_modules/openai/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + }, + "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/posthog-node": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/posthog-node/-/posthog-node-3.6.3.tgz", + "integrity": "sha512-JB+ei0LkwE+rKHyW5z79Nd1jUaGxU6TvkfjFqY9vQaHxU5aU8dRl0UUaEmZdZbHwjp3WmXCBQQRNyimwbNQfCw==", + "dependencies": { + "axios": "^1.6.2", + "rusha": "^0.8.14" + }, + "engines": { + "node": ">=15.0.0" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/retry-request": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-7.0.2.tgz", + "integrity": "sha512-dUOvLMJ0/JJYEn8NrpOaGNE7X3vpI5XlZS/u0ANjqtcZVKnIxP7IgCFwrKTxENw29emmwug53awKtaMm4i9g5w==", + "dependencies": { + "@types/request": "^2.48.8", + "extend": "^3.0.2", + "teeny-request": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rusha": { + "version": "0.8.14", + "resolved": "https://registry.npmjs.org/rusha/-/rusha-0.8.14.tgz", + "integrity": "sha512-cLgakCUf6PedEu15t8kbsjnwIFFR2D4RfL+W3iWFJ4iac7z4B0ZI8fxy4R3J956kAI68HclCFGL8MPoUVC3qVA==" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", + "engines": { + "node": "*" + } + }, + "node_modules/stream-events": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", + "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", + "dependencies": { + "stubs": "^3.0.0" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==" + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + }, + "node_modules/stubs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", + "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==" + }, + "node_modules/teeny-request": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-9.0.0.tgz", + "integrity": "sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==", + "dependencies": { + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.9", + "stream-events": "^1.0.5", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/teeny-request/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/teeny-request/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/teeny-request/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/teeny-request/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/text-hex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/triple-beam": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", + "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/ts-morph": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-19.0.0.tgz", + "integrity": "sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ==", + "dependencies": { + "@ts-morph/common": "~0.20.0", + "code-block-writer": "^12.0.0" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/web-tree-sitter": { + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.20.8.tgz", + "integrity": "sha512-weOVgZ3aAARgdnb220GqYuh7+rZU0Ka9k9yfKtGAzEYMa6GgiCzW9JjQRJyCJakvibQW+dfjJdihjInKuuCAUQ==" + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/winston": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.14.2.tgz", + "integrity": "sha512-CO8cdpBB2yqzEf8v895L+GNKYJiEq8eKlHU38af3snQBQ+sdAIUepjMSguOIJC7ICbzm0ZI+Af2If4vIJrtmOg==", + "dependencies": { + "@colors/colors": "^1.6.0", + "@dabh/diagnostics": "^2.0.2", + "async": "^3.2.3", + "is-stream": "^2.0.0", + "logform": "^2.6.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.7.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/winston-transport": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.1.tgz", + "integrity": "sha512-wQCXXVgfv/wUPOfb2x0ruxzwkcZfxcktz6JIMUaPLmcNhO4bZTwA/WtDWK74xV3F2dKu8YadrFv0qhwYjVEwhA==", + "dependencies": { + "logform": "^2.6.1", + "readable-stream": "^3.6.2", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/winston-vscode": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/winston-vscode/-/winston-vscode-1.0.0.tgz", + "integrity": "sha512-pC9WBAJd+1RzsKlorv1YBRSO0kmQlA4VG5+twxggpr3z7wCTj4lXFe0uLNwZ+GXCJ4BlYCX5kf3iEKRPFpZ0Hw==", + "dependencies": { + "winston-transport": "^4.5.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/extensions/codestory/package.json b/extensions/codestory/package.json index 75599440072..22d1aa50b6b 100644 --- a/extensions/codestory/package.json +++ b/extensions/codestory/package.json @@ -12,22 +12,20 @@ "*" ], "enabledApiProposals": [ - "inlineCompletionsAdditions", - "interactive", - "chatProvider", - "aideGetInlayHintsProvider", "aideGetCodeLensProvider", + "aideGetInlayHintsProvider", + "aideProbe", "chatParticipantAdditions", "chatParticipantPrivate", - "aideChatParticipant", - "aideChatVariableResolver", - "aideProbe", + "chatProvider", + "chatVariableResolver", + "csAuthentication", "csevents", "defaultChatParticipant", - "chatVariableResolver", + "inlineCompletionsAdditions", + "interactive", "modelSelection", - "terminalSelection", - "csAuthentication" + "terminalSelection" ], "files": [ "src/llm/embeddings/models/**/*", diff --git a/extensions/codestory/src/completions/providers/chatprovider.ts b/extensions/codestory/src/completions/providers/chatprovider.ts index a2ea0a9e69f..ab4ce2cc281 100644 --- a/extensions/codestory/src/completions/providers/chatprovider.ts +++ b/extensions/codestory/src/completions/providers/chatprovider.ts @@ -95,7 +95,7 @@ export class CSChatAgentProvider implements vscode.Disposable { this._projectContext = projectContext; this.chatAgent = vscode.aideChat.createChatParticipant('aide', this.defaultAgentRequestHandler); - this.chatAgent.isDefault = true; + // this.chatAgent.isDefault = true; this.chatAgent.iconPath = vscode.Uri.joinPath( vscode.extensions.getExtension('codestory-ghost.codestoryai')?.extensionUri ?? vscode.Uri.parse(''), 'assets', diff --git a/extensions/codestory/src/server/types.ts b/extensions/codestory/src/server/types.ts index c9d38bfec2a..d769bddbe99 100644 --- a/extensions/codestory/src/server/types.ts +++ b/extensions/codestory/src/server/types.ts @@ -115,8 +115,8 @@ interface SearchQuery { } type SearchResultSnippet = - | { type: 'FileContent', content: Uint8Array } - | { type: 'Tag', tag: string }; + | { type: 'FileContent'; content: Uint8Array } + | { type: 'Tag'; tag: string }; interface SearchResult { path: string; @@ -141,14 +141,14 @@ interface DecideResponse { type IterativeSearchEvent = | { type: 'SearchStarted' } - | { type: 'SeedApplied', duration: Duration } - | { type: 'SearchQueriesGenerated', queries: SearchQuery[], duration: Duration } - | { type: 'SearchExecuted', results: SearchResult[], duration: Duration } - | { type: 'IdentificationCompleted', response: IdentifyResponse, duration: Duration } - | { type: 'FileOutlineGenerated', duration: Duration } - | { type: 'DecisionMade', response: DecideResponse, duration: Duration } - | { type: 'LoopCompleted', iteration: number, duration: Duration } - | { type: 'SearchCompleted', duration: Duration }; + | { type: 'SeedApplied'; duration: Duration } + | { type: 'SearchQueriesGenerated'; queries: SearchQuery[]; duration: Duration } + | { type: 'SearchExecuted'; results: SearchResult[]; duration: Duration } + | { type: 'IdentificationCompleted'; response: IdentifyResponse; duration: Duration } + | { type: 'FileOutlineGenerated'; duration: Duration } + | { type: 'DecisionMade'; response: DecideResponse; duration: Duration } + | { type: 'LoopCompleted'; iteration: number; duration: Duration } + | { type: 'SearchCompleted'; duration: Duration }; interface Duration { secs: number; diff --git a/extensions/codestory/src/sidecar/client.ts b/extensions/codestory/src/sidecar/client.ts index 2ff709f008d..21cb590c71b 100644 --- a/extensions/codestory/src/sidecar/client.ts +++ b/extensions/codestory/src/sidecar/client.ts @@ -7,10 +7,11 @@ import * as path from 'path'; import * as vscode from 'vscode'; import { sidecarTypeDefinitionsWithNode } from '../completions/helpers/vscodeApi'; import { LoggingService } from '../completions/logger'; -import { OPEN_FILES_VARIABLE } from '../completions/providers/openFiles'; import { StreamCompletionResponse, StreamCompletionResponseUpdates } from '../completions/providers/fetch-and-process-completions'; +import { OPEN_FILES_VARIABLE } from '../completions/providers/openFiles'; import { TERMINAL_SELECTION_VARIABLE } from '../completions/providers/terminalSelection'; import { CompletionRequest, CompletionResponse } from '../inlineCompletion/sidecarCompletion'; +import { CodeEditAgentBody, ProbeAgentBody, SideCarAgentEvent, UserContext } from '../server/types'; import { SelectionDataForExplain } from '../utilities/getSelectionContext'; import { sidecarNotIndexRepository } from '../utilities/sidecarUrl'; import { sleep } from '../utilities/sleep'; @@ -19,8 +20,6 @@ import { CodeSymbolInformationEmbeddings, CodeSymbolKind } from '../utilities/ty import { getUserId } from '../utilities/uniqueId'; import { callServerEventStreamingBufferedGET, callServerEventStreamingBufferedPOST } from './ssestream'; import { ConversationMessage, EditFileResponse, getSideCarModelConfiguration, IdentifierNodeType, InEditorRequest, InEditorTreeSitterDocumentationQuery, InEditorTreeSitterDocumentationReply, InLineAgentMessage, Position, RepoStatus, SemanticSearchResponse, SidecarVariableType, SidecarVariableTypes, SnippetInformation, SyncUpdate, TextDocument } from './types'; -import { CodeEditAgentBody, ProbeAgentBody, SideCarAgentEvent, UserContext } from '../server/types'; -import { Diagnostic } from 'vscode'; export enum CompletionStopReason { /** @@ -634,7 +633,7 @@ export class SideCarClient { async sendDiagnostics( filePath: string, - diagnostics: readonly Diagnostic[] + diagnostics: readonly vscode.Diagnostic[] ): Promise { const textDocument = await vscode.workspace.openTextDocument(vscode.Uri.file(filePath)); const baseUrl = new URL(this._url); diff --git a/extensions/codestory/tsconfig.json b/extensions/codestory/tsconfig.json index 59e4bb1bb11..8f8ab546055 100644 --- a/extensions/codestory/tsconfig.json +++ b/extensions/codestory/tsconfig.json @@ -8,8 +8,6 @@ "include": [ "src/**/*", "../../src/vscode-dts/vscode.d.ts", - "../../src/vscode-dts/vscode.proposed.aideChatParticipant.d.ts", - "../../src/vscode-dts/vscode.proposed.aideChatVariableResolver.d.ts", "../../src/vscode-dts/vscode.proposed.aideProbe.d.ts", "../../src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts", "../../src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts", diff --git a/extensions/codestory/yarn.lock b/extensions/codestory/yarn.lock deleted file mode 100644 index 843531224b8..00000000000 --- a/extensions/codestory/yarn.lock +++ /dev/null @@ -1,1030 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@colors/colors@1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" - integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== - -"@dabh/diagnostics@^2.0.2": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.3.tgz#7f7e97ee9a725dffc7808d93668cc984e1dc477a" - integrity sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA== - dependencies: - colorspace "1.1.x" - enabled "2.0.x" - kuler "^2.0.0" - -"@google-cloud/paginator@^3.0.7": - version "3.0.7" - resolved "https://registry.yarnpkg.com/@google-cloud/paginator/-/paginator-3.0.7.tgz#fb6f8e24ec841f99defaebf62c75c2e744dd419b" - integrity sha512-jJNutk0arIQhmpUUQJPJErsojqo834KcyB6X7a1mxuic8i1tKXxde8E69IZxNZawRIlZdIK2QY4WALvlK5MzYQ== - dependencies: - arrify "^2.0.0" - extend "^3.0.2" - -"@google-cloud/projectify@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@google-cloud/projectify/-/projectify-3.0.0.tgz#302b25f55f674854dce65c2532d98919b118a408" - integrity sha512-HRkZsNmjScY6Li8/kb70wjGlDDyLkVk3KvoEo9uIoxSjYLJasGiCch9+PqRVDOCGUFvEIqyogl+BeqILL4OJHA== - -"@google-cloud/promisify@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@google-cloud/promisify/-/promisify-3.0.1.tgz#8d724fb280f47d1ff99953aee0c1669b25238c2e" - integrity sha512-z1CjRjtQyBOYL+5Qr9DdYIfrdLBe746jRTYfaYU6MeXkqp7UfYs/jX16lFFVzZ7PGEJvqZNqYUEtb1mvDww4pA== - -"@google-cloud/storage@^7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@google-cloud/storage/-/storage-7.0.1.tgz#38c267bb8377d442066d4eccb4f942f58d119476" - integrity sha512-YBJ8HaDZvbeVDgEGWuC6sCsfZNCooVfKg1J+CJ4iXwRejIWbKFjl8laWz8w+/+ucJHM9qOdGkB95Q/mhh2CX/A== - dependencies: - "@google-cloud/paginator" "^3.0.7" - "@google-cloud/projectify" "^3.0.0" - "@google-cloud/promisify" "^3.0.0" - abort-controller "^3.0.0" - async-retry "^1.3.3" - compressible "^2.0.12" - duplexify "^4.0.0" - ent "^2.2.0" - fast-xml-parser "^4.2.2" - gaxios "^6.0.2" - google-auth-library "^9.0.0" - mime "^3.0.0" - mime-types "^2.0.8" - p-limit "^3.0.1" - retry-request "^6.0.0" - teeny-request "^9.0.0" - uuid "^8.0.0" - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@tootallnate/once@2": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" - integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== - -"@ts-morph/common@~0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.20.0.tgz#3f161996b085ba4519731e4d24c35f6cba5b80af" - integrity sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q== - dependencies: - fast-glob "^3.2.12" - minimatch "^7.4.3" - mkdirp "^2.1.6" - path-browserify "^1.0.1" - -"@types/diff@^5.0.3": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@types/diff/-/diff-5.0.3.tgz#1f89e49ff83b5d200d78964fb896c68498ce1828" - integrity sha512-amrLbRqTU9bXMCc6uX0sWpxsQzRIo9z6MJPkH1pkez/qOxuqSZVuryJAWoBRq94CeG8JxY+VK4Le9HtjQR5T9A== - -"@types/js-levenshtein@^1.1.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz#a6fd0bdc8255b274e5438e0bfb25f154492d1106" - integrity sha512-jd+Q+sD20Qfu9e2aEXogiO3vpOC1PYJOUdyN9gvs4Qrvkg4wF43L5OhqrPeokdv8TL0/mXoYfpkcoGZMNN2pkQ== - -"@types/lodash@^4.14.202": - version "4.14.202" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.202.tgz#f09dbd2fb082d507178b2f2a5c7e74bd72ff98f8" - integrity sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ== - -"@types/node-fetch@^2.6.4": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "20.4.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.8.tgz#b5dda19adaa473a9bf0ab5cbd8f30ec7d43f5c85" - integrity sha512-0mHckf6D2DiIAzh8fM8f3HQCvMKDpK94YQ0DSVkfWTG9BZleYIWudw9cJxX8oCk9bM+vAkDyujDV6dmKHbvQpg== - -"@types/node@18.x": - version "18.19.22" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.22.tgz#f622f92514b897e6b09903e97c16a0db8e94689f" - integrity sha512-p3pDIfuMg/aXBmhkyanPshdfJuX5c5+bQjYLIikPLXAUycEogij/c50n/C+8XOA5L93cU4ZRXtn+dNQGi0IZqQ== - dependencies: - undici-types "~5.26.4" - -"@types/node@^18.11.18": - version "18.17.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.17.6.tgz#0296e9a30b22d2a8fcaa48d3c45afe51474ca55b" - integrity sha512-fGmT/P7z7ecA6bv/ia5DlaWCH4YeZvAQMNpUhrJjtAhOhZfoxS1VLUgU2pdk63efSjQaOJWdXMuAJsws+8I6dg== - -"@types/triple-beam@^1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.2.tgz#38ecb64f01aa0d02b7c8f4222d7c38af6316fef8" - integrity sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g== - -"@types/uuid@^9.0.2": - version "9.0.8" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.8.tgz#7545ba4fc3c003d6c756f651f3bf163d8f0f29ba" - integrity sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA== - -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -agent-base@^7.0.2: - version "7.1.0" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.0.tgz#536802b76bc0b34aa50195eb2442276d613e3434" - integrity sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg== - dependencies: - debug "^4.3.4" - -agentkeepalive@^4.2.1: - version "4.5.0" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923" - integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== - dependencies: - humanize-ms "^1.2.1" - -arrify@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" - integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== - -async-retry@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" - integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== - dependencies: - retry "0.13.1" - -async@^3.2.3: - version "3.2.4" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" - integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - -axios@^0.27.0: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== - dependencies: - follow-redirects "^1.14.9" - form-data "^4.0.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base-64@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" - integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA== - -base64-js@^1.3.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -bignumber.js@^9.0.0: - version "9.1.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" - integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -braces@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -buffer-equal-constant-time@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" - integrity sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA== - -charenc@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== - -code-block-writer@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-12.0.0.tgz#4dd58946eb4234105aff7f0035977b2afdc2a770" - integrity sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w== - -color-convert@^1.9.3: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - -color-name@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -color-string@^1.6.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.1.tgz#4467f9146f036f855b764dfb5bf8582bf342c7a4" - integrity sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg== - dependencies: - color-name "^1.0.0" - simple-swizzle "^0.2.2" - -color@^3.1.3: - version "3.2.1" - resolved "https://registry.yarnpkg.com/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164" - integrity sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA== - dependencies: - color-convert "^1.9.3" - color-string "^1.6.0" - -colorspace@1.1.x: - version "1.1.4" - resolved "https://registry.yarnpkg.com/colorspace/-/colorspace-1.1.4.tgz#8d442d1186152f60453bf8070cd66eb364e59243" - integrity sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w== - dependencies: - color "^3.1.3" - text-hex "1.0.x" - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -compressible@^2.0.12: - version "2.0.18" - resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" - integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg== - dependencies: - mime-db ">= 1.43.0 < 2" - -crypt@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== - -data-uri-to-buffer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" - integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== - -debug@4, debug@^4.1.1, debug@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -diff@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" - integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== - -digest-fetch@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/digest-fetch/-/digest-fetch-1.3.0.tgz#898e69264d00012a23cf26e8a3e40320143fc661" - integrity sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA== - dependencies: - base-64 "^0.1.0" - md5 "^2.3.0" - -duplexify@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.2.tgz#18b4f8d28289132fa0b9573c898d9f903f81c7b0" - integrity sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw== - dependencies: - end-of-stream "^1.4.1" - inherits "^2.0.3" - readable-stream "^3.1.1" - stream-shift "^1.0.0" - -ecdsa-sig-formatter@1.0.11, ecdsa-sig-formatter@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" - integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== - dependencies: - safe-buffer "^5.0.1" - -enabled@2.0.x: - version "2.0.0" - resolved "https://registry.yarnpkg.com/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" - integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ== - -end-of-stream@^1.4.1: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -ent@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA== - -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - -extend@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -fast-glob@^3.2.12: - version "3.3.1" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" - integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-xml-parser@^4.2.2: - version "4.2.7" - resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.2.7.tgz#871f2ca299dc4334b29f8da3658c164e68395167" - integrity sha512-J8r6BriSLO1uj2miOk1NW0YVm8AGOOu3Si2HQp/cSmo6EA4m3fcwu2WKjJ4RK9wMLBtg69y1kS8baDiQBR41Ig== - dependencies: - strnum "^1.0.5" - -fastq@^1.6.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" - integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== - dependencies: - reusify "^1.0.4" - -fecha@^4.2.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd" - integrity sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw== - -fetch-blob@^3.1.2, fetch-blob@^3.1.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" - integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== - dependencies: - node-domexception "^1.0.0" - web-streams-polyfill "^3.0.3" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -fn.name@1.x.x: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" - integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== - -follow-redirects@^1.14.9: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== - -form-data-encoder@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.2.tgz#1f1ae3dccf58ed4690b86d87e4f57c654fbab040" - integrity sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A== - -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -formdata-node@^4.3.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/formdata-node/-/formdata-node-4.4.1.tgz#23f6a5cb9cb55315912cbec4ff7b0f59bbd191e2" - integrity sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ== - dependencies: - node-domexception "1.0.0" - web-streams-polyfill "4.0.0-beta.3" - -formdata-polyfill@^4.0.10: - version "4.0.10" - resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" - integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== - dependencies: - fetch-blob "^3.1.2" - -gaxios@^6.0.0, gaxios@^6.0.2: - version "6.1.0" - resolved "https://registry.yarnpkg.com/gaxios/-/gaxios-6.1.0.tgz#8ab08adbf9cc600368a57545f58e004ccf831ccb" - integrity sha512-EIHuesZxNyIkUGcTQKQPMICyOpDD/bi+LJIJx+NLsSGmnS7N+xCLRX5bi4e9yAu9AlSZdVq+qlyWWVuTh/483w== - dependencies: - extend "^3.0.2" - https-proxy-agent "^7.0.1" - is-stream "^2.0.0" - node-fetch "^2.6.9" - -gcp-metadata@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/gcp-metadata/-/gcp-metadata-6.0.0.tgz#2ae12008bef8caa8726cba31fd0a641ebad5fb56" - integrity sha512-Ozxyi23/1Ar51wjUT2RDklK+3HxqDr8TLBNK8rBBFQ7T85iIGnXnVusauj06QyqCXRFZig8LZC+TUddWbndlpQ== - dependencies: - gaxios "^6.0.0" - json-bigint "^1.0.0" - -glob-parent@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -google-auth-library@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-9.0.0.tgz#b159d22464c679a6a25cb46d48a4ac97f9f426a2" - integrity sha512-IQGjgQoVUAfOk6khqTVMLvWx26R+yPw9uLyb1MNyMQpdKiKt0Fd9sp4NWoINjyGHR8S3iw12hMTYK7O8J07c6Q== - dependencies: - base64-js "^1.3.0" - ecdsa-sig-formatter "^1.0.11" - gaxios "^6.0.0" - gcp-metadata "^6.0.0" - gtoken "^7.0.0" - jws "^4.0.0" - lru-cache "^6.0.0" - -gtoken@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/gtoken/-/gtoken-7.0.1.tgz#b64bd01d88268ea3a3572c9076a85d1c48f1a455" - integrity sha512-KcFVtoP1CVFtQu0aSk3AyAt2og66PFhZAlkUOuWKwzMLoulHXG5W5wE5xAnHb+yl3/wEFoqGW7/cDGMU8igDZQ== - dependencies: - gaxios "^6.0.0" - jws "^4.0.0" - -http-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" - integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== - dependencies: - "@tootallnate/once" "2" - agent-base "6" - debug "4" - -https-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - -https-proxy-agent@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.1.tgz#0277e28f13a07d45c663633841e20a40aaafe0ab" - integrity sha512-Eun8zV0kcYS1g19r78osiQLEFIRspRUDd9tIfBCTBPBeMieF/EsJNL8VI3xOIdYRDEkjQnqOYPsZ2DsWsVsFwQ== - dependencies: - agent-base "^7.0.2" - debug "4" - -humanize-ms@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" - integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== - dependencies: - ms "^2.0.0" - -inherits@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -is-arrayish@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" - integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== - -is-buffer@~1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-glob@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - -js-levenshtein@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" - integrity sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g== - -json-bigint@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1" - integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ== - dependencies: - bignumber.js "^9.0.0" - -jwa@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/jwa/-/jwa-2.0.0.tgz#a7e9c3f29dae94027ebcaf49975c9345593410fc" - integrity sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA== - dependencies: - buffer-equal-constant-time "1.0.1" - ecdsa-sig-formatter "1.0.11" - safe-buffer "^5.0.1" - -jws@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jws/-/jws-4.0.0.tgz#2d4e8cf6a318ffaa12615e9dec7e86e6c97310f4" - integrity sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg== - dependencies: - jwa "^2.0.0" - safe-buffer "^5.0.1" - -kuler@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" - integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A== - -lodash@^4.17.21: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -logform@^2.3.2, logform@^2.4.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/logform/-/logform-2.5.1.tgz#44c77c34becd71b3a42a3970c77929e52c6ed48b" - integrity sha512-9FyqAm9o9NKKfiAKfZoYo9bGXXuwMkxQiQttkT4YjjVtQVIQtK6LmVtlxmCaFswo6N4AfEkHqZTV0taDtPotNg== - dependencies: - "@colors/colors" "1.5.0" - "@types/triple-beam" "^1.3.2" - fecha "^4.2.0" - ms "^2.1.1" - safe-stable-stringify "^2.3.1" - triple-beam "^1.3.0" - -lru-cache@^10.2.0: - version "10.2.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3" - integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q== - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -md5@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/md5/-/md5-2.3.0.tgz#c3da9a6aae3a30b46b7b0c349b87b110dc3bda4f" - integrity sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g== - dependencies: - charenc "0.0.2" - crypt "0.0.2" - is-buffer "~1.1.6" - -merge2@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - -mime-db@1.52.0, "mime-db@>= 1.43.0 < 2": - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.0.8, mime-types@^2.1.12: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - -mime@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" - integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== - -minimatch@^7.4.3: - version "7.4.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.6.tgz#845d6f254d8f4a5e4fd6baf44d5f10c8448365fb" - integrity sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw== - dependencies: - brace-expansion "^2.0.1" - -mkdirp@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" - integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@^2.0.0, ms@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -node-domexception@1.0.0, node-domexception@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" - integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== - -node-fetch@^2.6.7: - version "2.6.13" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.13.tgz#a20acbbec73c2e09f9007de5cda17104122e0010" - integrity sha512-StxNAxh15zr77QvvkmveSQ8uCQ4+v5FkvNTj0OESmiHu+VRi/gXArXtkWMElOsOUNLtUEvI4yS+rdtOHZTwlQA== - dependencies: - whatwg-url "^5.0.0" - -node-fetch@^2.6.9: - version "2.6.12" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" - integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== - dependencies: - whatwg-url "^5.0.0" - -node-fetch@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" - integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== - dependencies: - data-uri-to-buffer "^4.0.0" - fetch-blob "^3.1.4" - formdata-polyfill "^4.0.10" - -once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -one-time@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/one-time/-/one-time-1.0.0.tgz#e06bc174aed214ed58edede573b433bbf827cb45" - integrity sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g== - dependencies: - fn.name "1.x.x" - -openai@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/openai/-/openai-4.0.1.tgz#bcf1b4a53ee23f2df0f60e96eadc908c95eed1e2" - integrity sha512-UanMv/kCD/ylgOdBrkkRgkoFXdfENrXYWNvYdvPttXZaEJmRVY9MZSknlkWYH7iPMX6tTcz6szbI2d3O04UFag== - dependencies: - "@types/node" "^18.11.18" - "@types/node-fetch" "^2.6.4" - abort-controller "^3.0.0" - agentkeepalive "^4.2.1" - digest-fetch "^1.3.0" - form-data-encoder "1.7.2" - formdata-node "^4.3.2" - node-fetch "^2.6.7" - -p-limit@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -path-browserify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - -picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -posthog-node@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/posthog-node/-/posthog-node-3.1.1.tgz#f92c44a871552c9bfb98bf4cc8fd326d36af6cbd" - integrity sha512-OUSYcnLHbzvY/dxNsbUGoYuTZz5XNx48BkfiCkOIJZMFvot5VPQ0KWEjX+kzYxEwHeXbjW9plqsOVcYCYfidgg== - dependencies: - axios "^0.27.0" - rusha "^0.8.14" - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -retry-request@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/retry-request/-/retry-request-6.0.0.tgz#a74dbbab421b51daefa20228f6036e6e2a0f1169" - integrity sha512-24kaFMd3wCnT3n4uPnsQh90ZSV8OISpfTFXJ00Wi+/oD2OPrp63EQ8hznk6rhxdlpwx2QBhQSDz2Fg46ki852g== - dependencies: - debug "^4.1.1" - extend "^3.0.2" - -retry@0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" - integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -rusha@^0.8.14: - version "0.8.14" - resolved "https://registry.yarnpkg.com/rusha/-/rusha-0.8.14.tgz#a977d0de9428406138b7bb90d3de5dcd024e2f68" - integrity sha512-cLgakCUf6PedEu15t8kbsjnwIFFR2D4RfL+W3iWFJ4iac7z4B0ZI8fxy4R3J956kAI68HclCFGL8MPoUVC3qVA== - -safe-buffer@^5.0.1, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-stable-stringify@^2.3.1: - version "2.4.3" - resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz#138c84b6f6edb3db5f8ef3ef7115b8f55ccbf886" - integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g== - -simple-swizzle@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" - integrity sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg== - dependencies: - is-arrayish "^0.3.1" - -stack-trace@0.0.x: - version "0.0.10" - resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" - integrity sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg== - -stream-events@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/stream-events/-/stream-events-1.0.5.tgz#bbc898ec4df33a4902d892333d47da9bf1c406d5" - integrity sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg== - dependencies: - stubs "^3.0.0" - -stream-shift@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" - integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -strnum@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.0.5.tgz#5c4e829fe15ad4ff0d20c3db5ac97b73c9b072db" - integrity sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA== - -stubs@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" - integrity sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw== - -teeny-request@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/teeny-request/-/teeny-request-9.0.0.tgz#18140de2eb6595771b1b02203312dfad79a4716d" - integrity sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g== - dependencies: - http-proxy-agent "^5.0.0" - https-proxy-agent "^5.0.0" - node-fetch "^2.6.9" - stream-events "^1.0.5" - uuid "^9.0.0" - -text-hex@1.0.x: - version "1.0.0" - resolved "https://registry.yarnpkg.com/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5" - integrity sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - -triple-beam@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.4.1.tgz#6fde70271dc6e5d73ca0c3b24e2d92afb7441984" - integrity sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg== - -ts-morph@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-19.0.0.tgz#43e95fb0156c3fe3c77c814ac26b7d0be2f93169" - integrity sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ== - dependencies: - "@ts-morph/common" "~0.20.0" - code-block-writer "^12.0.0" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -uuid@^8.0.0: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - -uuid@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" - integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== - -web-streams-polyfill@4.0.0-beta.3: - version "4.0.0-beta.3" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz#2898486b74f5156095e473efe989dcf185047a38" - integrity sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug== - -web-streams-polyfill@^3.0.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b" - integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw== - -web-tree-sitter@^0.20.8: - version "0.20.8" - resolved "https://registry.yarnpkg.com/web-tree-sitter/-/web-tree-sitter-0.20.8.tgz#1e371cb577584789cadd75cb49c7ddfbc99d04c8" - integrity sha512-weOVgZ3aAARgdnb220GqYuh7+rZU0Ka9k9yfKtGAzEYMa6GgiCzW9JjQRJyCJakvibQW+dfjJdihjInKuuCAUQ== - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -winston-transport@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.5.0.tgz#6e7b0dd04d393171ed5e4e4905db265f7ab384fa" - integrity sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q== - dependencies: - logform "^2.3.2" - readable-stream "^3.6.0" - triple-beam "^1.3.0" - -winston-vscode@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/winston-vscode/-/winston-vscode-1.0.0.tgz#108c6cc7e8419adf6ec8f631d475ab0217af2f7f" - integrity sha512-pC9WBAJd+1RzsKlorv1YBRSO0kmQlA4VG5+twxggpr3z7wCTj4lXFe0uLNwZ+GXCJ4BlYCX5kf3iEKRPFpZ0Hw== - dependencies: - winston-transport "^4.5.0" - -winston@^3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/winston/-/winston-3.10.0.tgz#d033cb7bd3ced026fed13bf9d92c55b903116803" - integrity sha512-nT6SIDaE9B7ZRO0u3UvdrimG0HkB7dSTAgInQnNR2SOPJ4bvq5q79+pXLftKmP52lJGW15+H5MCK0nM9D3KB/g== - dependencies: - "@colors/colors" "1.5.0" - "@dabh/diagnostics" "^2.0.2" - async "^3.2.3" - is-stream "^2.0.0" - logform "^2.4.0" - one-time "^1.0.0" - readable-stream "^3.4.0" - safe-stable-stringify "^2.3.1" - stack-trace "0.0.x" - triple-beam "^1.3.0" - winston-transport "^4.5.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/extensions/coffeescript/yarn.lock b/extensions/coffeescript/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/coffeescript/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/configuration-editing/.vscodeignore b/extensions/configuration-editing/.vscodeignore index cfa2d155c50..679a6d6859f 100644 --- a/extensions/configuration-editing/.vscodeignore +++ b/extensions/configuration-editing/.vscodeignore @@ -4,7 +4,7 @@ tsconfig.json out/** extension.webpack.config.js extension-browser.webpack.config.js -yarn.lock +package-lock.json build/** schemas/devContainer.codespaces.schema.json schemas/devContainer.vscode.schema.json diff --git a/extensions/configuration-editing/package-lock.json b/extensions/configuration-editing/package-lock.json new file mode 100644 index 00000000000..199dcf7f755 --- /dev/null +++ b/extensions/configuration-editing/package-lock.json @@ -0,0 +1,296 @@ +{ + "name": "configuration-editing", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "configuration-editing", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@octokit/rest": "19.0.4", + "jsonc-parser": "^3.2.0", + "tunnel": "^0.0.6" + }, + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "^1.0.0" + } + }, + "node_modules/@octokit/auth-token": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.4.tgz", + "integrity": "sha512-TWFX7cZF2LXoCvdmJWY7XVPi74aSY0+FfBZNSXEXFkMpjcqsQwDSYVv5FhRFaI0V1ECnwbz4j59T/G+rXNWaIQ==", + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/core": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.4.tgz", + "integrity": "sha512-rYKilwgzQ7/imScn3M9/pFfUf4I1AZEH3KhyJmtPdE2zfaXAn2mFfUy4FbKewzc2We5y/LlKLj36fWJLKC2SIQ==", + "dependencies": { + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/endpoint": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.6.tgz", + "integrity": "sha512-5L4fseVRUsDFGR00tMWD/Trdeeihn999rTMGRMC1G/Ldi1uWlWJzI98H4Iak5DB/RVvQuyMYKqSK/R6mbSOQyg==", + "dependencies": { + "@octokit/types": "^9.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/graphql": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.6.tgz", + "integrity": "sha512-Fxyxdy/JH0MnIB5h+UQ3yCoh1FG4kWXfFKkpWqjZHw/p+Kc8Y44Hu/kCgNBT6nU1shNumEchmW/sUO1JuQnPcw==", + "dependencies": { + "@octokit/request": "^6.0.0", + "@octokit/types": "^9.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz", + "integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-4.3.1.tgz", + "integrity": "sha512-h8KKxESmSFTcXX409CAxlaOYscEDvN2KGQRsLCGT1NSqRW+D6EXLVQ8vuHhFznS9MuH9QYw1GfsUN30bg8hjVA==", + "dependencies": { + "@octokit/types": "^7.5.0" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=4" + } + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { + "version": "13.13.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.13.1.tgz", + "integrity": "sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ==" + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.1.tgz", + "integrity": "sha512-Zk4OUMLCSpXNI8KZZn47lVLJSsgMyCimsWWQI5hyjZg7hdYm0kjotaIkbG0Pp8SfU2CofMBzonboTqvzn3FrJA==", + "dependencies": { + "@octokit/openapi-types": "^13.11.0" + } + }, + "node_modules/@octokit/plugin-request-log": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.8.1.tgz", + "integrity": "sha512-QrlaTm8Lyc/TbU7BL/8bO49vp+RZ6W3McxxmmQTgYxf2sWkO8ZKuj4dLhPNJD6VCUW1hetCmeIM0m6FTVpDiEg==", + "dependencies": { + "@octokit/types": "^8.1.1", + "deprecation": "^2.3.1" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-14.0.0.tgz", + "integrity": "sha512-HNWisMYlR8VCnNurDU6os2ikx0s0VyEjDYHNS/h4cgb8DeOxQ0n72HyinUtdDVxJhFy3FWLGl0DJhfEWk3P5Iw==" + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-8.2.1.tgz", + "integrity": "sha512-8oWMUji8be66q2B9PmEIUyQm00VPDPun07umUWSaCwxmeaquFBro4Hcc3ruVoDo3zkQyZBlRvhIMEYS3pBhanw==", + "dependencies": { + "@octokit/openapi-types": "^14.0.0" + } + }, + "node_modules/@octokit/request": { + "version": "6.2.8", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.8.tgz", + "integrity": "sha512-ow4+pkVQ+6XVVsekSYBzJC0VTVvh/FCTUUgTsboGq+DTeWdyIFV8WSCdo0RIxk6wSkBTHqIK1mYuY7nOBXOchw==", + "dependencies": { + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/request-error": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.3.tgz", + "integrity": "sha512-crqw3V5Iy2uOU5Np+8M/YexTlT8zxCfI+qu+LxUB7SZpje4Qmx3mub5DfEKSO8Ylyk0aogi6TYdf6kxzh2BguQ==", + "dependencies": { + "@octokit/types": "^9.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/rest": { + "version": "19.0.4", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.4.tgz", + "integrity": "sha512-LwG668+6lE8zlSYOfwPj4FxWdv/qFXYBpv79TWIQEpBLKA9D/IMcWsF/U9RGpA3YqMVDiTxpgVpEW3zTFfPFTA==", + "dependencies": { + "@octokit/core": "^4.0.0", + "@octokit/plugin-paginate-rest": "^4.0.0", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/types": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", + "dependencies": { + "@octokit/openapi-types": "^18.0.0" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/before-after-hook": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" + }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + } + } +} diff --git a/extensions/configuration-editing/schemas/devContainer.codespaces.schema.json b/extensions/configuration-editing/schemas/devContainer.codespaces.schema.json index 681ca6105cf..3f8400a7bd4 100644 --- a/extensions/configuration-editing/schemas/devContainer.codespaces.schema.json +++ b/extensions/configuration-editing/schemas/devContainer.codespaces.schema.json @@ -180,6 +180,11 @@ "items": { "type": "string" } + }, + "disableAutomaticConfiguration": { + "type": "boolean", + "description": "Disables the setup that is automatically run in a codespace if no `postCreateCommand` is specified.", + "default": false } } } diff --git a/extensions/configuration-editing/yarn.lock b/extensions/configuration-editing/yarn.lock deleted file mode 100644 index 0e7d733c76f..00000000000 --- a/extensions/configuration-editing/yarn.lock +++ /dev/null @@ -1,205 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@octokit/auth-token@^3.0.0": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-3.0.4.tgz#70e941ba742bdd2b49bdb7393e821dea8520a3db" - integrity sha512-TWFX7cZF2LXoCvdmJWY7XVPi74aSY0+FfBZNSXEXFkMpjcqsQwDSYVv5FhRFaI0V1ECnwbz4j59T/G+rXNWaIQ== - -"@octokit/core@^4.0.0": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-4.2.4.tgz#d8769ec2b43ff37cc3ea89ec4681a20ba58ef907" - integrity sha512-rYKilwgzQ7/imScn3M9/pFfUf4I1AZEH3KhyJmtPdE2zfaXAn2mFfUy4FbKewzc2We5y/LlKLj36fWJLKC2SIQ== - dependencies: - "@octokit/auth-token" "^3.0.0" - "@octokit/graphql" "^5.0.0" - "@octokit/request" "^6.0.0" - "@octokit/request-error" "^3.0.0" - "@octokit/types" "^9.0.0" - before-after-hook "^2.2.0" - universal-user-agent "^6.0.0" - -"@octokit/endpoint@^7.0.0": - version "7.0.6" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-7.0.6.tgz#791f65d3937555141fb6c08f91d618a7d645f1e2" - integrity sha512-5L4fseVRUsDFGR00tMWD/Trdeeihn999rTMGRMC1G/Ldi1uWlWJzI98H4Iak5DB/RVvQuyMYKqSK/R6mbSOQyg== - dependencies: - "@octokit/types" "^9.0.0" - is-plain-object "^5.0.0" - universal-user-agent "^6.0.0" - -"@octokit/graphql@^5.0.0": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-5.0.6.tgz#9eac411ac4353ccc5d3fca7d76736e6888c5d248" - integrity sha512-Fxyxdy/JH0MnIB5h+UQ3yCoh1FG4kWXfFKkpWqjZHw/p+Kc8Y44Hu/kCgNBT6nU1shNumEchmW/sUO1JuQnPcw== - dependencies: - "@octokit/request" "^6.0.0" - "@octokit/types" "^9.0.0" - universal-user-agent "^6.0.0" - -"@octokit/openapi-types@^13.11.0": - version "13.13.1" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-13.13.1.tgz#a783bacb1817c9f61a2a0c3f81ea22ad62340fdf" - integrity sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ== - -"@octokit/openapi-types@^14.0.0": - version "14.0.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-14.0.0.tgz#949c5019028c93f189abbc2fb42f333290f7134a" - integrity sha512-HNWisMYlR8VCnNurDU6os2ikx0s0VyEjDYHNS/h4cgb8DeOxQ0n72HyinUtdDVxJhFy3FWLGl0DJhfEWk3P5Iw== - -"@octokit/openapi-types@^18.0.0": - version "18.0.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-18.0.0.tgz#f43d765b3c7533fd6fb88f3f25df079c24fccf69" - integrity sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw== - -"@octokit/plugin-paginate-rest@^4.0.0": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-4.3.1.tgz#553e653ee0318605acd23bf3a799c8bfafdedae3" - integrity sha512-h8KKxESmSFTcXX409CAxlaOYscEDvN2KGQRsLCGT1NSqRW+D6EXLVQ8vuHhFznS9MuH9QYw1GfsUN30bg8hjVA== - dependencies: - "@octokit/types" "^7.5.0" - -"@octokit/plugin-request-log@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" - integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== - -"@octokit/plugin-rest-endpoint-methods@^6.0.0": - version "6.8.1" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.8.1.tgz#97391fda88949eb15f68dc291957ccbe1d3e8ad1" - integrity sha512-QrlaTm8Lyc/TbU7BL/8bO49vp+RZ6W3McxxmmQTgYxf2sWkO8ZKuj4dLhPNJD6VCUW1hetCmeIM0m6FTVpDiEg== - dependencies: - "@octokit/types" "^8.1.1" - deprecation "^2.3.1" - -"@octokit/request-error@^3.0.0": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-3.0.3.tgz#ef3dd08b8e964e53e55d471acfe00baa892b9c69" - integrity sha512-crqw3V5Iy2uOU5Np+8M/YexTlT8zxCfI+qu+LxUB7SZpje4Qmx3mub5DfEKSO8Ylyk0aogi6TYdf6kxzh2BguQ== - dependencies: - "@octokit/types" "^9.0.0" - deprecation "^2.0.0" - once "^1.4.0" - -"@octokit/request@^6.0.0": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-6.2.8.tgz#aaf480b32ab2b210e9dadd8271d187c93171d8eb" - integrity sha512-ow4+pkVQ+6XVVsekSYBzJC0VTVvh/FCTUUgTsboGq+DTeWdyIFV8WSCdo0RIxk6wSkBTHqIK1mYuY7nOBXOchw== - dependencies: - "@octokit/endpoint" "^7.0.0" - "@octokit/request-error" "^3.0.0" - "@octokit/types" "^9.0.0" - is-plain-object "^5.0.0" - node-fetch "^2.6.7" - universal-user-agent "^6.0.0" - -"@octokit/rest@19.0.4": - version "19.0.4" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-19.0.4.tgz#fd8bed1cefffa486e9ae46a9dc608ce81bcfcbdd" - integrity sha512-LwG668+6lE8zlSYOfwPj4FxWdv/qFXYBpv79TWIQEpBLKA9D/IMcWsF/U9RGpA3YqMVDiTxpgVpEW3zTFfPFTA== - dependencies: - "@octokit/core" "^4.0.0" - "@octokit/plugin-paginate-rest" "^4.0.0" - "@octokit/plugin-request-log" "^1.0.4" - "@octokit/plugin-rest-endpoint-methods" "^6.0.0" - -"@octokit/types@^7.5.0": - version "7.5.1" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-7.5.1.tgz#4e8b182933c17e1f41cc25d44757dbdb7bd76c1b" - integrity sha512-Zk4OUMLCSpXNI8KZZn47lVLJSsgMyCimsWWQI5hyjZg7hdYm0kjotaIkbG0Pp8SfU2CofMBzonboTqvzn3FrJA== - dependencies: - "@octokit/openapi-types" "^13.11.0" - -"@octokit/types@^8.1.1": - version "8.2.1" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-8.2.1.tgz#a6de091ae68b5541f8d4fcf9a12e32836d4648aa" - integrity sha512-8oWMUji8be66q2B9PmEIUyQm00VPDPun07umUWSaCwxmeaquFBro4Hcc3ruVoDo3zkQyZBlRvhIMEYS3pBhanw== - dependencies: - "@octokit/openapi-types" "^14.0.0" - -"@octokit/types@^9.0.0": - version "9.3.2" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-9.3.2.tgz#3f5f89903b69f6a2d196d78ec35f888c0013cac5" - integrity sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA== - dependencies: - "@octokit/openapi-types" "^18.0.0" - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -before-after-hook@^2.2.0: - version "2.2.3" - resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c" - integrity sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ== - -deprecation@^2.0.0, deprecation@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" - integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== - -is-plain-object@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" - integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== - -jsonc-parser@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" - integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== - -node-fetch@^2.6.7: - version "2.7.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - -once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - -tunnel@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" - integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -universal-user-agent@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" - integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== diff --git a/extensions/cpp/yarn.lock b/extensions/cpp/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/cpp/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/csharp/cgmanifest.json b/extensions/csharp/cgmanifest.json index 1c88bd17296..58a7408dbbe 100644 --- a/extensions/csharp/cgmanifest.json +++ b/extensions/csharp/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "dotnet/csharp-tmLanguage", "repositoryUrl": "https://github.com/dotnet/csharp-tmLanguage", - "commitHash": "7a7482ffc72a6677a87eb1ed76005593a4f7f131" + "commitHash": "d63e2661d4e0c83b6c7810eb1d0eedc5da843b04" } }, "license": "MIT", diff --git a/extensions/csharp/syntaxes/csharp.tmLanguage.json b/extensions/csharp/syntaxes/csharp.tmLanguage.json index 96dbe04473c..4a2497a064a 100644 --- a/extensions/csharp/syntaxes/csharp.tmLanguage.json +++ b/extensions/csharp/syntaxes/csharp.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/dotnet/csharp-tmLanguage/commit/7a7482ffc72a6677a87eb1ed76005593a4f7f131", + "version": "https://github.com/dotnet/csharp-tmLanguage/commit/d63e2661d4e0c83b6c7810eb1d0eedc5da843b04", "name": "C#", "scopeName": "source.cs", "patterns": [ @@ -512,6 +512,9 @@ { "include": "#type-name" }, + { + "include": "#type-arguments" + }, { "include": "#attribute-arguments" } diff --git a/extensions/csharp/yarn.lock b/extensions/csharp/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/csharp/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/css-language-features/.vscodeignore b/extensions/css-language-features/.vscodeignore index a08d9b8dec7..f6411e76fdb 100644 --- a/extensions/css-language-features/.vscodeignore +++ b/extensions/css-language-features/.vscodeignore @@ -11,9 +11,9 @@ server/tsconfig.json server/test/** server/bin/** server/build/** -server/yarn.lock +server/package-lock.json server/.npmignore -yarn.lock +package-lock.json server/extension.webpack.config.js extension.webpack.config.js server/extension-browser.webpack.config.js diff --git a/extensions/css-language-features/CONTRIBUTING.md b/extensions/css-language-features/CONTRIBUTING.md index 1c3928b847a..d0f491be3b7 100644 --- a/extensions/css-language-features/CONTRIBUTING.md +++ b/extensions/css-language-features/CONTRIBUTING.md @@ -2,13 +2,13 @@ ## Setup - Clone [microsoft/vscode](https://github.com/microsoft/vscode) -- Run `yarn` at `/`, this will install +- Run `npm i` at `/`, this will install - Dependencies for `/extension/css-language-features/` - Dependencies for `/extension/css-language-features/server/` - devDependencies such as `gulp` - Open `/extensions/css-language-features/` as the workspace in VS Code -- In `/extensions/css-language-features/` run `yarn compile`(or `yarn watch`) to build the client and server +- In `/extensions/css-language-features/` run `npm run compile`(or `npm run watch`) to build the client and server - Run the [`Launch Extension`](https://github.com/microsoft/vscode/blob/master/extensions/css-language-features/.vscode/launch.json) debug target in the Debug View. This will: - Launch a new VS Code instance with the `css-language-features` extension loaded - Open a `.css` file to activate the extension. The extension will start the CSS language server process. @@ -30,14 +30,14 @@ However, within this extension, you can run a development version of `vscode-css #### Linking `vscode-css-languageservice` in `css-language-features/server/` - Clone [microsoft/vscode-css-languageservice](https://github.com/microsoft/vscode-css-languageservice) -- Run `yarn` in `vscode-css-languageservice` -- Run `yarn link` in `vscode-css-languageservice`. This will compile and link `vscode-css-languageservice` -- In `css-language-features/server/`, run `yarn link vscode-css-languageservice` +- Run `npm i` in `vscode-css-languageservice` +- Run `npm link` in `vscode-css-languageservice`. This will compile and link `vscode-css-languageservice` +- In `css-language-features/server/`, run `npm link vscode-css-languageservice` #### Testing the development version of `vscode-css-languageservice` - Open both `vscode-css-languageservice` and this extension in a single workspace with [multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) feature -- Run `yarn watch` in `vscode-css-languageservice` to recompile the extension whenever it changes -- Run `yarn watch` at `css-language-features/server/` to recompile this extension with the linked version of `vscode-css-languageservice` +- Run `npm run watch` in `vscode-css-languageservice` to recompile the extension whenever it changes +- Run `npm run watch` at `css-language-features/server/` to recompile this extension with the linked version of `vscode-css-languageservice` - Make some changes in `vscode-css-languageservice` - Now when you run `Launch Extension` debug target, the launched instance will use your development version of `vscode-css-languageservice`. You can interactively test the language features. diff --git a/extensions/css-language-features/client/src/browser/cssClientMain.ts b/extensions/css-language-features/client/src/browser/cssClientMain.ts index 6522c786389..1d4153d9836 100644 --- a/extensions/css-language-features/client/src/browser/cssClientMain.ts +++ b/extensions/css-language-features/client/src/browser/cssClientMain.ts @@ -7,13 +7,7 @@ import { ExtensionContext, Uri, l10n } from 'vscode'; import { BaseLanguageClient, LanguageClientOptions } from 'vscode-languageclient'; import { startClient, LanguageClientConstructor } from '../cssClient'; import { LanguageClient } from 'vscode-languageclient/browser'; - -declare const Worker: { - new(stringUrl: string): any; -}; -declare const TextDecoder: { - new(encoding?: string): { decode(buffer: ArrayBuffer): string }; -}; +import { registerDropOrPasteResourceSupport } from '../dropOrPaste/dropOrPasteResource'; let client: BaseLanguageClient | undefined; @@ -25,11 +19,12 @@ export async function activate(context: ExtensionContext) { worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' }); const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => { - return new LanguageClient(id, name, clientOptions, worker); + return new LanguageClient(id, name, worker, clientOptions); }; client = await startClient(context, newLanguageClient, { TextDecoder }); + context.subscriptions.push(registerDropOrPasteResourceSupport({ language: 'css', scheme: '*' })); } catch (e) { console.log(e); } diff --git a/extensions/css-language-features/client/src/dropOrPaste/dropOrPasteResource.ts b/extensions/css-language-features/client/src/dropOrPaste/dropOrPasteResource.ts new file mode 100644 index 00000000000..6a4c38d2417 --- /dev/null +++ b/extensions/css-language-features/client/src/dropOrPaste/dropOrPasteResource.ts @@ -0,0 +1,152 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as path from 'path'; +import * as vscode from 'vscode'; +import { getDocumentDir, Mimes, Schemes } from './shared'; +import { UriList } from './uriList'; + +class DropOrPasteResourceProvider implements vscode.DocumentDropEditProvider, vscode.DocumentPasteEditProvider { + readonly kind = vscode.DocumentDropOrPasteEditKind.Empty.append('css', 'url'); + + async provideDocumentDropEdits( + document: vscode.TextDocument, + position: vscode.Position, + dataTransfer: vscode.DataTransfer, + token: vscode.CancellationToken, + ): Promise { + const uriList = await this.getUriList(dataTransfer); + if (!uriList.entries.length || token.isCancellationRequested) { + return; + } + + const snippet = await this.createUriListSnippet(document.uri, uriList); + if (!snippet || token.isCancellationRequested) { + return; + } + + return { + kind: this.kind, + title: snippet.label, + insertText: snippet.snippet.value, + yieldTo: this.pasteAsCssUrlByDefault(document, position) ? [] : [vscode.DocumentDropOrPasteEditKind.Empty.append('uri')] + }; + } + + async provideDocumentPasteEdits( + document: vscode.TextDocument, + ranges: readonly vscode.Range[], + dataTransfer: vscode.DataTransfer, + _context: vscode.DocumentPasteEditContext, + token: vscode.CancellationToken + ): Promise { + const uriList = await this.getUriList(dataTransfer); + if (!uriList.entries.length || token.isCancellationRequested) { + return; + } + + const snippet = await this.createUriListSnippet(document.uri, uriList); + if (!snippet || token.isCancellationRequested) { + return; + } + + return [{ + kind: this.kind, + title: snippet.label, + insertText: snippet.snippet.value, + yieldTo: this.pasteAsCssUrlByDefault(document, ranges[0].start) ? [] : [vscode.DocumentDropOrPasteEditKind.Empty.append('uri')] + }]; + } + + private async getUriList(dataTransfer: vscode.DataTransfer): Promise { + const urlList = await dataTransfer.get(Mimes.uriList)?.asString(); + if (urlList) { + return UriList.from(urlList); + } + + // Find file entries + const uris: vscode.Uri[] = []; + for (const [_, entry] of dataTransfer) { + const file = entry.asFile(); + if (file?.uri) { + uris.push(file.uri); + } + } + + return new UriList(uris.map(uri => ({ uri, str: uri.toString(true) }))); + } + + private async createUriListSnippet(docUri: vscode.Uri, uriList: UriList): Promise<{ readonly snippet: vscode.SnippetString; readonly label: string } | undefined> { + if (!uriList.entries.length) { + return; + } + + const snippet = new vscode.SnippetString(); + for (let i = 0; i < uriList.entries.length; i++) { + const uri = uriList.entries[i]; + const relativePath = getRelativePath(getDocumentDir(docUri), uri.uri); + const urlText = relativePath ?? uri.str; + + snippet.appendText(`url(${urlText})`); + if (i !== uriList.entries.length - 1) { + snippet.appendText(' '); + } + } + + return { + snippet, + label: uriList.entries.length > 1 + ? vscode.l10n.t('Insert url() Functions') + : vscode.l10n.t('Insert url() Function') + }; + } + + private pasteAsCssUrlByDefault(document: vscode.TextDocument, position: vscode.Position): boolean { + const regex = /url\(.+?\)/gi; + for (const match of Array.from(document.lineAt(position.line).text.matchAll(regex))) { + if (position.character > match.index && position.character < match.index + match[0].length) { + return false; + } + } + return true; + } +} + +function getRelativePath(fromFile: vscode.Uri | undefined, toFile: vscode.Uri): string | undefined { + if (fromFile && fromFile.scheme === toFile.scheme && fromFile.authority === toFile.authority) { + if (toFile.scheme === Schemes.file) { + // On windows, we must use the native `path.relative` to generate the relative path + // so that drive-letters are resolved cast insensitively. However we then want to + // convert back to a posix path to insert in to the document + const relativePath = path.relative(fromFile.fsPath, toFile.fsPath); + return path.posix.normalize(relativePath.split(path.sep).join(path.posix.sep)); + } + + return path.posix.relative(fromFile.path, toFile.path); + } + + return undefined; +} + +export function registerDropOrPasteResourceSupport(selector: vscode.DocumentSelector): vscode.Disposable { + const provider = new DropOrPasteResourceProvider(); + + return vscode.Disposable.from( + vscode.languages.registerDocumentDropEditProvider(selector, provider, { + providedDropEditKinds: [provider.kind], + dropMimeTypes: [ + Mimes.uriList, + 'files' + ] + }), + vscode.languages.registerDocumentPasteEditProvider(selector, provider, { + providedPasteEditKinds: [provider.kind], + pasteMimeTypes: [ + Mimes.uriList, + 'files' + ] + }) + ); +} diff --git a/extensions/css-language-features/client/src/dropOrPaste/shared.ts b/extensions/css-language-features/client/src/dropOrPaste/shared.ts new file mode 100644 index 00000000000..548bccfec69 --- /dev/null +++ b/extensions/css-language-features/client/src/dropOrPaste/shared.ts @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { Utils } from 'vscode-uri'; + +export const Schemes = Object.freeze({ + file: 'file', + notebookCell: 'vscode-notebook-cell', + untitled: 'untitled', +}); + +export const Mimes = Object.freeze({ + plain: 'text/plain', + uriList: 'text/uri-list', +}); + + +export function getDocumentDir(uri: vscode.Uri): vscode.Uri | undefined { + const docUri = getParentDocumentUri(uri); + if (docUri.scheme === Schemes.untitled) { + return vscode.workspace.workspaceFolders?.[0]?.uri; + } + return Utils.dirname(docUri); +} + +function getParentDocumentUri(uri: vscode.Uri): vscode.Uri { + if (uri.scheme === Schemes.notebookCell) { + // is notebook documents necessary? + for (const notebook of vscode.workspace.notebookDocuments) { + for (const cell of notebook.getCells()) { + if (cell.document.uri.toString() === uri.toString()) { + return notebook.uri; + } + } + } + } + + return uri; +} diff --git a/extensions/css-language-features/client/src/dropOrPaste/uriList.ts b/extensions/css-language-features/client/src/dropOrPaste/uriList.ts new file mode 100644 index 00000000000..ed20b1ee797 --- /dev/null +++ b/extensions/css-language-features/client/src/dropOrPaste/uriList.ts @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; + +function splitUriList(str: string): string[] { + return str.split('\r\n'); +} + +function parseUriList(str: string): string[] { + return splitUriList(str) + .filter(value => !value.startsWith('#')) // Remove comments + .map(value => value.trim()); +} + +export class UriList { + + static from(str: string): UriList { + return new UriList(coalesce(parseUriList(str).map(line => { + try { + return { uri: vscode.Uri.parse(line), str: line }; + } catch { + // Uri parse failure + return undefined; + } + }))); + } + + constructor( + public readonly entries: ReadonlyArray<{ readonly uri: vscode.Uri; readonly str: string }> + ) { } +} + +function coalesce(array: ReadonlyArray): T[] { + return array.filter(e => !!e); +} diff --git a/extensions/css-language-features/client/src/node/cssClientMain.ts b/extensions/css-language-features/client/src/node/cssClientMain.ts index 802b58ab286..96926979b2a 100644 --- a/extensions/css-language-features/client/src/node/cssClientMain.ts +++ b/extensions/css-language-features/client/src/node/cssClientMain.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getNodeFSRequestService } from './nodeFs'; -import { ExtensionContext, extensions, l10n } from 'vscode'; -import { startClient, LanguageClientConstructor } from '../cssClient'; -import { ServerOptions, TransportKind, LanguageClientOptions, LanguageClient, BaseLanguageClient } from 'vscode-languageclient/node'; import { TextDecoder } from 'util'; - +import { ExtensionContext, extensions, l10n } from 'vscode'; +import { BaseLanguageClient, LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient/node'; +import { LanguageClientConstructor, startClient } from '../cssClient'; +import { getNodeFSRequestService } from './nodeFs'; +import { registerDropOrPasteResourceSupport } from '../dropOrPaste/dropOrPasteResource'; let client: BaseLanguageClient | undefined; @@ -37,6 +37,8 @@ export async function activate(context: ExtensionContext) { process.env['VSCODE_L10N_BUNDLE_LOCATION'] = l10n.uri?.toString() ?? ''; client = await startClient(context, newLanguageClient, { fs: getNodeFSRequestService(), TextDecoder }); + + context.subscriptions.push(registerDropOrPasteResourceSupport({ language: 'css', scheme: '*' })); } export async function deactivate(): Promise { @@ -45,3 +47,4 @@ export async function deactivate(): Promise { client = undefined; } } + diff --git a/extensions/css-language-features/client/tsconfig.json b/extensions/css-language-features/client/tsconfig.json index 573b24b4aa6..17bf7e962a8 100644 --- a/extensions/css-language-features/client/tsconfig.json +++ b/extensions/css-language-features/client/tsconfig.json @@ -1,10 +1,14 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./out" + "outDir": "./out", + "lib": [ + "webworker" + ] }, "include": [ "src/**/*", - "../../../src/vscode-dts/vscode.d.ts" + "../../../src/vscode-dts/vscode.d.ts", + "../../../src/vscode-dts/vscode.proposed.documentPaste.d.ts" ] } diff --git a/extensions/css-language-features/package-lock.json b/extensions/css-language-features/package-lock.json new file mode 100644 index 00000000000..e13184cae57 --- /dev/null +++ b/extensions/css-language-features/package-lock.json @@ -0,0 +1,135 @@ +{ + "name": "css-language-features", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "css-language-features", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "vscode-languageclient": "10.0.0-next.8", + "vscode-uri": "^3.0.8" + }, + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "^1.77.0" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/vscode-jsonrpc": { + "version": "9.0.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.4.tgz", + "integrity": "sha512-zSVIr58lJSMYKIsZ5P7GtBbv1eEx25eNyOf0NmEzxmn1GhUNJAVAb5hkA1poKUwj1FRMwN6CeyWxZypmr8SsQQ==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageclient": { + "version": "10.0.0-next.8", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-10.0.0-next.8.tgz", + "integrity": "sha512-D9inIHgqKayO9Tv0MeLb3XIL76yTuWmKdHqcGZKzjtQrMGJgASJDYWTapu+yAjEpDp0gmVOaCYyIlLB86ncDoQ==", + "dependencies": { + "minimatch": "^9.0.3", + "semver": "^7.6.0", + "vscode-languageserver-protocol": "3.17.6-next.6" + }, + "engines": { + "vscode": "^1.89.0" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.6-next.6", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.6.tgz", + "integrity": "sha512-naxM9kc/phpl0kAFNVPejMUWUtzFXdPYY/BtQTYtfbBbHf8sceHOrKkmf6yynZRu1A4oFtRZNqV3wyFRTWqUHw==", + "dependencies": { + "vscode-jsonrpc": "9.0.0-next.4", + "vscode-languageserver-types": "3.17.6-next.4" + } + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.6-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.4.tgz", + "integrity": "sha512-SeJTpH/S14EbxOAVaOUoGVqPToqpRTld5QO5Ghig3AlbFJTFF9Wu7srHMfa85L0SX1RYAuuCSFKJVVCxDIk1/Q==" + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/extensions/css-language-features/package.json b/extensions/css-language-features/package.json index f4f6adfb7f4..802e2fbf113 100644 --- a/extensions/css-language-features/package.json +++ b/extensions/css-language-features/package.json @@ -23,11 +23,14 @@ "supported": true } }, + "enabledApiProposals": [ + "documentPaste" + ], "scripts": { "compile": "npx gulp compile-extension:css-language-features-client compile-extension:css-language-features-server", "watch": "npx gulp watch-extension:css-language-features-client watch-extension:css-language-features-server", "test": "node ../../node_modules/mocha/bin/mocha", - "install-client-next": "yarn add vscode-languageclient@next" + "install-client-next": "npm install vscode-languageclient@next" }, "categories": [ "Programming Languages" @@ -994,7 +997,7 @@ ] }, "dependencies": { - "vscode-languageclient": "^10.0.0-next.5", + "vscode-languageclient": "10.0.0-next.8", "vscode-uri": "^3.0.8" }, "devDependencies": { diff --git a/extensions/css-language-features/schemas/package.schema.json b/extensions/css-language-features/schemas/package.schema.json index 831149caa9e..6c4b91faa27 100644 --- a/extensions/css-language-features/schemas/package.schema.json +++ b/extensions/css-language-features/schemas/package.schema.json @@ -1,6 +1,5 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "CSS contributions to package.json", "type": "object", "properties": { "contributes": { diff --git a/extensions/css-language-features/server/package-lock.json b/extensions/css-language-features/server/package-lock.json new file mode 100644 index 00000000000..2f7cb932b0c --- /dev/null +++ b/extensions/css-language-features/server/package-lock.json @@ -0,0 +1,111 @@ +{ + "name": "vscode-css-languageserver", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vscode-css-languageserver", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@vscode/l10n": "^0.0.18", + "vscode-css-languageservice": "^6.3.1", + "vscode-languageserver": "10.0.0-next.6", + "vscode-uri": "^3.0.8" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "20.x" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@types/mocha": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@vscode/l10n": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", + "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/vscode-css-languageservice": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-6.3.1.tgz", + "integrity": "sha512-1BzTBuJfwMc3A0uX4JBdJgoxp74cjj4q2mDJdp49yD/GuAq4X0k5WtK6fNcMYr+FfJ9nqgR6lpfCSZDkARJ5qQ==", + "dependencies": { + "@vscode/l10n": "^0.0.18", + "vscode-languageserver-textdocument": "^1.0.12", + "vscode-languageserver-types": "3.17.5", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/vscode-jsonrpc": { + "version": "9.0.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.4.tgz", + "integrity": "sha512-zSVIr58lJSMYKIsZ5P7GtBbv1eEx25eNyOf0NmEzxmn1GhUNJAVAb5hkA1poKUwj1FRMwN6CeyWxZypmr8SsQQ==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "10.0.0-next.6", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-10.0.0-next.6.tgz", + "integrity": "sha512-0Lh1nhQfSxo5Ob+ayYO1QTIsDix2/Lc72Urm1KZrCFxK5zIFYaEh3QFeM9oZih4Rzs0ZkQPXXnoHtpvs5GT+Zw==", + "dependencies": { + "vscode-languageserver-protocol": "3.17.6-next.6" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.6-next.6", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.6.tgz", + "integrity": "sha512-naxM9kc/phpl0kAFNVPejMUWUtzFXdPYY/BtQTYtfbBbHf8sceHOrKkmf6yynZRu1A4oFtRZNqV3wyFRTWqUHw==", + "dependencies": { + "vscode-jsonrpc": "9.0.0-next.4", + "vscode-languageserver-types": "3.17.6-next.4" + } + }, + "node_modules/vscode-languageserver-protocol/node_modules/vscode-languageserver-types": { + "version": "3.17.6-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.4.tgz", + "integrity": "sha512-SeJTpH/S14EbxOAVaOUoGVqPToqpRTld5QO5Ghig3AlbFJTFF9Wu7srHMfa85L0SX1RYAuuCSFKJVVCxDIk1/Q==" + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" + } + } +} diff --git a/extensions/css-language-features/server/package.json b/extensions/css-language-features/server/package.json index 0f1750e800a..4d8b9bd41ac 100644 --- a/extensions/css-language-features/server/package.json +++ b/extensions/css-language-features/server/package.json @@ -11,8 +11,8 @@ "browser": "./dist/browser/cssServerMain", "dependencies": { "@vscode/l10n": "^0.0.18", - "vscode-css-languageservice": "^6.2.14", - "vscode-languageserver": "^10.0.0-next.3", + "vscode-css-languageservice": "^6.3.1", + "vscode-languageserver": "10.0.0-next.6", "vscode-uri": "^3.0.8" }, "devDependencies": { @@ -22,10 +22,10 @@ "scripts": { "compile": "gulp compile-extension:css-language-features-server", "watch": "gulp watch-extension:css-language-features-server", - "install-service-next": "yarn add vscode-css-languageservice@next", - "install-service-local": "yarn link vscode-css-languageservice", - "install-server-next": "yarn add vscode-languageserver@next", - "install-server-local": "yarn link vscode-languageserver", + "install-service-next": "npm install vscode-css-languageservice@next", + "install-service-local": "npm link vscode-css-languageservice", + "install-server-next": "npm install vscode-languageserver@next", + "install-server-local": "npm install vscode-languageserver", "test": "node ./test/index.js" } } diff --git a/extensions/css-language-features/server/yarn.lock b/extensions/css-language-features/server/yarn.lock deleted file mode 100644 index 8d4c46d641e..00000000000 --- a/extensions/css-language-features/server/yarn.lock +++ /dev/null @@ -1,75 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/mocha@^9.1.1": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" - integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@vscode/l10n@^0.0.18": - version "0.0.18" - resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.18.tgz#916d3a5e960dbab47c1c56f58a7cb5087b135c95" - integrity sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -vscode-css-languageservice@^6.2.14: - version "6.2.14" - resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-6.2.14.tgz#d44fe75c03942d865a9c1a5ff5fb4e8dec1f89d0" - integrity sha512-5UPQ9Y1sUTnuMyaMBpO7LrBkqjhEJb5eAwdUlDp+Uez8lry+Tspnk3+3p2qWS4LlNsr4p3v9WkZxUf1ltgFpgw== - dependencies: - "@vscode/l10n" "^0.0.18" - vscode-languageserver-textdocument "^1.0.11" - vscode-languageserver-types "3.17.5" - vscode-uri "^3.0.8" - -vscode-jsonrpc@9.0.0-next.2: - version "9.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.2.tgz#29e9741c742c80329bba1c60ce38fd014651ba80" - integrity sha512-meIaXAgChCHzWy45QGU8YpCNyqnZQ/sYeCj32OLDDbUYsCF7AvgpdXx3nnZn9yzr8ed0Od9bW+NGphEmXsqvIQ== - -vscode-languageserver-protocol@3.17.6-next.4: - version "3.17.6-next.4" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.4.tgz#3c56f6eb588bb42fccc0ac54a0d5daf2d02f0a1b" - integrity sha512-/2bleKBxZLyRObS4mkpaWlVI9xGiUqMVmh/ztZ2vL4uP2XyIpraT45JBpn9AtXr0alqKJPKLuKr+/qcYULvm/w== - dependencies: - vscode-jsonrpc "9.0.0-next.2" - vscode-languageserver-types "3.17.6-next.3" - -vscode-languageserver-textdocument@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz#0822a000e7d4dc083312580d7575fe9e3ba2e2bf" - integrity sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA== - -vscode-languageserver-types@3.17.5: - version "3.17.5" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz#3273676f0cf2eab40b3f44d085acbb7f08a39d8a" - integrity sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg== - -vscode-languageserver-types@3.17.6-next.3: - version "3.17.6-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.3.tgz#f71d6c57f18d921346cfe0c227aabd72eb8cd2f0" - integrity sha512-l5kNFXFRQGuzriXpuBqFpRmkf6f6A4VoU3h95OsVkqIOoi1k7KbwSo600cIdsKSJWrPg/+vX+QMPcMw1oI7ItA== - -vscode-languageserver@^10.0.0-next.3: - version "10.0.0-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-10.0.0-next.3.tgz#a63c5ea9fab1be93d7732ab0fdc18c9b37956e07" - integrity sha512-4x1qHImf6ePji4+8PX43lnBCBfBNdi2jneGX2k5FswJhx/cxaYYmusShmmtO/clyL1iurxJacrQoXfw9+ikhvg== - dependencies: - vscode-languageserver-protocol "3.17.6-next.4" - -vscode-uri@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" - integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== diff --git a/extensions/css-language-features/yarn.lock b/extensions/css-language-features/yarn.lock deleted file mode 100644 index 25a22d07ca6..00000000000 --- a/extensions/css-language-features/yarn.lock +++ /dev/null @@ -1,85 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -minimatch@^9.0.3: - version "9.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" - integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== - dependencies: - brace-expansion "^2.0.1" - -semver@^7.6.0: - version "7.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" - integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== - dependencies: - lru-cache "^6.0.0" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -vscode-jsonrpc@9.0.0-next.2: - version "9.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.2.tgz#29e9741c742c80329bba1c60ce38fd014651ba80" - integrity sha512-meIaXAgChCHzWy45QGU8YpCNyqnZQ/sYeCj32OLDDbUYsCF7AvgpdXx3nnZn9yzr8ed0Od9bW+NGphEmXsqvIQ== - -vscode-languageclient@^10.0.0-next.5: - version "10.0.0-next.5" - resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-10.0.0-next.5.tgz#7431d88255a5fd99e9423659ac484b1f968200f3" - integrity sha512-JIf1WE7fvV0RElFM062bAummI433vcxuFwqoYAp+1zTVhta/jznxkTz1zs3Hbj2tiDfclf0TZ0qCxflAP1mY2Q== - dependencies: - minimatch "^9.0.3" - semver "^7.6.0" - vscode-languageserver-protocol "3.17.6-next.4" - -vscode-languageserver-protocol@3.17.6-next.4: - version "3.17.6-next.4" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.4.tgz#3c56f6eb588bb42fccc0ac54a0d5daf2d02f0a1b" - integrity sha512-/2bleKBxZLyRObS4mkpaWlVI9xGiUqMVmh/ztZ2vL4uP2XyIpraT45JBpn9AtXr0alqKJPKLuKr+/qcYULvm/w== - dependencies: - vscode-jsonrpc "9.0.0-next.2" - vscode-languageserver-types "3.17.6-next.3" - -vscode-languageserver-types@3.17.6-next.3: - version "3.17.6-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.3.tgz#f71d6c57f18d921346cfe0c227aabd72eb8cd2f0" - integrity sha512-l5kNFXFRQGuzriXpuBqFpRmkf6f6A4VoU3h95OsVkqIOoi1k7KbwSo600cIdsKSJWrPg/+vX+QMPcMw1oI7ItA== - -vscode-uri@^3.0.8: - version "3.0.8" - resolved "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz" - integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/extensions/css/yarn.lock b/extensions/css/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/css/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/dart/cgmanifest.json b/extensions/dart/cgmanifest.json index df4e4f0aae9..da493cafa70 100644 --- a/extensions/dart/cgmanifest.json +++ b/extensions/dart/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "dart-lang/dart-syntax-highlight", "repositoryUrl": "https://github.com/dart-lang/dart-syntax-highlight", - "commitHash": "bb8f7eebf5a1028e70dbebcf35cfef738dddc7fe" + "commitHash": "e8b053f9834cb44db0f49ac4a4567177bd943dbf" } }, "licenseDetail": [ diff --git a/extensions/dart/syntaxes/dart.tmLanguage.json b/extensions/dart/syntaxes/dart.tmLanguage.json index 5a4a9393bc7..32ea3f5b0c3 100644 --- a/extensions/dart/syntaxes/dart.tmLanguage.json +++ b/extensions/dart/syntaxes/dart.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/dart-lang/dart-syntax-highlight/commit/bb8f7eebf5a1028e70dbebcf35cfef738dddc7fe", + "version": "https://github.com/dart-lang/dart-syntax-highlight/commit/e8b053f9834cb44db0f49ac4a4567177bd943dbf", "name": "Dart", "scopeName": "source.dart", "patterns": [ @@ -212,7 +212,7 @@ }, { "name": "constant.numeric.dart", - "match": "(?=12.0.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/jsonc-parser": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz", + "integrity": "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==" + }, + "node_modules/queue": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", + "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==", + "dependencies": { + "inherits": "~2.0.3" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.3.tgz", + "integrity": "sha512-ynEGytvgTb6HVSUwPJIAZgiHQmPCx8bZ8w5um5Lz+q5DjP0Zj8wTFhQpyg8xaMvefDytw2+HH5yzqS+FhsR28A==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", + "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" + }, + "node_modules/vscode-uri": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-2.1.2.tgz", + "integrity": "sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A==" + } + } +} diff --git a/extensions/emmet/package.json b/extensions/emmet/package.json index 1783bc2ceaf..a390a86fc2e 100644 --- a/extensions/emmet/package.json +++ b/extensions/emmet/package.json @@ -476,7 +476,7 @@ "scripts": { "watch": "gulp watch-extension:emmet", "compile": "gulp compile-extension:emmet", - "deps": "yarn add @vscode/emmet-helper" + "deps": "npm install @vscode/emmet-helper" }, "devDependencies": { "@types/node": "20.x" diff --git a/extensions/emmet/yarn.lock b/extensions/emmet/yarn.lock deleted file mode 100644 index b75842fe4a4..00000000000 --- a/extensions/emmet/yarn.lock +++ /dev/null @@ -1,124 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@emmetio/abbreviation@^2.3.3": - version "2.3.3" - resolved "https://registry.yarnpkg.com/@emmetio/abbreviation/-/abbreviation-2.3.3.tgz#ed2b88fe37b972292d6026c7c540aaf887cecb6e" - integrity sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA== - dependencies: - "@emmetio/scanner" "^1.0.4" - -"@emmetio/css-abbreviation@^2.1.8": - version "2.1.8" - resolved "https://registry.yarnpkg.com/@emmetio/css-abbreviation/-/css-abbreviation-2.1.8.tgz#b785313486eba6cb7eb623ad39378c4e1063dc00" - integrity sha512-s9yjhJ6saOO/uk1V74eifykk2CBYi01STTK3WlXWGOepyKa23ymJ053+DNQjpFcy1ingpaO7AxCcwLvHFY9tuw== - dependencies: - "@emmetio/scanner" "^1.0.4" - -"@emmetio/css-parser@ramya-rao-a/css-parser#vscode": - version "0.4.0" - resolved "https://codeload.github.com/ramya-rao-a/css-parser/tar.gz/370c480ac103bd17c7bcfb34bf5d577dc40d3660" - dependencies: - "@emmetio/stream-reader" "^2.2.0" - "@emmetio/stream-reader-utils" "^0.1.0" - -"@emmetio/html-matcher@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@emmetio/html-matcher/-/html-matcher-0.3.3.tgz#0bbdadc0882e185950f03737dc6dbf8f7bd90728" - integrity sha1-C72twIguGFlQ8Dc33G2/j3vZByg= - dependencies: - "@emmetio/stream-reader" "^2.0.0" - "@emmetio/stream-reader-utils" "^0.1.0" - -"@emmetio/math-expression@^1.0.5": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@emmetio/math-expression/-/math-expression-1.0.5.tgz#d0cc52ed453a107bc9b19c5d71d1390d3aecbe48" - integrity sha512-qf5SXD/ViS04rXSeDg9CRGM10xLC9dVaKIbMHrrwxYr5LNB/C0rOfokhGSBwnVQKcidLmdRJeNWH1V1tppZ84Q== - dependencies: - "@emmetio/scanner" "^1.0.4" - -"@emmetio/scanner@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@emmetio/scanner/-/scanner-1.0.4.tgz#e9cdc67194fd91f8b7eb141014be4f2d086c15f1" - integrity sha512-IqRuJtQff7YHHBk4G8YZ45uB9BaAGcwQeVzgj/zj8/UdOhtQpEIupUhSk8dys6spFIWVZVeK20CzGEnqR5SbqA== - -"@emmetio/stream-reader-utils@^0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@emmetio/stream-reader-utils/-/stream-reader-utils-0.1.0.tgz#244cb02c77ec2e74f78a9bd318218abc9c500a61" - integrity sha1-JEywLHfsLnT3ipvTGCGKvJxQCmE= - -"@emmetio/stream-reader@^2.0.0", "@emmetio/stream-reader@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@emmetio/stream-reader/-/stream-reader-2.2.0.tgz#46cffea119a0a003312a21c2d9b5628cb5fcd442" - integrity sha1-Rs/+oRmgoAMxKiHC2bVijLX81EI= - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@vscode/emmet-helper@^2.8.8": - version "2.9.3" - resolved "https://registry.yarnpkg.com/@vscode/emmet-helper/-/emmet-helper-2.9.3.tgz#8a8b228981fcf2d9346fdca77b9ad5a31dc09dba" - integrity sha512-rB39LHWWPQYYlYfpv9qCoZOVioPCftKXXqrsyqN1mTWZM6dTnONT63Db+03vgrBbHzJN45IrgS/AGxw9iiqfEw== - dependencies: - emmet "^2.4.3" - jsonc-parser "^2.3.0" - vscode-languageserver-textdocument "^1.0.1" - vscode-languageserver-types "^3.15.1" - vscode-uri "^2.1.2" - -emmet@^2.4.3: - version "2.4.7" - resolved "https://registry.yarnpkg.com/emmet/-/emmet-2.4.7.tgz#19893c34e6274af14ea3c5729101e3c4ed18f01e" - integrity sha512-O5O5QNqtdlnQM2bmKHtJgyChcrFMgQuulI+WdiOw2NArzprUqqxUW6bgYtKvzKgrsYpuLWalOkdhNP+1jluhCA== - dependencies: - "@emmetio/abbreviation" "^2.3.3" - "@emmetio/css-abbreviation" "^2.1.8" - -image-size@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/image-size/-/image-size-1.0.0.tgz#58b31fe4743b1cec0a0ac26f5c914d3c5b2f0750" - integrity sha512-JLJ6OwBfO1KcA+TvJT+v8gbE6iWbj24LyDNFgFEN0lzegn6cC6a/p3NIDaepMsJjQjlUWqIC7wJv8lBFxPNjcw== - dependencies: - queue "6.0.2" - -inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -jsonc-parser@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.3.1.tgz#59549150b133f2efacca48fe9ce1ec0659af2342" - integrity sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg== - -queue@6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/queue/-/queue-6.0.2.tgz#b91525283e2315c7553d2efa18d83e76432fed65" - integrity sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA== - dependencies: - inherits "~2.0.3" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -vscode-languageserver-textdocument@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.3.tgz#879f2649bfa5a6e07bc8b392c23ede2dfbf43eff" - integrity sha512-ynEGytvgTb6HVSUwPJIAZgiHQmPCx8bZ8w5um5Lz+q5DjP0Zj8wTFhQpyg8xaMvefDytw2+HH5yzqS+FhsR28A== - -vscode-languageserver-types@^3.15.1: - version "3.17.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64" - integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== - -vscode-uri@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.1.2.tgz#c8d40de93eb57af31f3c715dd650e2ca2c096f1c" - integrity sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A== diff --git a/extensions/extension-editing/.vscodeignore b/extensions/extension-editing/.vscodeignore index de8e6dc5913..8d4da76b9cb 100644 --- a/extensions/extension-editing/.vscodeignore +++ b/extensions/extension-editing/.vscodeignore @@ -4,4 +4,4 @@ tsconfig.json out/** extension.webpack.config.js extension-browser.webpack.config.js -yarn.lock +package-lock.json diff --git a/extensions/extension-editing/package-lock.json b/extensions/extension-editing/package-lock.json new file mode 100644 index 00000000000..3fa0c35e2d0 --- /dev/null +++ b/extensions/extension-editing/package-lock.json @@ -0,0 +1,110 @@ +{ + "name": "extension-editing", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "extension-editing", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "jsonc-parser": "^3.2.0", + "markdown-it": "^12.3.2", + "parse5": "^3.0.2" + }, + "devDependencies": { + "@types/markdown-it": "0.0.2", + "@types/node": "20.x" + }, + "engines": { + "vscode": "^1.4.0" + } + }, + "node_modules/@types/markdown-it": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-0.0.2.tgz", + "integrity": "sha1-XZrRnm5lCM3S8llt+G/Qqt5ZhmA= sha512-A2seE+zJYSjGHy7L/v0EN/xRfgv2A60TuXOwI8tt5aZxF4UeoYIkM2jERnNH8w4VFr7oFEm0lElGOao7fZgygQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" + }, + "node_modules/linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dependencies": { + "uc.micro": "^1.0.1" + } + }, + "node_modules/markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dependencies": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" + }, + "node_modules/parse5": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.2.tgz", + "integrity": "sha1-Be/1fw70V3+xRKefi5qWemzERRA= sha512-yQW05f47bKFJa0WdnyzP7vh7+B+w8jhVsFBBiaEbIfNDSSt8GADBhcQgsdYxatQ7rVs1nU9cmsYXURGWBH3Siw==", + "dependencies": { + "@types/node": "^6.0.46" + } + }, + "node_modules/parse5/node_modules/@types/node": { + "version": "6.0.78", + "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.78.tgz", + "integrity": "sha512-+vD6E8ixntRzzZukoF3uP1iV+ZjVN3koTcaeK+BEoc/kSfGbLDIGC7RmCaUgVpUfN6cWvfczFRERCyKM9mkvXg==" + }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/extensions/extension-editing/yarn.lock b/extensions/extension-editing/yarn.lock deleted file mode 100644 index 00fad585fd1..00000000000 --- a/extensions/extension-editing/yarn.lock +++ /dev/null @@ -1,75 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/markdown-it@0.0.2": - version "0.0.2" - resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-0.0.2.tgz#5d9ad19e6e6508cdd2f2596df86fd0aade598660" - integrity sha1-XZrRnm5lCM3S8llt+G/Qqt5ZhmA= - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@types/node@^6.0.46": - version "6.0.78" - resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.78.tgz#5d4a3f579c1524e01ee21bf474e6fba09198f470" - integrity sha512-+vD6E8ixntRzzZukoF3uP1iV+ZjVN3koTcaeK+BEoc/kSfGbLDIGC7RmCaUgVpUfN6cWvfczFRERCyKM9mkvXg== - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -entities@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" - integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== - -jsonc-parser@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" - integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== - -linkify-it@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" - integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== - dependencies: - uc.micro "^1.0.1" - -markdown-it@^12.3.2: - version "12.3.2" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" - integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== - dependencies: - argparse "^2.0.1" - entities "~2.1.0" - linkify-it "^3.0.1" - mdurl "^1.0.1" - uc.micro "^1.0.5" - -mdurl@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" - integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= - -parse5@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.2.tgz#05eff57f0ef4577fb144a79f8b9a967a6cc44510" - integrity sha1-Be/1fw70V3+xRKefi5qWemzERRA= - dependencies: - "@types/node" "^6.0.46" - -uc.micro@^1.0.1, uc.micro@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" - integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/extensions/fsharp/cgmanifest.json b/extensions/fsharp/cgmanifest.json index 524b3fa0d46..ba75f69541e 100644 --- a/extensions/fsharp/cgmanifest.json +++ b/extensions/fsharp/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "ionide/ionide-fsgrammar", "repositoryUrl": "https://github.com/ionide/ionide-fsgrammar", - "commitHash": "7d029a46f17637228b2ee85dd02e511c3e8039b3" + "commitHash": "b38420f8569aa662b4862beb407a02e527e866c1" } }, "license": "MIT", diff --git a/extensions/fsharp/syntaxes/fsharp.tmLanguage.json b/extensions/fsharp/syntaxes/fsharp.tmLanguage.json index 5063f1c5210..9594d1b6ce8 100644 --- a/extensions/fsharp/syntaxes/fsharp.tmLanguage.json +++ b/extensions/fsharp/syntaxes/fsharp.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/ionide/ionide-fsgrammar/commit/7d029a46f17637228b2ee85dd02e511c3e8039b3", + "version": "https://github.com/ionide/ionide-fsgrammar/commit/b38420f8569aa662b4862beb407a02e527e866c1", "name": "fsharp", "scopeName": "source.fsharp", "patterns": [ @@ -617,7 +617,7 @@ }, { "name": "constant.numeric.float.fsharp", - "match": "\\b-?[0-9][0-9_]*((\\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))" + "match": "\\b-?[0-9][0-9_]*((\\.(?!\\.)([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))" }, { "name": "constant.numeric.integer.nativeint.fsharp", @@ -635,7 +635,7 @@ }, "abstract_definition": { "name": "abstract.definition.fsharp", - "begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(<)?", + "begin": "\\b(static)?\\s+(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(<)?", "end": "\\s*(with)\\b|=|$", "beginCaptures": { "1": { @@ -645,6 +645,9 @@ "name": "keyword.fsharp" }, "3": { + "name": "keyword.fsharp" + }, + "4": { "name": "support.function.attribute.fsharp" }, "5": { @@ -838,7 +841,7 @@ "name": "keyword.symbol.fsharp" } }, - "end": "(\\)\\s*(([?[:alpha:]0-9'`^._ ]+))+)", + "end": "(\\)\\s*(([?[:alpha:]0-9'`^._ ]+))*)", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" @@ -933,7 +936,7 @@ "patterns": [ { "name": "binding.fsharp", - "begin": "\\b(let mutable|static let mutable|static let|let inline|let|and|member val|static member inline|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?", + "begin": "\\b(let mutable|static let mutable|static let|let inline|let|and|member val|member inline|static member inline|static member val|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?", "end": "\\s*((with\\b)|(=|\\n+=|(?<=\\=)))", "beginCaptures": { "1": { @@ -1008,7 +1011,7 @@ }, { "name": "binding.fsharp", - "begin": "\\b(static val mutable|val mutable|val)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?", + "begin": "\\b(static val mutable|val mutable|val inline|val)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?", "end": "\\n$", "beginCaptures": { "1": { @@ -1130,7 +1133,7 @@ }, { "name": "keyword.symbol.fsharp", - "match": "(&&&|\\|\\|\\||\\^\\^\\^|~~~|~\\+|~\\-|<<<|>>>|\\|>|:>|:\\?>|:|\\[|\\]|\\;|<>|=|@|\\|\\||&&|&|%|{|}|\\||_|\\.\\.|\\,|\\+|\\-|\\*|\\/|\\^|\\!|\\>|\\>\\=|\\>\\>|\\<|\\<\\=|\\(|\\)|\\<\\<)" + "match": "[.?]*(&&&|\\|\\|\\||\\^\\^\\^|~~~|~\\+|~\\-|<<<|>>>|\\|>|:>|:\\?>|:|\\[|\\]|\\;|<>|=|@|\\|\\||&&|&|%|{|}|\\||_|\\.\\.|\\,|\\+|\\-|\\*|\\/|\\^|\\!|\\>|\\>\\=|\\>\\>|\\<|\\<\\=|\\(|\\)|\\<\\<)[.?]*" } ] }, diff --git a/extensions/fsharp/yarn.lock b/extensions/fsharp/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/fsharp/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/git-base/package-lock.json b/extensions/git-base/package-lock.json new file mode 100644 index 00000000000..f4b29739ca6 --- /dev/null +++ b/extensions/git-base/package-lock.json @@ -0,0 +1,34 @@ +{ + "name": "git-base", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "git-base", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "0.10.x" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/extensions/git-base/yarn.lock b/extensions/git-base/yarn.lock deleted file mode 100644 index 1f4b6c2e8b4..00000000000 --- a/extensions/git-base/yarn.lock +++ /dev/null @@ -1,15 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/extensions/git/.vscodeignore b/extensions/git/.vscodeignore index 94d2dc921e0..1e6130d5c7d 100644 --- a/extensions/git/.vscodeignore +++ b/extensions/git/.vscodeignore @@ -4,4 +4,4 @@ out/** tsconfig.json build/** extension.webpack.config.js -yarn.lock +package-lock.json diff --git a/extensions/git/package-lock.json b/extensions/git/package-lock.json new file mode 100644 index 00000000000..ef76d2719da --- /dev/null +++ b/extensions/git/package-lock.json @@ -0,0 +1,419 @@ +{ + "name": "git", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "git", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@joaomoreno/unique-names-generator": "^5.1.0", + "@vscode/extension-telemetry": "^0.9.0", + "@vscode/iconv-lite-umd": "0.7.0", + "byline": "^5.0.0", + "file-type": "16.5.4", + "jschardet": "3.1.3", + "picomatch": "2.3.1", + "vscode-uri": "^2.0.0", + "which": "4.0.0" + }, + "devDependencies": { + "@types/byline": "4.2.31", + "@types/mocha": "^9.1.1", + "@types/node": "20.x", + "@types/picomatch": "2.3.0", + "@types/which": "3.0.0" + }, + "engines": { + "vscode": "^1.5.0" + } + }, + "node_modules/@joaomoreno/unique-names-generator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@joaomoreno/unique-names-generator/-/unique-names-generator-5.1.0.tgz", + "integrity": "sha512-KEVThTpUIKPb7dBKJ9mJ3WYnD1mJZZsEinCSp9CVEPlWbDagurFv1RKRjvvujrLfJzsGc0HkBHS9W8Bughao4A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz", + "integrity": "sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz", + "integrity": "sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.0.3", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz", + "integrity": "sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz", + "integrity": "sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz", + "integrity": "sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz", + "integrity": "sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.0.4", + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", + "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.3.0.tgz", + "integrity": "sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz", + "integrity": "sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==" + }, + "node_modules/@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" + }, + "node_modules/@types/byline": { + "version": "4.2.31", + "resolved": "https://registry.npmjs.org/@types/byline/-/byline-4.2.31.tgz", + "integrity": "sha1-DmH8ucA+BH0hxEllVMcRYperYM0= sha512-TC6Ljn7tALesQMQyTNoMWoM44SNvWtCLkJDrA/TxcwE5ILkWt4zi5wbEokqiDk42S75eykAY1onPImWDybOkmQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/mocha": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@types/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-O397rnSS9iQI4OirieAtsDqvCj4+3eY1J+EPdNTKuHuRWIfUoGyzX294o8C4KJYaLqgSrd2o60c5EqCU8Zv02g==", + "dev": true + }, + "node_modules/@types/which": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/which/-/which-3.0.0.tgz", + "integrity": "sha512-ASCxdbsrwNfSMXALlC3Decif9rwDMu+80KGp5zI2RLRotfMsTv7fHL8W8VDp24wymzDyIFudhUeSCugrgRFfHQ==", + "dev": true + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz", + "integrity": "sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.0.3", + "@microsoft/1ds-post-js": "^4.0.3", + "@microsoft/applicationinsights-web-basic": "^3.0.4" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/@vscode/iconv-lite-umd": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz", + "integrity": "sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg==" + }, + "node_modules/byline": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", + "integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/file-type": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-16.5.4.tgz", + "integrity": "sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw==", + "dependencies": { + "readable-web-to-node-stream": "^3.0.0", + "strtok3": "^6.2.4", + "token-types": "^4.1.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "engines": { + "node": ">=16" + } + }, + "node_modules/jschardet": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz", + "integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/peek-readable": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-4.1.0.tgz", + "integrity": "sha512-ZI3LnwUv5nOGbQzD9c2iDG6toheuXSZP5esSHBjopsXH4dg19soufvpUGA3uohi5anFtGb2lhAVdHzH6R/Evvg==", + "engines": { + "node": ">=8" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "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/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readable-web-to-node-stream": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", + "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", + "dependencies": { + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/strtok3": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.3.0.tgz", + "integrity": "sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw==", + "dependencies": { + "@tokenizer/token": "^0.3.0", + "peek-readable": "^4.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/token-types": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-4.2.0.tgz", + "integrity": "sha512-P0rrp4wUpefLncNamWIef62J0v0kQR/GfDVji9WKY7GDCWy5YbVSrKUTam07iWPZQGy0zWNOfstYTykMmPNR7w==", + "dependencies": { + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/vscode-uri": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-2.0.0.tgz", + "integrity": "sha512-lWXWofDSYD8r/TIyu64MdwB4FaSirQ608PP/TzUyslyOeHGwQ0eTHUZeJrK1ILOmwUHaJtV693m2JoUYroUDpw==" + }, + "node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + } + } +} diff --git a/extensions/git/package.json b/extensions/git/package.json index 4fc372e21f7..57e332a8d78 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -16,14 +16,15 @@ "contribMergeEditorMenus", "contribMultiDiffEditorMenus", "contribDiffEditorGutterToolBarMenus", - "contribSourceControlHistoryItemGroupMenu", "contribSourceControlHistoryItemMenu", + "contribSourceControlHistoryTitleMenu", "contribSourceControlInputBoxMenu", "contribSourceControlTitleMenu", "contribViewsWelcome", "diffCommand", "editSessionIdentityProvider", "quickDiffProvider", + "quickInputButtonLocation", "quickPickSortByLabel", "scmActionButton", "scmHistoryProvider", @@ -451,6 +452,12 @@ "category": "Git", "enablement": "!operationInProgress" }, + { + "command": "git.checkoutRefDetached", + "title": "%command.checkoutRefDetached%", + "category": "Git", + "enablement": "!operationInProgress" + }, { "command": "git.branch", "title": "%command.branch%", @@ -526,6 +533,7 @@ { "command": "git.fetchAll", "title": "%command.fetchAll%", + "icon": "$(git-fetch)", "category": "Git", "enablement": "!operationInProgress" }, @@ -616,6 +624,12 @@ "category": "Git", "enablement": "!operationInProgress" }, + { + "command": "git.cherryPickRef", + "title": "%command.cherryPickRef%", + "category": "Git", + "enablement": "!operationInProgress" + }, { "command": "git.addRemote", "title": "%command.addRemote%", @@ -891,6 +905,16 @@ "icon": "$(diff-multiple)", "category": "Git", "enablement": "!operationInProgress" + }, + { + "command": "git.copyCommitId", + "title": "%command.timelineCopyCommitId%", + "category": "Git" + }, + { + "command": "git.copyCommitMessage", + "title": "%command.timelineCopyCommitMessage%", + "category": "Git" } ], "continueEditSession": [ @@ -1426,6 +1450,22 @@ { "command": "git.pushRef", "when": "false" + }, + { + "command": "git.copyCommitId", + "when": "false" + }, + { + "command": "git.copyCommitMessage", + "when": "false" + }, + { + "command": "git.checkoutRefDetached", + "when": "false" + }, + { + "command": "git.cherryPickRef", + "when": "false" } ], "scm/title": [ @@ -1915,100 +1955,43 @@ "group": "1_modification@3" } ], - "scm/incomingChanges": [ + "scm/history/title": [ { - "command": "git.fetchRef", - "group": "navigation", - "when": "scmProvider == git" - }, - { - "command": "git.pullRef", - "group": "navigation", - "when": "scmProvider == git" - } - ], - "scm/incomingChanges/context": [ - { - "command": "git.fetchRef", - "group": "1_modification@1", - "when": "scmProvider == git" - }, - { - "command": "git.pullRef", - "group": "1_modification@2", + "command": "git.fetchAll", + "group": "navigation@999", "when": "scmProvider == git" } ], - "scm/incomingChanges/allChanges/context": [ + "scm/historyItem/context": [ { - "command": "git.viewAllChanges", - "when": "scmProvider == git && scmHistoryItemFileCount != 0 && config.multiDiffEditor.experimental.enabled", - "group": "inline@1" - }, - { - "command": "git.viewAllChanges", - "when": "scmProvider == git && scmHistoryItemFileCount != 0 && config.multiDiffEditor.experimental.enabled", - "group": "1_view@1" - } - ], - "scm/incomingChanges/historyItem/context": [ - { - "command": "git.viewCommit", - "when": "scmProvider == git && scmHistoryItemFileCount != 0 && config.multiDiffEditor.experimental.enabled", - "group": "inline@1" + "command": "git.createTag", + "when": "scmProvider == git", + "group": "1_create@1" }, { - "command": "git.viewCommit", - "when": "scmProvider == git && scmHistoryItemFileCount != 0 && config.multiDiffEditor.experimental.enabled", - "group": "1_view@1" - } - ], - "scm/outgoingChanges": [ - { - "command": "git.pushRef", - "group": "navigation", - "when": "scmProvider == git && scmHistoryItemGroupHasRemote" + "command": "git.branch", + "when": "scmProvider == git", + "group": "1_create@2" }, { - "command": "git.publish", - "group": "navigation", - "when": "scmProvider == git && !scmHistoryItemGroupHasRemote" - } - ], - "scm/outgoingChanges/context": [ - { - "command": "git.pushRef", - "when": "scmProvider == git && scmHistoryItemGroupHasRemote", - "group": "1_modification@1" + "command": "git.cherryPickRef", + "when": "scmProvider == git", + "group": "2_modify@1" }, { - "command": "git.publish", - "when": "scmProvider == git && !scmHistoryItemGroupHasRemote", - "group": "1_modification@1" - } - ], - "scm/outgoingChanges/allChanges/context": [ - { - "command": "git.viewAllChanges", - "when": "scmProvider == git && scmHistoryItemFileCount != 0 && config.multiDiffEditor.experimental.enabled", - "group": "inline@1" + "command": "git.checkoutRefDetached", + "when": "scmProvider == git", + "group": "2_modify@2" }, { - "command": "git.viewAllChanges", - "when": "scmProvider == git && scmHistoryItemFileCount != 0 && config.multiDiffEditor.experimental.enabled", - "group": "1_view@1" - } - ], - "scm/outgoingChanges/historyItem/context": [ - { - "command": "git.viewCommit", - "when": "scmProvider == git && scmHistoryItemFileCount != 0 && config.multiDiffEditor.experimental.enabled", - "group": "inline@1" + "command": "git.copyCommitId", + "when": "scmProvider == git && !listMultiSelection", + "group": "9_copy@1" }, { - "command": "git.viewCommit", - "when": "scmProvider == git && scmHistoryItemFileCount != 0 && config.multiDiffEditor.experimental.enabled", - "group": "1_view@1" + "command": "git.copyCommitMessage", + "when": "scmProvider == git && !listMultiSelection", + "group": "9_copy@2" } ], "editor/title": [ @@ -3401,7 +3384,7 @@ "@vscode/iconv-lite-umd": "0.7.0", "byline": "^5.0.0", "file-type": "16.5.4", - "jschardet": "3.1.2", + "jschardet": "3.1.3", "picomatch": "2.3.1", "vscode-uri": "^2.0.0", "which": "4.0.0" diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index c2f7c3d6cfb..bad361bcea7 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -62,15 +62,17 @@ "command.undoCommit": "Undo Last Commit", "command.checkout": "Checkout to...", "command.checkoutDetached": "Checkout to (Detached)...", + "command.checkoutRefDetached": "Checkout (Detached)", "command.branch": "Create Branch...", "command.branchFrom": "Create Branch From...", "command.deleteBranch": "Delete Branch...", "command.renameBranch": "Rename Branch...", "command.cherryPick": "Cherry Pick...", + "command.cherryPickRef": "Cherry Pick", "command.merge": "Merge...", "command.mergeAbort": "Abort Merge", "command.rebase": "Rebase Branch...", - "command.createTag": "Create Tag", + "command.createTag": "Create Tag...", "command.deleteTag": "Delete Tag...", "command.deleteRemoteTag": "Delete Remote Tag...", "command.fetch": "Fetch", diff --git a/extensions/git/src/api/api1.ts b/extensions/git/src/api/api1.ts index f94ecbab7b0..63139af2447 100644 --- a/extensions/git/src/api/api1.ts +++ b/extensions/git/src/api/api1.ts @@ -201,8 +201,8 @@ export class ApiRepository implements Repository { return this.repository.getMergeBase(ref1, ref2); } - tag(name: string, upstream: string): Promise { - return this.repository.tag(name, upstream); + tag(name: string, message: string, ref?: string | undefined): Promise { + return this.repository.tag({ name, message, ref }); } deleteTag(name: string): Promise { @@ -322,6 +322,10 @@ export class ApiImpl implements API { } async openRepository(root: Uri): Promise { + if (root.scheme !== 'file') { + return null; + } + await this._model.openRepository(root.fsPath); return this.getRepository(root) || null; } diff --git a/extensions/git/src/api/git.d.ts b/extensions/git/src/api/git.d.ts index ce27e914244..17dd192ed95 100644 --- a/extensions/git/src/api/git.d.ts +++ b/extensions/git/src/api/git.d.ts @@ -146,6 +146,8 @@ export interface LogOptions { readonly shortStats?: boolean; readonly author?: string; readonly refNames?: string[]; + readonly maxParents?: number; + readonly skip?: number; } export interface CommitOptions { diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 00045c14ea3..38c1db541bb 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -5,7 +5,7 @@ import * as os from 'os'; import * as path from 'path'; -import { Command, commands, Disposable, LineChange, MessageOptions, Position, ProgressLocation, QuickPickItem, Range, SourceControlResourceState, TextDocumentShowOptions, TextEditor, Uri, ViewColumn, window, workspace, WorkspaceEdit, WorkspaceFolder, TimelineItem, env, Selection, TextDocumentContentProvider, InputBoxValidationSeverity, TabInputText, TabInputTextMerge, QuickPickItemKind, TextDocument, LogOutputChannel, l10n, Memento, UIKind, QuickInputButton, ThemeIcon, SourceControlHistoryItem, SourceControl, InputBoxValidationMessage, Tab, TabInputNotebook } from 'vscode'; +import { Command, commands, Disposable, LineChange, MessageOptions, Position, ProgressLocation, QuickPickItem, Range, SourceControlResourceState, TextDocumentShowOptions, TextEditor, Uri, ViewColumn, window, workspace, WorkspaceEdit, WorkspaceFolder, TimelineItem, env, Selection, TextDocumentContentProvider, InputBoxValidationSeverity, TabInputText, TabInputTextMerge, QuickPickItemKind, TextDocument, LogOutputChannel, l10n, Memento, UIKind, QuickInputButton, ThemeIcon, SourceControlHistoryItem, SourceControl, InputBoxValidationMessage, Tab, TabInputNotebook, QuickInputButtonLocation, SourceControlHistoryItemRef } from 'vscode'; import TelemetryReporter from '@vscode/extension-telemetry'; import { uniqueNamesGenerator, adjectives, animals, colors, NumberDictionary } from '@joaomoreno/unique-names-generator'; import { ForcePushMode, GitErrorCodes, Ref, RefType, Status, CommitOptions, RemoteSourcePublisher, Remote } from './api/git'; @@ -525,9 +525,15 @@ class CheckoutItemsProcessor extends RefItemsProcessor { // Button(s) if (item.refRemote) { const matchingRemote = this.repository.remotes.find((remote) => remote.name === item.refRemote); - const remoteUrl = matchingRemote?.pushUrl ?? matchingRemote?.fetchUrl; - if (remoteUrl) { - item.buttons = this.buttons.get(item.refRemote); + const buttons = []; + if (matchingRemote?.pushUrl) { + buttons.push(...this.buttons.get(matchingRemote.pushUrl) ?? []); + } + if (matchingRemote?.fetchUrl && matchingRemote.fetchUrl !== matchingRemote.pushUrl) { + buttons.push(...this.buttons.get(matchingRemote.fetchUrl) ?? []); + } + if (buttons.length) { + item.buttons = buttons; } } else { item.buttons = this.defaultButtons; @@ -1339,14 +1345,14 @@ export class CommandCenter { @command('git.stage') async stage(...resourceStates: SourceControlResourceState[]): Promise { - this.logger.debug(`git.stage ${resourceStates.length} `); + this.logger.debug(`[CommandCenter][stage] git.stage ${resourceStates.length} `); resourceStates = resourceStates.filter(s => !!s); if (resourceStates.length === 0 || (resourceStates[0] && !(resourceStates[0].resourceUri instanceof Uri))) { const resource = this.getSCMResource(); - this.logger.debug(`git.stage.getSCMResource ${resource ? resource.resourceUri.toString() : null} `); + this.logger.debug(`[CommandCenter][stage] git.stage.getSCMResource ${resource ? resource.resourceUri.toString() : null} `); if (!resource) { return; @@ -1389,7 +1395,7 @@ export class CommandCenter { const untracked = selection.filter(s => s.resourceGroupType === ResourceGroupType.Untracked); const scmResources = [...workingTree, ...untracked, ...resolved, ...unresolved]; - this.logger.debug(`git.stage.scmResources ${scmResources.length} `); + this.logger.debug(`[CommandCenter][stage] git.stage.scmResources ${scmResources.length} `); if (!scmResources.length) { return; } @@ -2063,7 +2069,7 @@ export class CommandCenter { promptToSaveFilesBeforeCommit = 'never'; } - const enableSmartCommit = config.get('enableSmartCommit') === true; + let enableSmartCommit = config.get('enableSmartCommit') === true; const enableCommitSigning = config.get('enableCommitSigning') === true; let noStagedChanges = repository.indexGroup.resourceStates.length === 0; let noUnstagedChanges = repository.workingTreeGroup.resourceStates.length === 0; @@ -2103,38 +2109,39 @@ export class CommandCenter { } } - if (!opts.amend) { - // no changes, and the user has not configured to commit all in this case - if (!noUnstagedChanges && noStagedChanges && !enableSmartCommit && !opts.all) { - const suggestSmartCommit = config.get('suggestSmartCommit') === true; - - if (!suggestSmartCommit) { - return; - } + // no changes, and the user has not configured to commit all in this case + if (!noUnstagedChanges && noStagedChanges && !enableSmartCommit && !opts.all && !opts.amend) { + const suggestSmartCommit = config.get('suggestSmartCommit') === true; - // prompt the user if we want to commit all or not - const message = l10n.t('There are no staged changes to commit.\n\nWould you like to stage all your changes and commit them directly?'); - const yes = l10n.t('Yes'); - const always = l10n.t('Always'); - const never = l10n.t('Never'); - const pick = await window.showWarningMessage(message, { modal: true }, yes, always, never); - - if (pick === always) { - config.update('enableSmartCommit', true, true); - } else if (pick === never) { - config.update('suggestSmartCommit', false, true); - return; - } else if (pick !== yes) { - return; // do not commit on cancel - } + if (!suggestSmartCommit) { + return; } - if (opts.all === undefined) { - opts = { ...opts, all: noStagedChanges }; - } else if (!opts.all && noStagedChanges) { - opts = { ...opts, all: true }; + // prompt the user if we want to commit all or not + const message = l10n.t('There are no staged changes to commit.\n\nWould you like to stage all your changes and commit them directly?'); + const yes = l10n.t('Yes'); + const always = l10n.t('Always'); + const never = l10n.t('Never'); + const pick = await window.showWarningMessage(message, { modal: true }, yes, always, never); + + if (pick === always) { + enableSmartCommit = true; + config.update('enableSmartCommit', true, true); + } else if (pick === never) { + config.update('suggestSmartCommit', false, true); + return; + } else if (pick === yes) { + enableSmartCommit = true; + } else { + // Cancel + return; } } + + // smart commit + if (enableSmartCommit && !opts.all) { + opts = { ...opts, all: noStagedChanges }; + } } // enable signing of commits if configured @@ -2494,6 +2501,14 @@ export class CommandCenter { return this._checkout(repository, { detached: true, treeish }); } + @command('git.checkoutRefDetached', { repository: true }) + async checkoutRefDetached(repository: Repository, historyItem?: SourceControlHistoryItemRef): Promise { + if (!historyItem) { + return false; + } + return this._checkout(repository, { detached: true, treeish: historyItem.id }); + } + private async _checkout(repository: Repository, opts?: { detached?: boolean; treeish?: string }): Promise { if (typeof opts?.treeish === 'string') { await repository.checkout(opts?.treeish, opts); @@ -2519,9 +2534,26 @@ export class CommandCenter { : l10n.t('Select a branch or tag to checkout'); quickPick.show(); - picks.push(... await createCheckoutItems(repository, opts?.detached)); - quickPick.items = [...commands, ...picks]; + + const setQuickPickItems = () => { + switch (true) { + case quickPick.value === '': + quickPick.items = [...commands, ...picks]; + break; + case commands.length === 0: + quickPick.items = picks; + break; + case picks.length === 0: + quickPick.items = commands; + break; + default: + quickPick.items = [...picks, { label: '', kind: QuickPickItemKind.Separator }, ...commands]; + break; + } + }; + + setQuickPickItems(); quickPick.busy = false; const choice = await new Promise(c => { @@ -2536,22 +2568,7 @@ export class CommandCenter { c(undefined); }))); - disposables.push(quickPick.onDidChangeValue(value => { - switch (true) { - case value === '': - quickPick.items = [...commands, ...picks]; - break; - case commands.length === 0: - quickPick.items = picks; - break; - case picks.length === 0: - quickPick.items = commands; - break; - default: - quickPick.items = [...picks, { label: '', kind: QuickPickItemKind.Separator }, ...commands]; - break; - } - })); + disposables.push(quickPick.onDidChangeValue(() => setQuickPickItems())); }); dispose(disposables); @@ -2601,8 +2618,8 @@ export class CommandCenter { } @command('git.branch', { repository: true }) - async branch(repository: Repository): Promise { - await this._branch(repository); + async branch(repository: Repository, historyItem?: SourceControlHistoryItem): Promise { + await this._branch(repository, undefined, false, historyItem?.id); } @command('git.branchFrom', { repository: true }) @@ -2700,6 +2717,7 @@ export class CommandCenter { { iconPath: new ThemeIcon('refresh'), tooltip: l10n.t('Regenerate Branch Name'), + location: QuickInputButtonLocation.Inline } ] : []; @@ -2728,8 +2746,8 @@ export class CommandCenter { return sanitizeBranchName(branchName || '', branchWhitespaceChar); } - private async _branch(repository: Repository, defaultName?: string, from = false): Promise { - let target = 'HEAD'; + private async _branch(repository: Repository, defaultName?: string, from = false, target?: string): Promise { + target = target ?? 'HEAD'; if (from) { const getRefPicks = async () => { @@ -2897,7 +2915,7 @@ export class CommandCenter { } @command('git.createTag', { repository: true }) - async createTag(repository: Repository): Promise { + async createTag(repository: Repository, historyItem?: SourceControlHistoryItem): Promise { const inputTagName = await window.showInputBox({ placeHolder: l10n.t('Tag name'), prompt: l10n.t('Please provide a tag name'), @@ -2915,7 +2933,7 @@ export class CommandCenter { }); const name = inputTagName.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$/g, '-'); - await repository.tag(name, inputMessage); + await repository.tag({ name, message: inputMessage, ref: historyItem?.id }); } @command('git.deleteTag', { repository: true }) @@ -3048,7 +3066,8 @@ export class CommandCenter { } @command('git.fetchRef', { repository: true }) - async fetchRef(repository: Repository, ref: string): Promise { + async fetchRef(repository: Repository, ref?: string): Promise { + ref = ref ?? repository?.historyProvider.currentHistoryItemRemoteRef?.id; if (!repository || !ref) { return; } @@ -3120,7 +3139,8 @@ export class CommandCenter { } @command('git.pullRef', { repository: true }) - async pullRef(repository: Repository, ref: string): Promise { + async pullRef(repository: Repository, ref?: string): Promise { + ref = ref ?? repository?.historyProvider.currentHistoryItemRemoteRef?.id; if (!repository || !ref) { return; } @@ -3267,8 +3287,8 @@ export class CommandCenter { } @command('git.pushRef', { repository: true }) - async pushRef(repository: Repository, ref: string): Promise { - if (!repository || !ref) { + async pushRef(repository: Repository): Promise { + if (!repository) { return; } @@ -3290,6 +3310,14 @@ export class CommandCenter { await repository.cherryPick(hash); } + @command('git.cherryPickRef', { repository: true }) + async cherryPickRef(repository: Repository, historyItem?: SourceControlHistoryItem): Promise { + if (!historyItem) { + return; + } + await repository.cherryPick(historyItem.id); + } + @command('git.pushTo', { repository: true }) async pushTo(repository: Repository, remote?: string, refspec?: string, setUpstream?: boolean): Promise { await this._push(repository, { pushType: PushType.PushTo, pushTo: { remote: remote, refspec: refspec, setUpstream: setUpstream } }); @@ -4186,17 +4214,36 @@ export class CommandCenter { } @command('git.viewCommit', { repository: true }) - async viewCommit(repository: Repository, historyItem: SourceControlHistoryItem): Promise { - if (!repository || !historyItem) { + async viewCommit(repository: Repository, historyItem1: SourceControlHistoryItem, historyItem2?: SourceControlHistoryItem): Promise { + if (!repository || !historyItem1) { return; } - const commit = await repository.getCommit(historyItem.id); - const title = `${historyItem.id.substring(0, 8)} - ${commit.message}`; + if (historyItem2) { + const mergeBase = await repository.getMergeBase(historyItem1.id, historyItem2.id); + if (!mergeBase || (mergeBase !== historyItem1.id && mergeBase !== historyItem2.id)) { + return; + } + } + + let title: string | undefined; + let historyItemParentId: string | undefined; + + // If historyItem2 is not provided, we are viewing a single commit. If historyItem2 is + // provided, we are viewing a range and we have to include both start and end commits. + // TODO@lszomoru - handle the case when historyItem2 is the first commit in the repository + if (!historyItem2) { + const commit = await repository.getCommit(historyItem1.id); + title = `${historyItem1.id.substring(0, 8)} - ${commit.message}`; + historyItemParentId = historyItem1.parentIds.length > 0 ? historyItem1.parentIds[0] : `${historyItem1.id}^`; + } else { + title = l10n.t('All Changes ({0} ↔ {1})', historyItem2.id.substring(0, 8), historyItem1.id.substring(0, 8)); + historyItemParentId = historyItem2.parentIds.length > 0 ? historyItem2.parentIds[0] : `${historyItem2.id}^`; + } - const multiDiffSourceUri = toGitUri(Uri.file(repository.root), historyItem.id, { scheme: 'git-commit' }); + const multiDiffSourceUri = toGitUri(Uri.file(repository.root), `${historyItemParentId}..${historyItem1.id}`, { scheme: 'git-commit', }); - await this._viewChanges(repository, historyItem, multiDiffSourceUri, title); + await this._viewChanges(repository, historyItem1.id, historyItemParentId, multiDiffSourceUri, title); } @command('git.viewAllChanges', { repository: true }) @@ -4211,20 +4258,32 @@ export class CommandCenter { const multiDiffSourceUri = toGitUri(Uri.file(repository.root), historyItem.id, { scheme: 'git-changes' }); - await this._viewChanges(repository, historyItem, multiDiffSourceUri, title); + await this._viewChanges(repository, modifiedShortRef, originalShortRef, multiDiffSourceUri, title); } - async _viewChanges(repository: Repository, historyItem: SourceControlHistoryItem, multiDiffSourceUri: Uri, title: string): Promise { - const historyItemParentId = historyItem.parentIds.length > 0 ? historyItem.parentIds[0] : `${historyItem.id}^`; - const changes = await repository.diffBetween(historyItemParentId, historyItem.id); + async _viewChanges(repository: Repository, historyItemId: string, historyItemParentId: string, multiDiffSourceUri: Uri, title: string): Promise { + const changes = await repository.diffBetween(historyItemParentId, historyItemId); + const resources = changes.map(c => toMultiFileDiffEditorUris(c, historyItemParentId, historyItemId)); + + await commands.executeCommand('_workbench.openMultiDiffEditor', { multiDiffSourceUri, title, resources }); + } - if (changes.length === 0) { + @command('git.copyCommitId', { repository: true }) + async copyCommitId(repository: Repository, historyItem: SourceControlHistoryItem): Promise { + if (!repository || !historyItem) { return; } - const resources = changes.map(c => toMultiFileDiffEditorUris(c, historyItemParentId, historyItem.id)); + env.clipboard.writeText(historyItem.id); + } - await commands.executeCommand('_workbench.openMultiDiffEditor', { multiDiffSourceUri, title, resources }); + @command('git.copyCommitMessage', { repository: true }) + async copyCommitMessage(repository: Repository, historyItem: SourceControlHistoryItem): Promise { + if (!repository || !historyItem) { + return; + } + + env.clipboard.writeText(historyItem.message); } private createCommand(id: string, key: string, method: Function, options: ScmCommandOptions): (...args: any[]) => any { @@ -4404,10 +4463,10 @@ export class CommandCenter { private getSCMResource(uri?: Uri): Resource | undefined { uri = uri ? uri : (window.activeTextEditor && window.activeTextEditor.document.uri); - this.logger.debug(`git.getSCMResource.uri ${uri && uri.toString()}`); + this.logger.debug(`[CommandCenter][getSCMResource] git.getSCMResource.uri: ${uri && uri.toString()}`); for (const r of this.model.repositories.map(r => r.root)) { - this.logger.debug(`repo root ${r}`); + this.logger.debug(`[CommandCenter][getSCMResource] repo root: ${r}`); } if (!uri) { diff --git a/extensions/git/src/decorationProvider.ts b/extensions/git/src/decorationProvider.ts index ace68c22524..548f3aa2a1c 100644 --- a/extensions/git/src/decorationProvider.ts +++ b/extensions/git/src/decorationProvider.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { window, workspace, Uri, Disposable, Event, EventEmitter, FileDecoration, FileDecorationProvider, ThemeColor, l10n } from 'vscode'; +import { window, workspace, Uri, Disposable, Event, EventEmitter, FileDecoration, FileDecorationProvider, ThemeColor, l10n, SourceControlHistoryItemRef } from 'vscode'; import * as path from 'path'; import { Repository, GitResourceGroup } from './repository'; import { Model } from './model'; @@ -11,6 +11,16 @@ import { debounce } from './decorators'; import { filterEvent, dispose, anyEvent, fireEvent, PromiseSource, combinedDisposable, runAndSubscribeEvent } from './util'; import { Change, GitErrorCodes, Status } from './api/git'; +function equalSourceControlHistoryItemRefs(ref1?: SourceControlHistoryItemRef, ref2?: SourceControlHistoryItemRef): boolean { + if (ref1 === ref2) { + return true; + } + + return ref1?.id === ref2?.id && + ref1?.name === ref2?.name && + ref1?.revision === ref2?.revision; +} + class GitIgnoreDecorationProvider implements FileDecorationProvider { private static Decoration: FileDecoration = { color: new ThemeColor('gitDecoration.ignoredResourceForeground') }; @@ -158,22 +168,37 @@ class GitIncomingChangesFileDecorationProvider implements FileDecorationProvider private readonly _onDidChangeDecorations = new EventEmitter(); readonly onDidChangeFileDecorations: Event = this._onDidChangeDecorations.event; - private decorations = new Map(); + private _currentHistoryItemRef: SourceControlHistoryItemRef | undefined; + private _currentHistoryItemRemoteRef: SourceControlHistoryItemRef | undefined; + + private _decorations = new Map(); private readonly disposables: Disposable[] = []; constructor(private readonly repository: Repository) { this.disposables.push( window.registerFileDecorationProvider(this), - runAndSubscribeEvent(repository.historyProvider.onDidChangeCurrentHistoryItemGroup, () => this.onDidChangeCurrentHistoryItemGroup()) + runAndSubscribeEvent(repository.historyProvider.onDidChangeCurrentHistoryItemRefs, () => this.onDidChangeCurrentHistoryItemRefs()) ); } - private async onDidChangeCurrentHistoryItemGroup(): Promise { - const newDecorations = new Map(); - await this.collectIncomingChangesFileDecorations(newDecorations); - const uris = new Set([...this.decorations.keys()].concat([...newDecorations.keys()])); + private async onDidChangeCurrentHistoryItemRefs(): Promise { + const historyProvider = this.repository.historyProvider; + const currentHistoryItemRef = historyProvider.currentHistoryItemRef; + const currentHistoryItemRemoteRef = historyProvider.currentHistoryItemRemoteRef; + + if (equalSourceControlHistoryItemRefs(this._currentHistoryItemRef, currentHistoryItemRef) && + equalSourceControlHistoryItemRefs(this._currentHistoryItemRemoteRef, currentHistoryItemRemoteRef)) { + return; + } + + const decorations = new Map(); + await this.collectIncomingChangesFileDecorations(decorations); + const uris = new Set([...this._decorations.keys()].concat([...decorations.keys()])); + + this._decorations = decorations; + this._currentHistoryItemRef = currentHistoryItemRef; + this._currentHistoryItemRemoteRef = currentHistoryItemRemoteRef; - this.decorations = newDecorations; this._onDidChangeDecorations.fire([...uris.values()].map(value => Uri.parse(value, true))); } @@ -218,18 +243,19 @@ class GitIncomingChangesFileDecorationProvider implements FileDecorationProvider private async getIncomingChanges(): Promise { try { const historyProvider = this.repository.historyProvider; - const currentHistoryItemGroup = historyProvider.currentHistoryItemGroup; + const currentHistoryItemRef = historyProvider.currentHistoryItemRef; + const currentHistoryItemRemoteRef = historyProvider.currentHistoryItemRemoteRef; - if (!currentHistoryItemGroup?.remote) { + if (!currentHistoryItemRef || !currentHistoryItemRemoteRef) { return []; } - const ancestor = await historyProvider.resolveHistoryItemGroupCommonAncestor(currentHistoryItemGroup.id, currentHistoryItemGroup.remote.id); + const ancestor = await historyProvider.resolveHistoryItemRefsCommonAncestor([currentHistoryItemRef.id, currentHistoryItemRemoteRef.id]); if (!ancestor) { return []; } - const changes = await this.repository.diffBetween(ancestor.id, currentHistoryItemGroup.remote.id); + const changes = await this.repository.diffBetween(ancestor, currentHistoryItemRemoteRef.id); return changes; } catch (err) { return []; @@ -237,7 +263,7 @@ class GitIncomingChangesFileDecorationProvider implements FileDecorationProvider } provideFileDecoration(uri: Uri): FileDecoration | undefined { - return this.decorations.get(uri.toString()); + return this._decorations.get(uri.toString()); } dispose(): void { diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 0e2b37af5b7..4d28b74d14c 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -491,7 +491,6 @@ export class Git { const repoUri = Uri.file(repositoryRootPath); const pathUri = Uri.file(pathInsidePossibleRepository); if (repoUri.authority.length !== 0 && pathUri.authority.length === 0) { - // eslint-disable-next-line local/code-no-look-behind-regex const match = /(?<=^\/?)([a-zA-Z])(?=:\/)/.exec(pathUri.path); if (match !== null) { const [, letter] = match; @@ -1062,6 +1061,7 @@ export interface PullOptions { } export class Repository { + private _isUsingRefTable = false; constructor( private _git: Git, @@ -1113,7 +1113,7 @@ export class Repository { return result.stdout.trim(); } catch (err) { - this.logger.warn(`git config failed: ${err.message}`); + this.logger.warn(`[Git][config] git config failed: ${err.message}`); return ''; } } @@ -1137,6 +1137,7 @@ export class Repository { } async log(options?: LogOptions): Promise { + const spawnOptions: SpawnOptions = {}; const args = ['log', `--format=${COMMIT_FORMAT}`, '-z']; if (options?.shortStats) { @@ -1165,17 +1166,30 @@ export class Repository { args.push(`--author="${options.author}"`); } + if (typeof options?.maxParents === 'number') { + args.push(`--max-parents=${options.maxParents}`); + } + + if (typeof options?.skip === 'number') { + args.push(`--skip=${options.skip}`); + } + if (options?.refNames) { args.push('--topo-order'); args.push('--decorate=full'); - args.push(...options.refNames); + + // In order to avoid hitting the command line limit due to large number of reference + // names (can happen when the `all` filter is used in the Source Control Graph view), + // we are passing the reference names via stdin. + spawnOptions.input = options.refNames.join('\n'); + args.push('--stdin'); } if (options?.path) { args.push('--', options.path); } - const result = await this.exec(args); + const result = await this.exec(args, spawnOptions); if (result.exitCode) { // An empty repo return []; @@ -1502,6 +1516,21 @@ export class Repository { return parseGitChanges(this.repositoryRoot, gitResult.stdout); } + async diffTrees(treeish1: string, treeish2?: string): Promise { + const args = ['diff-tree', '-r', '--name-status', '-z', '--diff-filter=ADMR', treeish1]; + + if (treeish2) { + args.push(treeish2); + } + + const gitResult = await this.exec(args); + if (gitResult.exitCode) { + return []; + } + + return parseGitChanges(this.repositoryRoot, gitResult.stdout); + } + async getMergeBase(ref1: string, ref2: string, ...refs: string[]): Promise { try { const args = ['merge-base']; @@ -1781,13 +1810,17 @@ export class Repository { await this.exec(['merge', '--abort']); } - async tag(name: string, message?: string): Promise { + async tag(options: { name: string; message?: string; ref?: string }): Promise { let args = ['tag']; - if (message) { - args = [...args, '-a', name, '-m', message]; + if (options.message) { + args = [...args, '-a', options.name, '-m', options.message]; } else { - args = [...args, name]; + args = [...args, options.name]; + } + + if (options.ref) { + args.push(options.ref); } await this.exec(args); @@ -2311,13 +2344,25 @@ export class Repository { } async getHEAD(): Promise { - try { - // Attempt to parse the HEAD file - const result = await this.getHEADFS(); - return result; - } - catch (err) { - this.logger.warn(err.message); + if (!this._isUsingRefTable) { + try { + // Attempt to parse the HEAD file + const result = await this.getHEADFS(); + + // Git 2.45 adds support for a new reference storage backend called "reftable", promising + // faster lookups, reads, and writes for repositories with any number of references. For + // backwards compatibility the `.git/HEAD` file contains `ref: refs/heads/.invalid`. More + // details are available at https://git-scm.com/docs/reftable + if (result.name === '.invalid') { + this._isUsingRefTable = true; + this.logger.warn(`[Git][getHEAD] Failed to parse HEAD file: Repository is using reftable format.`); + } else { + return result; + } + } + catch (err) { + this.logger.warn(`[Git][getHEAD] Failed to parse HEAD file: ${err.message}`); + } } try { @@ -2465,11 +2510,11 @@ export class Repository { remotes.push(...await this.getRemotesFS()); if (remotes.length === 0) { - this.logger.info('No remotes found in the git config file.'); + this.logger.info('[Git][getRemotes] No remotes found in the git config file'); } } catch (err) { - this.logger.warn(`getRemotes() - ${err.message}`); + this.logger.warn(`[Git][getRemotes] Error: ${err.message}`); // Fallback to using git to get the remotes remotes.push(...await this.getRemotesGit()); @@ -2605,13 +2650,13 @@ export class Repository { return branch; } - this.logger.warn(`No such branch: ${name}.`); + this.logger.warn(`[Git][getBranch] No such branch: ${name}`); return Promise.reject(new Error(`No such branch: ${name}.`)); } async getDefaultBranch(): Promise { const result = await this.exec(['symbolic-ref', '--short', 'refs/remotes/origin/HEAD']); - if (!result.stdout) { + if (!result.stdout || result.stderr) { throw new Error('No default branch'); } @@ -2670,7 +2715,7 @@ export class Repository { } async getCommit(ref: string): Promise { - const result = await this.exec(['show', '-s', `--format=${COMMIT_FORMAT}`, '-z', ref]); + const result = await this.exec(['show', '-s', '--decorate=full', '--shortstat', `--format=${COMMIT_FORMAT}`, '-z', ref]); const commits = parseGitCommits(result.stdout); if (commits.length === 0) { return Promise.reject('bad commit format'); @@ -2678,30 +2723,12 @@ export class Repository { return commits[0]; } - async getCommitFiles(ref: string): Promise { - const result = await this.exec(['diff-tree', '--no-commit-id', '--name-only', '-r', ref]); - return result.stdout.split('\n').filter(l => !!l); - } - - async getCommitCount(range: string): Promise<{ ahead: number; behind: number }> { - const args = ['rev-list', '--count', '--left-right', range]; - - if (isWindows) { - args.splice(0, 0, '-c', 'core.longpaths=true'); - } - - const result = await this.exec(args); - const [ahead, behind] = result.stdout.trim().split('\t'); - - return { ahead: Number(ahead) || 0, behind: Number(behind) || 0 }; - } - async revParse(ref: string): Promise { try { const result = await fs.readFile(path.join(this.dotGit.path, ref), 'utf8'); return result.trim(); } catch (err) { - this.logger.warn(err.message); + this.logger.warn(`[Git][revParse] Unable to read file: ${err.message}`); } try { diff --git a/extensions/git/src/historyProvider.ts b/extensions/git/src/historyProvider.ts index 22cbe9c493d..80d57a1beac 100644 --- a/extensions/git/src/historyProvider.ts +++ b/extensions/git/src/historyProvider.ts @@ -4,193 +4,256 @@ *--------------------------------------------------------------------------------------------*/ -import { Disposable, Event, EventEmitter, FileDecoration, FileDecorationProvider, SourceControlHistoryItem, SourceControlHistoryItemChange, SourceControlHistoryItemGroup, SourceControlHistoryOptions, SourceControlHistoryProvider, ThemeIcon, Uri, window, LogOutputChannel, SourceControlHistoryItemLabel } from 'vscode'; +import { Disposable, Event, EventEmitter, FileDecoration, FileDecorationProvider, SourceControlHistoryItem, SourceControlHistoryItemChange, SourceControlHistoryOptions, SourceControlHistoryProvider, ThemeIcon, Uri, window, LogOutputChannel, SourceControlHistoryItemRef, l10n, SourceControlHistoryItemRefsChangeEvent } from 'vscode'; import { Repository, Resource } from './repository'; -import { IDisposable, dispose, filterEvent } from './util'; +import { IDisposable, deltaHistoryItemRefs, dispose, filterEvent } from './util'; import { toGitUri } from './uri'; -import { Branch, RefType, UpstreamRef } from './api/git'; +import { Branch, LogOptions, Ref, RefType } from './api/git'; import { emojify, ensureEmojis } from './emoji'; -import { Operation } from './operation'; import { Commit } from './git'; +import { OperationKind, OperationResult } from './operation'; -export class GitHistoryProvider implements SourceControlHistoryProvider, FileDecorationProvider, IDisposable { - - private readonly _onDidChangeCurrentHistoryItemGroup = new EventEmitter(); - readonly onDidChangeCurrentHistoryItemGroup: Event = this._onDidChangeCurrentHistoryItemGroup.event; +function toSourceControlHistoryItemRef(ref: Ref): SourceControlHistoryItemRef { + switch (ref.type) { + case RefType.RemoteHead: + return { + id: `refs/remotes/${ref.name}`, + name: ref.name ?? '', + description: ref.commit ? l10n.t('Remote branch at {0}', ref.commit.substring(0, 8)) : undefined, + revision: ref.commit, + icon: new ThemeIcon('cloud'), + category: l10n.t('remote branches') + }; + case RefType.Tag: + return { + id: `refs/tags/${ref.name}`, + name: ref.name ?? '', + description: ref.commit ? l10n.t('Tag at {0}', ref.commit.substring(0, 8)) : undefined, + revision: ref.commit, + icon: new ThemeIcon('tag'), + category: l10n.t('tags') + }; + default: + return { + id: `refs/heads/${ref.name}`, + name: ref.name ?? '', + description: ref.commit ? ref.commit.substring(0, 8) : undefined, + revision: ref.commit, + icon: new ThemeIcon('git-branch'), + category: l10n.t('branches') + }; + } +} +export class GitHistoryProvider implements SourceControlHistoryProvider, FileDecorationProvider, IDisposable { private readonly _onDidChangeDecorations = new EventEmitter(); readonly onDidChangeFileDecorations: Event = this._onDidChangeDecorations.event; - private _HEAD: Branch | undefined; - private _HEADMergeBase: Branch | undefined; + private _currentHistoryItemRef: SourceControlHistoryItemRef | undefined; + get currentHistoryItemRef(): SourceControlHistoryItemRef | undefined { return this._currentHistoryItemRef; } - private _currentHistoryItemGroup: SourceControlHistoryItemGroup | undefined; - get currentHistoryItemGroup(): SourceControlHistoryItemGroup | undefined { return this._currentHistoryItemGroup; } - set currentHistoryItemGroup(value: SourceControlHistoryItemGroup | undefined) { - this._currentHistoryItemGroup = value; - this._onDidChangeCurrentHistoryItemGroup.fire(); - } + private _currentHistoryItemRemoteRef: SourceControlHistoryItemRef | undefined; + get currentHistoryItemRemoteRef(): SourceControlHistoryItemRef | undefined { return this._currentHistoryItemRemoteRef; } + + private _currentHistoryItemBaseRef: SourceControlHistoryItemRef | undefined; + get currentHistoryItemBaseRef(): SourceControlHistoryItemRef | undefined { return this._currentHistoryItemBaseRef; } + + private readonly _onDidChangeCurrentHistoryItemRefs = new EventEmitter(); + readonly onDidChangeCurrentHistoryItemRefs: Event = this._onDidChangeCurrentHistoryItemRefs.event; + + private readonly _onDidChangeHistoryItemRefs = new EventEmitter(); + readonly onDidChangeHistoryItemRefs: Event = this._onDidChangeHistoryItemRefs.event; + + private _HEAD: Branch | undefined; + private historyItemRefs: SourceControlHistoryItemRef[] = []; private historyItemDecorations = new Map(); - private historyItemLabels = new Map([ - ['HEAD -> refs/heads/', 'target'], - ['refs/heads/', 'git-branch'], - ['refs/remotes/', 'cloud'], - ['refs/tags/', 'tag'] - ]); private disposables: Disposable[] = []; constructor(protected readonly repository: Repository, private readonly logger: LogOutputChannel) { - this.disposables.push(repository.onDidRunGitStatus(() => this.onDidRunGitStatus(), this)); - this.disposables.push(filterEvent(repository.onDidRunOperation, e => e.operation === Operation.Refresh)(() => this.onDidRunGitStatus(true), this)); + const onDidRunWriteOperation = filterEvent(repository.onDidRunOperation, e => !e.operation.readOnly); + this.disposables.push(onDidRunWriteOperation(this.onDidRunWriteOperation, this)); this.disposables.push(window.registerFileDecorationProvider(this)); } - private async onDidRunGitStatus(force = false): Promise { - this.logger.trace('GitHistoryProvider:onDidRunGitStatus - HEAD:', JSON.stringify(this._HEAD)); - this.logger.trace('GitHistoryProvider:onDidRunGitStatus - repository.HEAD:', JSON.stringify(this.repository.HEAD)); - - // Get the merge base of the current history item group - const mergeBase = await this.resolveHEADMergeBase(); - - // Check if HEAD has changed - if (!force && - this._HEAD?.name === this.repository.HEAD?.name && - this._HEAD?.commit === this.repository.HEAD?.commit && - this._HEAD?.upstream?.name === this.repository.HEAD?.upstream?.name && - this._HEAD?.upstream?.remote === this.repository.HEAD?.upstream?.remote && - this._HEAD?.upstream?.commit === this.repository.HEAD?.upstream?.commit && - this._HEADMergeBase?.name === mergeBase?.name && - this._HEADMergeBase?.remote === mergeBase?.remote && - this._HEADMergeBase?.commit === mergeBase?.commit) { - this.logger.trace('GitHistoryProvider:onDidRunGitStatus - HEAD has not changed'); + private async onDidRunWriteOperation(result: OperationResult): Promise { + if (!this.repository.HEAD) { + this.logger.trace('[GitHistoryProvider][onDidRunWriteOperation] repository.HEAD is undefined'); + this._currentHistoryItemRef = this._currentHistoryItemRemoteRef = this._currentHistoryItemBaseRef = undefined; + this._onDidChangeCurrentHistoryItemRefs.fire(); + return; } - this._HEAD = this.repository.HEAD; - this._HEADMergeBase = mergeBase; - - // Check if HEAD does not support incoming/outgoing (detached commit, tag) - if (!this.repository.HEAD?.name || !this.repository.HEAD?.commit || this.repository.HEAD.type === RefType.Tag) { - this.logger.trace('GitHistoryProvider:onDidRunGitStatus - HEAD does not support incoming/outgoing'); - - this.currentHistoryItemGroup = undefined; - return; + let historyItemRefId = ''; + let historyItemRefName = ''; + + switch (this.repository.HEAD.type) { + case RefType.Head: { + if (this.repository.HEAD.name !== undefined) { + // Branch + historyItemRefId = `refs/heads/${this.repository.HEAD.name}`; + historyItemRefName = this.repository.HEAD.name; + + // Remote + this._currentHistoryItemRemoteRef = this.repository.HEAD.upstream ? { + id: `refs/remotes/${this.repository.HEAD.upstream.remote}/${this.repository.HEAD.upstream.name}`, + name: `${this.repository.HEAD.upstream.remote}/${this.repository.HEAD.upstream.name}`, + revision: this.repository.HEAD.upstream.commit, + icon: new ThemeIcon('cloud') + } : undefined; + + // Base - compute only if the branch has changed + if (this._HEAD?.name !== this.repository.HEAD.name) { + const mergeBase = await this.resolveHEADMergeBase(); + + this._currentHistoryItemBaseRef = mergeBase && + (mergeBase.remote !== this.repository.HEAD.upstream?.remote || + mergeBase.name !== this.repository.HEAD.upstream?.name) ? { + id: `refs/remotes/${mergeBase.remote}/${mergeBase.name}`, + name: `${mergeBase.remote}/${mergeBase.name}`, + revision: mergeBase.commit, + icon: new ThemeIcon('cloud') + } : undefined; + } + } else { + // Detached commit + historyItemRefId = this.repository.HEAD.commit ?? ''; + historyItemRefName = this.repository.HEAD.commit ?? ''; + + this._currentHistoryItemRemoteRef = undefined; + this._currentHistoryItemBaseRef = undefined; + } + break; + } + case RefType.Tag: { + // Tag + historyItemRefId = `refs/tags/${this.repository.HEAD.name}`; + historyItemRefName = this.repository.HEAD.name ?? this.repository.HEAD.commit ?? ''; + + this._currentHistoryItemRemoteRef = undefined; + this._currentHistoryItemBaseRef = undefined; + break; + } } - this.currentHistoryItemGroup = { - id: `refs/heads/${this.repository.HEAD.name ?? ''}`, - name: this.repository.HEAD.name ?? '', - remote: this.repository.HEAD.upstream ? { - id: `refs/remotes/${this.repository.HEAD.upstream.remote}/${this.repository.HEAD.upstream.name}`, - name: `${this.repository.HEAD.upstream.remote}/${this.repository.HEAD.upstream.name}`, - } : undefined, - base: mergeBase ? { - id: `refs/remotes/${mergeBase.remote}/${mergeBase.name}`, - name: `${mergeBase.remote}/${mergeBase.name}`, - } : undefined + this._HEAD = this.repository.HEAD; + + this._currentHistoryItemRef = { + id: historyItemRefId, + name: historyItemRefName, + revision: this.repository.HEAD.commit, + icon: new ThemeIcon('target'), }; - this.logger.trace(`GitHistoryProvider:onDidRunGitStatus - currentHistoryItemGroup (${force}): ${JSON.stringify(this.currentHistoryItemGroup)}`); - } + this._onDidChangeCurrentHistoryItemRefs.fire(); + this.logger.trace(`[GitHistoryProvider][onDidRunWriteOperation] currentHistoryItemRef: ${JSON.stringify(this._currentHistoryItemRef)}`); + this.logger.trace(`[GitHistoryProvider][onDidRunWriteOperation] currentHistoryItemRemoteRef: ${JSON.stringify(this._currentHistoryItemRemoteRef)}`); + this.logger.trace(`[GitHistoryProvider][onDidRunWriteOperation] currentHistoryItemBaseRef: ${JSON.stringify(this._currentHistoryItemBaseRef)}`); - async provideHistoryItems(historyItemGroupId: string, options: SourceControlHistoryOptions): Promise { - //TODO@lszomoru - support limit and cursor - if (typeof options.limit === 'number') { - throw new Error('Unsupported options.'); - } - if (typeof options.limit?.id !== 'string') { - throw new Error('Unsupported options.'); - } + // Refs (alphabetically) + const historyItemRefs = this.repository.refs + .map(ref => toSourceControlHistoryItemRef(ref)) + .sort((a, b) => a.id.localeCompare(b.id)); - const refParentId = options.limit.id; - const refId = await this.repository.revParse(historyItemGroupId) ?? ''; + // Auto-fetch + const silent = result.operation.kind === OperationKind.Fetch && result.operation.showProgress === false; + const delta = deltaHistoryItemRefs(this.historyItemRefs, historyItemRefs); + this._onDidChangeHistoryItemRefs.fire({ ...delta, silent }); - const historyItems: SourceControlHistoryItem[] = []; - const commits = await this.repository.log({ range: `${refParentId}..${refId}`, shortStats: true, sortByAuthorDate: true }); + this.historyItemRefs = historyItemRefs; - await ensureEmojis(); + const deltaLog = { + added: delta.added.map(ref => ref.id), + modified: delta.modified.map(ref => ref.id), + removed: delta.removed.map(ref => ref.id), + silent + }; + this.logger.trace(`[GitHistoryProvider][onDidRunWriteOperation] historyItemRefs: ${JSON.stringify(deltaLog)}`); + } - historyItems.push(...commits.map(commit => { - const newLineIndex = commit.message.indexOf('\n'); - const subject = newLineIndex !== -1 ? commit.message.substring(0, newLineIndex) : commit.message; + async provideHistoryItemRefs(): Promise { + const refs = await this.repository.getRefs(); - return { - id: commit.hash, - parentIds: commit.parents, - message: emojify(subject), - author: commit.authorName, - icon: new ThemeIcon('git-commit'), - timestamp: commit.authorDate?.getTime(), - statistics: commit.shortStat ?? { files: 0, insertions: 0, deletions: 0 }, - }; - })); + const branches: SourceControlHistoryItemRef[] = []; + const remoteBranches: SourceControlHistoryItemRef[] = []; + const tags: SourceControlHistoryItemRef[] = []; + + for (const ref of refs) { + switch (ref.type) { + case RefType.RemoteHead: + remoteBranches.push(toSourceControlHistoryItemRef(ref)); + break; + case RefType.Tag: + tags.push(toSourceControlHistoryItemRef(ref)); + break; + default: + branches.push(toSourceControlHistoryItemRef(ref)); + break; + } + } - return historyItems; + return [...branches, ...remoteBranches, ...tags]; } - async provideHistoryItems2(options: SourceControlHistoryOptions): Promise { - if (!this.currentHistoryItemGroup || !options.historyItemGroupIds) { + async provideHistoryItems(options: SourceControlHistoryOptions): Promise { + if (!this.currentHistoryItemRef || !options.historyItemRefs) { return []; } // Deduplicate refNames - const refNames = Array.from(new Set(options.historyItemGroupIds)); + const refNames = Array.from(new Set(options.historyItemRefs)); - // Get the merge base of the refNames - const refsMergeBase = await this.resolveHistoryItemGroupsMergeBase(refNames); - if (!refsMergeBase) { - return []; - } + let logOptions: LogOptions = { refNames, shortStats: true }; - // Get the commits - const commits = await this.repository.log({ range: `${refsMergeBase}^..`, refNames }); + try { + if (options.limit === undefined || typeof options.limit === 'number') { + logOptions = { ...logOptions, maxEntries: options.limit ?? 50 }; + } else if (typeof options.limit.id === 'string') { + // Get the common ancestor commit, and commits + const commit = await this.repository.getCommit(options.limit.id); + const commitParentId = commit.parents.length > 0 ? commit.parents[0] : await this.repository.getEmptyTree(); + + logOptions = { ...logOptions, range: `${commitParentId}..` }; + } - await ensureEmojis(); + if (typeof options.skip === 'number') { + logOptions = { ...logOptions, skip: options.skip }; + } - const historyItems: SourceControlHistoryItem[] = []; - historyItems.push(...commits.map(commit => { - const newLineIndex = commit.message.indexOf('\n'); - const subject = newLineIndex !== -1 ? commit.message.substring(0, newLineIndex) : commit.message; + const commits = await this.repository.log({ ...logOptions, silent: true }); - const labels = this.resolveHistoryItemLabels(commit, refNames); + await ensureEmojis(); - return { - id: commit.hash, - parentIds: commit.parents, - message: emojify(subject), - author: commit.authorName, - icon: new ThemeIcon('git-commit'), - timestamp: commit.authorDate?.getTime(), - statistics: commit.shortStat ?? { files: 0, insertions: 0, deletions: 0 }, - labels: labels.length !== 0 ? labels : undefined - }; - })); + return commits.map(commit => { + const references = this._resolveHistoryItemRefs(commit); - return historyItems; - } - - async provideHistoryItemSummary(historyItemId: string, historyItemParentId: string | undefined): Promise { - if (!historyItemParentId) { - const commit = await this.repository.getCommit(historyItemId); - historyItemParentId = commit.parents.length > 0 ? commit.parents[0] : `${historyItemId}^`; + return { + id: commit.hash, + parentIds: commit.parents, + message: emojify(commit.message), + author: commit.authorName, + icon: new ThemeIcon('git-commit'), + displayId: commit.hash.substring(0, 8), + timestamp: commit.authorDate?.getTime(), + statistics: commit.shortStat ?? { files: 0, insertions: 0, deletions: 0 }, + references: references.length !== 0 ? references : undefined + }; + }); + } catch (err) { + this.logger.error(`[GitHistoryProvider][provideHistoryItems] Failed to get history items with options '${JSON.stringify(options)}': ${err}`); + return []; } - - const allChanges = await this.repository.diffBetweenShortStat(historyItemParentId, historyItemId); - return { id: historyItemId, parentIds: [historyItemParentId], message: '', statistics: allChanges }; } async provideHistoryItemChanges(historyItemId: string, historyItemParentId: string | undefined): Promise { - if (!historyItemParentId) { - const commit = await this.repository.getCommit(historyItemId); - historyItemParentId = commit.parents.length > 0 ? commit.parents[0] : `${historyItemId}^`; - } + historyItemParentId = historyItemParentId ?? await this.repository.getEmptyTree(); const historyItemChangesUri: Uri[] = []; const historyItemChanges: SourceControlHistoryItemChange[] = []; - const changes = await this.repository.diffBetween(historyItemParentId, historyItemId); + const changes = await this.repository.diffTrees(historyItemParentId, historyItemId); for (const change of changes) { const historyItemUri = change.uri.with({ @@ -219,29 +282,36 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec return historyItemChanges; } - async resolveHistoryItemGroupCommonAncestor(historyItemId1: string, historyItemId2: string | undefined): Promise<{ id: string; ahead: number; behind: number } | undefined> { - if (!historyItemId2) { - const upstreamRef = await this.resolveHistoryItemGroupMergeBase(historyItemId1); - if (!upstreamRef) { - this.logger.info(`GitHistoryProvider:resolveHistoryItemGroupCommonAncestor - Failed to resolve history item group base for '${historyItemId1}'`); + async resolveHistoryItemRefsCommonAncestor(historyItemRefs: string[]): Promise { + try { + if (historyItemRefs.length === 0) { + // TODO@lszomoru - log return undefined; - } + } else if (historyItemRefs.length === 1 && historyItemRefs[0] === this.currentHistoryItemRef?.id) { + // Remote + if (this.currentHistoryItemRemoteRef) { + const ancestor = await this.repository.getMergeBase(historyItemRefs[0], this.currentHistoryItemRemoteRef.id); + return ancestor; + } - historyItemId2 = `refs/remotes/${upstreamRef.remote}/${upstreamRef.name}`; - } + // Base + if (this.currentHistoryItemBaseRef) { + const ancestor = await this.repository.getMergeBase(historyItemRefs[0], this.currentHistoryItemBaseRef.id); + return ancestor; + } - const ancestor = await this.repository.getMergeBase(historyItemId1, historyItemId2); - if (!ancestor) { - this.logger.info(`GitHistoryProvider:resolveHistoryItemGroupCommonAncestor - Failed to resolve common ancestor for '${historyItemId1}' and '${historyItemId2}'`); - return undefined; + // First commit + const commits = await this.repository.log({ maxParents: 0, refNames: ['HEAD'] }); + if (commits.length > 0) { + return commits[0].hash; + } + } else if (historyItemRefs.length > 1) { + const ancestor = await this.repository.getMergeBase(historyItemRefs[0], historyItemRefs[1], ...historyItemRefs.slice(2)); + return ancestor; + } } - - try { - const commitCount = await this.repository.getCommitCount(`${historyItemId1}...${historyItemId2}`); - this.logger.trace(`GitHistoryProvider:resolveHistoryItemGroupCommonAncestor - Resolved common ancestor for '${historyItemId1}' and '${historyItemId2}': ${JSON.stringify({ id: ancestor, ahead: commitCount.ahead, behind: commitCount.behind })}`); - return { id: ancestor, ahead: commitCount.ahead, behind: commitCount.behind }; - } catch (err) { - this.logger.error(`GitHistoryProvider:resolveHistoryItemGroupCommonAncestor - Failed to get ahead/behind for '${historyItemId1}...${historyItemId2}': ${err.message}`); + catch (err) { + this.logger.error(`[GitHistoryProvider][resolveHistoryItemRefsCommonAncestor] Failed to resolve common ancestor for ${historyItemRefs.join(',')}: ${err}`); } return undefined; @@ -251,63 +321,47 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec return this.historyItemDecorations.get(uri.toString()); } - private async resolveHistoryItemGroupsMergeBase(refNames: string[]): Promise { - if (refNames.length < 2) { - return undefined; - } - - const refsMergeBase = await this.repository.getMergeBase(refNames[0], refNames[1], ...refNames.slice(2)); - return refsMergeBase; - } - - private resolveHistoryItemLabels(commit: Commit, refNames: string[]): SourceControlHistoryItemLabel[] { - const labels: SourceControlHistoryItemLabel[] = []; - - for (const label of commit.refNames) { - if (!label.startsWith('HEAD -> ') && !refNames.includes(label)) { - continue; - } - - for (const [key, value] of this.historyItemLabels) { - if (label.startsWith(key)) { - labels.push({ - title: label.substring(key.length), - icon: new ThemeIcon(value) + private _resolveHistoryItemRefs(commit: Commit): SourceControlHistoryItemRef[] { + const references: SourceControlHistoryItemRef[] = []; + + for (const ref of commit.refNames) { + switch (true) { + case ref.startsWith('HEAD -> refs/heads/'): + references.push({ + id: ref.substring('HEAD -> '.length), + name: ref.substring('HEAD -> refs/heads/'.length), + revision: commit.hash, + icon: new ThemeIcon('target') + }); + break; + case ref.startsWith('tag: refs/tags/'): + references.push({ + id: ref.substring('tag: '.length), + name: ref.substring('tag: refs/tags/'.length), + revision: commit.hash, + icon: new ThemeIcon('tag') + }); + break; + case ref.startsWith('refs/heads/'): + references.push({ + id: ref, + name: ref.substring('refs/heads/'.length), + revision: commit.hash, + icon: new ThemeIcon('git-branch') + }); + break; + case ref.startsWith('refs/remotes/'): + references.push({ + id: ref, + name: ref.substring('refs/remotes/'.length), + revision: commit.hash, + icon: new ThemeIcon('cloud') }); break; - } - } - } - - return labels; - } - - private async resolveHistoryItemGroupMergeBase(historyItemId: string): Promise { - try { - // Upstream - const branch = await this.repository.getBranch(historyItemId); - if (branch.upstream) { - return branch.upstream; - } - - // Base (config -> reflog -> default) - const remoteBranch = await this.repository.getBranchBase(historyItemId); - if (!remoteBranch?.remote || !remoteBranch?.name || !remoteBranch?.commit || remoteBranch?.type !== RefType.RemoteHead) { - this.logger.info(`GitHistoryProvider:resolveHistoryItemGroupUpstreamOrBase - Failed to resolve history item group base for '${historyItemId}'`); - return undefined; } - - return { - name: remoteBranch.name, - remote: remoteBranch.remote, - commit: remoteBranch.commit - }; - } - catch (err) { - this.logger.error(`GitHistoryProvider:resolveHistoryItemGroupUpstreamOrBase - Failed to get branch base for '${historyItemId}': ${err.message}`); } - return undefined; + return references; } private async resolveHEADMergeBase(): Promise { diff --git a/extensions/git/src/main.ts b/extensions/git/src/main.ts index c2d9b974be7..aa4d98adc8b 100644 --- a/extensions/git/src/main.ts +++ b/extensions/git/src/main.ts @@ -20,7 +20,7 @@ import * as fs from 'fs'; import * as os from 'os'; import { GitTimelineProvider } from './timelineProvider'; import { registerAPICommands } from './api/api1'; -import { TerminalEnvironmentManager } from './terminal'; +import { TerminalEnvironmentManager, TerminalShellExecutionManager } from './terminal'; import { createIPCServer, IPCServer } from './ipc/ipcServer'; import { GitEditor } from './gitEditor'; import { GitPostCommitCommandsProvider } from './postCommitCommands'; @@ -48,7 +48,7 @@ async function createModel(context: ExtensionContext, logger: LogOutputChannel, } const info = await findGit(pathHints, gitPath => { - logger.info(l10n.t('Validating found git in: "{0}"', gitPath)); + logger.info(l10n.t('[main] Validating found git in: "{0}"', gitPath)); if (excludes.length === 0) { return true; } @@ -56,7 +56,7 @@ async function createModel(context: ExtensionContext, logger: LogOutputChannel, const normalized = path.normalize(gitPath).replace(/[\r\n]+$/, ''); const skip = excludes.some(e => normalized.startsWith(e)); if (skip) { - logger.info(l10n.t('Skipped found git in: "{0}"', gitPath)); + logger.info(l10n.t('[main] Skipped found git in: "{0}"', gitPath)); } return !skip; }, logger); @@ -66,7 +66,7 @@ async function createModel(context: ExtensionContext, logger: LogOutputChannel, try { ipcServer = await createIPCServer(context.storagePath); } catch (err) { - logger.error(`Failed to create git IPC: ${err}`); + logger.error(`[main] Failed to create git IPC: ${err}`); } const askpass = new Askpass(ipcServer); @@ -79,7 +79,7 @@ async function createModel(context: ExtensionContext, logger: LogOutputChannel, const terminalEnvironmentManager = new TerminalEnvironmentManager(context, [askpass, gitEditor, ipcServer]); disposables.push(terminalEnvironmentManager); - logger.info(l10n.t('Using git "{0}" from "{1}"', info.version, info.path)); + logger.info(l10n.t('[main] Using git "{0}" from "{1}"', info.version, info.path)); const git = new Git({ gitPath: info.path, @@ -113,7 +113,8 @@ async function createModel(context: ExtensionContext, logger: LogOutputChannel, new GitFileSystemProvider(model), new GitDecorations(model), new GitTimelineProvider(model, cc), - new GitEditSessionIdentityProvider(model) + new GitEditSessionIdentityProvider(model), + new TerminalShellExecutionManager(model, logger) ); const postCommitCommandsProvider = new GitPostCommitCommandsProvider(); @@ -187,7 +188,7 @@ export async function _activate(context: ExtensionContext): Promise { - logger.appendLine(l10n.t('Log level: {0}', LogLevel[logLevel])); + logger.appendLine(l10n.t('[main] Log level: {0}', LogLevel[logLevel])); }; disposables.push(logger.onDidChangeLogLevel(onDidChangeLogLevel)); onDidChangeLogLevel(logger.logLevel); @@ -212,13 +213,13 @@ export async function _activate(context: ExtensionContext): Promise { + this.logger.info('[Model][doInitialScan] Initial repository scan started'); + const config = workspace.getConfiguration('git'); const autoRepositoryDetection = config.get('autoRepositoryDetection'); const parentRepositoryConfig = config.get<'always' | 'never' | 'prompt'>('openRepositoryInParentFolders', 'prompt'); + this.logger.trace(`[Model][doInitialScan] Settings: autoRepositoryDetection=${autoRepositoryDetection}, openRepositoryInParentFolders=${parentRepositoryConfig}`); + // Initial repository scan function const initialScanFn = () => Promise.all([ this.onDidChangeWorkspaceFolders({ added: workspace.workspaceFolders || [], removed: [] }), @@ -321,6 +325,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi } */ this.telemetryReporter.sendTelemetryEvent('git.repositoryInitialScan', { autoRepositoryDetection: String(autoRepositoryDetection) }, { repositoryCount: this.openRepositories.length }); + this.logger.info(`[Model][doInitialScan] Initial repository scan completed - repositories (${this.repositories.length}), closed repositories (${this.closedRepositories.length}), parent repositories (${this.parentRepositories.length}), unsafe repositories (${this.unsafeRepositories.length})`); } /** @@ -329,47 +334,51 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi * the git.repositoryScanMaxDepth setting. */ private async scanWorkspaceFolders(): Promise { - const config = workspace.getConfiguration('git'); - const autoRepositoryDetection = config.get('autoRepositoryDetection'); - this.logger.trace(`[swsf] Scan workspace sub folders. autoRepositoryDetection=${autoRepositoryDetection}`); + try { + const config = workspace.getConfiguration('git'); + const autoRepositoryDetection = config.get('autoRepositoryDetection'); - if (autoRepositoryDetection !== true && autoRepositoryDetection !== 'subFolders') { - return; - } + if (autoRepositoryDetection !== true && autoRepositoryDetection !== 'subFolders') { + return; + } - await Promise.all((workspace.workspaceFolders || []).map(async folder => { - const root = folder.uri.fsPath; - this.logger.trace(`[swsf] Workspace folder: ${root}`); + await Promise.all((workspace.workspaceFolders || []).map(async folder => { + const root = folder.uri.fsPath; + this.logger.trace(`[Model][scanWorkspaceFolders] Workspace folder: ${root}`); - // Workspace folder children - const repositoryScanMaxDepth = (workspace.isTrusted ? workspace.getConfiguration('git', folder.uri) : config).get('repositoryScanMaxDepth', 1); - const repositoryScanIgnoredFolders = (workspace.isTrusted ? workspace.getConfiguration('git', folder.uri) : config).get('repositoryScanIgnoredFolders', []); + // Workspace folder children + const repositoryScanMaxDepth = (workspace.isTrusted ? workspace.getConfiguration('git', folder.uri) : config).get('repositoryScanMaxDepth', 1); + const repositoryScanIgnoredFolders = (workspace.isTrusted ? workspace.getConfiguration('git', folder.uri) : config).get('repositoryScanIgnoredFolders', []); - const subfolders = new Set(await this.traverseWorkspaceFolder(root, repositoryScanMaxDepth, repositoryScanIgnoredFolders)); + const subfolders = new Set(await this.traverseWorkspaceFolder(root, repositoryScanMaxDepth, repositoryScanIgnoredFolders)); - // Repository scan folders - const scanPaths = (workspace.isTrusted ? workspace.getConfiguration('git', folder.uri) : config).get('scanRepositories') || []; - this.logger.trace(`[swsf] Workspace scan settings: repositoryScanMaxDepth=${repositoryScanMaxDepth}; repositoryScanIgnoredFolders=[${repositoryScanIgnoredFolders.join(', ')}]; scanRepositories=[${scanPaths.join(', ')}]`); + // Repository scan folders + const scanPaths = (workspace.isTrusted ? workspace.getConfiguration('git', folder.uri) : config).get('scanRepositories') || []; + this.logger.trace(`[Model][scanWorkspaceFolders] Workspace scan settings: repositoryScanMaxDepth=${repositoryScanMaxDepth}; repositoryScanIgnoredFolders=[${repositoryScanIgnoredFolders.join(', ')}]; scanRepositories=[${scanPaths.join(', ')}]`); - for (const scanPath of scanPaths) { - if (scanPath === '.git') { - this.logger.trace('[swsf] \'.git\' not supported in \'git.scanRepositories\' setting.'); - continue; - } + for (const scanPath of scanPaths) { + if (scanPath === '.git') { + this.logger.trace('[Model][scanWorkspaceFolders] \'.git\' not supported in \'git.scanRepositories\' setting.'); + continue; + } - if (path.isAbsolute(scanPath)) { - const notSupportedMessage = l10n.t('Absolute paths not supported in "git.scanRepositories" setting.'); - this.logger.warn(notSupportedMessage); - console.warn(notSupportedMessage); - continue; - } + if (path.isAbsolute(scanPath)) { + const notSupportedMessage = l10n.t('Absolute paths not supported in "git.scanRepositories" setting.'); + this.logger.warn(`[Model][scanWorkspaceFolders] ${notSupportedMessage}`); + console.warn(notSupportedMessage); + continue; + } - subfolders.add(path.join(root, scanPath)); - } + subfolders.add(path.join(root, scanPath)); + } - this.logger.trace(`[swsf] Workspace scan sub folders: [${[...subfolders].join(', ')}]`); - await Promise.all([...subfolders].map(f => this.openRepository(f))); - })); + this.logger.trace(`[Model][scanWorkspaceFolders] Workspace scan sub folders: [${[...subfolders].join(', ')}]`); + await Promise.all([...subfolders].map(f => this.openRepository(f))); + })); + } + catch (err) { + this.logger.warn(`[Model][scanWorkspaceFolders] Error: ${err}`); + } } private async traverseWorkspaceFolder(workspaceFolder: string, maxDepth: number, repositoryScanIgnoredFolders: string[]): Promise { @@ -388,7 +397,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi } } catch (err) { - this.logger.warn(`[swsf] Unable to read folder '${currentFolder.path}': ${err}`); + this.logger.warn(`[Model][traverseWorkspaceFolder] Unable to read workspace folder '${currentFolder.path}': ${err}`); continue; } @@ -434,23 +443,28 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi } private async onDidChangeWorkspaceFolders({ added, removed }: WorkspaceFoldersChangeEvent): Promise { - const possibleRepositoryFolders = added - .filter(folder => !this.getOpenRepository(folder.uri)); - - const activeRepositoriesList = window.visibleTextEditors - .map(editor => this.getRepository(editor.document.uri)) - .filter(repository => !!repository) as Repository[]; - - const activeRepositories = new Set(activeRepositoriesList); - const openRepositoriesToDispose = removed - .map(folder => this.getOpenRepository(folder.uri)) - .filter(r => !!r) - .filter(r => !activeRepositories.has(r!.repository)) - .filter(r => !(workspace.workspaceFolders || []).some(f => isDescendant(f.uri.fsPath, r!.repository.root))) as OpenRepository[]; - - openRepositoriesToDispose.forEach(r => r.dispose()); - this.logger.trace(`[swf] Scan workspace folders: [${possibleRepositoryFolders.map(p => p.uri.fsPath).join(', ')}]`); - await Promise.all(possibleRepositoryFolders.map(p => this.openRepository(p.uri.fsPath))); + try { + const possibleRepositoryFolders = added + .filter(folder => !this.getOpenRepository(folder.uri)); + + const activeRepositoriesList = window.visibleTextEditors + .map(editor => this.getRepository(editor.document.uri)) + .filter(repository => !!repository) as Repository[]; + + const activeRepositories = new Set(activeRepositoriesList); + const openRepositoriesToDispose = removed + .map(folder => this.getOpenRepository(folder.uri)) + .filter(r => !!r) + .filter(r => !activeRepositories.has(r!.repository)) + .filter(r => !(workspace.workspaceFolders || []).some(f => isDescendant(f.uri.fsPath, r!.repository.root))) as OpenRepository[]; + + openRepositoriesToDispose.forEach(r => r.dispose()); + this.logger.trace(`[Model][onDidChangeWorkspaceFolders] Workspace folders: [${possibleRepositoryFolders.map(p => p.uri.fsPath).join(', ')}]`); + await Promise.all(possibleRepositoryFolders.map(p => this.openRepository(p.uri.fsPath))); + } + catch (err) { + this.logger.warn(`[Model][onDidChangeWorkspaceFolders] Error: ${err}`); + } } private onDidChangeConfiguration(): void { @@ -463,50 +477,54 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi .filter(({ root }) => workspace.getConfiguration('git', root).get('enabled') !== true) .map(({ repository }) => repository); - this.logger.trace(`[swf] Scan workspace folders: [${possibleRepositoryFolders.map(p => p.uri.fsPath).join(', ')}]`); + this.logger.trace(`[Model][onDidChangeConfiguration] Workspace folders: [${possibleRepositoryFolders.map(p => p.uri.fsPath).join(', ')}]`); possibleRepositoryFolders.forEach(p => this.openRepository(p.uri.fsPath)); openRepositoriesToDispose.forEach(r => r.dispose()); } private async onDidChangeVisibleTextEditors(editors: readonly TextEditor[]): Promise { - if (!workspace.isTrusted) { - this.logger.trace('[svte] Workspace is not trusted.'); - return; - } - - const config = workspace.getConfiguration('git'); - const autoRepositoryDetection = config.get('autoRepositoryDetection'); - this.logger.trace(`[svte] Scan visible text editors. autoRepositoryDetection=${autoRepositoryDetection}`); - - if (autoRepositoryDetection !== true && autoRepositoryDetection !== 'openEditors') { - return; - } - - await Promise.all(editors.map(async editor => { - const uri = editor.document.uri; - - if (uri.scheme !== 'file') { + try { + if (!workspace.isTrusted) { + this.logger.trace('[Model][onDidChangeVisibleTextEditors] Workspace is not trusted.'); return; } - const repository = this.getRepository(uri); + const config = workspace.getConfiguration('git'); + const autoRepositoryDetection = config.get('autoRepositoryDetection'); - if (repository) { - this.logger.trace(`[svte] Repository for editor resource ${uri.fsPath} already exists: ${repository.root}`); + if (autoRepositoryDetection !== true && autoRepositoryDetection !== 'openEditors') { return; } - this.logger.trace(`[svte] Open repository for editor resource ${uri.fsPath}`); - await this.openRepository(path.dirname(uri.fsPath)); - })); + await Promise.all(editors.map(async editor => { + const uri = editor.document.uri; + + if (uri.scheme !== 'file') { + return; + } + + const repository = this.getRepository(uri); + + if (repository) { + this.logger.trace(`[Model][onDidChangeVisibleTextEditors] Repository for editor resource ${uri.fsPath} already exists: ${repository.root}`); + return; + } + + this.logger.trace(`[Model][onDidChangeVisibleTextEditors] Open repository for editor resource ${uri.fsPath}`); + await this.openRepository(path.dirname(uri.fsPath)); + })); + } + catch (err) { + this.logger.warn(`[Model][onDidChangeVisibleTextEditors] Error: ${err}`); + } } @sequentialize async openRepository(repoPath: string, openIfClosed = false): Promise { - this.logger.trace(`Opening repository: ${repoPath}`); + this.logger.trace(`[Model][openRepository] Repository: ${repoPath}`); const existingRepository = await this.getRepositoryExact(repoPath); if (existingRepository) { - this.logger.trace(`Repository for path ${repoPath} already exists: ${existingRepository.root}`); + this.logger.trace(`[Model][openRepository] Repository for path ${repoPath} already exists: ${existingRepository.root}`); return; } @@ -514,7 +532,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi const enabled = config.get('enabled') === true; if (!enabled) { - this.logger.trace('Git is not enabled'); + this.logger.trace('[Model][openRepository] Git is not enabled'); return; } @@ -524,7 +542,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi fs.accessSync(path.join(repoPath, 'HEAD'), fs.constants.F_OK); const result = await this.git.exec(repoPath, ['-C', repoPath, 'rev-parse', '--show-cdup']); if (result.stderr.trim() === '' && result.stdout.trim() === '') { - this.logger.trace(`Bare repository: ${repoPath}`); + this.logger.trace(`[Model][openRepository] Bare repository: ${repoPath}`); return; } } catch { @@ -534,16 +552,16 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi try { const { repositoryRoot, unsafeRepositoryMatch } = await this.getRepositoryRoot(repoPath); - this.logger.trace(`Repository root for path ${repoPath} is: ${repositoryRoot}`); + this.logger.trace(`[Model][openRepository] Repository root for path ${repoPath} is: ${repositoryRoot}`); const existingRepository = await this.getRepositoryExact(repositoryRoot); if (existingRepository) { - this.logger.trace(`Repository for path ${repositoryRoot} already exists: ${existingRepository.root}`); + this.logger.trace(`[Model][openRepository] Repository for path ${repositoryRoot} already exists: ${existingRepository.root}`); return; } if (this.shouldRepositoryBeIgnored(repositoryRoot)) { - this.logger.trace(`Repository for path ${repositoryRoot} is ignored`); + this.logger.trace(`[Model][openRepository] Repository for path ${repositoryRoot} is ignored`); return; } @@ -552,7 +570,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi if (parentRepositoryConfig !== 'always' && this.globalState.get(`parentRepository:${repositoryRoot}`) !== true) { const isRepositoryOutsideWorkspace = await this.isRepositoryOutsideWorkspace(repositoryRoot); if (isRepositoryOutsideWorkspace) { - this.logger.trace(`Repository in parent folder: ${repositoryRoot}`); + this.logger.trace(`[Model][openRepository] Repository in parent folder: ${repositoryRoot}`); if (!this._parentRepositoriesManager.hasRepository(repositoryRoot)) { // Show a notification if the parent repository is opened after the initial scan @@ -569,7 +587,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi // Handle unsafe repositories if (unsafeRepositoryMatch && unsafeRepositoryMatch.length === 3) { - this.logger.trace(`Unsafe repository: ${repositoryRoot}`); + this.logger.trace(`[Model][openRepository] Unsafe repository: ${repositoryRoot}`); // Show a notification if the unsafe repository is opened after the initial scan if (this._state === 'initialized' && !this._unsafeRepositoriesManager.hasRepository(repositoryRoot)) { @@ -583,7 +601,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi // Handle repositories that were closed by the user if (!openIfClosed && this._closedRepositoriesManager.isRepositoryClosed(repositoryRoot)) { - this.logger.trace(`Repository for path ${repositoryRoot} is closed`); + this.logger.trace(`[Model][openRepository] Repository for path ${repositoryRoot} is closed`); return; } @@ -594,12 +612,14 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi this.open(repository); this._closedRepositoriesManager.deleteRepository(repository.root); + this.logger.info(`[Model][openRepository] Opened repository: ${repository.root}`); + // Do not await this, we want SCM // to know about the repo asap repository.status(); } catch (err) { // noop - this.logger.trace(`Opening repository for path='${repoPath}' failed; ex=${err}`); + this.logger.trace(`[Model][openRepository] Opening repository for path='${repoPath}' failed. Error:${err}`); } } @@ -631,7 +651,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi const repositoryRootRealPath = await fs.promises.realpath(repositoryRoot); return !pathEquals(repositoryRoot, repositoryRootRealPath) ? repositoryRootRealPath : undefined; } catch (err) { - this.logger.warn(`Failed to get repository realpath for: "${repositoryRoot}". ${err}`); + this.logger.warn(`[Model][getRepositoryRootRealPath] Failed to get repository realpath for "${repositoryRoot}": ${err}`); return undefined; } } @@ -658,7 +678,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi } private open(repository: Repository): void { - this.logger.info(`Open repository: ${repository.root}`); + this.logger.trace(`[Model][open] Repository: ${repository.root}`); const onDidDisappearRepository = filterEvent(repository.onDidChangeState, state => state === RepositoryState.Disposed); const disappearListener = onDidDisappearRepository(() => dispose()); @@ -675,7 +695,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi const checkForSubmodules = () => { if (!shouldDetectSubmodules) { - this.logger.trace('Automatic detection of git submodules is not enabled.'); + this.logger.trace('[Model][open] Automatic detection of git submodules is not enabled.'); return; } @@ -688,7 +708,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi .slice(0, submodulesLimit) .map(r => path.join(repository.root, r.path)) .forEach(p => { - this.logger.trace(`Opening submodule: '${p}'`); + this.logger.trace(`[Model][open] Opening submodule: '${p}'`); this.eventuallyScanPossibleGitRepository(p); }); }; @@ -750,7 +770,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi return; } - this.logger.info(`Close repository: ${repository.root}`); + this.logger.info(`[Model][close] Repository: ${repository.root}`); this._closedRepositoriesManager.addRepository(openRepository.repository.root); openRepository.dispose(); @@ -803,7 +823,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi return openRepositoryRealPath?.repository; } catch (err) { - this.logger.warn(`Failed to get repository realpath for: "${repoPath}". ${err}`); + this.logger.warn(`[Model][getRepositoryExact] Failed to get repository realpath for: "${repoPath}". Error:${err}`); return undefined; } } @@ -989,7 +1009,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi this._workspaceFolders.set(workspaceFolder.uri.fsPath, result); } catch (err) { // noop - Workspace folder does not exist - this.logger.trace(`Failed to resolve workspace folder: "${workspaceFolder.uri.fsPath}". ${err}`); + this.logger.trace(`[Model][getWorkspaceFolderRealPath] Failed to resolve workspace folder "${workspaceFolder.uri.fsPath}". Error:${err}`); } } diff --git a/extensions/git/src/operation.ts b/extensions/git/src/operation.ts index 223f1945b02..d960cedfdbb 100644 --- a/extensions/git/src/operation.ts +++ b/extensions/git/src/operation.ts @@ -141,7 +141,7 @@ export const Operation = { CheckoutTracking: (refLabel: string) => ({ kind: OperationKind.CheckoutTracking, blocking: true, readOnly: false, remote: false, retry: false, showProgress: true, refLabel } as CheckoutTrackingOperation), Clean: (showProgress: boolean) => ({ kind: OperationKind.Clean, blocking: false, readOnly: false, remote: false, retry: false, showProgress } as CleanOperation), Commit: { kind: OperationKind.Commit, blocking: true, readOnly: false, remote: false, retry: false, showProgress: true } as CommitOperation, - Config: (readOnly: boolean) => ({ kind: OperationKind.Config, blocking: false, readOnly, remote: false, retry: false, showProgress: true } as ConfigOperation), + Config: (readOnly: boolean) => ({ kind: OperationKind.Config, blocking: false, readOnly, remote: false, retry: false, showProgress: false } as ConfigOperation), DeleteBranch: { kind: OperationKind.DeleteBranch, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as DeleteBranchOperation, DeleteRef: { kind: OperationKind.DeleteRef, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as DeleteRefOperation, DeleteRemoteTag: { kind: OperationKind.DeleteRemoteTag, blocking: false, readOnly: false, remote: true, retry: false, showProgress: true } as DeleteRemoteTagOperation, @@ -149,7 +149,7 @@ export const Operation = { Diff: { kind: OperationKind.Diff, blocking: false, readOnly: true, remote: false, retry: false, showProgress: false } as DiffOperation, Fetch: (showProgress: boolean) => ({ kind: OperationKind.Fetch, blocking: false, readOnly: false, remote: true, retry: true, showProgress } as FetchOperation), FindTrackingBranches: { kind: OperationKind.FindTrackingBranches, blocking: false, readOnly: true, remote: false, retry: false, showProgress: true } as FindTrackingBranchesOperation, - GetBranch: { kind: OperationKind.GetBranch, blocking: false, readOnly: true, remote: false, retry: false, showProgress: true } as GetBranchOperation, + GetBranch: { kind: OperationKind.GetBranch, blocking: false, readOnly: true, remote: false, retry: false, showProgress: false } as GetBranchOperation, GetBranches: { kind: OperationKind.GetBranches, blocking: false, readOnly: true, remote: false, retry: false, showProgress: true } as GetBranchesOperation, GetCommitTemplate: { kind: OperationKind.GetCommitTemplate, blocking: false, readOnly: true, remote: false, retry: false, showProgress: true } as GetCommitTemplateOperation, GetObjectDetails: { kind: OperationKind.GetObjectDetails, blocking: false, readOnly: true, remote: false, retry: false, showProgress: false } as GetObjectDetailsOperation, @@ -158,7 +158,7 @@ export const Operation = { GetRemoteRefs: { kind: OperationKind.GetRemoteRefs, blocking: false, readOnly: true, remote: true, retry: false, showProgress: false } as GetRemoteRefsOperation, HashObject: { kind: OperationKind.HashObject, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as HashObjectOperation, Ignore: { kind: OperationKind.Ignore, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as IgnoreOperation, - Log: { kind: OperationKind.Log, blocking: false, readOnly: true, remote: false, retry: false, showProgress: true } as LogOperation, + Log: (showProgress: boolean) => ({ kind: OperationKind.Log, blocking: false, readOnly: true, remote: false, retry: false, showProgress }) as LogOperation, LogFile: { kind: OperationKind.LogFile, blocking: false, readOnly: true, remote: false, retry: false, showProgress: false } as LogFileOperation, Merge: { kind: OperationKind.Merge, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as MergeOperation, MergeAbort: { kind: OperationKind.MergeAbort, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as MergeAbortOperation, @@ -214,7 +214,7 @@ export class OperationManager implements IOperationManager { this.operations.set(operation.kind, new Set([operation])); } - this.logger.trace(`Operation start: ${operation.kind} (blocking: ${operation.blocking}, readOnly: ${operation.readOnly}; retry: ${operation.retry}; showProgress: ${operation.showProgress})`); + this.logger.trace(`[OperationManager][start] ${operation.kind} (blocking: ${operation.blocking}, readOnly: ${operation.readOnly}; retry: ${operation.retry}; showProgress: ${operation.showProgress})`); } end(operation: Operation): void { @@ -226,7 +226,7 @@ export class OperationManager implements IOperationManager { } } - this.logger.trace(`Operation end: ${operation.kind} (blocking: ${operation.blocking}, readOnly: ${operation.readOnly}; retry: ${operation.retry}; showProgress: ${operation.showProgress})`); + this.logger.trace(`[OperationManager][end] ${operation.kind} (blocking: ${operation.blocking}, readOnly: ${operation.readOnly}; retry: ${operation.retry}; showProgress: ${operation.showProgress})`); } getOperations(operationKind: OperationKind): Operation[] { diff --git a/extensions/git/src/protocolHandler.ts b/extensions/git/src/protocolHandler.ts index dc73fe39965..90491fecd50 100644 --- a/extensions/git/src/protocolHandler.ts +++ b/extensions/git/src/protocolHandler.ts @@ -22,7 +22,7 @@ export class GitProtocolHandler implements UriHandler { } handleUri(uri: Uri): void { - this.logger.info(`GitProtocolHandler.handleUri(${uri.toString()})`); + this.logger.info(`[GitProtocolHandler][handleUri] URI:(${uri.toString()})`); switch (uri.path) { case '/clone': this.clone(uri); @@ -34,17 +34,17 @@ export class GitProtocolHandler implements UriHandler { const ref = data.ref; if (!data.url) { - this.logger.warn('Failed to open URI:' + uri.toString()); + this.logger.warn('[GitProtocolHandler][clone] Failed to open URI:' + uri.toString()); return; } if (Array.isArray(data.url) && data.url.length === 0) { - this.logger.warn('Failed to open URI:' + uri.toString()); + this.logger.warn('[GitProtocolHandler][clone] Failed to open URI:' + uri.toString()); return; } if (ref !== undefined && typeof ref !== 'string') { - this.logger.warn('Failed to open URI due to multiple references:' + uri.toString()); + this.logger.warn('[GitProtocolHandler][clone] Failed to open URI due to multiple references:' + uri.toString()); return; } @@ -69,12 +69,12 @@ export class GitProtocolHandler implements UriHandler { } } catch (ex) { - this.logger.warn('Invalid URI:' + uri.toString()); + this.logger.warn('[GitProtocolHandler][clone] Invalid URI:' + uri.toString()); return; } if (!(await commands.getCommands(true)).includes('git.clone')) { - this.logger.error('Could not complete git clone operation as git installation was not found.'); + this.logger.error('[GitProtocolHandler][clone] Could not complete git clone operation as git installation was not found.'); const errorMessage = l10n.t('Could not clone your repository as Git is not installed.'); const downloadGit = l10n.t('Download Git'); @@ -86,7 +86,7 @@ export class GitProtocolHandler implements UriHandler { return; } else { const cloneTarget = cloneUri.toString(true); - this.logger.info(`Executing git.clone for ${cloneTarget}`); + this.logger.info(`[GitProtocolHandler][clone] Executing git.clone for ${cloneTarget}`); commands.executeCommand('git.clone', cloneTarget, undefined, { ref: ref }); } } diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index deec56f9eaa..cad93f799fb 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -426,8 +426,8 @@ class FileEventLogger { } this.eventDisposable = combinedDisposable([ - this.onWorkspaceWorkingTreeFileChange(uri => this.logger.debug(`[wt] Change: ${uri.fsPath}`)), - this.onDotGitFileChange(uri => this.logger.debug(`[.git] Change: ${uri.fsPath}`)) + this.onWorkspaceWorkingTreeFileChange(uri => this.logger.debug(`[FileEventLogger][onWorkspaceWorkingTreeFileChange] ${uri.fsPath}`)), + this.onDotGitFileChange(uri => this.logger.debug(`[FileEventLogger][onDotGitFileChange] ${uri.fsPath}`)) ]); } @@ -478,7 +478,7 @@ class DotGitWatcher implements IFileWatcher { this.transientDisposables.push(upstreamWatcher); upstreamWatcher.event(this.emitter.fire, this.emitter, this.transientDisposables); } catch (err) { - this.logger.warn(`Failed to watch ref '${upstreamPath}', is most likely packed.`); + this.logger.warn(`[DotGitWatcher][updateTransientWatchers] Failed to watch ref '${upstreamPath}', is most likely packed.`); } } @@ -718,11 +718,18 @@ export class Repository implements Disposable { private _untrackedGroup: SourceControlResourceGroup; get untrackedGroup(): GitResourceGroup { return this._untrackedGroup as GitResourceGroup; } + private _EMPTY_TREE: string | undefined; + private _HEAD: Branch | undefined; get HEAD(): Branch | undefined { return this._HEAD; } + private _refs: Ref[] = []; + get refs(): Ref[] { + return this._refs; + } + get headShortName(): string | undefined { if (!this.HEAD) { return; @@ -1046,8 +1053,9 @@ export class Repository implements Disposable { return this.run(Operation.Config(false), () => this.repository.config('local', key, value)); } - log(options?: LogOptions): Promise { - return this.run(Operation.Log, () => this.repository.log(options)); + log(options?: LogOptions & { silent?: boolean }): Promise { + const showProgress = !options || options.silent !== true; + return this.run(Operation.Log(showProgress), () => this.repository.log(options)); } logFile(uri: Uri, options?: LogFileOptions): Promise { @@ -1112,6 +1120,10 @@ export class Repository implements Disposable { return this.run(Operation.Diff, () => this.repository.diffBetweenShortStat(ref1, ref2)); } + diffTrees(treeish1: string, treeish2?: string): Promise { + return this.run(Operation.Diff, () => this.repository.diffTrees(treeish1, treeish2)); + } + getMergeBase(ref1: string, ref2: string, ...refs: string[]): Promise { return this.run(Operation.MergeBase, () => this.repository.getMergeBase(ref1, ref2, ...refs)); } @@ -1501,16 +1513,13 @@ export class Repository implements Disposable { private async getDefaultBranch(): Promise { try { - const defaultBranchResult = await this.repository.exec(['symbolic-ref', '--short', 'refs/remotes/origin/HEAD']); - if (defaultBranchResult.stdout.trim() === '' || defaultBranchResult.stderr) { - return undefined; - } - - return this.getBranch(defaultBranchResult.stdout.trim()); + const defaultBranch = await this.repository.getDefaultBranch(); + return defaultBranch; + } + catch (err) { + this.logger.warn(`[Repository][getDefaultBranch] Failed to get default branch details: ${err.message}.`); + return undefined; } - catch (err) { } - - return undefined; } private async getUpstreamBranch(branch: Branch): Promise { @@ -1523,7 +1532,7 @@ export class Repository implements Disposable { return upstreamBranch; } catch (err) { - this.logger.warn(`Failed to get branch details for 'refs/remotes/${branch.upstream.remote}/${branch.upstream.name}': ${err.message}.`); + this.logger.warn(`[Repository][getUpstreamBranch] Failed to get branch details for 'refs/remotes/${branch.upstream.remote}/${branch.upstream.name}': ${err.message}.`); return undefined; } } @@ -1559,8 +1568,8 @@ export class Repository implements Disposable { await this.run(Operation.Rebase, () => this.repository.rebase(branch)); } - async tag(name: string, message?: string): Promise { - await this.run(Operation.Tag, () => this.repository.tag(name, message)); + async tag(options: { name: string; message?: string; ref?: string }): Promise { + await this.run(Operation.Tag, () => this.repository.tag(options)); } async deleteTag(name: string): Promise { @@ -1602,12 +1611,13 @@ export class Repository implements Disposable { return await this.repository.getCommit(ref); } - async getCommitCount(range: string): Promise<{ ahead: number; behind: number }> { - return await this.run(Operation.RevList, () => this.repository.getCommitCount(range)); - } + async getEmptyTree(): Promise { + if (!this._EMPTY_TREE) { + const result = await this.repository.exec(['hash-object', '-t', 'tree', '/dev/null']); + this._EMPTY_TREE = result.stdout.trim(); + } - async revParse(ref: string): Promise { - return await this.run(Operation.RevParse, () => this.repository.revParse(ref)); + return this._EMPTY_TREE; } async reset(treeish: string, hard?: boolean): Promise { @@ -1819,7 +1829,7 @@ export class Repository implements Disposable { return true; } - const maybeRebased = await this.run(Operation.Log, async () => { + const maybeRebased = await this.run(Operation.Log(true), async () => { try { const result = await this.repository.exec(['log', '--oneline', '--cherry', `${currentBranch ?? ''}...${currentBranch ?? ''}@{upstream}`, '--']); if (result.exitCode) { @@ -1943,7 +1953,8 @@ export class Repository implements Disposable { return await this.run(Operation.Ignore, async () => { const ignoreFile = `${this.repository.root}${path.sep}.gitignore`; const textToAppend = files - .map(uri => relativePath(this.repository.root, uri.fsPath).replace(/\\/g, '/')) + .map(uri => relativePath(this.repository.root, uri.fsPath) + .replace(/\\|\[/g, match => match === '\\' ? '/' : `\\${match}`)) .join('\n'); const document = await new Promise(c => fs.exists(ignoreFile, c)) @@ -2170,7 +2181,12 @@ export class Repository implements Disposable { this._sourceControl.commitTemplate = commitTemplate; // Execute cancellable long-running operation - const resourceGroups = await this.getStatus(cancellationToken); + const [resourceGroups, refs] = + await Promise.all([ + this.getStatus(cancellationToken), + this.getRefs({}, cancellationToken)]); + + this._refs = refs; this._updateResourceGroupsState(resourceGroups); this._onDidChangeStatus.fire(); @@ -2409,17 +2425,17 @@ export class Repository implements Disposable { const autorefresh = config.get('autorefresh'); if (!autorefresh) { - this.logger.trace('Skip running git status because autorefresh setting is disabled.'); + this.logger.trace('[Repository][onFileChange] Skip running git status because autorefresh setting is disabled.'); return; } if (this.isRepositoryHuge) { - this.logger.trace('Skip running git status because repository is huge.'); + this.logger.trace('[Repository][onFileChange] Skip running git status because repository is huge.'); return; } if (!this.operations.isIdle()) { - this.logger.trace('Skip running git status because an operation is running.'); + this.logger.trace('[Repository][onFileChange] Skip running git status because an operation is running.'); return; } diff --git a/extensions/git/src/terminal.ts b/extensions/git/src/terminal.ts index 4f6d95488bb..edf02693ccd 100644 --- a/extensions/git/src/terminal.ts +++ b/extensions/git/src/terminal.ts @@ -3,8 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ExtensionContext, l10n, workspace } from 'vscode'; -import { filterEvent, IDisposable } from './util'; +import { ExtensionContext, l10n, LogOutputChannel, TerminalShellExecutionEndEvent, window, workspace } from 'vscode'; +import { dispose, filterEvent, IDisposable } from './util'; +import { Model } from './model'; export interface ITerminalEnvironmentProvider { featureDescription?: string; @@ -50,3 +51,42 @@ export class TerminalEnvironmentManager { this.disposable.dispose(); } } + +export class TerminalShellExecutionManager { + private readonly subcommands = new Set([ + 'add', 'branch', 'checkout', 'cherry-pick', 'clean', 'commit', 'fetch', 'merge', + 'mv', 'rebase', 'reset', 'restore', 'revert', 'rm', 'pull', 'push', 'stash', 'switch']); + + private readonly disposables: IDisposable[] = []; + + constructor( + private readonly model: Model, + private readonly logger: LogOutputChannel + ) { + window.onDidEndTerminalShellExecution(this.onDidEndTerminalShellExecution, this, this.disposables); + } + + private onDidEndTerminalShellExecution(e: TerminalShellExecutionEndEvent): void { + const { execution, exitCode, shellIntegration } = e; + const [executable, subcommand] = execution.commandLine.value.split(/\s+/); + const cwd = execution.cwd ?? shellIntegration.cwd; + + if (executable.toLowerCase() !== 'git' || !this.subcommands.has(subcommand?.toLowerCase()) || !cwd || exitCode !== 0) { + return; + } + + this.logger.trace(`[TerminalShellExecutionManager][onDidEndTerminalShellExecution] Matched git subcommand: ${subcommand}`); + + const repository = this.model.getRepository(cwd); + if (!repository) { + this.logger.trace(`[TerminalShellExecutionManager][onDidEndTerminalShellExecution] Unable to find repository for current working directory: ${cwd.toString()}`); + return; + } + + repository.status(); + } + + dispose(): void { + dispose(this.disposables); + } +} diff --git a/extensions/git/src/util.ts b/extensions/git/src/util.ts index eac6f0384b9..bf33411c3b3 100644 --- a/extensions/git/src/util.ts +++ b/extensions/git/src/util.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event, Disposable, EventEmitter } from 'vscode'; +import { Event, Disposable, EventEmitter, SourceControlHistoryItemRef } from 'vscode'; import { dirname, sep, relative } from 'path'; import { Readable } from 'stream'; import { promises as fs, createReadStream } from 'fs'; @@ -513,3 +513,58 @@ export namespace Versions { return from(major, minor, patch, pre); } } + +export function deltaHistoryItemRefs(before: SourceControlHistoryItemRef[], after: SourceControlHistoryItemRef[]): { + added: SourceControlHistoryItemRef[]; + modified: SourceControlHistoryItemRef[]; + removed: SourceControlHistoryItemRef[]; +} { + if (before.length === 0) { + return { added: after, modified: [], removed: [] }; + } + + const added: SourceControlHistoryItemRef[] = []; + const modified: SourceControlHistoryItemRef[] = []; + const removed: SourceControlHistoryItemRef[] = []; + + let beforeIdx = 0; + let afterIdx = 0; + + while (true) { + if (beforeIdx === before.length) { + added.push(...after.slice(afterIdx)); + break; + } + if (afterIdx === after.length) { + removed.push(...before.slice(beforeIdx)); + break; + } + + const beforeElement = before[beforeIdx]; + const afterElement = after[afterIdx]; + + const result = beforeElement.id.localeCompare(afterElement.id); + + if (result === 0) { + if (beforeElement.revision !== afterElement.revision) { + // modified + modified.push(afterElement); + } + + beforeIdx += 1; + afterIdx += 1; + } else if (result < 0) { + // beforeElement is smaller -> before element removed + removed.push(beforeElement); + + beforeIdx += 1; + } else if (result > 0) { + // beforeElement is greater -> after element added + added.push(afterElement); + + afterIdx += 1; + } + } + + return { added, modified, removed }; +} diff --git a/extensions/git/tsconfig.json b/extensions/git/tsconfig.json index 6ca99fecf1b..75fb8217df7 100644 --- a/extensions/git/tsconfig.json +++ b/extensions/git/tsconfig.json @@ -21,6 +21,7 @@ "../../src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts", "../../src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts", "../../src/vscode-dts/vscode.proposed.timeline.d.ts", + "../../src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts", "../types/lib.textEncoder.d.ts" ] } diff --git a/extensions/git/yarn.lock b/extensions/git/yarn.lock deleted file mode 100644 index 06023a61227..00000000000 --- a/extensions/git/yarn.lock +++ /dev/null @@ -1,264 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@joaomoreno/unique-names-generator@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@joaomoreno/unique-names-generator/-/unique-names-generator-5.1.0.tgz#d577d425aed794c44c0e8863cddd5dea349f74f3" - integrity sha512-KEVThTpUIKPb7dBKJ9mJ3WYnD1mJZZsEinCSp9CVEPlWbDagurFv1RKRjvvujrLfJzsGc0HkBHS9W8Bughao4A== - -"@microsoft/1ds-core-js@4.0.3", "@microsoft/1ds-core-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz#c8a92c623745a9595e06558a866658480c33bdf9" - integrity sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/1ds-post-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz#cfcb20bb23fb6215d3f0732f60f5b7df3e624f86" - integrity sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ== - dependencies: - "@microsoft/1ds-core-js" "4.0.3" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-channel-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz#247b6fe2158fad9826cbcdf7304f885766b36624" - integrity sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A== - dependencies: - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-common@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz#c4aa53ba343f5b3c7fbf54cddd3c86a5bdcd95dc" - integrity sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-core-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz#008308b786930d94a1de8a1fbb4af0351b74653e" - integrity sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g== - dependencies: - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-shims@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f" - integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@microsoft/applicationinsights-web-basic@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz#9a23323276b4a5a0dc6a352e2de5d75e3c16b534" - integrity sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ== - dependencies: - "@microsoft/applicationinsights-channel-js" "3.0.4" - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/dynamicproto-js@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6" - integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@nevware21/ts-async@>= 0.3.0 < 2.x": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c" - integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA== - dependencies: - "@nevware21/ts-utils" ">= 0.10.0 < 2.x" - -"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.10.1 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7" - integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg== - -"@tokenizer/token@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@tokenizer/token/-/token-0.3.0.tgz#fe98a93fe789247e998c75e74e9c7c63217aa276" - integrity sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A== - -"@types/byline@4.2.31": - version "4.2.31" - resolved "https://registry.yarnpkg.com/@types/byline/-/byline-4.2.31.tgz#0e61fcb9c03e047d21c4496554c7116297ab60cd" - integrity sha1-DmH8ucA+BH0hxEllVMcRYperYM0= - dependencies: - "@types/node" "*" - -"@types/mocha@^9.1.1": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" - integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== - -"@types/node@*": - version "8.0.51" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb" - integrity sha512-El3+WJk2D/ppWNd2X05aiP5l2k4EwF7KwheknQZls+I26eSICoWRhRIJ56jGgw2dqNGQ5LtNajmBU2ajS28EvQ== - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@types/picomatch@2.3.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@types/picomatch/-/picomatch-2.3.0.tgz#75db5e75a713c5a83d5b76780c3da84a82806003" - integrity sha512-O397rnSS9iQI4OirieAtsDqvCj4+3eY1J+EPdNTKuHuRWIfUoGyzX294o8C4KJYaLqgSrd2o60c5EqCU8Zv02g== - -"@types/which@3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/which/-/which-3.0.0.tgz#849afdd9fdcb0b67339b9cfc80fa6ea4e0253fc5" - integrity sha512-ASCxdbsrwNfSMXALlC3Decif9rwDMu+80KGp5zI2RLRotfMsTv7fHL8W8VDp24wymzDyIFudhUeSCugrgRFfHQ== - -"@vscode/extension-telemetry@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz#8c6c61e253ff304f46045f04edd60059b144417a" - integrity sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ== - dependencies: - "@microsoft/1ds-core-js" "^4.0.3" - "@microsoft/1ds-post-js" "^4.0.3" - "@microsoft/applicationinsights-web-basic" "^3.0.4" - -"@vscode/iconv-lite-umd@0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz#d2f1e0664ee6036408f9743fee264ea0699b0e48" - integrity sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg== - -byline@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" - integrity sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= - -file-type@16.5.4: - version "16.5.4" - resolved "https://registry.yarnpkg.com/file-type/-/file-type-16.5.4.tgz#474fb4f704bee427681f98dd390058a172a6c2fd" - integrity sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw== - dependencies: - readable-web-to-node-stream "^3.0.0" - strtok3 "^6.2.4" - token-types "^4.1.1" - -ieee754@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -inherits@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -isexe@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-3.1.1.tgz#4a407e2bd78ddfb14bea0c27c6f7072dde775f0d" - integrity sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ== - -jschardet@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-3.1.2.tgz#9bf4364deba0677fe9e3bd9e29eda57febf2e9db" - integrity sha512-mw3CBZGzW8nUBPYhFU2ztZ/kJ6NClQUQVpyzvFMfznZsoC///ZQ30J2RCUanNsr5yF22LqhgYr/lj807/ZleWA== - -peek-readable@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/peek-readable/-/peek-readable-4.1.0.tgz#4ece1111bf5c2ad8867c314c81356847e8a62e72" - integrity sha512-ZI3LnwUv5nOGbQzD9c2iDG6toheuXSZP5esSHBjopsXH4dg19soufvpUGA3uohi5anFtGb2lhAVdHzH6R/Evvg== - -picomatch@2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-web-to-node-stream@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz#5d52bb5df7b54861fd48d015e93a2cb87b3ee0bb" - integrity sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw== - dependencies: - readable-stream "^3.6.0" - -safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -strtok3@^6.2.4: - version "6.3.0" - resolved "https://registry.yarnpkg.com/strtok3/-/strtok3-6.3.0.tgz#358b80ffe6d5d5620e19a073aa78ce947a90f9a0" - integrity sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw== - dependencies: - "@tokenizer/token" "^0.3.0" - peek-readable "^4.1.0" - -token-types@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/token-types/-/token-types-4.2.0.tgz#b66bc3d67420c6873222a424eee64a744f4c2f13" - integrity sha512-P0rrp4wUpefLncNamWIef62J0v0kQR/GfDVji9WKY7GDCWy5YbVSrKUTam07iWPZQGy0zWNOfstYTykMmPNR7w== - dependencies: - "@tokenizer/token" "^0.3.0" - ieee754 "^1.2.1" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -vscode-uri@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.0.0.tgz#2df704222f72b8a71ff266ba0830ed6c51ac1542" - integrity sha512-lWXWofDSYD8r/TIyu64MdwB4FaSirQ608PP/TzUyslyOeHGwQ0eTHUZeJrK1ILOmwUHaJtV693m2JoUYroUDpw== - -which@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/which/-/which-4.0.0.tgz#cd60b5e74503a3fbcfbf6cd6b4138a8bae644c1a" - integrity sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg== - dependencies: - isexe "^3.1.1" diff --git a/extensions/github-authentication/.vscodeignore b/extensions/github-authentication/.vscodeignore index f65bc15d839..0d0ea746e79 100644 --- a/extensions/github-authentication/.vscodeignore +++ b/extensions/github-authentication/.vscodeignore @@ -6,4 +6,4 @@ build/** extension.webpack.config.js extension-browser.webpack.config.js tsconfig.json -yarn.lock +package-lock.json diff --git a/extensions/github-authentication/package-lock.json b/extensions/github-authentication/package-lock.json new file mode 100644 index 00000000000..c150fa7acc3 --- /dev/null +++ b/extensions/github-authentication/package-lock.json @@ -0,0 +1,300 @@ +{ + "name": "github-authentication", + "version": "0.0.2", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "github-authentication", + "version": "0.0.2", + "license": "MIT", + "dependencies": { + "@vscode/extension-telemetry": "^0.9.0", + "node-fetch": "2.6.7", + "vscode-tas-client": "^0.1.84" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "20.x", + "@types/node-fetch": "^2.5.7" + }, + "engines": { + "vscode": "^1.41.0" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz", + "integrity": "sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz", + "integrity": "sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.0.3", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz", + "integrity": "sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz", + "integrity": "sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz", + "integrity": "sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz", + "integrity": "sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.0.4", + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", + "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.3.0.tgz", + "integrity": "sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz", + "integrity": "sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==" + }, + "node_modules/@types/mocha": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.7.tgz", + "integrity": "sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "form-data": "^3.0.0" + } + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz", + "integrity": "sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.0.3", + "@microsoft/1ds-post-js": "^4.0.3", + "@microsoft/applicationinsights-web-basic": "^3.0.4" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k= sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk= sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "dependencies": { + "mime-db": "1.44.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/tas-client": { + "version": "0.2.33", + "resolved": "https://registry.npmjs.org/tas-client/-/tas-client-0.2.33.tgz", + "integrity": "sha512-V+uqV66BOQnWxvI6HjDnE4VkInmYZUQ4dgB7gzaDyFyFSK1i1nF/j7DpS9UbQAgV9NaF1XpcyuavnM1qOeiEIg==" + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/vscode-tas-client": { + "version": "0.1.84", + "resolved": "https://registry.npmjs.org/vscode-tas-client/-/vscode-tas-client-0.1.84.tgz", + "integrity": "sha512-rUTrUopV+70hvx1hW5ebdw1nd6djxubkLvVxjGdyD/r5v/wcVF41LIfiAtbm5qLZDtQdsMH1IaCuDoluoIa88w==", + "dependencies": { + "tas-client": "0.2.33" + }, + "engines": { + "vscode": "^1.85.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0= sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + } +} diff --git a/extensions/github-authentication/package.json b/extensions/github-authentication/package.json index 2d2bea56277..7fcbc7f151c 100644 --- a/extensions/github-authentication/package.json +++ b/extensions/github-authentication/package.json @@ -38,7 +38,7 @@ "id": "github-enterprise" } ], - "configuration": { + "configuration": [{ "title": "GitHub Enterprise Server Authentication Provider", "properties": { "github-enterprise.uri": { @@ -46,7 +46,17 @@ "description": "GitHub Enterprise Server URI" } } + }, + { + "title": "GitHub Authentication", + "properties": { + "github.experimental.multipleAccounts": { + "type": "boolean", + "description": "Experimental support for multiple GitHub accounts" + } + } } + ] }, "aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255", "main": "./out/extension.js", diff --git a/extensions/github-authentication/src/flows.ts b/extensions/github-authentication/src/flows.ts index 7498a2b2202..a2497b2b0b2 100644 --- a/extensions/github-authentication/src/flows.ts +++ b/extensions/github-authentication/src/flows.ts @@ -173,6 +173,8 @@ const allFlows: IFlow[] = [ ]); if (existingLogin) { searchParams.append('login', existingLogin); + } else { + searchParams.append('prompt', 'select_account'); } // The extra toString, parse is apparently needed for env.openExternal @@ -240,6 +242,8 @@ const allFlows: IFlow[] = [ ]); if (existingLogin) { searchParams.append('login', existingLogin); + } else { + searchParams.append('prompt', 'select_account'); } const loginUrl = baseUri.with({ diff --git a/extensions/github-authentication/src/github.ts b/extensions/github-authentication/src/github.ts index 15fe2ef04f8..231c793e6a4 100644 --- a/extensions/github-authentication/src/github.ts +++ b/extensions/github-authentication/src/github.ts @@ -18,7 +18,9 @@ interface SessionData { account?: { label?: string; displayName?: string; - id: string; + // Unfortunately, for some time the id was a number, so we need to support both. + // This can be removed once we are confident that all users have migrated to the new id. + id: string | number; }; scopes: string[]; accessToken: string; @@ -97,6 +99,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid private readonly _keychain: Keychain; private readonly _accountsSeen = new Set(); private readonly _disposable: vscode.Disposable | undefined; + private _supportsMultipleAccounts = false; private _sessionsPromise: Promise; @@ -133,10 +136,24 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid return sessions; }); + this._supportsMultipleAccounts = vscode.workspace.getConfiguration('github.experimental').get('multipleAccounts', false); + this._disposable = vscode.Disposable.from( this._telemetryReporter, - vscode.authentication.registerAuthenticationProvider(type, this._githubServer.friendlyName, this, { supportsMultipleAccounts: false }), - this.context.secrets.onDidChange(() => this.checkForUpdates()) + vscode.authentication.registerAuthenticationProvider(type, this._githubServer.friendlyName, this, { supportsMultipleAccounts: this._supportsMultipleAccounts }), + this.context.secrets.onDidChange(() => this.checkForUpdates()), + vscode.workspace.onDidChangeConfiguration(async e => { + if (e.affectsConfiguration('github.experimental.multipleAccounts')) { + const newValue = vscode.workspace.getConfiguration('github.experimental').get('multipleAccounts', false); + if (newValue === this._supportsMultipleAccounts) { + return; + } + const result = await vscode.window.showInformationMessage(vscode.l10n.t('Please reload the window to apply the new setting.'), { modal: true }, vscode.l10n.t('Reload Window')); + if (result) { + vscode.commands.executeCommand('workbench.action.reloadWindow'); + } + } + }) ); } @@ -148,14 +165,17 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid return this._sessionChangeEmitter.event; } - async getSessions(scopes?: string[]): Promise { + async getSessions(scopes: string[] | undefined, options?: vscode.AuthenticationProviderSessionOptions): Promise { // For GitHub scope list, order doesn't matter so we immediately sort the scopes const sortedScopes = scopes?.sort() || []; this._logger.info(`Getting sessions for ${sortedScopes.length ? sortedScopes.join(',') : 'all scopes'}...`); const sessions = await this._sessionsPromise; - const finalSessions = sortedScopes.length - ? sessions.filter(session => arrayEquals([...session.scopes].sort(), sortedScopes)) + const accountFilteredSessions = options?.account + ? sessions.filter(session => session.account.label === options.account?.label) : sessions; + const finalSessions = sortedScopes.length + ? accountFilteredSessions.filter(session => arrayEquals([...session.scopes].sort(), sortedScopes)) + : accountFilteredSessions; this._logger.info(`Got ${finalSessions.length} sessions for ${sortedScopes?.join(',') ?? 'all scopes'}...`); return finalSessions; @@ -221,12 +241,17 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid return []; } + // Unfortunately, we were using a number secretly for the account id for some time... this is due to a bad `any`. + // AuthenticationSession's account id is a string, so we need to detect when there is a number accountId and re-store + // the sessions to migrate away from the bad number usage. + // TODO@TylerLeonhardt: Remove this after we are confident that all users have migrated to the new id. + let seenNumberAccountId: boolean = false; // TODO: eventually remove this Set because we should only have one session per set of scopes. const scopesSeen = new Set(); - const sessionPromises = sessionData.map(async (session: SessionData) => { + const sessionPromises = sessionData.map(async (session: SessionData): Promise => { // For GitHub scope list, order doesn't matter so we immediately sort the scopes const scopesStr = [...session.scopes].sort().join(' '); - if (scopesSeen.has(scopesStr)) { + if (!this._supportsMultipleAccounts && scopesSeen.has(scopesStr)) { return undefined; } let userInfo: { id: string; accountName: string } | undefined; @@ -244,13 +269,23 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid this._logger.trace(`Read the following session from the keychain with the following scopes: ${scopesStr}`); scopesSeen.add(scopesStr); + + let accountId: string; + if (session.account?.id) { + if (typeof session.account.id === 'number') { + seenNumberAccountId = true; + } + accountId = `${session.account.id}`; + } else { + accountId = userInfo?.id ?? ''; + } return { id: session.id, account: { label: session.account ? session.account.label ?? session.account.displayName ?? '' : userInfo?.accountName ?? '', - id: session.account?.id ?? userInfo?.id ?? '' + id: accountId }, // we set this to session.scopes to maintain the original order of the scopes requested // by the extension that called getSession() @@ -265,7 +300,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid .filter((p?: T): p is T => Boolean(p)); this._logger.info(`Got ${verifiedSessions.length} verified sessions.`); - if (verifiedSessions.length !== sessionData.length) { + if (seenNumberAccountId || verifiedSessions.length !== sessionData.length) { await this.storeSessions(verifiedSessions); } @@ -279,7 +314,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid this._logger.info(`Stored ${sessions.length} sessions!`); } - public async createSession(scopes: string[]): Promise { + public async createSession(scopes: string[], options?: vscode.AuthenticationProviderSessionOptions): Promise { try { // For GitHub scope list, order doesn't matter so we use a sorted scope to determine // if we've got a session already. @@ -298,14 +333,20 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid const sessions = await this._sessionsPromise; - const accounts = new Set(sessions.map(session => session.account.label)); - const existingLogin = accounts.size <= 1 ? sessions[0]?.account.label : await vscode.window.showQuickPick([...accounts], { placeHolder: 'Choose an account that you would like to log in to' }); + // First we use the account specified in the options, otherwise we use the first account we have to seed auth. + const loginWith = options?.account?.label ?? sessions[0]?.account.label; + this._logger.info(`Logging in with '${loginWith ? loginWith : 'any'}' account...`); + const scopeString = sortedScopes.join(' '); - const token = await this._githubServer.login(scopeString, existingLogin); + const token = await this._githubServer.login(scopeString, loginWith); const session = await this.tokenToSession(token, scopes); this.afterSessionLoad(session); - const sessionIndex = sessions.findIndex(s => s.id === session.id || arrayEquals([...s.scopes].sort(), sortedScopes)); + const sessionIndex = sessions.findIndex( + this._supportsMultipleAccounts + ? s => s.account.id === session.account.id && arrayEquals([...s.scopes].sort(), sortedScopes) + : s => s.id === session.id || arrayEquals([...s.scopes].sort(), sortedScopes) + ); const removed = new Array(); if (sessionIndex > -1) { removed.push(...sessions.splice(sessionIndex, 1, session)); diff --git a/extensions/github-authentication/src/githubServer.ts b/extensions/github-authentication/src/githubServer.ts index af2cf22724f..a9f94ccf65d 100644 --- a/extensions/github-authentication/src/githubServer.ts +++ b/extensions/github-authentication/src/githubServer.ts @@ -197,7 +197,7 @@ export class GitHubServer implements IGitHubServer { throw new Error(`${result.status} ${result.statusText}`); } } catch (e) { - this._logger.warn('Failed to delete token from server.' + e.message ?? e); + this._logger.warn('Failed to delete token from server.' + (e.message ?? e)); } } @@ -228,9 +228,9 @@ export class GitHubServer implements IGitHubServer { if (result.ok) { try { - const json = await result.json(); + const json = await result.json() as { id: number; login: string }; this._logger.info('Got account info!'); - return { id: json.id, accountName: json.login }; + return { id: `${json.id}`, accountName: json.login }; } catch (e) { this._logger.error(`Unexpected error parsing response from GitHub: ${e.message ?? e}`); throw e; diff --git a/extensions/github-authentication/yarn.lock b/extensions/github-authentication/yarn.lock deleted file mode 100644 index 8ef2192404a..00000000000 --- a/extensions/github-authentication/yarn.lock +++ /dev/null @@ -1,210 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@microsoft/1ds-core-js@4.0.3", "@microsoft/1ds-core-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz#c8a92c623745a9595e06558a866658480c33bdf9" - integrity sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/1ds-post-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz#cfcb20bb23fb6215d3f0732f60f5b7df3e624f86" - integrity sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ== - dependencies: - "@microsoft/1ds-core-js" "4.0.3" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-channel-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz#247b6fe2158fad9826cbcdf7304f885766b36624" - integrity sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A== - dependencies: - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-common@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz#c4aa53ba343f5b3c7fbf54cddd3c86a5bdcd95dc" - integrity sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-core-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz#008308b786930d94a1de8a1fbb4af0351b74653e" - integrity sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g== - dependencies: - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-shims@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f" - integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@microsoft/applicationinsights-web-basic@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz#9a23323276b4a5a0dc6a352e2de5d75e3c16b534" - integrity sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ== - dependencies: - "@microsoft/applicationinsights-channel-js" "3.0.4" - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/dynamicproto-js@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6" - integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@nevware21/ts-async@>= 0.3.0 < 2.x": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c" - integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA== - dependencies: - "@nevware21/ts-utils" ">= 0.10.0 < 2.x" - -"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.10.1 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7" - integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg== - -"@types/mocha@^9.1.1": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" - integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== - -"@types/node-fetch@^2.5.7": - version "2.5.7" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" - integrity sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "14.0.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.5.tgz#3d03acd3b3414cf67faf999aed11682ed121f22b" - integrity sha512-90hiq6/VqtQgX8Sp0EzeIsv3r+ellbGj4URKj5j30tLlZvRUpnAe9YbYnjl3pJM93GyXU0tghHhvXHq+5rnCKA== - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@vscode/extension-telemetry@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz#8c6c61e253ff304f46045f04edd60059b144417a" - integrity sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ== - dependencies: - "@microsoft/1ds-core-js" "^4.0.3" - "@microsoft/1ds-post-js" "^4.0.3" - "@microsoft/applicationinsights-web-basic" "^3.0.4" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -form-data@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" - integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== - -mime-types@^2.1.12: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== - dependencies: - mime-db "1.44.0" - -node-fetch@2.6.7: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - -tas-client@0.2.33: - version "0.2.33" - resolved "https://registry.yarnpkg.com/tas-client/-/tas-client-0.2.33.tgz#451bf114a8a64748030ce4068ab7d079958402e6" - integrity sha512-V+uqV66BOQnWxvI6HjDnE4VkInmYZUQ4dgB7gzaDyFyFSK1i1nF/j7DpS9UbQAgV9NaF1XpcyuavnM1qOeiEIg== - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -vscode-tas-client@^0.1.84: - version "0.1.84" - resolved "https://registry.yarnpkg.com/vscode-tas-client/-/vscode-tas-client-0.1.84.tgz#906bdcfd8c9e1dc04321d6bc0335184f9119968e" - integrity sha512-rUTrUopV+70hvx1hW5ebdw1nd6djxubkLvVxjGdyD/r5v/wcVF41LIfiAtbm5qLZDtQdsMH1IaCuDoluoIa88w== - dependencies: - tas-client "0.2.33" - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" diff --git a/extensions/github/.vscodeignore b/extensions/github/.vscodeignore index ed8fa3a7e38..24b1bd4e73a 100644 --- a/extensions/github/.vscodeignore +++ b/extensions/github/.vscodeignore @@ -4,4 +4,4 @@ out/** build/** extension.webpack.config.js tsconfig.json -yarn.lock +package-lock.json diff --git a/extensions/github/package-lock.json b/extensions/github/package-lock.json new file mode 100644 index 00000000000..41de66d1a9b --- /dev/null +++ b/extensions/github/package-lock.json @@ -0,0 +1,524 @@ +{ + "name": "github", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "github", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "@octokit/graphql": "5.0.5", + "@octokit/graphql-schema": "14.4.0", + "@octokit/rest": "19.0.4", + "@vscode/extension-telemetry": "^0.9.0", + "tunnel": "^0.0.6" + }, + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "^1.41.0" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz", + "integrity": "sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz", + "integrity": "sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.0.3", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz", + "integrity": "sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz", + "integrity": "sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz", + "integrity": "sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz", + "integrity": "sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.0.4", + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", + "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.3.0.tgz", + "integrity": "sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz", + "integrity": "sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==" + }, + "node_modules/@octokit/auth-token": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.1.tgz", + "integrity": "sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==", + "dependencies": { + "@octokit/types": "^7.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/auth-token/node_modules/@octokit/openapi-types": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.6.0.tgz", + "integrity": "sha512-bxftLwoZ2J6zsU1rzRvk0O32j7lVB0NWWn+P5CDHn9zPzytasR3hdAeXlTngRDkqv1LyEeuy5psVnDkmOSwrcQ==" + }, + "node_modules/@octokit/auth-token/node_modules/@octokit/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.2.0.tgz", + "integrity": "sha512-pYQ/a1U6mHptwhGyp6SvsiM4bWP2s3V95olUeTxas85D/2kN78yN5C8cGN+P4LwJSWUqIEyvq0Qn2WUn6NQRjw==", + "dependencies": { + "@octokit/openapi-types": "^13.6.0" + } + }, + "node_modules/@octokit/core": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.0.5.tgz", + "integrity": "sha512-4R3HeHTYVHCfzSAi0C6pbGXV8UDI5Rk+k3G7kLVNckswN9mvpOzW9oENfjfH3nEmzg8y3AmKmzs8Sg6pLCeOCA==", + "dependencies": { + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^7.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/core/node_modules/@octokit/openapi-types": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.6.0.tgz", + "integrity": "sha512-bxftLwoZ2J6zsU1rzRvk0O32j7lVB0NWWn+P5CDHn9zPzytasR3hdAeXlTngRDkqv1LyEeuy5psVnDkmOSwrcQ==" + }, + "node_modules/@octokit/core/node_modules/@octokit/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.2.0.tgz", + "integrity": "sha512-pYQ/a1U6mHptwhGyp6SvsiM4bWP2s3V95olUeTxas85D/2kN78yN5C8cGN+P4LwJSWUqIEyvq0Qn2WUn6NQRjw==", + "dependencies": { + "@octokit/openapi-types": "^13.6.0" + } + }, + "node_modules/@octokit/endpoint": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.1.tgz", + "integrity": "sha512-/wTXAJwt0HzJ2IeE4kQXO+mBScfzyCkI0hMtkIaqyXd9zg76OpOfNQfHL9FlaxAV2RsNiOXZibVWloy8EexENg==", + "dependencies": { + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.6.0.tgz", + "integrity": "sha512-bxftLwoZ2J6zsU1rzRvk0O32j7lVB0NWWn+P5CDHn9zPzytasR3hdAeXlTngRDkqv1LyEeuy5psVnDkmOSwrcQ==" + }, + "node_modules/@octokit/endpoint/node_modules/@octokit/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.2.0.tgz", + "integrity": "sha512-pYQ/a1U6mHptwhGyp6SvsiM4bWP2s3V95olUeTxas85D/2kN78yN5C8cGN+P4LwJSWUqIEyvq0Qn2WUn6NQRjw==", + "dependencies": { + "@octokit/openapi-types": "^13.6.0" + } + }, + "node_modules/@octokit/graphql": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.5.tgz", + "integrity": "sha512-Qwfvh3xdqKtIznjX9lz2D458r7dJPP8l6r4GQkIdWQouZwHQK0mVT88uwiU2bdTU2OtT1uOlKpRciUWldpG0yQ==", + "dependencies": { + "@octokit/request": "^6.0.0", + "@octokit/types": "^9.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/graphql-schema": { + "version": "14.4.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql-schema/-/graphql-schema-14.4.0.tgz", + "integrity": "sha512-+O6/dsLlR6V9gv+t1lqsN+x73TLwyQWZpd3M8/eYnuny7VaznV9TAyUxf18tX8WBBS5IqtlLDk1nG+aSTPRZzQ==", + "dependencies": { + "graphql": "^16.0.0", + "graphql-tag": "^2.10.3" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-17.1.0.tgz", + "integrity": "sha512-rnI26BAITDZTo5vqFOmA7oX4xRd18rO+gcK4MiTpJmsRMxAw0JmevNjPsjpry1bb9SVNo56P/0kbiyXXa4QluA==" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-4.2.0.tgz", + "integrity": "sha512-8otLCIK9esfmOCY14CBnG/xPqv0paf14rc+s9tHpbOpeFwrv5CnECKW1qdqMAT60ngAa9eB1bKQ+l2YCpi0HPQ==", + "dependencies": { + "@octokit/types": "^7.2.0" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=4" + } + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.6.0.tgz", + "integrity": "sha512-bxftLwoZ2J6zsU1rzRvk0O32j7lVB0NWWn+P5CDHn9zPzytasR3hdAeXlTngRDkqv1LyEeuy5psVnDkmOSwrcQ==" + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.2.0.tgz", + "integrity": "sha512-pYQ/a1U6mHptwhGyp6SvsiM4bWP2s3V95olUeTxas85D/2kN78yN5C8cGN+P4LwJSWUqIEyvq0Qn2WUn6NQRjw==", + "dependencies": { + "@octokit/openapi-types": "^13.6.0" + } + }, + "node_modules/@octokit/plugin-request-log": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.4.0.tgz", + "integrity": "sha512-YP4eUqZ6vORy/eZOTdil1ZSrMt0kv7i/CVw+HhC2C0yJN+IqTc/rot957JQ7JfyeJD6HZOjLg6Jp1o9cPhI9KA==", + "dependencies": { + "@octokit/types": "^7.2.0", + "deprecation": "^2.3.1" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.6.0.tgz", + "integrity": "sha512-bxftLwoZ2J6zsU1rzRvk0O32j7lVB0NWWn+P5CDHn9zPzytasR3hdAeXlTngRDkqv1LyEeuy5psVnDkmOSwrcQ==" + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.2.0.tgz", + "integrity": "sha512-pYQ/a1U6mHptwhGyp6SvsiM4bWP2s3V95olUeTxas85D/2kN78yN5C8cGN+P4LwJSWUqIEyvq0Qn2WUn6NQRjw==", + "dependencies": { + "@octokit/openapi-types": "^13.6.0" + } + }, + "node_modules/@octokit/request": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.1.tgz", + "integrity": "sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ==", + "dependencies": { + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/request-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.1.tgz", + "integrity": "sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ==", + "dependencies": { + "@octokit/types": "^7.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.6.0.tgz", + "integrity": "sha512-bxftLwoZ2J6zsU1rzRvk0O32j7lVB0NWWn+P5CDHn9zPzytasR3hdAeXlTngRDkqv1LyEeuy5psVnDkmOSwrcQ==" + }, + "node_modules/@octokit/request-error/node_modules/@octokit/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.2.0.tgz", + "integrity": "sha512-pYQ/a1U6mHptwhGyp6SvsiM4bWP2s3V95olUeTxas85D/2kN78yN5C8cGN+P4LwJSWUqIEyvq0Qn2WUn6NQRjw==", + "dependencies": { + "@octokit/openapi-types": "^13.6.0" + } + }, + "node_modules/@octokit/request/node_modules/@octokit/openapi-types": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.6.0.tgz", + "integrity": "sha512-bxftLwoZ2J6zsU1rzRvk0O32j7lVB0NWWn+P5CDHn9zPzytasR3hdAeXlTngRDkqv1LyEeuy5psVnDkmOSwrcQ==" + }, + "node_modules/@octokit/request/node_modules/@octokit/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.2.0.tgz", + "integrity": "sha512-pYQ/a1U6mHptwhGyp6SvsiM4bWP2s3V95olUeTxas85D/2kN78yN5C8cGN+P4LwJSWUqIEyvq0Qn2WUn6NQRjw==", + "dependencies": { + "@octokit/openapi-types": "^13.6.0" + } + }, + "node_modules/@octokit/rest": { + "version": "19.0.4", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.4.tgz", + "integrity": "sha512-LwG668+6lE8zlSYOfwPj4FxWdv/qFXYBpv79TWIQEpBLKA9D/IMcWsF/U9RGpA3YqMVDiTxpgVpEW3zTFfPFTA==", + "dependencies": { + "@octokit/core": "^4.0.0", + "@octokit/plugin-paginate-rest": "^4.0.0", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/types": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.0.tgz", + "integrity": "sha512-xySzJG4noWrIBFyMu4lg4tu9vAgNg9S0aoLRONhAEz6ueyi1evBzb40HitIosaYS4XOexphG305IVcLrIX/30g==", + "dependencies": { + "@octokit/openapi-types": "^17.1.0" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz", + "integrity": "sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.0.3", + "@microsoft/1ds-post-js": "^4.0.3", + "@microsoft/applicationinsights-web-basic": "^3.0.4" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/before-after-hook": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" + }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + }, + "node_modules/graphql": { + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", + "engines": { + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" + } + }, + "node_modules/graphql-tag": { + "version": "2.12.6", + "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz", + "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" + } + }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E= sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0= sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + } + } +} diff --git a/extensions/github/yarn.lock b/extensions/github/yarn.lock deleted file mode 100644 index 912a28439be..00000000000 --- a/extensions/github/yarn.lock +++ /dev/null @@ -1,326 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@microsoft/1ds-core-js@4.0.3", "@microsoft/1ds-core-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz#c8a92c623745a9595e06558a866658480c33bdf9" - integrity sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/1ds-post-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz#cfcb20bb23fb6215d3f0732f60f5b7df3e624f86" - integrity sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ== - dependencies: - "@microsoft/1ds-core-js" "4.0.3" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-channel-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz#247b6fe2158fad9826cbcdf7304f885766b36624" - integrity sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A== - dependencies: - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-common@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz#c4aa53ba343f5b3c7fbf54cddd3c86a5bdcd95dc" - integrity sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-core-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz#008308b786930d94a1de8a1fbb4af0351b74653e" - integrity sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g== - dependencies: - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-shims@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f" - integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@microsoft/applicationinsights-web-basic@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz#9a23323276b4a5a0dc6a352e2de5d75e3c16b534" - integrity sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ== - dependencies: - "@microsoft/applicationinsights-channel-js" "3.0.4" - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/dynamicproto-js@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6" - integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@nevware21/ts-async@>= 0.3.0 < 2.x": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c" - integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA== - dependencies: - "@nevware21/ts-utils" ">= 0.10.0 < 2.x" - -"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.10.1 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7" - integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg== - -"@octokit/auth-token@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-3.0.1.tgz#88bc2baf5d706cb258474e722a720a8365dff2ec" - integrity sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA== - dependencies: - "@octokit/types" "^7.0.0" - -"@octokit/core@^4.0.0": - version "4.0.5" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-4.0.5.tgz#589e68c0a35d2afdcd41dafceab072c2fbc6ab5f" - integrity sha512-4R3HeHTYVHCfzSAi0C6pbGXV8UDI5Rk+k3G7kLVNckswN9mvpOzW9oENfjfH3nEmzg8y3AmKmzs8Sg6pLCeOCA== - dependencies: - "@octokit/auth-token" "^3.0.0" - "@octokit/graphql" "^5.0.0" - "@octokit/request" "^6.0.0" - "@octokit/request-error" "^3.0.0" - "@octokit/types" "^7.0.0" - before-after-hook "^2.2.0" - universal-user-agent "^6.0.0" - -"@octokit/endpoint@^7.0.0": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-7.0.1.tgz#cb0d03e62e8762f3c80e52b025179de81899a823" - integrity sha512-/wTXAJwt0HzJ2IeE4kQXO+mBScfzyCkI0hMtkIaqyXd9zg76OpOfNQfHL9FlaxAV2RsNiOXZibVWloy8EexENg== - dependencies: - "@octokit/types" "^7.0.0" - is-plain-object "^5.0.0" - universal-user-agent "^6.0.0" - -"@octokit/graphql-schema@14.4.0": - version "14.4.0" - resolved "https://registry.yarnpkg.com/@octokit/graphql-schema/-/graphql-schema-14.4.0.tgz#9336f64c3103a2e82ee3ce060c3ccf99d177d7f0" - integrity sha512-+O6/dsLlR6V9gv+t1lqsN+x73TLwyQWZpd3M8/eYnuny7VaznV9TAyUxf18tX8WBBS5IqtlLDk1nG+aSTPRZzQ== - dependencies: - graphql "^16.0.0" - graphql-tag "^2.10.3" - -"@octokit/graphql@5.0.5": - version "5.0.5" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-5.0.5.tgz#a4cb3ea73f83b861893a6370ee82abb36e81afd2" - integrity sha512-Qwfvh3xdqKtIznjX9lz2D458r7dJPP8l6r4GQkIdWQouZwHQK0mVT88uwiU2bdTU2OtT1uOlKpRciUWldpG0yQ== - dependencies: - "@octokit/request" "^6.0.0" - "@octokit/types" "^9.0.0" - universal-user-agent "^6.0.0" - -"@octokit/graphql@^5.0.0": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-5.0.1.tgz#a06982514ad131fb6fbb9da968653b2233fade9b" - integrity sha512-sxmnewSwAixkP1TrLdE6yRG53eEhHhDTYUykUwdV9x8f91WcbhunIHk9x1PZLALdBZKRPUO2HRcm4kezZ79HoA== - dependencies: - "@octokit/request" "^6.0.0" - "@octokit/types" "^7.0.0" - universal-user-agent "^6.0.0" - -"@octokit/openapi-types@^13.6.0": - version "13.6.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-13.6.0.tgz#381884008e23fd82fd444553f6b4dcd24a5c4a4d" - integrity sha512-bxftLwoZ2J6zsU1rzRvk0O32j7lVB0NWWn+P5CDHn9zPzytasR3hdAeXlTngRDkqv1LyEeuy5psVnDkmOSwrcQ== - -"@octokit/openapi-types@^17.1.0": - version "17.1.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-17.1.0.tgz#9a712b5bb9d644940d8a1f24115c798c317a64a5" - integrity sha512-rnI26BAITDZTo5vqFOmA7oX4xRd18rO+gcK4MiTpJmsRMxAw0JmevNjPsjpry1bb9SVNo56P/0kbiyXXa4QluA== - -"@octokit/plugin-paginate-rest@^4.0.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-4.2.0.tgz#41fc6ca312446a85a4275aca698b4d9c4c5e06ab" - integrity sha512-8otLCIK9esfmOCY14CBnG/xPqv0paf14rc+s9tHpbOpeFwrv5CnECKW1qdqMAT60ngAa9eB1bKQ+l2YCpi0HPQ== - dependencies: - "@octokit/types" "^7.2.0" - -"@octokit/plugin-request-log@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" - integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== - -"@octokit/plugin-rest-endpoint-methods@^6.0.0": - version "6.4.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.4.0.tgz#09584dd4e85fc4fe04ade45620b105af582c20ba" - integrity sha512-YP4eUqZ6vORy/eZOTdil1ZSrMt0kv7i/CVw+HhC2C0yJN+IqTc/rot957JQ7JfyeJD6HZOjLg6Jp1o9cPhI9KA== - dependencies: - "@octokit/types" "^7.2.0" - deprecation "^2.3.1" - -"@octokit/request-error@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-3.0.1.tgz#3fd747913c06ab2195e52004a521889dadb4b295" - integrity sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ== - dependencies: - "@octokit/types" "^7.0.0" - deprecation "^2.0.0" - once "^1.4.0" - -"@octokit/request@^6.0.0": - version "6.2.1" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-6.2.1.tgz#3ceeb22dab09a29595d96594b6720fc14495cf4e" - integrity sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ== - dependencies: - "@octokit/endpoint" "^7.0.0" - "@octokit/request-error" "^3.0.0" - "@octokit/types" "^7.0.0" - is-plain-object "^5.0.0" - node-fetch "^2.6.7" - universal-user-agent "^6.0.0" - -"@octokit/rest@19.0.4": - version "19.0.4" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-19.0.4.tgz#fd8bed1cefffa486e9ae46a9dc608ce81bcfcbdd" - integrity sha512-LwG668+6lE8zlSYOfwPj4FxWdv/qFXYBpv79TWIQEpBLKA9D/IMcWsF/U9RGpA3YqMVDiTxpgVpEW3zTFfPFTA== - dependencies: - "@octokit/core" "^4.0.0" - "@octokit/plugin-paginate-rest" "^4.0.0" - "@octokit/plugin-request-log" "^1.0.4" - "@octokit/plugin-rest-endpoint-methods" "^6.0.0" - -"@octokit/types@^7.0.0", "@octokit/types@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-7.2.0.tgz#7ee0fc27f9f463d7ccf12ca5956988d498b3c6c4" - integrity sha512-pYQ/a1U6mHptwhGyp6SvsiM4bWP2s3V95olUeTxas85D/2kN78yN5C8cGN+P4LwJSWUqIEyvq0Qn2WUn6NQRjw== - dependencies: - "@octokit/openapi-types" "^13.6.0" - -"@octokit/types@^9.0.0": - version "9.2.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-9.2.0.tgz#0358e3de070b1d43c5a8af63b9951c88a09fc9ed" - integrity sha512-xySzJG4noWrIBFyMu4lg4tu9vAgNg9S0aoLRONhAEz6ueyi1evBzb40HitIosaYS4XOexphG305IVcLrIX/30g== - dependencies: - "@octokit/openapi-types" "^17.1.0" - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@vscode/extension-telemetry@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz#8c6c61e253ff304f46045f04edd60059b144417a" - integrity sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ== - dependencies: - "@microsoft/1ds-core-js" "^4.0.3" - "@microsoft/1ds-post-js" "^4.0.3" - "@microsoft/applicationinsights-web-basic" "^3.0.4" - -before-after-hook@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e" - integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ== - -deprecation@^2.0.0, deprecation@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" - integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== - -graphql-tag@^2.10.3: - version "2.12.6" - resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.6.tgz#d441a569c1d2537ef10ca3d1633b48725329b5f1" - integrity sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg== - dependencies: - tslib "^2.1.0" - -graphql@^16.0.0: - version "16.8.1" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07" - integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw== - -is-plain-object@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" - integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== - -node-fetch@^2.6.7: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - -once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - -tslib@^2.1.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" - integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== - -tunnel@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" - integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -universal-user-agent@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" - integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= diff --git a/extensions/go/cgmanifest.json b/extensions/go/cgmanifest.json index d27352e1339..39db8ac979f 100644 --- a/extensions/go/cgmanifest.json +++ b/extensions/go/cgmanifest.json @@ -6,12 +6,12 @@ "git": { "name": "go-syntax", "repositoryUrl": "https://github.com/worlpaker/go-syntax", - "commitHash": "092c45ec9a51fe40188408d1371f123eaa4796fa" + "commitHash": "b40fb01f2cf48bc24e6f4030373311b0402b158e" } }, "license": "MIT", "description": "The file syntaxes/go.tmLanguage.json is from https://github.com/worlpaker/go-syntax, which in turn was derived from https://github.com/jeff-hykin/better-go-syntax.", - "version": "0.6.8" + "version": "0.7.6" } ], "version": 1 diff --git a/extensions/go/syntaxes/go.tmLanguage.json b/extensions/go/syntaxes/go.tmLanguage.json index 21b370514d0..bc56a1b97ee 100644 --- a/extensions/go/syntaxes/go.tmLanguage.json +++ b/extensions/go/syntaxes/go.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/worlpaker/go-syntax/commit/092c45ec9a51fe40188408d1371f123eaa4796fa", + "version": "https://github.com/worlpaker/go-syntax/commit/b40fb01f2cf48bc24e6f4030373311b0402b158e", "name": "Go", "scopeName": "source.go", "patterns": [ @@ -321,7 +321,7 @@ "name": "punctuation.definition.begin.bracket.square.go" } }, - "end": "(?:(\\])((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:[\\[\\]\\*]+)?\\b(?:func|struct|map)\\b)(?:[\\*\\[\\]]+)?(?:[\\w\\.]+))?)", + "end": "(?:(\\])((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:[\\[\\]\\*]+)?\\b(?:func|struct|map)\\b)(?:[\\*\\[\\]]+)?(?:[\\w\\.]+)(?:\\[(?:(?:[\\w\\.\\*\\[\\]\\{\\}]+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]\\{\\}]+))*))?\\])?)?)", "endCaptures": { "1": { "name": "punctuation.definition.end.bracket.square.go" @@ -1845,7 +1845,7 @@ }, { "comment": "one type only", - "match": "(?:((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?\\|\\&]+))(\\.\\(\\btype\\b\\)\\s*)(\\{)", "beginCaptures": { "1": { "patterns": [ @@ -2770,7 +2773,7 @@ }, "slice_index_variables": { "comment": "slice index and capacity variables, to not scope them as property variables", - "match": "(?<=\\w\\[)((?:(?:\\b[\\w\\.\\*\\+/\\-\\*\\%\\<\\>\\|\\&]+\\:)|(?:\\:\\b[\\w\\.\\*\\+/\\-\\*\\%\\<\\>\\|\\&]+))(?:\\b[\\w\\.\\*\\+/\\-\\*\\%\\<\\>\\|\\&]+)?(?:\\:\\b[\\w\\.\\*\\+/\\-\\*\\%\\<\\>\\|\\&]+)?)(?=\\])", + "match": "(?<=\\w\\[)((?:(?:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+\\:)|(?:\\:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+))(?:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+)?(?:\\:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+)?)(?=\\])", "captures": { "1": { "patterns": [ @@ -2786,8 +2789,8 @@ } }, "property_variables": { - "comment": "Property variables in struct | parameter field in struct initialization", - "match": "(?:(?:((?:\\b[\\w\\.]+)(?:\\:(?!\\=))))(?:(?:\\s*([\\w\\.\\*\\&\\[\\]]+)(\\.\\w+)(?![\\w\\.\\*\\&\\[\\]]*(?:\\{|\\()))((?:\\s*(?:\\<|\\>|\\<\\=|\\>\\=|\\=\\=|\\!\\=|\\|\\||\\&\\&|\\+|/|\\-|\\*|\\%|\\||\\&)\\s*(?:[\\w\\.\\*\\&\\[\\]]+)(?:\\.\\w+)(?![\\w\\.\\*\\&\\[\\]]*(?:\\{|\\()))*))?)", + "comment": "Property variables in struct", + "match": "((?:\\b[\\w\\.]+)(?:\\:(?!\\=)))", "captures": { "1": { "patterns": [ @@ -2799,68 +2802,6 @@ "name": "variable.other.property.go" } ] - }, - "2": { - "patterns": [ - { - "include": "#type-declarations" - }, - { - "match": "\\w+", - "name": "variable.other.go" - }, - { - "include": "$self" - } - ] - }, - "3": { - "patterns": [ - { - "include": "#type-declarations" - }, - { - "match": "\\w+", - "name": "variable.other.property.field.go" - }, - { - "include": "$self" - } - ] - }, - "4": { - "patterns": [ - { - "match": "([\\w\\.\\*\\&\\[\\]]+)(\\.\\w+)", - "captures": { - "1": { - "patterns": [ - { - "include": "#type-declarations" - }, - { - "match": "\\w+", - "name": "variable.other.go" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#type-declarations" - }, - { - "match": "\\w+", - "name": "variable.other.property.field.go" - } - ] - } - } - }, - { - "include": "$self" - } - ] } } }, @@ -2931,13 +2872,16 @@ }, "2": { "patterns": [ - { - "include": "#type-declarations" - }, { "match": "\\binvalid\\b\\s+\\btype\\b", "name": "invalid.field.go" }, + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, { "match": "\\w+", "name": "entity.name.type.go" diff --git a/extensions/go/yarn.lock b/extensions/go/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/go/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/groovy/yarn.lock b/extensions/groovy/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/groovy/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/grunt/.vscodeignore b/extensions/grunt/.vscodeignore index 9d384dd9061..698898bf9df 100644 --- a/extensions/grunt/.vscodeignore +++ b/extensions/grunt/.vscodeignore @@ -3,4 +3,4 @@ src/** tsconfig.json out/** extension.webpack.config.js -yarn.lock \ No newline at end of file +package-lock.json diff --git a/extensions/grunt/package-lock.json b/extensions/grunt/package-lock.json new file mode 100644 index 00000000000..f0431ef8c85 --- /dev/null +++ b/extensions/grunt/package-lock.json @@ -0,0 +1,34 @@ +{ + "name": "grunt", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "grunt", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "*" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/extensions/grunt/src/main.ts b/extensions/grunt/src/main.ts index 886e7e27e71..fd99ba335c4 100644 --- a/extensions/grunt/src/main.ts +++ b/extensions/grunt/src/main.ts @@ -316,7 +316,7 @@ class TaskDetector { if (this.detectors.size === 0) { return Promise.resolve([]); } else if (this.detectors.size === 1) { - return this.detectors.values().next().value.getTasks(); + return this.detectors.values().next().value!.getTasks(); } else { const promises: Promise[] = []; for (const detector of this.detectors.values()) { @@ -338,7 +338,7 @@ class TaskDetector { if (this.detectors.size === 0) { return undefined; } else if (this.detectors.size === 1) { - return this.detectors.values().next().value.getTask(task); + return this.detectors.values().next().value!.getTask(task); } else { if ((task.scope === vscode.TaskScope.Workspace) || (task.scope === vscode.TaskScope.Global)) { return undefined; diff --git a/extensions/grunt/yarn.lock b/extensions/grunt/yarn.lock deleted file mode 100644 index 1f4b6c2e8b4..00000000000 --- a/extensions/grunt/yarn.lock +++ /dev/null @@ -1,15 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/extensions/gulp/.vscodeignore b/extensions/gulp/.vscodeignore index 36e8b0714fa..360fcfd1c99 100644 --- a/extensions/gulp/.vscodeignore +++ b/extensions/gulp/.vscodeignore @@ -2,4 +2,4 @@ src/** tsconfig.json out/** extension.webpack.config.js -yarn.lock \ No newline at end of file +package-lock.json diff --git a/extensions/gulp/package-lock.json b/extensions/gulp/package-lock.json new file mode 100644 index 00000000000..9311609f962 --- /dev/null +++ b/extensions/gulp/package-lock.json @@ -0,0 +1,34 @@ +{ + "name": "gulp", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "gulp", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "*" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/extensions/gulp/src/main.ts b/extensions/gulp/src/main.ts index 284175741a5..b0b85ca29b9 100644 --- a/extensions/gulp/src/main.ts +++ b/extensions/gulp/src/main.ts @@ -357,7 +357,7 @@ class TaskDetector { if (this.detectors.size === 0) { return Promise.resolve([]); } else if (this.detectors.size === 1) { - return this.detectors.values().next().value.getTasks(); + return this.detectors.values().next().value!.getTasks(); } else { const promises: Promise[] = []; for (const detector of this.detectors.values()) { @@ -379,7 +379,7 @@ class TaskDetector { if (this.detectors.size === 0) { return undefined; } else if (this.detectors.size === 1) { - return this.detectors.values().next().value.getTask(task); + return this.detectors.values().next().value!.getTask(task); } else { if ((task.scope === vscode.TaskScope.Workspace) || (task.scope === vscode.TaskScope.Global)) { // Not supported, we don't have enough info to create the task. diff --git a/extensions/gulp/yarn.lock b/extensions/gulp/yarn.lock deleted file mode 100644 index 1f4b6c2e8b4..00000000000 --- a/extensions/gulp/yarn.lock +++ /dev/null @@ -1,15 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/extensions/handlebars/yarn.lock b/extensions/handlebars/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/handlebars/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/hlsl/yarn.lock b/extensions/hlsl/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/hlsl/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/html-language-features/.vscode/tasks.json b/extensions/html-language-features/.vscode/tasks.json index 7abfc71df26..0e343f94d4c 100644 --- a/extensions/html-language-features/.vscode/tasks.json +++ b/extensions/html-language-features/.vscode/tasks.json @@ -2,8 +2,8 @@ "version": "2.0.0", "tasks": [ { - "label": "yarn", - "command": "yarn", + "label": "npm install", + "command": "npm i", "args": ["compile"], "type": "shell", "presentation": { diff --git a/extensions/html-language-features/.vscodeignore b/extensions/html-language-features/.vscodeignore index dda5275fdb5..b1586b6bc84 100644 --- a/extensions/html-language-features/.vscodeignore +++ b/extensions/html-language-features/.vscodeignore @@ -13,9 +13,9 @@ server/test/** server/bin/** server/build/** server/lib/cgmanifest.json -server/yarn.lock +server/package-lock.json server/.npmignore -yarn.lock +package-lock.json server/extension.webpack.config.js extension.webpack.config.js server/extension-browser.webpack.config.js diff --git a/extensions/html-language-features/CONTRIBUTING.md b/extensions/html-language-features/CONTRIBUTING.md index 441baa4d318..8f1cb271dc3 100644 --- a/extensions/html-language-features/CONTRIBUTING.md +++ b/extensions/html-language-features/CONTRIBUTING.md @@ -1,12 +1,12 @@ ## Setup - Clone [microsoft/vscode](https://github.com/microsoft/vscode) -- Run `yarn` at `/`, this will install +- Run `npm i` at `/`, this will install - Dependencies for `/extension/html-language-features/` - Dependencies for `/extension/html-language-features/server/` - devDependencies such as `gulp` - Open `/extensions/html-language-features/` as the workspace in VS Code -- In `/extensions/html-language-features/` run `yarn compile`(or `yarn watch`) to build the client and server +- In `/extensions/html-language-features/` run `npm run compile`(or `npm run watch`) to build the client and server - Run the [`Launch Extension`](https://github.com/microsoft/vscode/blob/master/extensions/html-language-features/.vscode/launch.json) debug target in the Debug View. This will: - Launch a new VS Code instance with the `html-language-features` extension loaded - Open a `.html` file to activate the extension. The extension will start the HTML language server process. @@ -28,13 +28,13 @@ However, within this extension, you can run a development version of `vscode-htm #### Linking `vscode-html-languageservice` in `html-language-features/server/` - Clone [microsoft/vscode-html-languageservice](https://github.com/microsoft/vscode-html-languageservice) -- Run `yarn` in `vscode-html-languageservice` -- Run `yarn link` in `vscode-html-languageservice`. This will compile and link `vscode-html-languageservice` -- In `html-language-features/server/`, run `yarn link vscode-html-languageservice` +- Run `npm i` in `vscode-html-languageservice` +- Run `npm link` in `vscode-html-languageservice`. This will compile and link `vscode-html-languageservice` +- In `html-language-features/server/`, run `npm link vscode-html-languageservice` #### Testing the development version of `vscode-html-languageservice` - Open both `vscode-html-languageservice` and this extension in two windows or with a single window with the[multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) feature -- Run `yarn watch` at `html-languagefeatures/server/` to recompile this extension with the linked version of `vscode-html-languageservice` +- Run `npm run watch` at `html-languagefeatures/server/` to recompile this extension with the linked version of `vscode-html-languageservice` - Make some changes in `vscode-html-languageservice` - Now when you run `Launch Extension` debug target, the launched instance will use your development version of `vscode-html-languageservice`. You can interactively test the language features. diff --git a/extensions/html-language-features/client/src/autoInsertion.ts b/extensions/html-language-features/client/src/autoInsertion.ts index e95e6a64a09..3c70839befe 100644 --- a/extensions/html-language-features/client/src/autoInsertion.ts +++ b/extensions/html-language-features/client/src/autoInsertion.ts @@ -56,14 +56,20 @@ export function activateAutoInsertion(provider: (kind: 'autoQuote' | 'autoClose' } const lastChange = contentChanges[contentChanges.length - 1]; - const lastCharacter = lastChange.text[lastChange.text.length - 1]; - if (isEnabled['autoQuote'] && lastChange.rangeLength === 0 && lastCharacter === '=') { - doAutoInsert('autoQuote', document, lastChange); - } else if (isEnabled['autoClose'] && lastChange.rangeLength === 0 && (lastCharacter === '>' || lastCharacter === '/')) { - doAutoInsert('autoClose', document, lastChange); + if (lastChange.rangeLength === 0 && isSingleLine(lastChange.text)) { + const lastCharacter = lastChange.text[lastChange.text.length - 1]; + if (isEnabled['autoQuote'] && lastCharacter === '=') { + doAutoInsert('autoQuote', document, lastChange); + } else if (isEnabled['autoClose'] && (lastCharacter === '>' || lastCharacter === '/')) { + doAutoInsert('autoClose', document, lastChange); + } } } + function isSingleLine(text: string): boolean { + return !/\n/.test(text); + } + function doAutoInsert(kind: 'autoQuote' | 'autoClose', document: TextDocument, lastChange: TextDocumentContentChangeEvent) { const rangeStart = lastChange.range.start; const version = document.version; diff --git a/extensions/html-language-features/client/src/browser/htmlClientMain.ts b/extensions/html-language-features/client/src/browser/htmlClientMain.ts index 3f10e6d131f..06997d39fb0 100644 --- a/extensions/html-language-features/client/src/browser/htmlClientMain.ts +++ b/extensions/html-language-features/client/src/browser/htmlClientMain.ts @@ -8,13 +8,6 @@ import { LanguageClientOptions } from 'vscode-languageclient'; import { startClient, LanguageClientConstructor, AsyncDisposable } from '../htmlClient'; import { LanguageClient } from 'vscode-languageclient/browser'; -declare const Worker: { - new(stringUrl: string): any; -}; -declare const TextDecoder: { - new(encoding?: string): { decode(buffer: ArrayBuffer): string }; -}; - let client: AsyncDisposable | undefined; // this method is called when vs code is activated @@ -25,7 +18,7 @@ export async function activate(context: ExtensionContext) { worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' }); const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => { - return new LanguageClient(id, name, clientOptions, worker); + return new LanguageClient(id, name, worker, clientOptions); }; const timer = { diff --git a/extensions/html-language-features/client/tsconfig.json b/extensions/html-language-features/client/tsconfig.json index 8f5cef74fd3..349af163eea 100644 --- a/extensions/html-language-features/client/tsconfig.json +++ b/extensions/html-language-features/client/tsconfig.json @@ -1,7 +1,10 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./out" + "outDir": "./out", + "lib": [ + "webworker" + ] }, "include": [ "src/**/*", diff --git a/extensions/html-language-features/package-lock.json b/extensions/html-language-features/package-lock.json new file mode 100644 index 00000000000..a7c6d22b395 --- /dev/null +++ b/extensions/html-language-features/package-lock.json @@ -0,0 +1,263 @@ +{ + "name": "html-language-features", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "html-language-features", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@vscode/extension-telemetry": "^0.9.0", + "vscode-languageclient": "10.0.0-next.8", + "vscode-uri": "^3.0.8" + }, + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "^1.77.0" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz", + "integrity": "sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz", + "integrity": "sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.0.3", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz", + "integrity": "sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz", + "integrity": "sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz", + "integrity": "sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz", + "integrity": "sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.0.4", + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", + "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.3.0.tgz", + "integrity": "sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz", + "integrity": "sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==" + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz", + "integrity": "sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.0.3", + "@microsoft/1ds-post-js": "^4.0.3", + "@microsoft/applicationinsights-web-basic": "^3.0.4" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c= sha512-9Y0g0Q8rmSt+H33DfKv7FOc3v+iRI+o1lbzt8jGcIosYW37IIW/2XVYq5NPdmaD5NQ59Nk26Kl/vZbwW9Fr8vg==" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/vscode-jsonrpc": { + "version": "9.0.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.4.tgz", + "integrity": "sha512-zSVIr58lJSMYKIsZ5P7GtBbv1eEx25eNyOf0NmEzxmn1GhUNJAVAb5hkA1poKUwj1FRMwN6CeyWxZypmr8SsQQ==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageclient": { + "version": "10.0.0-next.8", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-10.0.0-next.8.tgz", + "integrity": "sha512-D9inIHgqKayO9Tv0MeLb3XIL76yTuWmKdHqcGZKzjtQrMGJgASJDYWTapu+yAjEpDp0gmVOaCYyIlLB86ncDoQ==", + "dependencies": { + "minimatch": "^9.0.3", + "semver": "^7.6.0", + "vscode-languageserver-protocol": "3.17.6-next.6" + }, + "engines": { + "vscode": "^1.89.0" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.6-next.6", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.6.tgz", + "integrity": "sha512-naxM9kc/phpl0kAFNVPejMUWUtzFXdPYY/BtQTYtfbBbHf8sceHOrKkmf6yynZRu1A4oFtRZNqV3wyFRTWqUHw==", + "dependencies": { + "vscode-jsonrpc": "9.0.0-next.4", + "vscode-languageserver-types": "3.17.6-next.4" + } + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.6-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.4.tgz", + "integrity": "sha512-SeJTpH/S14EbxOAVaOUoGVqPToqpRTld5QO5Ghig3AlbFJTFF9Wu7srHMfa85L0SX1RYAuuCSFKJVVCxDIk1/Q==" + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/extensions/html-language-features/package.json b/extensions/html-language-features/package.json index 49489ff20df..5246391caf0 100644 --- a/extensions/html-language-features/package.json +++ b/extensions/html-language-features/package.json @@ -28,7 +28,7 @@ "scripts": { "compile": "npx gulp compile-extension:html-language-features-client compile-extension:html-language-features-server", "watch": "npx gulp watch-extension:html-language-features-client watch-extension:html-language-features-server", - "install-client-next": "yarn add vscode-languageclient@next" + "install-client-next": "npm install vscode-languageclient@next" }, "categories": [ "Programming Languages" @@ -259,7 +259,7 @@ }, "dependencies": { "@vscode/extension-telemetry": "^0.9.0", - "vscode-languageclient": "^10.0.0-next.3", + "vscode-languageclient": "10.0.0-next.8", "vscode-uri": "^3.0.8" }, "devDependencies": { diff --git a/extensions/html-language-features/schemas/package.schema.json b/extensions/html-language-features/schemas/package.schema.json index ef717dbd1d1..205143c33ca 100644 --- a/extensions/html-language-features/schemas/package.schema.json +++ b/extensions/html-language-features/schemas/package.schema.json @@ -1,6 +1,5 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "HTML contributions to package.json", "type": "object", "properties": { "contributes": { diff --git a/extensions/html-language-features/server/.vscode/tasks.json b/extensions/html-language-features/server/.vscode/tasks.json index c26073e1d4f..22ac021def7 100644 --- a/extensions/html-language-features/server/.vscode/tasks.json +++ b/extensions/html-language-features/server/.vscode/tasks.json @@ -2,8 +2,8 @@ "version": "2.0.0", "tasks": [ { - "label": "yarn watch", - "command": "yarn", + "label": "npm run watch", + "command": "npm i", "args": ["watch"], "type": "shell", "presentation": { diff --git a/extensions/html-language-features/server/package-lock.json b/extensions/html-language-features/server/package-lock.json new file mode 100644 index 00000000000..a6e67b1ef6b --- /dev/null +++ b/extensions/html-language-features/server/package-lock.json @@ -0,0 +1,124 @@ +{ + "name": "vscode-html-languageserver", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vscode-html-languageserver", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@vscode/l10n": "^0.0.18", + "vscode-css-languageservice": "^6.3.1", + "vscode-html-languageservice": "^5.3.1", + "vscode-languageserver": "10.0.0-next.6", + "vscode-languageserver-textdocument": "^1.0.12", + "vscode-uri": "^3.0.8" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "20.x" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@types/mocha": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.12.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.5.tgz", + "integrity": "sha512-BD+BjQ9LS/D8ST9p5uqBxghlN+S42iuNxjsUGjeZobe/ciXzk2qb1B6IXc6AnRLS+yFJRpN2IPEHMzwspfDJNw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@vscode/l10n": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", + "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/vscode-css-languageservice": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-6.3.1.tgz", + "integrity": "sha512-1BzTBuJfwMc3A0uX4JBdJgoxp74cjj4q2mDJdp49yD/GuAq4X0k5WtK6fNcMYr+FfJ9nqgR6lpfCSZDkARJ5qQ==", + "dependencies": { + "@vscode/l10n": "^0.0.18", + "vscode-languageserver-textdocument": "^1.0.12", + "vscode-languageserver-types": "3.17.5", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/vscode-html-languageservice": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-5.3.1.tgz", + "integrity": "sha512-ysUh4hFeW/WOWz/TO9gm08xigiSsV/FOAZ+DolgJfeLftna54YdmZ4A+lIn46RbdO3/Qv5QHTn1ZGqmrXQhZyA==", + "dependencies": { + "@vscode/l10n": "^0.0.18", + "vscode-languageserver-textdocument": "^1.0.12", + "vscode-languageserver-types": "^3.17.5", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/vscode-jsonrpc": { + "version": "9.0.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.4.tgz", + "integrity": "sha512-zSVIr58lJSMYKIsZ5P7GtBbv1eEx25eNyOf0NmEzxmn1GhUNJAVAb5hkA1poKUwj1FRMwN6CeyWxZypmr8SsQQ==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "10.0.0-next.6", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-10.0.0-next.6.tgz", + "integrity": "sha512-0Lh1nhQfSxo5Ob+ayYO1QTIsDix2/Lc72Urm1KZrCFxK5zIFYaEh3QFeM9oZih4Rzs0ZkQPXXnoHtpvs5GT+Zw==", + "dependencies": { + "vscode-languageserver-protocol": "3.17.6-next.6" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.6-next.6", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.6.tgz", + "integrity": "sha512-naxM9kc/phpl0kAFNVPejMUWUtzFXdPYY/BtQTYtfbBbHf8sceHOrKkmf6yynZRu1A4oFtRZNqV3wyFRTWqUHw==", + "dependencies": { + "vscode-jsonrpc": "9.0.0-next.4", + "vscode-languageserver-types": "3.17.6-next.4" + } + }, + "node_modules/vscode-languageserver-protocol/node_modules/vscode-languageserver-types": { + "version": "3.17.6-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.4.tgz", + "integrity": "sha512-SeJTpH/S14EbxOAVaOUoGVqPToqpRTld5QO5Ghig3AlbFJTFF9Wu7srHMfa85L0SX1RYAuuCSFKJVVCxDIk1/Q==" + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" + } + } +} diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json index 75bfa00de11..652340f49d7 100644 --- a/extensions/html-language-features/server/package.json +++ b/extensions/html-language-features/server/package.json @@ -10,10 +10,10 @@ "main": "./out/node/htmlServerMain", "dependencies": { "@vscode/l10n": "^0.0.18", - "vscode-css-languageservice": "^6.2.13", - "vscode-html-languageservice": "^5.2.0", - "vscode-languageserver": "^10.0.0-next.2", - "vscode-languageserver-textdocument": "^1.0.11", + "vscode-css-languageservice": "^6.3.1", + "vscode-html-languageservice": "^5.3.1", + "vscode-languageserver": "10.0.0-next.6", + "vscode-languageserver-textdocument": "^1.0.12", "vscode-uri": "^3.0.8" }, "devDependencies": { @@ -23,10 +23,10 @@ "scripts": { "compile": "npx gulp compile-extension:html-language-features-server", "watch": "npx gulp watch-extension:html-language-features-server", - "install-service-next": "yarn add vscode-css-languageservice@next && yarn add vscode-html-languageservice@next", - "install-service-local": "yarn link vscode-css-languageservice && yarn link vscode-html-languageservice", - "install-server-next": "yarn add vscode-languageserver@next", - "install-server-local": "yarn link vscode-languageserver", - "test": "yarn compile && node ./test/index.js" + "install-service-next": "npm install vscode-css-languageservice@next && npm install vscode-html-languageservice@next", + "install-service-local": "npm install vscode-css-languageservice && npm install vscode-html-languageservice", + "install-server-next": "npm install vscode-languageserver@next", + "install-server-local": "npm install vscode-languageserver", + "test": "npm run compile && node ./test/index.js" } } diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock deleted file mode 100644 index f327f1f352f..00000000000 --- a/extensions/html-language-features/server/yarn.lock +++ /dev/null @@ -1,85 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/mocha@^9.1.1": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" - integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== - -"@types/node@20.x": - version "20.12.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.5.tgz#74c4f31ab17955d0b5808cdc8fd2839526ad00b3" - integrity sha512-BD+BjQ9LS/D8ST9p5uqBxghlN+S42iuNxjsUGjeZobe/ciXzk2qb1B6IXc6AnRLS+yFJRpN2IPEHMzwspfDJNw== - dependencies: - undici-types "~5.26.4" - -"@vscode/l10n@^0.0.18": - version "0.0.18" - resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.18.tgz#916d3a5e960dbab47c1c56f58a7cb5087b135c95" - integrity sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -vscode-css-languageservice@^6.2.13: - version "6.2.13" - resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-6.2.13.tgz#c7c2dc7a081a203048d60157c65536767d6d96f8" - integrity sha512-2rKWXfH++Kxd9Z4QuEgd1IF7WmblWWU7DScuyf1YumoGLkY9DW6wF/OTlhOyO2rN63sWHX2dehIpKBbho4ZwvA== - dependencies: - "@vscode/l10n" "^0.0.18" - vscode-languageserver-textdocument "^1.0.11" - vscode-languageserver-types "3.17.5" - vscode-uri "^3.0.8" - -vscode-html-languageservice@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-5.2.0.tgz#5b36f9131acc073cebaa2074dc8ff53e84c80f31" - integrity sha512-cdNMhyw57/SQzgUUGSIMQ66jikqEN6nBNyhx5YuOyj9310+eY9zw8Q0cXpiKzDX8aHYFewQEXRnigl06j/TVwQ== - dependencies: - "@vscode/l10n" "^0.0.18" - vscode-languageserver-textdocument "^1.0.11" - vscode-languageserver-types "^3.17.5" - vscode-uri "^3.0.8" - -vscode-jsonrpc@9.0.0-next.2: - version "9.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.2.tgz#29e9741c742c80329bba1c60ce38fd014651ba80" - integrity sha512-meIaXAgChCHzWy45QGU8YpCNyqnZQ/sYeCj32OLDDbUYsCF7AvgpdXx3nnZn9yzr8ed0Od9bW+NGphEmXsqvIQ== - -vscode-languageserver-protocol@3.17.6-next.3: - version "3.17.6-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.3.tgz#09d3e28e9ad12270233d07fa0b69cf1d51d7dfe4" - integrity sha512-H8ATH5SAvc3JzttS+AL6g681PiBOZM/l34WP2JZk4akY3y7NqTP+f9cJ+MhrVBbD3aDS8bdAKewZgbFLW6M8Pg== - dependencies: - vscode-jsonrpc "9.0.0-next.2" - vscode-languageserver-types "3.17.6-next.3" - -vscode-languageserver-textdocument@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz#0822a000e7d4dc083312580d7575fe9e3ba2e2bf" - integrity sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA== - -vscode-languageserver-types@3.17.5, vscode-languageserver-types@^3.17.5: - version "3.17.5" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz#3273676f0cf2eab40b3f44d085acbb7f08a39d8a" - integrity sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg== - -vscode-languageserver-types@3.17.6-next.3: - version "3.17.6-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.3.tgz#f71d6c57f18d921346cfe0c227aabd72eb8cd2f0" - integrity sha512-l5kNFXFRQGuzriXpuBqFpRmkf6f6A4VoU3h95OsVkqIOoi1k7KbwSo600cIdsKSJWrPg/+vX+QMPcMw1oI7ItA== - -vscode-languageserver@^10.0.0-next.2: - version "10.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-10.0.0-next.2.tgz#9a8ac58f72979961497c4fd7f6097561d4134d5f" - integrity sha512-WZdK/XO6EkNU6foYck49NpS35sahWhYFs4hwCGalH/6lhPmdUKABTnWioK/RLZKWqH8E5HdlAHQMfSBIxKBV9Q== - dependencies: - vscode-languageserver-protocol "3.17.6-next.3" - -vscode-uri@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" - integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== diff --git a/extensions/html-language-features/yarn.lock b/extensions/html-language-features/yarn.lock deleted file mode 100644 index d1d73407809..00000000000 --- a/extensions/html-language-features/yarn.lock +++ /dev/null @@ -1,187 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@microsoft/1ds-core-js@4.0.3", "@microsoft/1ds-core-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz#c8a92c623745a9595e06558a866658480c33bdf9" - integrity sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/1ds-post-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz#cfcb20bb23fb6215d3f0732f60f5b7df3e624f86" - integrity sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ== - dependencies: - "@microsoft/1ds-core-js" "4.0.3" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-channel-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz#247b6fe2158fad9826cbcdf7304f885766b36624" - integrity sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A== - dependencies: - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-common@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz#c4aa53ba343f5b3c7fbf54cddd3c86a5bdcd95dc" - integrity sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-core-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz#008308b786930d94a1de8a1fbb4af0351b74653e" - integrity sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g== - dependencies: - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-shims@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f" - integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@microsoft/applicationinsights-web-basic@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz#9a23323276b4a5a0dc6a352e2de5d75e3c16b534" - integrity sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ== - dependencies: - "@microsoft/applicationinsights-channel-js" "3.0.4" - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/dynamicproto-js@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6" - integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@nevware21/ts-async@>= 0.3.0 < 2.x": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c" - integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA== - dependencies: - "@nevware21/ts-utils" ">= 0.10.0 < 2.x" - -"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.10.1 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7" - integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg== - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@vscode/extension-telemetry@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz#8c6c61e253ff304f46045f04edd60059b144417a" - integrity sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ== - dependencies: - "@microsoft/1ds-core-js" "^4.0.3" - "@microsoft/1ds-post-js" "^4.0.3" - "@microsoft/applicationinsights-web-basic" "^3.0.4" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -minimatch@^9.0.3: - version "9.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" - integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== - dependencies: - brace-expansion "^2.0.1" - -semver@^7.6.0: - version "7.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" - integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== - dependencies: - lru-cache "^6.0.0" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -vscode-jsonrpc@9.0.0-next.2: - version "9.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.2.tgz#29e9741c742c80329bba1c60ce38fd014651ba80" - integrity sha512-meIaXAgChCHzWy45QGU8YpCNyqnZQ/sYeCj32OLDDbUYsCF7AvgpdXx3nnZn9yzr8ed0Od9bW+NGphEmXsqvIQ== - -vscode-languageclient@^10.0.0-next.3: - version "10.0.0-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-10.0.0-next.3.tgz#d7336bafafb37569ac1d8e931d20ba2a6385cc64" - integrity sha512-jJhPdZaiELpPRnCUt8kQcF2HJuvzLgeW4HOGc6dp8Je+p08ndueVT4fpSsbly6KiEHr/Ri73tNz0CSfsOye6MA== - dependencies: - minimatch "^9.0.3" - semver "^7.6.0" - vscode-languageserver-protocol "3.17.6-next.4" - -vscode-languageserver-protocol@3.17.6-next.4: - version "3.17.6-next.4" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.4.tgz#3c56f6eb588bb42fccc0ac54a0d5daf2d02f0a1b" - integrity sha512-/2bleKBxZLyRObS4mkpaWlVI9xGiUqMVmh/ztZ2vL4uP2XyIpraT45JBpn9AtXr0alqKJPKLuKr+/qcYULvm/w== - dependencies: - vscode-jsonrpc "9.0.0-next.2" - vscode-languageserver-types "3.17.6-next.3" - -vscode-languageserver-types@3.17.6-next.3: - version "3.17.6-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.3.tgz#f71d6c57f18d921346cfe0c227aabd72eb8cd2f0" - integrity sha512-l5kNFXFRQGuzriXpuBqFpRmkf6f6A4VoU3h95OsVkqIOoi1k7KbwSo600cIdsKSJWrPg/+vX+QMPcMw1oI7ItA== - -vscode-uri@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" - integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/extensions/html/yarn.lock b/extensions/html/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/html/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/ini/yarn.lock b/extensions/ini/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/ini/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/ipynb/.vscodeignore b/extensions/ipynb/.vscodeignore index 69a1b29e0ce..2d13f5a0c22 100644 --- a/extensions/ipynb/.vscodeignore +++ b/extensions/ipynb/.vscodeignore @@ -5,6 +5,6 @@ out/** tsconfig.json extension.webpack.config.js extension-browser.webpack.config.js -yarn.lock +package-lock.json .gitignore esbuild.js diff --git a/extensions/ipynb/extension-browser.webpack.config.js b/extensions/ipynb/extension-browser.webpack.config.js index e9bc478c03e..a9dbdb8b04c 100644 --- a/extensions/ipynb/extension-browser.webpack.config.js +++ b/extensions/ipynb/extension-browser.webpack.config.js @@ -12,10 +12,10 @@ const withBrowserDefaults = require('../shared.webpack.config').browser; const config = withBrowserDefaults({ context: __dirname, entry: { - extension: './src/ipynbMain.ts' + extension: './src/ipynbMain.browser.ts' }, output: { - filename: 'ipynbMain.js' + filename: 'ipynbMain.browser.js' } }); diff --git a/extensions/ipynb/extension.webpack.config.js b/extensions/ipynb/extension.webpack.config.js index 784411bb066..aad5f55845a 100644 --- a/extensions/ipynb/extension.webpack.config.js +++ b/extensions/ipynb/extension.webpack.config.js @@ -8,13 +8,19 @@ 'use strict'; const withDefaults = require('../shared.webpack.config'); +const path = require('path'); module.exports = withDefaults({ context: __dirname, entry: { - extension: './src/ipynbMain.ts', + ['ipynbMain.node']: './src/ipynbMain.node.ts', + notebookSerializerWorker: './src/notebookSerializerWorker.ts', }, output: { - filename: 'ipynbMain.js' - } + path: path.resolve(__dirname, 'dist'), + filename: '[name].js' + }, + plugins: [ + ...withDefaults.nodePlugins(__dirname), // add plugins, don't replace inherited + ] }); diff --git a/extensions/ipynb/package-lock.json b/extensions/ipynb/package-lock.json new file mode 100644 index 00000000000..7042d6a22b2 --- /dev/null +++ b/extensions/ipynb/package-lock.json @@ -0,0 +1,77 @@ +{ + "name": "ipynb", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "ipynb", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@enonic/fnv-plus": "^1.3.0", + "detect-indent": "^6.0.0" + }, + "devDependencies": { + "@jupyterlab/nbformat": "^3.2.9", + "@types/markdown-it": "12.2.3" + }, + "engines": { + "vscode": "^1.57.0" + } + }, + "node_modules/@enonic/fnv-plus": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@enonic/fnv-plus/-/fnv-plus-1.3.0.tgz", + "integrity": "sha512-BCN9uNWH8AmiP7BXBJqEinUY9KXalmRzo+L0cB/mQsmFfzODxwQrbvxCHXUNH2iP+qKkWYtB4vyy8N62PViMFw==" + }, + "node_modules/@jupyterlab/nbformat": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/@jupyterlab/nbformat/-/nbformat-3.4.3.tgz", + "integrity": "sha512-i/yADrwhhAJJCUOTa+fEBMyJO7fvX9Y73I0B7V6dQhGcrmrEKLC3wk4yOo63+jRntd5+dupbiOtz3w1ncIXwIA==", + "dev": true, + "dependencies": { + "@lumino/coreutils": "^1.11.0" + } + }, + "node_modules/@lumino/coreutils": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@lumino/coreutils/-/coreutils-1.12.0.tgz", + "integrity": "sha512-DSglh4ylmLi820CNx9soJmDJCpUgymckdWeGWuN0Ash5g60oQvrQDfosVxEhzmNvtvXv45WZEqSBzDP6E5SEmQ==", + "dev": true, + "peerDependencies": { + "crypto": "1.0.1" + } + }, + "node_modules/@types/linkify-it": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", + "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", + "dev": true + }, + "node_modules/@types/markdown-it": { + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", + "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "dev": true, + "dependencies": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, + "node_modules/@types/mdurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", + "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", + "dev": true + }, + "node_modules/detect-indent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", + "engines": { + "node": ">=8" + } + } + } +} diff --git a/extensions/ipynb/package.json b/extensions/ipynb/package.json index b97bd42e6c8..c2fe8c2a012 100644 --- a/extensions/ipynb/package.json +++ b/extensions/ipynb/package.json @@ -22,8 +22,8 @@ "workspace", "ui" ], - "main": "./out/ipynbMain.js", - "browser": "./dist/browser/ipynbMain.js", + "main": "./out/ipynbMain.node.js", + "browser": "./dist/browser/ipynbMain.browser.js", "capabilities": { "virtualWorkspaces": true, "untrustedWorkspaces": { @@ -39,6 +39,12 @@ "scope": "resource", "markdownDescription": "%ipynb.pasteImagesAsAttachments.enabled%", "default": true + }, + "ipynb.experimental.serialization": { + "type": "boolean", + "scope": "resource", + "markdownDescription": "%ipynb.experimental.serialization%", + "default": false } } } @@ -62,6 +68,11 @@ "command": "notebook.cellOutput.copy", "title": "%copyCellOutput.title%", "category": "Notebook" + }, + { + "command": "notebook.cellOutput.openInTextEditor", + "title": "%openCellOutput.title%", + "category": "Notebook" } ], "notebooks": [ @@ -108,12 +119,24 @@ { "command": "notebook.cellOutput.copy", "when": "notebookCellHasOutputs" + }, + { + "command": "notebook.cellOutput.openInTextEditor", + "when": "false" } ], "webview/context": [ { "command": "notebook.cellOutput.copy", "when": "webviewId == 'notebook.output' && webviewSection == 'image'" + }, + { + "command": "notebook.cellOutput.copy", + "when": "webviewId == 'notebook.output' && webviewSection == 'text'" + }, + { + "command": "notebook.cellOutput.openInTextEditor", + "when": "webviewId == 'notebook.output' && webviewSection == 'text'" } ] } diff --git a/extensions/ipynb/package.nls.json b/extensions/ipynb/package.nls.json index af7d8f4ab47..9fc163137f8 100644 --- a/extensions/ipynb/package.nls.json +++ b/extensions/ipynb/package.nls.json @@ -2,11 +2,13 @@ "displayName": ".ipynb Support", "description": "Provides basic support for opening and reading Jupyter's .ipynb notebook files", "ipynb.pasteImagesAsAttachments.enabled": "Enable/disable pasting of images into Markdown cells in ipynb notebook files. Pasted images are inserted as attachments to the cell.", + "ipynb.experimental.serialization": "Experimental feature to serialize the Jupyter notebook in a worker thread. Not supported when the Extension host is running as a web worker.", "newUntitledIpynb.title": "New Jupyter Notebook", "newUntitledIpynb.shortTitle": "Jupyter Notebook", "openIpynbInNotebookEditor.title": "Open IPYNB File In Notebook Editor", "cleanInvalidImageAttachment.title": "Clean Invalid Image Attachment Reference", "copyCellOutput.title": "Copy Cell Output", + "openCellOutput.title": "Open Cell Output in Text Editor", "markdownAttachmentRenderer.displayName": { "message": "Markdown-It ipynb Cell Attachment renderer", "comment": [ diff --git a/extensions/ipynb/src/common.ts b/extensions/ipynb/src/common.ts index d81951d2d7c..3fda0bc74f4 100644 --- a/extensions/ipynb/src/common.ts +++ b/extensions/ipynb/src/common.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import type * as nbformat from '@jupyterlab/nbformat'; -import { workspace } from 'vscode'; /** * Metadata we store in VS Code cell output items. @@ -66,6 +65,3 @@ export interface CellMetadata { execution_count?: number; } -export function useCustomPropertyInMetadata() { - return !workspace.getConfiguration('jupyter', undefined).get('experimental.dropCustomMetadata', true); -} diff --git a/extensions/ipynb/src/constants.ts b/extensions/ipynb/src/constants.ts index 43e13b3b510..9a82ccfae39 100644 --- a/extensions/ipynb/src/constants.ts +++ b/extensions/ipynb/src/constants.ts @@ -3,9 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; +import type { DocumentSelector } from 'vscode'; export const defaultNotebookFormat = { major: 4, minor: 2 }; export const ATTACHMENT_CLEANUP_COMMANDID = 'ipynb.cleanInvalidImageAttachment'; -export const JUPYTER_NOTEBOOK_MARKDOWN_SELECTOR: vscode.DocumentSelector = { notebookType: 'jupyter-notebook', language: 'markdown' }; +export const JUPYTER_NOTEBOOK_MARKDOWN_SELECTOR: DocumentSelector = { notebookType: 'jupyter-notebook', language: 'markdown' }; + +// Copied from NotebookCellKind.Markup as we cannot import it from vscode directly in worker threads. +export const NotebookCellKindMarkup = 1; +// Copied from NotebookCellKind.Code as we cannot import it from vscode directly in worker threads. +export const NotebookCellKindCode = 2; + +export enum CellOutputMimeTypes { + error = 'application/vnd.code.notebook.error', + stderr = 'application/vnd.code.notebook.stderr', + stdout = 'application/vnd.code.notebook.stdout' +} + +export const textMimeTypes = ['text/plain', 'text/markdown', 'text/latex', CellOutputMimeTypes.stderr, CellOutputMimeTypes.stdout]; + diff --git a/extensions/ipynb/src/deserializers.ts b/extensions/ipynb/src/deserializers.ts index 920689c748c..de467f66077 100644 --- a/extensions/ipynb/src/deserializers.ts +++ b/extensions/ipynb/src/deserializers.ts @@ -5,7 +5,8 @@ import type * as nbformat from '@jupyterlab/nbformat'; import { extensions, NotebookCellData, NotebookCellExecutionSummary, NotebookCellKind, NotebookCellOutput, NotebookCellOutputItem, NotebookData } from 'vscode'; -import { CellMetadata, CellOutputMetadata, useCustomPropertyInMetadata } from './common'; +import { CellMetadata, CellOutputMetadata } from './common'; +import { textMimeTypes } from './constants'; const jupyterLanguageToMonacoLanguageMapping = new Map([ ['c#', 'csharp'], @@ -89,15 +90,6 @@ function sortOutputItemsBasedOnDisplayOrder(outputItems: NotebookCellOutputItem[ .sort((outputItemA, outputItemB) => outputItemA.index - outputItemB.index).map(item => item.item); } - -enum CellOutputMimeTypes { - error = 'application/vnd.code.notebook.error', - stderr = 'application/vnd.code.notebook.stderr', - stdout = 'application/vnd.code.notebook.stdout' -} - -export const textMimeTypes = ['text/plain', 'text/markdown', 'text/latex', CellOutputMimeTypes.stderr, CellOutputMimeTypes.stdout]; - function concatMultilineString(str: string | string[], trim?: boolean): string { const nonLineFeedWhiteSpaceTrim = /(^[\t\f\v\r ]+|[\t\f\v\r ]+$)/g; if (Array.isArray(str)) { @@ -154,51 +146,25 @@ function convertJupyterOutputToBuffer(mime: string, value: unknown): NotebookCel function getNotebookCellMetadata(cell: nbformat.IBaseCell): { [key: string]: any; } { - if (useCustomPropertyInMetadata()) { - const cellMetadata: { [key: string]: any } = {}; - // We put this only for VSC to display in diff view. - // Else we don't use this. - const custom: CellMetadata = {}; - - if (cell.cell_type === 'code' && typeof cell['execution_count'] === 'number') { - custom.execution_count = cell['execution_count']; - } - - if (cell['metadata']) { - custom['metadata'] = JSON.parse(JSON.stringify(cell['metadata'])); - } - - if ('id' in cell && typeof cell.id === 'string') { - custom.id = cell.id; - } - - cellMetadata.custom = custom; - - if (cell['attachments']) { - cellMetadata.attachments = JSON.parse(JSON.stringify(cell['attachments'])); - } - return cellMetadata; - } else { - // We put this only for VSC to display in diff view. - // Else we don't use this. - const cellMetadata: CellMetadata = {}; - if (cell.cell_type === 'code' && typeof cell['execution_count'] === 'number') { - cellMetadata.execution_count = cell['execution_count']; - } + // We put this only for VSC to display in diff view. + // Else we don't use this. + const cellMetadata: CellMetadata = {}; + if (cell.cell_type === 'code' && typeof cell['execution_count'] === 'number') { + cellMetadata.execution_count = cell['execution_count']; + } - if (cell['metadata']) { - cellMetadata['metadata'] = JSON.parse(JSON.stringify(cell['metadata'])); - } + if (cell['metadata']) { + cellMetadata['metadata'] = JSON.parse(JSON.stringify(cell['metadata'])); + } - if ('id' in cell && typeof cell.id === 'string') { - cellMetadata.id = cell.id; - } + if ('id' in cell && typeof cell.id === 'string') { + cellMetadata.id = cell.id; + } - if (cell['attachments']) { - cellMetadata.attachments = JSON.parse(JSON.stringify(cell['attachments'])); - } - return cellMetadata; + if (cell['attachments']) { + cellMetadata.attachments = JSON.parse(JSON.stringify(cell['attachments'])); } + return cellMetadata; } function getOutputMetadata(output: nbformat.IOutput): CellOutputMetadata { @@ -382,7 +348,7 @@ export function jupyterNotebookModelToNotebookData( preferredLanguage: string ): NotebookData { const notebookContentWithoutCells = { ...notebookContent, cells: [] }; - if (!notebookContent.cells || notebookContent.cells.length === 0) { + if (!Array.isArray(notebookContent.cells)) { throw new Error('Notebook content is missing cells'); } @@ -391,6 +357,6 @@ export function jupyterNotebookModelToNotebookData( .filter((item): item is NotebookCellData => !!item); const notebookData = new NotebookData(cells); - notebookData.metadata = useCustomPropertyInMetadata() ? { custom: notebookContentWithoutCells } : notebookContentWithoutCells; + notebookData.metadata = notebookContentWithoutCells; return notebookData; } diff --git a/extensions/ipynb/src/helper.ts b/extensions/ipynb/src/helper.ts index fd81250885d..beab091f5c6 100644 --- a/extensions/ipynb/src/helper.ts +++ b/extensions/ipynb/src/helper.ts @@ -3,6 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { CancellationError } from 'vscode'; + export function deepClone(obj: T): T { if (!obj || typeof obj !== 'object') { return obj; @@ -140,3 +142,119 @@ export class Delayer { export interface ITask { (): T; } + + +/** + * Copied from src/vs/base/common/uuid.ts + */ +export function generateUuid() { + // use `randomValues` if possible + function getRandomValues(bucket: Uint8Array): Uint8Array { + for (let i = 0; i < bucket.length; i++) { + bucket[i] = Math.floor(Math.random() * 256); + } + return bucket; + } + + // prep-work + const _data = new Uint8Array(16); + const _hex: string[] = []; + for (let i = 0; i < 256; i++) { + _hex.push(i.toString(16).padStart(2, '0')); + } + + // get data + getRandomValues(_data); + + // set version bits + _data[6] = (_data[6] & 0x0f) | 0x40; + _data[8] = (_data[8] & 0x3f) | 0x80; + + // print as string + let i = 0; + let result = ''; + result += _hex[_data[i++]]; + result += _hex[_data[i++]]; + result += _hex[_data[i++]]; + result += _hex[_data[i++]]; + result += '-'; + result += _hex[_data[i++]]; + result += _hex[_data[i++]]; + result += '-'; + result += _hex[_data[i++]]; + result += _hex[_data[i++]]; + result += '-'; + result += _hex[_data[i++]]; + result += _hex[_data[i++]]; + result += '-'; + result += _hex[_data[i++]]; + result += _hex[_data[i++]]; + result += _hex[_data[i++]]; + result += _hex[_data[i++]]; + result += _hex[_data[i++]]; + result += _hex[_data[i++]]; + return result; +} + +export type ValueCallback = (value: T | Promise) => void; + +const enum DeferredOutcome { + Resolved, + Rejected +} + + +/** + * Creates a promise whose resolution or rejection can be controlled imperatively. + */ +export class DeferredPromise { + + private completeCallback!: ValueCallback; + private errorCallback!: (err: unknown) => void; + private outcome?: { outcome: DeferredOutcome.Rejected; value: any } | { outcome: DeferredOutcome.Resolved; value: T }; + + public get isRejected() { + return this.outcome?.outcome === DeferredOutcome.Rejected; + } + + public get isResolved() { + return this.outcome?.outcome === DeferredOutcome.Resolved; + } + + public get isSettled() { + return !!this.outcome; + } + + public get value() { + return this.outcome?.outcome === DeferredOutcome.Resolved ? this.outcome?.value : undefined; + } + + public readonly p: Promise; + + constructor() { + this.p = new Promise((c, e) => { + this.completeCallback = c; + this.errorCallback = e; + }); + } + + public complete(value: T) { + return new Promise(resolve => { + this.completeCallback(value); + this.outcome = { outcome: DeferredOutcome.Resolved, value }; + resolve(); + }); + } + + public error(err: unknown) { + return new Promise(resolve => { + this.errorCallback(err); + this.outcome = { outcome: DeferredOutcome.Rejected, value: err }; + resolve(); + }); + } + + public cancel() { + return this.error(new CancellationError()); + } +} diff --git a/build/azure-pipelines/common/installPlaywright.ts b/extensions/ipynb/src/ipynbMain.browser.ts similarity index 52% rename from build/azure-pipelines/common/installPlaywright.ts rename to extensions/ipynb/src/ipynbMain.browser.ts index 742b6e0e399..030a6b541d4 100644 --- a/build/azure-pipelines/common/installPlaywright.ts +++ b/extensions/ipynb/src/ipynbMain.browser.ts @@ -3,12 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -process.env.DEBUG='pw:install'; // enable logging for this (https://github.com/microsoft/playwright/issues/17394) +import * as vscode from 'vscode'; +import * as main from './ipynbMain'; +import { NotebookSerializer } from './notebookSerializer.web'; -const { installDefaultBrowsersForNpmInstall } = require('playwright-core/lib/server'); - -async function install() { - await installDefaultBrowsersForNpmInstall(); +export function activate(context: vscode.ExtensionContext) { + return main.activate(context, new NotebookSerializer(context)); } -install(); +export function deactivate() { + return main.deactivate(); +} diff --git a/extensions/ipynb/src/ipynbMain.node.ts b/extensions/ipynb/src/ipynbMain.node.ts new file mode 100644 index 00000000000..3ec39fee641 --- /dev/null +++ b/extensions/ipynb/src/ipynbMain.node.ts @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import * as main from './ipynbMain'; +import { NotebookSerializer } from './notebookSerializer.node'; + +export function activate(context: vscode.ExtensionContext) { + return main.activate(context, new NotebookSerializer(context)); +} + +export function deactivate() { + return main.deactivate(); +} diff --git a/extensions/ipynb/src/ipynbMain.ts b/extensions/ipynb/src/ipynbMain.ts index 6d73107ef54..5dc9098a99d 100644 --- a/extensions/ipynb/src/ipynbMain.ts +++ b/extensions/ipynb/src/ipynbMain.ts @@ -4,11 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { NotebookSerializer } from './notebookSerializer'; import { activate as keepNotebookModelStoreInSync } from './notebookModelStoreSync'; import { notebookImagePasteSetup } from './notebookImagePaste'; import { AttachmentCleaner } from './notebookAttachmentCleaner'; -import { useCustomPropertyInMetadata } from './common'; +import { serializeNotebookToString } from './serializers'; // From {nbformat.INotebookMetadata} in @jupyterlab/coreutils type NotebookMetadata = { @@ -29,16 +28,11 @@ type NotebookMetadata = { [propName: string]: unknown; }; -export function activate(context: vscode.ExtensionContext) { - const serializer = new NotebookSerializer(context); +export function activate(context: vscode.ExtensionContext, serializer: vscode.NotebookSerializer) { keepNotebookModelStoreInSync(context); context.subscriptions.push(vscode.workspace.registerNotebookSerializer('jupyter-notebook', serializer, { transientOutputs: false, - transientCellMetadata: useCustomPropertyInMetadata() ? { - breakpointMargin: true, - custom: false, - attachments: false - } : { + transientCellMetadata: { breakpointMargin: true, id: false, metadata: false, @@ -51,11 +45,7 @@ export function activate(context: vscode.ExtensionContext) { context.subscriptions.push(vscode.workspace.registerNotebookSerializer('interactive', serializer, { transientOutputs: false, - transientCellMetadata: useCustomPropertyInMetadata() ? { - breakpointMargin: true, - custom: false, - attachments: false - } : { + transientCellMetadata: { breakpointMargin: true, id: false, metadata: false, @@ -84,14 +74,7 @@ export function activate(context: vscode.ExtensionContext) { const language = 'python'; const cell = new vscode.NotebookCellData(vscode.NotebookCellKind.Code, '', language); const data = new vscode.NotebookData([cell]); - data.metadata = useCustomPropertyInMetadata() ? { - custom: { - cells: [], - metadata: {}, - nbformat: 4, - nbformat_minor: 2 - } - } : { + data.metadata = { cells: [], metadata: {}, nbformat: 4, @@ -119,10 +102,10 @@ export function activate(context: vscode.ExtensionContext) { return { get dropCustomMetadata() { - return !useCustomPropertyInMetadata(); + return true; }, - exportNotebook: (notebook: vscode.NotebookData): string => { - return exportNotebook(notebook, serializer); + exportNotebook: (notebook: vscode.NotebookData): Promise => { + return Promise.resolve(serializeNotebookToString(notebook)); }, setNotebookMetadata: async (resource: vscode.Uri, metadata: Partial): Promise => { const document = vscode.workspace.notebookDocuments.find(doc => doc.uri.toString() === resource.toString()); @@ -131,33 +114,16 @@ export function activate(context: vscode.ExtensionContext) { } const edit = new vscode.WorkspaceEdit(); - if (useCustomPropertyInMetadata()) { - edit.set(resource, [vscode.NotebookEdit.updateNotebookMetadata({ - ...document.metadata, - custom: { - ...(document.metadata.custom ?? {}), - metadata: { - ...(document.metadata.custom?.metadata ?? {}), - ...metadata - }, - } - })]); - } else { - edit.set(resource, [vscode.NotebookEdit.updateNotebookMetadata({ - ...document.metadata, - metadata: { - ...(document.metadata.metadata ?? {}), - ...metadata - }, - })]); - } + edit.set(resource, [vscode.NotebookEdit.updateNotebookMetadata({ + ...document.metadata, + metadata: { + ...(document.metadata.metadata ?? {}), + ...metadata + }, + })]); return vscode.workspace.applyEdit(edit); }, }; } -function exportNotebook(notebook: vscode.NotebookData, serializer: NotebookSerializer): string { - return serializer.serializeNotebookToString(notebook); -} - export function deactivate() { } diff --git a/extensions/ipynb/src/notebookModelStoreSync.ts b/extensions/ipynb/src/notebookModelStoreSync.ts index a3266216498..451085718c6 100644 --- a/extensions/ipynb/src/notebookModelStoreSync.ts +++ b/extensions/ipynb/src/notebookModelStoreSync.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import { Disposable, ExtensionContext, NotebookCellKind, NotebookDocument, NotebookDocumentChangeEvent, NotebookEdit, workspace, WorkspaceEdit, type NotebookCell, type NotebookDocumentWillSaveEvent } from 'vscode'; -import { getCellMetadata, getVSCodeCellLanguageId, removeVSCodeCellLanguageId, setVSCodeCellLanguageId, sortObjectPropertiesRecursively } from './serializers'; -import { CellMetadata, useCustomPropertyInMetadata } from './common'; -import { getNotebookMetadata } from './notebookSerializer'; +import { getCellMetadata, getVSCodeCellLanguageId, removeVSCodeCellLanguageId, setVSCodeCellLanguageId, sortObjectPropertiesRecursively, getNotebookMetadata } from './serializers'; +import { CellMetadata } from './common'; import type * as nbformat from '@jupyterlab/nbformat'; +import { generateUuid } from './helper'; const noop = () => { // @@ -108,17 +108,12 @@ function trackAndUpdateCellMetadata(notebook: NotebookDocument, updates: { cell: pendingNotebookCellModelUpdates.set(notebook, pendingUpdates); const edit = new WorkspaceEdit(); updates.forEach(({ cell, metadata }) => { - let newMetadata: any = {}; - if (useCustomPropertyInMetadata()) { - newMetadata = { ...(cell.metadata), custom: metadata }; - } else { - newMetadata = { ...cell.metadata, ...metadata }; - if (!metadata.execution_count && newMetadata.execution_count) { - delete newMetadata.execution_count; - } - if (!metadata.attachments && newMetadata.attachments) { - delete newMetadata.attachments; - } + const newMetadata = { ...cell.metadata, ...metadata }; + if (!metadata.execution_count && newMetadata.execution_count) { + delete newMetadata.execution_count; + } + if (!metadata.attachments && newMetadata.attachments) { + delete newMetadata.attachments; } edit.set(cell.notebook.uri, [NotebookEdit.updateCellMetadata(cell.index, sortObjectPropertiesRecursively(newMetadata))]); }); @@ -247,55 +242,3 @@ function generateCellId(notebook: NotebookDocument) { } } - -/** - * Copied from src/vs/base/common/uuid.ts - */ -function generateUuid() { - // use `randomValues` if possible - function getRandomValues(bucket: Uint8Array): Uint8Array { - for (let i = 0; i < bucket.length; i++) { - bucket[i] = Math.floor(Math.random() * 256); - } - return bucket; - } - - // prep-work - const _data = new Uint8Array(16); - const _hex: string[] = []; - for (let i = 0; i < 256; i++) { - _hex.push(i.toString(16).padStart(2, '0')); - } - - // get data - getRandomValues(_data); - - // set version bits - _data[6] = (_data[6] & 0x0f) | 0x40; - _data[8] = (_data[8] & 0x3f) | 0x80; - - // print as string - let i = 0; - let result = ''; - result += _hex[_data[i++]]; - result += _hex[_data[i++]]; - result += _hex[_data[i++]]; - result += _hex[_data[i++]]; - result += '-'; - result += _hex[_data[i++]]; - result += _hex[_data[i++]]; - result += '-'; - result += _hex[_data[i++]]; - result += _hex[_data[i++]]; - result += '-'; - result += _hex[_data[i++]]; - result += _hex[_data[i++]]; - result += '-'; - result += _hex[_data[i++]]; - result += _hex[_data[i++]]; - result += _hex[_data[i++]]; - result += _hex[_data[i++]]; - result += _hex[_data[i++]]; - result += _hex[_data[i++]]; - return result; -} diff --git a/extensions/ipynb/src/notebookSerializer.node.ts b/extensions/ipynb/src/notebookSerializer.node.ts new file mode 100644 index 00000000000..5a6a21018ef --- /dev/null +++ b/extensions/ipynb/src/notebookSerializer.node.ts @@ -0,0 +1,91 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { DeferredPromise, generateUuid } from './helper'; +import { NotebookSerializerBase } from './notebookSerializer'; + +export class NotebookSerializer extends NotebookSerializerBase { + private experimentalSave = vscode.workspace.getConfiguration('ipynb').get('experimental.serialization', false); + private worker?: import('node:worker_threads').Worker; + private tasks = new Map>(); + + constructor(context: vscode.ExtensionContext) { + super(context); + context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(e => { + if (e.affectsConfiguration('ipynb.experimental.serialization')) { + this.experimentalSave = vscode.workspace.getConfiguration('ipynb').get('experimental.serialization', false); + } + })); + } + + override dispose() { + try { + void this.worker?.terminate(); + } catch { + // + } + super.dispose(); + } + + public override async serializeNotebook(data: vscode.NotebookData, token: vscode.CancellationToken): Promise { + if (this.disposed) { + return new Uint8Array(0); + } + + if (this.experimentalSave) { + return this.serializeViaWorker(data); + } + + return super.serializeNotebook(data, token); + } + + private async startWorker() { + if (this.disposed) { + throw new Error('Serializer disposed'); + } + if (this.worker) { + return this.worker; + } + const { Worker } = await import('node:worker_threads'); + const outputDir = getOutputDir(this.context); + this.worker = new Worker(vscode.Uri.joinPath(this.context.extensionUri, outputDir, 'notebookSerializerWorker.js').fsPath, {}); + this.worker.on('exit', (exitCode) => { + if (!this.disposed) { + console.error(`IPynb Notebook Serializer Worker exited unexpectedly`, exitCode); + } + this.worker = undefined; + }); + this.worker.on('message', (result: { data: Uint8Array; id: string }) => { + const task = this.tasks.get(result.id); + if (task) { + task.complete(result.data); + this.tasks.delete(result.id); + } + }); + this.worker.on('error', (err) => { + if (!this.disposed) { + console.error(`IPynb Notebook Serializer Worker errored unexpectedly`, err); + } + }); + return this.worker; + } + private async serializeViaWorker(data: vscode.NotebookData): Promise { + const worker = await this.startWorker(); + const id = generateUuid(); + + const deferred = new DeferredPromise(); + this.tasks.set(id, deferred); + worker.postMessage({ data, id }); + + return deferred.p; + } +} + + +function getOutputDir(context: vscode.ExtensionContext): string { + const main = context.extension.packageJSON.main as string; + return main.indexOf('/dist/') !== -1 ? 'dist' : 'out'; +} diff --git a/extensions/ipynb/src/notebookSerializer.ts b/extensions/ipynb/src/notebookSerializer.ts index 1d44a458812..898b4ff9362 100644 --- a/extensions/ipynb/src/notebookSerializer.ts +++ b/extensions/ipynb/src/notebookSerializer.ts @@ -6,14 +6,19 @@ import type * as nbformat from '@jupyterlab/nbformat'; import * as detectIndent from 'detect-indent'; import * as vscode from 'vscode'; -import { defaultNotebookFormat } from './constants'; import { getPreferredLanguage, jupyterNotebookModelToNotebookData } from './deserializers'; -import { createJupyterCellFromNotebookCell, pruneCell, sortObjectPropertiesRecursively } from './serializers'; import * as fnv from '@enonic/fnv-plus'; -import { useCustomPropertyInMetadata } from './common'; +import { serializeNotebookToString } from './serializers'; -export class NotebookSerializer implements vscode.NotebookSerializer { - constructor(readonly context: vscode.ExtensionContext) { +export abstract class NotebookSerializerBase extends vscode.Disposable implements vscode.NotebookSerializer { + protected disposed: boolean = false; + constructor(protected readonly context: vscode.ExtensionContext) { + super(() => { }); + } + + override dispose() { + this.disposed = true; + super.dispose(); } public async deserializeNotebook(content: Uint8Array, _token: vscode.CancellationToken): Promise { @@ -52,13 +57,6 @@ export class NotebookSerializer implements vscode.NotebookSerializer { // Ensure we always have a blank cell. if ((json.cells || []).length === 0) { json.cells = [ - { - cell_type: 'code', - execution_count: null, - metadata: {}, - outputs: [], - source: '' - } ]; } @@ -78,33 +76,13 @@ export class NotebookSerializer implements vscode.NotebookSerializer { return data; } - public serializeNotebook(data: vscode.NotebookData, _token: vscode.CancellationToken): Uint8Array { - return new TextEncoder().encode(this.serializeNotebookToString(data)); - } - - public serializeNotebookToString(data: vscode.NotebookData): string { - const notebookContent = getNotebookMetadata(data); - // use the preferred language from document metadata or the first cell language as the notebook preferred cell language - const preferredCellLanguage = notebookContent.metadata?.language_info?.name ?? data.cells.find(cell => cell.kind === vscode.NotebookCellKind.Code)?.languageId; - - notebookContent.cells = data.cells - .map(cell => createJupyterCellFromNotebookCell(cell, preferredCellLanguage)) - .map(pruneCell); + public async serializeNotebook(data: vscode.NotebookData, _token: vscode.CancellationToken): Promise { + if (this.disposed) { + return new Uint8Array(0); + } - const indentAmount = data.metadata && 'indentAmount' in data.metadata && typeof data.metadata.indentAmount === 'string' ? - data.metadata.indentAmount : - ' '; - // ipynb always ends with a trailing new line (we add this so that SCMs do not show unnecessary changes, resulting from a missing trailing new line). - return JSON.stringify(sortObjectPropertiesRecursively(notebookContent), undefined, indentAmount) + '\n'; + const serialized = serializeNotebookToString(data); + return new TextEncoder().encode(serialized); } -} -export function getNotebookMetadata(document: vscode.NotebookDocument | vscode.NotebookData) { - const existingContent: Partial = (useCustomPropertyInMetadata() ? document.metadata?.custom : document.metadata) || {}; - const notebookContent: Partial = {}; - notebookContent.cells = existingContent.cells || []; - notebookContent.nbformat = existingContent.nbformat || defaultNotebookFormat.major; - notebookContent.nbformat_minor = existingContent.nbformat_minor ?? defaultNotebookFormat.minor; - notebookContent.metadata = existingContent.metadata || {}; - return notebookContent; } diff --git a/src/vs/workbench/contrib/aideChat/browser/contrib/media/editorHoverWrapper.css b/extensions/ipynb/src/notebookSerializer.web.ts similarity index 73% rename from src/vs/workbench/contrib/aideChat/browser/contrib/media/editorHoverWrapper.css rename to extensions/ipynb/src/notebookSerializer.web.ts index d95fd395255..6352cb97d20 100644 --- a/src/vs/workbench/contrib/aideChat/browser/contrib/media/editorHoverWrapper.css +++ b/extensions/ipynb/src/notebookSerializer.web.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.chat-editor-hover-wrapper-content { - padding: 2px 8px; +import { NotebookSerializerBase } from './notebookSerializer'; + +export class NotebookSerializer extends NotebookSerializerBase { } diff --git a/extensions/ipynb/src/notebookSerializerWorker.ts b/extensions/ipynb/src/notebookSerializerWorker.ts new file mode 100644 index 00000000000..594af6da791 --- /dev/null +++ b/extensions/ipynb/src/notebookSerializerWorker.ts @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { parentPort } from 'worker_threads'; +import { serializeNotebookToString } from './serializers'; +import type { NotebookData } from 'vscode'; + + +if (parentPort) { + parentPort.on('message', ({ id, data }: { id: string; data: NotebookData }) => { + if (parentPort) { + const json = serializeNotebookToString(data); + const bytes = new TextEncoder().encode(json); + parentPort.postMessage({ id, data: bytes }); + } + }); +} diff --git a/extensions/ipynb/src/serializers.ts b/extensions/ipynb/src/serializers.ts index 3eb6e90eabd..e1896ee3be1 100644 --- a/extensions/ipynb/src/serializers.ts +++ b/extensions/ipynb/src/serializers.ts @@ -4,24 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import type * as nbformat from '@jupyterlab/nbformat'; -import { NotebookCell, NotebookCellData, NotebookCellKind, NotebookCellOutput } from 'vscode'; -import { CellOutputMetadata, useCustomPropertyInMetadata, type CellMetadata } from './common'; -import { textMimeTypes } from './deserializers'; +import type { NotebookCell, NotebookCellData, NotebookCellOutput, NotebookData, NotebookDocument } from 'vscode'; +import { CellOutputMetadata, type CellMetadata } from './common'; +import { textMimeTypes, NotebookCellKindMarkup, CellOutputMimeTypes, defaultNotebookFormat } from './constants'; const textDecoder = new TextDecoder(); -enum CellOutputMimeTypes { - error = 'application/vnd.code.notebook.error', - stderr = 'application/vnd.code.notebook.stderr', - stdout = 'application/vnd.code.notebook.stdout' -} - export function createJupyterCellFromNotebookCell( vscCell: NotebookCellData, - preferredLanguage: string | undefined + preferredLanguage: string | undefined, ): nbformat.IRawCell | nbformat.IMarkdownCell | nbformat.ICodeCell { let cell: nbformat.IRawCell | nbformat.IMarkdownCell | nbformat.ICodeCell; - if (vscCell.kind === NotebookCellKind.Markup) { + if (vscCell.kind === NotebookCellKindMarkup) { cell = createMarkdownCellFromNotebookCell(vscCell); } else if (vscCell.languageId === 'raw') { cell = createRawCellFromNotebookCell(vscCell); @@ -57,18 +51,6 @@ export function sortObjectPropertiesRecursively(obj: any): any { export function getCellMetadata(options: { cell: NotebookCell | NotebookCellData } | { metadata?: { [key: string]: any } }): CellMetadata { if ('cell' in options) { const cell = options.cell; - if (useCustomPropertyInMetadata()) { - const metadata: CellMetadata = { - // it contains the cell id, and the cell metadata, along with other nb cell metadata - ...(cell.metadata?.custom ?? {}) - }; - // promote the cell attachments to the top level - const attachments = cell.metadata?.custom?.attachments ?? cell.metadata?.attachments; - if (attachments) { - metadata.attachments = attachments; - } - return metadata; - } const metadata = { // it contains the cell id, and the cell metadata, along with other nb cell metadata ...(cell.metadata ?? {}) @@ -77,18 +59,6 @@ export function getCellMetadata(options: { cell: NotebookCell | NotebookCellData return metadata; } else { const cell = options; - if (useCustomPropertyInMetadata()) { - const metadata: CellMetadata = { - // it contains the cell id, and the cell metadata, along with other nb cell metadata - ...(cell.metadata?.custom ?? {}) - }; - // promote the cell attachments to the top level - const attachments = cell.metadata?.custom?.attachments ?? cell.metadata?.attachments; - if (attachments) { - metadata.attachments = attachments; - } - return metadata; - } const metadata = { // it contains the cell id, and the cell metadata, along with other nb cell metadata ...(cell.metadata ?? {}) @@ -121,9 +91,15 @@ function createCodeCellFromNotebookCell(cell: NotebookCellData, preferredLanguag removeVSCodeCellLanguageId(cellMetadata); } - const codeCell: any = { + const codeCell: nbformat.ICodeCell = { cell_type: 'code', - execution_count: cell.executionSummary?.executionOrder ?? null, + // Metadata should always contain the execution_count. + // When ever execution summary data changes we will update the metadata to contain the execution count. + // Failing to do so means we have a problem. + // Also do not read the value of executionSummary here, as its possible user reverted changes to metadata + // & in that case execution summary could contain the data, but metadata will not. + // In such cases we do not want to re-set the metadata with the value from execution summary (remember, user reverted that). + execution_count: cellMetadata.execution_count ?? null, source: splitMultilineString(cell.value.replace(/\r\n/g, '\n')), outputs: (cell.outputs || []).map(translateCellDisplayOutput), metadata: cellMetadata.metadata @@ -469,3 +445,36 @@ function fixupOutput(output: nbformat.IOutput): nbformat.IOutput { } return result; } + + +export function serializeNotebookToString(data: NotebookData): string { + const notebookContent = getNotebookMetadata(data); + // use the preferred language from document metadata or the first cell language as the notebook preferred cell language + const preferredCellLanguage = notebookContent.metadata?.language_info?.name ?? data.cells.find(cell => cell.kind === 2)?.languageId; + + notebookContent.cells = data.cells + .map(cell => createJupyterCellFromNotebookCell(cell, preferredCellLanguage)) + .map(pruneCell); + + const indentAmount = data.metadata && 'indentAmount' in data.metadata && typeof data.metadata.indentAmount === 'string' ? + data.metadata.indentAmount : + ' '; + + return serializeNotebookToJSON(notebookContent, indentAmount); +} +function serializeNotebookToJSON(notebookContent: Partial, indentAmount: string): string { + // ipynb always ends with a trailing new line (we add this so that SCMs do not show unnecessary changes, resulting from a missing trailing new line). + const sorted = sortObjectPropertiesRecursively(notebookContent); + + return JSON.stringify(sorted, undefined, indentAmount) + '\n'; +} + +export function getNotebookMetadata(document: NotebookDocument | NotebookData) { + const existingContent: Partial = document.metadata || {}; + const notebookContent: Partial = {}; + notebookContent.cells = existingContent.cells || []; + notebookContent.nbformat = existingContent.nbformat || defaultNotebookFormat.major; + notebookContent.nbformat_minor = existingContent.nbformat_minor ?? defaultNotebookFormat.minor; + notebookContent.metadata = existingContent.metadata || {}; + return notebookContent; +} diff --git a/extensions/ipynb/src/test/notebookModelStoreSync.test.ts b/extensions/ipynb/src/test/notebookModelStoreSync.test.ts index 1afca8c1239..acb6ec546bb 100644 --- a/extensions/ipynb/src/test/notebookModelStoreSync.test.ts +++ b/extensions/ipynb/src/test/notebookModelStoreSync.test.ts @@ -8,673 +8,525 @@ import * as sinon from 'sinon'; import { CancellationTokenSource, Disposable, EventEmitter, ExtensionContext, NotebookCellKind, NotebookDocumentChangeEvent, NotebookDocumentWillSaveEvent, NotebookEdit, NotebookRange, TextDocumentSaveReason, workspace, type CancellationToken, type NotebookCell, type NotebookDocument, type WorkspaceEdit, type WorkspaceEditMetadata } from 'vscode'; import { activate } from '../notebookModelStoreSync'; -[true, false].forEach(useCustomPropertyInMetadata => { - suite(`Notebook Model Store Sync (${useCustomPropertyInMetadata ? 'with custom metadata (standard behaviour)' : 'without custom metadata'})`, () => { - let disposables: Disposable[] = []; - let onDidChangeNotebookDocument: EventEmitter; - let onWillSaveNotebookDocument: AsyncEmitter; - let notebook: NotebookDocument; - let token: CancellationTokenSource; - let editsApplied: WorkspaceEdit[] = []; - let pendingPromises: Promise[] = []; - let cellMetadataUpdates: NotebookEdit[] = []; - let applyEditStub: sinon.SinonStub<[edit: WorkspaceEdit, metadata?: WorkspaceEditMetadata | undefined], Thenable>; - setup(() => { - disposables = []; - notebook = { - notebookType: '', - metadata: {} - } as NotebookDocument; - sinon.stub(workspace, 'getConfiguration').callsFake((section, scope) => { - if (section === 'jupyter') { - return { - get: () => { - return !useCustomPropertyInMetadata; - } - }; - } else { - return (workspace.getConfiguration as any).wrappedMethod.call(workspace, section, scope); - } - }); - token = new CancellationTokenSource(); - disposables.push(token); - sinon.stub(notebook, 'notebookType').get(() => 'jupyter-notebook'); - applyEditStub = sinon.stub(workspace, 'applyEdit').callsFake((edit: WorkspaceEdit) => { - editsApplied.push(edit); - return Promise.resolve(true); - }); - const context = { subscriptions: [] as Disposable[] } as ExtensionContext; - onDidChangeNotebookDocument = new EventEmitter(); - disposables.push(onDidChangeNotebookDocument); - onWillSaveNotebookDocument = new AsyncEmitter(); - - sinon.stub(NotebookEdit, 'updateCellMetadata').callsFake((index, metadata) => { - const edit = (NotebookEdit.updateCellMetadata as any).wrappedMethod.call(NotebookEdit, index, metadata); - cellMetadataUpdates.push(edit); - return edit; - } - ); - sinon.stub(workspace, 'onDidChangeNotebookDocument').callsFake(cb => - onDidChangeNotebookDocument.event(cb) - ); - sinon.stub(workspace, 'onWillSaveNotebookDocument').callsFake(cb => - onWillSaveNotebookDocument.event(cb) - ); - activate(context); - }); - teardown(async () => { - await Promise.allSettled(pendingPromises); - editsApplied = []; - pendingPromises = []; - cellMetadataUpdates = []; - disposables.forEach(d => d.dispose()); - disposables = []; - sinon.restore(); +suite(`Notebook Model Store Sync`, () => { + let disposables: Disposable[] = []; + let onDidChangeNotebookDocument: EventEmitter; + let onWillSaveNotebookDocument: AsyncEmitter; + let notebook: NotebookDocument; + let token: CancellationTokenSource; + let editsApplied: WorkspaceEdit[] = []; + let pendingPromises: Promise[] = []; + let cellMetadataUpdates: NotebookEdit[] = []; + let applyEditStub: sinon.SinonStub<[edit: WorkspaceEdit, metadata?: WorkspaceEditMetadata | undefined], Thenable>; + setup(() => { + disposables = []; + notebook = { + notebookType: '', + metadata: {} + } as NotebookDocument; + token = new CancellationTokenSource(); + disposables.push(token); + sinon.stub(notebook, 'notebookType').get(() => 'jupyter-notebook'); + applyEditStub = sinon.stub(workspace, 'applyEdit').callsFake((edit: WorkspaceEdit) => { + editsApplied.push(edit); + return Promise.resolve(true); }); + const context = { subscriptions: [] as Disposable[] } as ExtensionContext; + onDidChangeNotebookDocument = new EventEmitter(); + disposables.push(onDidChangeNotebookDocument); + onWillSaveNotebookDocument = new AsyncEmitter(); + + sinon.stub(NotebookEdit, 'updateCellMetadata').callsFake((index, metadata) => { + const edit = (NotebookEdit.updateCellMetadata as any).wrappedMethod.call(NotebookEdit, index, metadata); + cellMetadataUpdates.push(edit); + return edit; + } + ); + sinon.stub(workspace, 'onDidChangeNotebookDocument').callsFake(cb => + onDidChangeNotebookDocument.event(cb) + ); + sinon.stub(workspace, 'onWillSaveNotebookDocument').callsFake(cb => + onWillSaveNotebookDocument.event(cb) + ); + activate(context); + }); + teardown(async () => { + await Promise.allSettled(pendingPromises); + editsApplied = []; + pendingPromises = []; + cellMetadataUpdates = []; + disposables.forEach(d => d.dispose()); + disposables = []; + sinon.restore(); + }); - test('Empty cell will not result in any updates', async () => { - const e: NotebookDocumentChangeEvent = { - notebook, - metadata: undefined, - contentChanges: [], - cellChanges: [] - }; + test('Empty cell will not result in any updates', async () => { + const e: NotebookDocumentChangeEvent = { + notebook, + metadata: undefined, + contentChanges: [], + cellChanges: [] + }; - onDidChangeNotebookDocument.fire(e); + onDidChangeNotebookDocument.fire(e); - assert.strictEqual(editsApplied.length, 0); - }); - test('Adding cell for non Jupyter Notebook will not result in any updates', async () => { - sinon.stub(notebook, 'notebookType').get(() => 'some-other-type'); - const cell: NotebookCell = { - document: {} as any, - executionSummary: {}, - index: 0, - kind: NotebookCellKind.Code, - metadata: {}, - notebook, - outputs: [] - }; - const e: NotebookDocumentChangeEvent = { - notebook, - metadata: undefined, - contentChanges: [ - { - range: new NotebookRange(0, 0), - removedCells: [], - addedCells: [cell] - } - ], - cellChanges: [] - }; + assert.strictEqual(editsApplied.length, 0); + }); + test('Adding cell for non Jupyter Notebook will not result in any updates', async () => { + sinon.stub(notebook, 'notebookType').get(() => 'some-other-type'); + const cell: NotebookCell = { + document: {} as any, + executionSummary: {}, + index: 0, + kind: NotebookCellKind.Code, + metadata: {}, + notebook, + outputs: [] + }; + const e: NotebookDocumentChangeEvent = { + notebook, + metadata: undefined, + contentChanges: [ + { + range: new NotebookRange(0, 0), + removedCells: [], + addedCells: [cell] + } + ], + cellChanges: [] + }; - onDidChangeNotebookDocument.fire(e); + onDidChangeNotebookDocument.fire(e); - assert.strictEqual(editsApplied.length, 0); - assert.strictEqual(cellMetadataUpdates.length, 0); - }); - test('Adding cell will result in an update to the metadata', async () => { - const cell: NotebookCell = { - document: {} as any, - executionSummary: {}, - index: 0, - kind: NotebookCellKind.Code, - metadata: {}, - notebook, - outputs: [] - }; - const e: NotebookDocumentChangeEvent = { - notebook, - metadata: undefined, - contentChanges: [ - { - range: new NotebookRange(0, 0), - removedCells: [], - addedCells: [cell] - } - ], - cellChanges: [] - }; + assert.strictEqual(editsApplied.length, 0); + assert.strictEqual(cellMetadataUpdates.length, 0); + }); + test('Adding cell will result in an update to the metadata', async () => { + const cell: NotebookCell = { + document: {} as any, + executionSummary: {}, + index: 0, + kind: NotebookCellKind.Code, + metadata: {}, + notebook, + outputs: [] + }; + const e: NotebookDocumentChangeEvent = { + notebook, + metadata: undefined, + contentChanges: [ + { + range: new NotebookRange(0, 0), + removedCells: [], + addedCells: [cell] + } + ], + cellChanges: [] + }; - onDidChangeNotebookDocument.fire(e); + onDidChangeNotebookDocument.fire(e); - assert.strictEqual(editsApplied.length, 1); - assert.strictEqual(cellMetadataUpdates.length, 1); - const newMetadata = cellMetadataUpdates[0].newCellMetadata; - if (useCustomPropertyInMetadata) { - assert.deepStrictEqual(newMetadata, { custom: { metadata: {} } }); - } else { - assert.deepStrictEqual(newMetadata, { metadata: {} }); - } - }); - test('Add cell id if nbformat is 4.5', async () => { - if (useCustomPropertyInMetadata) { - sinon.stub(notebook, 'metadata').get(() => ({ custom: { nbformat: 4, nbformat_minor: 5 } })); - } else { - sinon.stub(notebook, 'metadata').get(() => ({ nbformat: 4, nbformat_minor: 5 })); - } - const cell: NotebookCell = { - document: {} as any, - executionSummary: {}, - index: 0, - kind: NotebookCellKind.Code, - metadata: {}, - notebook, - outputs: [] - }; - const e: NotebookDocumentChangeEvent = { - notebook, - metadata: undefined, - contentChanges: [ - { - range: new NotebookRange(0, 0), - removedCells: [], - addedCells: [cell] - } - ], - cellChanges: [] - }; + assert.strictEqual(editsApplied.length, 1); + assert.strictEqual(cellMetadataUpdates.length, 1); + const newMetadata = cellMetadataUpdates[0].newCellMetadata; + assert.deepStrictEqual(newMetadata, { metadata: {} }); + }); + test('Add cell id if nbformat is 4.5', async () => { + sinon.stub(notebook, 'metadata').get(() => ({ nbformat: 4, nbformat_minor: 5 })); + const cell: NotebookCell = { + document: {} as any, + executionSummary: {}, + index: 0, + kind: NotebookCellKind.Code, + metadata: {}, + notebook, + outputs: [] + }; + const e: NotebookDocumentChangeEvent = { + notebook, + metadata: undefined, + contentChanges: [ + { + range: new NotebookRange(0, 0), + removedCells: [], + addedCells: [cell] + } + ], + cellChanges: [] + }; + + onDidChangeNotebookDocument.fire(e); + + assert.strictEqual(editsApplied.length, 1); + assert.strictEqual(cellMetadataUpdates.length, 1); + const newMetadata = cellMetadataUpdates[0].newCellMetadata || {}; + assert.strictEqual(Object.keys(newMetadata).length, 2); + assert.deepStrictEqual(newMetadata.metadata, {}); + assert.ok(newMetadata.id); + }); + test('Do not add cell id if one already exists', async () => { + sinon.stub(notebook, 'metadata').get(() => ({ nbformat: 4, nbformat_minor: 5 })); + const cell: NotebookCell = { + document: {} as any, + executionSummary: {}, + index: 0, + kind: NotebookCellKind.Code, + metadata: { + id: '1234' + }, + notebook, + outputs: [] + }; + const e: NotebookDocumentChangeEvent = { + notebook, + metadata: undefined, + contentChanges: [ + { + range: new NotebookRange(0, 0), + removedCells: [], + addedCells: [cell] + } + ], + cellChanges: [] + }; + + onDidChangeNotebookDocument.fire(e); + + assert.strictEqual(editsApplied.length, 1); + assert.strictEqual(cellMetadataUpdates.length, 1); + const newMetadata = cellMetadataUpdates[0].newCellMetadata || {}; + assert.strictEqual(Object.keys(newMetadata).length, 2); + assert.deepStrictEqual(newMetadata.metadata, {}); + assert.strictEqual(newMetadata.id, '1234'); + }); + test('Do not perform any updates if cell id and metadata exists', async () => { + sinon.stub(notebook, 'metadata').get(() => ({ nbformat: 4, nbformat_minor: 5 })); + const cell: NotebookCell = { + document: {} as any, + executionSummary: {}, + index: 0, + kind: NotebookCellKind.Code, + metadata: { + id: '1234', + metadata: {} + }, + notebook, + outputs: [] + }; + const e: NotebookDocumentChangeEvent = { + notebook, + metadata: undefined, + contentChanges: [ + { + range: new NotebookRange(0, 0), + removedCells: [], + addedCells: [cell] + } + ], + cellChanges: [] + }; - onDidChangeNotebookDocument.fire(e); - - assert.strictEqual(editsApplied.length, 1); - assert.strictEqual(cellMetadataUpdates.length, 1); - const newMetadata = cellMetadataUpdates[0].newCellMetadata || {}; - if (useCustomPropertyInMetadata) { - assert.strictEqual(Object.keys(newMetadata).length, 1); - assert.strictEqual(Object.keys(newMetadata.custom).length, 2); - assert.deepStrictEqual(newMetadata.custom.metadata, {}); - assert.ok(newMetadata.custom.id); - } else { - assert.strictEqual(Object.keys(newMetadata).length, 2); - assert.deepStrictEqual(newMetadata.metadata, {}); - assert.ok(newMetadata.id); - } - }); - test('Do not add cell id if one already exists', async () => { - if (useCustomPropertyInMetadata) { - sinon.stub(notebook, 'metadata').get(() => ({ custom: { nbformat: 4, nbformat_minor: 5 } })); - } else { - sinon.stub(notebook, 'metadata').get(() => ({ nbformat: 4, nbformat_minor: 5 })); - } - const cell: NotebookCell = { - document: {} as any, - executionSummary: {}, - index: 0, - kind: NotebookCellKind.Code, - metadata: useCustomPropertyInMetadata ? { - custom: { - id: '1234' - } - } : { - id: '1234' - }, - notebook, - outputs: [] - }; - const e: NotebookDocumentChangeEvent = { - notebook, - metadata: undefined, - contentChanges: [ - { - range: new NotebookRange(0, 0), - removedCells: [], - addedCells: [cell] - } - ], - cellChanges: [] - }; + onDidChangeNotebookDocument.fire(e); - onDidChangeNotebookDocument.fire(e); - - assert.strictEqual(editsApplied.length, 1); - assert.strictEqual(cellMetadataUpdates.length, 1); - const newMetadata = cellMetadataUpdates[0].newCellMetadata || {}; - if (useCustomPropertyInMetadata) { - assert.strictEqual(Object.keys(newMetadata).length, 1); - assert.strictEqual(Object.keys(newMetadata.custom).length, 2); - assert.deepStrictEqual(newMetadata.custom.metadata, {}); - assert.strictEqual(newMetadata.custom.id, '1234'); - } else { - assert.strictEqual(Object.keys(newMetadata).length, 2); - assert.deepStrictEqual(newMetadata.metadata, {}); - assert.strictEqual(newMetadata.id, '1234'); - } - }); - test('Do not perform any updates if cell id and metadata exists', async () => { - if (useCustomPropertyInMetadata) { - sinon.stub(notebook, 'metadata').get(() => ({ custom: { nbformat: 4, nbformat_minor: 5 } })); - } else { - sinon.stub(notebook, 'metadata').get(() => ({ nbformat: 4, nbformat_minor: 5 })); + assert.strictEqual(editsApplied.length, 0); + assert.strictEqual(cellMetadataUpdates.length, 0); + }); + test('Store language id in custom metadata, whilst preserving existing metadata', async () => { + sinon.stub(notebook, 'metadata').get(() => ({ + nbformat: 4, nbformat_minor: 5, + metadata: { + language_info: { name: 'python' } } - const cell: NotebookCell = { - document: {} as any, - executionSummary: {}, - index: 0, - kind: NotebookCellKind.Code, - metadata: useCustomPropertyInMetadata ? { - custom: { - id: '1234', - metadata: {} - } - } : { - id: '1234', - metadata: {} - }, - notebook, - outputs: [] - }; - const e: NotebookDocumentChangeEvent = { - notebook, - metadata: undefined, - contentChanges: [ - { - range: new NotebookRange(0, 0), - removedCells: [], - addedCells: [cell] - } - ], - cellChanges: [] - }; - - onDidChangeNotebookDocument.fire(e); + })); + const cell: NotebookCell = { + document: { + languageId: 'javascript' + } as any, + executionSummary: {}, + index: 0, + kind: NotebookCellKind.Code, + metadata: { + id: '1234', + metadata: { + collapsed: true, scrolled: true + } + }, + notebook, + outputs: [] + }; + const e: NotebookDocumentChangeEvent = { + notebook, + metadata: undefined, + contentChanges: [], + cellChanges: [ + { + cell, + document: { + languageId: 'javascript' + } as any, + metadata: undefined, + outputs: undefined, + executionSummary: undefined + } + ] + }; - assert.strictEqual(editsApplied.length, 0); - assert.strictEqual(cellMetadataUpdates.length, 0); - }); - test('Store language id in custom metadata, whilst preserving existing metadata', async () => { - if (useCustomPropertyInMetadata) { - sinon.stub(notebook, 'metadata').get(() => ({ - custom: { - nbformat: 4, nbformat_minor: 5, - metadata: { - language_info: { name: 'python' } - } - } - })); - } else { - sinon.stub(notebook, 'metadata').get(() => ({ - nbformat: 4, nbformat_minor: 5, - metadata: { - language_info: { name: 'python' } - } - })); - } - const cell: NotebookCell = { - document: { - languageId: 'javascript' - } as any, - executionSummary: {}, - index: 0, - kind: NotebookCellKind.Code, - metadata: useCustomPropertyInMetadata ? { - custom: { - id: '1234', - metadata: { - collapsed: true, scrolled: true - } - } - } : { - id: '1234', - metadata: { - collapsed: true, scrolled: true - } - }, - notebook, - outputs: [] - }; - const e: NotebookDocumentChangeEvent = { - notebook, - metadata: undefined, - contentChanges: [], - cellChanges: [ - { - cell, - document: { - languageId: 'javascript' - } as any, - metadata: undefined, - outputs: undefined, - executionSummary: undefined - } - ] - }; + onDidChangeNotebookDocument.fire(e); - onDidChangeNotebookDocument.fire(e); - - assert.strictEqual(editsApplied.length, 1); - assert.strictEqual(cellMetadataUpdates.length, 1); - const newMetadata = cellMetadataUpdates[0].newCellMetadata || {}; - if (useCustomPropertyInMetadata) { - assert.strictEqual(Object.keys(newMetadata).length, 1); - assert.strictEqual(Object.keys(newMetadata.custom).length, 2); - assert.deepStrictEqual(newMetadata.custom.metadata, { collapsed: true, scrolled: true, vscode: { languageId: 'javascript' } }); - assert.strictEqual(newMetadata.custom.id, '1234'); - } else { - assert.strictEqual(Object.keys(newMetadata).length, 2); - assert.deepStrictEqual(newMetadata.metadata, { collapsed: true, scrolled: true, vscode: { languageId: 'javascript' } }); - assert.strictEqual(newMetadata.id, '1234'); - } - }); - test('No changes when language is javascript', async () => { - if (useCustomPropertyInMetadata) { - sinon.stub(notebook, 'metadata').get(() => ({ - custom: { - nbformat: 4, nbformat_minor: 5, - metadata: { - language_info: { name: 'javascript' } - } - } - })); - } else { - sinon.stub(notebook, 'metadata').get(() => ({ - nbformat: 4, nbformat_minor: 5, - metadata: { - language_info: { name: 'javascript' } - } - })); + assert.strictEqual(editsApplied.length, 1); + assert.strictEqual(cellMetadataUpdates.length, 1); + const newMetadata = cellMetadataUpdates[0].newCellMetadata || {}; + assert.strictEqual(Object.keys(newMetadata).length, 2); + assert.deepStrictEqual(newMetadata.metadata, { collapsed: true, scrolled: true, vscode: { languageId: 'javascript' } }); + assert.strictEqual(newMetadata.id, '1234'); + }); + test('No changes when language is javascript', async () => { + sinon.stub(notebook, 'metadata').get(() => ({ + nbformat: 4, nbformat_minor: 5, + metadata: { + language_info: { name: 'javascript' } } - const cell: NotebookCell = { - document: { - languageId: 'javascript' - } as any, - executionSummary: {}, - index: 0, - kind: NotebookCellKind.Code, - metadata: useCustomPropertyInMetadata ? { - custom: { - id: '1234', - metadata: { - collapsed: true, scrolled: true - } - } - } : { - id: '1234', - metadata: { - collapsed: true, scrolled: true - } - }, - notebook, - outputs: [] - }; - const e: NotebookDocumentChangeEvent = { - notebook, - metadata: undefined, - contentChanges: [], - cellChanges: [ - { - cell, - document: undefined, - metadata: undefined, - outputs: undefined, - executionSummary: undefined - } - ] - }; + })); + const cell: NotebookCell = { + document: { + languageId: 'javascript' + } as any, + executionSummary: {}, + index: 0, + kind: NotebookCellKind.Code, + metadata: { + id: '1234', + metadata: { + collapsed: true, scrolled: true + } + }, + notebook, + outputs: [] + }; + const e: NotebookDocumentChangeEvent = { + notebook, + metadata: undefined, + contentChanges: [], + cellChanges: [ + { + cell, + document: undefined, + metadata: undefined, + outputs: undefined, + executionSummary: undefined + } + ] + }; - onDidChangeNotebookDocument.fire(e); + onDidChangeNotebookDocument.fire(e); - assert.strictEqual(editsApplied.length, 0); - assert.strictEqual(cellMetadataUpdates.length, 0); - }); - test('Remove language from metadata when cell language matches kernel language', async () => { - if (useCustomPropertyInMetadata) { - sinon.stub(notebook, 'metadata').get(() => ({ - custom: { - nbformat: 4, nbformat_minor: 5, - metadata: { - language_info: { name: 'javascript' } - } - } - })); - } else { - sinon.stub(notebook, 'metadata').get(() => ({ - nbformat: 4, nbformat_minor: 5, - metadata: { - language_info: { name: 'javascript' } - } - })); + assert.strictEqual(editsApplied.length, 0); + assert.strictEqual(cellMetadataUpdates.length, 0); + }); + test('Remove language from metadata when cell language matches kernel language', async () => { + sinon.stub(notebook, 'metadata').get(() => ({ + nbformat: 4, nbformat_minor: 5, + metadata: { + language_info: { name: 'javascript' } } - const cell: NotebookCell = { - document: { - languageId: 'javascript' - } as any, - executionSummary: {}, - index: 0, - kind: NotebookCellKind.Code, - metadata: useCustomPropertyInMetadata ? { - custom: { - id: '1234', - metadata: { - vscode: { languageId: 'python' }, - collapsed: true, scrolled: true - } - } - } : { - id: '1234', - metadata: { - vscode: { languageId: 'python' }, - collapsed: true, scrolled: true - } - }, - notebook, - outputs: [] - }; - const e: NotebookDocumentChangeEvent = { - notebook, - metadata: undefined, - contentChanges: [], - cellChanges: [ - { - cell, - document: { - languageId: 'javascript' - } as any, - metadata: undefined, - outputs: undefined, - executionSummary: undefined - } - ] - }; + })); + const cell: NotebookCell = { + document: { + languageId: 'javascript' + } as any, + executionSummary: {}, + index: 0, + kind: NotebookCellKind.Code, + metadata: { + id: '1234', + metadata: { + vscode: { languageId: 'python' }, + collapsed: true, scrolled: true + } + }, + notebook, + outputs: [] + }; + const e: NotebookDocumentChangeEvent = { + notebook, + metadata: undefined, + contentChanges: [], + cellChanges: [ + { + cell, + document: { + languageId: 'javascript' + } as any, + metadata: undefined, + outputs: undefined, + executionSummary: undefined + } + ] + }; - onDidChangeNotebookDocument.fire(e); - - assert.strictEqual(editsApplied.length, 1); - assert.strictEqual(cellMetadataUpdates.length, 1); - const newMetadata = cellMetadataUpdates[0].newCellMetadata || {}; - if (useCustomPropertyInMetadata) { - assert.strictEqual(Object.keys(newMetadata).length, 1); - assert.strictEqual(Object.keys(newMetadata.custom).length, 2); - assert.deepStrictEqual(newMetadata.custom.metadata, { collapsed: true, scrolled: true }); - assert.strictEqual(newMetadata.custom.id, '1234'); - } else { - assert.strictEqual(Object.keys(newMetadata).length, 2); - assert.deepStrictEqual(newMetadata.metadata, { collapsed: true, scrolled: true }); - assert.strictEqual(newMetadata.id, '1234'); - } - }); - test('Update language in metadata', async () => { - if (useCustomPropertyInMetadata) { - sinon.stub(notebook, 'metadata').get(() => ({ - custom: { - nbformat: 4, nbformat_minor: 5, - metadata: { - language_info: { name: 'javascript' } - } - } - })); - } else { + onDidChangeNotebookDocument.fire(e); - sinon.stub(notebook, 'metadata').get(() => ({ - nbformat: 4, nbformat_minor: 5, - metadata: { - language_info: { name: 'javascript' } - } - })); + assert.strictEqual(editsApplied.length, 1); + assert.strictEqual(cellMetadataUpdates.length, 1); + const newMetadata = cellMetadataUpdates[0].newCellMetadata || {}; + assert.strictEqual(Object.keys(newMetadata).length, 2); + assert.deepStrictEqual(newMetadata.metadata, { collapsed: true, scrolled: true }); + assert.strictEqual(newMetadata.id, '1234'); + }); + test('Update language in metadata', async () => { + sinon.stub(notebook, 'metadata').get(() => ({ + nbformat: 4, nbformat_minor: 5, + metadata: { + language_info: { name: 'javascript' } } - const cell: NotebookCell = { - document: { - languageId: 'powershell' - } as any, - executionSummary: {}, - index: 0, - kind: NotebookCellKind.Code, - metadata: useCustomPropertyInMetadata ? { - custom: { - id: '1234', - metadata: { - vscode: { languageId: 'python' }, - collapsed: true, scrolled: true - } - } - } : { - id: '1234', - metadata: { - vscode: { languageId: 'python' }, - collapsed: true, scrolled: true - } - }, - notebook, - outputs: [] - }; - const e: NotebookDocumentChangeEvent = { - notebook, - metadata: undefined, - contentChanges: [], - cellChanges: [ - { - cell, - document: { - languageId: 'powershell' - } as any, - metadata: undefined, - outputs: undefined, - executionSummary: undefined - } - ] - }; + })); + const cell: NotebookCell = { + document: { + languageId: 'powershell' + } as any, + executionSummary: {}, + index: 0, + kind: NotebookCellKind.Code, + metadata: { + id: '1234', + metadata: { + vscode: { languageId: 'python' }, + collapsed: true, scrolled: true + } + }, + notebook, + outputs: [] + }; + const e: NotebookDocumentChangeEvent = { + notebook, + metadata: undefined, + contentChanges: [], + cellChanges: [ + { + cell, + document: { + languageId: 'powershell' + } as any, + metadata: undefined, + outputs: undefined, + executionSummary: undefined + } + ] + }; - onDidChangeNotebookDocument.fire(e); - - assert.strictEqual(editsApplied.length, 1); - assert.strictEqual(cellMetadataUpdates.length, 1); - const newMetadata = cellMetadataUpdates[0].newCellMetadata || {}; - if (useCustomPropertyInMetadata) { - assert.strictEqual(Object.keys(newMetadata).length, 1); - assert.strictEqual(Object.keys(newMetadata.custom).length, 2); - assert.deepStrictEqual(newMetadata.custom.metadata, { collapsed: true, scrolled: true, vscode: { languageId: 'powershell' } }); - assert.strictEqual(newMetadata.custom.id, '1234'); - } else { - assert.strictEqual(Object.keys(newMetadata).length, 2); - assert.deepStrictEqual(newMetadata.metadata, { collapsed: true, scrolled: true, vscode: { languageId: 'powershell' } }); - assert.strictEqual(newMetadata.id, '1234'); - } - }); + onDidChangeNotebookDocument.fire(e); - test('Will save event without any changes', async () => { - await onWillSaveNotebookDocument.fireAsync({ notebook, reason: TextDocumentSaveReason.Manual }, token.token); + assert.strictEqual(editsApplied.length, 1); + assert.strictEqual(cellMetadataUpdates.length, 1); + const newMetadata = cellMetadataUpdates[0].newCellMetadata || {}; + assert.strictEqual(Object.keys(newMetadata).length, 2); + assert.deepStrictEqual(newMetadata.metadata, { collapsed: true, scrolled: true, vscode: { languageId: 'powershell' } }); + assert.strictEqual(newMetadata.id, '1234'); + }); + + test('Will save event without any changes', async () => { + await onWillSaveNotebookDocument.fireAsync({ notebook, reason: TextDocumentSaveReason.Manual }, token.token); + }); + test('Wait for pending updates to complete when saving', async () => { + let resolveApplyEditPromise: (value: boolean) => void; + const promise = new Promise((resolve) => resolveApplyEditPromise = resolve); + applyEditStub.restore(); + sinon.stub(workspace, 'applyEdit').callsFake((edit: WorkspaceEdit) => { + editsApplied.push(edit); + return promise; }); - test('Wait for pending updates to complete when saving', async () => { - let resolveApplyEditPromise: (value: boolean) => void; - const promise = new Promise((resolve) => resolveApplyEditPromise = resolve); - applyEditStub.restore(); - sinon.stub(workspace, 'applyEdit').callsFake((edit: WorkspaceEdit) => { - editsApplied.push(edit); - return promise; - }); - const cell: NotebookCell = { - document: {} as any, - executionSummary: {}, - index: 0, - kind: NotebookCellKind.Code, - metadata: {}, - notebook, - outputs: [] - }; - const e: NotebookDocumentChangeEvent = { - notebook, - metadata: undefined, - contentChanges: [ - { - range: new NotebookRange(0, 0), - removedCells: [], - addedCells: [cell] - } - ], - cellChanges: [] - }; + const cell: NotebookCell = { + document: {} as any, + executionSummary: {}, + index: 0, + kind: NotebookCellKind.Code, + metadata: {}, + notebook, + outputs: [] + }; + const e: NotebookDocumentChangeEvent = { + notebook, + metadata: undefined, + contentChanges: [ + { + range: new NotebookRange(0, 0), + removedCells: [], + addedCells: [cell] + } + ], + cellChanges: [] + }; - onDidChangeNotebookDocument.fire(e); + onDidChangeNotebookDocument.fire(e); - assert.strictEqual(editsApplied.length, 1); - assert.strictEqual(cellMetadataUpdates.length, 1); + assert.strictEqual(editsApplied.length, 1); + assert.strictEqual(cellMetadataUpdates.length, 1); - // Try to save. - let saveCompleted = false; - const saved = onWillSaveNotebookDocument.fireAsync({ - notebook, - reason: TextDocumentSaveReason.Manual - }, token.token); - saved.finally(() => saveCompleted = true); - await new Promise((resolve) => setTimeout(resolve, 10)); + // Try to save. + let saveCompleted = false; + const saved = onWillSaveNotebookDocument.fireAsync({ + notebook, + reason: TextDocumentSaveReason.Manual + }, token.token); + saved.finally(() => saveCompleted = true); + await new Promise((resolve) => setTimeout(resolve, 10)); - // Verify we have not yet completed saving. - assert.strictEqual(saveCompleted, false); + // Verify we have not yet completed saving. + assert.strictEqual(saveCompleted, false); - resolveApplyEditPromise!(true); - await new Promise((resolve) => setTimeout(resolve, 1)); + resolveApplyEditPromise!(true); + await new Promise((resolve) => setTimeout(resolve, 1)); - // Should have completed saving. - saved.finally(() => saveCompleted = true); - }); + // Should have completed saving. + saved.finally(() => saveCompleted = true); + }); - interface IWaitUntil { - token: CancellationToken; - waitUntil(thenable: Promise): void; + interface IWaitUntil { + token: CancellationToken; + waitUntil(thenable: Promise): void; + } + + interface IWaitUntil { + token: CancellationToken; + waitUntil(thenable: Promise): void; + } + type IWaitUntilData = Omit, 'token'>; + + class AsyncEmitter { + private listeners: ((d: T) => void)[] = []; + get event(): (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]) => Disposable { + + return (listener, thisArgs, _disposables) => { + this.listeners.push(listener.bind(thisArgs)); + return { + dispose: () => { + // + } + }; + }; } - - interface IWaitUntil { - token: CancellationToken; - waitUntil(thenable: Promise): void; + dispose() { + this.listeners = []; } - type IWaitUntilData = Omit, 'token'>; - - class AsyncEmitter { - private listeners: ((d: T) => void)[] = []; - get event(): (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]) => Disposable { - - return (listener, thisArgs, _disposables) => { - this.listeners.push(listener.bind(thisArgs)); - return { - dispose: () => { - // - } - }; - }; + async fireAsync(data: IWaitUntilData, token: CancellationToken): Promise { + if (!this.listeners.length) { + return; } - dispose() { - this.listeners = []; - } - async fireAsync(data: IWaitUntilData, token: CancellationToken): Promise { - if (!this.listeners.length) { - return; - } - const promises: Promise[] = []; - this.listeners.forEach(cb => { - const event = { - ...data, - token, - waitUntil: (thenable: Promise) => { - promises.push(thenable); - } - } as T; - cb(event); - }); - - await Promise.all(promises); - } + const promises: Promise[] = []; + this.listeners.forEach(cb => { + const event = { + ...data, + token, + waitUntil: (thenable: Promise) => { + promises.push(thenable); + } + } as T; + cb(event); + }); + + await Promise.all(promises); } - }); + } }); diff --git a/extensions/ipynb/src/test/serializers.test.ts b/extensions/ipynb/src/test/serializers.test.ts index cc7f53fe442..cb461539c5d 100644 --- a/extensions/ipynb/src/test/serializers.test.ts +++ b/extensions/ipynb/src/test/serializers.test.ts @@ -19,267 +19,215 @@ function deepStripProperties(obj: any, props: string[]) { } } } -[true, false].forEach(useCustomPropertyInMetadata => { - suite(`ipynb serializer (${useCustomPropertyInMetadata ? 'with custom metadata (standard behaviour)' : 'without custom metadata'})`, () => { - let disposables: vscode.Disposable[] = []; - setup(() => { - disposables = []; - sinon.stub(vscode.workspace, 'getConfiguration').callsFake((section, scope) => { - if (section === 'jupyter') { - return { - get: () => { - return !useCustomPropertyInMetadata; - } - }; - } else { - return (vscode.workspace.getConfiguration as any).wrappedMethod.call(vscode.workspace, section, scope); +suite(`ipynb serializer`, () => { + let disposables: vscode.Disposable[] = []; + setup(() => { + disposables = []; + }); + teardown(async () => { + disposables.forEach(d => d.dispose()); + disposables = []; + sinon.restore(); + }); + + const base64EncodedImage = + 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOUlZL6DwAB/wFSU1jVmgAAAABJRU5ErkJggg=='; + test('Deserialize', async () => { + const cells: nbformat.ICell[] = [ + { + cell_type: 'code', + execution_count: 10, + outputs: [], + source: 'print(1)', + metadata: {} + }, + { + cell_type: 'markdown', + source: '# HEAD', + metadata: {} + } + ]; + const notebook = jupyterNotebookModelToNotebookData({ cells }, 'python'); + assert.ok(notebook); + + const expectedCodeCell = new vscode.NotebookCellData(vscode.NotebookCellKind.Code, 'print(1)', 'python'); + expectedCodeCell.outputs = []; + expectedCodeCell.metadata = { execution_count: 10, metadata: {} }; + expectedCodeCell.executionSummary = { executionOrder: 10 }; + + const expectedMarkdownCell = new vscode.NotebookCellData(vscode.NotebookCellKind.Markup, '# HEAD', 'markdown'); + expectedMarkdownCell.outputs = []; + expectedMarkdownCell.metadata = { + metadata: {} + }; + + assert.deepStrictEqual(notebook.cells, [expectedCodeCell, expectedMarkdownCell]); + }); + + + test('Serialize', async () => { + const markdownCell = new vscode.NotebookCellData(vscode.NotebookCellKind.Markup, '# header1', 'markdown'); + markdownCell.metadata = { + attachments: { + 'image.png': { + 'image/png': 'abc' } - }); + }, + id: '123', + metadata: { + foo: 'bar' + } + }; + + const cellMetadata = getCellMetadata({ cell: markdownCell }); + assert.deepStrictEqual(cellMetadata, { + id: '123', + metadata: { + foo: 'bar', + }, + attachments: { + 'image.png': { + 'image/png': 'abc' + } + } }); - teardown(async () => { - disposables.forEach(d => d.dispose()); - disposables = []; - sinon.restore(); + + const markdownCell2 = new vscode.NotebookCellData(vscode.NotebookCellKind.Markup, '# header1', 'markdown'); + markdownCell2.metadata = { + id: '123', + metadata: { + foo: 'bar' + }, + attachments: { + 'image.png': { + 'image/png': 'abc' + } + } + }; + + const nbMarkdownCell = createMarkdownCellFromNotebookCell(markdownCell); + const nbMarkdownCell2 = createMarkdownCellFromNotebookCell(markdownCell2); + assert.deepStrictEqual(nbMarkdownCell, nbMarkdownCell2); + + assert.deepStrictEqual(nbMarkdownCell, { + cell_type: 'markdown', + source: ['# header1'], + metadata: { + foo: 'bar', + }, + attachments: { + 'image.png': { + 'image/png': 'abc' + } + }, + id: '123' }); + }); - const base64EncodedImage = - 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOUlZL6DwAB/wFSU1jVmgAAAABJRU5ErkJggg=='; - test('Deserialize', async () => { + suite('Outputs', () => { + function validateCellOutputTranslation( + outputs: nbformat.IOutput[], + expectedOutputs: vscode.NotebookCellOutput[], + propertiesToExcludeFromComparison: string[] = [] + ) { const cells: nbformat.ICell[] = [ { cell_type: 'code', execution_count: 10, - outputs: [], + outputs, source: 'print(1)', metadata: {} - }, - { - cell_type: 'markdown', - source: '# HEAD', - metadata: {} } ]; const notebook = jupyterNotebookModelToNotebookData({ cells }, 'python'); - assert.ok(notebook); - const expectedCodeCell = new vscode.NotebookCellData(vscode.NotebookCellKind.Code, 'print(1)', 'python'); - expectedCodeCell.outputs = []; - expectedCodeCell.metadata = useCustomPropertyInMetadata ? { custom: { execution_count: 10, metadata: {} } } : { execution_count: 10, metadata: {} }; - expectedCodeCell.executionSummary = { executionOrder: 10 }; - - const expectedMarkdownCell = new vscode.NotebookCellData(vscode.NotebookCellKind.Markup, '# HEAD', 'markdown'); - expectedMarkdownCell.outputs = []; - expectedMarkdownCell.metadata = useCustomPropertyInMetadata ? { - custom: { metadata: {} } - } : { - metadata: {} - }; + // OutputItems contain an `id` property generated by VSC. + // Exclude that property when comparing. + const propertiesToExclude = propertiesToExcludeFromComparison.concat(['id']); + const actualOuts = notebook.cells[0].outputs; + deepStripProperties(actualOuts, propertiesToExclude); + deepStripProperties(expectedOutputs, propertiesToExclude); + assert.deepStrictEqual(actualOuts, expectedOutputs); + } - assert.deepStrictEqual(notebook.cells, [expectedCodeCell, expectedMarkdownCell]); + test('Empty output', () => { + validateCellOutputTranslation([], []); }); - - test('Serialize', async () => { - const markdownCell = new vscode.NotebookCellData(vscode.NotebookCellKind.Markup, '# header1', 'markdown'); - markdownCell.metadata = useCustomPropertyInMetadata ? { - attachments: { - 'image.png': { - 'image/png': 'abc' - } - }, - custom: { - id: '123', - metadata: { - foo: 'bar' - } - } - } : { - attachments: { - 'image.png': { - 'image/png': 'abc' - } - }, - id: '123', - metadata: { - foo: 'bar' - } - }; - - const cellMetadata = getCellMetadata({ cell: markdownCell }); - assert.deepStrictEqual(cellMetadata, { - id: '123', - metadata: { - foo: 'bar', - }, - attachments: { - 'image.png': { - 'image/png': 'abc' - } - } - }); - - const markdownCell2 = new vscode.NotebookCellData(vscode.NotebookCellKind.Markup, '# header1', 'markdown'); - markdownCell2.metadata = useCustomPropertyInMetadata ? { - custom: { - id: '123', - metadata: { - foo: 'bar' + test('Stream output', () => { + validateCellOutputTranslation( + [ + { + output_type: 'stream', + name: 'stderr', + text: 'Error' }, - attachments: { - 'image.png': { - 'image/png': 'abc' - } + { + output_type: 'stream', + name: 'stdout', + text: 'NoError' } - } - } : { - id: '123', - metadata: { - foo: 'bar' - }, - attachments: { - 'image.png': { - 'image/png': 'abc' + ], + [ + new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stderr('Error')], { + outputType: 'stream' + }), + new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stdout('NoError')], { + outputType: 'stream' + }) + ] + ); + }); + test('Stream output and line endings', () => { + validateCellOutputTranslation( + [ + { + output_type: 'stream', + name: 'stdout', + text: [ + 'Line1\n', + '\n', + 'Line3\n', + 'Line4' + ] } - } - }; - - const nbMarkdownCell = createMarkdownCellFromNotebookCell(markdownCell); - const nbMarkdownCell2 = createMarkdownCellFromNotebookCell(markdownCell2); - assert.deepStrictEqual(nbMarkdownCell, nbMarkdownCell2); - - assert.deepStrictEqual(nbMarkdownCell, { - cell_type: 'markdown', - source: ['# header1'], - metadata: { - foo: 'bar', - }, - attachments: { - 'image.png': { - 'image/png': 'abc' + ], + [ + new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stdout('Line1\n\nLine3\nLine4')], { + outputType: 'stream' + }) + ] + ); + validateCellOutputTranslation( + [ + { + output_type: 'stream', + name: 'stdout', + text: [ + 'Hello\n', + 'Hello\n', + 'Hello\n', + 'Hello\n', + 'Hello\n', + 'Hello\n' + ] } - }, - id: '123' - }); + ], + [ + new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stdout('Hello\nHello\nHello\nHello\nHello\nHello\n')], { + outputType: 'stream' + }) + ] + ); }); - - suite('Outputs', () => { - function validateCellOutputTranslation( - outputs: nbformat.IOutput[], - expectedOutputs: vscode.NotebookCellOutput[], - propertiesToExcludeFromComparison: string[] = [] - ) { - const cells: nbformat.ICell[] = [ + test('Multi-line Stream output', () => { + validateCellOutputTranslation( + [ { - cell_type: 'code', - execution_count: 10, - outputs, - source: 'print(1)', - metadata: {} - } - ]; - const notebook = jupyterNotebookModelToNotebookData({ cells }, 'python'); - - // OutputItems contain an `id` property generated by VSC. - // Exclude that property when comparing. - const propertiesToExclude = propertiesToExcludeFromComparison.concat(['id']); - const actualOuts = notebook.cells[0].outputs; - deepStripProperties(actualOuts, propertiesToExclude); - deepStripProperties(expectedOutputs, propertiesToExclude); - assert.deepStrictEqual(actualOuts, expectedOutputs); - } - - test('Empty output', () => { - validateCellOutputTranslation([], []); - }); - - test('Stream output', () => { - validateCellOutputTranslation( - [ - { - output_type: 'stream', - name: 'stderr', - text: 'Error' - }, - { - output_type: 'stream', - name: 'stdout', - text: 'NoError' - } - ], - [ - new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stderr('Error')], { - outputType: 'stream' - }), - new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stdout('NoError')], { - outputType: 'stream' - }) - ] - ); - }); - test('Stream output and line endings', () => { - validateCellOutputTranslation( - [ - { - output_type: 'stream', - name: 'stdout', - text: [ - 'Line1\n', - '\n', - 'Line3\n', - 'Line4' - ] - } - ], - [ - new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stdout('Line1\n\nLine3\nLine4')], { - outputType: 'stream' - }) - ] - ); - validateCellOutputTranslation( - [ - { - output_type: 'stream', - name: 'stdout', - text: [ - 'Hello\n', - 'Hello\n', - 'Hello\n', - 'Hello\n', - 'Hello\n', - 'Hello\n' - ] - } - ], - [ - new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stdout('Hello\nHello\nHello\nHello\nHello\nHello\n')], { - outputType: 'stream' - }) - ] - ); - }); - test('Multi-line Stream output', () => { - validateCellOutputTranslation( - [ - { - name: 'stdout', - output_type: 'stream', - text: [ - 'Epoch 1/5\n', - '...\n', - 'Epoch 2/5\n', - '...\n', - 'Epoch 3/5\n', - '...\n', - 'Epoch 4/5\n', - '...\n', - 'Epoch 5/5\n', - '...\n' - ] - } - ], - [ - new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stdout(['Epoch 1/5\n', + name: 'stdout', + output_type: 'stream', + text: [ + 'Epoch 1/5\n', '...\n', 'Epoch 2/5\n', '...\n', @@ -288,35 +236,35 @@ function deepStripProperties(obj: any, props: string[]) { 'Epoch 4/5\n', '...\n', 'Epoch 5/5\n', - '...\n'].join(''))], { - outputType: 'stream' - }) - ] - ); - }); + '...\n' + ] + } + ], + [ + new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stdout(['Epoch 1/5\n', + '...\n', + 'Epoch 2/5\n', + '...\n', + 'Epoch 3/5\n', + '...\n', + 'Epoch 4/5\n', + '...\n', + 'Epoch 5/5\n', + '...\n'].join(''))], { + outputType: 'stream' + }) + ] + ); + }); - test('Multi-line Stream output (last empty line should not be saved in ipynb)', () => { - validateCellOutputTranslation( - [ - { - name: 'stderr', - output_type: 'stream', - text: [ - 'Epoch 1/5\n', - '...\n', - 'Epoch 2/5\n', - '...\n', - 'Epoch 3/5\n', - '...\n', - 'Epoch 4/5\n', - '...\n', - 'Epoch 5/5\n', - '...\n' - ] - } - ], - [ - new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stderr(['Epoch 1/5\n', + test('Multi-line Stream output (last empty line should not be saved in ipynb)', () => { + validateCellOutputTranslation( + [ + { + name: 'stderr', + output_type: 'stream', + text: [ + 'Epoch 1/5\n', '...\n', 'Epoch 2/5\n', '...\n', @@ -325,423 +273,436 @@ function deepStripProperties(obj: any, props: string[]) { 'Epoch 4/5\n', '...\n', 'Epoch 5/5\n', - '...\n', - // This last empty line should not be saved in ipynb. - '\n'].join(''))], { - outputType: 'stream' - }) - ] - ); - }); + '...\n' + ] + } + ], + [ + new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stderr(['Epoch 1/5\n', + '...\n', + 'Epoch 2/5\n', + '...\n', + 'Epoch 3/5\n', + '...\n', + 'Epoch 4/5\n', + '...\n', + 'Epoch 5/5\n', + '...\n', + // This last empty line should not be saved in ipynb. + '\n'].join(''))], { + outputType: 'stream' + }) + ] + ); + }); - test('Streamed text with Ansi characters', async () => { - validateCellOutputTranslation( - [ + test('Streamed text with Ansi characters', async () => { + validateCellOutputTranslation( + [ + { + name: 'stderr', + text: '\u001b[K\u001b[33m✅ \u001b[0m Loading\n', + output_type: 'stream' + } + ], + [ + new vscode.NotebookCellOutput( + [vscode.NotebookCellOutputItem.stderr('\u001b[K\u001b[33m✅ \u001b[0m Loading\n')], { - name: 'stderr', - text: '\u001b[K\u001b[33m✅ \u001b[0m Loading\n', - output_type: 'stream' + outputType: 'stream' } - ], - [ - new vscode.NotebookCellOutput( - [vscode.NotebookCellOutputItem.stderr('\u001b[K\u001b[33m✅ \u001b[0m Loading\n')], - { - outputType: 'stream' - } - ) - ] - ); - }); + ) + ] + ); + }); - test('Streamed text with angle bracket characters', async () => { - validateCellOutputTranslation( - [ - { - name: 'stderr', - text: '1 is < 2', - output_type: 'stream' - } - ], - [ - new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stderr('1 is < 2')], { - outputType: 'stream' - }) - ] - ); - }); + test('Streamed text with angle bracket characters', async () => { + validateCellOutputTranslation( + [ + { + name: 'stderr', + text: '1 is < 2', + output_type: 'stream' + } + ], + [ + new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stderr('1 is < 2')], { + outputType: 'stream' + }) + ] + ); + }); - test('Streamed text with angle bracket characters and ansi chars', async () => { - validateCellOutputTranslation( - [ + test('Streamed text with angle bracket characters and ansi chars', async () => { + validateCellOutputTranslation( + [ + { + name: 'stderr', + text: '1 is < 2\u001b[K\u001b[33m✅ \u001b[0m Loading\n', + output_type: 'stream' + } + ], + [ + new vscode.NotebookCellOutput( + [vscode.NotebookCellOutputItem.stderr('1 is < 2\u001b[K\u001b[33m✅ \u001b[0m Loading\n')], { - name: 'stderr', - text: '1 is < 2\u001b[K\u001b[33m✅ \u001b[0m Loading\n', - output_type: 'stream' + outputType: 'stream' } - ], - [ - new vscode.NotebookCellOutput( - [vscode.NotebookCellOutputItem.stderr('1 is < 2\u001b[K\u001b[33m✅ \u001b[0m Loading\n')], - { - outputType: 'stream' - } - ) - ] - ); - }); + ) + ] + ); + }); - test('Error', async () => { - validateCellOutputTranslation( - [ + test('Error', async () => { + validateCellOutputTranslation( + [ + { + ename: 'Error Name', + evalue: 'Error Value', + traceback: ['stack1', 'stack2', 'stack3'], + output_type: 'error' + } + ], + [ + new vscode.NotebookCellOutput( + [ + vscode.NotebookCellOutputItem.error({ + name: 'Error Name', + message: 'Error Value', + stack: ['stack1', 'stack2', 'stack3'].join('\n') + }) + ], { - ename: 'Error Name', - evalue: 'Error Value', - traceback: ['stack1', 'stack2', 'stack3'], - output_type: 'error' - } - ], - [ - new vscode.NotebookCellOutput( - [ - vscode.NotebookCellOutputItem.error({ - name: 'Error Name', - message: 'Error Value', - stack: ['stack1', 'stack2', 'stack3'].join('\n') - }) - ], - { - outputType: 'error', - originalError: { - ename: 'Error Name', - evalue: 'Error Value', - traceback: ['stack1', 'stack2', 'stack3'], - output_type: 'error' - } + outputType: 'error', + originalError: { + ename: 'Error Name', + evalue: 'Error Value', + traceback: ['stack1', 'stack2', 'stack3'], + output_type: 'error' } - ) - ] - ); - }); - - ['display_data', 'execute_result'].forEach(output_type => { - suite(`Rich output for output_type = ${output_type}`, () => { - // Properties to exclude when comparing. - let propertiesToExcludeFromComparison: string[] = []; - setup(() => { - if (output_type === 'display_data') { - // With display_data the execution_count property will never exist in the output. - // We can ignore that (as it will never exist). - // But we leave it in the case of `output_type === 'execute_result'` - propertiesToExcludeFromComparison = ['execution_count', 'executionCount']; } - }); + ) + ] + ); + }); - test('Text mimeType output', async () => { - validateCellOutputTranslation( - [ + ['display_data', 'execute_result'].forEach(output_type => { + suite(`Rich output for output_type = ${output_type}`, () => { + // Properties to exclude when comparing. + let propertiesToExcludeFromComparison: string[] = []; + setup(() => { + if (output_type === 'display_data') { + // With display_data the execution_count property will never exist in the output. + // We can ignore that (as it will never exist). + // But we leave it in the case of `output_type === 'execute_result'` + propertiesToExcludeFromComparison = ['execution_count', 'executionCount']; + } + }); + + test('Text mimeType output', async () => { + validateCellOutputTranslation( + [ + { + data: { + 'text/plain': 'Hello World!' + }, + output_type, + metadata: {}, + execution_count: 1 + } + ], + [ + new vscode.NotebookCellOutput( + [new vscode.NotebookCellOutputItem(Buffer.from('Hello World!', 'utf8'), 'text/plain')], { - data: { - 'text/plain': 'Hello World!' - }, - output_type, - metadata: {}, - execution_count: 1 + outputType: output_type, + metadata: {}, // display_data & execute_result always have metadata. + executionCount: 1 } - ], - [ - new vscode.NotebookCellOutput( - [new vscode.NotebookCellOutputItem(Buffer.from('Hello World!', 'utf8'), 'text/plain')], - { - outputType: output_type, - metadata: {}, // display_data & execute_result always have metadata. - executionCount: 1 - } - ) - ], - propertiesToExcludeFromComparison - ); - }); + ) + ], + propertiesToExcludeFromComparison + ); + }); - test('png,jpeg images', async () => { - validateCellOutputTranslation( - [ + test('png,jpeg images', async () => { + validateCellOutputTranslation( + [ + { + execution_count: 1, + data: { + 'image/png': base64EncodedImage, + 'image/jpeg': base64EncodedImage + }, + metadata: {}, + output_type + } + ], + [ + new vscode.NotebookCellOutput( + [ + new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/png'), + new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/jpeg') + ], { - execution_count: 1, - data: { - 'image/png': base64EncodedImage, - 'image/jpeg': base64EncodedImage - }, - metadata: {}, - output_type + executionCount: 1, + outputType: output_type, + metadata: {} // display_data & execute_result always have metadata. } - ], - [ - new vscode.NotebookCellOutput( - [ - new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/png'), - new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/jpeg') - ], - { - executionCount: 1, - outputType: output_type, - metadata: {} // display_data & execute_result always have metadata. - } - ) - ], - propertiesToExcludeFromComparison - ); - }); + ) + ], + propertiesToExcludeFromComparison + ); + }); - test('png image with a light background', async () => { - validateCellOutputTranslation( - [ + test('png image with a light background', async () => { + validateCellOutputTranslation( + [ + { + execution_count: 1, + data: { + 'image/png': base64EncodedImage + }, + metadata: { + needs_background: 'light' + }, + output_type + } + ], + [ + new vscode.NotebookCellOutput( + [new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/png')], { - execution_count: 1, - data: { - 'image/png': base64EncodedImage - }, + executionCount: 1, metadata: { needs_background: 'light' }, - output_type + outputType: output_type } - ], - [ - new vscode.NotebookCellOutput( - [new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/png')], - { - executionCount: 1, - metadata: { - needs_background: 'light' - }, - outputType: output_type - } - ) - ], - propertiesToExcludeFromComparison - ); - }); + ) + ], + propertiesToExcludeFromComparison + ); + }); - test('png image with a dark background', async () => { - validateCellOutputTranslation( - [ + test('png image with a dark background', async () => { + validateCellOutputTranslation( + [ + { + execution_count: 1, + data: { + 'image/png': base64EncodedImage + }, + metadata: { + needs_background: 'dark' + }, + output_type + } + ], + [ + new vscode.NotebookCellOutput( + [new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/png')], { - execution_count: 1, - data: { - 'image/png': base64EncodedImage - }, + executionCount: 1, metadata: { needs_background: 'dark' }, - output_type + outputType: output_type } - ], - [ - new vscode.NotebookCellOutput( - [new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/png')], - { - executionCount: 1, - metadata: { - needs_background: 'dark' - }, - outputType: output_type - } - ) - ], - propertiesToExcludeFromComparison - ); - }); + ) + ], + propertiesToExcludeFromComparison + ); + }); - test('png image with custom dimensions', async () => { - validateCellOutputTranslation( - [ + test('png image with custom dimensions', async () => { + validateCellOutputTranslation( + [ + { + execution_count: 1, + data: { + 'image/png': base64EncodedImage + }, + metadata: { + 'image/png': { height: '111px', width: '999px' } + }, + output_type + } + ], + [ + new vscode.NotebookCellOutput( + [new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/png')], { - execution_count: 1, - data: { - 'image/png': base64EncodedImage - }, + executionCount: 1, metadata: { 'image/png': { height: '111px', width: '999px' } }, - output_type + outputType: output_type } - ], - [ - new vscode.NotebookCellOutput( - [new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/png')], - { - executionCount: 1, - metadata: { - 'image/png': { height: '111px', width: '999px' } - }, - outputType: output_type - } - ) - ], - propertiesToExcludeFromComparison - ); - }); + ) + ], + propertiesToExcludeFromComparison + ); + }); - test('png allowed to scroll', async () => { - validateCellOutputTranslation( - [ + test('png allowed to scroll', async () => { + validateCellOutputTranslation( + [ + { + execution_count: 1, + data: { + 'image/png': base64EncodedImage + }, + metadata: { + unconfined: true, + 'image/png': { width: '999px' } + }, + output_type + } + ], + [ + new vscode.NotebookCellOutput( + [new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/png')], { - execution_count: 1, - data: { - 'image/png': base64EncodedImage - }, + executionCount: 1, metadata: { unconfined: true, 'image/png': { width: '999px' } }, - output_type + outputType: output_type } - ], - [ - new vscode.NotebookCellOutput( - [new vscode.NotebookCellOutputItem(Buffer.from(base64EncodedImage, 'base64'), 'image/png')], - { - executionCount: 1, - metadata: { - unconfined: true, - 'image/png': { width: '999px' } - }, - outputType: output_type - } - ) - ], - propertiesToExcludeFromComparison - ); - }); + ) + ], + propertiesToExcludeFromComparison + ); }); }); }); + }); - suite('Output Order', () => { - test('Verify order of outputs', async () => { - const dataAndExpectedOrder: { output: nbformat.IDisplayData; expectedMimeTypesOrder: string[] }[] = [ - { - output: { - data: { - 'application/vnd.vegalite.v4+json': 'some json', - 'text/html': 'Hello' - }, - metadata: {}, - output_type: 'display_data' + suite('Output Order', () => { + test('Verify order of outputs', async () => { + const dataAndExpectedOrder: { output: nbformat.IDisplayData; expectedMimeTypesOrder: string[] }[] = [ + { + output: { + data: { + 'application/vnd.vegalite.v4+json': 'some json', + 'text/html': 'Hello' }, - expectedMimeTypesOrder: ['application/vnd.vegalite.v4+json', 'text/html'] + metadata: {}, + output_type: 'display_data' }, - { - output: { - data: { - 'application/vnd.vegalite.v4+json': 'some json', - 'application/javascript': 'some js', - 'text/plain': 'some text', - 'text/html': 'Hello' - }, - metadata: {}, - output_type: 'display_data' + expectedMimeTypesOrder: ['application/vnd.vegalite.v4+json', 'text/html'] + }, + { + output: { + data: { + 'application/vnd.vegalite.v4+json': 'some json', + 'application/javascript': 'some js', + 'text/plain': 'some text', + 'text/html': 'Hello' }, - expectedMimeTypesOrder: [ - 'application/vnd.vegalite.v4+json', - 'text/html', - 'application/javascript', - 'text/plain' - ] + metadata: {}, + output_type: 'display_data' }, - { - output: { - data: { - 'application/vnd.vegalite.v4+json': '', // Empty, should give preference to other mimetypes. - 'application/javascript': 'some js', - 'text/plain': 'some text', - 'text/html': 'Hello' - }, - metadata: {}, - output_type: 'display_data' + expectedMimeTypesOrder: [ + 'application/vnd.vegalite.v4+json', + 'text/html', + 'application/javascript', + 'text/plain' + ] + }, + { + output: { + data: { + 'application/vnd.vegalite.v4+json': '', // Empty, should give preference to other mimetypes. + 'application/javascript': 'some js', + 'text/plain': 'some text', + 'text/html': 'Hello' }, - expectedMimeTypesOrder: [ - 'text/html', - 'application/javascript', - 'text/plain', - 'application/vnd.vegalite.v4+json' - ] + metadata: {}, + output_type: 'display_data' }, - { - output: { - data: { - 'text/plain': 'some text', - 'text/html': 'Hello' - }, - metadata: {}, - output_type: 'display_data' + expectedMimeTypesOrder: [ + 'text/html', + 'application/javascript', + 'text/plain', + 'application/vnd.vegalite.v4+json' + ] + }, + { + output: { + data: { + 'text/plain': 'some text', + 'text/html': 'Hello' }, - expectedMimeTypesOrder: ['text/html', 'text/plain'] + metadata: {}, + output_type: 'display_data' }, - { - output: { - data: { - 'application/javascript': 'some js', - 'text/plain': 'some text' - }, - metadata: {}, - output_type: 'display_data' + expectedMimeTypesOrder: ['text/html', 'text/plain'] + }, + { + output: { + data: { + 'application/javascript': 'some js', + 'text/plain': 'some text' }, - expectedMimeTypesOrder: ['application/javascript', 'text/plain'] + metadata: {}, + output_type: 'display_data' }, - { - output: { - data: { - 'image/svg+xml': 'some svg', - 'text/plain': 'some text' - }, - metadata: {}, - output_type: 'display_data' + expectedMimeTypesOrder: ['application/javascript', 'text/plain'] + }, + { + output: { + data: { + 'image/svg+xml': 'some svg', + 'text/plain': 'some text' }, - expectedMimeTypesOrder: ['image/svg+xml', 'text/plain'] + metadata: {}, + output_type: 'display_data' }, - { - output: { - data: { - 'text/latex': 'some latex', - 'text/plain': 'some text' - }, - metadata: {}, - output_type: 'display_data' + expectedMimeTypesOrder: ['image/svg+xml', 'text/plain'] + }, + { + output: { + data: { + 'text/latex': 'some latex', + 'text/plain': 'some text' }, - expectedMimeTypesOrder: ['text/latex', 'text/plain'] + metadata: {}, + output_type: 'display_data' }, - { - output: { - data: { - 'application/vnd.jupyter.widget-view+json': 'some widget', - 'text/plain': 'some text' - }, - metadata: {}, - output_type: 'display_data' + expectedMimeTypesOrder: ['text/latex', 'text/plain'] + }, + { + output: { + data: { + 'application/vnd.jupyter.widget-view+json': 'some widget', + 'text/plain': 'some text' }, - expectedMimeTypesOrder: ['application/vnd.jupyter.widget-view+json', 'text/plain'] + metadata: {}, + output_type: 'display_data' }, - { - output: { - data: { - 'text/plain': 'some text', - 'image/svg+xml': 'some svg', - 'image/png': 'some png' - }, - metadata: {}, - output_type: 'display_data' + expectedMimeTypesOrder: ['application/vnd.jupyter.widget-view+json', 'text/plain'] + }, + { + output: { + data: { + 'text/plain': 'some text', + 'image/svg+xml': 'some svg', + 'image/png': 'some png' }, - expectedMimeTypesOrder: ['image/png', 'image/svg+xml', 'text/plain'] - } - ]; + metadata: {}, + output_type: 'display_data' + }, + expectedMimeTypesOrder: ['image/png', 'image/svg+xml', 'text/plain'] + } + ]; - dataAndExpectedOrder.forEach(({ output, expectedMimeTypesOrder }) => { - const sortedOutputs = jupyterCellOutputToCellOutput(output); - const mimeTypes = sortedOutputs.items.map((item) => item.mime).join(','); - assert.equal(mimeTypes, expectedMimeTypesOrder.join(',')); - }); + dataAndExpectedOrder.forEach(({ output, expectedMimeTypesOrder }) => { + const sortedOutputs = jupyterCellOutputToCellOutput(output); + const mimeTypes = sortedOutputs.items.map((item) => item.mime).join(','); + assert.equal(mimeTypes, expectedMimeTypesOrder.join(',')); }); }); }); diff --git a/extensions/ipynb/yarn.lock b/extensions/ipynb/yarn.lock deleted file mode 100644 index fa950f66b64..00000000000 --- a/extensions/ipynb/yarn.lock +++ /dev/null @@ -1,43 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@enonic/fnv-plus@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@enonic/fnv-plus/-/fnv-plus-1.3.0.tgz#be65a7b128a3b544f60aea3ef978d938e85869f3" - integrity sha512-BCN9uNWH8AmiP7BXBJqEinUY9KXalmRzo+L0cB/mQsmFfzODxwQrbvxCHXUNH2iP+qKkWYtB4vyy8N62PViMFw== - -"@jupyterlab/nbformat@^3.2.9": - version "3.4.3" - resolved "https://registry.yarnpkg.com/@jupyterlab/nbformat/-/nbformat-3.4.3.tgz#cbab1bf507677b7f0f309d8353fc83fe5a973c82" - integrity sha512-i/yADrwhhAJJCUOTa+fEBMyJO7fvX9Y73I0B7V6dQhGcrmrEKLC3wk4yOo63+jRntd5+dupbiOtz3w1ncIXwIA== - dependencies: - "@lumino/coreutils" "^1.11.0" - -"@lumino/coreutils@^1.11.0": - version "1.12.0" - resolved "https://registry.yarnpkg.com/@lumino/coreutils/-/coreutils-1.12.0.tgz#fbdef760f736eaf2bd396a5c6fc3a68a4b449b15" - integrity sha512-DSglh4ylmLi820CNx9soJmDJCpUgymckdWeGWuN0Ash5g60oQvrQDfosVxEhzmNvtvXv45WZEqSBzDP6E5SEmQ== - -"@types/linkify-it@*": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9" - integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA== - -"@types/markdown-it@12.2.3": - version "12.2.3" - resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-12.2.3.tgz#0d6f6e5e413f8daaa26522904597be3d6cd93b51" - integrity sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ== - dependencies: - "@types/linkify-it" "*" - "@types/mdurl" "*" - -"@types/mdurl@*": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" - integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== - -detect-indent@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" - integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== diff --git a/extensions/jake/.vscodeignore b/extensions/jake/.vscodeignore index 36e8b0714fa..360fcfd1c99 100644 --- a/extensions/jake/.vscodeignore +++ b/extensions/jake/.vscodeignore @@ -2,4 +2,4 @@ src/** tsconfig.json out/** extension.webpack.config.js -yarn.lock \ No newline at end of file +package-lock.json diff --git a/extensions/jake/package-lock.json b/extensions/jake/package-lock.json new file mode 100644 index 00000000000..ff50538c25e --- /dev/null +++ b/extensions/jake/package-lock.json @@ -0,0 +1,34 @@ +{ + "name": "jake", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "jake", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "*" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/extensions/jake/src/main.ts b/extensions/jake/src/main.ts index 33d39e288a4..a2511dc62df 100644 --- a/extensions/jake/src/main.ts +++ b/extensions/jake/src/main.ts @@ -290,7 +290,7 @@ class TaskDetector { if (this.detectors.size === 0) { return Promise.resolve([]); } else if (this.detectors.size === 1) { - return this.detectors.values().next().value.getTasks(); + return this.detectors.values().next().value!.getTasks(); } else { const promises: Promise[] = []; for (const detector of this.detectors.values()) { @@ -312,7 +312,7 @@ class TaskDetector { if (this.detectors.size === 0) { return undefined; } else if (this.detectors.size === 1) { - return this.detectors.values().next().value.getTask(task); + return this.detectors.values().next().value!.getTask(task); } else { if ((task.scope === vscode.TaskScope.Workspace) || (task.scope === vscode.TaskScope.Global)) { // Not supported, we don't have enough info to create the task. diff --git a/extensions/jake/yarn.lock b/extensions/jake/yarn.lock deleted file mode 100644 index 1f4b6c2e8b4..00000000000 --- a/extensions/jake/yarn.lock +++ /dev/null @@ -1,15 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/extensions/java/yarn.lock b/extensions/java/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/java/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/javascript/snippets/javascript.code-snippets b/extensions/javascript/snippets/javascript.code-snippets index 9448fd140d9..5bf6aa5edee 100644 --- a/extensions/javascript/snippets/javascript.code-snippets +++ b/extensions/javascript/snippets/javascript.code-snippets @@ -1,16 +1,79 @@ { - "define module": { - "prefix": "define", - "body": [ - "define([", - "\t'require',", - "\t'${1:dependency}'", - "], function(require, ${2:factory}) {", - "\t'use strict';", + "Constructor": { + "prefix": "ctor", + "body": [ + "/**", + " *", + " */", + "constructor() {", + "\tsuper();", "\t$0", - "});" + "}" + ], + "description": "Constructor" + }, + "Class Definition": { + "prefix": "class", + "isFileTemplate": true, + "body": [ + "class ${1:name} {", + "\tconstructor(${2:parameters}) {", + "\t\t$0", + "\t}", + "}" + ], + "description": "Class Definition" + }, + "Method Definition": { + "prefix": "method", + "body": [ + "/**", + " * ", + " */", + "${1:name}() {", + "\t$0", + "}" + ], + "description": "Method Definition" + }, + "Import Statement": { + "prefix": "import", + "body": [ + "import { $0 } from \"${1:module}\";" + ], + "description": "Import external module" + }, + "Log to the console": { + "prefix": "log", + "body": [ + "console.log($1);", + "$0" + ], + "description": "Log to the console" + }, + "Log warning to console": { + "prefix": "warn", + "body": [ + "console.warn($1);", + "$0" + ], + "description": "Log warning to the console" + }, + "Log error to console": { + "prefix": "error", + "body": [ + "console.error($1);", + "$0" + ], + "description": "Log error to the console" + }, + "Throw Exception": { + "prefix": "throw", + "body": [ + "throw new Error(\"$1\");", + "$0" ], - "description": "define module" + "description": "Throw Exception" }, "For Loop": { "prefix": "for", @@ -22,20 +85,20 @@ ], "description": "For Loop" }, - "For-Each Loop": { - "prefix": "foreach", + "For-Each Loop using =>": { + "prefix": "foreach =>", "body": [ "${1:array}.forEach(${2:element} => {", "\t$TM_SELECTED_TEXT$0", "});" ], - "description": "For-Each Loop" + "description": "For-Each Loop using =>" }, "For-In Loop": { "prefix": "forin", "body": [ "for (const ${1:key} in ${2:object}) {", - "\tif (Object.hasOwnProperty.call(${2:object}, ${1:key})) {", + "\tif (Object.prototype.hasOwnProperty.call(${2:object}, ${1:key})) {", "\t\tconst ${3:element} = ${2:object}[${1:key}];", "\t\t$TM_SELECTED_TEXT$0", "\t}", @@ -46,12 +109,21 @@ "For-Of Loop": { "prefix": "forof", "body": [ - "for (const ${1:iterator} of ${2:object}) {", + "for (const ${1:element} of ${2:object}) {", "\t$TM_SELECTED_TEXT$0", "}" ], "description": "For-Of Loop" }, + "For-Await-Of Loop": { + "prefix": "forawaitof", + "body": [ + "for await (const ${1:element} of ${2:object}) {", + "\t$TM_SELECTED_TEXT$0", + "}" + ], + "description": "For-Await-Of Loop" + }, "Function Statement": { "prefix": "function", "body": [ @@ -149,13 +221,6 @@ ], "description": "Set Interval Function" }, - "Import Statement": { - "prefix": "import", - "body": [ - "import { $0 } from \"${1:module}\";" - ], - "description": "Import external module" - }, "Region Start": { "prefix": "#region", "body": [ @@ -170,34 +235,31 @@ ], "description": "Folding Region End" }, - "Log to the console": { - "prefix": "log", - "body": [ - "console.log($1);" - ], - "description": "Log to the console" - }, - "Log warning to console": { - "prefix": "warn", + "new Promise": { + "prefix": "newpromise", "body": [ - "console.warn($1);" + "new Promise((resolve, reject) => {", + "\t$TM_SELECTED_TEXT$0", + "})" ], - "description": "Log warning to the console" + "description": "Create a new Promise" }, - "Log error to console": { - "prefix": "error", + "Async Function Statement": { + "prefix": "async function", "body": [ - "console.error($1);" + "async function ${1:name}(${2:params}) {", + "\t$TM_SELECTED_TEXT$0", + "}" ], - "description": "Log error to the console" + "description": "Async Function Statement" }, - "new Promise": { - "prefix": "newpromise", + "Async Function Expression": { + "prefix": "async arrow function", "body": [ - "new Promise((resolve, reject) => {", + "async (${1:params}) => {", "\t$TM_SELECTED_TEXT$0", - "})" + "}" ], - "description": "Create a new Promise" + "description": "Async Function Expression" } } diff --git a/extensions/javascript/yarn.lock b/extensions/javascript/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/javascript/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/json-language-features/.vscodeignore b/extensions/json-language-features/.vscodeignore index 1ebee75dfd3..807b3e4cbae 100644 --- a/extensions/json-language-features/.vscodeignore +++ b/extensions/json-language-features/.vscodeignore @@ -10,10 +10,10 @@ server/tsconfig.json server/test/** server/bin/** server/build/** -server/yarn.lock +server/package-lock.json server/.npmignore server/README.md -yarn.lock +package-lock.json CONTRIBUTING.md server/extension.webpack.config.js extension.webpack.config.js diff --git a/extensions/json-language-features/CONTRIBUTING.md b/extensions/json-language-features/CONTRIBUTING.md index f0b0aa0ec09..2e0b6c084d2 100644 --- a/extensions/json-language-features/CONTRIBUTING.md +++ b/extensions/json-language-features/CONTRIBUTING.md @@ -1,12 +1,12 @@ ## Setup - Clone [microsoft/vscode](https://github.com/microsoft/vscode) -- Run `yarn` at `/`, this will install +- Run `npm i` at `/`, this will install - Dependencies for `/extension/json-language-features/` - Dependencies for `/extension/json-language-features/server/` - devDependencies such as `gulp` - Open `/extensions/json-language-features/` as the workspace in VS Code -- In `/extensions/json-language-features/` run `yarn compile`(or `yarn watch`) to build the client and server +- In `/extensions/json-language-features/` run `npm run compile`(or `npm run watch`) to build the client and server - Run the [`Launch Extension`](https://github.com/microsoft/vscode/blob/master/extensions/json-language-features/.vscode/launch.json) debug target in the Debug View. This will: - Launch a new VS Code instance with the `json-language-features` extension loaded - Open a `.json` file to activate the extension. The extension will start the JSON language server process. @@ -29,13 +29,13 @@ However, within this extension, you can run a development version of `vscode-jso #### Linking `vscode-json-languageservice` in `json-language-features/server/` - Clone [microsoft/vscode-json-languageservice](https://github.com/microsoft/vscode-json-languageservice) -- Run `npm install` in `vscode-json-languageservice` +- Run `npm i` in `vscode-json-languageservice` - Run `npm link` in `vscode-json-languageservice`. This will compile and link `vscode-json-languageservice` -- In `json-language-features/server/`, run `yarn link vscode-json-languageservice` +- In `json-language-features/server/`, run `npm link vscode-json-languageservice` #### Testing the development version of `vscode-json-languageservice` - Open both `vscode-json-languageservice` and this extension in two windows or with a single window with the[multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) feature. -- Run `yarn watch` at `json-languagefeatures/server/` to recompile this extension with the linked version of `vscode-json-languageservice` +- Run `npm run watch` at `json-languagefeatures/server/` to recompile this extension with the linked version of `vscode-json-languageservice` - Make some changes in `vscode-json-languageservice` - Now when you run `Launch Extension` debug target, the launched instance will use your development version of `vscode-json-languageservice`. You can interactively test the language features. diff --git a/extensions/json-language-features/client/src/browser/jsonClientMain.ts b/extensions/json-language-features/client/src/browser/jsonClientMain.ts index f78f494d727..91ed937fe6f 100644 --- a/extensions/json-language-features/client/src/browser/jsonClientMain.ts +++ b/extensions/json-language-features/client/src/browser/jsonClientMain.ts @@ -8,12 +8,6 @@ import { LanguageClientOptions } from 'vscode-languageclient'; import { startClient, LanguageClientConstructor, SchemaRequestService, AsyncDisposable, languageServerDescription } from '../jsonClient'; import { LanguageClient } from 'vscode-languageclient/browser'; -declare const Worker: { - new(stringUrl: string): any; -}; - -declare function fetch(uri: string, options: any): any; - let client: AsyncDisposable | undefined; // this method is called when vs code is activated @@ -24,7 +18,7 @@ export async function activate(context: ExtensionContext) { worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' }); const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => { - return new LanguageClient(id, name, clientOptions, worker); + return new LanguageClient(id, name, worker, clientOptions); }; const schemaRequests: SchemaRequestService = { diff --git a/extensions/json-language-features/client/src/jsonClient.ts b/extensions/json-language-features/client/src/jsonClient.ts index f892664d917..90aafc89b84 100644 --- a/extensions/json-language-features/client/src/jsonClient.ts +++ b/extensions/json-language-features/client/src/jsonClient.ts @@ -8,7 +8,8 @@ export type JSONLanguageStatus = { schemas: string[] }; import { workspace, window, languages, commands, LogOutputChannel, ExtensionContext, extensions, Uri, ColorInformation, Diagnostic, StatusBarAlignment, TextEditor, TextDocument, FormattingOptions, CancellationToken, FoldingRange, - ProviderResult, TextEdit, Range, Position, Disposable, CompletionItem, CompletionList, CompletionContext, Hover, MarkdownString, FoldingContext, DocumentSymbol, SymbolInformation, l10n + ProviderResult, TextEdit, Range, Position, Disposable, CompletionItem, CompletionList, CompletionContext, Hover, MarkdownString, FoldingContext, DocumentSymbol, SymbolInformation, l10n, + RelativePattern } from 'vscode'; import { LanguageClientOptions, RequestType, NotificationType, FormattingOptions as LSPFormattingOptions, DocumentDiagnosticReportKind, @@ -360,18 +361,29 @@ async function startClientWithParticipants(context: ExtensionContext, languagePa const schemaDocuments: { [uri: string]: boolean } = {}; // handle content request - client.onRequest(VSCodeContentRequest.type, (uriPath: string) => { + client.onRequest(VSCodeContentRequest.type, async (uriPath: string) => { const uri = Uri.parse(uriPath); + const uriString = uri.toString(); if (uri.scheme === 'untitled') { - return Promise.reject(new ResponseError(3, l10n.t('Unable to load {0}', uri.toString()))); + throw new ResponseError(3, l10n.t('Unable to load {0}', uriString)); } - if (uri.scheme !== 'http' && uri.scheme !== 'https') { - return workspace.openTextDocument(uri).then(doc => { - schemaDocuments[uri.toString()] = true; - return doc.getText(); - }, error => { - return Promise.reject(new ResponseError(2, error.toString())); - }); + if (uri.scheme === 'vscode') { + try { + runtime.logOutputChannel.info('read schema from vscode: ' + uriString); + ensureFilesystemWatcherInstalled(uri); + const content = await workspace.fs.readFile(uri); + return new TextDecoder().decode(content); + } catch (e) { + throw new ResponseError(5, e.toString(), e); + } + } else if (uri.scheme !== 'http' && uri.scheme !== 'https') { + try { + const document = await workspace.openTextDocument(uri); + schemaDocuments[uriString] = true; + return document.getText(); + } catch (e) { + throw new ResponseError(2, e.toString(), e); + } } else if (schemaDownloadEnabled) { if (runtime.telemetry && uri.authority === 'schema.management.azure.com') { /* __GDPR__ @@ -381,13 +393,15 @@ async function startClientWithParticipants(context: ExtensionContext, languagePa "schemaURL" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "The azure schema URL that was requested." } } */ - runtime.telemetry.sendTelemetryEvent('json.schema', { schemaURL: uriPath }); + runtime.telemetry.sendTelemetryEvent('json.schema', { schemaURL: uriString }); + } + try { + return await runtime.schemaRequests.getContent(uriString); + } catch (e) { + throw new ResponseError(4, e.toString()); } - return runtime.schemaRequests.getContent(uriPath).catch(e => { - return Promise.reject(new ResponseError(4, e.toString())); - }); } else { - return Promise.reject(new ResponseError(1, l10n.t('Downloading schemas is disabled through setting \'{0}\'', SettingIds.enableSchemaDownload))); + throw new ResponseError(1, l10n.t('Downloading schemas is disabled through setting \'{0}\'', SettingIds.enableSchemaDownload)); } }); @@ -415,15 +429,50 @@ async function startClientWithParticipants(context: ExtensionContext, languagePa schemaResolutionErrorStatusBarItem.hide(); } }; - - toDispose.push(workspace.onDidChangeTextDocument(e => handleContentChange(e.document.uri.toString()))); - toDispose.push(workspace.onDidCloseTextDocument(d => { - const uriString = d.uri.toString(); + const handleContentClosed = (uriString: string) => { if (handleContentChange(uriString)) { delete schemaDocuments[uriString]; } fileSchemaErrors.delete(uriString); + }; + + const watchers: Map = new Map(); + toDispose.push(new Disposable(() => { + for (const d of watchers.values()) { + d.dispose(); + } })); + + + const ensureFilesystemWatcherInstalled = (uri: Uri) => { + + const uriString = uri.toString(); + if (!watchers.has(uriString)) { + try { + const watcher = workspace.createFileSystemWatcher(new RelativePattern(uri, '*')); + const handleChange = (uri: Uri) => { + runtime.logOutputChannel.info('schema change detected ' + uri.toString()); + client.sendNotification(SchemaContentChangeNotification.type, uriString); + }; + const createListener = watcher.onDidCreate(handleChange); + const changeListener = watcher.onDidChange(handleChange); + const deleteListener = watcher.onDidDelete(() => { + const watcher = watchers.get(uriString); + if (watcher) { + watcher.dispose(); + watchers.delete(uriString); + } + }); + watchers.set(uriString, Disposable.from(watcher, createListener, changeListener, deleteListener)); + } catch { + runtime.logOutputChannel.info('Problem installing a file system watcher for ' + uriString); + } + } + }; + + toDispose.push(workspace.onDidChangeTextDocument(e => handleContentChange(e.document.uri.toString()))); + toDispose.push(workspace.onDidCloseTextDocument(d => handleContentClosed(d.uri.toString()))); + toDispose.push(window.onDidChangeActiveTextEditor(handleActiveEditorChange)); const handleRetryResolveSchemaCommand = () => { diff --git a/extensions/json-language-features/client/tsconfig.json b/extensions/json-language-features/client/tsconfig.json index aa51e4d0157..89e6a6c12b7 100644 --- a/extensions/json-language-features/client/tsconfig.json +++ b/extensions/json-language-features/client/tsconfig.json @@ -1,7 +1,10 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./out" + "outDir": "./out", + "lib": [ + "webworker" + ] }, "include": [ "src/**/*", diff --git a/extensions/json-language-features/package-lock.json b/extensions/json-language-features/package-lock.json new file mode 100644 index 00000000000..f3b999cc223 --- /dev/null +++ b/extensions/json-language-features/package-lock.json @@ -0,0 +1,263 @@ +{ + "name": "json-language-features", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "json-language-features", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@vscode/extension-telemetry": "^0.9.0", + "request-light": "^0.8.0", + "vscode-languageclient": "10.0.0-next.8" + }, + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "^1.77.0" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz", + "integrity": "sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz", + "integrity": "sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.0.3", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz", + "integrity": "sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz", + "integrity": "sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz", + "integrity": "sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz", + "integrity": "sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.0.4", + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", + "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.3.0.tgz", + "integrity": "sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz", + "integrity": "sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==" + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz", + "integrity": "sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.0.3", + "@microsoft/1ds-post-js": "^4.0.3", + "@microsoft/applicationinsights-web-basic": "^3.0.4" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c= sha512-9Y0g0Q8rmSt+H33DfKv7FOc3v+iRI+o1lbzt8jGcIosYW37IIW/2XVYq5NPdmaD5NQ59Nk26Kl/vZbwW9Fr8vg==" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/request-light": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.8.0.tgz", + "integrity": "sha512-bH6E4PMmsEXYrLX6Kr1vu+xI3HproB1vECAwaPSJeroLE1kpWE3HR27uB4icx+6YORu1ajqBJXxuedv8ZQg5Lw==" + }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/vscode-jsonrpc": { + "version": "9.0.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.4.tgz", + "integrity": "sha512-zSVIr58lJSMYKIsZ5P7GtBbv1eEx25eNyOf0NmEzxmn1GhUNJAVAb5hkA1poKUwj1FRMwN6CeyWxZypmr8SsQQ==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageclient": { + "version": "10.0.0-next.8", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-10.0.0-next.8.tgz", + "integrity": "sha512-D9inIHgqKayO9Tv0MeLb3XIL76yTuWmKdHqcGZKzjtQrMGJgASJDYWTapu+yAjEpDp0gmVOaCYyIlLB86ncDoQ==", + "dependencies": { + "minimatch": "^9.0.3", + "semver": "^7.6.0", + "vscode-languageserver-protocol": "3.17.6-next.6" + }, + "engines": { + "vscode": "^1.89.0" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.6-next.6", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.6.tgz", + "integrity": "sha512-naxM9kc/phpl0kAFNVPejMUWUtzFXdPYY/BtQTYtfbBbHf8sceHOrKkmf6yynZRu1A4oFtRZNqV3wyFRTWqUHw==", + "dependencies": { + "vscode-jsonrpc": "9.0.0-next.4", + "vscode-languageserver-types": "3.17.6-next.4" + } + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.6-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.4.tgz", + "integrity": "sha512-SeJTpH/S14EbxOAVaOUoGVqPToqpRTld5QO5Ghig3AlbFJTFF9Wu7srHMfa85L0SX1RYAuuCSFKJVVCxDIk1/Q==" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/extensions/json-language-features/package.json b/extensions/json-language-features/package.json index f86470429a4..e19541b7631 100644 --- a/extensions/json-language-features/package.json +++ b/extensions/json-language-features/package.json @@ -29,7 +29,7 @@ "scripts": { "compile": "npx gulp compile-extension:json-language-features-client compile-extension:json-language-features-server", "watch": "npx gulp watch-extension:json-language-features-client watch-extension:json-language-features-server", - "install-client-next": "yarn add vscode-languageclient@next" + "install-client-next": "npm install vscode-languageclient@next" }, "categories": [ "Programming Languages" @@ -162,8 +162,8 @@ }, "dependencies": { "@vscode/extension-telemetry": "^0.9.0", - "request-light": "^0.7.0", - "vscode-languageclient": "^10.0.0-next.5" + "request-light": "^0.8.0", + "vscode-languageclient": "10.0.0-next.8" }, "devDependencies": { "@types/node": "20.x" diff --git a/extensions/json-language-features/server/.npmignore b/extensions/json-language-features/server/.npmignore index 3032fe8b26f..960a01cc7b5 100644 --- a/extensions/json-language-features/server/.npmignore +++ b/extensions/json-language-features/server/.npmignore @@ -5,6 +5,6 @@ src/ test/ tsconfig.json .gitignore -yarn.lock +package-lock.json extension.webpack.config.js -vscode-json-languageserver-*.tgz \ No newline at end of file +vscode-json-languageserver-*.tgz diff --git a/extensions/json-language-features/server/package-lock.json b/extensions/json-language-features/server/package-lock.json new file mode 100644 index 00000000000..1a5e567c9b8 --- /dev/null +++ b/extensions/json-language-features/server/package-lock.json @@ -0,0 +1,127 @@ +{ + "name": "vscode-json-languageserver", + "version": "1.3.4", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vscode-json-languageserver", + "version": "1.3.4", + "license": "MIT", + "dependencies": { + "@vscode/l10n": "^0.0.18", + "jsonc-parser": "^3.3.1", + "request-light": "^0.8.0", + "vscode-json-languageservice": "^5.4.1", + "vscode-languageserver": "10.0.0-next.6", + "vscode-uri": "^3.0.8" + }, + "bin": { + "vscode-json-languageserver": "bin/vscode-json-languageserver" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "20.x" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@types/mocha": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.12.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.5.tgz", + "integrity": "sha512-BD+BjQ9LS/D8ST9p5uqBxghlN+S42iuNxjsUGjeZobe/ciXzk2qb1B6IXc6AnRLS+yFJRpN2IPEHMzwspfDJNw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@vscode/l10n": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", + "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" + }, + "node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==" + }, + "node_modules/request-light": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.8.0.tgz", + "integrity": "sha512-bH6E4PMmsEXYrLX6Kr1vu+xI3HproB1vECAwaPSJeroLE1kpWE3HR27uB4icx+6YORu1ajqBJXxuedv8ZQg5Lw==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/vscode-json-languageservice": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-5.4.1.tgz", + "integrity": "sha512-5czFGNyVPxz3ZJYl8R3a3SuIj5gjhmGF4Wv05MRPvD4DEnHK6b8km4VbNMJNHBlTCh7A0aHzUbPVzo+0C18mCA==", + "dependencies": { + "@vscode/l10n": "^0.0.18", + "jsonc-parser": "^3.3.1", + "vscode-languageserver-textdocument": "^1.0.12", + "vscode-languageserver-types": "^3.17.5", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/vscode-jsonrpc": { + "version": "9.0.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.4.tgz", + "integrity": "sha512-zSVIr58lJSMYKIsZ5P7GtBbv1eEx25eNyOf0NmEzxmn1GhUNJAVAb5hkA1poKUwj1FRMwN6CeyWxZypmr8SsQQ==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "10.0.0-next.6", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-10.0.0-next.6.tgz", + "integrity": "sha512-0Lh1nhQfSxo5Ob+ayYO1QTIsDix2/Lc72Urm1KZrCFxK5zIFYaEh3QFeM9oZih4Rzs0ZkQPXXnoHtpvs5GT+Zw==", + "dependencies": { + "vscode-languageserver-protocol": "3.17.6-next.6" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.6-next.6", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.6.tgz", + "integrity": "sha512-naxM9kc/phpl0kAFNVPejMUWUtzFXdPYY/BtQTYtfbBbHf8sceHOrKkmf6yynZRu1A4oFtRZNqV3wyFRTWqUHw==", + "dependencies": { + "vscode-jsonrpc": "9.0.0-next.4", + "vscode-languageserver-types": "3.17.6-next.4" + } + }, + "node_modules/vscode-languageserver-protocol/node_modules/vscode-languageserver-types": { + "version": "3.17.6-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.4.tgz", + "integrity": "sha512-SeJTpH/S14EbxOAVaOUoGVqPToqpRTld5QO5Ghig3AlbFJTFF9Wu7srHMfa85L0SX1RYAuuCSFKJVVCxDIk1/Q==" + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" + } + } +} diff --git a/extensions/json-language-features/server/package.json b/extensions/json-language-features/server/package.json index 6134fb4224d..48a6547f1d4 100644 --- a/extensions/json-language-features/server/package.json +++ b/extensions/json-language-features/server/package.json @@ -13,10 +13,10 @@ "main": "./out/node/jsonServerMain", "dependencies": { "@vscode/l10n": "^0.0.18", - "jsonc-parser": "^3.2.1", - "request-light": "^0.7.0", - "vscode-json-languageservice": "^5.3.11", - "vscode-languageserver": "^10.0.0-next.3", + "jsonc-parser": "^3.3.1", + "request-light": "^0.8.0", + "vscode-json-languageservice": "^5.4.1", + "vscode-languageserver": "10.0.0-next.6", "vscode-uri": "^3.0.8" }, "devDependencies": { @@ -28,10 +28,10 @@ "compile": "npx gulp compile-extension:json-language-features-server", "watch": "npx gulp watch-extension:json-language-features-server", "clean": "../../../node_modules/.bin/rimraf out", - "install-service-next": "yarn add vscode-json-languageservice@next", - "install-service-local": "yarn link vscode-json-languageservice", - "install-server-next": "yarn add vscode-languageserver@next", - "install-server-local": "yarn link vscode-languageserver-server", + "install-service-next": "npm install vscode-json-languageservice@next", + "install-service-local": "npm link vscode-json-languageservice", + "install-server-next": "npm install vscode-languageserver@next", + "install-server-local": "npm link vscode-languageserver-server", "version": "git commit -m \"JSON Language Server $npm_package_version\" package.json" } } diff --git a/extensions/json-language-features/server/yarn.lock b/extensions/json-language-features/server/yarn.lock deleted file mode 100644 index 669e823497d..00000000000 --- a/extensions/json-language-features/server/yarn.lock +++ /dev/null @@ -1,86 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/mocha@^9.1.1": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" - integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== - -"@types/node@20.x": - version "20.12.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.5.tgz#74c4f31ab17955d0b5808cdc8fd2839526ad00b3" - integrity sha512-BD+BjQ9LS/D8ST9p5uqBxghlN+S42iuNxjsUGjeZobe/ciXzk2qb1B6IXc6AnRLS+yFJRpN2IPEHMzwspfDJNw== - dependencies: - undici-types "~5.26.4" - -"@vscode/l10n@^0.0.18": - version "0.0.18" - resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.18.tgz#916d3a5e960dbab47c1c56f58a7cb5087b135c95" - integrity sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ== - -jsonc-parser@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz#031904571ccf929d7670ee8c547545081cb37f1a" - integrity sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA== - -request-light@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/request-light/-/request-light-0.7.0.tgz#885628bb2f8040c26401ebf258ec51c4ae98ac2a" - integrity sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -vscode-json-languageservice@^5.3.11: - version "5.3.11" - resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-5.3.11.tgz#71dbc56e9b1d07a57aa6a3d5569c8b7f2c05ca05" - integrity sha512-WYS72Ymria3dn8ZbjtBbt5K71m05wY1Q6hpXV5JxUT0q75Ts0ljLmnZJAVpx8DjPgYbFD+Z8KHpWh2laKLUCtQ== - dependencies: - "@vscode/l10n" "^0.0.18" - jsonc-parser "^3.2.1" - vscode-languageserver-textdocument "^1.0.11" - vscode-languageserver-types "^3.17.5" - vscode-uri "^3.0.8" - -vscode-jsonrpc@9.0.0-next.2: - version "9.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.2.tgz#29e9741c742c80329bba1c60ce38fd014651ba80" - integrity sha512-meIaXAgChCHzWy45QGU8YpCNyqnZQ/sYeCj32OLDDbUYsCF7AvgpdXx3nnZn9yzr8ed0Od9bW+NGphEmXsqvIQ== - -vscode-languageserver-protocol@3.17.6-next.4: - version "3.17.6-next.4" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.4.tgz#3c56f6eb588bb42fccc0ac54a0d5daf2d02f0a1b" - integrity sha512-/2bleKBxZLyRObS4mkpaWlVI9xGiUqMVmh/ztZ2vL4uP2XyIpraT45JBpn9AtXr0alqKJPKLuKr+/qcYULvm/w== - dependencies: - vscode-jsonrpc "9.0.0-next.2" - vscode-languageserver-types "3.17.6-next.3" - -vscode-languageserver-textdocument@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz#0822a000e7d4dc083312580d7575fe9e3ba2e2bf" - integrity sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA== - -vscode-languageserver-types@3.17.6-next.3: - version "3.17.6-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.3.tgz#f71d6c57f18d921346cfe0c227aabd72eb8cd2f0" - integrity sha512-l5kNFXFRQGuzriXpuBqFpRmkf6f6A4VoU3h95OsVkqIOoi1k7KbwSo600cIdsKSJWrPg/+vX+QMPcMw1oI7ItA== - -vscode-languageserver-types@^3.17.5: - version "3.17.5" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz#3273676f0cf2eab40b3f44d085acbb7f08a39d8a" - integrity sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg== - -vscode-languageserver@^10.0.0-next.3: - version "10.0.0-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-10.0.0-next.3.tgz#a63c5ea9fab1be93d7732ab0fdc18c9b37956e07" - integrity sha512-4x1qHImf6ePji4+8PX43lnBCBfBNdi2jneGX2k5FswJhx/cxaYYmusShmmtO/clyL1iurxJacrQoXfw9+ikhvg== - dependencies: - vscode-languageserver-protocol "3.17.6-next.4" - -vscode-uri@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" - integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== diff --git a/extensions/json-language-features/yarn.lock b/extensions/json-language-features/yarn.lock deleted file mode 100644 index b7ca937103a..00000000000 --- a/extensions/json-language-features/yarn.lock +++ /dev/null @@ -1,187 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@microsoft/1ds-core-js@4.0.3", "@microsoft/1ds-core-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz#c8a92c623745a9595e06558a866658480c33bdf9" - integrity sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/1ds-post-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz#cfcb20bb23fb6215d3f0732f60f5b7df3e624f86" - integrity sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ== - dependencies: - "@microsoft/1ds-core-js" "4.0.3" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-channel-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz#247b6fe2158fad9826cbcdf7304f885766b36624" - integrity sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A== - dependencies: - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-common@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz#c4aa53ba343f5b3c7fbf54cddd3c86a5bdcd95dc" - integrity sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-core-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz#008308b786930d94a1de8a1fbb4af0351b74653e" - integrity sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g== - dependencies: - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-shims@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f" - integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@microsoft/applicationinsights-web-basic@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz#9a23323276b4a5a0dc6a352e2de5d75e3c16b534" - integrity sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ== - dependencies: - "@microsoft/applicationinsights-channel-js" "3.0.4" - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/dynamicproto-js@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6" - integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@nevware21/ts-async@>= 0.3.0 < 2.x": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c" - integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA== - dependencies: - "@nevware21/ts-utils" ">= 0.10.0 < 2.x" - -"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.10.1 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7" - integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg== - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@vscode/extension-telemetry@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz#8c6c61e253ff304f46045f04edd60059b144417a" - integrity sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ== - dependencies: - "@microsoft/1ds-core-js" "^4.0.3" - "@microsoft/1ds-post-js" "^4.0.3" - "@microsoft/applicationinsights-web-basic" "^3.0.4" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -minimatch@^9.0.3: - version "9.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" - integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== - dependencies: - brace-expansion "^2.0.1" - -request-light@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/request-light/-/request-light-0.7.0.tgz#885628bb2f8040c26401ebf258ec51c4ae98ac2a" - integrity sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q== - -semver@^7.6.0: - version "7.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" - integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== - dependencies: - lru-cache "^6.0.0" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -vscode-jsonrpc@9.0.0-next.2: - version "9.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.2.tgz#29e9741c742c80329bba1c60ce38fd014651ba80" - integrity sha512-meIaXAgChCHzWy45QGU8YpCNyqnZQ/sYeCj32OLDDbUYsCF7AvgpdXx3nnZn9yzr8ed0Od9bW+NGphEmXsqvIQ== - -vscode-languageclient@^10.0.0-next.5: - version "10.0.0-next.5" - resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-10.0.0-next.5.tgz#7431d88255a5fd99e9423659ac484b1f968200f3" - integrity sha512-JIf1WE7fvV0RElFM062bAummI433vcxuFwqoYAp+1zTVhta/jznxkTz1zs3Hbj2tiDfclf0TZ0qCxflAP1mY2Q== - dependencies: - minimatch "^9.0.3" - semver "^7.6.0" - vscode-languageserver-protocol "3.17.6-next.4" - -vscode-languageserver-protocol@3.17.6-next.4: - version "3.17.6-next.4" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.6-next.4.tgz#3c56f6eb588bb42fccc0ac54a0d5daf2d02f0a1b" - integrity sha512-/2bleKBxZLyRObS4mkpaWlVI9xGiUqMVmh/ztZ2vL4uP2XyIpraT45JBpn9AtXr0alqKJPKLuKr+/qcYULvm/w== - dependencies: - vscode-jsonrpc "9.0.0-next.2" - vscode-languageserver-types "3.17.6-next.3" - -vscode-languageserver-types@3.17.6-next.3: - version "3.17.6-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.3.tgz#f71d6c57f18d921346cfe0c227aabd72eb8cd2f0" - integrity sha512-l5kNFXFRQGuzriXpuBqFpRmkf6f6A4VoU3h95OsVkqIOoi1k7KbwSo600cIdsKSJWrPg/+vX+QMPcMw1oI7ItA== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/extensions/json/yarn.lock b/extensions/json/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/json/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/julia/cgmanifest.json b/extensions/julia/cgmanifest.json index 9daaee1fdd8..b5d8a03be09 100644 --- a/extensions/julia/cgmanifest.json +++ b/extensions/julia/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "JuliaEditorSupport/atom-language-julia", "repositoryUrl": "https://github.com/JuliaEditorSupport/atom-language-julia", - "commitHash": "663bf8d943fd8440f4ae7565f73327dd616bf191" + "commitHash": "c686684f18153687886e7d19c1bfc3a33076b1ab" } }, "license": "MIT", - "version": "0.22.1" + "version": "0.23.0" } ], "version": 1 diff --git a/extensions/julia/syntaxes/julia.tmLanguage.json b/extensions/julia/syntaxes/julia.tmLanguage.json index 35a4ea7d927..f66fda97f70 100644 --- a/extensions/julia/syntaxes/julia.tmLanguage.json +++ b/extensions/julia/syntaxes/julia.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/JuliaEditorSupport/atom-language-julia/commit/663bf8d943fd8440f4ae7565f73327dd616bf191", + "version": "https://github.com/JuliaEditorSupport/atom-language-julia/commit/c686684f18153687886e7d19c1bfc3a33076b1ab", "name": "Julia", "scopeName": "source.julia", "comment": "This grammar is used by Atom (Oniguruma), GitHub (PCRE), and VSCode (Oniguruma),\nso all regexps must be compatible with both engines.\n\nSpecs:\n- https://github.com/kkos/oniguruma/blob/master/doc/RE\n- https://www.pcre.org/current/doc/html/", @@ -333,7 +333,7 @@ "name": "keyword.control.using.julia" }, { - "match": "(?<=\\w\\s)\\b(as)\\b(?=\\s\\w)", + "match": "(?<=\\S\\s+)\\b(as)\\b(?=\\s+\\S)", "name": "keyword.control.as.julia" }, { diff --git a/extensions/latex/cgmanifest.json b/extensions/latex/cgmanifest.json index b537c48ee8c..3c7203d5d2a 100644 --- a/extensions/latex/cgmanifest.json +++ b/extensions/latex/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "jlelong/vscode-latex-basics", "repositoryUrl": "https://github.com/jlelong/vscode-latex-basics", - "commitHash": "5d7c2a4e451a932b776f6d9342087be6a1e8c0a1" + "commitHash": "969429cb9230a63f9155987f069acd4234d10e1a" } }, "license": "MIT", diff --git a/extensions/latex/syntaxes/LaTeX.tmLanguage.json b/extensions/latex/syntaxes/LaTeX.tmLanguage.json index aad6c5c4bd9..bc97a73bda8 100644 --- a/extensions/latex/syntaxes/LaTeX.tmLanguage.json +++ b/extensions/latex/syntaxes/LaTeX.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/jlelong/vscode-latex-basics/commit/3d141a124a16558958e95c54267f7ca37986de6f", + "version": "https://github.com/jlelong/vscode-latex-basics/commit/969429cb9230a63f9155987f069acd4234d10e1a", "name": "LaTeX", "scopeName": "text.tex.latex", "patterns": [ @@ -94,7 +94,7 @@ "4": { "patterns": [ { - "include": "#optional-arg" + "include": "#optional-arg-bracket" } ] }, @@ -1900,7 +1900,7 @@ "3": { "patterns": [ { - "include": "#optional-arg" + "include": "#optional-arg-bracket" } ] }, @@ -1910,7 +1910,7 @@ "5": { "patterns": [ { - "include": "#optional-arg" + "include": "#optional-arg-bracket" } ] }, @@ -2368,7 +2368,7 @@ "3": { "patterns": [ { - "include": "#optional-arg" + "include": "#optional-arg-bracket" } ] }, @@ -2404,7 +2404,7 @@ "3": { "patterns": [ { - "include": "#optional-arg" + "include": "#optional-arg-bracket" } ] }, @@ -2562,7 +2562,7 @@ "name": "meta.scope.item.latex" }, { - "begin": "((\\\\)(?:[aA]uto|foot|full|no|ref|short|[tT]ext|[pP]aren|[sS]mart)?[cC]ite(?:al)?(?:p|s|t|author|year(?:par)?|title)?[ANP]*\\*?)((?:(?:\\([^\\)]*\\)){0,2}(?:\\[[^\\]]*\\]){0,2}\\{[\\p{Alphabetic}:.]*\\})*)(?:([<\\[])[^\\]<>]*([>\\]]))?(?:(\\[)[^\\]]*(\\]))?(\\{)", + "begin": "((\\\\)(?:[aA]uto|foot|full|no|ref|short|[tT]ext|[pP]aren|[sS]mart)?[cC]ite(?:al)?(?:p|s|t|author|year(?:par)?|title)?[ANP]*\\*?)((?:(?:\\([^\\)]*\\)){0,2}(?:\\[[^\\]]*\\]){0,2}\\{[\\p{Alphabetic}\\p{Number}_:.-]*\\})*)(<[^\\]<>]*>)?((?:\\[[^\\]]*\\])*)(\\{)", "captures": { "1": { "name": "keyword.control.cite.latex" @@ -2578,18 +2578,20 @@ ] }, "4": { - "name": "punctuation.definition.arguments.optional.begin.latex" + "patterns": [ + { + "include": "#optional-arg-angle-no-highlight" + } + ] }, "5": { - "name": "punctuation.definition.arguments.optional.end.latex" + "patterns": [ + { + "include": "#optional-arg-bracket-no-highlight" + } + ] }, "6": { - "name": "punctuation.definition.arguments.optional.begin.latex" - }, - "7": { - "name": "punctuation.definition.arguments.optional.end.latex" - }, - "8": { "name": "punctuation.definition.arguments.begin.latex" } }, @@ -2602,6 +2604,7 @@ "name": "meta.citation.latex", "patterns": [ { + "match": "((%).*)$", "captures": { "1": { "name": "comment.line.percentage.tex" @@ -2609,8 +2612,7 @@ "2": { "name": "punctuation.definition.comment.tex" } - }, - "match": "((%).*)$" + } }, { "match": "[\\p{Alphabetic}\\p{Number}:.-]+", @@ -2646,7 +2648,7 @@ ] }, { - "begin": "((\\\\)(?:\\w*[rR]ef\\*?))(\\{)", + "begin": "((\\\\)(?:\\w*[rR]ef\\*?))(?:\\[[^\\]]*\\])?(\\{)", "beginCaptures": { "1": { "name": "keyword.control.ref.latex" @@ -2740,7 +2742,7 @@ "3": { "patterns": [ { - "include": "#optional-arg" + "include": "#optional-arg-bracket" } ] }, @@ -2783,7 +2785,7 @@ "3": { "patterns": [ { - "include": "#optional-arg" + "include": "#optional-arg-bracket" } ] }, @@ -2820,7 +2822,7 @@ "3": { "patterns": [ { - "include": "#optional-arg" + "include": "#optional-arg-bracket" } ] }, @@ -2867,7 +2869,7 @@ "3": { "patterns": [ { - "include": "#optional-arg" + "include": "#optional-arg-bracket" } ] }, @@ -3048,7 +3050,7 @@ "name": "punctuation.definition.variable.latex" } }, - "match": "(\\\\)[cgl](?:[_\\p{Alphabetic}@]+)+_(?:bitset|clist|dim|fp|int|muskip|str|tl|bool|box|coffin|flag|fparray|intarray|ior|iow|prop|regex|seq)", + "match": "(\\\\)(?:[cgl]_+[_\\p{Alphabetic}@]+_[a-z]+|[qs]_[_\\p{Alphabetic}@]+[\\p{Alphabetic}@])", "name": "variable.other.latex3.latex" }, { @@ -3073,27 +3075,29 @@ { "captures": { "1": { - "name": "punctuation.definition.arguments.optional.begin.latex" + "patterns": [ + { + "include": "#optional-arg-parenthesis-no-highlight" + } + ] }, "2": { - "name": "punctuation.definition.arguments.optional.end.latex" + "patterns": [ + { + "include": "#optional-arg-bracket-no-highlight" + } + ] }, "3": { - "name": "punctuation.definition.arguments.optional.begin.latex" - }, - "4": { - "name": "punctuation.definition.arguments.optional.end.latex" - }, - "5": { "name": "punctuation.definition.arguments.begin.latex" }, - "6": { + "4": { "name": "constant.other.reference.citation.latex" }, - "7": { + "5": { "name": "punctuation.definition.arguments.end.latex" }, - "8": { + "6": { "patterns": [ { "include": "#autocites-arg" @@ -3101,7 +3105,7 @@ ] } }, - "match": "(?:(\\()[^\\)]*(\\))){0,2}(?:(\\[)[^\\]]*(\\])){0,2}(\\{)([\\p{Alphabetic}\\p{Number}:.]+)(\\})(.*)" + "match": "((?:\\([^\\)]*\\)){0,2})((?:\\[[^\\]]*\\]){0,2})(\\{)([\\p{Alphabetic}\\p{Number}_:.-]+)(\\})(.*)" } ] }, @@ -3148,7 +3152,7 @@ "match": "\\s*((\\\\)(?:begin|end))(\\{)([a-zA-Z]*\\*?)(\\})(?:(\\[)([^\\]]*)(\\])){,2}(?:(\\{)([^{}]*)(\\}))?" }, "definition-label": { - "begin": "((\\\\)label)((?:\\[[^\\[]*?\\])*)(\\{)", + "begin": "((\\\\)z?label)((?:\\[[^\\[]*?\\])*)(\\{)", "beginCaptures": { "1": { "name": "keyword.control.label.latex" @@ -3159,7 +3163,7 @@ "3": { "patterns": [ { - "include": "#optional-arg" + "include": "#optional-arg-bracket" } ] }, @@ -3222,7 +3226,7 @@ } ] }, - "optional-arg": { + "optional-arg-bracket": { "patterns": [ { "captures": { @@ -3240,6 +3244,73 @@ "name": "meta.parameter.optional.latex" } ] + }, + "optional-arg-parenthesis": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.arguments.optional.begin.latex" + }, + "2": { + "name": "variable.parameter.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.optional.end.latex" + } + }, + "match": "(\\()([^\\(]*?)(\\))", + "name": "meta.parameter.optional.latex" + } + ] + }, + "optional-arg-bracket-no-highlight": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.arguments.optional.begin.latex" + }, + "2": { + "name": "punctuation.definition.arguments.optional.end.latex" + } + }, + "match": "(\\[)[^\\[]*?(\\])", + "name": "meta.parameter.optional.latex" + } + ] + }, + "optional-arg-angle-no-highlight": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.arguments.optional.begin.latex" + }, + "2": { + "name": "punctuation.definition.arguments.optional.end.latex" + } + }, + "match": "(<)[^<]*?(>)", + "name": "meta.parameter.optional.latex" + } + ] + }, + "optional-arg-parenthesis-no-highlight": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.arguments.optional.begin.latex" + }, + "2": { + "name": "punctuation.definition.arguments.optional.end.latex" + } + }, + "match": "(\\()[^\\(]*?(\\))", + "name": "meta.parameter.optional.latex" + } + ] } } } \ No newline at end of file diff --git a/extensions/less/cgmanifest.json b/extensions/less/cgmanifest.json index caf908bbcc0..a3598df8739 100644 --- a/extensions/less/cgmanifest.json +++ b/extensions/less/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "language-less", "repositoryUrl": "https://github.com/radium-v/Better-Less", - "commitHash": "24047277622c245dbe9309f0004d0ccb8f02636f" + "commitHash": "63c0cba9792e49e255cce0f6dd03250fb30591e6" } }, "license": "MIT", diff --git a/extensions/less/syntaxes/less.tmLanguage.json b/extensions/less/syntaxes/less.tmLanguage.json index 2acac688385..b7e51e831a8 100644 --- a/extensions/less/syntaxes/less.tmLanguage.json +++ b/extensions/less/syntaxes/less.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/radium-v/Better-Less/commit/24047277622c245dbe9309f0004d0ccb8f02636f", + "version": "https://github.com/radium-v/Better-Less/commit/63c0cba9792e49e255cce0f6dd03250fb30591e6", "name": "Less", "scopeName": "source.css.less", "patterns": [ @@ -40,9 +40,17 @@ "match": "(?i:[-+]?(?:(?:\\d*\\.\\d+(?:[eE](?:[-+]?\\d+))*)|(?:[-+]?\\d+))(deg|grad|rad|turn))\\b", "name": "constant.numeric.less" }, + "arbitrary-repetition": { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repetition.less" + } + }, + "match": "\\s*(?:(,))" + }, "at-charset": { "begin": "\\s*((@)charset\\b)\\s*", - "captures": { + "beginCaptures": { "1": { "name": "keyword.control.at-rule.charset.less" }, @@ -58,9 +66,132 @@ } ] }, + "at-container": { + "begin": "(?=\\s*@container)", + "end": "\\s*(\\})", + "endCaptures": { + "1": { + "name": "punctuation.definition.block.end.less" + } + }, + "patterns": [ + { + "begin": "((@)container)", + "beginCaptures": { + "1": { + "name": "keyword.control.at-rule.container.less" + }, + "2": { + "name": "punctuation.definition.keyword.less" + }, + "3": { + "name": "support.constant.container.less" + } + }, + "end": "(?=\\{)", + "name": "meta.at-rule.container.less", + "patterns": [ + { + "begin": "\\s*(?=[^{;])", + "end": "\\s*(?=[{;])", + "patterns": [ + { + "match": "\\b(not|and|or)\\b", + "name": "keyword.operator.comparison.less" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.at-rule.container-query.less", + "patterns": [ + { + "captures": { + "1": { + "name": "support.type.property-name.less" + } + }, + "match": "\\b(aspect-ratio|block-size|height|inline-size|orientation|width)\\b", + "name": "support.constant.size-feature.less" + }, + { + "match": "((<|>)=?)|=|\\/", + "name": "keyword.operator.comparison.less" + }, + { + "match": ":", + "name": "punctuation.separator.key-value.less" + }, + { + "match": "portrait|landscape", + "name": "support.constant.property-value.less" + }, + { + "include": "#numeric-values" + }, + { + "match": "\\/", + "name": "keyword.operator.arithmetic.less" + }, + { + "include": "#var-function" + }, + { + "include": "#less-variables" + }, + { + "include": "#less-variable-interpolation" + } + ] + }, + { + "include": "#style-function" + }, + { + "match": "--|(?:-?(?:(?:[a-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R]))))(?:(?:[-\\da-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R])))*", + "name": "variable.parameter.container-name.css" + }, + { + "include": "#arbitrary-repetition" + }, + { + "include": "#less-variables" + } + ] + } + ] + }, + { + "begin": "\\s*(\\{)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.block.begin.less" + } + }, + "end": "(?=\\})", + "patterns": [ + { + "include": "#rule-list-body" + }, + { + "include": "$self" + } + ] + } + ] + }, "at-counter-style": { "begin": "\\s*((@)counter-style\\b)\\s+(?:(?i:\\b(decimal|none)\\b)|(-?(?:[[_a-zA-Z][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*))\\s*(?=\\{|$)", - "captures": { + "beginCaptures": { "1": { "name": "keyword.control.at-rule.counter-style.less" }, @@ -124,7 +255,7 @@ }, "at-font-face": { "begin": "\\s*((@)font-face)\\s*(?=\\{|$)", - "captures": { + "beginCaptures": { "1": { "name": "keyword.control.at-rule.font-face.less" }, @@ -211,7 +342,7 @@ ] }, "at-keyframes": { - "begin": "\\s*((@)(-webkit-|-moz-|-o-)?keyframes)(?=.*?\\{)", + "begin": "\\s*((@)keyframes)(?=.*?\\{)", "beginCaptures": { "1": { "name": "keyword.control.at-rule.keyframe.less" @@ -219,9 +350,6 @@ "2": { "name": "punctuation.definition.keyword.less" }, - "3": { - "name": "support.type.property-vendor.less" - }, "4": { "name": "support.constant.keyframe.less" } @@ -268,6 +396,9 @@ "patterns": [ { "include": "#keyframe-name" + }, + { + "include": "#arbitrary-repetition" } ] } @@ -383,6 +514,9 @@ { "include": "#at-charset" }, + { + "include": "#at-container" + }, { "include": "#at-counter-style" }, @@ -497,44 +631,6 @@ } ] }, - "at-viewport": { - "begin": "((@(-ms-)?)viewport)", - "beginCaptures": { - "1": { - "name": "keyword.control.at-rule.viewport.less" - }, - "2": { - "name": "punctuation.definition.keyword.less" - }, - "3": { - "name": "support.type.vendor-prefix.less" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.block.end.less" - } - }, - "name": "meta.at-rule.viewport.less", - "patterns": [ - { - "begin": "\\{", - "captures": { - "0": { - "name": "punctuation.definition.block.begin.less" - } - }, - "end": "(?=\\})", - "name": "meta.block.less", - "patterns": [ - { - "include": "#rule-list-body" - } - ] - } - ] - }, "attr-function": { "begin": "\\b(attr)(?=\\()", "beginCaptures": { @@ -615,6 +711,9 @@ { "include": "#filter-function" }, + { + "include": "#fit-content-function" + }, { "include": "#format-function" }, @@ -697,6 +796,9 @@ }, { "include": "#less-math" + }, + { + "include": "#relative-color" } ] } @@ -715,6 +817,7 @@ "name": "support.function.color.less" } }, + "comment": "rgb(), rgba()", "end": "\\)", "endCaptures": { "0": { @@ -738,9 +841,15 @@ { "include": "#less-variables" }, + { + "include": "#var-function" + }, { "include": "#comma-delimiter" }, + { + "include": "#value-separator" + }, { "include": "#percentage-type" }, @@ -752,12 +861,13 @@ ] }, { - "begin": "\\b(hs(l|v)a?|hwb)(?=\\()", + "begin": "\\b(hsla|hsl|hwb|oklab|oklch|lab|lch)(?=\\()", "beginCaptures": { "1": { "name": "support.function.color.less" } }, + "comment": "hsla, hsl, hwb, oklab, oklch, lab, lch", "end": "\\)", "endCaptures": { "0": { @@ -775,12 +885,18 @@ }, "end": "(?=\\))", "patterns": [ + { + "include": "#color-values" + }, { "include": "#less-strings" }, { "include": "#less-variables" }, + { + "include": "#var-function" + }, { "include": "#comma-delimiter" }, @@ -792,6 +908,47 @@ }, { "include": "#number-type" + }, + { + "include": "#calc-function" + }, + { + "include": "#value-separator" + } + ] + } + ] + }, + { + "begin": "\\b(light-dark)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.color.less" + } + }, + "comment": "light-dark()", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#color-values" + }, + { + "include": "#comma-delimiter" } ] } @@ -813,6 +970,9 @@ { "include": "#less-variables" }, + { + "include": "#var-function" + }, { "match": "\\b(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)\\b", "name": "support.constant.color.w3c-standard-color-name.less" @@ -833,6 +993,9 @@ }, "match": "(#)(\\h{3}|\\h{4}|\\h{6}|\\h{8})\\b", "name": "constant.other.color.rgb-value.less" + }, + { + "include": "#relative-color" } ] }, @@ -848,12 +1011,17 @@ "patterns": [ { "begin": "/\\*", - "captures": { + "beginCaptures": { "0": { "name": "punctuation.definition.comment.less" } }, "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.less" + } + }, "name": "comment.block.less" }, { @@ -902,6 +1070,9 @@ { "include": "#less-variables" }, + { + "include": "#var-function" + }, { "match": "(?:--(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))+|-?(?:[[_a-zA-Z][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*)", "name": "entity.other.counter-name.less" @@ -961,6 +1132,9 @@ { "include": "#less-variables" }, + { + "include": "#var-function" + }, { "include": "#literal-string" }, @@ -1030,12 +1204,16 @@ ] }, "cubic-bezier-function": { - "begin": "\\b(cubic-bezier)(?=\\()", + "begin": "\\b(cubic-bezier)(\\()", "beginCaptures": { - "0": { + "1": { "name": "support.function.timing.less" + }, + "2": { + "name": "punctuation.definition.group.begin.less" } }, + "contentName": "meta.group.less", "end": "\\)", "endCaptures": { "0": { @@ -1045,21 +1223,22 @@ "name": "meta.function-call.less", "patterns": [ { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.group.begin.less" - } - }, - "end": "(?=\\))", - "patterns": [ - { - "include": "#comma-delimiter" - }, - { - "include": "#number-type" - } - ] + "include": "#less-functions" + }, + { + "include": "#calc-function" + }, + { + "include": "#less-variables" + }, + { + "include": "#var-function" + }, + { + "include": "#comma-delimiter" + }, + { + "include": "#number-type" } ] }, @@ -1084,13 +1263,13 @@ "include": "#frequency-type" }, { - "include": "#length-type" + "include": "#time-type" }, { - "include": "#resolution-type" + "include": "#percentage-type" }, { - "include": "#time-type" + "include": "#length-type" } ] }, @@ -1275,18 +1454,61 @@ } ] }, - "format-function": { - "patterns": [ - { - "begin": "\\b(format)(?=\\()", - "beginCaptures": { - "0": { - "name": "support.function.format.less" - } - }, - "end": "\\)", - "endCaptures": { - "0": { + "fit-content-function": { + "begin": "\\b(fit-content)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.grid.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#less-variables" + }, + { + "include": "#var-function" + }, + { + "include": "#calc-function" + }, + { + "include": "#percentage-type" + }, + { + "include": "#length-type" + } + ] + } + ] + }, + "format-function": { + "patterns": [ + { + "begin": "\\b(format)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.format.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { "name": "punctuation.definition.group.end.less" } }, @@ -1319,6 +1541,10 @@ "match": "(?i:[-+]?(?:(?:\\d*\\.\\d+(?:[eE](?:[-+]?\\d+))*)|(?:[-+]?\\d+))(Hz|kHz))\\b", "name": "constant.numeric.less" }, + "global-property-values": { + "match": "\\b(?:initial|inherit|unset|revert-layer|revert)\\b", + "name": "support.constant.property-value.less" + }, "gradient-functions": { "patterns": [ { @@ -1348,6 +1574,9 @@ { "include": "#less-variables" }, + { + "include": "#var-function" + }, { "include": "#angle-type" }, @@ -1402,6 +1631,9 @@ { "include": "#less-variables" }, + { + "include": "#var-function" + }, { "include": "#color-values" }, @@ -1541,6 +1773,15 @@ } ] }, + "important": { + "captures": { + "1": { + "name": "punctuation.separator.less" + } + }, + "match": "(\\!)\\s*important", + "name": "keyword.other.important.less" + }, "integer-type": { "match": "(?:[-+]?\\d+)", "name": "constant.numeric.less" @@ -1560,13 +1801,21 @@ } }, "length-type": { - "captures": { - "1": { - "name": "keyword.other.unit.less" + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.other.unit.less" + } + }, + "match": "(?:[-+]?)(?:\\d+\\.\\d+|\\.?\\d+)(?:[eE][-+]?\\d+)?(em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|m|q|in|pt|pc|px|fr|dpi|dpcm|dppx|x)", + "name": "constant.numeric.less" + }, + { + "match": "\\b(?:[-+]?)0\\b", + "name": "constant.numeric.less" } - }, - "match": "0|(?i:[-+]?(?:(?:\\d*\\.\\d+(?:[eE](?:[-+]?\\d+))*)|(?:[-+]?\\d+))(em|ex|ch|rem|vw|vh|vmin|vmax|(c|m)?m|q|in|pt|pc|px|fr))\\b", - "name": "constant.numeric.less" + ] }, "less-boolean-function": { "begin": "\\b(boolean)(?=\\()", @@ -1628,6 +1877,9 @@ { "include": "#less-variables" }, + { + "include": "#var-function" + }, { "include": "#comma-delimiter" }, @@ -1684,6 +1936,7 @@ "name": "support.function.color-definition.less" } }, + "comment": "argb()", "end": "\\)", "endCaptures": { "0": { @@ -1704,12 +1957,68 @@ { "include": "#less-variables" }, + { + "include": "#var-function" + }, { "include": "#color-values" } ] } ] + }, + { + "begin": "\\b(hsva?)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.color.less" + } + }, + "comment": "hsva(), hsv()", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#integer-type" + }, + { + "include": "#percentage-type" + }, + { + "include": "#number-type" + }, + { + "include": "#less-strings" + }, + { + "include": "#less-variables" + }, + { + "include": "#var-function" + }, + { + "include": "#calc-function" + }, + { + "include": "#comma-delimiter" + } + ] + } + ] } ] }, @@ -2438,9 +2747,6 @@ { "include": "#less-variables" }, - { - "include": "#dimensions" - }, { "include": "#numeric-values" }, @@ -2732,14 +3038,6 @@ { "include": "#comma-delimiter" }, - { - "captures": { - "1": { - "name": "punctuation.terminator.rule.less" - } - }, - "match": "\\s*(;)|(?=[})])" - }, { "include": "#property-values" }, @@ -2747,17 +3045,14 @@ "include": "#rule-list-body" } ] - } - ] - }, - "less-number-units": { - "patterns": [ - { - "match": "\\b((c|m)?m|in|p(t|c)|m?s|g?rad|deg|turn)\\b", - "name": "keyword.other.unit.less" }, { - "match": "\\b(r?em|ex|ch|vw|vh|vmin|vmax|cm|mm|q|in|pt|pc|px|fr|s|ms|Hz|kHz|dpi|dpcm|dppx|deg|grad|rad|turn)\\b" + "captures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "match": "(;)|(?=[})])" } ] }, @@ -3143,16 +3438,23 @@ "name": "variable.other.readwrite.less" }, "less-variables": { - "captures": { - "1": { - "name": "punctuation.definition.variable.less" + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.variable.less" + }, + "2": { + "name": "support.other.variable.less" + } + }, + "match": "\\s*(@@?)([-\\w]+)", + "name": "variable.other.readwrite.less" }, - "2": { - "name": "support.other.variable.less" + { + "include": "#less-variable-interpolation" } - }, - "match": "\\s*(@@?)([-\\w]+)", - "name": "variable.other.readwrite.less" + ] }, "literal-string": { "patterns": [ @@ -3280,16 +3582,10 @@ "name": "meta.group.less", "patterns": [ { - "begin": "((-webkit-|-o-)?((min|max)-)?(-moz-)?(((device-)?(height|width|aspect-ratio|pixel-ratio))|(color(-index)?)|monochrome|resolution))|grid|scan|orientation\\s*(?=[:)])", + "begin": "(--|(?:-?(?:(?:[a-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R]))))(?:(?:[-\\da-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R])))*)\\s*(?=[:)])", "beginCaptures": { "0": { "name": "support.type.property-name.media.less" - }, - "2": { - "name": "support.type.vendor-prefix.less" - }, - "5": { - "name": "support.type.vendor-prefix.less" } }, "end": "(((\\+_?)?):)|(?=\\))", @@ -3360,6 +3656,9 @@ { "include": "#less-variables" }, + { + "include": "#var-function" + }, { "include": "#length-type" }, @@ -3375,7 +3674,7 @@ ] }, "number-type": { - "match": "[-+]?(?:(?:\\d*\\.\\d+(?:[eE](?:[-+]?\\d+))*)|(?:[-+]?\\d+))", + "match": "(?:[-+]?)(?:\\d+\\.\\d+|\\.?\\d+)(?:[eE][-+]?\\d+)?", "name": "constant.numeric.less" }, "numeric-values": { @@ -3397,7 +3696,7 @@ "name": "keyword.other.unit.less" } }, - "match": "[-+]?(?:(?:\\d*\\.\\d+(?:[eE](?:[-+]?\\d+))*)|(?:[-+]?\\d+))(%)", + "match": "(?:[-+]?)(?:\\d+\\.\\d+|\\.?\\d+)(?:[eE][-+]?\\d+)?(%)", "name": "constant.numeric.less" }, "property-list": { @@ -3421,11 +3720,65 @@ "property-value-constants": { "patterns": [ { - "match": "(?x)\\b(\n absolute|active|add\n |all(-(petite|small)-caps|-scroll)?\n |alpha(betic)?\n |alternate(-reverse)?\n |always|annotation|antialiased|at\n |auto(hiding-scrollbar)?\n |avoid(-column|-page|-region)?\n |background(-color|-image|-position|-size)?\n |backwards|balance|baseline|below|bevel|bicubic|bidi-override|blink\n |block(-line-height)?\n |blur\n |bold(er)?\n |border(-bottom|-left|-right|-top)?-(color|radius|width|style)\n |border-(bottom|top)-(left|right)-radius\n |border-image(-outset|-repeat|-slice|-source|-width)?\n |border(-bottom|-left|-right|-top|-collapse|-spacing|-box)?\n |both|bottom\n |box(-shadow)?\n |break-(all|word)\n |brightness\n |butt(on)?\n |capitalize\n |cent(er|ral)\n |char(acter-variant)?\n |cjk-ideographic|clip|clone|close-quote\n |closest-(corner|side)\n |col-resize|collapse\n |color(-stop|-burn|-dodge)?\n |column((-count|-gap|-reverse|-rule(-color|-width)?|-width)|s)?\n |common-ligatures|condensed|consider-shifts|contain\n |content(-box|s)?\n |contextual|contrast|cover\n |crisp(-e|E)dges\n |crop\n |cross(hair)?\n |da(rken|shed)\n |default|dense|diagonal-fractions|difference|disabled\n |discretionary-ligatures|disregard-shifts\n |distribute(-all-lines|-letter|-space)?\n |dotted|double|drop-shadow\n |(nwse|nesw|ns|ew|sw|se|nw|ne|w|s|e|n)-resize\n |ease(-in-out|-in|-out)?\n |element|ellipsis|embed|end|EndColorStr|evenodd\n |exclu(de(-ruby)?|sion)\n |expanded\n |(extra|semi|ultra)-(condensed|expanded)\n |farthest-(corner|side)?\n |fill(-box|-opacity)?\n |filter|fixed|flat\n |flex((-basis|-end|-grow|-shrink|-start)|box)?\n |flip|flood-color\n |font(-size(-adjust)?|-stretch|-weight)?\n |forwards\n |from(-image)?\n |full-width|geometricPrecision|glyphs|gradient|grayscale\n |grid(-height)?\n |groove|hand|hanging|hard-light|height|help|hidden|hide\n |historical-(forms|ligatures)\n |horizontal(-tb)?\n |hue\n |ideograph(-alpha|-numeric|-parenthesis|-space|ic)\n |inactive|include-ruby|infinite|inherit|initial\n |inline(-block|-box|-flex(box)?|-line-height|-table)?\n |inset|inside\n |inter(-ideograph|-word|sect)\n |invert|isolat(e|ion)|italic\n |jis(04|78|83|90)\n |justify(-all)?\n |keep-all\n |large[r]?\n |last|layout|left|letter-spacing\n |light(e[nr]|ing-color)\n |line(-edge|-height|-through)?\n |linear(-gradient|RGB)?\n |lining-nums|list-item|local|loose|lowercase|lr-tb|ltr\n |lumin(osity|ance)|manual\n |manipulation\n |margin(-bottom|-box|-left|-right|-top)?\n |marker(-offset|s)?\n |mathematical\n |max-(content|height|lines|size|width)\n |medium|middle\n |min-(content|height|width)\n |miter|mixed|move|multiply|newspaper\n |no-(change|clip|(close|open)-quote|(common|discretionary|historical)-ligatures|contextual|drop|repeat)\n |none|nonzero|normal|not-allowed|nowrap|oblique\n |offset(-after|-before|-end|-start)?\n |oldstyle-nums|opacity|open-quote\n |optimize(Legibility|Precision|Quality|Speed)\n |order|ordinal|ornaments\n |outline(-color|-offset|-width)?\n |outset|outside|over(line|-edge|lay)\n |padding(-bottom|-box|-left|-right|-top|-box)?\n |page|painted|paused\n |pan-(x|left|right|y|up|down)\n |perspective-origin\n |petite-caps|pixelated|pointer\n |pinch-zoom\n |pre(-line|-wrap)?\n |preserve-3d\n |progid:DXImageTransform.Microsoft.(Alpha|Blur|dropshadow|gradient|Shadow)\n |progress\n |proportional-(nums|width)\n |radial-gradient|recto|region|relative\n |repeat(-[xy])?\n |repeating-(linear|radial)-gradient\n |replaced|reset-size|reverse|ridge|right\n |round\n |row(-resize|-reverse)?\n |rtl|ruby|running|saturat(e|ion)|screen\n |scroll(-position|bar)?\n |separate|sepia\n |scale-down\n |shape-(image-threshold|margin|outside)\n |show\n |sideways(-lr|-rl)?\n |simplified\n |size\n |slashed-zero|slice\n |small(-caps|er)?\n |smooth|snap|solid|soft-light\n |space(-around|-between)?\n |span|sRGB\n |stack(ed-fractions)?\n |start(ColorStr)?\n |static\n |step-(end|start)\n |sticky\n |stop-(color|opacity)\n |stretch|strict\n |stroke(-box|-dash(array|offset)|-miterlimit|-opacity|-width)?\n |style(set)?\n |stylistic\n |sub(grid|pixel-antialiased|tract)?\n |super|swash\n |table(-caption|-cell|(-column|-footer|-header|-row)-group|-column|-row)?\n |tabular-nums|tb-rl\n |text((-bottom|-(decoration|emphasis)-color|-indent|-(over|under)-edge|-shadow|-size(-adjust)?|-top)|field)?\n |thi(ck|n)\n |titling-ca(ps|se)\n |to[p]?\n |touch|traditional\n |transform(-origin)?\n |under(-edge|line)?\n |unicase|unset|uppercase|upright\n |use-(glyph-orientation|script)\n |verso\n |vertical(-align|-ideographic|-lr|-rl|-text)?\n |view-box\n |viewport-fill(-opacity)?\n |visibility\n |visible(Fill|Painted|Stroke)?\n |wait|wavy|weight|whitespace|(device-)?width|word-spacing\n |wrap(-reverse)?\n |x{1,2}-(large|small)\n |z-index|zero\n |zoom(-in|-out)?\n |((?xi:arabic-indic|armenian|bengali|cambodian|circle|cjk-decimal|cjk-earthly-branch|cjk-heavenly-stem|decimal-leading-zero|decimal|devanagari|disclosure-closed|disclosure-open|disc|ethiopic-numeric|georgian|gujarati|gurmukhi|hebrew|hiragana-iroha|hiragana|japanese-formal|japanese-informal|kannada|katakana-iroha|katakana|khmer|korean-hangul-formal|korean-hanja-formal|korean-hanja-informal|lao|lower-alpha|lower-armenian|lower-greek|lower-latin|lower-roman|malayalam|mongolian|myanmar|oriya|persian|simp-chinese-formal|simp-chinese-informal|square|tamil|telugu|thai|tibetan|trad-chinese-formal|trad-chinese-informal|upper-alpha|upper-armenian|upper-latin|upper-roman)))\\b", + "comment": "align-content, align-items, align-self, justify-content, justify-items, justify-self", + "match": "(?x)\\b( flex-start | flex-end | start | end | space-between | space-around | space-evenly | stretch | baseline | safe | unsafe | legacy | anchor-center | first | last | self-start | self-end )\\b", + "name": "support.constant.property-value.less" + }, + { + "comment": "alignment-baseline", + "match": "(?x)\\b( text-before-edge | before-edge | middle | central | text-after-edge | after-edge | ideographic | alphabetic | hanging | mathematical | top | center | bottom )\\b", + "name": "support.constant.property-value.less" + }, + { + "include": "#global-property-values" + }, + { + "include": "#cubic-bezier-function" + }, + { + "include": "#steps-function" + }, + { + "comment": "animation-composition", + "match": "\\b(?:replace|add|accumulate)\\b", + "name": "support.constant.property-value.less" + }, + { + "comment": "animation-direction", + "match": "\\b(?:normal|alternate-reverse|alternate|reverse)\\b", + "name": "support.constant.property-value.less" + }, + { + "comment": "animation-fill-mode", + "match": "\\b(?:forwards|backwards|both)\\b", + "name": "support.constant.property-value.less" + }, + { + "comment": "animation-iteration-count", + "match": "\\b(?:infinite)\\b", "name": "support.constant.property-value.less" }, { - "match": "\\b(?i:sans-serif|serif|monospace|fantasy|cursive)\\b(?=\\s*[;,\\n}])", + "comment": "animation-play-state", + "match": "\\b(?:running|paused)\\b", + "name": "support.constant.property-value.less" + }, + { + "comment": "animation-range, animation-range-start, animation-range-end", + "match": "\\b(?:entry-crossing|exit-crossing|entry|exit)\\b", + "name": "support.constant.property-value.less" + }, + { + "comment": "animation-timing-function", + "match": "(?x)\\b(linear | ease-in-out | ease-in | ease-out | ease | step-start | step-end)\\b", + "name": "support.constant.property-value.less" + }, + { + "match": "(?x)\\b( absolute | active | add | all-petite-caps | all-small-caps | all-scroll | all | alphabetic | alpha | alternate-reverse | alternate | always | annotation | antialiased | at | autohiding-scrollbar | auto | avoid-column | avoid-page | avoid-region | avoid | background-color | background-image | background-position | background-size | background-repeat | background | backwards | balance | baseline | below | bevel | bicubic | bidi-override | blink | block-line-height | block-start | block-end | block | blur | bolder | bold | border-top-left-radius | border-top-right-radius | border-bottom-left-radius | border-bottom-right-radius | border-end-end-radius | border-end-start-radius | border-start-end-radius | border-start-start-radius | border-block-start-color | border-block-start-style | border-block-start-width | border-block-start | border-block-end-color | border-block-end-style | border-block-end-width | border-block-end | border-block-color | border-block-style | border-block-width | border-block | border-inline-start-color | border-inline-start-style | border-inline-start-width | border-inline-start | border-inline-end-color | border-inline-end-style | border-inline-end-width | border-inline-end | border-inline-color | border-inline-style | border-inline-width | border-inline | border-top-color | border-top-style | border-top-width | border-top | border-right-color | border-right-style | border-right-width | border-right | border-bottom-color | border-bottom-style | border-bottom-width | border-bottom | border-left-color | border-left-style | border-left-width | border-left | border-image-outset | border-image-repeat | border-image-slice | border-image-source | border-image-width | border-image | border-color | border-style | border-width | border-radius | border-collapse | border-spacing | border | both | bottom | box-shadow | box | break-all | break-word | break-spaces | brightness | butt(on)? | capitalize | central | center | char(acter-variant)? | cjk-ideographic | clip | clone | close-quote | closest-corner | closest-side | col-resize | collapse | color-stop | color-burn | color-dodge | color | column-count | column-gap | column-reverse | column-rule-color | column-rule-width | column-rule | column-width | columns | column | common-ligatures | condensed | consider-shifts | contain | content-box | contents? | contextual | contrast | cover | crisp-edges | crispEdges | crop | crosshair | cross | darken | dashed | default | dense | device-width | diagonal-fractions | difference | disabled | discard | discretionary-ligatures | disregard-shifts | distribute-all-lines | distribute-letter | distribute-space | distribute | dotted | double | drop-shadow | [nsew]{1,4}-resize | ease-in-out | ease-in | ease-out | ease | element | ellipsis | embed | end | EndColorStr | evenodd | exclude-ruby | exclusion | expanded | extra-condensed | extra-expanded | farthest-corner | farthest-side | farthest | fill-box | fill-opacity | fill | filter | fit-content | fixed | flat | flex-basis | flex-end | flex-grow | flex-shrink | flex-start | flexbox | flex | flip | flood-color | font-size-adjust | font-size | font-stretch | font-weight | font | forwards | from-image | from | full-width | gap | geometricPrecision | glyphs | gradient | grayscale | grid-column-gap | grid-column | grid-row-gap | grid-row | grid-gap | grid-height | grid | groove | hand | hanging | hard-light | height | help | hidden | hide | historical-forms | historical-ligatures | horizontal-tb | horizontal | hue | ideographic | ideograph-alpha | ideograph-numeric | ideograph-parenthesis | ideograph-space | inactive | include-ruby | infinite | inherit | initial | inline-end | inline-size | inline-start | inline-table | inline-line-height | inline-flexbox | inline-flex | inline-box | inline-block | inline | inset | inside | inter-ideograph | inter-word | intersect | invert | isolate | isolation | italic | jis(04|78|83|90) | justify-all | justify | keep-all | larger | large | last | layout | left | letter-spacing | lighten | lighter | lighting-color | linear-gradient | linearRGB | linear | line-edge | line-height | line-through | line | lining-nums | list-item | local | loose | lowercase | lr-tb | ltr | luminosity | luminance | manual | manipulation | margin-bottom | margin-box | margin-left | margin-right | margin-top | margin | marker(-offset|s)? | match-parent | mathematical | max-(content|height|lines|size|width) | medium | middle | min-(content|height|width) | miter | mixed | move | multiply | newspaper | no-change | no-clip | no-close-quote | no-open-quote | no-common-ligatures | no-discretionary-ligatures | no-historical-ligatures | no-contextual | no-drop | no-repeat | none | nonzero | normal | not-allowed | nowrap | oblique | offset-after | offset-before | offset-end | offset-start | offset | oldstyle-nums | opacity | open-quote | optimize(Legibility|Precision|Quality|Speed) | order | ordinal | ornaments | outline-color | outline-offset | outline-width | outline | outset | outside | overline | over-edge | overlay | padding(-bottom|-box|-left|-right|-top|-box)? | page | paint(ed)? | paused | pan-(x|left|right|y|up|down) | perspective-origin | petite-caps | pixelated | pointer | pinch-zoom | pretty | pre(-line|-wrap)? | preserve-3d | preserve-breaks | preserve-spaces | preserve | progid:DXImageTransform\\.Microsoft\\.(Alpha|Blur|dropshadow|gradient|Shadow) | progress | proportional-nums | proportional-width | radial-gradient | recto | region | relative | repeating-linear-gradient | repeating-radial-gradient | repeat-x | repeat-y | repeat | replaced | reset-size | reverse | revert-layer | revert | ridge | right | round | row-gap | row-resize | row-reverse | row | rtl | ruby | running | saturate | saturation | screen | scrollbar | scroll-position | scroll | separate | sepia | scale-down | semi-condensed | semi-expanded | shape-image-threshold | shape-margin | shape-outside | show | sideways-lr | sideways-rl | sideways | simplified | size | slashed-zero | slice | small-caps | smaller | small | smooth | snap | solid | soft-light | space-around | space-between | space | span | sRGB | stable | stacked-fractions | stack | startColorStr | start | static | step-end | step-start | sticky | stop-color | stop-opacity | stretch | strict | stroke-box | stroke-dasharray | stroke-dashoffset | stroke-miterlimit | stroke-opacity | stroke-width | stroke | styleset | style | stylistic | subgrid | subpixel-antialiased | subtract | super | swash | table-caption | table-cell | table-column-group | table-footer-group | table-header-group | table-row-group | table-column | table-row | table | tabular-nums | tb-rl | text((-bottom|-(decoration|emphasis)-color|-indent|-(over|under)-edge|-shadow|-size(-adjust)?|-top)|field)? | thick |thin | titling-caps | titling-case | top | touch | to | traditional | transform-origin | transform-style | transform | ultra-condensed | ultra-expanded | under-edge | underline | unicase | unset | uppercase | upright | use-glyph-orientation | use-script | verso | vertical(-align|-ideographic|-lr|-rl|-text)? | view-box | viewport-fill-opacity | viewport-fill | visibility | visibleFill | visiblePainted | visibleStroke | visible | wait | wavy | weight | whitespace | width | word-spacing | wrap-reverse | wrap-reverse | wrap | xx?-(large|small) | z-index | zero | zoom-in | zoom-out | zoom | arabic-indic | armenian | bengali | cambodian | circle | cjk-decimal | cjk-earthly-branch | cjk-heavenly-stem | decimal-leading-zero | decimal | devanagari | disclosure-closed | disclosure-open | disc | ethiopic-numeric | georgian | gujarati | gurmukhi | hebrew | hiragana-iroha | hiragana | japanese-formal | japanese-informal | kannada | katakana-iroha | katakana | khmer | korean-hangul-formal | korean-hanja-formal | korean-hanja-informal | lao | lower-alpha | lower-armenian | lower-greek | lower-latin | lower-roman | malayalam | mongolian | myanmar | oriya | persian | simp-chinese-formal | simp-chinese-informal | square | tamil | telugu | thai | tibetan | trad-chinese-formal | trad-chinese-informal | upper-alpha | upper-armenian | upper-latin | upper-roman)\\b", + "name": "support.constant.property-value.less" + }, + { + "match": "\\b(sans-serif|serif|monospace|fantasy|cursive)\\b(?=\\s*[;,\\n}])", "name": "support.constant.font-name.less" } ] @@ -3435,18 +3788,12 @@ { "include": "#comment-block" }, - { - "include": "#vendor-prefix" - }, { "include": "#builtin-functions" }, { "include": "#color-functions" }, - { - "include": "#less-math" - }, { "include": "#less-functions" }, @@ -3465,25 +3812,25 @@ { "include": "#property-value-constants" }, + { + "include": "#less-math" + }, { "include": "#literal-string" }, { - "captures": { - "1": { - "name": "punctuation.separator.less" - } - }, - "match": "(\\!)\\s*important", - "name": "keyword.other.important.less" + "include": "#comma-delimiter" + }, + { + "include": "#important" } ] }, - "pseudo-classes": { + "pseudo-selectors": { "patterns": [ { - "begin": "(:)(dir|lang)(?=\\()", - "captures": { + "begin": "(:)(dir)(?=\\()", + "beginCaptures": { "1": { "name": "punctuation.definition.entity.less" } @@ -3506,15 +3853,19 @@ "end": "(?=\\))", "patterns": [ { - "include": "#unquoted-string" + "match": "ltr|rtl", + "name": "variable.parameter.dir.less" + }, + { + "include": "#less-variables" } ] } ] }, { - "begin": "(:)(not)(?=\\()", - "captures": { + "begin": "(:)(lang)(?=\\()", + "beginCaptures": { "1": { "name": "punctuation.definition.entity.less" } @@ -3537,15 +3888,52 @@ "end": "(?=\\))", "patterns": [ { - "include": "#selectors" + "include": "#less-variables" + }, + { + "include": "#literal-string" + }, + { + "include": "#unquoted-string" } ] } ] }, { - "begin": "(:)(nth(-last)?-(child|of-type))(?=\\()", - "captures": { + "begin": "(:)(not)(?=\\()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.entity.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "entity.other.attribute-name.pseudo-class.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#selectors" + } + ] + } + ] + }, + { + "begin": "(:)(nth(-last)?-(child|of-type))(?=\\()", + "beginCaptures": { "1": { "name": "punctuation.definition.entity.less" }, @@ -3553,13 +3941,14 @@ "name": "entity.other.attribute-name.pseudo-class.less" } }, + "contentName": "meta.function-call.less", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.group.end.less" } }, - "name": "meta.function-call.less", + "name": "entity.other.attribute-name.pseudo-class.less", "patterns": [ { "begin": "\\(", @@ -3578,10 +3967,16 @@ { "captures": { "1": { + "name": "keyword.operator.arithmetic.less" + }, + "2": { "name": "keyword.other.unit.less" + }, + "4": { + "name": "keyword.operator.arithmetic.less" } }, - "match": "(?:[-+]?(?:\\d+)?(n)(\\s*[-+]\\s*\\d+)?|[-+]?\\s*\\d+)", + "match": "(?:([-+])?(?:\\d+)?(n)(\\s*([-+])\\s*\\d+)?|[-+]?\\s*\\d+)", "name": "constant.numeric.less" }, { @@ -3598,8 +3993,8 @@ ] }, { - "begin": "(:)(host-context)(?=\\()", - "captures": { + "begin": "(:)(host-context|host|has|is|not|where)(?=\\()", + "beginCaptures": { "1": { "name": "punctuation.definition.entity.less" } @@ -3637,27 +4032,24 @@ "name": "entity.other.attribute-name.pseudo-class.less" } }, - "match": "(:)(active|any|checked|default|disabled|empty|enabled|first(-(child|of-type))?|fullscreen|focus|host|hover|indeterminate|in-range|invalid|last-(child|of-type)|left|link|only-(child|of-type)|optional|out-of-range|read-(only|write)|required|right|root|scope|target|valid|visited)", + "match": "(?x)(:)( active | any-link | autofill | blank | buffering | checked | current | default | defined | disabled | empty | enabled | first-child | first-of-type | first | focus-visible | focus-within | focus | fullscreen | future | host | hover | in-range | indeterminate | invalid | last-child | last-of-type | left | local-link | link | modal | muted | only-child | only-of-type | optional | out-of-range | past | paused | picture-in-picture | placeholder-shown | playing | popover-open | read-only | read-write | required | right | root | scope | seeking | stalled | target-within | target | user-invalid | user-valid | valid | visited | volume-locked )\\b", "name": "meta.function-call.less" - } - ] - }, - "pseudo-elements": { - "patterns": [ + }, { - "begin": "(::)(slotted)(?=\\()", - "captures": { + "begin": "(::?)(highlight|part|state)(?=\\s*(\\())", + "beginCaptures": { "1": { "name": "punctuation.definition.entity.less" } }, + "comment": "::highlight()", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.group.end.less" } }, - "name": "entity.other.attribute-name.pseudo-class.less", + "name": "entity.other.attribute-name.pseudo-element.less", "patterns": [ { "begin": "\\(", @@ -3667,6 +4059,44 @@ } }, "end": "(?=\\))", + "patterns": [ + { + "match": "--|(?:-?(?:(?:[a-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R]))))(?:(?:[-\\da-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R])))*", + "name": "variable.parameter.less" + }, + { + "include": "#less-variables" + } + ] + } + ] + }, + { + "begin": "(::?)slotted(?=\\s*(\\())", + "beginCaptures": { + "1": { + "name": "punctuation.definition.entity.less" + } + }, + "comment": "::slotted()", + "contentName": "meta.function-call.less", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "entity.other.attribute-name.pseudo-element.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "name": "meta.group.less", "patterns": [ { "include": "#selectors" @@ -3679,15 +4109,23 @@ "captures": { "1": { "name": "punctuation.definition.entity.less" - }, - "2": { + } + }, + "comment": "defined pseudo-elements", + "match": "(?x)(::?)(after | backdrop | before | cue | file-selector-button | first-letter | first-line | grammar-error | marker | placeholder | selection | spelling-error | target-text | view-transition-group | view-transition-image-pair | view-transition-new | view-transition-old | view-transition)\\b", + "name": "entity.other.attribute-name.pseudo-element.less" + }, + { + "captures": { + "1": { "name": "punctuation.definition.entity.less" }, - "3": { - "name": "support.type.vendor-prefix.less" + "2": { + "name": "meta.namespace.vendor-prefix.less" } }, - "match": "(?:(:{1,2})(?:before|after|first-line|first-letter)|(::)(-(?:moz|ms|webkit)-)?(?:(-?(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))(?:[[-\\w][^\\x{00}-\\x{7F}]]|(?:\\\\\\h{1,6}[\\s\\t\\n\\f]?|\\\\[^\\n\\f\\h]))*)))\\b", + "comment": "other possible pseudo-elements", + "match": "(?x)(::?)(-\\w+-)(--|(?:-?(?:(?:[a-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R]))))(?:(?:[-\\da-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R])))*)\\b", "name": "entity.other.attribute-name.pseudo-element.less" } ] @@ -3733,14 +4171,17 @@ } ] }, - "resolution-type": { - "captures": { - "1": { - "name": "keyword.other.unit.less" + "relative-color": { + "patterns": [ + { + "match": "from", + "name": "keyword.other.less" + }, + { + "match": "\\b[hslawbch]\\b", + "name": "keyword.other.less" } - }, - "match": "(?i:[-+]?(?:(?:\\d*\\.\\d+(?:[eE](?:[-+]?\\d+))*)|(?:[-+]?\\d+))(dpi|dpcm|dppx))\\b", - "name": "constant.numeric.less" + ] }, "rule-list": { "patterns": [ @@ -3787,21 +4228,120 @@ "include": "#less-variable-assignment" }, { - "include": "#less-variable-interpolation" + "begin": "(?=[-\\w]*?@\\{.*\\}[-\\w]*?\\s*:[^;{(]*(?=[;})]))", + "end": "(?=\\s*(;)|(?=[})]))", + "patterns": [ + { + "begin": "(?=[^\\s:])", + "end": "(?=(((\\+_?)?):)[\\s\\t]*)", + "name": "support.type.property-name.less", + "patterns": [ + { + "include": "#less-variable-interpolation" + } + ] + }, + { + "begin": "(((\\+_?)?):)(?=[\\s\\t]*)", + "beginCaptures": { + "1": { + "name": "punctuation.separator.key-value.less" + } + }, + "contentName": "support.type.property-name.less", + "end": "(?=\\s*(;)|(?=[})]))", + "patterns": [ + { + "include": "#property-values" + } + ] + } + ] }, { "begin": "(?=[-a-z])", "end": "$|(?![-a-z])", "patterns": [ { - "include": "#vendor-prefix" + "include": "#custom-property-name" }, { - "include": "#custom-property-name" + "begin": "(-[\\w-]+?-)((?:(?:[a-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R])))(?:(?:[-\\da-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R])))*)\\b", + "beginCaptures": { + "0": { + "name": "support.type.property-name.less" + }, + "1": { + "name": "meta.namespace.vendor-prefix.less" + } + }, + "comment": "vendor-prefixed properties", + "end": "\\s*(;)|(?=[})])", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "patterns": [ + { + "begin": "(((\\+_?)?):)(?=[\\s\\t]*)", + "beginCaptures": { + "1": { + "name": "punctuation.separator.key-value.less" + } + }, + "contentName": "meta.property-value.less", + "end": "(?=\\s*(;)|(?=[})]))", + "patterns": [ + { + "include": "#property-values" + }, + { + "match": "[\\w-]+", + "name": "support.constant.property-value.less" + } + ] + } + ] }, { "include": "#filter-function" }, + { + "begin": "\\b(border((-(bottom|top)-(left|right))|((-(start|end)){2}))?-radius|(border-image(?!-)))\\b", + "beginCaptures": { + "0": { + "name": "support.type.property-name.less" + } + }, + "comment": "border-radius and border-image properties utilize a slash as a separator", + "end": "\\s*(;)|(?=[})])", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "patterns": [ + { + "begin": "(((\\+_?)?):)(?=[\\s\\t]*)", + "beginCaptures": { + "1": { + "name": "punctuation.separator.key-value.less" + } + }, + "contentName": "meta.property-value.less", + "end": "(?=\\s*(;)|(?=[})]))", + "patterns": [ + { + "include": "#value-separator" + }, + { + "include": "#property-values" + } + ] + } + ] + }, { "captures": { "1": { @@ -3854,7 +4394,7 @@ ] }, { - "begin": "\\banimation(-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function))?\\b", + "begin": "\\banimation-timeline\\b", "beginCaptures": { "0": { "name": "support.type.property-name.less" @@ -3874,42 +4414,91 @@ "name": "punctuation.separator.key-value.less" } }, - "captures": { + "contentName": "meta.property-value.less", + "end": "(?=\\s*(;)|(?=[})]))", + "patterns": [ + { + "include": "#comment-block" + }, + { + "include": "#custom-property-name" + }, + { + "include": "#scroll-function" + }, + { + "include": "#view-function" + }, + { + "include": "#property-values" + }, + { + "include": "#less-variables" + }, + { + "include": "#arbitrary-repetition" + }, + { + "include": "#important" + } + ] + } + ] + }, + { + "begin": "\\banimation(?:-name)?(?=(?:\\+_?)?:)\\b", + "beginCaptures": { + "0": { + "name": "support.type.property-name.less" + } + }, + "end": "\\s*(;)|(?=[})])", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "patterns": [ + { + "begin": "(((\\+_?)?):)(?=[\\s\\t]*)", + "beginCaptures": { "1": { - "name": "punctuation.definition.arbitrary-repetition.less" + "name": "punctuation.separator.key-value.less" } }, "contentName": "meta.property-value.less", "end": "(?=\\s*(;)|(?=[})]))", "patterns": [ { - "match": "\\b(linear|ease(-in)?(-out)?|step-(start|end)|none|forwards|backwards|both|normal|alternate(-reverse)?|reverse|running|paused)\\b", - "name": "support.constant.property-value.less" + "include": "#comment-block" }, { - "include": "#cubic-bezier-function" + "include": "#builtin-functions" }, { - "include": "#steps-function" + "include": "#less-functions" }, { - "include": "#time-type" + "include": "#less-variables" + }, + { + "include": "#numeric-values" }, { - "include": "#number-type" + "include": "#property-value-constants" }, { "match": "-?(?:[_a-zA-Z]|[^\\x{00}-\\x{7F}]|(?:(:?\\\\[0-9a-f]{1,6}(\\r\\n|[\\s\\t\\r\\n\\f])?)|\\\\[^\\r\\n\\f0-9a-f]))(?:[-_a-zA-Z0-9]|[^\\x{00}-\\x{7F}]|(?:(:?\\\\[0-9a-f]{1,6}(\\r\\n|[\\t\\r\\n\\f])?)|\\\\[^\\r\\n\\f0-9a-f]))*", - "name": "variable.other.constant.animation-name.less" + "name": "variable.other.constant.animation-name.less string.unquoted.less" }, { - "include": "#literal-string" + "include": "#less-math" }, { - "include": "#property-values" + "include": "#arbitrary-repetition" }, { - "match": "\\s*(?:(,))" + "include": "#important" } ] } @@ -3918,9 +4507,6 @@ { "begin": "\\b(transition(-(property|duration|delay|timing-function))?)\\b", "beginCaptures": { - "0": { - "name": "meta.property-name.less" - }, "1": { "name": "support.type.property-name.less" } @@ -3933,35 +4519,31 @@ }, "patterns": [ { - "captures": { + "begin": "(((\\+_?)?):)(?=[\\s\\t]*)", + "beginCaptures": { "1": { "name": "punctuation.separator.key-value.less" - }, - "4": { - "name": "meta.property-value.less" } }, - "match": "(((\\+_?)?):)([\\s\\t]*)" - }, - { - "include": "#time-type" - }, - { - "include": "#property-values" - }, - { - "include": "#cubic-bezier-function" - }, - { - "include": "#steps-function" - }, - { - "captures": { - "1": { - "name": "punctuation.definition.arbitrary-repetition.less" + "contentName": "meta.property-value.less", + "end": "(?=\\s*(;)|(?=[})]))", + "patterns": [ + { + "include": "#time-type" + }, + { + "include": "#property-values" + }, + { + "include": "#cubic-bezier-function" + }, + { + "include": "#steps-function" + }, + { + "include": "#arbitrary-repetition" } - }, - "match": "\\s*(?:(,))" + ] } ] }, @@ -4035,12 +4617,7 @@ "name": "support.constant.property-value.less" }, { - "captures": { - "1": { - "name": "punctuation.definition.arbitrary-repetition.less" - } - }, - "match": "\\s*(?:(,))" + "include": "#arbitrary-repetition" } ] }, @@ -4084,7 +4661,53 @@ ] }, { - "match": "(?x)\\b( accent-height | align-content | align-items | align-self | alignment-baseline | all | animation-timing-function | animation-play-state | animation-name | animation-iteration-count | animation-fill-mode | animation-duration | animation-direction | animation-delay | animation | appearance | ascent | azimuth | backface-visibility | background-size | background-repeat-y | background-repeat-x | background-repeat | background-position-y | background-position-x | background-position | background-origin | background-image | background-color | background-clip | background-blend-mode | background-attachment | background | baseline-shift | begin | bias | blend-mode | border-((top|right|bottom|left)-)?(width|style|color) | border-(top|bottom)-(right|left)-radius | border-image-(width|source|slice|repeat|outset) | border-(top|right|bottom|left|collapse|image|radius|spacing) | border | bottom | box-(align|decoration-break|direction|flex|ordinal-group|orient|pack|shadow|sizing) | break-(after|before|inside) | caption-side | clear | clip-path | clip-rule | clip | color(-(interpolation(-filters)?|profile|rendering))? | columns | column-(break-before|count|fill|gap|(rule(-(color|style|width))?)|span|width) | contain | content | counter-(increment|reset) | cursor | (c|d|f)(x|y) | direction | display | divisor | dominant-baseline | dur | elevation | empty-cells | enable-background | end | fallback | fill(-(opacity|rule))? | filter | flex(-(align|basis|direction|flow|grow|item-align|line-pack|negative|order|pack|positive|preferred-size|shrink|wrap))? | float | flood-(color|opacity) | font-display | font-family | font-feature-settings | font-kerning | font-language-override | font-size(-adjust)? | font-smoothing | font-stretch | font-style | font-synthesis | font-variant(-(alternates|caps|east-asian|ligatures|numeric|position))? | font-weight | font | fr | glyph-orientation-(horizontal|vertical) | grid-(area|gap) | grid-auto-(columns|flow|rows) | grid-(column|row)(-(end|gap|start))? | grid-template(-(areas|columns|rows))? | height | hyphens | image-(orientation|rendering|resolution) | isolation | justify-content | kerning | left | letter-spacing | lighting-color | line-(box-contain|break|clamp|height) | list-style(-(image|position|type))? | margin(-(bottom|left|right|top))? | marker(-(end|mid|start))? | mask(-(clip||composite|image|origin|position|repeat|size|type))? | (max|min)-(height|width) | mix-blend-mode | nbsp-mode | negative | object-(fit|position) | opacity | operator | order | orphans | outline(-(color|offset|style|width))? | overflow(-(scrolling|wrap|x|y))? | pad(ding(-(bottom|left|right|top))?)? | page(-break-(after|before|inside))? | paint-order | pause(-(after|before))? | perspective(-origin(-(x|y))?)? | pitch(-range)? | pointer-events | position | prefix | quotes | range | resize | right | rotate | scale | scroll-behavior | shape-(image-threshold|margin|outside|rendering) | size | speak(-as)? | src | stop-(color|opacity) | stroke(-(dash(array|offset)|line(cap|join)|miterlimit|opacity|width))? | suffix | symbols | system | tab-size | table-layout | tap-highlight-color | text-align(-last)? | text-decoration(-(color|line|style))? | text-emphasis(-(color|position|style))? | text-(anchor|fill-color|height|indent|justify|orientation|overflow|rendering|shadow|transform|underline-position) | top | touch-action | transform(-origin(-(x|y))?) | transform(-style)? | transition(-(delay|duration|property|timing-function))? | translate | unicode-(bidi|range) | user-(drag|select) | vertical-align | visibility | white-space | widows | width | will-change | word-(break|spacing|wrap) | writing-mode | z-index | zoom )\\b", + "begin": "\\bcontainer(?:-name)?(?=\\s*?:)", + "end": "\\s*(;)|(?=[})])", + "endCaptures": { + "1": { + "name": "punctuation.terminator.rule.less" + } + }, + "name": "support.type.property-name.less", + "patterns": [ + { + "begin": "(((\\+_?)?):)(?=[\\s\\t]*)", + "beginCaptures": { + "1": { + "name": "punctuation.separator.key-value.less" + } + }, + "contentName": "meta.property-value.less", + "end": "(?=\\s*(;)|(?=[})]))", + "patterns": [ + { + "match": "\\bdefault\\b", + "name": "invalid.illegal.property-value.less" + }, + { + "include": "#global-property-values" + }, + { + "include": "#custom-property-name" + }, + { + "contentName": "variable.other.constant.container-name.less", + "match": "--|(?:-?(?:(?:[a-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R]))))(?:(?:[-\\da-zA-Z_]|[\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}\\x{200D}\\x{203F}\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])|(?:\\\\(?:\\N|[[:^xdigit:]]|[[:xdigit:]]{1,6}[\\s\\R])))*", + "name": "support.constant.property-value.less" + }, + { + "include": "#property-values" + } + ] + } + ] + }, + { + "match": "(?x)\\b( accent-height | align-content | align-items | align-self | alignment-baseline | all | animation-timing-function | animation-range-start | animation-range-end | animation-range | animation-play-state | animation-name | animation-iteration-count | animation-fill-mode | animation-duration | animation-direction | animation-delay | animation-composition | animation | appearance | ascent | aspect-ratio | azimuth | backface-visibility | background-size | background-repeat-y | background-repeat-x | background-repeat | background-position-y | background-position-x | background-position | background-origin | background-image | background-color | background-clip | background-blend-mode | background-attachment | background | baseline-shift | begin | bias | blend-mode | border-top-left-radius | border-top-right-radius | border-bottom-left-radius | border-bottom-right-radius | border-end-end-radius | border-end-start-radius | border-start-end-radius | border-start-start-radius | border-block-start-color | border-block-start-style | border-block-start-width | border-block-start | border-block-end-color | border-block-end-style | border-block-end-width | border-block-end | border-block-color | border-block-style | border-block-width | border-block | border-inline-start-color | border-inline-start-style | border-inline-start-width | border-inline-start | border-inline-end-color | border-inline-end-style | border-inline-end-width | border-inline-end | border-inline-color | border-inline-style | border-inline-width | border-inline | border-top-color | border-top-style | border-top-width | border-top | border-right-color | border-right-style | border-right-width | border-right | border-bottom-color | border-bottom-style | border-bottom-width | border-bottom | border-left-color | border-left-style | border-left-width | border-left | border-image-outset | border-image-repeat | border-image-slice | border-image-source | border-image-width | border-image | border-color | border-style | border-width | border-radius | border-collapse | border-spacing | border | bottom | box-(align|decoration-break|direction|flex|ordinal-group|orient|pack|shadow|sizing) | break-(after|before|inside) | caption-side | clear | clip-path | clip-rule | clip | color(-(interpolation(-filters)?|profile|rendering))? | columns | column-(break-before|count|fill|gap|(rule(-(color|style|width))?)|span|width) | container-name | container-type | container | contain-intrinsic-block-size | contain-intrinsic-inline-size | contain-intrinsic-height | contain-intrinsic-size | contain-intrinsic-width | contain | content | counter-(increment|reset) | cursor | [cdf][xy] | direction | display | divisor | dominant-baseline | dur | elevation | empty-cells | enable-background | end | fallback | fill(-(opacity|rule))? | filter | flex(-(align|basis|direction|flow|grow|item-align|line-pack|negative|order|pack|positive|preferred-size|shrink|wrap))? | float | flood-(color|opacity) | font-display | font-family | font-feature-settings | font-kerning | font-language-override | font-size(-adjust)? | font-smoothing | font-stretch | font-style | font-synthesis | font-variant(-(alternates|caps|east-asian|ligatures|numeric|position))? | font-weight | font | fr | ((column|row)-)?gap | glyph-orientation-(horizontal|vertical) | grid-(area|gap) | grid-auto-(columns|flow|rows) | grid-(column|row)(-(end|gap|start))? | grid-template(-(areas|columns|rows))? | grid | height | hyphens | image-(orientation|rendering|resolution) | inset(-(block|inline))?(-(start|end))? | isolation | justify-content | justify-items | justify-self | kerning | left | letter-spacing | lighting-color | line-(box-contain|break|clamp|height) | list-style(-(image|position|type))? | (margin|padding)(-(bottom|left|right|top)|(-(block|inline)?(-(end|start))?))? | marker(-(end|mid|start))? | mask(-(clip||composite|image|origin|position|repeat|size|type))? | (max|min)-(height|width) | mix-blend-mode | nbsp-mode | negative | object-(fit|position) | opacity | operator | order | orphans | outline(-(color|offset|style|width))? | overflow(-((inline|block)|scrolling|wrap|x|y))? | overscroll-behavior(-block|-(inline|x|y))? | pad(ding(-(bottom|left|right|top))?)? | page(-break-(after|before|inside))? | paint-order | pause(-(after|before))? | perspective(-origin(-(x|y))?)? | pitch(-range)? | place-content | place-self | pointer-events | position | prefix | quotes | range | resize | right | rotate | scale | scroll-behavior | shape-(image-threshold|margin|outside|rendering) | size | speak(-as)? | src | stop-(color|opacity) | stroke(-(dash(array|offset)|line(cap|join)|miterlimit|opacity|width))? | suffix | symbols | system | tab-size | table-layout | tap-highlight-color | text-align(-last)? | text-decoration(-(color|line|style))? | text-emphasis(-(color|position|style))? | text-(anchor|fill-color|height|indent|justify|orientation|overflow|rendering|size-adjust|shadow|transform|underline-position|wrap) | top | touch-action | transform(-origin(-(x|y))?) | transform(-style)? | transition(-(delay|duration|property|timing-function))? | translate | unicode-(bidi|range) | user-(drag|select) | vertical-align | visibility | white-space(-collapse)? | widows | width | will-change | word-(break|spacing|wrap) | writing-mode | z-index | zoom )\\b", + "name": "support.type.property-name.less" + }, + { + "match": "(?x)\\b(((contain-intrinsic|max|min)-)?(block|inline)?-size)\\b", "name": "support.type.property-name.less" }, { @@ -4093,7 +4716,15 @@ ] }, { - "begin": "\\b(((\\+_?)?):)([\\s\\t]*)", + "begin": "\\b((?:(?:\\+_?)?):)([\\s\\t]*)", + "beginCaptures": { + "1": { + "name": "punctuation.separator.key-value.less" + }, + "2": { + "name": "meta.property-value.less" + } + }, "captures": { "1": { "name": "punctuation.separator.key-value.less" @@ -4120,6 +4751,40 @@ } ] }, + "scroll-function": { + "begin": "\\b(scroll)(\\()", + "beginCaptures": { + "1": { + "name": "support.function.scroll.less" + }, + "2": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "match": "root|nearest|self", + "name": "support.constant.scroller.less" + }, + { + "match": "block|inline|x|y", + "name": "support.constant.axis.less" + }, + { + "include": "#less-variables" + }, + { + "include": "#var-function" + } + ] + }, "selector": { "patterns": [ { @@ -4140,13 +4805,7 @@ "include": "#less-variable-interpolation" }, { - "captures": { - "1": { - "name": "punctuation.separator.less" - } - }, - "match": "(\\!)\\s*important", - "name": "keyword.other.important.less" + "include": "#important" } ] } @@ -4212,10 +4871,7 @@ ] }, { - "include": "#pseudo-elements" - }, - { - "include": "#pseudo-classes" + "include": "#pseudo-selectors" }, { "include": "#less-extend" @@ -4234,12 +4890,17 @@ }, { "begin": "\\[", - "captures": { + "beginCaptures": { "0": { - "name": "punctuation.definition.entity.less" + "name": "punctuation.section.braces.begin.less" } }, "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.section.braces.end.less" + } + }, "name": "meta.attribute-selector.less", "patterns": [ { @@ -4254,7 +4915,7 @@ }, { "begin": "\\s*([~*|^$]?=)\\s*", - "captures": { + "beginCaptures": { "1": { "name": "keyword.operator.attribute-selector.less" } @@ -4288,12 +4949,7 @@ ] }, { - "captures": { - "1": { - "name": "punctuation.definition.arbitrary-repetition.less" - } - }, - "match": "\\s*(?:(,))" + "include": "#arbitrary-repetition" }, { "match": "\\*", @@ -4462,12 +5118,16 @@ ] }, "steps-function": { - "begin": "\\b(steps)(?=\\()", + "begin": "\\b(steps)(\\()", "beginCaptures": { - "0": { + "1": { "name": "support.function.timing.less" + }, + "2": { + "name": "punctuation.definition.group.begin.less" } }, + "contentName": "meta.group.less", "end": "\\)", "endCaptures": { "0": { @@ -4477,25 +5137,23 @@ "name": "meta.function-call.less", "patterns": [ { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.group.begin.less" - } - }, - "end": "(?=\\))", - "patterns": [ - { - "include": "#comma-delimiter" - }, - { - "include": "#integer-type" - }, - { - "match": "(end|middle|start)", - "name": "support.keyword.timing-direction.less" - } - ] + "match": "jump-start|jump-end|jump-none|jump-both|start|end", + "name": "support.constant.step-position.less" + }, + { + "include": "#comma-delimiter" + }, + { + "include": "#integer-type" + }, + { + "include": "#less-variables" + }, + { + "include": "#var-function" + }, + { + "include": "#calc-function" } ] }, @@ -4514,6 +5172,37 @@ } ] }, + "style-function": { + "begin": "\\b(style)(?=\\()", + "beginCaptures": { + "0": { + "name": "support.function.style.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.less" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#rule-list-body" + } + ] + } + ] + }, "symbols-function": { "begin": "\\b(symbols)(?=\\()", "beginCaptures": { @@ -4968,50 +5657,103 @@ } ] }, + "value-separator": { + "captures": { + "1": { + "name": "punctuation.separator.less" + } + }, + "match": "\\s*(/)\\s*" + }, "var-function": { + "begin": "\\b(var)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.var.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", "patterns": [ { - "begin": "\\b(var)(?=\\()", + "begin": "\\(", "beginCaptures": { - "1": { - "name": "support.function.var.less" + "0": { + "name": "punctuation.definition.group.begin.less" } }, - "end": "\\)", - "endCaptures": { + "end": "(?=\\))", + "patterns": [ + { + "include": "#comma-delimiter" + }, + { + "include": "#custom-property-name" + }, + { + "include": "#less-variables" + }, + { + "include": "#property-values" + } + ] + } + ] + }, + "view-function": { + "begin": "\\b(view)(?=\\()", + "beginCaptures": { + "1": { + "name": "support.function.view.less" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.less" + } + }, + "name": "meta.function-call.less", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { "0": { - "name": "punctuation.definition.group.end.less" + "name": "punctuation.definition.group.begin.less" } }, - "name": "meta.function-call.less", + "end": "(?=\\))", "patterns": [ { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.group.begin.less" - } - }, - "end": "(?=\\))", - "patterns": [ - { - "include": "#comma-delimiter" - }, - { - "include": "#custom-property-name" - }, - { - "include": "#less-variables" - } - ] + "match": "block|inline|x|y|auto", + "name": "support.constant.property-value.less" + }, + { + "include": "#percentage-type" + }, + { + "include": "#length-type" + }, + { + "include": "#less-variables" + }, + { + "include": "#var-function" + }, + { + "include": "#calc-function" + }, + { + "include": "#arbitrary-repetition" } ] } ] - }, - "vendor-prefix": { - "match": "-(?:webkit|moz(-osx)?|ms|o)-", - "name": "support.type.vendor-prefix.less" } } } \ No newline at end of file diff --git a/extensions/less/yarn.lock b/extensions/less/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/less/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/log/yarn.lock b/extensions/log/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/log/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/lua/yarn.lock b/extensions/lua/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/lua/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/make/yarn.lock b/extensions/make/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/make/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/markdown-basics/cgmanifest.json b/extensions/markdown-basics/cgmanifest.json index 60c6b192bed..380b0c74ac6 100644 --- a/extensions/markdown-basics/cgmanifest.json +++ b/extensions/markdown-basics/cgmanifest.json @@ -33,7 +33,7 @@ "git": { "name": "microsoft/vscode-markdown-tm-grammar", "repositoryUrl": "https://github.com/microsoft/vscode-markdown-tm-grammar", - "commitHash": "f75d5f55730e72ee7ff386841949048b2395e440" + "commitHash": "7418dd20d76c72e82fadee2909e03239e9973b35" } }, "license": "MIT", diff --git a/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json b/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json index c84c468b80c..9761ca716ab 100644 --- a/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json +++ b/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/f75d5f55730e72ee7ff386841949048b2395e440", + "version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/7418dd20d76c72e82fadee2909e03239e9973b35", "name": "Markdown", "scopeName": "text.html.markdown", "patterns": [ @@ -2480,14 +2480,34 @@ "name": "meta.separator.markdown" }, "frontMatter": { - "begin": "\\A-{3}\\s*$", - "contentName": "meta.embedded.block.frontmatter", + "begin": "\\A(?=(-{3,}))", + "end": "^ {,3}\\1-*[ \\t]*$|^[ \\t]*\\.{3}$", + "applyEndPatternLast": 1, + "endCaptures": { + "0": { + "name": "punctuation.definition.end.frontmatter" + } + }, "patterns": [ { - "include": "source.yaml" + "begin": "\\A(-{3,})(.*)$", + "while": "^(?! {,3}\\1-*[ \\t]*$|[ \\t]*\\.{3}$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.begin.frontmatter" + }, + "2": { + "name": "comment.frontmatter" + } + }, + "contentName": "meta.embedded.block.frontmatter", + "patterns": [ + { + "include": "source.yaml" + } + ] } - ], - "end": "(^|\\G)-{3}|\\.{3}\\s*$" + ] }, "table": { "name": "markup.table.markdown", diff --git a/extensions/markdown-basics/yarn.lock b/extensions/markdown-basics/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/markdown-basics/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/markdown-language-features/.vscodeignore b/extensions/markdown-language-features/.vscodeignore index 588916d37c3..0d35b62002d 100644 --- a/extensions/markdown-language-features/.vscodeignore +++ b/extensions/markdown-language-features/.vscodeignore @@ -9,17 +9,10 @@ out/** extension.webpack.config.js extension-browser.webpack.config.js cgmanifest.json -yarn.lock +package-lock.json preview-src/** webpack.config.js esbuild-notebook.js esbuild-preview.js .gitignore -server/src/** -server/extension.webpack.config.js -server/extension-browser.webpack.config.js -server/tsconfig.json -server/.vscode/** -server/node_modules/** -server/yarn.lock -server/.npmignore +**/*.d.ts diff --git a/extensions/markdown-language-features/extension-browser.webpack.config.js b/extensions/markdown-language-features/extension-browser.webpack.config.js index bad27aab02e..47f50aa5e8f 100644 --- a/extensions/markdown-language-features/extension-browser.webpack.config.js +++ b/extensions/markdown-language-features/extension-browser.webpack.config.js @@ -7,13 +7,25 @@ 'use strict'; -const withBrowserDefaults = require('../shared.webpack.config').browser; +const CopyPlugin = require('copy-webpack-plugin'); +const { browserPlugins, browser } = require('../shared.webpack.config'); -module.exports = withBrowserDefaults({ +module.exports = browser({ context: __dirname, entry: { extension: './src/extension.browser.ts' - } + }, + plugins: [ + ...browserPlugins(__dirname), // add plugins, don't replace inherited + new CopyPlugin({ + patterns: [ + { + from: './node_modules/vscode-markdown-languageserver/dist/browser/workerMain.js', + to: 'serverWorkerMain.js', + } + ], + }), + ], }, { configFile: 'tsconfig.browser.json' }); diff --git a/extensions/markdown-language-features/extension.webpack.config.js b/extensions/markdown-language-features/extension.webpack.config.js index de88398eca0..588d0632fd2 100644 --- a/extensions/markdown-language-features/extension.webpack.config.js +++ b/extensions/markdown-language-features/extension.webpack.config.js @@ -7,6 +7,7 @@ 'use strict'; +const CopyPlugin = require('copy-webpack-plugin'); const withDefaults = require('../shared.webpack.config'); module.exports = withDefaults({ @@ -16,5 +17,16 @@ module.exports = withDefaults({ }, entry: { extension: './src/extension.ts', - } + }, + plugins: [ + ...withDefaults.nodePlugins(__dirname), // add plugins, don't replace inherited + new CopyPlugin({ + patterns: [ + { + from: './node_modules/vscode-markdown-languageserver/dist/node/workerMain.js', + to: 'serverWorkerMain.js', + } + ], + }), + ], }); diff --git a/extensions/markdown-language-features/media/markdown.css b/extensions/markdown-language-features/media/markdown.css index 168f6a8a862..800be985a43 100644 --- a/extensions/markdown-language-features/media/markdown.css +++ b/extensions/markdown-language-features/media/markdown.css @@ -205,7 +205,7 @@ table > tbody > tr + tr > td { blockquote { margin: 0; - padding: 2px 16px 0 10px; + padding: 0px 16px 0 10px; border-left-width: 5px; border-left-style: solid; border-radius: 2px; diff --git a/extensions/markdown-language-features/package-lock.json b/extensions/markdown-language-features/package-lock.json new file mode 100644 index 00000000000..cfeb2c76228 --- /dev/null +++ b/extensions/markdown-language-features/package-lock.json @@ -0,0 +1,695 @@ +{ + "name": "markdown-language-features", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "markdown-language-features", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@vscode/extension-telemetry": "^0.9.0", + "dompurify": "^3.0.5", + "highlight.js": "^11.8.0", + "markdown-it": "^12.3.2", + "markdown-it-front-matter": "^0.2.4", + "morphdom": "^2.6.1", + "picomatch": "^2.3.1", + "punycode": "^2.3.1", + "vscode-languageclient": "^8.0.2", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-markdown-languageserver": "^0.5.0-alpha.8", + "vscode-uri": "^3.0.3" + }, + "devDependencies": { + "@types/dompurify": "^3.0.2", + "@types/lodash.throttle": "^4.1.3", + "@types/markdown-it": "12.2.3", + "@types/picomatch": "^2.3.0", + "@types/vscode-notebook-renderer": "^1.60.0", + "@types/vscode-webview": "^1.57.0", + "@vscode/markdown-it-katex": "^1.0.2", + "lodash.throttle": "^4.1.1", + "vscode-languageserver-types": "^3.17.2", + "vscode-markdown-languageservice": "^0.3.0-alpha.3" + }, + "engines": { + "vscode": "^1.70.0" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz", + "integrity": "sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz", + "integrity": "sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.0.3", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz", + "integrity": "sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz", + "integrity": "sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz", + "integrity": "sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz", + "integrity": "sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.0.4", + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", + "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.3.0.tgz", + "integrity": "sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz", + "integrity": "sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==" + }, + "node_modules/@types/dompurify": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/dompurify/-/dompurify-3.0.2.tgz", + "integrity": "sha512-YBL4ziFebbbfQfH5mlC+QTJsvh0oJUrWbmxKMyEdL7emlHJqGR2Qb34TEFKj+VCayBvjKy3xczMFNhugThUsfQ==", + "dev": true, + "dependencies": { + "@types/trusted-types": "*" + } + }, + "node_modules/@types/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", + "dev": true + }, + "node_modules/@types/lodash": { + "version": "4.14.104", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.104.tgz", + "integrity": "sha512-ufQcVg4daO8xQ5kopxRHanqFdL4AI7ondQkV+2f+7mz3gvp0LkBx2zBRC6hfs3T87mzQFmf5Fck7Fi145Ul6NQ==", + "dev": true + }, + "node_modules/@types/lodash.throttle": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@types/lodash.throttle/-/lodash.throttle-4.1.3.tgz", + "integrity": "sha512-FUm7uMuYRX7dzqmgX02bxdBwC75owUxGA4dDKtFePDLJ6N1ofXxkRX3NhJV8wOrNs/wCjaY6sDVJrD1lbyERoQ==", + "dev": true, + "dependencies": { + "@types/lodash": "*" + } + }, + "node_modules/@types/markdown-it": { + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", + "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "dev": true, + "dependencies": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, + "node_modules/@types/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", + "dev": true + }, + "node_modules/@types/picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@types/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-O397rnSS9iQI4OirieAtsDqvCj4+3eY1J+EPdNTKuHuRWIfUoGyzX294o8C4KJYaLqgSrd2o60c5EqCU8Zv02g==", + "dev": true + }, + "node_modules/@types/trusted-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz", + "integrity": "sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==", + "dev": true + }, + "node_modules/@types/vscode-notebook-renderer": { + "version": "1.60.0", + "resolved": "https://registry.npmjs.org/@types/vscode-notebook-renderer/-/vscode-notebook-renderer-1.60.0.tgz", + "integrity": "sha512-u7TD2uuEZTVuitx0iijOJdKI0JLiQP6PsSBSRy2XmHXUOXcp5p1S56NrjOEDoF+PIHd3NL3eO6KTRSf5nukDqQ==", + "dev": true + }, + "node_modules/@types/vscode-webview": { + "version": "1.57.0", + "resolved": "https://registry.npmjs.org/@types/vscode-webview/-/vscode-webview-1.57.0.tgz", + "integrity": "sha512-x3Cb/SMa1IwRHfSvKaZDZOTh4cNoG505c3NjTqGlMC082m++x/ETUmtYniDsw6SSmYzZXO8KBNhYxR0+VqymqA==", + "dev": true + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz", + "integrity": "sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.0.3", + "@microsoft/1ds-post-js": "^4.0.3", + "@microsoft/applicationinsights-web-basic": "^3.0.4" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/@vscode/l10n": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.11.tgz", + "integrity": "sha512-ukOMWnCg1tCvT7WnDfsUKQOFDQGsyR5tNgRpwmqi+5/vzU3ghdDXzvIM4IOPdSb3OeSsBNvmSL8nxIVOqi2WXA==" + }, + "node_modules/@vscode/markdown-it-katex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@vscode/markdown-it-katex/-/markdown-it-katex-1.0.2.tgz", + "integrity": "sha512-QY/OnOHPTqc8tQoCoAjVblILX4yE6xGZHKODtiTKqA328OXra+lSpeJO5Ouo9AAvrs9AwcCLz6xvW3zwcsPBQg==", + "dev": true, + "dependencies": { + "katex": "^0.16.4" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/dompurify": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.5.tgz", + "integrity": "sha512-F9e6wPGtY+8KNMRAVfxeCOHU0/NPWMSENNq4pQctuXRqqdEPW7q3CrLbR5Nse044WwacyjHGOMlvNsBe1y6z9A==" + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "bin": { + "he": "bin/he" + } + }, + "node_modules/highlight.js": { + "version": "11.8.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.8.0.tgz", + "integrity": "sha512-MedQhoqVdr0U6SSnWPzfiadUcDHfN/Wzq25AkXiQv9oiOO/sG0S7XkvpFIqWBl9Yq1UYyYOOVORs5UW2XlPyzg==", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/katex": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.10.tgz", + "integrity": "sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA==", + "dev": true, + "funding": [ + "https://opencollective.com/katex", + "https://github.com/sponsors/katex" + ], + "dependencies": { + "commander": "^8.3.0" + }, + "bin": { + "katex": "cli.js" + } + }, + "node_modules/linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dependencies": { + "uc.micro": "^1.0.1" + } + }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dependencies": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/markdown-it-front-matter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/markdown-it-front-matter/-/markdown-it-front-matter-0.2.4.tgz", + "integrity": "sha512-25GUs0yjS2hLl8zAemVndeEzThB1p42yxuDEKbd4JlL3jiz+jsm6e56Ya8B0VREOkNxLYB4TTwaoPJ3ElMmW+w==" + }, + "node_modules/markdown-it/node_modules/entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/morphdom": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/morphdom/-/morphdom-2.6.1.tgz", + "integrity": "sha512-Y8YRbAEP3eKykroIBWrjcfMw7mmwJfjhqdpSvoqinu8Y702nAwikpXcNFDiIkyvfCLxLM9Wu95RZqo4a9jFBaA==" + }, + "node_modules/node-html-parser": { + "version": "6.1.13", + "resolved": "https://registry.npmjs.org/node-html-parser/-/node-html-parser-6.1.13.tgz", + "integrity": "sha512-qIsTMOY4C/dAa5Q5vsobRpOOvPfC4pB61UVW2uSwZNUp0QU/jCekTal1vMmbO0DgdHeLUJpv/ARmDqErVxA3Sg==", + "dependencies": { + "css-select": "^5.1.0", + "he": "1.2.0" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "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/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, + "node_modules/vscode-jsonrpc": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz", + "integrity": "sha512-RY7HwI/ydoC1Wwg4gJ3y6LpU9FJRZAUnTYMXthqhFXXu77ErDd/xkREpGuk4MyYkk4a+XDWAMqe0S3KkelYQEQ==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageclient": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.0.2.tgz", + "integrity": "sha512-lHlthJtphG9gibGb/y72CKqQUxwPsMXijJVpHEC2bvbFqxmkj9LwQ3aGU9dwjBLqsX1S4KjShYppLvg1UJDF/Q==", + "dependencies": { + "minimatch": "^3.0.4", + "semver": "^7.3.5", + "vscode-languageserver-protocol": "3.17.2" + }, + "engines": { + "vscode": "^1.67.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", + "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", + "dependencies": { + "vscode-languageserver-protocol": "3.17.3" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.2", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2.tgz", + "integrity": "sha512-8kYisQ3z/SQ2kyjlNeQxbkkTNmVFoQCqkmGrzLH6A9ecPlgTbp3wDTnUNqaUxYr4vlAcloxx8zwy7G5WdguYNg==", + "dependencies": { + "vscode-jsonrpc": "8.0.2", + "vscode-languageserver-types": "3.17.2" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.2", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz", + "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" + }, + "node_modules/vscode-languageserver/node_modules/vscode-jsonrpc": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", + "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol": { + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", + "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", + "dependencies": { + "vscode-jsonrpc": "8.1.0", + "vscode-languageserver-types": "3.17.3" + } + }, + "node_modules/vscode-languageserver/node_modules/vscode-languageserver-types": { + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", + "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" + }, + "node_modules/vscode-markdown-languageserver": { + "version": "0.5.0-alpha.8", + "resolved": "https://registry.npmjs.org/vscode-markdown-languageserver/-/vscode-markdown-languageserver-0.5.0-alpha.8.tgz", + "integrity": "sha512-Bp6YXHy4EMQ8JpsmXpQHa78byLvv83wVnLmhVfTaJsZTBwF8IOJ56NBUasepg9L6QVffUA9T2H/PfBqEOGpeOQ==", + "dependencies": { + "@vscode/l10n": "^0.0.11", + "vscode-languageserver": "^8.1.0", + "vscode-languageserver-textdocument": "^1.0.8", + "vscode-languageserver-types": "^3.17.3", + "vscode-markdown-languageservice": "^0.5.0-alpha.7", + "vscode-uri": "^3.0.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/vscode-markdown-languageserver/node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" + }, + "node_modules/vscode-markdown-languageserver/node_modules/vscode-markdown-languageservice": { + "version": "0.5.0-alpha.7", + "resolved": "https://registry.npmjs.org/vscode-markdown-languageservice/-/vscode-markdown-languageservice-0.5.0-alpha.7.tgz", + "integrity": "sha512-Iq9S5YGHm3D/UG9Usm8a/O5tYCo9FwaMF7nJsDQCxKgVZu5OzwOj3ixDkhoM+c8GKXiwt23DxhhWRuvI4odkTg==", + "dependencies": { + "@vscode/l10n": "^0.0.10", + "node-html-parser": "^6.1.5", + "picomatch": "^2.3.1", + "vscode-languageserver-protocol": "^3.17.1", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-uri": "^3.0.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/vscode-markdown-languageserver/node_modules/vscode-markdown-languageservice/node_modules/@vscode/l10n": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.10.tgz", + "integrity": "sha512-E1OCmDcDWa0Ya7vtSjp/XfHFGqYJfh+YPC1RkATU71fTac+j1JjCcB3qwSzmlKAighx2WxhLlfhS0RwAN++PFQ==" + }, + "node_modules/vscode-markdown-languageservice": { + "version": "0.3.0-alpha.3", + "resolved": "https://registry.npmjs.org/vscode-markdown-languageservice/-/vscode-markdown-languageservice-0.3.0-alpha.3.tgz", + "integrity": "sha512-KPjIuCkSqabkzci7TnlLKep5FYIC45tS7UC5H8zoOii7aoKJru5mZBDXJt86bM3XTgnfpW7rUYqhNnvXbbCBbw==", + "dev": true, + "dependencies": { + "@vscode/l10n": "^0.0.10", + "picomatch": "^2.3.1", + "vscode-languageserver-textdocument": "^1.0.5", + "vscode-languageserver-types": "^3.17.1", + "vscode-uri": "^3.0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/vscode-markdown-languageservice/node_modules/@vscode/l10n": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.10.tgz", + "integrity": "sha512-E1OCmDcDWa0Ya7vtSjp/XfHFGqYJfh+YPC1RkATU71fTac+j1JjCcB3qwSzmlKAighx2WxhLlfhS0RwAN++PFQ==", + "dev": true + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/extensions/markdown-language-features/package.json b/extensions/markdown-language-features/package.json index e238a24b0fe..ad6446073f3 100644 --- a/extensions/markdown-language-features/package.json +++ b/extensions/markdown-language-features/package.json @@ -708,14 +708,11 @@ "%configuration.markdown.preferredMdPathExtensionStyle.removeExtension%" ] }, - "markdown.experimental.updateLinksOnPaste": { + "markdown.editor.updateLinksOnPaste.enabled": { "type": "boolean", - "default": false, - "markdownDescription": "%configuration.markdown.experimental.updateLinksOnPaste%", + "markdownDescription": "%configuration.markdown.editor.updateLinksOnPaste.enabled%", "scope": "resource", - "tags": [ - "experimental" - ] + "default": true } } }, @@ -756,8 +753,8 @@ ] }, "scripts": { - "compile": "gulp compile-extension:markdown-language-features-languageService && gulp compile-extension:markdown-language-features-server && gulp compile-extension:markdown-language-features && npm run build-preview && npm run build-notebook", - "watch": "npm run build-preview && gulp watch-extension:markdown-language-features watch-extension:markdown-language-features-languageService watch-extension:markdown-language-features-server", + "compile": "gulp compile-extension:markdown-language-features-languageService && gulp compile-extension:markdown-language-features && npm run build-preview && npm run build-notebook", + "watch": "npm run build-preview && gulp watch-extension:markdown-language-features watch-extension:markdown-language-features-languageService", "vscode:prepublish": "npm run build-ext && npm run build-preview", "build-ext": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:markdown-language-features ./tsconfig.json", "build-notebook": "node ./esbuild-notebook", @@ -773,8 +770,10 @@ "markdown-it-front-matter": "^0.2.4", "morphdom": "^2.6.1", "picomatch": "^2.3.1", + "punycode": "^2.3.1", "vscode-languageclient": "^8.0.2", "vscode-languageserver-textdocument": "^1.0.11", + "vscode-markdown-languageserver": "^0.5.0-alpha.8", "vscode-uri": "^3.0.3" }, "devDependencies": { diff --git a/extensions/markdown-language-features/package.nls.json b/extensions/markdown-language-features/package.nls.json index 3549ec58c51..da567b46665 100644 --- a/extensions/markdown-language-features/package.nls.json +++ b/extensions/markdown-language-features/package.nls.json @@ -91,6 +91,6 @@ "configuration.markdown.preferredMdPathExtensionStyle.removeExtension": "Prefer removing the file extension. For example, path completions to a file named `file.md` will insert `file` without the `.md`.", "configuration.markdown.editor.filePaste.videoSnippet": "Snippet used when adding videos to Markdown. This snippet can use the following variables:\n- `${src}` — The resolved path of the video file.\n- `${title}` — The title used for the video. A snippet placeholder will automatically be created for this variable.", "configuration.markdown.editor.filePaste.audioSnippet": "Snippet used when adding audio to Markdown. This snippet can use the following variables:\n- `${src}` — The resolved path of the audio file.\n- `${title}` — The title used for the audio. A snippet placeholder will automatically be created for this variable.", - "configuration.markdown.experimental.updateLinksOnPaste": "Enable/disable automatic updating of links in text that is copied and pasted from one Markdown editor to another.", + "configuration.markdown.editor.updateLinksOnPaste.enabled": "Enable/disable a paste option that updates links and reference in text that is copied and pasted between Markdown editors.\n\nTo use this feature, after pasting text that contains updatable links, just click on the Paste Widget and select `Paste and update pasted links`.", "workspaceTrust": "Required for loading styles configured in the workspace." } diff --git a/extensions/markdown-language-features/schemas/package.schema.json b/extensions/markdown-language-features/schemas/package.schema.json index 5591d0b0032..8dea48f757f 100644 --- a/extensions/markdown-language-features/schemas/package.schema.json +++ b/extensions/markdown-language-features/schemas/package.schema.json @@ -1,6 +1,5 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Markdown contributions to package.json", "type": "object", "properties": { "contributes": { diff --git a/extensions/markdown-language-features/server/.npmignore b/extensions/markdown-language-features/server/.npmignore deleted file mode 100644 index bfd4215998c..00000000000 --- a/extensions/markdown-language-features/server/.npmignore +++ /dev/null @@ -1,12 +0,0 @@ -.vscode/ -.github/ -out/test/ -src/ -.eslintrc.js -.gitignore -tsconfig*.json -*.tsbuildinfo -*.map -example.cjs -CODE_OF_CONDUCT.md -SECURITY.md \ No newline at end of file diff --git a/extensions/markdown-language-features/server/.vscode/launch.json b/extensions/markdown-language-features/server/.vscode/launch.json deleted file mode 100644 index fd9033bffaa..00000000000 --- a/extensions/markdown-language-features/server/.vscode/launch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "0.1.0", - // List of configurations. Add new configurations or edit existing ones. - "configurations": [ - { - "name": "Attach", - "type": "node", - "request": "attach", - "port": 7997, - "sourceMaps": true, - "outFiles": [ - "${workspaceFolder}/out/**/*.js" - ] - } - ] -} \ No newline at end of file diff --git a/extensions/markdown-language-features/server/.vscode/settings.json b/extensions/markdown-language-features/server/.vscode/settings.json deleted file mode 100644 index 7a73a41bfdf..00000000000 --- a/extensions/markdown-language-features/server/.vscode/settings.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/extensions/markdown-language-features/server/.vscode/tasks.json b/extensions/markdown-language-features/server/.vscode/tasks.json deleted file mode 100644 index ecc951a7baf..00000000000 --- a/extensions/markdown-language-features/server/.vscode/tasks.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": "2.0.0", - "command": "npm", - "args": [ - "run", - "watch" - ], - "isBackground": true, - "problemMatcher": "$tsc-watch", - "tasks": [ - { - "label": "npm", - "type": "shell", - "command": "npm", - "args": [ - "run", - "watch" - ], - "isBackground": true, - "problemMatcher": "$tsc-watch", - "group": { - "_id": "build", - "isDefault": false - } - } - ] -} \ No newline at end of file diff --git a/extensions/markdown-language-features/server/CHANGELOG.md b/extensions/markdown-language-features/server/CHANGELOG.md deleted file mode 100644 index a5cc9d15cf1..00000000000 --- a/extensions/markdown-language-features/server/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# Changelog - -# 0.4.0-alpha.3 — June 2, 2023 -- Pick up [Markdown Language Service](https://github.com/microsoft/vscode-markdown-languageservice) 0.4.0-alpha.3. See [CHANGELOG](https://github.com/microsoft/vscode-markdown-languageservice/blob/main/CHANGELOG.md#040-alpha3--may-30-2023) for details. - -## 0.3.0 - March 28, 2023 -- Pick up [Markdown Language Service](https://github.com/microsoft/vscode-markdown-languageservice) 0.3.0. See [CHANGELOG](https://github.com/microsoft/vscode-markdown-languageservice/blob/main/CHANGELOG.md#030--march-16-2023) for details. diff --git a/extensions/markdown-language-features/server/README.md b/extensions/markdown-language-features/server/README.md deleted file mode 100644 index 4114d2698bf..00000000000 --- a/extensions/markdown-language-features/server/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# Markdown Language Server - -> **❗ Import** This is still in development. While the language server is being used by VS Code, it has not yet been tested with other clients. - -The Markdown language server powers VS Code's built-in markdown support, providing tools for writing and browsing Markdown files. It runs as a separate executable and implements the [language server protocol](https://microsoft.github.io/language-server-protocol/overview). - -This server uses the [Markdown Language Service](https://github.com/microsoft/vscode-markdown-languageservice) to implement almost all of the language features. You can use that library if you need a library for working with Markdown instead of a full language server. - -## Server capabilities - -- [Completions](https://microsoft.github.io/language-server-protocol/specification#textDocument_completion) for Markdown links. - -- [Folding](https://microsoft.github.io/language-server-protocol/specification#textDocument_foldingRange) of Markdown regions, block elements, and header sections. - -- [Smart selection](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_selectionRange) for inline elements, block elements, and header sections. - -- [Document Symbols](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol) for quick navigation to headers in a document. - -- [Workspace Symbols](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_symbol) for quick navigation to headers in the workspace - -- [Document links](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentLink) for making Markdown links in a document clickable. - -- [Find all references](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_references) to headers and links across all Markdown files in the workspace. - -- [Go to definition](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_definition) from links to headers or link definitions. - -- [Rename](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_rename) of headers and links across all Markdown files in the workspace. - -- Find all references to a file. Uses a custom `markdown/getReferencesToFileInWorkspace` message. - -- [Code Actions](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeAction) - - - Organize link definitions source action. - - Extract link to definition refactoring. - -- Updating links when a file is moved / renamed. Uses a custom `markdown/getEditForFileRenames` message. - -- [Pull diagnostics (validation)](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_pullDiagnostics) for links. - -## Client requirements - -### Initialization options - -The client can send the following initialization options to the server: - -- `markdownFileExtensions` Array file extensions that should be considered as Markdown. These should not include the leading `.`. For example: `['md', 'mdown', 'markdown']`. - -### Settings - -Clients may send a `workspace/didChangeConfiguration` notification to notify the server of settings changes. -The server supports the following settings: - -- `markdown` - - `suggest` - - `paths` - - `enabled` — Enable/disable path suggestions. - - - `occurrencesHighlight` - - `enabled` — Enable/disable highlighting of link occurrences. - - - `validate` - - `enabled` — Enable/disable all validation. - - `referenceLinks` - - `enabled` — Enable/disable validation of reference links: `[text][ref]` - - `fragmentLinks` - - `enabled` — Enable/disable validation of links to fragments in the current files: `[text](#head)` - - `fileLinks` - - `enabled` — Enable/disable validation of links to file in the workspace. - - `markdownFragmentLinks` — Enable/disable validation of links to headers in other Markdown files. Use `inherit` to inherit the `fragmentLinks` setting. - - `ignoredLinks` — Array of glob patterns for files that should not be validated. - - `unusedLinkDefinitions` - - `enabled` — Enable/disable validation of unused link definitions. - - `duplicateLinkDefinitions` - - `enabled` — Enable/disable validation of duplicated link definitions. - -### Custom requests - -To support all of the features of the language server, the client needs to implement a few custom request types. The definitions of these request types can be found in [`protocol.ts`](./src/protocol.ts) - -#### `markdown/parse` - -Get the tokens for a Markdown file. Clients are expected to use [Markdown-it](https://github.com/markdown-it/markdown-it) for this. - -We require that clients bring their own version of Markdown-it so that they can customize/extend Markdown-it. - -#### `markdown/fs/readFile` - -Read the contents of a file in the workspace. - -#### `markdown/fs/readDirectory` - -Read the contents of a directory in the workspace. - -#### `markdown/fs/stat` - -Check if a given file/directory exists in the workspace. - -#### `markdown/fs/watcher/create` - -Create a file watcher. This is needed for diagnostics support. - -#### `markdown/fs/watcher/delete` - -Delete a previously created file watcher. - -#### `markdown/findMarkdownFilesInWorkspace` - -Get a list of all markdown files in the workspace. - -## Contribute - -The source code of the Markdown language server can be found in the [VSCode repository](https://github.com/microsoft/vscode) at [extensions/markdown-language-features/server](https://github.com/microsoft/vscode/tree/master/extensions/markdown-language-features/server). - -File issues and pull requests in the [VSCode GitHub Issues](https://github.com/microsoft/vscode/issues). See the document [How to Contribute](https://github.com/microsoft/vscode/wiki/How-to-Contribute) on how to build and run from source. - -Most of the functionality of the server is located in libraries: - -- [vscode-markdown-languageservice](https://github.com/microsoft/vscode-markdown-languageservice) contains the implementation of all features as a reusable library. -- [vscode-languageserver-node](https://github.com/microsoft/vscode-languageserver-node) contains the implementation of language server for NodeJS. - -Help on any of these projects is very welcome. - -## Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -## License - -Copyright (c) Microsoft Corporation. All rights reserved. - -Licensed under the [MIT](https://github.com/microsoft/vscode/blob/master/LICENSE.txt) License. diff --git a/extensions/markdown-language-features/server/build/pipeline.yml b/extensions/markdown-language-features/server/build/pipeline.yml deleted file mode 100644 index 0c9e3bdbd11..00000000000 --- a/extensions/markdown-language-features/server/build/pipeline.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: $(Date:yyyyMMdd)$(Rev:.r) - -trigger: none -pr: none - -resources: - repositories: - - repository: templates - type: github - name: microsoft/vscode-engineering - ref: main - endpoint: Monaco - -parameters: - - name: publishPackage - displayName: Publish vscode-markdown-languageserver - type: boolean - default: false - -extends: - template: azure-pipelines/npm-package/pipeline.yml@templates - parameters: - npmPackages: - - name: vscode-markdown-languageserver - workingDirectory: extensions/markdown-language-features/server - - buildSteps: - - script: yarn install - displayName: Install dependencies - - - script: gulp compile-extension:markdown-language-features-server - displayName: Compile - - publishPackage: ${{ parameters.publishPackage }} - packagePlatform: 'Windows' diff --git a/extensions/markdown-language-features/server/extension-browser.webpack.config.js b/extensions/markdown-language-features/server/extension-browser.webpack.config.js deleted file mode 100644 index 2a9de70bc01..00000000000 --- a/extensions/markdown-language-features/server/extension-browser.webpack.config.js +++ /dev/null @@ -1,24 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -//@ts-check - -'use strict'; - -const withBrowserDefaults = require('../../shared.webpack.config').browser; -const path = require('path'); - -module.exports = withBrowserDefaults({ - context: __dirname, - entry: { - extension: './src/browser/workerMain.ts', - }, - output: { - filename: 'workerMain.js', - path: path.join(__dirname, 'dist', 'browser'), - libraryTarget: 'var', - library: 'serverExportVar' - } -}); diff --git a/extensions/markdown-language-features/server/package.json b/extensions/markdown-language-features/server/package.json deleted file mode 100644 index 532c2dec843..00000000000 --- a/extensions/markdown-language-features/server/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "vscode-markdown-languageserver", - "description": "Markdown language server", - "version": "0.5.0-alpha.6", - "author": "Microsoft Corporation", - "license": "MIT", - "engines": { - "node": "*" - }, - "main": "./out/node/main", - "browser": "./dist/browser/main", - "files": [ - "dist/**/*.js", - "out/**/*.js" - ], - "dependencies": { - "@vscode/l10n": "^0.0.11", - "vscode-languageserver": "^8.1.0", - "vscode-languageserver-textdocument": "^1.0.8", - "vscode-languageserver-types": "^3.17.3", - "vscode-markdown-languageservice": "^0.5.0-alpha.6", - "vscode-uri": "^3.0.7" - }, - "devDependencies": { - "@types/node": "20.x" - }, - "scripts": { - "compile": "gulp compile-extension:markdown-language-features-server", - "prepublishOnly": "npm run compile", - "watch": "gulp watch-extension:markdown-language-features-server", - "compile-web": "npx webpack-cli --config extension-browser.webpack.config --mode none", - "watch-web": "npx webpack-cli --config extension-browser.webpack.config --mode none --watch --info-verbosity verbose" - } -} diff --git a/extensions/markdown-language-features/server/src/browser/main.ts b/extensions/markdown-language-features/server/src/browser/main.ts deleted file mode 100644 index 126121080a8..00000000000 --- a/extensions/markdown-language-features/server/src/browser/main.ts +++ /dev/null @@ -1,14 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { BrowserMessageReader, BrowserMessageWriter, createConnection } from 'vscode-languageserver/browser'; -import { startVsCodeServer } from '../server'; - -const messageReader = new BrowserMessageReader(self); -const messageWriter = new BrowserMessageWriter(self); - -const connection = createConnection(messageReader, messageWriter); - -startVsCodeServer(connection); diff --git a/extensions/markdown-language-features/server/src/browser/workerMain.ts b/extensions/markdown-language-features/server/src/browser/workerMain.ts deleted file mode 100644 index e653751af40..00000000000 --- a/extensions/markdown-language-features/server/src/browser/workerMain.ts +++ /dev/null @@ -1,38 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -import * as l10n from '@vscode/l10n'; - -let initialized = false; -const pendingMessages: any[] = []; - -const messageHandler = async (e: any) => { - if (!initialized) { - const l10nLog: string[] = []; - initialized = true; - const i10lLocation = e.data.i10lLocation; - if (i10lLocation) { - try { - await l10n.config({ uri: i10lLocation }); - l10nLog.push(`l10n: Configured to ${i10lLocation.toString()}.`); - } catch (e) { - l10nLog.push(`l10n: Problems loading ${i10lLocation.toString()} : ${e}.`); - } - } else { - l10nLog.push(`l10n: No bundle configured.`); - } - - await import('./main'); - - if (self.onmessage !== messageHandler) { - pendingMessages.forEach(msg => self.onmessage?.(msg)); - pendingMessages.length = 0; - } - - l10nLog.forEach(console.log); - } else { - pendingMessages.push(e); - } -}; -self.onmessage = messageHandler; diff --git a/extensions/markdown-language-features/server/src/config.ts b/extensions/markdown-language-features/server/src/config.ts deleted file mode 100644 index 5992258b0b6..00000000000 --- a/extensions/markdown-language-features/server/src/config.ts +++ /dev/null @@ -1,32 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { LsConfiguration } from 'vscode-markdown-languageservice'; - -export { LsConfiguration }; - -const defaultConfig: LsConfiguration = { - markdownFileExtensions: ['md'], - knownLinkedToFileExtensions: [ - 'jpg', - 'jpeg', - 'png', - 'gif', - 'webp', - 'bmp', - 'tiff', - ], - excludePaths: [ - '**/.*', - '**/node_modules/**', - ] -}; - -export function getLsConfiguration(overrides: Partial): LsConfiguration { - return { - ...defaultConfig, - ...overrides, - }; -} diff --git a/extensions/markdown-language-features/server/src/configuration.ts b/extensions/markdown-language-features/server/src/configuration.ts deleted file mode 100644 index 949573cfaf5..00000000000 --- a/extensions/markdown-language-features/server/src/configuration.ts +++ /dev/null @@ -1,74 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { Connection, Emitter } from 'vscode-languageserver'; -import { Disposable } from './util/dispose'; - -export type ValidateEnabled = 'ignore' | 'warning' | 'error' | 'hint'; - -export interface Settings { - readonly markdown: { - readonly server: { - readonly log: 'off' | 'debug' | 'trace'; - }; - - readonly preferredMdPathExtensionStyle: 'auto' | 'includeExtension' | 'removeExtension'; - - readonly occurrencesHighlight: { - readonly enabled: boolean; - }; - - readonly suggest: { - readonly paths: { - readonly enabled: boolean; - readonly includeWorkspaceHeaderCompletions: 'never' | 'onSingleOrDoubleHash' | 'onDoubleHash'; - }; - }; - - readonly validate: { - readonly enabled: true; - readonly referenceLinks: { - readonly enabled: ValidateEnabled; - }; - readonly fragmentLinks: { - readonly enabled: ValidateEnabled; - }; - readonly fileLinks: { - readonly enabled: ValidateEnabled; - readonly markdownFragmentLinks: ValidateEnabled | 'inherit'; - }; - readonly ignoredLinks: readonly string[]; - readonly unusedLinkDefinitions: { - readonly enabled: ValidateEnabled; - }; - readonly duplicateLinkDefinitions: { - readonly enabled: ValidateEnabled; - }; - }; - }; -} - - -export class ConfigurationManager extends Disposable { - - private readonly _onDidChangeConfiguration = this._register(new Emitter()); - public readonly onDidChangeConfiguration = this._onDidChangeConfiguration.event; - - private _settings?: Settings; - - constructor(connection: Connection) { - super(); - - // The settings have changed. Is send on server activation as well. - this._register(connection.onDidChangeConfiguration((change) => { - this._settings = change.settings; - this._onDidChangeConfiguration.fire(this._settings!); - })); - } - - public getSettings(): Settings | undefined { - return this._settings; - } -} diff --git a/extensions/markdown-language-features/server/src/languageFeatures/diagnostics.ts b/extensions/markdown-language-features/server/src/languageFeatures/diagnostics.ts deleted file mode 100644 index d21a6fdbfb6..00000000000 --- a/extensions/markdown-language-features/server/src/languageFeatures/diagnostics.ts +++ /dev/null @@ -1,114 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { Connection, FullDocumentDiagnosticReport, TextDocuments, UnchangedDocumentDiagnosticReport } from 'vscode-languageserver'; -import * as md from 'vscode-markdown-languageservice'; -import { Disposable } from 'vscode-notebook-renderer/events'; -import { URI } from 'vscode-uri'; -import { ConfigurationManager, ValidateEnabled } from '../configuration'; -import { disposeAll } from '../util/dispose'; - -const defaultDiagnosticOptions: md.DiagnosticOptions = { - validateFileLinks: md.DiagnosticLevel.ignore, - validateReferences: md.DiagnosticLevel.ignore, - validateFragmentLinks: md.DiagnosticLevel.ignore, - validateMarkdownFileLinkFragments: md.DiagnosticLevel.ignore, - validateUnusedLinkDefinitions: md.DiagnosticLevel.ignore, - validateDuplicateLinkDefinitions: md.DiagnosticLevel.ignore, - ignoreLinks: [], -}; - -function convertDiagnosticLevel(enabled: ValidateEnabled): md.DiagnosticLevel | undefined { - switch (enabled) { - case 'error': return md.DiagnosticLevel.error; - case 'warning': return md.DiagnosticLevel.warning; - case 'ignore': return md.DiagnosticLevel.ignore; - case 'hint': return md.DiagnosticLevel.hint; - default: return md.DiagnosticLevel.ignore; - } -} - -function getDiagnosticsOptions(config: ConfigurationManager): md.DiagnosticOptions { - const settings = config.getSettings(); - if (!settings) { - return defaultDiagnosticOptions; - } - - const validateFragmentLinks = convertDiagnosticLevel(settings.markdown.validate.fragmentLinks.enabled); - return { - validateFileLinks: convertDiagnosticLevel(settings.markdown.validate.fileLinks.enabled), - validateReferences: convertDiagnosticLevel(settings.markdown.validate.referenceLinks.enabled), - validateFragmentLinks: convertDiagnosticLevel(settings.markdown.validate.fragmentLinks.enabled), - validateMarkdownFileLinkFragments: settings.markdown.validate.fileLinks.markdownFragmentLinks === 'inherit' ? validateFragmentLinks : convertDiagnosticLevel(settings.markdown.validate.fileLinks.markdownFragmentLinks), - validateUnusedLinkDefinitions: convertDiagnosticLevel(settings.markdown.validate.unusedLinkDefinitions.enabled), - validateDuplicateLinkDefinitions: convertDiagnosticLevel(settings.markdown.validate.duplicateLinkDefinitions.enabled), - ignoreLinks: settings.markdown.validate.ignoredLinks, - }; -} - -export function registerValidateSupport( - connection: Connection, - workspace: md.IWorkspace, - documents: TextDocuments, - ls: md.IMdLanguageService, - config: ConfigurationManager, - logger: md.ILogger, -): Disposable { - let diagnosticOptions: md.DiagnosticOptions = defaultDiagnosticOptions; - function updateDiagnosticsSetting(): void { - diagnosticOptions = getDiagnosticsOptions(config); - } - - const subs: Disposable[] = []; - const manager = ls.createPullDiagnosticsManager(); - subs.push(manager); - - subs.push(manager.onLinkedToFileChanged(() => { - // TODO: We only need to refresh certain files - connection.languages.diagnostics.refresh(); - })); - - const emptyDiagnosticsResponse = Object.freeze({ kind: 'full', items: [] }); - - connection.languages.diagnostics.on(async (params, token): Promise => { - logger.log(md.LogLevel.Debug, 'connection.languages.diagnostics.on', { document: params.textDocument.uri }); - - if (!config.getSettings()?.markdown.validate.enabled) { - return emptyDiagnosticsResponse; - } - - const uri = URI.parse(params.textDocument.uri); - if (!workspace.hasMarkdownDocument(uri)) { - return emptyDiagnosticsResponse; - } - - const document = await workspace.openMarkdownDocument(uri); - if (!document) { - return emptyDiagnosticsResponse; - } - - const diagnostics = await manager.computeDiagnostics(document, diagnosticOptions, token); - return { - kind: 'full', - items: diagnostics, - }; - }); - - updateDiagnosticsSetting(); - subs.push(config.onDidChangeConfiguration(() => { - updateDiagnosticsSetting(); - connection.languages.diagnostics.refresh(); - })); - - subs.push(documents.onDidClose(e => { - manager.disposeDocumentResources(URI.parse(e.document.uri)); - })); - - return { - dispose: () => { - disposeAll(subs); - } - }; -} diff --git a/extensions/markdown-language-features/server/src/logging.ts b/extensions/markdown-language-features/server/src/logging.ts deleted file mode 100644 index 0df6b8e0cc5..00000000000 --- a/extensions/markdown-language-features/server/src/logging.ts +++ /dev/null @@ -1,81 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as md from 'vscode-markdown-languageservice'; -import { ConfigurationManager } from './configuration'; -import { Disposable } from './util/dispose'; - -export class LogFunctionLogger extends Disposable implements md.ILogger { - - private static now(): string { - const now = new Date(); - return String(now.getUTCHours()).padStart(2, '0') - + ':' + String(now.getMinutes()).padStart(2, '0') - + ':' + String(now.getUTCSeconds()).padStart(2, '0') + '.' + String(now.getMilliseconds()).padStart(3, '0'); - } - - private static data2String(data: any): string { - if (data instanceof Error) { - if (typeof data.stack === 'string') { - return data.stack; - } - return data.message; - } - if (typeof data === 'string') { - return data; - } - return JSON.stringify(data, undefined, 2); - } - - private _logLevel: md.LogLevel; - - constructor( - private readonly _logFn: typeof console.log, - private readonly _config: ConfigurationManager, - ) { - super(); - - this._register(this._config.onDidChangeConfiguration(() => { - this._logLevel = LogFunctionLogger.readLogLevel(this._config); - })); - - this._logLevel = LogFunctionLogger.readLogLevel(this._config); - } - - private static readLogLevel(config: ConfigurationManager): md.LogLevel { - switch (config.getSettings()?.markdown.server.log) { - case 'trace': return md.LogLevel.Trace; - case 'debug': return md.LogLevel.Debug; - case 'off': - default: - return md.LogLevel.Off; - } - } - - get level(): md.LogLevel { return this._logLevel; } - - public log(level: md.LogLevel, message: string, data?: any): void { - if (this.level < level) { - return; - } - - this.appendLine(`[${this.toLevelLabel(level)} ${LogFunctionLogger.now()}] ${message}`); - if (data) { - this.appendLine(LogFunctionLogger.data2String(data)); - } - } - - private toLevelLabel(level: md.LogLevel): string { - switch (level) { - case md.LogLevel.Off: return 'Off'; - case md.LogLevel.Debug: return 'Debug'; - case md.LogLevel.Trace: return 'Trace'; - } - } - - private appendLine(value: string): void { - this._logFn(value); - } -} diff --git a/extensions/markdown-language-features/server/src/node/main.ts b/extensions/markdown-language-features/server/src/node/main.ts deleted file mode 100644 index 7945d44acf6..00000000000 --- a/extensions/markdown-language-features/server/src/node/main.ts +++ /dev/null @@ -1,19 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { Connection, createConnection } from 'vscode-languageserver/node'; -import { startVsCodeServer } from '../server'; - -// Create a connection for the server. -const connection: Connection = createConnection(); - -console.log = connection.console.log.bind(connection.console); -console.error = connection.console.error.bind(connection.console); - -process.on('unhandledRejection', (e: any) => { - connection.console.error(`Unhandled exception ${e}`); -}); - -startVsCodeServer(connection); diff --git a/extensions/markdown-language-features/server/src/node/workerMain.ts b/extensions/markdown-language-features/server/src/node/workerMain.ts deleted file mode 100644 index f3369768012..00000000000 --- a/extensions/markdown-language-features/server/src/node/workerMain.ts +++ /dev/null @@ -1,23 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -import * as l10n from '@vscode/l10n'; - -async function setupMain() { - const l10nLog: string[] = []; - - const i10lLocation = process.env['VSCODE_L10N_BUNDLE_LOCATION']; - if (i10lLocation) { - try { - await l10n.config({ uri: i10lLocation }); - l10nLog.push(`l10n: Configured to ${i10lLocation.toString()}`); - } catch (e) { - l10nLog.push(`l10n: Problems loading ${i10lLocation.toString()} : ${e}`); - } - } - await import('./main'); - - l10nLog.forEach(console.log); -} -setupMain(); diff --git a/extensions/markdown-language-features/server/src/protocol.ts b/extensions/markdown-language-features/server/src/protocol.ts deleted file mode 100644 index d06edbd4303..00000000000 --- a/extensions/markdown-language-features/server/src/protocol.ts +++ /dev/null @@ -1,33 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { FileRename, RequestType } from 'vscode-languageserver'; -import type * as lsp from 'vscode-languageserver-types'; -import type * as md from 'vscode-markdown-languageservice'; - -//#region From server -export const parse = new RequestType<{ uri: string; text?: string }, md.Token[], any>('markdown/parse'); - -export const fs_readFile = new RequestType<{ uri: string }, number[], any>('markdown/fs/readFile'); -export const fs_readDirectory = new RequestType<{ uri: string }, [string, { isDirectory: boolean }][], any>('markdown/fs/readDirectory'); -export const fs_stat = new RequestType<{ uri: string }, { isDirectory: boolean } | undefined, any>('markdown/fs/stat'); - -export const fs_watcher_create = new RequestType<{ id: number; uri: string; options: md.FileWatcherOptions; watchParentDirs: boolean }, void, any>('markdown/fs/watcher/create'); -export const fs_watcher_delete = new RequestType<{ id: number }, void, any>('markdown/fs/watcher/delete'); - -export const findMarkdownFilesInWorkspace = new RequestType<{}, string[], any>('markdown/findMarkdownFilesInWorkspace'); -//#endregion - -//#region To server -export const getReferencesToFileInWorkspace = new RequestType<{ uri: string }, lsp.Location[], any>('markdown/getReferencesToFileInWorkspace'); -export const getEditForFileRenames = new RequestType('markdown/getEditForFileRenames'); - -export const prepareUpdatePastedLinks = new RequestType<{ uri: string; ranges: lsp.Range[] }, string, any>('markdown/prepareUpdatePastedLinks'); -export const getUpdatePastedLinksEdit = new RequestType<{ pasteIntoDoc: string; metadata: string; edits: lsp.TextEdit[] }, lsp.TextEdit[] | undefined, any>('markdown/getUpdatePastedLinksEdit'); - -export const fs_watcher_onChange = new RequestType<{ id: number; uri: string; kind: 'create' | 'change' | 'delete' }, void, any>('markdown/fs/watcher/onChange'); - -export const resolveLinkTarget = new RequestType<{ linkText: string; uri: string }, md.ResolvedDocumentLinkTarget, any>('markdown/resolveLinkTarget'); -//#endregion diff --git a/extensions/markdown-language-features/server/src/server.ts b/extensions/markdown-language-features/server/src/server.ts deleted file mode 100644 index f1df5494f3b..00000000000 --- a/extensions/markdown-language-features/server/src/server.ts +++ /dev/null @@ -1,399 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as l10n from '@vscode/l10n'; -import { CancellationToken, CompletionRegistrationOptions, CompletionRequest, Connection, Disposable, DocumentHighlightRegistrationOptions, DocumentHighlightRequest, InitializeParams, InitializeResult, NotebookDocuments, ResponseError, TextDocuments } from 'vscode-languageserver'; -import { TextDocument } from 'vscode-languageserver-textdocument'; -import * as lsp from 'vscode-languageserver-types'; -import * as md from 'vscode-markdown-languageservice'; -import { URI } from 'vscode-uri'; -import { LsConfiguration, getLsConfiguration } from './config'; -import { ConfigurationManager, Settings } from './configuration'; -import { registerValidateSupport } from './languageFeatures/diagnostics'; -import { LogFunctionLogger } from './logging'; -import * as protocol from './protocol'; -import { IDisposable } from './util/dispose'; -import { VsCodeClientWorkspace } from './workspace'; - -interface MdServerInitializationOptions extends LsConfiguration { } - -const organizeLinkDefKind = 'source.organizeLinkDefinitions'; - -export async function startVsCodeServer(connection: Connection) { - const configurationManager = new ConfigurationManager(connection); - const logger = new LogFunctionLogger(connection.console.log.bind(connection.console), configurationManager); - - const parser = new class implements md.IMdParser { - slugifier = md.githubSlugifier; - - tokenize(document: md.ITextDocument): Promise { - return connection.sendRequest(protocol.parse, { - uri: document.uri, - - // Clients won't be able to read temp documents. - // Send along the full text for parsing. - text: document.version < 0 ? document.getText() : undefined - }); - } - }; - - const documents = new TextDocuments(TextDocument); - const notebooks = new NotebookDocuments(documents); - - const workspaceFactory: WorkspaceFactory = ({ connection, config, workspaceFolders }) => { - const workspace = new VsCodeClientWorkspace(connection, config, documents, notebooks, logger); - workspace.workspaceFolders = (workspaceFolders ?? []).map(x => URI.parse(x.uri)); - return workspace; - }; - - return startServer(connection, { documents, notebooks, configurationManager, logger, parser, workspaceFactory }); -} - -type WorkspaceFactory = (config: { - connection: Connection; - config: LsConfiguration; - workspaceFolders?: lsp.WorkspaceFolder[] | null; -}) => md.IWorkspace; - -export async function startServer(connection: Connection, serverConfig: { - documents: TextDocuments; - notebooks?: NotebookDocuments; - configurationManager: ConfigurationManager; - logger: md.ILogger; - parser: md.IMdParser; - workspaceFactory: WorkspaceFactory; -}) { - const { documents, notebooks } = serverConfig; - - let mdLs: md.IMdLanguageService | undefined; - - connection.onInitialize((params: InitializeParams): InitializeResult => { - const initOptions = params.initializationOptions as MdServerInitializationOptions | undefined; - - const mdConfig = getLsConfiguration(initOptions ?? {}); - - const workspace = serverConfig.workspaceFactory({ connection, config: mdConfig, workspaceFolders: params.workspaceFolders }); - mdLs = md.createLanguageService({ - workspace, - parser: serverConfig.parser, - logger: serverConfig.logger, - ...mdConfig, - get preferredMdPathExtensionStyle() { - switch (serverConfig.configurationManager.getSettings()?.markdown.preferredMdPathExtensionStyle) { - case 'includeExtension': return md.PreferredMdPathExtensionStyle.includeExtension; - case 'removeExtension': return md.PreferredMdPathExtensionStyle.removeExtension; - case 'auto': - default: - return md.PreferredMdPathExtensionStyle.auto; - } - } - }); - - registerCompletionsSupport(connection, documents, mdLs, serverConfig.configurationManager); - registerDocumentHighlightSupport(connection, documents, mdLs, serverConfig.configurationManager); - registerValidateSupport(connection, workspace, documents, mdLs, serverConfig.configurationManager, serverConfig.logger); - - return { - capabilities: { - diagnosticProvider: { - documentSelector: null, - identifier: 'markdown', - interFileDependencies: true, - workspaceDiagnostics: false, - }, - codeActionProvider: { - resolveProvider: true, - codeActionKinds: [ - organizeLinkDefKind, - 'quickfix', - 'refactor', - ] - }, - definitionProvider: true, - documentLinkProvider: { resolveProvider: true }, - documentSymbolProvider: true, - foldingRangeProvider: true, - hoverProvider: true, - referencesProvider: true, - renameProvider: { prepareProvider: true, }, - selectionRangeProvider: true, - workspaceSymbolProvider: true, - workspace: { - workspaceFolders: { - supported: true, - changeNotifications: true, - }, - } - } - }; - }); - - connection.onDocumentLinks(async (params, token): Promise => { - const document = documents.get(params.textDocument.uri); - if (!document) { - return []; - } - return mdLs!.getDocumentLinks(document, token); - }); - - connection.onDocumentLinkResolve(async (link, token): Promise => { - return mdLs!.resolveDocumentLink(link, token); - }); - - connection.onDocumentSymbol(async (params, token): Promise => { - const document = documents.get(params.textDocument.uri); - if (!document) { - return []; - } - return mdLs!.getDocumentSymbols(document, { includeLinkDefinitions: true }, token); - }); - - connection.onFoldingRanges(async (params, token): Promise => { - const document = documents.get(params.textDocument.uri); - if (!document) { - return []; - } - return mdLs!.getFoldingRanges(document, token); - }); - - connection.onSelectionRanges(async (params, token): Promise => { - const document = documents.get(params.textDocument.uri); - if (!document) { - return []; - } - return mdLs!.getSelectionRanges(document, params.positions, token); - }); - - connection.onWorkspaceSymbol(async (params, token): Promise => { - return mdLs!.getWorkspaceSymbols(params.query, token); - }); - - connection.onReferences(async (params, token): Promise => { - const document = documents.get(params.textDocument.uri); - if (!document) { - return []; - } - return mdLs!.getReferences(document, params.position, params.context, token); - }); - - connection.onDefinition(async (params, token): Promise => { - const document = documents.get(params.textDocument.uri); - if (!document) { - return undefined; - } - return mdLs!.getDefinition(document, params.position, token); - }); - - connection.onPrepareRename(async (params, token) => { - const document = documents.get(params.textDocument.uri); - if (!document) { - return undefined; - } - - try { - return await mdLs!.prepareRename(document, params.position, token); - } catch (e) { - if (e instanceof md.RenameNotSupportedAtLocationError) { - throw new ResponseError(0, e.message); - } else { - throw e; - } - } - }); - - connection.onRenameRequest(async (params, token) => { - const document = documents.get(params.textDocument.uri); - if (!document) { - return undefined; - } - return mdLs!.getRenameEdit(document, params.position, params.newName, token); - }); - - interface OrganizeLinkActionData { - readonly uri: string; - } - - connection.onCodeAction(async (params, token) => { - const document = documents.get(params.textDocument.uri); - if (!document) { - return undefined; - } - - if (params.context.only?.some(kind => kind === 'source' || kind.startsWith('source.'))) { - const action: lsp.CodeAction = { - title: l10n.t("Organize link definitions"), - kind: organizeLinkDefKind, - data: { uri: document.uri } satisfies OrganizeLinkActionData, - }; - return [action]; - } - - return mdLs!.getCodeActions(document, params.range, params.context, token); - }); - - connection.onCodeActionResolve(async (codeAction, token) => { - if (codeAction.kind === organizeLinkDefKind) { - const data = codeAction.data as OrganizeLinkActionData; - const document = documents.get(data.uri); - if (!document) { - return codeAction; - } - - const edits = (await mdLs?.organizeLinkDefinitions(document, { removeUnused: true }, token)) || []; - codeAction.edit = { - changes: { - [data.uri]: edits - } - }; - return codeAction; - } - - return codeAction; - }); - - connection.onHover(async (params, token) => { - const document = documents.get(params.textDocument.uri); - if (!document) { - return null; - } - - return mdLs!.getHover(document, params.position, token); - }); - - connection.onRequest(protocol.getReferencesToFileInWorkspace, (async (params: { uri: string }, token: CancellationToken) => { - return mdLs!.getFileReferences(URI.parse(params.uri), token); - })); - - connection.onRequest(protocol.getEditForFileRenames, (async (params, token: CancellationToken) => { - const result = await mdLs!.getRenameFilesInWorkspaceEdit(params.map(x => ({ oldUri: URI.parse(x.oldUri), newUri: URI.parse(x.newUri) })), token); - if (!result) { - return result; - } - - return { - edit: result.edit, - participatingRenames: result.participatingRenames.map(rename => ({ oldUri: rename.oldUri.toString(), newUri: rename.newUri.toString() })) - }; - })); - - connection.onRequest(protocol.prepareUpdatePastedLinks, (async (params, token: CancellationToken) => { - const document = documents.get(params.uri); - if (!document) { - return undefined; - } - - return mdLs!.prepareUpdatePastedLinks(document, params.ranges, token); - })); - - connection.onRequest(protocol.getUpdatePastedLinksEdit, (async (params, token: CancellationToken) => { - const document = documents.get(params.pasteIntoDoc); - if (!document) { - return undefined; - } - - // TODO: Figure out why range types are lying - const edits = params.edits.map((edit: any) => lsp.TextEdit.replace(lsp.Range.create(edit.range[0].line, edit.range[0].character, edit.range[1].line, edit.range[1].character), edit.newText)); - return mdLs!.getUpdatePastedLinksEdit(document, edits, params.metadata, token); - })); - - connection.onRequest(protocol.resolveLinkTarget, (async (params, token: CancellationToken) => { - return mdLs!.resolveLinkTarget(params.linkText, URI.parse(params.uri), token); - })); - - documents.listen(connection); - notebooks?.listen(connection); - connection.listen(); -} - -function registerDynamicClientFeature( - config: ConfigurationManager, - isEnabled: (settings: Settings | undefined) => boolean, - register: () => Promise, -) { - let registration: Promise | undefined; - function update() { - const settings = config.getSettings(); - if (isEnabled(settings)) { - if (!registration) { - registration = register(); - } - } else { - registration?.then(x => x.dispose()); - registration = undefined; - } - } - - update(); - return config.onDidChangeConfiguration(() => update()); -} - -function registerCompletionsSupport( - connection: Connection, - documents: TextDocuments, - ls: md.IMdLanguageService, - config: ConfigurationManager, -): IDisposable { - function getIncludeWorkspaceHeaderCompletions(): md.IncludeWorkspaceHeaderCompletions { - switch (config.getSettings()?.markdown.suggest.paths.includeWorkspaceHeaderCompletions) { - case 'onSingleOrDoubleHash': return md.IncludeWorkspaceHeaderCompletions.onSingleOrDoubleHash; - case 'onDoubleHash': return md.IncludeWorkspaceHeaderCompletions.onDoubleHash; - case 'never': - default: return md.IncludeWorkspaceHeaderCompletions.never; - } - } - - connection.onCompletion(async (params, token): Promise => { - const settings = config.getSettings(); - if (!settings?.markdown.suggest.paths.enabled) { - return []; - } - - const document = documents.get(params.textDocument.uri); - if (document) { - // TODO: remove any type after picking up new release with correct types - return ls.getCompletionItems(document, params.position, { - ...(params.context || {}), - includeWorkspaceHeaderCompletions: getIncludeWorkspaceHeaderCompletions(), - } as any, token); - } - return []; - }); - - return registerDynamicClientFeature(config, (settings) => !!settings?.markdown.suggest.paths.enabled, () => { - const registrationOptions: CompletionRegistrationOptions = { - documentSelector: null, - triggerCharacters: ['.', '/', '#'], - }; - return connection.client.register(CompletionRequest.type, registrationOptions); - }); -} - -function registerDocumentHighlightSupport( - connection: Connection, - documents: TextDocuments, - mdLs: md.IMdLanguageService, - configurationManager: ConfigurationManager -) { - connection.onDocumentHighlight(async (params, token) => { - const settings = configurationManager.getSettings(); - if (!settings?.markdown.occurrencesHighlight.enabled) { - return undefined; - } - - const document = documents.get(params.textDocument.uri); - if (!document) { - return undefined; - } - - return mdLs!.getDocumentHighlights(document, params.position, token); - }); - - return registerDynamicClientFeature(configurationManager, (settings) => !!settings?.markdown.occurrencesHighlight.enabled, () => { - const registrationOptions: DocumentHighlightRegistrationOptions = { - documentSelector: null, - }; - return connection.client.register(DocumentHighlightRequest.type, registrationOptions); - }); -} diff --git a/extensions/markdown-language-features/server/src/util/dispose.ts b/extensions/markdown-language-features/server/src/util/dispose.ts deleted file mode 100644 index 2e9d8dc6a14..00000000000 --- a/extensions/markdown-language-features/server/src/util/dispose.ts +++ /dev/null @@ -1,54 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -export function disposeAll(disposables: Iterable) { - const errors: any[] = []; - - for (const disposable of disposables) { - try { - disposable.dispose(); - } catch (e) { - errors.push(e); - } - } - - if (errors.length === 1) { - throw errors[0]; - } else if (errors.length > 1) { - throw new AggregateError(errors, 'Encountered errors while disposing of store'); - } -} - -export interface IDisposable { - dispose(): void; -} - -export abstract class Disposable { - private _isDisposed = false; - - protected _disposables: IDisposable[] = []; - - public dispose(): any { - if (this._isDisposed) { - return; - } - this._isDisposed = true; - disposeAll(this._disposables); - } - - protected _register(value: T): T { - if (this._isDisposed) { - value.dispose(); - } else { - this._disposables.push(value); - } - return value; - } - - protected get isDisposed() { - return this._isDisposed; - } -} - diff --git a/extensions/markdown-language-features/server/src/util/file.ts b/extensions/markdown-language-features/server/src/util/file.ts deleted file mode 100644 index 10e95bf5dcf..00000000000 --- a/extensions/markdown-language-features/server/src/util/file.ts +++ /dev/null @@ -1,16 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { TextDocument } from 'vscode-languageserver-textdocument'; -import { URI, Utils } from 'vscode-uri'; -import { LsConfiguration } from '../config'; - -export function looksLikeMarkdownPath(config: LsConfiguration, resolvedHrefPath: URI) { - return config.markdownFileExtensions.includes(Utils.extname(resolvedHrefPath).toLowerCase().replace('.', '')); -} - -export function isMarkdownFile(document: TextDocument) { - return document.languageId === 'markdown'; -} diff --git a/extensions/markdown-language-features/server/src/util/limiter.ts b/extensions/markdown-language-features/server/src/util/limiter.ts deleted file mode 100644 index bd4153cd08b..00000000000 --- a/extensions/markdown-language-features/server/src/util/limiter.ts +++ /dev/null @@ -1,67 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -interface ILimitedTaskFactory { - factory: ITask>; - c: (value: T | Promise) => void; - e: (error?: unknown) => void; -} - -interface ITask { - (): T; -} - -/** - * A helper to queue N promises and run them all with a max degree of parallelism. The helper - * ensures that at any time no more than M promises are running at the same time. - * - * Taken from 'src/vs/base/common/async.ts' - */ -export class Limiter { - - private _size = 0; - private runningPromises: number; - private readonly maxDegreeOfParalellism: number; - private readonly outstandingPromises: ILimitedTaskFactory[]; - - constructor(maxDegreeOfParalellism: number) { - this.maxDegreeOfParalellism = maxDegreeOfParalellism; - this.outstandingPromises = []; - this.runningPromises = 0; - } - - get size(): number { - return this._size; - } - - queue(factory: ITask>): Promise { - this._size++; - - return new Promise((c, e) => { - this.outstandingPromises.push({ factory, c, e }); - this.consume(); - }); - } - - private consume(): void { - while (this.outstandingPromises.length && this.runningPromises < this.maxDegreeOfParalellism) { - const iLimitedTask = this.outstandingPromises.shift()!; - this.runningPromises++; - - const promise = iLimitedTask.factory(); - promise.then(iLimitedTask.c, iLimitedTask.e); - promise.then(() => this.consumed(), () => this.consumed()); - } - } - - private consumed(): void { - this._size--; - this.runningPromises--; - - if (this.outstandingPromises.length > 0) { - this.consume(); - } - } -} diff --git a/extensions/markdown-language-features/server/src/util/resourceMap.ts b/extensions/markdown-language-features/server/src/util/resourceMap.ts deleted file mode 100644 index 7cec9d661d3..00000000000 --- a/extensions/markdown-language-features/server/src/util/resourceMap.ts +++ /dev/null @@ -1,69 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { URI } from 'vscode-uri'; - - -type ResourceToKey = (uri: URI) => string; - -const defaultResourceToKey = (resource: URI): string => resource.toString(); - -export class ResourceMap { - - private readonly map = new Map(); - - private readonly toKey: ResourceToKey; - - constructor(toKey: ResourceToKey = defaultResourceToKey) { - this.toKey = toKey; - } - - public set(uri: URI, value: T): this { - this.map.set(this.toKey(uri), { uri, value }); - return this; - } - - public get(resource: URI): T | undefined { - return this.map.get(this.toKey(resource))?.value; - } - - public has(resource: URI): boolean { - return this.map.has(this.toKey(resource)); - } - - public get size(): number { - return this.map.size; - } - - public clear(): void { - this.map.clear(); - } - - public delete(resource: URI): boolean { - return this.map.delete(this.toKey(resource)); - } - - public *values(): IterableIterator { - for (const entry of this.map.values()) { - yield entry.value; - } - } - - public *keys(): IterableIterator { - for (const entry of this.map.values()) { - yield entry.uri; - } - } - - public *entries(): IterableIterator<[URI, T]> { - for (const entry of this.map.values()) { - yield [entry.uri, entry.value]; - } - } - - public [Symbol.iterator](): IterableIterator<[URI, T]> { - return this.entries(); - } -} diff --git a/extensions/markdown-language-features/server/src/workspace.ts b/extensions/markdown-language-features/server/src/workspace.ts deleted file mode 100644 index 13e5c6b4472..00000000000 --- a/extensions/markdown-language-features/server/src/workspace.ts +++ /dev/null @@ -1,433 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { Connection, Emitter, FileChangeType, NotebookDocuments, Position, Range, TextDocuments } from 'vscode-languageserver'; -import { TextDocument } from 'vscode-languageserver-textdocument'; -import * as md from 'vscode-markdown-languageservice'; -import { URI } from 'vscode-uri'; -import { LsConfiguration } from './config'; -import * as protocol from './protocol'; -import { isMarkdownFile, looksLikeMarkdownPath } from './util/file'; -import { Limiter } from './util/limiter'; -import { ResourceMap } from './util/resourceMap'; -import { Schemes } from './util/schemes'; - -declare const TextDecoder: any; - -class VsCodeDocument implements md.ITextDocument { - - private inMemoryDoc?: TextDocument; - private onDiskDoc?: TextDocument; - - readonly uri: string; - - constructor(uri: string, init: { inMemoryDoc: TextDocument }); - constructor(uri: string, init: { onDiskDoc: TextDocument }); - constructor(uri: string, init: { inMemoryDoc?: TextDocument; onDiskDoc?: TextDocument }) { - this.uri = uri; - this.inMemoryDoc = init?.inMemoryDoc; - this.onDiskDoc = init?.onDiskDoc; - } - - get version(): number { - return this.inMemoryDoc?.version ?? this.onDiskDoc?.version ?? 0; - } - - get lineCount(): number { - return this.inMemoryDoc?.lineCount ?? this.onDiskDoc?.lineCount ?? 0; - } - - getText(range?: Range): string { - if (this.inMemoryDoc) { - return this.inMemoryDoc.getText(range); - } - - if (this.onDiskDoc) { - return this.onDiskDoc.getText(range); - } - - throw new Error('Document has been closed'); - } - - positionAt(offset: number): Position { - if (this.inMemoryDoc) { - return this.inMemoryDoc.positionAt(offset); - } - - if (this.onDiskDoc) { - return this.onDiskDoc.positionAt(offset); - } - - throw new Error('Document has been closed'); - } - - offsetAt(position: Position): number { - if (this.inMemoryDoc) { - return this.inMemoryDoc.offsetAt(position); - } - - if (this.onDiskDoc) { - return this.onDiskDoc.offsetAt(position); - } - - throw new Error('Document has been closed'); - } - - hasInMemoryDoc(): boolean { - return !!this.inMemoryDoc; - } - - isDetached(): boolean { - return !this.onDiskDoc && !this.inMemoryDoc; - } - - setInMemoryDoc(doc: TextDocument | undefined) { - this.inMemoryDoc = doc; - } - - setOnDiskDoc(doc: TextDocument | undefined) { - this.onDiskDoc = doc; - } -} - -export class VsCodeClientWorkspace implements md.IWorkspaceWithWatching { - - private readonly _onDidCreateMarkdownDocument = new Emitter(); - public readonly onDidCreateMarkdownDocument = this._onDidCreateMarkdownDocument.event; - - private readonly _onDidChangeMarkdownDocument = new Emitter(); - public readonly onDidChangeMarkdownDocument = this._onDidChangeMarkdownDocument.event; - - private readonly _onDidDeleteMarkdownDocument = new Emitter(); - public readonly onDidDeleteMarkdownDocument = this._onDidDeleteMarkdownDocument.event; - - private readonly _documentCache = new ResourceMap(); - - private readonly _utf8Decoder = new TextDecoder('utf-8'); - - private _watcherPool = 0; - private readonly _watchers = new Map; - readonly onDidCreate: Emitter; - readonly onDidDelete: Emitter; - }>(); - - constructor( - private readonly connection: Connection, - private readonly config: LsConfiguration, - private readonly documents: TextDocuments, - private readonly notebooks: NotebookDocuments, - private readonly logger: md.ILogger, - ) { - documents.onDidOpen(e => { - if (!this.isRelevantMarkdownDocument(e.document)) { - return; - } - - this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace.TextDocument.onDidOpen', { document: e.document.uri }); - - const uri = URI.parse(e.document.uri); - const doc = this._documentCache.get(uri); - - if (doc) { - // File already existed on disk - doc.setInMemoryDoc(e.document); - - // The content visible to the language service may have changed since the in-memory doc - // may differ from the one on-disk. To be safe we always fire a change event. - this._onDidChangeMarkdownDocument.fire(doc); - } else { - // We're creating the file for the first time - const doc = new VsCodeDocument(e.document.uri, { inMemoryDoc: e.document }); - this._documentCache.set(uri, doc); - this._onDidCreateMarkdownDocument.fire(doc); - } - }); - - documents.onDidChangeContent(e => { - if (!this.isRelevantMarkdownDocument(e.document)) { - return; - } - - this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace.TextDocument.onDidChanceContent', { document: e.document.uri }); - - const uri = URI.parse(e.document.uri); - const entry = this._documentCache.get(uri); - if (entry) { - entry.setInMemoryDoc(e.document); - this._onDidChangeMarkdownDocument.fire(entry); - } - }); - - documents.onDidClose(async e => { - if (!this.isRelevantMarkdownDocument(e.document)) { - return; - } - - this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace.TextDocument.onDidClose', { document: e.document.uri }); - - const uri = URI.parse(e.document.uri); - const doc = this._documentCache.get(uri); - if (!doc) { - // Document was never opened - return; - } - - doc.setInMemoryDoc(undefined); - if (doc.isDetached()) { - // The document has been fully closed - this.doDeleteDocument(uri); - return; - } - - // Check that if file has been deleted on disk. - // This can happen when directories are renamed / moved. VS Code's file system watcher does not - // notify us when this happens. - if (!(await this.statBypassingCache(uri))) { - if (this._documentCache.get(uri) === doc && !doc.hasInMemoryDoc()) { - this.doDeleteDocument(uri); - return; - } - } - - // The document still exists on disk - // To be safe, tell the service that the document has changed because the - // in-memory doc contents may be different than the disk doc contents. - this._onDidChangeMarkdownDocument.fire(doc); - }); - - connection.onDidChangeWatchedFiles(async ({ changes }) => { - for (const change of changes) { - const resource = URI.parse(change.uri); - this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace.onDidChangeWatchedFiles', { type: change.type, resource: resource.toString() }); - switch (change.type) { - case FileChangeType.Changed: { - const entry = this._documentCache.get(resource); - if (entry) { - // Refresh the on-disk state - const document = await this.openMarkdownDocumentFromFs(resource); - if (document) { - this._onDidChangeMarkdownDocument.fire(document); - } - } - break; - } - case FileChangeType.Created: { - const entry = this._documentCache.get(resource); - if (entry) { - // Create or update the on-disk state - const document = await this.openMarkdownDocumentFromFs(resource); - if (document) { - this._onDidCreateMarkdownDocument.fire(document); - } - } - break; - } - case FileChangeType.Deleted: { - const entry = this._documentCache.get(resource); - if (entry) { - entry.setOnDiskDoc(undefined); - if (entry.isDetached()) { - this.doDeleteDocument(resource); - } - } - break; - } - } - } - }); - - connection.onRequest(protocol.fs_watcher_onChange, params => { - this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace.fs_watcher_onChange', { kind: params.kind, uri: params.uri }); - - const watcher = this._watchers.get(params.id); - if (!watcher) { - return; - } - - switch (params.kind) { - case 'create': watcher.onDidCreate.fire(URI.parse(params.uri)); return; - case 'change': watcher.onDidChange.fire(URI.parse(params.uri)); return; - case 'delete': watcher.onDidDelete.fire(URI.parse(params.uri)); return; - } - }); - } - - public listen() { - this.connection.workspace.onDidChangeWorkspaceFolders(async () => { - this.workspaceFolders = (await this.connection.workspace.getWorkspaceFolders() ?? []).map(x => URI.parse(x.uri)); - }); - } - - private _workspaceFolders: readonly URI[] = []; - - get workspaceFolders(): readonly URI[] { - return this._workspaceFolders; - } - - set workspaceFolders(value: readonly URI[]) { - this._workspaceFolders = value; - } - - async getAllMarkdownDocuments(): Promise> { - // Add opened files (such as untitled files) - const openTextDocumentResults = this.documents.all() - .filter(doc => this.isRelevantMarkdownDocument(doc)); - - const allDocs = new ResourceMap(); - for (const doc of openTextDocumentResults) { - allDocs.set(URI.parse(doc.uri), doc); - } - - // And then add files on disk - const maxConcurrent = 20; - const limiter = new Limiter(maxConcurrent); - const resources = await this.connection.sendRequest(protocol.findMarkdownFilesInWorkspace, {}); - await Promise.all(resources.map(strResource => { - return limiter.queue(async () => { - const resource = URI.parse(strResource); - if (allDocs.has(resource)) { - return; - } - - const doc = await this.openMarkdownDocument(resource); - if (doc) { - allDocs.set(resource, doc); - } - return doc; - }); - })); - - return allDocs.values(); - } - - hasMarkdownDocument(resource: URI): boolean { - return !!this.documents.get(resource.toString()); - } - - async openMarkdownDocument(resource: URI): Promise { - const existing = this._documentCache.get(resource); - if (existing) { - return existing; - } - - const matchingDocument = this.documents.get(resource.toString()); - if (matchingDocument) { - let entry = this._documentCache.get(resource); - if (entry) { - entry.setInMemoryDoc(matchingDocument); - } else { - entry = new VsCodeDocument(resource.toString(), { inMemoryDoc: matchingDocument }); - this._documentCache.set(resource, entry); - } - - return entry; - } - - return this.openMarkdownDocumentFromFs(resource); - } - - private async openMarkdownDocumentFromFs(resource: URI): Promise { - if (!looksLikeMarkdownPath(this.config, resource)) { - return undefined; - } - - try { - const response = await this.connection.sendRequest(protocol.fs_readFile, { uri: resource.toString() }); - // TODO: LSP doesn't seem to handle Array buffers well - const bytes = new Uint8Array(response); - - // We assume that markdown is in UTF-8 - const text = this._utf8Decoder.decode(bytes); - const doc = new VsCodeDocument(resource.toString(), { - onDiskDoc: TextDocument.create(resource.toString(), 'markdown', 0, text) - }); - this._documentCache.set(resource, doc); - return doc; - } catch (e) { - return undefined; - } - } - - async stat(resource: URI): Promise { - this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace.stat', { resource: resource.toString() }); - if (this._documentCache.has(resource)) { - return { isDirectory: false }; - } - return this.statBypassingCache(resource); - } - - private async statBypassingCache(resource: URI): Promise { - const uri = resource.toString(); - if (this.documents.get(uri)) { - return { isDirectory: false }; - } - const fsResult = await this.connection.sendRequest(protocol.fs_stat, { uri }); - return fsResult ?? undefined; // Force convert null to undefined - } - - async readDirectory(resource: URI): Promise<[string, md.FileStat][]> { - this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace.readDir', { resource: resource.toString() }); - return this.connection.sendRequest(protocol.fs_readDirectory, { uri: resource.toString() }); - } - - getContainingDocument(resource: URI): md.ContainingDocumentContext | undefined { - if (resource.scheme === Schemes.notebookCell) { - const nb = this.notebooks.findNotebookDocumentForCell(resource.toString()); - if (nb) { - return { - uri: URI.parse(nb.uri), - children: nb.cells.map(cell => ({ uri: URI.parse(cell.document) })), - }; - } - } - return undefined; - } - - watchFile(resource: URI, options: md.FileWatcherOptions): md.IFileSystemWatcher { - const id = this._watcherPool++; - this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace.watchFile', { id, resource: resource.toString() }); - - const entry = { - resource, - options, - onDidCreate: new Emitter(), - onDidChange: new Emitter(), - onDidDelete: new Emitter(), - }; - this._watchers.set(id, entry); - - this.connection.sendRequest(protocol.fs_watcher_create, { - id, - uri: resource.toString(), - options, - watchParentDirs: true, - }); - - return { - onDidCreate: entry.onDidCreate.event, - onDidChange: entry.onDidChange.event, - onDidDelete: entry.onDidDelete.event, - dispose: () => { - this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace.disposeWatcher', { id, resource: resource.toString() }); - this.connection.sendRequest(protocol.fs_watcher_delete, { id }); - this._watchers.delete(id); - } - }; - } - - private isRelevantMarkdownDocument(doc: TextDocument) { - return isMarkdownFile(doc) && URI.parse(doc.uri).scheme !== 'vscode-bulkeditpreview'; - } - - private doDeleteDocument(uri: URI) { - this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace.deleteDocument', { document: uri.toString() }); - - this._documentCache.delete(uri); - this._onDidDeleteMarkdownDocument.fire(uri); - } -} diff --git a/extensions/markdown-language-features/server/tsconfig.json b/extensions/markdown-language-features/server/tsconfig.json deleted file mode 100644 index 0a73af08ed8..00000000000 --- a/extensions/markdown-language-features/server/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./out", - "lib": [ - "ES2020", - "ES2021.Promise", - "WebWorker" - ] - }, - "include": [ - "src/**/*" - ] -} diff --git a/extensions/markdown-language-features/server/yarn.lock b/extensions/markdown-language-features/server/yarn.lock deleted file mode 100644 index 148783435bd..00000000000 --- a/extensions/markdown-language-features/server/yarn.lock +++ /dev/null @@ -1,176 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@vscode/l10n@^0.0.10": - version "0.0.10" - resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.10.tgz#9c513107c690c0dd16e3ec61e453743de15ebdb0" - integrity sha512-E1OCmDcDWa0Ya7vtSjp/XfHFGqYJfh+YPC1RkATU71fTac+j1JjCcB3qwSzmlKAighx2WxhLlfhS0RwAN++PFQ== - -"@vscode/l10n@^0.0.11": - version "0.0.11" - resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.11.tgz#325d7beb2cfb87162bc624d16c4d546de6a73b72" - integrity sha512-ukOMWnCg1tCvT7WnDfsUKQOFDQGsyR5tNgRpwmqi+5/vzU3ghdDXzvIM4IOPdSb3OeSsBNvmSL8nxIVOqi2WXA== - -boolbase@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" - integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== - -css-select@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-5.1.0.tgz#b8ebd6554c3637ccc76688804ad3f6a6fdaea8a6" - integrity sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg== - dependencies: - boolbase "^1.0.0" - css-what "^6.1.0" - domhandler "^5.0.2" - domutils "^3.0.1" - nth-check "^2.0.1" - -css-what@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" - integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== - -dom-serializer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" - integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== - dependencies: - domelementtype "^2.3.0" - domhandler "^5.0.2" - entities "^4.2.0" - -domelementtype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" - integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== - -domhandler@^5.0.2, domhandler@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" - integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== - dependencies: - domelementtype "^2.3.0" - -domutils@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.1.0.tgz#c47f551278d3dc4b0b1ab8cbb42d751a6f0d824e" - integrity sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA== - dependencies: - dom-serializer "^2.0.0" - domelementtype "^2.3.0" - domhandler "^5.0.3" - -entities@^4.2.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" - integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== - -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -node-html-parser@^6.1.5: - version "6.1.5" - resolved "https://registry.yarnpkg.com/node-html-parser/-/node-html-parser-6.1.5.tgz#c819dceb13a10a7642ff92f94f870b4f77968097" - integrity sha512-fAaM511feX++/Chnhe475a0NHD8M7AxDInsqQpz6x63GRF7xYNdS8Vo5dKsIVPgsOvG7eioRRTZQnWBrhDHBSg== - dependencies: - css-select "^5.1.0" - he "1.2.0" - -nth-check@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" - integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== - dependencies: - boolbase "^1.0.0" - -picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -vscode-jsonrpc@8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz#cb9989c65e219e18533cc38e767611272d274c94" - integrity sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw== - -vscode-jsonrpc@8.2.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz#f43dfa35fb51e763d17cd94dcca0c9458f35abf9" - integrity sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA== - -vscode-languageserver-protocol@3.17.3: - version "3.17.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz#6d0d54da093f0c0ee3060b81612cce0f11060d57" - integrity sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA== - dependencies: - vscode-jsonrpc "8.1.0" - vscode-languageserver-types "3.17.3" - -vscode-languageserver-protocol@^3.17.1: - version "3.17.5" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz#864a8b8f390835572f4e13bd9f8313d0e3ac4bea" - integrity sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg== - dependencies: - vscode-jsonrpc "8.2.0" - vscode-languageserver-types "3.17.5" - -vscode-languageserver-textdocument@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz#0822a000e7d4dc083312580d7575fe9e3ba2e2bf" - integrity sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA== - -vscode-languageserver-textdocument@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz#9eae94509cbd945ea44bca8dcfe4bb0c15bb3ac0" - integrity sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q== - -vscode-languageserver-types@3.17.3, vscode-languageserver-types@^3.17.3: - version "3.17.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64" - integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== - -vscode-languageserver-types@3.17.5: - version "3.17.5" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz#3273676f0cf2eab40b3f44d085acbb7f08a39d8a" - integrity sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg== - -vscode-languageserver@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz#5024253718915d84576ce6662dd46a791498d827" - integrity sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw== - dependencies: - vscode-languageserver-protocol "3.17.3" - -vscode-markdown-languageservice@^0.5.0-alpha.6: - version "0.5.0-alpha.6" - resolved "https://registry.yarnpkg.com/vscode-markdown-languageservice/-/vscode-markdown-languageservice-0.5.0-alpha.6.tgz#3aa5fc94fea3d5d7f0cd970e64348e2791643dc0" - integrity sha512-mA1JCA7aHHSek5gr8Yv7C3esEPo2hRrgxmoZUDRro+pnwbdsJuRaWOKWtCWxejRUVVVhc/5yTK2X64Jx9OCmFQ== - dependencies: - "@vscode/l10n" "^0.0.10" - node-html-parser "^6.1.5" - picomatch "^2.3.1" - vscode-languageserver-protocol "^3.17.1" - vscode-languageserver-textdocument "^1.0.11" - vscode-uri "^3.0.7" - -vscode-uri@^3.0.7: - version "3.0.7" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.7.tgz#6d19fef387ee6b46c479e5fb00870e15e58c1eb8" - integrity sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA== diff --git a/extensions/markdown-language-features/src/extension.browser.ts b/extensions/markdown-language-features/src/extension.browser.ts index 30639672490..2bfc63fc857 100644 --- a/extensions/markdown-language-features/src/extension.browser.ts +++ b/extensions/markdown-language-features/src/extension.browser.ts @@ -27,7 +27,7 @@ export async function activate(context: vscode.ExtensionContext) { } function startServer(context: vscode.ExtensionContext, parser: IMdParser): Promise { - const serverMain = vscode.Uri.joinPath(context.extensionUri, 'server/dist/browser/workerMain.js'); + const serverMain = vscode.Uri.joinPath(context.extensionUri, 'dist', 'browser', 'serverWorkerMain.js'); const worker = new Worker(serverMain.toString()); worker.postMessage({ i10lLocation: vscode.l10n.uri?.toString() ?? '' }); diff --git a/extensions/markdown-language-features/src/extension.ts b/extensions/markdown-language-features/src/extension.ts index b14ab6d0e7e..98ea87df069 100644 --- a/extensions/markdown-language-features/src/extension.ts +++ b/extensions/markdown-language-features/src/extension.ts @@ -27,10 +27,15 @@ export async function activate(context: vscode.ExtensionContext) { } function startServer(context: vscode.ExtensionContext, parser: IMdParser): Promise { - const clientMain = vscode.extensions.getExtension('vscode.markdown-language-features')?.packageJSON?.main || ''; - - const serverMain = `./server/${clientMain.indexOf('/dist/') !== -1 ? 'dist' : 'out'}/node/workerMain`; - const serverModule = context.asAbsolutePath(serverMain); + const isDebugBuild = context.extension.packageJSON.main.includes('/out/'); + + const serverModule = context.asAbsolutePath( + isDebugBuild + // For local non bundled version of vscode-markdown-languageserver + // ? './node_modules/vscode-markdown-languageserver/out/node/workerMain' + ? './node_modules/vscode-markdown-languageserver/dist/node/workerMain' + : './dist/serverWorkerMain' + ); // The debug options for the server const debugOptions = { execArgv: ['--nolazy', '--inspect=' + (7000 + Math.round(Math.random() * 999))] }; diff --git a/extensions/markdown-language-features/src/languageFeatures/updateLinksOnPaste.ts b/extensions/markdown-language-features/src/languageFeatures/updateLinksOnPaste.ts index 36b6eacfcfd..c8ad4c722fd 100644 --- a/extensions/markdown-language-features/src/languageFeatures/updateLinksOnPaste.ts +++ b/extensions/markdown-language-features/src/languageFeatures/updateLinksOnPaste.ts @@ -9,7 +9,7 @@ import { Mime } from '../util/mimes'; class UpdatePastedLinksEditProvider implements vscode.DocumentPasteEditProvider { - public static readonly kind = vscode.DocumentDropOrPasteEditKind.Empty.append('text', 'markdown', 'updateLinks'); + public static readonly kind = vscode.DocumentDropOrPasteEditKind.Empty.append('markdown', 'updateLinks'); public static readonly metadataMime = 'vnd.vscode.markdown.updateLinksMetadata'; @@ -26,6 +26,7 @@ class UpdatePastedLinksEditProvider implements vscode.DocumentPasteEditProvider if (token.isCancellationRequested) { return; } + dataTransfer.set(UpdatePastedLinksEditProvider.metadataMime, new vscode.DataTransferItem(metadata)); } @@ -33,7 +34,7 @@ class UpdatePastedLinksEditProvider implements vscode.DocumentPasteEditProvider document: vscode.TextDocument, ranges: readonly vscode.Range[], dataTransfer: vscode.DataTransfer, - _context: vscode.DocumentPasteEditContext, + context: vscode.DocumentPasteEditContext, token: vscode.CancellationToken, ): Promise { if (!this._isEnabled(document)) { @@ -56,7 +57,7 @@ class UpdatePastedLinksEditProvider implements vscode.DocumentPasteEditProvider // - Copy with multiple cursors and paste into multiple locations // - ... const edits = await this._client.getUpdatePastedLinksEdit(document.uri, ranges.map(x => new vscode.TextEdit(x, text)), metadata, token); - if (!edits || !edits.length || token.isCancellationRequested) { + if (!edits?.length || token.isCancellationRequested) { return; } @@ -64,11 +65,16 @@ class UpdatePastedLinksEditProvider implements vscode.DocumentPasteEditProvider const workspaceEdit = new vscode.WorkspaceEdit(); workspaceEdit.set(document.uri, edits.map(x => new vscode.TextEdit(new vscode.Range(x.range.start.line, x.range.start.character, x.range.end.line, x.range.end.character,), x.newText))); pasteEdit.additionalEdit = workspaceEdit; + + if (!context.only || !UpdatePastedLinksEditProvider.kind.contains(context.only)) { + pasteEdit.yieldTo = [vscode.DocumentDropOrPasteEditKind.Empty.append('text')]; + } + return [pasteEdit]; } private _isEnabled(document: vscode.TextDocument): boolean { - return vscode.workspace.getConfiguration('markdown', document.uri).get('experimental.updateLinksOnPaste', false); + return vscode.workspace.getConfiguration('markdown', document.uri).get('editor.updateLinksOnPaste.enabled', true); } } diff --git a/extensions/markdown-language-features/src/markdownEngine.ts b/extensions/markdown-language-features/src/markdownEngine.ts index 103cbc191e4..5f6e746a82d 100644 --- a/extensions/markdown-language-features/src/markdownEngine.ts +++ b/extensions/markdown-language-features/src/markdownEngine.ts @@ -313,7 +313,7 @@ export class MarkdownItEngine implements IMdParser { private _addNamedHeaders(md: MarkdownIt): void { const original = md.renderer.rules.heading_open; md.renderer.rules.heading_open = (tokens: Token[], idx: number, options, env, self) => { - const title = tokens[idx + 1].children!.reduce((acc, t) => acc + t.content, ''); + const title = this._tokenToPlainText(tokens[idx + 1]); let slug = this.slugifier.fromHeading(title); if (this._slugCount.has(slug.value)) { @@ -334,6 +334,21 @@ export class MarkdownItEngine implements IMdParser { }; } + private _tokenToPlainText(token: Token): string { + if (token.children) { + return token.children.map(x => this._tokenToPlainText(x)).join(''); + } + + switch (token.type) { + case 'text': + case 'emoji': + case 'code_inline': + return token.content; + default: + return ''; + } + } + private _addLinkRenderer(md: MarkdownIt): void { const original = md.renderer.rules.link_open; diff --git a/extensions/markdown-language-features/yarn.lock b/extensions/markdown-language-features/yarn.lock deleted file mode 100644 index 2b688e40592..00000000000 --- a/extensions/markdown-language-features/yarn.lock +++ /dev/null @@ -1,351 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@microsoft/1ds-core-js@4.0.3", "@microsoft/1ds-core-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz#c8a92c623745a9595e06558a866658480c33bdf9" - integrity sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/1ds-post-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz#cfcb20bb23fb6215d3f0732f60f5b7df3e624f86" - integrity sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ== - dependencies: - "@microsoft/1ds-core-js" "4.0.3" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-channel-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz#247b6fe2158fad9826cbcdf7304f885766b36624" - integrity sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A== - dependencies: - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-common@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz#c4aa53ba343f5b3c7fbf54cddd3c86a5bdcd95dc" - integrity sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-core-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz#008308b786930d94a1de8a1fbb4af0351b74653e" - integrity sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g== - dependencies: - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-shims@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f" - integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@microsoft/applicationinsights-web-basic@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz#9a23323276b4a5a0dc6a352e2de5d75e3c16b534" - integrity sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ== - dependencies: - "@microsoft/applicationinsights-channel-js" "3.0.4" - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/dynamicproto-js@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6" - integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@nevware21/ts-async@>= 0.3.0 < 2.x": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c" - integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA== - dependencies: - "@nevware21/ts-utils" ">= 0.10.0 < 2.x" - -"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.10.1 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7" - integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg== - -"@types/dompurify@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@types/dompurify/-/dompurify-3.0.2.tgz#c1cd33a475bc49c43c2a7900e41028e2136a4553" - integrity sha512-YBL4ziFebbbfQfH5mlC+QTJsvh0oJUrWbmxKMyEdL7emlHJqGR2Qb34TEFKj+VCayBvjKy3xczMFNhugThUsfQ== - dependencies: - "@types/trusted-types" "*" - -"@types/linkify-it@*": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9" - integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA== - -"@types/lodash.throttle@^4.1.3": - version "4.1.3" - resolved "https://registry.yarnpkg.com/@types/lodash.throttle/-/lodash.throttle-4.1.3.tgz#8bfa4fec519d09ebce56c815bcbff3e55c604db9" - integrity sha512-FUm7uMuYRX7dzqmgX02bxdBwC75owUxGA4dDKtFePDLJ6N1ofXxkRX3NhJV8wOrNs/wCjaY6sDVJrD1lbyERoQ== - dependencies: - "@types/lodash" "*" - -"@types/lodash@*": - version "4.14.104" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.104.tgz#53ee2357fa2e6e68379341d92eb2ecea4b11bb80" - integrity sha512-ufQcVg4daO8xQ5kopxRHanqFdL4AI7ondQkV+2f+7mz3gvp0LkBx2zBRC6hfs3T87mzQFmf5Fck7Fi145Ul6NQ== - -"@types/markdown-it@12.2.3": - version "12.2.3" - resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-12.2.3.tgz#0d6f6e5e413f8daaa26522904597be3d6cd93b51" - integrity sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ== - dependencies: - "@types/linkify-it" "*" - "@types/mdurl" "*" - -"@types/mdurl@*": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" - integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== - -"@types/picomatch@^2.3.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@types/picomatch/-/picomatch-2.3.0.tgz#75db5e75a713c5a83d5b76780c3da84a82806003" - integrity sha512-O397rnSS9iQI4OirieAtsDqvCj4+3eY1J+EPdNTKuHuRWIfUoGyzX294o8C4KJYaLqgSrd2o60c5EqCU8Zv02g== - -"@types/trusted-types@*": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756" - integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg== - -"@types/vscode-notebook-renderer@^1.60.0": - version "1.60.0" - resolved "https://registry.yarnpkg.com/@types/vscode-notebook-renderer/-/vscode-notebook-renderer-1.60.0.tgz#8a67d561f48ddf46a95dfa9f712a79c72c7b8f7a" - integrity sha512-u7TD2uuEZTVuitx0iijOJdKI0JLiQP6PsSBSRy2XmHXUOXcp5p1S56NrjOEDoF+PIHd3NL3eO6KTRSf5nukDqQ== - -"@types/vscode-webview@^1.57.0": - version "1.57.0" - resolved "https://registry.yarnpkg.com/@types/vscode-webview/-/vscode-webview-1.57.0.tgz#bad5194d45ae8d03afc1c0f67f71ff5e7a243bbf" - integrity sha512-x3Cb/SMa1IwRHfSvKaZDZOTh4cNoG505c3NjTqGlMC082m++x/ETUmtYniDsw6SSmYzZXO8KBNhYxR0+VqymqA== - -"@vscode/extension-telemetry@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz#8c6c61e253ff304f46045f04edd60059b144417a" - integrity sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ== - dependencies: - "@microsoft/1ds-core-js" "^4.0.3" - "@microsoft/1ds-post-js" "^4.0.3" - "@microsoft/applicationinsights-web-basic" "^3.0.4" - -"@vscode/l10n@^0.0.10": - version "0.0.10" - resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.10.tgz#9c513107c690c0dd16e3ec61e453743de15ebdb0" - integrity sha512-E1OCmDcDWa0Ya7vtSjp/XfHFGqYJfh+YPC1RkATU71fTac+j1JjCcB3qwSzmlKAighx2WxhLlfhS0RwAN++PFQ== - -"@vscode/markdown-it-katex@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@vscode/markdown-it-katex/-/markdown-it-katex-1.0.2.tgz#27ba579fa3896b2944b71209dd30d0f983983f11" - integrity sha512-QY/OnOHPTqc8tQoCoAjVblILX4yE6xGZHKODtiTKqA328OXra+lSpeJO5Ouo9AAvrs9AwcCLz6xvW3zwcsPBQg== - dependencies: - katex "^0.16.4" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -commander@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" - integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -dompurify@^3.0.5: - version "3.0.5" - resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.0.5.tgz#eb3d9cfa10037b6e73f32c586682c4b2ab01fbed" - integrity sha512-F9e6wPGtY+8KNMRAVfxeCOHU0/NPWMSENNq4pQctuXRqqdEPW7q3CrLbR5Nse044WwacyjHGOMlvNsBe1y6z9A== - -entities@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" - integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== - -highlight.js@^11.8.0: - version "11.8.0" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.8.0.tgz#966518ea83257bae2e7c9a48596231856555bb65" - integrity sha512-MedQhoqVdr0U6SSnWPzfiadUcDHfN/Wzq25AkXiQv9oiOO/sG0S7XkvpFIqWBl9Yq1UYyYOOVORs5UW2XlPyzg== - -katex@^0.16.4: - version "0.16.10" - resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.10.tgz#6f81b71ac37ff4ec7556861160f53bc5f058b185" - integrity sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA== - dependencies: - commander "^8.3.0" - -linkify-it@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" - integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== - dependencies: - uc.micro "^1.0.1" - -lodash.throttle@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" - integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -markdown-it-front-matter@^0.2.4: - version "0.2.4" - resolved "https://registry.yarnpkg.com/markdown-it-front-matter/-/markdown-it-front-matter-0.2.4.tgz#cf29bc8222149b53575699357b1ece697bf39507" - integrity sha512-25GUs0yjS2hLl8zAemVndeEzThB1p42yxuDEKbd4JlL3jiz+jsm6e56Ya8B0VREOkNxLYB4TTwaoPJ3ElMmW+w== - -markdown-it@^12.3.2: - version "12.3.2" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" - integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== - dependencies: - argparse "^2.0.1" - entities "~2.1.0" - linkify-it "^3.0.1" - mdurl "^1.0.1" - uc.micro "^1.0.5" - -mdurl@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" - integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= - -minimatch@^3.0.4: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -morphdom@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/morphdom/-/morphdom-2.6.1.tgz#e868e24f989fa3183004b159aed643e628b4306e" - integrity sha512-Y8YRbAEP3eKykroIBWrjcfMw7mmwJfjhqdpSvoqinu8Y702nAwikpXcNFDiIkyvfCLxLM9Wu95RZqo4a9jFBaA== - -picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -semver@^7.3.5: - version "7.5.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - -uc.micro@^1.0.1, uc.micro@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" - integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== - -vscode-jsonrpc@8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz#f239ed2cd6004021b6550af9fd9d3e47eee3cac9" - integrity sha512-RY7HwI/ydoC1Wwg4gJ3y6LpU9FJRZAUnTYMXthqhFXXu77ErDd/xkREpGuk4MyYkk4a+XDWAMqe0S3KkelYQEQ== - -vscode-languageclient@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.0.2.tgz#f1f23ce8c8484aa11e4b7dfb24437d3e59bb61c6" - integrity sha512-lHlthJtphG9gibGb/y72CKqQUxwPsMXijJVpHEC2bvbFqxmkj9LwQ3aGU9dwjBLqsX1S4KjShYppLvg1UJDF/Q== - dependencies: - minimatch "^3.0.4" - semver "^7.3.5" - vscode-languageserver-protocol "3.17.2" - -vscode-languageserver-protocol@3.17.2: - version "3.17.2" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2.tgz#beaa46aea06ed061576586c5e11368a9afc1d378" - integrity sha512-8kYisQ3z/SQ2kyjlNeQxbkkTNmVFoQCqkmGrzLH6A9ecPlgTbp3wDTnUNqaUxYr4vlAcloxx8zwy7G5WdguYNg== - dependencies: - vscode-jsonrpc "8.0.2" - vscode-languageserver-types "3.17.2" - -vscode-languageserver-textdocument@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz#0822a000e7d4dc083312580d7575fe9e3ba2e2bf" - integrity sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA== - -vscode-languageserver-textdocument@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.5.tgz#838769940ece626176ec5d5a2aa2d0aa69f5095c" - integrity sha512-1ah7zyQjKBudnMiHbZmxz5bYNM9KKZYz+5VQLj+yr8l+9w3g+WAhCkUkWbhMEdC5u0ub4Ndiye/fDyS8ghIKQg== - -vscode-languageserver-types@3.17.2, vscode-languageserver-types@^3.17.1, vscode-languageserver-types@^3.17.2: - version "3.17.2" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz#b2c2e7de405ad3d73a883e91989b850170ffc4f2" - integrity sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA== - -vscode-markdown-languageservice@^0.3.0-alpha.3: - version "0.3.0-alpha.3" - resolved "https://registry.yarnpkg.com/vscode-markdown-languageservice/-/vscode-markdown-languageservice-0.3.0-alpha.3.tgz#219a4880cfc0ea037b5a1833bc0b0039bfd1e2db" - integrity sha512-KPjIuCkSqabkzci7TnlLKep5FYIC45tS7UC5H8zoOii7aoKJru5mZBDXJt86bM3XTgnfpW7rUYqhNnvXbbCBbw== - dependencies: - "@vscode/l10n" "^0.0.10" - picomatch "^2.3.1" - vscode-languageserver-textdocument "^1.0.5" - vscode-languageserver-types "^3.17.1" - vscode-uri "^3.0.3" - -vscode-uri@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.3.tgz#a95c1ce2e6f41b7549f86279d19f47951e4f4d84" - integrity sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/extensions/markdown-math/.vscodeignore b/extensions/markdown-math/.vscodeignore index 5ac0ae077c3..85f550b7d7b 100644 --- a/extensions/markdown-math/.vscodeignore +++ b/extensions/markdown-math/.vscodeignore @@ -4,7 +4,7 @@ extension-browser.webpack.config.js extension.webpack.config.js esbuild.js cgmanifest.json -yarn.lock +package-lock.json webpack.config.js tsconfig.json .gitignore diff --git a/extensions/markdown-math/notebook/katex.ts b/extensions/markdown-math/notebook/katex.ts index 94aad4f3c3b..ccc43046b32 100644 --- a/extensions/markdown-math/notebook/katex.ts +++ b/extensions/markdown-math/notebook/katex.ts @@ -51,7 +51,8 @@ export async function activate(ctx: RendererContext) { return md.use(katex, { globalGroup: true, enableBareBlocks: true, - macros + enableFencedBlocks: true, + macros, }); }); } diff --git a/extensions/markdown-math/package-lock.json b/extensions/markdown-math/package-lock.json new file mode 100644 index 00000000000..53a0866e61f --- /dev/null +++ b/extensions/markdown-math/package-lock.json @@ -0,0 +1,66 @@ +{ + "name": "markdown-math", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "markdown-math", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@vscode/markdown-it-katex": "^1.1.0" + }, + "devDependencies": { + "@types/markdown-it": "^0.0.0", + "@types/vscode-notebook-renderer": "^1.60.0" + }, + "engines": { + "vscode": "^1.54.0" + } + }, + "node_modules/@types/markdown-it": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-0.0.0.tgz", + "integrity": "sha512-rLEOTm6Wi9M8GFnIK7VczXSEThIN/eVoevpTYVk+FD/DPX3N15Sj9b3vkjjDY63U0Zw1yawf13CI92CCHpC5kw==", + "dev": true + }, + "node_modules/@types/vscode-notebook-renderer": { + "version": "1.72.0", + "resolved": "https://registry.npmjs.org/@types/vscode-notebook-renderer/-/vscode-notebook-renderer-1.72.0.tgz", + "integrity": "sha512-5iTjb39DpLn03ULUwrDR3L2Dy59RV4blSUHy0oLdQuIY11PhgWO4mXIcoFS0VxY1GZQ4IcjSf3ooT2Jrrcahnw==", + "dev": true + }, + "node_modules/@vscode/markdown-it-katex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@vscode/markdown-it-katex/-/markdown-it-katex-1.1.0.tgz", + "integrity": "sha512-9cF2eJpsJOEs2V1cCAoJW/boKz9GQQLvZhNvI030K90z6ZE9lRGc9hDVvKut8zdFO2ObjwylPXXXVYvTdP2O2Q==", + "dependencies": { + "katex": "^0.16.4" + } + }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/katex": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.10.tgz", + "integrity": "sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA==", + "funding": [ + "https://opencollective.com/katex", + "https://github.com/sponsors/katex" + ], + "dependencies": { + "commander": "^8.3.0" + }, + "bin": { + "katex": "cli.js" + } + } + } +} diff --git a/extensions/markdown-math/package.json b/extensions/markdown-math/package.json index 44b442b3df4..9669efc2435 100644 --- a/extensions/markdown-math/package.json +++ b/extensions/markdown-math/package.json @@ -56,6 +56,16 @@ "meta.embedded.math.markdown": "latex", "punctuation.definition.math.end.markdown": "latex" } + }, + { + "scopeName": "markdown.math.codeblock", + "path": "./syntaxes/md-math-fence.tmLanguage.json", + "injectTo": [ + "text.html.markdown" + ], + "embeddedLanguages": { + "meta.embedded.math.markdown": "latex" + } } ], "notebookRenderer": [ @@ -99,7 +109,7 @@ "build-notebook": "node ./esbuild" }, "dependencies": { - "@vscode/markdown-it-katex": "^1.0.3" + "@vscode/markdown-it-katex": "^1.1.0" }, "devDependencies": { "@types/markdown-it": "^0.0.0", diff --git a/extensions/markdown-math/src/extension.ts b/extensions/markdown-math/src/extension.ts index 1c27036b2fc..6491b0c1459 100644 --- a/extensions/markdown-math/src/extension.ts +++ b/extensions/markdown-math/src/extension.ts @@ -30,7 +30,11 @@ export function activate(context: vscode.ExtensionContext) { if (isEnabled()) { const katex = require('@vscode/markdown-it-katex').default; const settingsMacros = getMacros(); - const options = { globalGroup: true, macros: { ...settingsMacros } }; + const options = { + enableFencedBlocks: true, + globalGroup: true, + macros: { ...settingsMacros } + }; md.core.ruler.push('reset-katex-macros', () => { options.macros = { ...settingsMacros }; }); @@ -39,4 +43,4 @@ export function activate(context: vscode.ExtensionContext) { return md; } }; -} +} \ No newline at end of file diff --git a/extensions/markdown-math/syntaxes/md-math-block.tmLanguage.json b/extensions/markdown-math/syntaxes/md-math-block.tmLanguage.json index 43fd1bda5db..543568bf83e 100644 --- a/extensions/markdown-math/syntaxes/md-math-block.tmLanguage.json +++ b/extensions/markdown-math/syntaxes/md-math-block.tmLanguage.json @@ -82,4 +82,4 @@ } }, "scopeName": "markdown.math.block" -} +} \ No newline at end of file diff --git a/extensions/markdown-math/syntaxes/md-math-fence.tmLanguage.json b/extensions/markdown-math/syntaxes/md-math-fence.tmLanguage.json new file mode 100644 index 00000000000..556c579d3e7 --- /dev/null +++ b/extensions/markdown-math/syntaxes/md-math-fence.tmLanguage.json @@ -0,0 +1,28 @@ +{ + "fileTypes": [], + "injectionSelector": "L:markup.fenced_code.block.markdown", + "patterns": [ + { + "include": "#math-code-block" + } + ], + "repository": { + "math-code-block": { + "begin": "(?<=[`~])math(\\s+[^`~]*)?$", + "end": "(^|\\G)(?=\\s*[`~]{3,}\\s*$)", + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.math.markdown", + "patterns": [ + { + "include": "text.html.markdown.math#math" + } + ] + } + ] + } + }, + "scopeName": "markdown.math.codeblock" +} diff --git a/extensions/markdown-math/yarn.lock b/extensions/markdown-math/yarn.lock deleted file mode 100644 index f6b6729fce6..00000000000 --- a/extensions/markdown-math/yarn.lock +++ /dev/null @@ -1,32 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/markdown-it@^0.0.0": - version "0.0.0" - resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-0.0.0.tgz#8f6acaa5e3245e275f684e95deb3e518d1c6ab16" - integrity sha512-rLEOTm6Wi9M8GFnIK7VczXSEThIN/eVoevpTYVk+FD/DPX3N15Sj9b3vkjjDY63U0Zw1yawf13CI92CCHpC5kw== - -"@types/vscode-notebook-renderer@^1.60.0": - version "1.72.0" - resolved "https://registry.yarnpkg.com/@types/vscode-notebook-renderer/-/vscode-notebook-renderer-1.72.0.tgz#8943dc3cef0ced2dfb1e04c0a933bd289e7d5199" - integrity sha512-5iTjb39DpLn03ULUwrDR3L2Dy59RV4blSUHy0oLdQuIY11PhgWO4mXIcoFS0VxY1GZQ4IcjSf3ooT2Jrrcahnw== - -"@vscode/markdown-it-katex@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@vscode/markdown-it-katex/-/markdown-it-katex-1.0.3.tgz#5364e4dbcb0f7e7fd2fdab3847ba5d6b0c3ce9d9" - integrity sha512-a8ppdac0CG2lAQC6E6lT8dxmXkUk9gRtYNtILx31FyrPEwj875AAHc6tpRGeJBpWMpiMtcvz7ymWYBwYgxuFmw== - dependencies: - katex "^0.16.4" - -commander@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" - integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== - -katex@^0.16.4: - version "0.16.10" - resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.10.tgz#6f81b71ac37ff4ec7556861160f53bc5f058b185" - integrity sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA== - dependencies: - commander "^8.3.0" diff --git a/extensions/media-preview/.vscodeignore b/extensions/media-preview/.vscodeignore index bcb886a094d..532c87f6f2e 100644 --- a/extensions/media-preview/.vscodeignore +++ b/extensions/media-preview/.vscodeignore @@ -6,6 +6,6 @@ out/** extension.webpack.config.js extension-browser.webpack.config.js cgmanifest.json -yarn.lock +package-lock.json preview-src/** webpack.config.js diff --git a/extensions/media-preview/media/imagePreview.css b/extensions/media-preview/media/imagePreview.css index 49a01b8d969..67c73e39595 100644 --- a/extensions/media-preview/media/imagePreview.css +++ b/extensions/media-preview/media/imagePreview.css @@ -12,6 +12,7 @@ html, body { body img { max-width: none; max-height: none; + vertical-align: middle; } .container:focus { @@ -31,20 +32,20 @@ body img { box-sizing: border-box; } -.container.image img { +.container.image .transparency-grid { padding: 0; background-position: 0 0, 8px 8px; background-size: 16px 16px; border: 1px solid var(--vscode-imagePreview-border); } -.container.image img { +.container.image .transparency-grid { background-image: linear-gradient(45deg, rgb(230, 230, 230) 25%, transparent 25%, transparent 75%, rgb(230, 230, 230) 75%, rgb(230, 230, 230)), linear-gradient(45deg, rgb(230, 230, 230) 25%, transparent 25%, transparent 75%, rgb(230, 230, 230) 75%, rgb(230, 230, 230)); } -.vscode-dark.container.image img { +.vscode-dark.container.image .transparency-grid { background-image: linear-gradient(45deg, rgb(20, 20, 20) 25%, transparent 25%, transparent 75%, rgb(20, 20, 20) 75%, rgb(20, 20, 20)), linear-gradient(45deg, rgb(20, 20, 20) 25%, transparent 25%, transparent 75%, rgb(20, 20, 20) 75%, rgb(20, 20, 20)); @@ -54,13 +55,13 @@ body img { image-rendering: pixelated; } -.container img.scale-to-fit { +.container .transparency-grid.scale-to-fit { max-width: calc(100% - 20px); max-height: calc(100% - 20px); object-fit: contain; } -.container img { +.container .transparency-grid { margin: auto; } diff --git a/extensions/media-preview/media/imagePreview.js b/extensions/media-preview/media/imagePreview.js index ab8ad542a2d..7179283d052 100644 --- a/extensions/media-preview/media/imagePreview.js +++ b/extensions/media-preview/media/imagePreview.js @@ -76,6 +76,8 @@ // Elements const container = document.body; + const transparencyGrid = document.createElement('div'); + transparencyGrid.classList.add('transparency-grid'); const image = document.createElement('img'); function updateScale(newScale) { @@ -85,7 +87,7 @@ if (newScale === 'fit') { scale = 'fit'; - image.classList.add('scale-to-fit'); + transparencyGrid.classList.add('scale-to-fit'); image.classList.remove('pixelated'); // @ts-ignore Non-standard CSS property image.style.zoom = 'normal'; @@ -292,7 +294,9 @@ document.body.classList.remove('loading'); document.body.classList.add('ready'); - document.body.append(image); + + document.body.append(transparencyGrid); + transparencyGrid.appendChild(image); updateScale(scale); diff --git a/extensions/media-preview/package-lock.json b/extensions/media-preview/package-lock.json new file mode 100644 index 00000000000..68391b8c4be --- /dev/null +++ b/extensions/media-preview/package-lock.json @@ -0,0 +1,152 @@ +{ + "name": "media-preview", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "media-preview", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@vscode/extension-telemetry": "^0.9.0", + "vscode-uri": "^3.0.6" + }, + "engines": { + "vscode": "^1.70.0" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz", + "integrity": "sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz", + "integrity": "sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.0.3", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz", + "integrity": "sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz", + "integrity": "sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz", + "integrity": "sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz", + "integrity": "sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.0.4", + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", + "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.3.0.tgz", + "integrity": "sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz", + "integrity": "sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==" + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz", + "integrity": "sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.0.3", + "@microsoft/1ds-post-js": "^4.0.3", + "@microsoft/applicationinsights-web-basic": "^3.0.4" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/vscode-uri": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.6.tgz", + "integrity": "sha512-fmL7V1eiDBFRRnu+gfRWTzyPpNIHJTc4mWnFkwBUmO9U3KPgJAmTx7oxi2bl/Rh6HLdU7+4C9wlj0k2E4AdKFQ==" + } + } +} diff --git a/extensions/media-preview/src/imagePreview/index.ts b/extensions/media-preview/src/imagePreview/index.ts index 007e466d99f..e0c605c2a6e 100644 --- a/extensions/media-preview/src/imagePreview/index.ts +++ b/extensions/media-preview/src/imagePreview/index.ts @@ -113,8 +113,6 @@ class ImagePreview extends MediaPreview { this.updateBinarySize(); this.render(); this.updateState(); - - this.webviewEditor.webview.postMessage({ type: 'setActive', value: this.webviewEditor.active }); } public override dispose(): void { @@ -157,6 +155,10 @@ class ImagePreview extends MediaPreview { this.zoomStatusBarEntry.hide(this); } } + protected override async render(): Promise { + await super.render(); + this.webviewEditor.webview.postMessage({ type: 'setActive', value: this.webviewEditor.active }); + } protected override async getWebviewContents(): Promise { const version = Date.now().toString(); diff --git a/extensions/media-preview/yarn.lock b/extensions/media-preview/yarn.lock deleted file mode 100644 index a19b8cbb124..00000000000 --- a/extensions/media-preview/yarn.lock +++ /dev/null @@ -1,110 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@microsoft/1ds-core-js@4.0.3", "@microsoft/1ds-core-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz#c8a92c623745a9595e06558a866658480c33bdf9" - integrity sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/1ds-post-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz#cfcb20bb23fb6215d3f0732f60f5b7df3e624f86" - integrity sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ== - dependencies: - "@microsoft/1ds-core-js" "4.0.3" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-channel-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz#247b6fe2158fad9826cbcdf7304f885766b36624" - integrity sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A== - dependencies: - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-common@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz#c4aa53ba343f5b3c7fbf54cddd3c86a5bdcd95dc" - integrity sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-core-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz#008308b786930d94a1de8a1fbb4af0351b74653e" - integrity sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g== - dependencies: - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-shims@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f" - integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@microsoft/applicationinsights-web-basic@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz#9a23323276b4a5a0dc6a352e2de5d75e3c16b534" - integrity sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ== - dependencies: - "@microsoft/applicationinsights-channel-js" "3.0.4" - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/dynamicproto-js@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6" - integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@nevware21/ts-async@>= 0.3.0 < 2.x": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c" - integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA== - dependencies: - "@nevware21/ts-utils" ">= 0.10.0 < 2.x" - -"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.10.1 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7" - integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg== - -"@vscode/extension-telemetry@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz#8c6c61e253ff304f46045f04edd60059b144417a" - integrity sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ== - dependencies: - "@microsoft/1ds-core-js" "^4.0.3" - "@microsoft/1ds-post-js" "^4.0.3" - "@microsoft/applicationinsights-web-basic" "^3.0.4" - -vscode-uri@^3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.6.tgz#5e6e2e1a4170543af30151b561a41f71db1d6f91" - integrity sha512-fmL7V1eiDBFRRnu+gfRWTzyPpNIHJTc4mWnFkwBUmO9U3KPgJAmTx7oxi2bl/Rh6HLdU7+4C9wlj0k2E4AdKFQ== diff --git a/extensions/merge-conflict/.vscodeignore b/extensions/merge-conflict/.vscodeignore index f071cfb7c71..3a8a2a96a6c 100644 --- a/extensions/merge-conflict/.vscodeignore +++ b/extensions/merge-conflict/.vscodeignore @@ -3,4 +3,4 @@ tsconfig.json out/** extension.webpack.config.js extension-browser.webpack.config.js -yarn.lock +package-lock.json diff --git a/extensions/merge-conflict/package-lock.json b/extensions/merge-conflict/package-lock.json new file mode 100644 index 00000000000..a57272606cd --- /dev/null +++ b/extensions/merge-conflict/package-lock.json @@ -0,0 +1,164 @@ +{ + "name": "merge-conflict", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "merge-conflict", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@vscode/extension-telemetry": "^0.9.0" + }, + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "^1.5.0" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz", + "integrity": "sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz", + "integrity": "sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.0.3", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz", + "integrity": "sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz", + "integrity": "sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz", + "integrity": "sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz", + "integrity": "sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.0.4", + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", + "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.3.0.tgz", + "integrity": "sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz", + "integrity": "sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==" + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz", + "integrity": "sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.0.3", + "@microsoft/1ds-post-js": "^4.0.3", + "@microsoft/applicationinsights-web-basic": "^3.0.4" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/extensions/merge-conflict/yarn.lock b/extensions/merge-conflict/yarn.lock deleted file mode 100644 index 31f7cee0830..00000000000 --- a/extensions/merge-conflict/yarn.lock +++ /dev/null @@ -1,117 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@microsoft/1ds-core-js@4.0.3", "@microsoft/1ds-core-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz#c8a92c623745a9595e06558a866658480c33bdf9" - integrity sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/1ds-post-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz#cfcb20bb23fb6215d3f0732f60f5b7df3e624f86" - integrity sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ== - dependencies: - "@microsoft/1ds-core-js" "4.0.3" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-channel-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz#247b6fe2158fad9826cbcdf7304f885766b36624" - integrity sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A== - dependencies: - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-common@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz#c4aa53ba343f5b3c7fbf54cddd3c86a5bdcd95dc" - integrity sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-core-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz#008308b786930d94a1de8a1fbb4af0351b74653e" - integrity sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g== - dependencies: - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-shims@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f" - integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@microsoft/applicationinsights-web-basic@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz#9a23323276b4a5a0dc6a352e2de5d75e3c16b534" - integrity sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ== - dependencies: - "@microsoft/applicationinsights-channel-js" "3.0.4" - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/dynamicproto-js@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6" - integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@nevware21/ts-async@>= 0.3.0 < 2.x": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c" - integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA== - dependencies: - "@nevware21/ts-utils" ">= 0.10.0 < 2.x" - -"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.10.1 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7" - integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg== - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@vscode/extension-telemetry@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz#8c6c61e253ff304f46045f04edd60059b144417a" - integrity sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ== - dependencies: - "@microsoft/1ds-core-js" "^4.0.3" - "@microsoft/1ds-post-js" "^4.0.3" - "@microsoft/applicationinsights-web-basic" "^3.0.4" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/extensions/microsoft-authentication/.vscodeignore b/extensions/microsoft-authentication/.vscodeignore index 46f23a20dba..98b90d34d82 100644 --- a/extensions/microsoft-authentication/.vscodeignore +++ b/extensions/microsoft-authentication/.vscodeignore @@ -4,7 +4,7 @@ out/test/** out/** extension.webpack.config.js extension-browser.webpack.config.js -yarn.lock +package-lock.json src/** .gitignore vsc-extension-quickstart.md diff --git a/extensions/microsoft-authentication/extension-browser.webpack.config.js b/extensions/microsoft-authentication/extension-browser.webpack.config.js index 2513c7d0f9c..0d395fc0f96 100644 --- a/extensions/microsoft-authentication/extension-browser.webpack.config.js +++ b/extensions/microsoft-authentication/extension-browser.webpack.config.js @@ -22,10 +22,9 @@ module.exports = withBrowserDefaults({ }, resolve: { alias: { - './node/crypto': path.resolve(__dirname, 'src/browser/crypto'), './node/authServer': path.resolve(__dirname, 'src/browser/authServer'), './node/buffer': path.resolve(__dirname, 'src/browser/buffer'), - './node/fetch': path.resolve(__dirname, 'src/browser/fetch'), + './node/authProvider': path.resolve(__dirname, 'src/browser/authProvider'), } } }); diff --git a/extensions/microsoft-authentication/package-lock.json b/extensions/microsoft-authentication/package-lock.json new file mode 100644 index 00000000000..8f05b14f02a --- /dev/null +++ b/extensions/microsoft-authentication/package-lock.json @@ -0,0 +1,440 @@ +{ + "name": "microsoft-authentication", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "microsoft-authentication", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "@azure/ms-rest-azure-env": "^2.0.0", + "@azure/msal-node": "^2.13.1", + "@vscode/extension-telemetry": "^0.9.0", + "vscode-tas-client": "^0.1.84" + }, + "devDependencies": { + "@types/node": "20.x", + "@types/node-fetch": "^2.5.7", + "@types/randombytes": "^2.0.0", + "@types/sha.js": "^2.4.0", + "@types/uuid": "8.0.0" + }, + "engines": { + "vscode": "^1.42.0" + } + }, + "node_modules/@azure/ms-rest-azure-env": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-azure-env/-/ms-rest-azure-env-2.0.0.tgz", + "integrity": "sha512-dG76W7ElfLi+fbTjnZVGj+M9e0BIEJmRxU6fHaUQ12bZBe8EJKYb2GV50YWNaP2uJiVQ5+7nXEVj1VN1UQtaEw==" + }, + "node_modules/@azure/msal-common": { + "version": "14.14.2", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.14.2.tgz", + "integrity": "sha512-XV0P5kSNwDwCA/SjIxTe9mEAsKB0NqGNSuaVrkCCE2lAyBr/D6YtD80Vkdp4tjWnPFwjzkwldjr1xU/facOJog==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@azure/msal-node": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.13.1.tgz", + "integrity": "sha512-sijfzPNorKt6+9g1/miHwhj6Iapff4mPQx1azmmZExgzUROqWTM1o3ACyxDja0g47VpowFy/sxTM/WsuCyXTiw==", + "dependencies": { + "@azure/msal-common": "14.14.2", + "jsonwebtoken": "^9.0.0", + "uuid": "^8.3.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz", + "integrity": "sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz", + "integrity": "sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.0.3", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz", + "integrity": "sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz", + "integrity": "sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz", + "integrity": "sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz", + "integrity": "sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.0.4", + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", + "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.3.0.tgz", + "integrity": "sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz", + "integrity": "sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==" + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.7.tgz", + "integrity": "sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "form-data": "^3.0.0" + } + }, + "node_modules/@types/randombytes": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/randombytes/-/randombytes-2.0.0.tgz", + "integrity": "sha512-bz8PhAVlwN72vqefzxa14DKNT8jK/mV66CSjwdVQM/k3Th3EPKfUtdMniwZgMedQTFuywAsfjnZsg+pEnltaMA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/sha.js": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/sha.js/-/sha.js-2.4.0.tgz", + "integrity": "sha512-amxKgPy6WJTKuw8mpUwjX2BSxuBtBmZfRwIUDIuPJKNwGN8CWDli8JTg5ONTWOtcTkHIstvT7oAhhYXqEjStHQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/uuid": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.0.0.tgz", + "integrity": "sha512-xSQfNcvOiE5f9dyd4Kzxbof1aTrLobL278pGLKOZI6esGfZ7ts9Ka16CzIN6Y8hFHE1C7jIBZokULhK1bOgjRw==", + "dev": true + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz", + "integrity": "sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.0.3", + "@microsoft/1ds-post-js": "^4.0.3", + "@microsoft/applicationinsights-web-basic": "^3.0.4" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k= sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk= sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, + "node_modules/mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "dependencies": { + "mime-db": "1.44.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tas-client": { + "version": "0.2.33", + "resolved": "https://registry.npmjs.org/tas-client/-/tas-client-0.2.33.tgz", + "integrity": "sha512-V+uqV66BOQnWxvI6HjDnE4VkInmYZUQ4dgB7gzaDyFyFSK1i1nF/j7DpS9UbQAgV9NaF1XpcyuavnM1qOeiEIg==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/vscode-tas-client": { + "version": "0.1.84", + "resolved": "https://registry.npmjs.org/vscode-tas-client/-/vscode-tas-client-0.1.84.tgz", + "integrity": "sha512-rUTrUopV+70hvx1hW5ebdw1nd6djxubkLvVxjGdyD/r5v/wcVF41LIfiAtbm5qLZDtQdsMH1IaCuDoluoIa88w==", + "dependencies": { + "tas-client": "0.2.33" + }, + "engines": { + "vscode": "^1.85.0" + } + } + } +} diff --git a/extensions/microsoft-authentication/package.json b/extensions/microsoft-authentication/package.json index fd3ba077028..15acb5db286 100644 --- a/extensions/microsoft-authentication/package.json +++ b/extensions/microsoft-authentication/package.json @@ -14,8 +14,7 @@ ], "activationEvents": [], "enabledApiProposals": [ - "idToken", - "authGetSessions" + "idToken" ], "capabilities": { "virtualWorkspaces": true, @@ -96,6 +95,15 @@ ] } } + }, + { + "title": "Microsoft", + "properties": { + "microsoft.useMsal": { + "type": "boolean", + "description": "%useMsal.description%" + } + } } ] }, @@ -117,9 +125,10 @@ "@types/uuid": "8.0.0" }, "dependencies": { - "node-fetch": "2.6.7", "@azure/ms-rest-azure-env": "^2.0.0", - "@vscode/extension-telemetry": "^0.9.0" + "@azure/msal-node": "^2.13.1", + "@vscode/extension-telemetry": "^0.9.0", + "vscode-tas-client": "^0.1.84" }, "repository": { "type": "git", diff --git a/extensions/microsoft-authentication/package.nls.json b/extensions/microsoft-authentication/package.nls.json index 14c625dc762..80cbb32d4ab 100644 --- a/extensions/microsoft-authentication/package.nls.json +++ b/extensions/microsoft-authentication/package.nls.json @@ -3,6 +3,7 @@ "description": "Microsoft authentication provider", "signIn": "Sign In", "signOut": "Sign Out", + "useMsal.description": "Use the Microsoft Authentication Library (MSAL) to sign in with a Microsoft account.", "microsoft-sovereign-cloud.environment.description": { "message": "The Sovereign Cloud to use for authentication. If you select `custom`, you must also set the `#microsoft-sovereign-cloud.customEnvironment#` setting.", "comment": [ diff --git a/extensions/microsoft-authentication/src/AADHelper.ts b/extensions/microsoft-authentication/src/AADHelper.ts index bc4d71e56d6..713f5f12e9a 100644 --- a/extensions/microsoft-authentication/src/AADHelper.ts +++ b/extensions/microsoft-authentication/src/AADHelper.ts @@ -11,7 +11,6 @@ import { generateCodeChallenge, generateCodeVerifier, randomUUID } from './crypt import { BetterTokenStorage, IDidChangeInOtherWindowEvent } from './betterSecretStorage'; import { LoopbackAuthServer } from './node/authServer'; import { base64Decode } from './node/buffer'; -import { fetching } from './node/fetch'; import { UriEventHandler } from './UriEventHandler'; import TelemetryReporter from '@vscode/extension-telemetry'; import { Environment } from '@azure/ms-rest-azure-env'; @@ -806,7 +805,7 @@ export class AzureActiveDirectoryService { let result; let errorMessage: string | undefined; try { - result = await fetching(endpoint, { + result = await fetch(endpoint, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', diff --git a/extensions/microsoft-authentication/src/UriEventHandler.ts b/extensions/microsoft-authentication/src/UriEventHandler.ts index 3dc753af835..f525912fa51 100644 --- a/extensions/microsoft-authentication/src/UriEventHandler.ts +++ b/extensions/microsoft-authentication/src/UriEventHandler.ts @@ -6,7 +6,14 @@ import * as vscode from 'vscode'; export class UriEventHandler extends vscode.EventEmitter implements vscode.UriHandler { - public handleUri(uri: vscode.Uri) { + private _disposable = vscode.window.registerUriHandler(this); + + handleUri(uri: vscode.Uri) { this.fire(uri); } + + override dispose(): void { + super.dispose(); + this._disposable.dispose(); + } } diff --git a/extensions/microsoft-authentication/src/browser/authProvider.ts b/extensions/microsoft-authentication/src/browser/authProvider.ts new file mode 100644 index 00000000000..3b4da5b18fa --- /dev/null +++ b/extensions/microsoft-authentication/src/browser/authProvider.ts @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { AuthenticationProvider, AuthenticationProviderAuthenticationSessionsChangeEvent, AuthenticationSession, EventEmitter } from 'vscode'; + +export class MsalAuthProvider implements AuthenticationProvider { + private _onDidChangeSessions = new EventEmitter(); + onDidChangeSessions = this._onDidChangeSessions.event; + + initialize(): Thenable { + throw new Error('Method not implemented.'); + } + + getSessions(): Thenable { + throw new Error('Method not implemented.'); + } + createSession(): Thenable { + throw new Error('Method not implemented.'); + } + removeSession(): Thenable { + throw new Error('Method not implemented.'); + } + + dispose() { + this._onDidChangeSessions.dispose(); + } +} diff --git a/extensions/microsoft-authentication/src/common/async.ts b/extensions/microsoft-authentication/src/common/async.ts index 641faaff0dd..094861518fc 100644 --- a/extensions/microsoft-authentication/src/common/async.ts +++ b/extensions/microsoft-authentication/src/common/async.ts @@ -3,7 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationError, CancellationToken, Disposable } from 'vscode'; +import { CancellationError, CancellationToken, Disposable, Event, EventEmitter } from 'vscode'; + +/** + * Can be passed into the Delayed to defer using a microtask + */ +export const MicrotaskDelay = Symbol('MicrotaskDelay'); export class SequencerByKey { @@ -80,3 +85,473 @@ export function raceTimeoutError(promise: Promise, timeout: number): Promi export function raceCancellationAndTimeoutError(promise: Promise, token: CancellationToken, timeout: number): Promise { return raceCancellationError(raceTimeoutError(promise, timeout), token); } + +interface ILimitedTaskFactory { + factory: () => Promise; + c: (value: T | Promise) => void; + e: (error?: unknown) => void; +} + +export interface ILimiter { + + readonly size: number; + + queue(factory: () => Promise): Promise; + + clear(): void; +} + +/** + * A helper to queue N promises and run them all with a max degree of parallelism. The helper + * ensures that at any time no more than M promises are running at the same time. + */ +export class Limiter implements ILimiter { + + private _size = 0; + private _isDisposed = false; + private runningPromises: number; + private readonly maxDegreeOfParalellism: number; + private readonly outstandingPromises: ILimitedTaskFactory[]; + private readonly _onDrained: EventEmitter; + + constructor(maxDegreeOfParalellism: number) { + this.maxDegreeOfParalellism = maxDegreeOfParalellism; + this.outstandingPromises = []; + this.runningPromises = 0; + this._onDrained = new EventEmitter(); + } + + /** + * + * @returns A promise that resolved when all work is done (onDrained) or when + * there is nothing to do + */ + whenIdle(): Promise { + return this.size > 0 + ? toPromise(this.onDrained) + : Promise.resolve(); + } + + get onDrained(): Event { + return this._onDrained.event; + } + + get size(): number { + return this._size; + } + + queue(factory: () => Promise): Promise { + if (this._isDisposed) { + throw new Error('Object has been disposed'); + } + this._size++; + + return new Promise((c, e) => { + this.outstandingPromises.push({ factory, c, e }); + this.consume(); + }); + } + + private consume(): void { + while (this.outstandingPromises.length && this.runningPromises < this.maxDegreeOfParalellism) { + const iLimitedTask = this.outstandingPromises.shift()!; + this.runningPromises++; + + const promise = iLimitedTask.factory(); + promise.then(iLimitedTask.c, iLimitedTask.e); + promise.then(() => this.consumed(), () => this.consumed()); + } + } + + private consumed(): void { + if (this._isDisposed) { + return; + } + this.runningPromises--; + if (--this._size === 0) { + this._onDrained.fire(); + } + + if (this.outstandingPromises.length > 0) { + this.consume(); + } + } + + clear(): void { + if (this._isDisposed) { + throw new Error('Object has been disposed'); + } + this.outstandingPromises.length = 0; + this._size = this.runningPromises; + } + + dispose(): void { + this._isDisposed = true; + this.outstandingPromises.length = 0; // stop further processing + this._size = 0; + this._onDrained.dispose(); + } +} + + +interface IScheduledLater extends Disposable { + isTriggered(): boolean; +} + +const timeoutDeferred = (timeout: number, fn: () => void): IScheduledLater => { + let scheduled = true; + const handle = setTimeout(() => { + scheduled = false; + fn(); + }, timeout); + return { + isTriggered: () => scheduled, + dispose: () => { + clearTimeout(handle); + scheduled = false; + }, + }; +}; + +const microtaskDeferred = (fn: () => void): IScheduledLater => { + let scheduled = true; + queueMicrotask(() => { + if (scheduled) { + scheduled = false; + fn(); + } + }); + + return { + isTriggered: () => scheduled, + dispose: () => { scheduled = false; }, + }; +}; + +/** + * A helper to delay (debounce) execution of a task that is being requested often. + * + * Following the throttler, now imagine the mail man wants to optimize the number of + * trips proactively. The trip itself can be long, so he decides not to make the trip + * as soon as a letter is submitted. Instead he waits a while, in case more + * letters are submitted. After said waiting period, if no letters were submitted, he + * decides to make the trip. Imagine that N more letters were submitted after the first + * one, all within a short period of time between each other. Even though N+1 + * submissions occurred, only 1 delivery was made. + * + * The delayer offers this behavior via the trigger() method, into which both the task + * to be executed and the waiting period (delay) must be passed in as arguments. Following + * the example: + * + * const delayer = new Delayer(WAITING_PERIOD); + * const letters = []; + * + * function letterReceived(l) { + * letters.push(l); + * delayer.trigger(() => { return makeTheTrip(); }); + * } + */ +export class Delayer implements Disposable { + + private deferred: IScheduledLater | null; + private completionPromise: Promise | null; + private doResolve: ((value?: any | Promise) => void) | null; + private doReject: ((err: any) => void) | null; + private task: (() => T | Promise) | null; + + constructor(public defaultDelay: number | typeof MicrotaskDelay) { + this.deferred = null; + this.completionPromise = null; + this.doResolve = null; + this.doReject = null; + this.task = null; + } + + trigger(task: () => T | Promise, delay = this.defaultDelay): Promise { + this.task = task; + this.cancelTimeout(); + + if (!this.completionPromise) { + this.completionPromise = new Promise((resolve, reject) => { + this.doResolve = resolve; + this.doReject = reject; + }).then(() => { + this.completionPromise = null; + this.doResolve = null; + if (this.task) { + const task = this.task; + this.task = null; + return task(); + } + return undefined; + }); + } + + const fn = () => { + this.deferred = null; + this.doResolve?.(null); + }; + + this.deferred = delay === MicrotaskDelay ? microtaskDeferred(fn) : timeoutDeferred(delay, fn); + + return this.completionPromise; + } + + isTriggered(): boolean { + return !!this.deferred?.isTriggered(); + } + + cancel(): void { + this.cancelTimeout(); + + if (this.completionPromise) { + this.doReject?.(new CancellationError()); + this.completionPromise = null; + } + } + + private cancelTimeout(): void { + this.deferred?.dispose(); + this.deferred = null; + } + + dispose(): void { + this.cancel(); + } +} + +/** + * A helper to prevent accumulation of sequential async tasks. + * + * Imagine a mail man with the sole task of delivering letters. As soon as + * a letter submitted for delivery, he drives to the destination, delivers it + * and returns to his base. Imagine that during the trip, N more letters were submitted. + * When the mail man returns, he picks those N letters and delivers them all in a + * single trip. Even though N+1 submissions occurred, only 2 deliveries were made. + * + * The throttler implements this via the queue() method, by providing it a task + * factory. Following the example: + * + * const throttler = new Throttler(); + * const letters = []; + * + * function deliver() { + * const lettersToDeliver = letters; + * letters = []; + * return makeTheTrip(lettersToDeliver); + * } + * + * function onLetterReceived(l) { + * letters.push(l); + * throttler.queue(deliver); + * } + */ +export class Throttler implements Disposable { + + private activePromise: Promise | null; + private queuedPromise: Promise | null; + private queuedPromiseFactory: (() => Promise) | null; + + private isDisposed = false; + + constructor() { + this.activePromise = null; + this.queuedPromise = null; + this.queuedPromiseFactory = null; + } + + queue(promiseFactory: () => Promise): Promise { + if (this.isDisposed) { + return Promise.reject(new Error('Throttler is disposed')); + } + + if (this.activePromise) { + this.queuedPromiseFactory = promiseFactory; + + if (!this.queuedPromise) { + const onComplete = () => { + this.queuedPromise = null; + + if (this.isDisposed) { + return; + } + + const result = this.queue(this.queuedPromiseFactory!); + this.queuedPromiseFactory = null; + + return result; + }; + + this.queuedPromise = new Promise(resolve => { + this.activePromise!.then(onComplete, onComplete).then(resolve); + }); + } + + return new Promise((resolve, reject) => { + this.queuedPromise!.then(resolve, reject); + }); + } + + this.activePromise = promiseFactory(); + + return new Promise((resolve, reject) => { + this.activePromise!.then((result: T) => { + this.activePromise = null; + resolve(result); + }, (err: unknown) => { + this.activePromise = null; + reject(err); + }); + }); + } + + dispose(): void { + this.isDisposed = true; + } +} + +/** + * A helper to delay execution of a task that is being requested often, while + * preventing accumulation of consecutive executions, while the task runs. + * + * The mail man is clever and waits for a certain amount of time, before going + * out to deliver letters. While the mail man is going out, more letters arrive + * and can only be delivered once he is back. Once he is back the mail man will + * do one more trip to deliver the letters that have accumulated while he was out. + */ +export class ThrottledDelayer { + + private delayer: Delayer>; + private throttler: Throttler; + + constructor(defaultDelay: number) { + this.delayer = new Delayer(defaultDelay); + this.throttler = new Throttler(); + } + + trigger(promiseFactory: () => Promise, delay?: number): Promise { + return this.delayer.trigger(() => this.throttler.queue(promiseFactory), delay) as unknown as Promise; + } + + isTriggered(): boolean { + return this.delayer.isTriggered(); + } + + cancel(): void { + this.delayer.cancel(); + } + + dispose(): void { + this.delayer.dispose(); + this.throttler.dispose(); + } +} + +/** + * A queue is handles one promise at a time and guarantees that at any time only one promise is executing. + */ +export class Queue extends Limiter { + + constructor() { + super(1); + } +} + +/** + * Given an event, returns another event which only fires once. + * + * @param event The event source for the new event. + */ +export function once(event: Event): Event { + return (listener, thisArgs = null, disposables?) => { + // we need this, in case the event fires during the listener call + let didFire = false; + let result: Disposable | undefined = undefined; + result = event(e => { + if (didFire) { + return; + } else if (result) { + result.dispose(); + } else { + didFire = true; + } + + return listener.call(thisArgs, e); + }, null, disposables); + + if (didFire) { + result.dispose(); + } + + return result; + }; +} + +/** + * Creates a promise out of an event, using the {@link Event.once} helper. + */ +export function toPromise(event: Event): Promise { + return new Promise(resolve => once(event)(resolve)); +} + +export type ValueCallback = (value: T | Promise) => void; + +const enum DeferredOutcome { + Resolved, + Rejected +} + +/** + * Creates a promise whose resolution or rejection can be controlled imperatively. + */ +export class DeferredPromise { + + private completeCallback!: ValueCallback; + private errorCallback!: (err: unknown) => void; + private outcome?: { outcome: DeferredOutcome.Rejected; value: any } | { outcome: DeferredOutcome.Resolved; value: T }; + + public get isRejected() { + return this.outcome?.outcome === DeferredOutcome.Rejected; + } + + public get isResolved() { + return this.outcome?.outcome === DeferredOutcome.Resolved; + } + + public get isSettled() { + return !!this.outcome; + } + + public get value() { + return this.outcome?.outcome === DeferredOutcome.Resolved ? this.outcome?.value : undefined; + } + + public readonly p: Promise; + + constructor() { + this.p = new Promise((c, e) => { + this.completeCallback = c; + this.errorCallback = e; + }); + } + + public complete(value: T) { + return new Promise(resolve => { + this.completeCallback(value); + this.outcome = { outcome: DeferredOutcome.Resolved, value }; + resolve(); + }); + } + + public error(err: unknown) { + return new Promise(resolve => { + this.errorCallback(err); + this.outcome = { outcome: DeferredOutcome.Rejected, value: err }; + resolve(); + }); + } + + public cancel() { + return this.error(new CancellationError()); + } +} diff --git a/extensions/microsoft-authentication/src/common/cachePlugin.ts b/extensions/microsoft-authentication/src/common/cachePlugin.ts new file mode 100644 index 00000000000..91b4f0ee6a8 --- /dev/null +++ b/extensions/microsoft-authentication/src/common/cachePlugin.ts @@ -0,0 +1,55 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { ICachePlugin, TokenCacheContext } from '@azure/msal-node'; +import { Disposable, EventEmitter, SecretStorage } from 'vscode'; + +export class SecretStorageCachePlugin implements ICachePlugin { + private readonly _onDidChange: EventEmitter = new EventEmitter(); + readonly onDidChange = this._onDidChange.event; + + private _disposable: Disposable; + + private _value: string | undefined; + + constructor( + private readonly _secretStorage: SecretStorage, + private readonly _key: string + ) { + this._disposable = Disposable.from( + this._onDidChange, + this._registerChangeHandler() + ); + } + + private _registerChangeHandler() { + return this._secretStorage.onDidChange(e => { + if (e.key === this._key) { + this._onDidChange.fire(); + } + }); + } + + async beforeCacheAccess(tokenCacheContext: TokenCacheContext): Promise { + const data = await this._secretStorage.get(this._key); + this._value = data; + if (data) { + tokenCacheContext.tokenCache.deserialize(data); + } + } + + async afterCacheAccess(tokenCacheContext: TokenCacheContext): Promise { + if (tokenCacheContext.cacheHasChanged) { + const value = tokenCacheContext.tokenCache.serialize(); + if (value !== this._value) { + await this._secretStorage.store(this._key, value); + } + } + } + + dispose() { + this._disposable.dispose(); + } +} diff --git a/extensions/microsoft-authentication/src/common/event.ts b/extensions/microsoft-authentication/src/common/event.ts new file mode 100644 index 00000000000..1df992cf8bb --- /dev/null +++ b/extensions/microsoft-authentication/src/common/event.ts @@ -0,0 +1,107 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { Event } from 'vscode'; + +/** + * The EventBufferer is useful in situations in which you want + * to delay firing your events during some code. + * You can wrap that code and be sure that the event will not + * be fired during that wrap. + * + * ``` + * const emitter: Emitter; + * const delayer = new EventDelayer(); + * const delayedEvent = delayer.wrapEvent(emitter.event); + * + * delayedEvent(console.log); + * + * delayer.bufferEvents(() => { + * emitter.fire(); // event will not be fired yet + * }); + * + * // event will only be fired at this point + * ``` + */ +export class EventBufferer { + + private data: { buffers: Function[] }[] = []; + + wrapEvent(event: Event): Event; + wrapEvent(event: Event, reduce: (last: T | undefined, event: T) => T): Event; + wrapEvent(event: Event, reduce: (last: O | undefined, event: T) => O, initial: O): Event; + wrapEvent(event: Event, reduce?: (last: T | O | undefined, event: T) => T | O, initial?: O): Event { + return (listener, thisArgs?, disposables?) => { + return event(i => { + const data = this.data[this.data.length - 1]; + + // Non-reduce scenario + if (!reduce) { + // Buffering case + if (data) { + data.buffers.push(() => listener.call(thisArgs, i)); + } else { + // Not buffering case + listener.call(thisArgs, i); + } + return; + } + + // Reduce scenario + const reduceData = data as typeof data & { + /** + * The accumulated items that will be reduced. + */ + items?: T[]; + /** + * The reduced result cached to be shared with other listeners. + */ + reducedResult?: T | O; + }; + + // Not buffering case + if (!reduceData) { + // TODO: Is there a way to cache this reduce call for all listeners? + listener.call(thisArgs, reduce(initial, i)); + return; + } + + // Buffering case + reduceData.items ??= []; + reduceData.items.push(i); + if (reduceData.buffers.length === 0) { + // Include a single buffered function that will reduce all events when we're done buffering events + data.buffers.push(() => { + // cache the reduced result so that the value can be shared across all listeners + reduceData.reducedResult ??= initial + ? reduceData.items!.reduce(reduce as (last: O | undefined, event: T) => O, initial) + : reduceData.items!.reduce(reduce as (last: T | undefined, event: T) => T); + listener.call(thisArgs, reduceData.reducedResult); + }); + } + }, undefined, disposables); + }; + } + + bufferEvents(fn: () => R): R { + const data = { buffers: new Array() }; + this.data.push(data); + const r = fn(); + this.data.pop(); + data.buffers.forEach(flush => flush()); + return r; + } + + async bufferEventsAsync(fn: () => Promise): Promise { + const data = { buffers: new Array() }; + this.data.push(data); + try { + const r = await fn(); + return r; + } finally { + this.data.pop(); + data.buffers.forEach(flush => flush()); + } + } +} diff --git a/extensions/microsoft-authentication/src/common/experimentation.ts b/extensions/microsoft-authentication/src/common/experimentation.ts new file mode 100644 index 00000000000..dd383c4f040 --- /dev/null +++ b/extensions/microsoft-authentication/src/common/experimentation.ts @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; +import { getExperimentationService, IExperimentationService, IExperimentationTelemetry, TargetPopulation } from 'vscode-tas-client'; + +export async function createExperimentationService( + context: vscode.ExtensionContext, + experimentationTelemetry: IExperimentationTelemetry, + isPreRelease: boolean, +): Promise { + const id = context.extension.id; + const version = context.extension.packageJSON['version']; + + const service = getExperimentationService( + id, + version, + isPreRelease ? TargetPopulation.Insiders : TargetPopulation.Public, + experimentationTelemetry, + context.globalState, + ) as unknown as IExperimentationService; + await service.initializePromise; + await service.initialFetch; + return service; +} diff --git a/extensions/microsoft-authentication/src/common/loggerOptions.ts b/extensions/microsoft-authentication/src/common/loggerOptions.ts new file mode 100644 index 00000000000..86443c0281f --- /dev/null +++ b/extensions/microsoft-authentication/src/common/loggerOptions.ts @@ -0,0 +1,61 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { LogLevel as MsalLogLevel } from '@azure/msal-node'; +import { env, LogLevel, LogOutputChannel } from 'vscode'; + +export class MsalLoggerOptions { + piiLoggingEnabled = false; + + constructor(private readonly _output: LogOutputChannel) { } + + get logLevel(): MsalLogLevel { + return this._toMsalLogLevel(env.logLevel); + } + + loggerCallback(level: MsalLogLevel, message: string, containsPii: boolean): void { + if (containsPii) { + return; + } + + switch (level) { + case MsalLogLevel.Error: + this._output.error(message); + return; + case MsalLogLevel.Warning: + this._output.warn(message); + return; + case MsalLogLevel.Info: + this._output.info(message); + return; + case MsalLogLevel.Verbose: + this._output.debug(message); + return; + case MsalLogLevel.Trace: + this._output.trace(message); + return; + default: + this._output.info(message); + return; + } + } + + private _toMsalLogLevel(logLevel: LogLevel): MsalLogLevel { + switch (logLevel) { + case LogLevel.Trace: + return MsalLogLevel.Trace; + case LogLevel.Debug: + return MsalLogLevel.Verbose; + case LogLevel.Info: + return MsalLogLevel.Info; + case LogLevel.Warning: + return MsalLogLevel.Warning; + case LogLevel.Error: + return MsalLogLevel.Error; + default: + return MsalLogLevel.Info; + } + } +} diff --git a/extensions/microsoft-authentication/src/common/loopbackClientAndOpener.ts b/extensions/microsoft-authentication/src/common/loopbackClientAndOpener.ts new file mode 100644 index 00000000000..3fbb0340037 --- /dev/null +++ b/extensions/microsoft-authentication/src/common/loopbackClientAndOpener.ts @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type { ILoopbackClient, ServerAuthorizationCodeResponse } from '@azure/msal-node'; +import type { UriEventHandler } from '../UriEventHandler'; +import { env, LogOutputChannel, Uri } from 'vscode'; +import { toPromise } from './async'; + +export interface ILoopbackClientAndOpener extends ILoopbackClient { + openBrowser(url: string): Promise; +} + +export class UriHandlerLoopbackClient implements ILoopbackClientAndOpener { + constructor( + private readonly _uriHandler: UriEventHandler, + private readonly _redirectUri: string, + private readonly _logger: LogOutputChannel + ) { } + + async listenForAuthCode(): Promise { + const url = await toPromise(this._uriHandler.event); + this._logger.debug(`Received URL event. Authority: ${url.authority}`); + const result = new URL(url.toString(true)); + + return { + code: result.searchParams.get('code') ?? undefined, + state: result.searchParams.get('state') ?? undefined, + error: result.searchParams.get('error') ?? undefined, + error_description: result.searchParams.get('error_description') ?? undefined, + error_uri: result.searchParams.get('error_uri') ?? undefined, + }; + } + + getRedirectUri(): string { + // We always return the constant redirect URL because + // it will handle redirecting back to the extension + return this._redirectUri; + } + + closeServer(): void { + // No-op + } + + async openBrowser(url: string): Promise { + const callbackUri = await env.asExternalUri(Uri.parse(`${env.uriScheme}://vscode.microsoft-authentication`)); + + const uri = Uri.parse(url + `&state=${encodeURI(callbackUri.toString(true))}`); + await env.openExternal(uri); + } +} diff --git a/extensions/microsoft-authentication/src/common/publicClientCache.ts b/extensions/microsoft-authentication/src/common/publicClientCache.ts new file mode 100644 index 00000000000..925a4d1a88c --- /dev/null +++ b/extensions/microsoft-authentication/src/common/publicClientCache.ts @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import type { AccountInfo, AuthenticationResult, InteractiveRequest, SilentFlowRequest } from '@azure/msal-node'; +import type { Disposable, Event } from 'vscode'; + +export interface ICachedPublicClientApplication extends Disposable { + initialize(): Promise; + onDidAccountsChange: Event<{ added: AccountInfo[]; changed: AccountInfo[]; deleted: AccountInfo[] }>; + onDidRemoveLastAccount: Event; + acquireTokenSilent(request: SilentFlowRequest): Promise; + acquireTokenInteractive(request: InteractiveRequest): Promise; + removeAccount(account: AccountInfo): Promise; + accounts: AccountInfo[]; + clientId: string; + authority: string; +} + +export interface ICachedPublicClientApplicationManager { + onDidAccountsChange: Event<{ added: AccountInfo[]; changed: AccountInfo[]; deleted: AccountInfo[] }>; + getOrCreate(clientId: string, authority: string): Promise; + getAll(): ICachedPublicClientApplication[]; +} diff --git a/extensions/microsoft-authentication/src/common/scopeData.ts b/extensions/microsoft-authentication/src/common/scopeData.ts new file mode 100644 index 00000000000..4432abfed43 --- /dev/null +++ b/extensions/microsoft-authentication/src/common/scopeData.ts @@ -0,0 +1,85 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +const DEFAULT_CLIENT_ID = 'aebc6443-996d-45c2-90f0-388ff96faa56'; +const DEFAULT_TENANT = 'organizations'; + +const OIDC_SCOPES = ['openid', 'email', 'profile', 'offline_access']; +const GRAPH_TACK_ON_SCOPE = 'User.Read'; + +export class ScopeData { + + /** + * The full list of scopes including: + * * the original scopes passed to the constructor + * * internal VS Code scopes (e.g. `VSCODE_CLIENT_ID:...`) + * * the default scopes (`openid`, `email`, `profile`, `offline_access`) + */ + readonly allScopes: string[]; + + /** + * The full list of scopes as a space-separated string. For logging. + */ + readonly scopeStr: string; + + /** + * The list of scopes to send to the token endpoint. This is the same as `scopes` but without the internal VS Code scopes. + */ + readonly scopesToSend: string[]; + + /** + * The client ID to use for the token request. This is the value of the `VSCODE_CLIENT_ID:...` scope if present, otherwise the default client ID. + */ + readonly clientId: string; + + /** + * The tenant ID to use for the token request. This is the value of the `VSCODE_TENANT:...` scope if present, otherwise the default tenant ID. + */ + readonly tenant: string; + + constructor(readonly originalScopes: readonly string[] = []) { + const modifiedScopes = [...originalScopes]; + modifiedScopes.sort(); + this.allScopes = modifiedScopes; + this.scopeStr = modifiedScopes.join(' '); + this.scopesToSend = this.getScopesToSend(modifiedScopes); + this.clientId = this.getClientId(this.allScopes); + this.tenant = this.getTenantId(this.allScopes); + } + + private getClientId(scopes: string[]) { + return scopes.reduce((prev, current) => { + if (current.startsWith('VSCODE_CLIENT_ID:')) { + return current.split('VSCODE_CLIENT_ID:')[1]; + } + return prev; + }, undefined) ?? DEFAULT_CLIENT_ID; + } + + private getTenantId(scopes: string[]) { + return scopes.reduce((prev, current) => { + if (current.startsWith('VSCODE_TENANT:')) { + return current.split('VSCODE_TENANT:')[1]; + } + return prev; + }, undefined) ?? DEFAULT_TENANT; + } + + private getScopesToSend(scopes: string[]) { + const scopesToSend = scopes.filter(s => !s.startsWith('VSCODE_')); + + const set = new Set(scopesToSend); + for (const scope of OIDC_SCOPES) { + set.delete(scope); + } + + // If we only had OIDC scopes, we need to add a tack-on scope to make the request valid + // by forcing Identity into treating this as a Graph token request. + if (!set.size) { + scopesToSend.push(GRAPH_TACK_ON_SCOPE); + } + return scopesToSend; + } +} diff --git a/extensions/microsoft-authentication/src/common/telemetryReporter.ts b/extensions/microsoft-authentication/src/common/telemetryReporter.ts new file mode 100644 index 00000000000..25ac2623282 --- /dev/null +++ b/extensions/microsoft-authentication/src/common/telemetryReporter.ts @@ -0,0 +1,128 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import TelemetryReporter, { TelemetryEventProperties } from '@vscode/extension-telemetry'; +import { IExperimentationTelemetry } from 'vscode-tas-client'; + +export const enum MicrosoftAccountType { + AAD = 'aad', + MSA = 'msa', + Unknown = 'unknown' +} + +export class MicrosoftAuthenticationTelemetryReporter implements IExperimentationTelemetry { + private sharedProperties: Record = {}; + protected _telemetryReporter: TelemetryReporter; + constructor(aiKey: string) { + this._telemetryReporter = new TelemetryReporter(aiKey); + } + + get telemetryReporter(): TelemetryReporter { + return this._telemetryReporter; + } + + setSharedProperty(name: string, value: string): void { + this.sharedProperties[name] = value; + } + + postEvent(eventName: string, props: Map): void { + const eventProperties: TelemetryEventProperties = { ...this.sharedProperties, ...Object.fromEntries(props) }; + this._telemetryReporter.sendTelemetryEvent( + eventName, + eventProperties + ); + } + + sendLoginEvent(scopes: readonly string[]): void { + /* __GDPR__ + "login" : { + "owner": "TylerLeonhardt", + "comment": "Used to determine the usage of the Microsoft Auth Provider.", + "scopes": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight", "comment": "Used to determine what scope combinations are being requested." } + } + */ + this._telemetryReporter.sendTelemetryEvent('login', { + // Get rid of guids from telemetry. + scopes: JSON.stringify(this._scrubGuids(scopes)), + }); + } + sendLoginFailedEvent(): void { + /* __GDPR__ + "loginFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users run into issues with the login flow." } + */ + this._telemetryReporter.sendTelemetryEvent('loginFailed'); + } + sendLogoutEvent(): void { + /* __GDPR__ + "logout" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users log out." } + */ + this._telemetryReporter.sendTelemetryEvent('logout'); + } + sendLogoutFailedEvent(): void { + /* __GDPR__ + "logoutFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often fail to log out." } + */ + this._telemetryReporter.sendTelemetryEvent('logoutFailed'); + } + /** + * Sends an event for an account type available at startup. + * @param scopes The scopes for the session + * @param accountType The account type for the session + * @todo Remove the scopes since we really don't care about them. + */ + sendAccountEvent(scopes: string[], accountType: MicrosoftAccountType): void { + /* __GDPR__ + "login" : { + "owner": "TylerLeonhardt", + "comment": "Used to determine the usage of the Microsoft Auth Provider.", + "scopes": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight", "comment": "Used to determine what scope combinations are being requested." }, + "accountType": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight", "comment": "Used to determine what account types are being used." } + } + */ + this._telemetryReporter.sendTelemetryEvent('account', { + // Get rid of guids from telemetry. + scopes: JSON.stringify(this._scrubGuids(scopes)), + accountType + }); + } + + protected _scrubGuids(scopes: readonly string[]): string[] { + return scopes.map(s => s.replace(/[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}/i, '{guid}')); + } +} + +export class MicrosoftSovereignCloudAuthenticationTelemetryReporter extends MicrosoftAuthenticationTelemetryReporter { + override sendLoginEvent(scopes: string[]): void { + /* __GDPR__ + "loginMicrosoftSovereignCloud" : { + "owner": "TylerLeonhardt", + "comment": "Used to determine the usage of the Microsoft Auth Provider.", + "scopes": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight", "comment": "Used to determine what scope combinations are being requested." } + } + */ + this._telemetryReporter.sendTelemetryEvent('loginMicrosoftSovereignCloud', { + // Get rid of guids from telemetry. + scopes: JSON.stringify(this._scrubGuids(scopes)), + }); + } + override sendLoginFailedEvent(): void { + /* __GDPR__ + "loginMicrosoftSovereignCloudFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users run into issues with the login flow." } + */ + this._telemetryReporter.sendTelemetryEvent('loginMicrosoftSovereignCloudFailed'); + } + override sendLogoutEvent(): void { + /* __GDPR__ + "logoutMicrosoftSovereignCloud" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users log out." } + */ + this._telemetryReporter.sendTelemetryEvent('logoutMicrosoftSovereignCloud'); + } + override sendLogoutFailedEvent(): void { + /* __GDPR__ + "logoutMicrosoftSovereignCloudFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often fail to log out." } + */ + this._telemetryReporter.sendTelemetryEvent('logoutMicrosoftSovereignCloudFailed'); + } +} diff --git a/extensions/microsoft-authentication/src/common/test/loopbackClientAndOpener.test.ts b/extensions/microsoft-authentication/src/common/test/loopbackClientAndOpener.test.ts new file mode 100644 index 00000000000..69d7afaa38a --- /dev/null +++ b/extensions/microsoft-authentication/src/common/test/loopbackClientAndOpener.test.ts @@ -0,0 +1,83 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as assert from 'assert'; +import { env, Uri, window } from 'vscode'; +import * as sinon from 'sinon'; +import { UriHandlerLoopbackClient } from '../loopbackClientAndOpener'; +import { UriEventHandler } from '../../UriEventHandler'; + +suite('UriHandlerLoopbackClient', () => { + const redirectUri = 'http://localhost'; + let uriHandler: UriEventHandler; + let client: UriHandlerLoopbackClient; + let envStub: sinon.SinonStubbedInstance; + let callbackUri: Uri; + + setup(async () => { + callbackUri = await env.asExternalUri(Uri.parse(`${env.uriScheme}://vscode.microsoft-authentication`)); + envStub = sinon.stub(env); + envStub.openExternal.resolves(true); + envStub.asExternalUri.callThrough(); + uriHandler = new UriEventHandler(); + client = new UriHandlerLoopbackClient(uriHandler, redirectUri, window.createOutputChannel('test', { log: true })); + }); + + teardown(() => { + sinon.restore(); + uriHandler.dispose(); + }); + + suite('openBrowser', () => { + test('should open browser with correct URL', async () => { + const testUrl = 'http://example.com?foo=5'; + + await client.openBrowser(testUrl); + + assert.ok(envStub.asExternalUri.calledOnce); + assert.ok(envStub.openExternal.calledOnce); + + const expectedUri = Uri.parse(testUrl + `&state=${encodeURI(callbackUri.toString(true))}`); + const value = envStub.openExternal.getCalls()[0].args[0]; + assert.strictEqual(value.toString(true), expectedUri.toString(true)); + }); + }); + + suite('getRedirectUri', () => { + test('should return the redirect URI', () => { + const result = client.getRedirectUri(); + assert.strictEqual(result, redirectUri); + }); + }); + + suite('listenForAuthCode', () => { + test('should return auth code from URL', async () => { + const code = '1234'; + const state = '5678'; + const testUrl = Uri.parse(`http://example.com?code=${code}&state=${state}`); + const promise = client.listenForAuthCode(); + uriHandler.handleUri(testUrl); + const result = await promise; + + assert.strictEqual(result.code, code); + assert.strictEqual(result.state, state); + }); + + test('should return auth error from URL', async () => { + const error = 'access_denied'; + const errorDescription = 'reason'; + const errorUri = 'uri'; + const testUrl = Uri.parse(`http://example.com?error=${error}&error_description=${errorDescription}&error_uri=${errorUri}`); + + const promise = client.listenForAuthCode(); + uriHandler.handleUri(testUrl); + const result = await promise; + + assert.strictEqual(result.error, 'access_denied'); + assert.strictEqual(result.error_description, 'reason'); + assert.strictEqual(result.error_uri, 'uri'); + }); + }); +}); diff --git a/extensions/microsoft-authentication/src/common/test/scopeData.test.ts b/extensions/microsoft-authentication/src/common/test/scopeData.test.ts new file mode 100644 index 00000000000..9250d7cecbd --- /dev/null +++ b/extensions/microsoft-authentication/src/common/test/scopeData.test.ts @@ -0,0 +1,59 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as assert from 'assert'; +import { ScopeData } from '../scopeData'; + +suite('ScopeData', () => { + test('should include default scopes if not present', () => { + const scopeData = new ScopeData(['custom_scope']); + assert.deepStrictEqual(scopeData.allScopes, ['custom_scope']); + }); + + test('should not duplicate default scopes if already present', () => { + const scopeData = new ScopeData(['custom_scope', 'openid', 'email', 'profile', 'offline_access']); + assert.deepStrictEqual(scopeData.allScopes, ['custom_scope', 'email', 'offline_access', 'openid', 'profile']); + }); + + test('should sort the scopes alphabetically', () => { + const scopeData = new ScopeData(['custom_scope', 'profile', 'email', 'openid', 'offline_access']); + assert.deepStrictEqual(scopeData.allScopes, ['custom_scope', 'email', 'offline_access', 'openid', 'profile']); + }); + + test('should create a space-separated string of all scopes', () => { + const scopeData = new ScopeData(['custom_scope', 'openid', 'email', 'offline_access', 'profile']); + assert.strictEqual(scopeData.scopeStr, 'custom_scope email offline_access openid profile'); + }); + + test('should add TACK ON scope if all scopes are OIDC scopes', () => { + const scopeData = new ScopeData(['openid', 'email', 'offline_access', 'profile']); + assert.deepStrictEqual(scopeData.scopesToSend, ['email', 'offline_access', 'openid', 'profile', 'User.Read']); + }); + + test('should filter out internal VS Code scopes for scopesToSend', () => { + const scopeData = new ScopeData(['custom_scope', 'VSCODE_CLIENT_ID:some_id']); + assert.deepStrictEqual(scopeData.scopesToSend, ['custom_scope']); + }); + + test('should use the default client ID if no VSCODE_CLIENT_ID scope is present', () => { + const scopeData = new ScopeData(['custom_scope']); + assert.strictEqual(scopeData.clientId, 'aebc6443-996d-45c2-90f0-388ff96faa56'); + }); + + test('should use the VSCODE_CLIENT_ID scope if present', () => { + const scopeData = new ScopeData(['custom_scope', 'VSCODE_CLIENT_ID:some_id']); + assert.strictEqual(scopeData.clientId, 'some_id'); + }); + + test('should use the default tenant ID if no VSCODE_TENANT scope is present', () => { + const scopeData = new ScopeData(['custom_scope']); + assert.strictEqual(scopeData.tenant, 'organizations'); + }); + + test('should use the VSCODE_TENANT scope if present', () => { + const scopeData = new ScopeData(['custom_scope', 'VSCODE_TENANT:some_tenant']); + assert.strictEqual(scopeData.tenant, 'some_tenant'); + }); +}); diff --git a/extensions/microsoft-authentication/src/cryptoUtils.ts b/extensions/microsoft-authentication/src/cryptoUtils.ts index 582dae74c3c..e608a81fc99 100644 --- a/extensions/microsoft-authentication/src/cryptoUtils.ts +++ b/extensions/microsoft-authentication/src/cryptoUtils.ts @@ -3,7 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { base64Encode } from './node/buffer'; -import { crypto } from './node/crypto'; export function randomUUID() { return crypto.randomUUID(); diff --git a/extensions/microsoft-authentication/src/extension.ts b/extensions/microsoft-authentication/src/extension.ts index 87dc94e4c25..3f9b5d3a4d1 100644 --- a/extensions/microsoft-authentication/src/extension.ts +++ b/extensions/microsoft-authentication/src/extension.ts @@ -3,179 +3,83 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { Environment, EnvironmentParameters } from '@azure/ms-rest-azure-env'; -import { AzureActiveDirectoryService, IStoredSession } from './AADHelper'; -import { BetterTokenStorage } from './betterSecretStorage'; -import { UriEventHandler } from './UriEventHandler'; -import TelemetryReporter from '@vscode/extension-telemetry'; - -async function initMicrosoftSovereignCloudAuthProvider(context: vscode.ExtensionContext, telemetryReporter: TelemetryReporter, uriHandler: UriEventHandler, tokenStorage: BetterTokenStorage): Promise { - const environment = vscode.workspace.getConfiguration('microsoft-sovereign-cloud').get('environment'); - let authProviderName: string | undefined; - if (!environment) { - return undefined; +import { commands, env, ExtensionContext, l10n, window, workspace } from 'vscode'; +import * as extensionV1 from './extensionV1'; +import * as extensionV2 from './extensionV2'; +import { createExperimentationService } from './common/experimentation'; +import { MicrosoftAuthenticationTelemetryReporter } from './common/telemetryReporter'; +import { IExperimentationService } from 'vscode-tas-client'; +import Logger from './logger'; + +function shouldUseMsal(expService: IExperimentationService): boolean { + // First check if there is a setting value to allow user to override the default + const inspect = workspace.getConfiguration('microsoft').inspect('useMsal'); + if (inspect?.workspaceFolderValue !== undefined) { + Logger.debug(`Acquired MSAL enablement value from 'workspaceFolderValue'. Value: ${inspect.workspaceFolderValue}`); + return inspect.workspaceFolderValue; } - - if (environment === 'custom') { - const customEnv = vscode.workspace.getConfiguration('microsoft-sovereign-cloud').get('customEnvironment'); - if (!customEnv) { - const res = await vscode.window.showErrorMessage(vscode.l10n.t('You must also specify a custom environment in order to use the custom environment auth provider.'), vscode.l10n.t('Open settings')); - if (res) { - await vscode.commands.executeCommand('workbench.action.openSettingsJson', 'microsoft-sovereign-cloud.customEnvironment'); - } - return undefined; - } - try { - Environment.add(customEnv); - } catch (e) { - const res = await vscode.window.showErrorMessage(vscode.l10n.t('Error validating custom environment setting: {0}', e.message), vscode.l10n.t('Open settings')); - if (res) { - await vscode.commands.executeCommand('workbench.action.openSettings', 'microsoft-sovereign-cloud.customEnvironment'); - } - return undefined; - } - authProviderName = customEnv.name; - } else { - authProviderName = environment; + if (inspect?.workspaceValue !== undefined) { + Logger.debug(`Acquired MSAL enablement value from 'workspaceValue'. Value: ${inspect.workspaceValue}`); + return inspect.workspaceValue; } - - const env = Environment.get(authProviderName); - if (!env) { - const res = await vscode.window.showErrorMessage(vscode.l10n.t('The environment `{0}` is not a valid environment.', authProviderName), vscode.l10n.t('Open settings')); - return undefined; + if (inspect?.globalValue !== undefined) { + Logger.debug(`Acquired MSAL enablement value from 'globalValue'. Value: ${inspect.globalValue}`); + return inspect.globalValue; } - const aadService = new AzureActiveDirectoryService( - vscode.window.createOutputChannel(vscode.l10n.t('Microsoft Sovereign Cloud Authentication'), { log: true }), - context, - uriHandler, - tokenStorage, - telemetryReporter, - env); - await aadService.initialize(); - - const disposable = vscode.authentication.registerAuthenticationProvider('microsoft-sovereign-cloud', authProviderName, { - onDidChangeSessions: aadService.onDidChangeSessions, - getSessions: (scopes: string[]) => aadService.getSessions(scopes), - createSession: async (scopes: string[]) => { - try { - /* __GDPR__ - "login" : { - "owner": "TylerLeonhardt", - "comment": "Used to determine the usage of the Microsoft Sovereign Cloud Auth Provider.", - "scopes": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight", "comment": "Used to determine what scope combinations are being requested." } - } - */ - telemetryReporter.sendTelemetryEvent('loginMicrosoftSovereignCloud', { - // Get rid of guids from telemetry. - scopes: JSON.stringify(scopes.map(s => s.replace(/[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}/i, '{guid}'))), - }); - - return await aadService.createSession(scopes); - } catch (e) { - /* __GDPR__ - "loginFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users run into issues with the login flow." } - */ - telemetryReporter.sendTelemetryEvent('loginMicrosoftSovereignCloudFailed'); - - throw e; - } - }, - removeSession: async (id: string) => { - try { - /* __GDPR__ - "logout" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users log out." } - */ - telemetryReporter.sendTelemetryEvent('logoutMicrosoftSovereignCloud'); - - await aadService.removeSessionById(id); - } catch (e) { - /* __GDPR__ - "logoutFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often fail to log out." } - */ - telemetryReporter.sendTelemetryEvent('logoutMicrosoftSovereignCloudFailed'); - } - } - }, { supportsMultipleAccounts: true }); + // Then check if the experiment value + const expValue = expService.getTreatmentVariable('vscode', 'microsoft.useMsal'); + if (expValue !== undefined) { + Logger.debug(`Acquired MSAL enablement value from 'exp'. Value: ${expValue}`); + return expValue; + } - context.subscriptions.push(disposable); - return disposable; + Logger.debug('Acquired MSAL enablement value from default. Value: false'); + // If no setting or experiment value is found, default to false + return false; } +let useMsal: boolean | undefined; -export async function activate(context: vscode.ExtensionContext) { - const aiKey: string = context.extension.packageJSON.aiKey; - const telemetryReporter = new TelemetryReporter(aiKey); - - const uriHandler = new UriEventHandler(); - context.subscriptions.push(uriHandler); - context.subscriptions.push(vscode.window.registerUriHandler(uriHandler)); - const betterSecretStorage = new BetterTokenStorage('microsoft.login.keylist', context); - - const loginService = new AzureActiveDirectoryService( - vscode.window.createOutputChannel(vscode.l10n.t('Microsoft Authentication'), { log: true }), +export async function activate(context: ExtensionContext) { + const mainTelemetryReporter = new MicrosoftAuthenticationTelemetryReporter(context.extension.packageJSON.aiKey); + const expService = await createExperimentationService( context, - uriHandler, - betterSecretStorage, - telemetryReporter, - Environment.AzureCloud); - await loginService.initialize(); - - context.subscriptions.push(vscode.authentication.registerAuthenticationProvider('microsoft', 'Microsoft', { - onDidChangeSessions: loginService.onDidChangeSessions, - getSessions: (scopes: string[], options?: vscode.AuthenticationProviderSessionOptions) => loginService.getSessions(scopes, options?.account), - createSession: async (scopes: string[], options?: vscode.AuthenticationProviderSessionOptions) => { - try { - /* __GDPR__ - "login" : { - "owner": "TylerLeonhardt", - "comment": "Used to determine the usage of the Microsoft Auth Provider.", - "scopes": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight", "comment": "Used to determine what scope combinations are being requested." } - } - */ - telemetryReporter.sendTelemetryEvent('login', { - // Get rid of guids from telemetry. - scopes: JSON.stringify(scopes.map(s => s.replace(/[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}/i, '{guid}'))), - }); - - return await loginService.createSession(scopes, options?.account); - } catch (e) { - /* __GDPR__ - "loginFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users run into issues with the login flow." } - */ - telemetryReporter.sendTelemetryEvent('loginFailed'); - - throw e; - } - }, - removeSession: async (id: string) => { - try { - /* __GDPR__ - "logout" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users log out." } - */ - telemetryReporter.sendTelemetryEvent('logout'); - - await loginService.removeSessionById(id); - } catch (e) { - /* __GDPR__ - "logoutFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often fail to log out." } - */ - telemetryReporter.sendTelemetryEvent('logoutFailed'); - } + mainTelemetryReporter, + env.uriScheme !== 'vscode', // isPreRelease + ); + useMsal = shouldUseMsal(expService); + + context.subscriptions.push(workspace.onDidChangeConfiguration(async e => { + if (!e.affectsConfiguration('microsoft.useMsal') || useMsal === shouldUseMsal(expService)) { + return; } - }, { supportsMultipleAccounts: true })); - - let microsoftSovereignCloudAuthProviderDisposable = await initMicrosoftSovereignCloudAuthProvider(context, telemetryReporter, uriHandler, betterSecretStorage); - context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(async e => { - if (e.affectsConfiguration('microsoft-sovereign-cloud')) { - microsoftSovereignCloudAuthProviderDisposable?.dispose(); - microsoftSovereignCloudAuthProviderDisposable = await initMicrosoftSovereignCloudAuthProvider(context, telemetryReporter, uriHandler, betterSecretStorage); + const reload = l10n.t('Reload'); + const result = await window.showInformationMessage( + 'Reload required', + { + modal: true, + detail: l10n.t('Microsoft Account configuration has been changed.'), + }, + reload + ); + + if (result === reload) { + commands.executeCommand('workbench.action.reloadWindow'); } })); - - return; + // Only activate the new extension if we are not running in a browser environment + if (useMsal && typeof navigator === 'undefined') { + await extensionV2.activate(context, mainTelemetryReporter); + } else { + await extensionV1.activate(context, mainTelemetryReporter.telemetryReporter); + } } -// this method is called when your extension is deactivated -export function deactivate() { } +export function deactivate() { + if (useMsal) { + extensionV2.deactivate(); + } else { + extensionV1.deactivate(); + } +} diff --git a/extensions/microsoft-authentication/src/extensionV1.ts b/extensions/microsoft-authentication/src/extensionV1.ts new file mode 100644 index 00000000000..f785adad85c --- /dev/null +++ b/extensions/microsoft-authentication/src/extensionV1.ts @@ -0,0 +1,178 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { Environment, EnvironmentParameters } from '@azure/ms-rest-azure-env'; +import { AzureActiveDirectoryService, IStoredSession } from './AADHelper'; +import { BetterTokenStorage } from './betterSecretStorage'; +import { UriEventHandler } from './UriEventHandler'; +import TelemetryReporter from '@vscode/extension-telemetry'; +import Logger from './logger'; + +async function initMicrosoftSovereignCloudAuthProvider(context: vscode.ExtensionContext, telemetryReporter: TelemetryReporter, uriHandler: UriEventHandler, tokenStorage: BetterTokenStorage): Promise { + const environment = vscode.workspace.getConfiguration('microsoft-sovereign-cloud').get('environment'); + let authProviderName: string | undefined; + if (!environment) { + return undefined; + } + + if (environment === 'custom') { + const customEnv = vscode.workspace.getConfiguration('microsoft-sovereign-cloud').get('customEnvironment'); + if (!customEnv) { + const res = await vscode.window.showErrorMessage(vscode.l10n.t('You must also specify a custom environment in order to use the custom environment auth provider.'), vscode.l10n.t('Open settings')); + if (res) { + await vscode.commands.executeCommand('workbench.action.openSettingsJson', 'microsoft-sovereign-cloud.customEnvironment'); + } + return undefined; + } + try { + Environment.add(customEnv); + } catch (e) { + const res = await vscode.window.showErrorMessage(vscode.l10n.t('Error validating custom environment setting: {0}', e.message), vscode.l10n.t('Open settings')); + if (res) { + await vscode.commands.executeCommand('workbench.action.openSettings', 'microsoft-sovereign-cloud.customEnvironment'); + } + return undefined; + } + authProviderName = customEnv.name; + } else { + authProviderName = environment; + } + + const env = Environment.get(authProviderName); + if (!env) { + const res = await vscode.window.showErrorMessage(vscode.l10n.t('The environment `{0}` is not a valid environment.', authProviderName), vscode.l10n.t('Open settings')); + return undefined; + } + + const aadService = new AzureActiveDirectoryService( + vscode.window.createOutputChannel(vscode.l10n.t('Microsoft Sovereign Cloud Authentication'), { log: true }), + context, + uriHandler, + tokenStorage, + telemetryReporter, + env); + await aadService.initialize(); + + const disposable = vscode.authentication.registerAuthenticationProvider('microsoft-sovereign-cloud', authProviderName, { + onDidChangeSessions: aadService.onDidChangeSessions, + getSessions: (scopes: string[]) => aadService.getSessions(scopes), + createSession: async (scopes: string[]) => { + try { + /* __GDPR__ + "login" : { + "owner": "TylerLeonhardt", + "comment": "Used to determine the usage of the Microsoft Sovereign Cloud Auth Provider.", + "scopes": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight", "comment": "Used to determine what scope combinations are being requested." } + } + */ + telemetryReporter.sendTelemetryEvent('loginMicrosoftSovereignCloud', { + // Get rid of guids from telemetry. + scopes: JSON.stringify(scopes.map(s => s.replace(/[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}/i, '{guid}'))), + }); + + return await aadService.createSession(scopes); + } catch (e) { + /* __GDPR__ + "loginFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users run into issues with the login flow." } + */ + telemetryReporter.sendTelemetryEvent('loginMicrosoftSovereignCloudFailed'); + + throw e; + } + }, + removeSession: async (id: string) => { + try { + /* __GDPR__ + "logout" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users log out." } + */ + telemetryReporter.sendTelemetryEvent('logoutMicrosoftSovereignCloud'); + + await aadService.removeSessionById(id); + } catch (e) { + /* __GDPR__ + "logoutFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often fail to log out." } + */ + telemetryReporter.sendTelemetryEvent('logoutMicrosoftSovereignCloudFailed'); + } + } + }, { supportsMultipleAccounts: true }); + + context.subscriptions.push(disposable); + return disposable; +} + +export async function activate(context: vscode.ExtensionContext, telemetryReporter: TelemetryReporter) { + const uriHandler = new UriEventHandler(); + context.subscriptions.push(uriHandler); + const betterSecretStorage = new BetterTokenStorage('microsoft.login.keylist', context); + + const loginService = new AzureActiveDirectoryService( + Logger, + context, + uriHandler, + betterSecretStorage, + telemetryReporter, + Environment.AzureCloud); + await loginService.initialize(); + + context.subscriptions.push(vscode.authentication.registerAuthenticationProvider('microsoft', 'Microsoft', { + onDidChangeSessions: loginService.onDidChangeSessions, + getSessions: (scopes: string[], options?: vscode.AuthenticationProviderSessionOptions) => loginService.getSessions(scopes, options?.account), + createSession: async (scopes: string[], options?: vscode.AuthenticationProviderSessionOptions) => { + try { + /* __GDPR__ + "login" : { + "owner": "TylerLeonhardt", + "comment": "Used to determine the usage of the Microsoft Auth Provider.", + "scopes": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight", "comment": "Used to determine what scope combinations are being requested." } + } + */ + telemetryReporter.sendTelemetryEvent('login', { + // Get rid of guids from telemetry. + scopes: JSON.stringify(scopes.map(s => s.replace(/[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}/i, '{guid}'))), + }); + + return await loginService.createSession(scopes, options?.account); + } catch (e) { + /* __GDPR__ + "loginFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users run into issues with the login flow." } + */ + telemetryReporter.sendTelemetryEvent('loginFailed'); + + throw e; + } + }, + removeSession: async (id: string) => { + try { + /* __GDPR__ + "logout" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often users log out." } + */ + telemetryReporter.sendTelemetryEvent('logout'); + + await loginService.removeSessionById(id); + } catch (e) { + /* __GDPR__ + "logoutFailed" : { "owner": "TylerLeonhardt", "comment": "Used to determine how often fail to log out." } + */ + telemetryReporter.sendTelemetryEvent('logoutFailed'); + } + } + }, { supportsMultipleAccounts: true })); + + let microsoftSovereignCloudAuthProviderDisposable = await initMicrosoftSovereignCloudAuthProvider(context, telemetryReporter, uriHandler, betterSecretStorage); + + context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(async e => { + if (e.affectsConfiguration('microsoft-sovereign-cloud')) { + microsoftSovereignCloudAuthProviderDisposable?.dispose(); + microsoftSovereignCloudAuthProviderDisposable = await initMicrosoftSovereignCloudAuthProvider(context, telemetryReporter, uriHandler, betterSecretStorage); + } + })); + + return; +} + +// this method is called when your extension is deactivated +export function deactivate() { } diff --git a/extensions/microsoft-authentication/src/extensionV2.ts b/extensions/microsoft-authentication/src/extensionV2.ts new file mode 100644 index 00000000000..9610af37977 --- /dev/null +++ b/extensions/microsoft-authentication/src/extensionV2.ts @@ -0,0 +1,97 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Environment, EnvironmentParameters } from '@azure/ms-rest-azure-env'; +import Logger from './logger'; +import { MsalAuthProvider } from './node/authProvider'; +import { UriEventHandler } from './UriEventHandler'; +import { authentication, commands, ExtensionContext, l10n, window, workspace, Disposable } from 'vscode'; +import { MicrosoftAuthenticationTelemetryReporter, MicrosoftSovereignCloudAuthenticationTelemetryReporter } from './common/telemetryReporter'; + +async function initMicrosoftSovereignCloudAuthProvider( + context: ExtensionContext, + uriHandler: UriEventHandler +): Promise { + const environment = workspace.getConfiguration('microsoft-sovereign-cloud').get('environment'); + let authProviderName: string | undefined; + if (!environment) { + return undefined; + } + + if (environment === 'custom') { + const customEnv = workspace.getConfiguration('microsoft-sovereign-cloud').get('customEnvironment'); + if (!customEnv) { + const res = await window.showErrorMessage(l10n.t('You must also specify a custom environment in order to use the custom environment auth provider.'), l10n.t('Open settings')); + if (res) { + await commands.executeCommand('workbench.action.openSettingsJson', 'microsoft-sovereign-cloud.customEnvironment'); + } + return undefined; + } + try { + Environment.add(customEnv); + } catch (e) { + const res = await window.showErrorMessage(l10n.t('Error validating custom environment setting: {0}', e.message), l10n.t('Open settings')); + if (res) { + await commands.executeCommand('workbench.action.openSettings', 'microsoft-sovereign-cloud.customEnvironment'); + } + return undefined; + } + authProviderName = customEnv.name; + } else { + authProviderName = environment; + } + + const env = Environment.get(authProviderName); + if (!env) { + await window.showErrorMessage(l10n.t('The environment `{0}` is not a valid environment.', authProviderName), l10n.t('Open settings')); + return undefined; + } + + const authProvider = new MsalAuthProvider( + context, + new MicrosoftSovereignCloudAuthenticationTelemetryReporter(context.extension.packageJSON.aiKey), + window.createOutputChannel(l10n.t('Microsoft Sovereign Cloud Authentication'), { log: true }), + uriHandler, + env + ); + await authProvider.initialize(); + const disposable = authentication.registerAuthenticationProvider( + 'microsoft-sovereign-cloud', + authProviderName, + authProvider, + { supportsMultipleAccounts: true } + ); + context.subscriptions.push(disposable); + return disposable; +} + +export async function activate(context: ExtensionContext, mainTelemetryReporter: MicrosoftAuthenticationTelemetryReporter) { + const uriHandler = new UriEventHandler(); + context.subscriptions.push(uriHandler); + const authProvider = new MsalAuthProvider( + context, + mainTelemetryReporter, + Logger, + uriHandler + ); + await authProvider.initialize(); + context.subscriptions.push(authentication.registerAuthenticationProvider( + 'microsoft', + 'Microsoft', + authProvider, + { supportsMultipleAccounts: true } + )); + + let microsoftSovereignCloudAuthProviderDisposable = await initMicrosoftSovereignCloudAuthProvider(context, uriHandler); + + context.subscriptions.push(workspace.onDidChangeConfiguration(async e => { + if (e.affectsConfiguration('microsoft-sovereign-cloud')) { + microsoftSovereignCloudAuthProviderDisposable?.dispose(); + microsoftSovereignCloudAuthProviderDisposable = await initMicrosoftSovereignCloudAuthProvider(context, uriHandler); + } + })); +} + +export function deactivate() { } diff --git a/extensions/microsoft-authentication/src/node/authProvider.ts b/extensions/microsoft-authentication/src/node/authProvider.ts new file mode 100644 index 00000000000..20c8bf305a2 --- /dev/null +++ b/extensions/microsoft-authentication/src/node/authProvider.ts @@ -0,0 +1,315 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { AccountInfo, AuthenticationResult, ServerError } from '@azure/msal-node'; +import { AuthenticationGetSessionOptions, AuthenticationProvider, AuthenticationProviderAuthenticationSessionsChangeEvent, AuthenticationSession, AuthenticationSessionAccountInformation, CancellationError, env, EventEmitter, ExtensionContext, l10n, LogOutputChannel, Memento, SecretStorage, Uri, window } from 'vscode'; +import { Environment } from '@azure/ms-rest-azure-env'; +import { CachedPublicClientApplicationManager } from './publicClientCache'; +import { UriHandlerLoopbackClient } from '../common/loopbackClientAndOpener'; +import { UriEventHandler } from '../UriEventHandler'; +import { ICachedPublicClientApplication } from '../common/publicClientCache'; +import { MicrosoftAccountType, MicrosoftAuthenticationTelemetryReporter } from '../common/telemetryReporter'; +import { loopbackTemplate } from './loopbackTemplate'; +import { ScopeData } from '../common/scopeData'; +import { EventBufferer } from '../common/event'; + +const redirectUri = 'https://vscode.dev/redirect'; +const MSA_TID = '9188040d-6c67-4c5b-b112-36a304b66dad'; +const MSA_PASSTHRU_TID = 'f8cdef31-a31e-4b4a-93e4-5f571e91255a'; + +export class MsalAuthProvider implements AuthenticationProvider { + + private readonly _disposables: { dispose(): void }[]; + private readonly _publicClientManager: CachedPublicClientApplicationManager; + private readonly _eventBufferer = new EventBufferer(); + + /** + * Event to signal a change in authentication sessions for this provider. + */ + private readonly _onDidChangeSessionsEmitter = new EventEmitter(); + + /** + * Event to signal a change in authentication sessions for this provider. + * + * NOTE: This event is handled differently in the Microsoft auth provider than "typical" auth providers. Normally, + * this event would fire when the provider's sessions change... which are tied to a specific list of scopes. However, + * since Microsoft identity doesn't care too much about scopes (you can mint a new token from an existing token), + * we just fire this event whenever the account list changes... so essentially there is one session per account. + * + * This is not quite how the API should be used... but this event really is just for signaling that the account list + * has changed. + */ + onDidChangeSessions = this._onDidChangeSessionsEmitter.event; + + constructor( + context: ExtensionContext, + private readonly _telemetryReporter: MicrosoftAuthenticationTelemetryReporter, + private readonly _logger: LogOutputChannel, + private readonly _uriHandler: UriEventHandler, + private readonly _env: Environment = Environment.AzureCloud + ) { + this._disposables = context.subscriptions; + this._publicClientManager = new CachedPublicClientApplicationManager( + context.globalState, + context.secrets, + this._logger, + this._env.name + ); + const accountChangeEvent = this._eventBufferer.wrapEvent( + this._publicClientManager.onDidAccountsChange, + (last, newEvent) => { + if (!last) { + return newEvent; + } + const mergedEvent = { + added: [...(last.added ?? []), ...(newEvent.added ?? [])], + deleted: [...(last.deleted ?? []), ...(newEvent.deleted ?? [])], + changed: [...(last.changed ?? []), ...(newEvent.changed ?? [])] + }; + + const dedupedEvent = { + added: Array.from(new Map(mergedEvent.added.map(item => [item.username, item])).values()), + deleted: Array.from(new Map(mergedEvent.deleted.map(item => [item.username, item])).values()), + changed: Array.from(new Map(mergedEvent.changed.map(item => [item.username, item])).values()) + }; + + return dedupedEvent; + }, + { added: new Array(), deleted: new Array(), changed: new Array() } + )(e => this._handleAccountChange(e)); + this._disposables.push( + this._onDidChangeSessionsEmitter, + this._publicClientManager, + accountChangeEvent + ); + } + + async initialize(): Promise { + await this._eventBufferer.bufferEventsAsync(() => this._publicClientManager.initialize()); + + // Send telemetry for existing accounts + for (const cachedPca of this._publicClientManager.getAll()) { + for (const account of cachedPca.accounts) { + if (!account.idTokenClaims?.tid) { + continue; + } + const tid = account.idTokenClaims.tid; + const type = tid === MSA_TID || tid === MSA_PASSTHRU_TID ? MicrosoftAccountType.MSA : MicrosoftAccountType.AAD; + this._telemetryReporter.sendAccountEvent([], type); + } + } + } + + /** + * See {@link onDidChangeSessions} for more information on how this is used. + * @param param0 Event that contains the added and removed accounts + */ + private _handleAccountChange({ added, changed, deleted }: { added: AccountInfo[]; changed: AccountInfo[]; deleted: AccountInfo[] }) { + this._logger.debug(`[_handleAccountChange] added: ${added.length}, changed: ${changed.length}, deleted: ${deleted.length}`); + this._onDidChangeSessionsEmitter.fire({ + added: added.map(this.sessionFromAccountInfo), + changed: changed.map(this.sessionFromAccountInfo), + removed: deleted.map(this.sessionFromAccountInfo) + }); + } + + //#region AuthenticationProvider methods + + async getSessions(scopes: string[] | undefined, options?: AuthenticationGetSessionOptions): Promise { + const askingForAll = scopes === undefined; + const scopeData = new ScopeData(scopes); + // Do NOT use `scopes` beyond this place in the code. Use `scopeData` instead. + this._logger.info('[getSessions]', askingForAll ? '[all]' : `[${scopeData.scopeStr}]`, 'starting'); + + // This branch only gets called by Core for sign out purposes and initial population of the account menu. Since we are + // living in a world where a "session" from Core's perspective is an account, we return 1 session per account. + // See the large comment on `onDidChangeSessions` for more information. + if (askingForAll) { + const allSessionsForAccounts = new Map(); + for (const cachedPca of this._publicClientManager.getAll()) { + for (const account of cachedPca.accounts) { + if (allSessionsForAccounts.has(account.homeAccountId)) { + continue; + } + allSessionsForAccounts.set(account.homeAccountId, this.sessionFromAccountInfo(account)); + } + } + const allSessions = Array.from(allSessionsForAccounts.values()); + this._logger.info('[getSessions] [all]', `returned ${allSessions.length} session(s)`); + return allSessions; + } + + const cachedPca = await this.getOrCreatePublicClientApplication(scopeData.clientId, scopeData.tenant); + const sessions = await this.getAllSessionsForPca(cachedPca, scopeData.originalScopes, scopeData.scopesToSend, options?.account); + this._logger.info(`[getSessions] [${scopeData.scopeStr}] returned ${sessions.length} session(s)`); + return sessions; + + } + + async createSession(scopes: readonly string[]): Promise { + const scopeData = new ScopeData(scopes); + // Do NOT use `scopes` beyond this place in the code. Use `scopeData` instead. + + this._logger.info('[createSession]', `[${scopeData.scopeStr}]`, 'starting'); + const cachedPca = await this.getOrCreatePublicClientApplication(scopeData.clientId, scopeData.tenant); + let result: AuthenticationResult | undefined; + + // Currently, the http://localhost redirect URI is only in the AzureCloud environment... even though I did make the change in the SovereignCloud environments... + // TODO: Remove this check when the change is in all environments. + let useLoopBack = this._env !== Environment.AzureCloud && scopeData.clientId === 'aebc6443-996d-45c2-90f0-388ff96faa56'; + if (!useLoopBack) { + try { + result = await cachedPca.acquireTokenInteractive({ + openBrowser: async (url: string) => { await env.openExternal(Uri.parse(url)); }, + scopes: scopeData.scopesToSend, + // The logic for rendering one or the other of these templates is in the + // template itself, so we pass the same one for both. + successTemplate: loopbackTemplate, + errorTemplate: loopbackTemplate + }); + } catch (e) { + if (e instanceof CancellationError) { + const yes = l10n.t('Yes'); + const result = await window.showErrorMessage( + l10n.t('Having trouble logging in?'), + { + modal: true, + detail: l10n.t('Would you like to try a different way to sign in to your Microsoft account? ({0})', 'protocol handler') + }, + yes + ); + if (!result) { + this._telemetryReporter.sendLoginFailedEvent(); + throw e; + } + } + // This error comes from the backend and is likely not due to the user's machine + // failing to open a port or something local that would require us to try the + // URL handler loopback client. + if (e instanceof ServerError) { + this._telemetryReporter.sendLoginFailedEvent(); + throw e; + } + + // The user wants to try the loopback client or we got an error likely due to spinning up the server + useLoopBack = true; + } + } + + if (useLoopBack) { + const loopbackClient = new UriHandlerLoopbackClient(this._uriHandler, redirectUri, this._logger); + try { + result = await cachedPca.acquireTokenInteractive({ + openBrowser: (url: string) => loopbackClient.openBrowser(url), + scopes: scopeData.scopesToSend, + loopbackClient + }); + } catch (e) { + this._telemetryReporter.sendLoginFailedEvent(); + throw e; + } + } + + if (!result) { + this._telemetryReporter.sendLoginFailedEvent(); + throw new Error('No result returned from MSAL'); + } + + const session = this.sessionFromAuthenticationResult(result, scopeData.originalScopes); + this._telemetryReporter.sendLoginEvent(session.scopes); + this._logger.info('[createSession]', `[${scopeData.scopeStr}]`, 'returned session'); + // This is the only scenario in which we need to fire the _onDidChangeSessionsEmitter out of band... + // the badge flow (when the client passes no options in to getSession) will only remove a badge if a session + // was created that _matches the scopes_ that that badge requests. See `onDidChangeSessions` for more info. + // TODO: This should really be fixed in Core. + this._onDidChangeSessionsEmitter.fire({ added: [session], changed: [], removed: [] }); + return session; + } + + async removeSession(sessionId: string): Promise { + this._logger.info('[removeSession]', sessionId, 'starting'); + const promises = new Array>(); + for (const cachedPca of this._publicClientManager.getAll()) { + const accounts = cachedPca.accounts; + for (const account of accounts) { + if (account.homeAccountId === sessionId) { + this._telemetryReporter.sendLogoutEvent(); + promises.push(cachedPca.removeAccount(account)); + this._logger.info(`[removeSession] [${sessionId}] [${cachedPca.clientId}] [${cachedPca.authority}] removing session...`); + } + } + } + if (!promises.length) { + this._logger.info('[removeSession]', sessionId, 'session not found'); + return; + } + const results = await Promise.allSettled(promises); + for (const result of results) { + if (result.status === 'rejected') { + this._telemetryReporter.sendLogoutFailedEvent(); + this._logger.error('[removeSession]', sessionId, 'error removing session', result.reason); + } + } + + this._logger.info('[removeSession]', sessionId, `attempted to remove ${promises.length} sessions`); + } + + //#endregion + + private async getOrCreatePublicClientApplication(clientId: string, tenant: string): Promise { + const authority = new URL(tenant, this._env.activeDirectoryEndpointUrl).toString(); + return await this._publicClientManager.getOrCreate(clientId, authority); + } + + private async getAllSessionsForPca( + cachedPca: ICachedPublicClientApplication, + originalScopes: readonly string[], + scopesToSend: string[], + accountFilter?: AuthenticationSessionAccountInformation + ): Promise { + const accounts = accountFilter + ? cachedPca.accounts.filter(a => a.homeAccountId === accountFilter.id) + : cachedPca.accounts; + const sessions: AuthenticationSession[] = []; + return this._eventBufferer.bufferEventsAsync(async () => { + for (const account of accounts) { + try { + const result = await cachedPca.acquireTokenSilent({ account, scopes: scopesToSend, redirectUri }); + sessions.push(this.sessionFromAuthenticationResult(result, originalScopes)); + } catch (e) { + // If we can't get a token silently, the account is probably in a bad state so we should skip it + // MSAL will log this already, so we don't need to log it again + continue; + } + } + return sessions; + }); + } + + private sessionFromAuthenticationResult(result: AuthenticationResult, scopes: readonly string[]): AuthenticationSession & { idToken: string } { + return { + accessToken: result.accessToken, + idToken: result.idToken, + id: result.account?.homeAccountId ?? result.uniqueId, + account: { + id: result.account?.homeAccountId ?? result.uniqueId, + label: result.account?.username ?? 'Unknown', + }, + scopes + }; + } + + private sessionFromAccountInfo(account: AccountInfo): AuthenticationSession { + return { + accessToken: '1234', + id: account.homeAccountId, + scopes: [], + account: { + id: account.homeAccountId, + label: account.username + }, + idToken: account.idToken, + }; + } +} diff --git a/extensions/microsoft-authentication/src/node/authServer.ts b/extensions/microsoft-authentication/src/node/authServer.ts index de08c6fca0f..2d6a8d03861 100644 --- a/extensions/microsoft-authentication/src/node/authServer.ts +++ b/extensions/microsoft-authentication/src/node/authServer.ts @@ -110,20 +110,29 @@ export class LoopbackAuthServer implements ILoopbackServer { const code = reqUrl.searchParams.get('code') ?? undefined; const state = reqUrl.searchParams.get('state') ?? undefined; const nonce = (reqUrl.searchParams.get('nonce') ?? '').replace(/ /g, '+'); + const error = reqUrl.searchParams.get('error') ?? undefined; + if (error) { + res.writeHead(302, { location: `/?error=${reqUrl.searchParams.get('error_description')}` }); + res.end(); + deferred.reject(new Error(error)); + break; + } if (!code || !state || !nonce) { res.writeHead(400); res.end(); - return; + break; } if (this.state !== state) { res.writeHead(302, { location: `/?error=${encodeURIComponent('State does not match.')}` }); res.end(); - throw new Error('State does not match.'); + deferred.reject(new Error('State does not match.')); + break; } if (this.nonce !== nonce) { res.writeHead(302, { location: `/?error=${encodeURIComponent('Nonce does not match.')}` }); res.end(); - throw new Error('Nonce does not match.'); + deferred.reject(new Error('Nonce does not match.')); + break; } deferred.resolve({ code, state }); res.writeHead(302, { location: '/' }); diff --git a/extensions/microsoft-authentication/src/node/cachedPublicClientApplication.ts b/extensions/microsoft-authentication/src/node/cachedPublicClientApplication.ts new file mode 100644 index 00000000000..8807fc3098e --- /dev/null +++ b/extensions/microsoft-authentication/src/node/cachedPublicClientApplication.ts @@ -0,0 +1,161 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { PublicClientApplication, AccountInfo, Configuration, SilentFlowRequest, AuthenticationResult, InteractiveRequest, LogLevel } from '@azure/msal-node'; +import { Disposable, Memento, SecretStorage, LogOutputChannel, window, ProgressLocation, l10n, EventEmitter } from 'vscode'; +import { raceCancellationAndTimeoutError } from '../common/async'; +import { SecretStorageCachePlugin } from '../common/cachePlugin'; +import { MsalLoggerOptions } from '../common/loggerOptions'; +import { ICachedPublicClientApplication } from '../common/publicClientCache'; + +export class CachedPublicClientApplication implements ICachedPublicClientApplication { + private _pca: PublicClientApplication; + private _sequencer = new Sequencer(); + + private _accounts: AccountInfo[] = []; + private readonly _disposable: Disposable; + + private readonly _loggerOptions = new MsalLoggerOptions(this._logger); + private readonly _secretStorageCachePlugin = new SecretStorageCachePlugin( + this._secretStorage, + // Include the prefix as a differentiator to other secrets + `pca:${JSON.stringify({ clientId: this._clientId, authority: this._authority })}` + ); + private readonly _config: Configuration = { + auth: { clientId: this._clientId, authority: this._authority }, + system: { + loggerOptions: { + correlationId: `${this._clientId}] [${this._authority}`, + loggerCallback: (level, message, containsPii) => this._loggerOptions.loggerCallback(level, message, containsPii), + logLevel: LogLevel.Trace + } + }, + cache: { + cachePlugin: this._secretStorageCachePlugin + } + }; + + /** + * We keep track of the last time an account was removed so we can recreate the PCA if we detect that an account was removed. + * This is due to MSAL-node not providing a way to detect when an account is removed from the cache. An internal issue has been + * filed to track this. If MSAL-node ever provides a way to detect this or handle this better in the Persistant Cache Plugin, + * we can remove this logic. + */ + private _lastCreated: Date; + + //#region Events + + private readonly _onDidAccountsChangeEmitter = new EventEmitter<{ added: AccountInfo[]; changed: AccountInfo[]; deleted: AccountInfo[] }>; + readonly onDidAccountsChange = this._onDidAccountsChangeEmitter.event; + + private readonly _onDidRemoveLastAccountEmitter = new EventEmitter(); + readonly onDidRemoveLastAccount = this._onDidRemoveLastAccountEmitter.event; + + //#endregion + + constructor( + private readonly _clientId: string, + private readonly _authority: string, + private readonly _globalMemento: Memento, + private readonly _secretStorage: SecretStorage, + private readonly _logger: LogOutputChannel + ) { + this._pca = new PublicClientApplication(this._config); + this._lastCreated = new Date(); + this._disposable = Disposable.from( + this._registerOnSecretStorageChanged(), + this._onDidAccountsChangeEmitter, + this._onDidRemoveLastAccountEmitter + ); + } + + get accounts(): AccountInfo[] { return this._accounts; } + get clientId(): string { return this._clientId; } + get authority(): string { return this._authority; } + + initialize(): Promise { + return this._update(); + } + + dispose(): void { + this._disposable.dispose(); + } + + async acquireTokenSilent(request: SilentFlowRequest): Promise { + this._logger.debug(`[acquireTokenSilent] [${this._clientId}] [${this._authority}] [${request.scopes.join(' ')}] [${request.account.username}] starting...`); + const result = await this._sequencer.queue(() => this._pca.acquireTokenSilent(request)); + this._logger.debug(`[acquireTokenSilent] [${this._clientId}] [${this._authority}] [${request.scopes.join(' ')}] [${request.account.username}] got result`); + if (result.account && !result.fromCache) { + this._logger.debug(`[acquireTokenSilent] [${this._clientId}] [${this._authority}] [${request.scopes.join(' ')}] [${request.account.username}] firing event due to change`); + this._onDidAccountsChangeEmitter.fire({ added: [], changed: [result.account], deleted: [] }); + } + return result; + } + + async acquireTokenInteractive(request: InteractiveRequest): Promise { + this._logger.debug(`[acquireTokenInteractive] [${this._clientId}] [${this._authority}] [${request.scopes?.join(' ')}] loopbackClientOverride: ${request.loopbackClient ? 'true' : 'false'}`); + return await window.withProgress( + { + location: ProgressLocation.Notification, + cancellable: true, + title: l10n.t('Signing in to Microsoft...') + }, + (_process, token) => raceCancellationAndTimeoutError( + this._pca.acquireTokenInteractive(request), + token, + 1000 * 60 * 5 + ) + ); + } + + removeAccount(account: AccountInfo): Promise { + this._globalMemento.update(`lastRemoval:${this._clientId}:${this._authority}`, new Date()); + return this._pca.getTokenCache().removeAccount(account); + } + + private _registerOnSecretStorageChanged() { + return this._secretStorageCachePlugin.onDidChange(() => this._update()); + } + + private async _update() { + const before = this._accounts; + this._logger.debug(`[update] [${this._clientId}] [${this._authority}] CachedPublicClientApplication update before: ${before.length}`); + // Dates are stored as strings in the memento + const lastRemovalDate = this._globalMemento.get(`lastRemoval:${this._clientId}:${this._authority}`); + if (lastRemovalDate && this._lastCreated && Date.parse(lastRemovalDate) > this._lastCreated.getTime()) { + this._logger.debug(`[update] [${this._clientId}] [${this._authority}] CachedPublicClientApplication removal detected... recreating PCA...`); + this._pca = new PublicClientApplication(this._config); + this._lastCreated = new Date(); + } + + const after = await this._pca.getAllAccounts(); + this._accounts = after; + this._logger.debug(`[update] [${this._clientId}] [${this._authority}] CachedPublicClientApplication update after: ${after.length}`); + + const beforeSet = new Set(before.map(b => b.homeAccountId)); + const afterSet = new Set(after.map(a => a.homeAccountId)); + + const added = after.filter(a => !beforeSet.has(a.homeAccountId)); + const deleted = before.filter(b => !afterSet.has(b.homeAccountId)); + if (added.length > 0 || deleted.length > 0) { + this._onDidAccountsChangeEmitter.fire({ added, changed: [], deleted }); + this._logger.debug(`[update] [${this._clientId}] [${this._authority}] CachedPublicClientApplication accounts changed. added: ${added.length}, deleted: ${deleted.length}`); + if (!after.length) { + this._logger.debug(`[update] [${this._clientId}] [${this._authority}] CachedPublicClientApplication final account deleted. Firing event.`); + this._onDidRemoveLastAccountEmitter.fire(); + } + } + this._logger.debug(`[update] [${this._clientId}] [${this._authority}] CachedPublicClientApplication update complete`); + } +} + +export class Sequencer { + + private current: Promise = Promise.resolve(null); + + queue(promiseTask: () => Promise): Promise { + return this.current = this.current.then(() => promiseTask(), () => promiseTask()); + } +} diff --git a/extensions/microsoft-authentication/src/node/fetch.ts b/extensions/microsoft-authentication/src/node/fetch.ts deleted file mode 100644 index 58718078e69..00000000000 --- a/extensions/microsoft-authentication/src/node/fetch.ts +++ /dev/null @@ -1,7 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -import fetch from 'node-fetch'; - -export const fetching = fetch; diff --git a/extensions/microsoft-authentication/src/node/loopbackTemplate.ts b/extensions/microsoft-authentication/src/node/loopbackTemplate.ts new file mode 100644 index 00000000000..60d3cd4d9cc --- /dev/null +++ b/extensions/microsoft-authentication/src/node/loopbackTemplate.ts @@ -0,0 +1,140 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +export const loopbackTemplate = ` + + + + + + Microsoft Account - Sign In + + + + + + + Visual Studio Code + +
+
+ You are signed in now and can close this page. +
+
+ An error occurred while signing in: +
+
+
+ + + + +`; diff --git a/extensions/microsoft-authentication/src/node/publicClientCache.ts b/extensions/microsoft-authentication/src/node/publicClientCache.ts new file mode 100644 index 00000000000..fc6ce38e975 --- /dev/null +++ b/extensions/microsoft-authentication/src/node/publicClientCache.ts @@ -0,0 +1,231 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { AccountInfo } from '@azure/msal-node'; +import { SecretStorage, LogOutputChannel, Disposable, EventEmitter, Memento, Event } from 'vscode'; +import { ICachedPublicClientApplication, ICachedPublicClientApplicationManager } from '../common/publicClientCache'; +import { CachedPublicClientApplication } from './cachedPublicClientApplication'; + +export interface IPublicClientApplicationInfo { + clientId: string; + authority: string; +} + +export class CachedPublicClientApplicationManager implements ICachedPublicClientApplicationManager { + // The key is the clientId and authority JSON stringified + private readonly _pcas = new Map(); + private readonly _pcaDisposables = new Map(); + + private _disposable: Disposable; + private _pcasSecretStorage: PublicClientApplicationsSecretStorage; + + private readonly _onDidAccountsChangeEmitter = new EventEmitter<{ added: AccountInfo[]; changed: AccountInfo[]; deleted: AccountInfo[] }>(); + readonly onDidAccountsChange = this._onDidAccountsChangeEmitter.event; + + constructor( + private readonly _globalMemento: Memento, + private readonly _secretStorage: SecretStorage, + private readonly _logger: LogOutputChannel, + cloudName: string + ) { + this._pcasSecretStorage = new PublicClientApplicationsSecretStorage(_secretStorage, cloudName); + this._disposable = Disposable.from( + this._pcasSecretStorage, + this._registerSecretStorageHandler(), + this._onDidAccountsChangeEmitter + ); + } + + private _registerSecretStorageHandler() { + return this._pcasSecretStorage.onDidChange(() => this._handleSecretStorageChange()); + } + + async initialize() { + this._logger.debug('[initialize] Initializing PublicClientApplicationManager'); + let keys: string[] | undefined; + try { + keys = await this._pcasSecretStorage.get(); + } catch (e) { + // data is corrupted + this._logger.error('[initialize] Error initializing PublicClientApplicationManager:', e); + await this._pcasSecretStorage.delete(); + } + if (!keys) { + return; + } + + const promises = new Array>(); + for (const key of keys) { + try { + const { clientId, authority } = JSON.parse(key) as IPublicClientApplicationInfo; + // Load the PCA in memory + promises.push(this._doCreatePublicClientApplication(clientId, authority, key)); + } catch (e) { + this._logger.error('[initialize] Error intitializing PCA:', key); + } + } + + const results = await Promise.allSettled(promises); + let pcasChanged = false; + for (const result of results) { + if (result.status === 'rejected') { + this._logger.error('[initialize] Error getting PCA:', result.reason); + } else { + if (!result.value.accounts.length) { + pcasChanged = true; + const pcaKey = JSON.stringify({ clientId: result.value.clientId, authority: result.value.authority }); + this._pcaDisposables.get(pcaKey)?.dispose(); + this._pcaDisposables.delete(pcaKey); + this._pcas.delete(pcaKey); + this._logger.debug(`[initialize] [${result.value.clientId}] [${result.value.authority}] PCA disposed because it's empty.`); + } + } + } + if (pcasChanged) { + await this._storePublicClientApplications(); + } + this._logger.debug('[initialize] PublicClientApplicationManager initialized'); + } + + dispose() { + this._disposable.dispose(); + Disposable.from(...this._pcaDisposables.values()).dispose(); + } + + async getOrCreate(clientId: string, authority: string): Promise { + // Use the clientId and authority as the key + const pcasKey = JSON.stringify({ clientId, authority }); + let pca = this._pcas.get(pcasKey); + if (pca) { + this._logger.debug(`[getOrCreate] [${clientId}] [${authority}] PublicClientApplicationManager cache hit`); + return pca; + } + + this._logger.debug(`[getOrCreate] [${clientId}] [${authority}] PublicClientApplicationManager cache miss, creating new PCA...`); + pca = await this._doCreatePublicClientApplication(clientId, authority, pcasKey); + await this._storePublicClientApplications(); + this._logger.debug(`[getOrCreate] [${clientId}] [${authority}] PCA created.`); + return pca; + } + + private async _doCreatePublicClientApplication(clientId: string, authority: string, pcasKey: string) { + const pca = new CachedPublicClientApplication(clientId, authority, this._globalMemento, this._secretStorage, this._logger); + this._pcas.set(pcasKey, pca); + const disposable = Disposable.from( + pca, + pca.onDidAccountsChange(e => this._onDidAccountsChangeEmitter.fire(e)), + pca.onDidRemoveLastAccount(() => { + // The PCA has no more accounts, so we can dispose it so we're not keeping it + // around forever. + disposable.dispose(); + this._pcaDisposables.delete(pcasKey); + this._pcas.delete(pcasKey); + this._logger.debug(`[_doCreatePublicClientApplication] [${clientId}] [${authority}] PCA disposed. Firing off storing of PCAs...`); + void this._storePublicClientApplications(); + }) + ); + this._pcaDisposables.set(pcasKey, disposable); + // Intialize the PCA after the `onDidAccountsChange` is set so we get initial state. + await pca.initialize(); + return pca; + } + + getAll(): ICachedPublicClientApplication[] { + return Array.from(this._pcas.values()); + } + + private async _handleSecretStorageChange() { + this._logger.debug(`[_handleSecretStorageChange] Handling PCAs secret storage change...`); + let result: string[] | undefined; + try { + result = await this._pcasSecretStorage.get(); + } catch (_e) { + // The data in secret storage has been corrupted somehow so + // we store what we have in this window + await this._storePublicClientApplications(); + return; + } + if (!result) { + this._logger.debug(`[_handleSecretStorageChange] PCAs deleted in secret storage. Disposing all...`); + Disposable.from(...this._pcaDisposables.values()).dispose(); + this._pcas.clear(); + this._pcaDisposables.clear(); + this._logger.debug(`[_handleSecretStorageChange] Finished PCAs secret storage change.`); + return; + } + + const pcaKeysFromStorage = new Set(result); + // Handle the deleted ones + for (const pcaKey of this._pcas.keys()) { + if (!pcaKeysFromStorage.delete(pcaKey)) { + // This PCA has been removed in another window + this._pcaDisposables.get(pcaKey)?.dispose(); + this._pcaDisposables.delete(pcaKey); + this._pcas.delete(pcaKey); + this._logger.debug(`[_handleSecretStorageChange] Disposed PCA that was deleted in another window: ${pcaKey}`); + } + } + + // Handle the new ones + for (const newPca of pcaKeysFromStorage) { + try { + const { clientId, authority } = JSON.parse(newPca); + this._logger.debug(`[_handleSecretStorageChange] [${clientId}] [${authority}] Creating new PCA that was created in another window...`); + await this._doCreatePublicClientApplication(clientId, authority, newPca); + this._logger.debug(`[_handleSecretStorageChange] [${clientId}] [${authority}] PCA created.`); + } catch (_e) { + // This really shouldn't happen, but should we do something about this? + this._logger.error(`Failed to parse new PublicClientApplication: ${newPca}`); + continue; + } + } + + this._logger.debug('[_handleSecretStorageChange] Finished handling PCAs secret storage change.'); + } + + private _storePublicClientApplications() { + return this._pcasSecretStorage.store(Array.from(this._pcas.keys())); + } +} + +class PublicClientApplicationsSecretStorage { + private _disposable: Disposable; + + private readonly _onDidChangeEmitter = new EventEmitter; + readonly onDidChange: Event = this._onDidChangeEmitter.event; + + private readonly _key = `publicClientApplications-${this._cloudName}`; + + constructor(private readonly _secretStorage: SecretStorage, private readonly _cloudName: string) { + this._disposable = Disposable.from( + this._onDidChangeEmitter, + this._secretStorage.onDidChange(e => { + if (e.key === this._key) { + this._onDidChangeEmitter.fire(); + } + }) + ); + } + + async get(): Promise { + const value = await this._secretStorage.get(this._key); + if (!value) { + return undefined; + } + return JSON.parse(value); + } + + store(value: string[]): Thenable { + return this._secretStorage.store(this._key, JSON.stringify(value)); + } + + delete(): Thenable { + return this._secretStorage.delete(this._key); + } + + dispose() { + this._disposable.dispose(); + } +} diff --git a/extensions/microsoft-authentication/tsconfig.json b/extensions/microsoft-authentication/tsconfig.json index cad76d078bd..4b9d06d1847 100644 --- a/extensions/microsoft-authentication/tsconfig.json +++ b/extensions/microsoft-authentication/tsconfig.json @@ -22,7 +22,6 @@ "include": [ "src/**/*", "../../src/vscode-dts/vscode.d.ts", - "../../src/vscode-dts/vscode.proposed.idToken.d.ts", - "../../src/vscode-dts/vscode.proposed.authGetSessions.d.ts" + "../../src/vscode-dts/vscode.proposed.idToken.d.ts" ] } diff --git a/extensions/microsoft-authentication/yarn.lock b/extensions/microsoft-authentication/yarn.lock deleted file mode 100644 index 6f277110a56..00000000000 --- a/extensions/microsoft-authentication/yarn.lock +++ /dev/null @@ -1,217 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@azure/ms-rest-azure-env@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@azure/ms-rest-azure-env/-/ms-rest-azure-env-2.0.0.tgz#45809f89763a480924e21d3c620cd40866771625" - integrity sha512-dG76W7ElfLi+fbTjnZVGj+M9e0BIEJmRxU6fHaUQ12bZBe8EJKYb2GV50YWNaP2uJiVQ5+7nXEVj1VN1UQtaEw== - -"@microsoft/1ds-core-js@4.0.3", "@microsoft/1ds-core-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz#c8a92c623745a9595e06558a866658480c33bdf9" - integrity sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/1ds-post-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz#cfcb20bb23fb6215d3f0732f60f5b7df3e624f86" - integrity sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ== - dependencies: - "@microsoft/1ds-core-js" "4.0.3" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-channel-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz#247b6fe2158fad9826cbcdf7304f885766b36624" - integrity sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A== - dependencies: - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-common@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz#c4aa53ba343f5b3c7fbf54cddd3c86a5bdcd95dc" - integrity sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-core-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz#008308b786930d94a1de8a1fbb4af0351b74653e" - integrity sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g== - dependencies: - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-shims@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f" - integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@microsoft/applicationinsights-web-basic@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz#9a23323276b4a5a0dc6a352e2de5d75e3c16b534" - integrity sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ== - dependencies: - "@microsoft/applicationinsights-channel-js" "3.0.4" - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/dynamicproto-js@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6" - integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@nevware21/ts-async@>= 0.3.0 < 2.x": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c" - integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA== - dependencies: - "@nevware21/ts-utils" ">= 0.10.0 < 2.x" - -"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.10.1 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7" - integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg== - -"@types/node-fetch@^2.5.7": - version "2.5.7" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" - integrity sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "14.0.23" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.23.tgz#676fa0883450ed9da0bb24156213636290892806" - integrity sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw== - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@types/randombytes@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/randombytes/-/randombytes-2.0.0.tgz#0087ff5e60ae68023b9bc4398b406fea7ad18304" - integrity sha512-bz8PhAVlwN72vqefzxa14DKNT8jK/mV66CSjwdVQM/k3Th3EPKfUtdMniwZgMedQTFuywAsfjnZsg+pEnltaMA== - dependencies: - "@types/node" "*" - -"@types/sha.js@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@types/sha.js/-/sha.js-2.4.0.tgz#bce682ef860b40f419d024fa08600c3b8d24bb01" - integrity sha512-amxKgPy6WJTKuw8mpUwjX2BSxuBtBmZfRwIUDIuPJKNwGN8CWDli8JTg5ONTWOtcTkHIstvT7oAhhYXqEjStHQ== - dependencies: - "@types/node" "*" - -"@types/uuid@8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.0.0.tgz#165aae4819ad2174a17476dbe66feebd549556c0" - integrity sha512-xSQfNcvOiE5f9dyd4Kzxbof1aTrLobL278pGLKOZI6esGfZ7ts9Ka16CzIN6Y8hFHE1C7jIBZokULhK1bOgjRw== - -"@vscode/extension-telemetry@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz#8c6c61e253ff304f46045f04edd60059b144417a" - integrity sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ== - dependencies: - "@microsoft/1ds-core-js" "^4.0.3" - "@microsoft/1ds-post-js" "^4.0.3" - "@microsoft/applicationinsights-web-basic" "^3.0.4" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -form-data@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" - integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== - -mime-types@^2.1.12: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== - dependencies: - mime-db "1.44.0" - -node-fetch@2.6.7: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" diff --git a/extensions/notebook-renderers/package-lock.json b/extensions/notebook-renderers/package-lock.json new file mode 100644 index 00000000000..8dbc5f5ad4c --- /dev/null +++ b/extensions/notebook-renderers/package-lock.json @@ -0,0 +1,700 @@ +{ + "name": "builtin-notebook-renderers", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "builtin-notebook-renderers", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@types/jsdom": "^21.1.0", + "@types/vscode-notebook-renderer": "^1.60.0", + "jsdom": "^21.1.1" + }, + "engines": { + "vscode": "^1.57.0" + } + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@types/jsdom": { + "version": "21.1.0", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.0.tgz", + "integrity": "sha512-leWreJOdnuIxq9Y70tBVm/bvTuh31DSlF/r4l7Cfi4uhVQqLHD0Q4v301GMisEMwwbMgF7ZKxuZ+Jbd4NcdmRw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, + "node_modules/@types/node": { + "version": "18.15.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.3.tgz", + "integrity": "sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==", + "dev": true + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", + "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", + "dev": true + }, + "node_modules/@types/vscode-notebook-renderer": { + "version": "1.60.0", + "resolved": "https://registry.npmjs.org/@types/vscode-notebook-renderer/-/vscode-notebook-renderer-1.60.0.tgz", + "integrity": "sha512-u7TD2uuEZTVuitx0iijOJdKI0JLiQP6PsSBSRy2XmHXUOXcp5p1S56NrjOEDoF+PIHd3NL3eO6KTRSf5nukDqQ==", + "dev": true + }, + "node_modules/abab": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "deprecated": "Use your platform's native atob() and btoa() methods instead", + "dev": true + }, + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", + "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "dev": true, + "dependencies": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cssstyle": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", + "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", + "dev": true, + "dependencies": { + "rrweb-cssom": "^0.6.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/data-urls": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", + "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", + "dev": true, + "dependencies": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "deprecated": "Use your platform's native DOMException instead", + "dev": true, + "dependencies": { + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/entities": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", + "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "node_modules/jsdom": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-21.1.1.tgz", + "integrity": "sha512-Jjgdmw48RKcdAIQyUD1UdBh2ecH7VqwaXPN3ehoZN6MqgVbMn+lRm1aAT1AsdJRAJpwfa4IpwgzySn61h2qu3w==", + "dev": true, + "dependencies": { + "abab": "^2.0.6", + "acorn": "^8.8.2", + "acorn-globals": "^7.0.0", + "cssstyle": "^3.0.0", + "data-urls": "^4.0.0", + "decimal.js": "^10.4.3", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.6.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.1", + "ws": "^8.13.0", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nwsapi": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.2.tgz", + "integrity": "sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw==", + "dev": true + }, + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, + "node_modules/rrweb-cssom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "dev": true + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "node_modules/tough-cookie": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "dev": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tr46": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "dev": true, + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/w3c-xmlserializer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "dev": true, + "dependencies": { + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", + "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", + "dev": true, + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/word-wrap": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + } + } +} diff --git a/extensions/notebook-renderers/src/textHelper.ts b/extensions/notebook-renderers/src/textHelper.ts index b49dbb6ad8d..9c080c7f9e4 100644 --- a/extensions/notebook-renderers/src/textHelper.ts +++ b/extensions/notebook-renderers/src/textHelper.ts @@ -71,6 +71,11 @@ function generateNestedViewAllElement(outputId: string) { function truncatedArrayOfString(id: string, buffer: string[], linesLimit: number, linkOptions: LinkOptions) { const container = document.createElement('div'); + container.setAttribute('data-vscode-context', JSON.stringify({ + webviewSection: 'text', + outputId: id, + 'preventDefaultContextMenuItems': true + })); const lineCount = buffer.length; if (lineCount <= linesLimit) { @@ -95,6 +100,11 @@ function truncatedArrayOfString(id: string, buffer: string[], linesLimit: number function scrollableArrayOfString(id: string, buffer: string[], linkOptions: LinkOptions) { const element = document.createElement('div'); + element.setAttribute('data-vscode-context', JSON.stringify({ + webviewSection: 'text', + outputId: id, + 'preventDefaultContextMenuItems': true + })); if (buffer.length > softScrollableLineLimit) { element.appendChild(generateNestedViewAllElement(id)); } diff --git a/extensions/notebook-renderers/yarn.lock b/extensions/notebook-renderers/yarn.lock deleted file mode 100644 index 3cbe531e0fd..00000000000 --- a/extensions/notebook-renderers/yarn.lock +++ /dev/null @@ -1,423 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@tootallnate/once@2": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" - integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== - -"@types/jsdom@^21.1.0": - version "21.1.0" - resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-21.1.0.tgz#219f15e3370da3f85d18fe02ae86bda7ff66104a" - integrity sha512-leWreJOdnuIxq9Y70tBVm/bvTuh31DSlF/r4l7Cfi4uhVQqLHD0Q4v301GMisEMwwbMgF7ZKxuZ+Jbd4NcdmRw== - dependencies: - "@types/node" "*" - "@types/tough-cookie" "*" - parse5 "^7.0.0" - -"@types/node@*": - version "18.15.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.3.tgz#f0b991c32cfc6a4e7f3399d6cb4b8cf9a0315014" - integrity sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw== - -"@types/tough-cookie@*": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.2.tgz#6286b4c7228d58ab7866d19716f3696e03a09397" - integrity sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw== - -"@types/vscode-notebook-renderer@^1.60.0": - version "1.60.0" - resolved "https://registry.yarnpkg.com/@types/vscode-notebook-renderer/-/vscode-notebook-renderer-1.60.0.tgz#8a67d561f48ddf46a95dfa9f712a79c72c7b8f7a" - integrity sha512-u7TD2uuEZTVuitx0iijOJdKI0JLiQP6PsSBSRy2XmHXUOXcp5p1S56NrjOEDoF+PIHd3NL3eO6KTRSf5nukDqQ== - -abab@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" - integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== - -acorn-globals@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-7.0.1.tgz#0dbf05c44fa7c94332914c02066d5beff62c40c3" - integrity sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q== - dependencies: - acorn "^8.1.0" - acorn-walk "^8.0.2" - -acorn-walk@^8.0.2: - version "8.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== - -acorn@^8.1.0, acorn@^8.8.2: - version "8.8.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" - integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -cssstyle@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-3.0.0.tgz#17ca9c87d26eac764bb8cfd00583cff21ce0277a" - integrity sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg== - dependencies: - rrweb-cssom "^0.6.0" - -data-urls@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-4.0.0.tgz#333a454eca6f9a5b7b0f1013ff89074c3f522dd4" - integrity sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g== - dependencies: - abab "^2.0.6" - whatwg-mimetype "^3.0.0" - whatwg-url "^12.0.0" - -debug@4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -decimal.js@^10.4.3: - version "10.4.3" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" - integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== - -deep-is@~0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -domexception@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-4.0.0.tgz#4ad1be56ccadc86fc76d033353999a8037d03673" - integrity sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw== - dependencies: - webidl-conversions "^7.0.0" - -entities@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-4.4.0.tgz#97bdaba170339446495e653cfd2db78962900174" - integrity sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA== - -escodegen@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" - integrity sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw== - dependencies: - esprima "^4.0.1" - estraverse "^5.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -esprima@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== - -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -html-encoding-sniffer@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz#2cb1a8cf0db52414776e5b2a7a04d5dd98158de9" - integrity sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA== - dependencies: - whatwg-encoding "^2.0.0" - -http-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" - integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== - dependencies: - "@tootallnate/once" "2" - agent-base "6" - debug "4" - -https-proxy-agent@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - -iconv-lite@0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - -is-potential-custom-element-name@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" - integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== - -jsdom@^21.1.1: - version "21.1.1" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-21.1.1.tgz#ab796361e3f6c01bcfaeda1fea3c06197ac9d8ae" - integrity sha512-Jjgdmw48RKcdAIQyUD1UdBh2ecH7VqwaXPN3ehoZN6MqgVbMn+lRm1aAT1AsdJRAJpwfa4IpwgzySn61h2qu3w== - dependencies: - abab "^2.0.6" - acorn "^8.8.2" - acorn-globals "^7.0.0" - cssstyle "^3.0.0" - data-urls "^4.0.0" - decimal.js "^10.4.3" - domexception "^4.0.0" - escodegen "^2.0.0" - form-data "^4.0.0" - html-encoding-sniffer "^3.0.0" - http-proxy-agent "^5.0.0" - https-proxy-agent "^5.0.1" - is-potential-custom-element-name "^1.0.1" - nwsapi "^2.2.2" - parse5 "^7.1.2" - rrweb-cssom "^0.6.0" - saxes "^6.0.0" - symbol-tree "^3.2.4" - tough-cookie "^4.1.2" - w3c-xmlserializer "^4.0.0" - webidl-conversions "^7.0.0" - whatwg-encoding "^2.0.0" - whatwg-mimetype "^3.0.0" - whatwg-url "^12.0.1" - ws "^8.13.0" - xml-name-validator "^4.0.0" - -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.12: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -nwsapi@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.2.tgz#e5418863e7905df67d51ec95938d67bf801f0bb0" - integrity sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw== - -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -parse5@^7.0.0, parse5@^7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" - integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== - dependencies: - entities "^4.4.0" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== - -psl@^1.1.33: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== - -punycode@^2.1.1, punycode@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== - -querystringify@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" - integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== - -rrweb-cssom@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1" - integrity sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw== - -"safer-buffer@>= 2.1.2 < 3.0.0": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -saxes@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" - integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== - dependencies: - xmlchars "^2.2.0" - -source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -symbol-tree@^3.2.4: - version "3.2.4" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" - integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== - -tough-cookie@^4.1.2: - version "4.1.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" - integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== - dependencies: - psl "^1.1.33" - punycode "^2.1.1" - universalify "^0.2.0" - url-parse "^1.5.3" - -tr46@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-4.1.1.tgz#281a758dcc82aeb4fe38c7dfe4d11a395aac8469" - integrity sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw== - dependencies: - punycode "^2.3.0" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== - dependencies: - prelude-ls "~1.1.2" - -universalify@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" - integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== - -url-parse@^1.5.3: - version "1.5.10" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" - integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - -w3c-xmlserializer@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073" - integrity sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw== - dependencies: - xml-name-validator "^4.0.0" - -webidl-conversions@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" - integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== - -whatwg-encoding@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz#e7635f597fd87020858626805a2729fa7698ac53" - integrity sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg== - dependencies: - iconv-lite "0.6.3" - -whatwg-mimetype@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7" - integrity sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q== - -whatwg-url@^12.0.0, whatwg-url@^12.0.1: - version "12.0.1" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-12.0.1.tgz#fd7bcc71192e7c3a2a97b9a8d6b094853ed8773c" - integrity sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ== - dependencies: - tr46 "^4.1.1" - webidl-conversions "^7.0.0" - -word-wrap@~1.2.3: - version "1.2.4" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f" - integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA== - -ws@^8.13.0: - version "8.13.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" - integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== - -xml-name-validator@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835" - integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw== - -xmlchars@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" - integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== diff --git a/extensions/npm/.vscodeignore b/extensions/npm/.vscodeignore index 7700b94ebb0..f05a79416be 100644 --- a/extensions/npm/.vscodeignore +++ b/extensions/npm/.vscodeignore @@ -4,4 +4,4 @@ tsconfig.json .vscode/** extension.webpack.config.js extension-browser.webpack.config.js -yarn.lock +package-lock.json diff --git a/extensions/npm/package-lock.json b/extensions/npm/package-lock.json new file mode 100644 index 00000000000..4ee7ee7a0e3 --- /dev/null +++ b/extensions/npm/package-lock.json @@ -0,0 +1,353 @@ +{ + "name": "npm", + "version": "1.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "npm", + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "find-up": "^5.0.0", + "find-yarn-workspace-root": "^2.0.0", + "jsonc-parser": "^3.2.0", + "minimatch": "^5.1.6", + "request-light": "^0.7.0", + "vscode-uri": "^3.0.8", + "which": "^4.0.0", + "which-pm": "^2.1.1" + }, + "devDependencies": { + "@types/minimatch": "^5.1.2", + "@types/node": "20.x", + "@types/which": "^3.0.0" + }, + "engines": { + "vscode": "0.10.x" + } + }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/which": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/which/-/which-3.0.0.tgz", + "integrity": "sha512-ASCxdbsrwNfSMXALlC3Decif9rwDMu+80KGp5zI2RLRotfMsTv7fHL8W8VDp24wymzDyIFudhUeSCugrgRFfHQ==", + "dev": true + }, + "node_modules/argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY= sha512-iK7YPKV+GsvihPUTKcM3hh2gq47zSFCpVDv/Ay2O9mzuD7dfvLV4vhms4XcjZvv4VRgXuGLMEts51IlTjS11/A==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c= sha512-9Y0g0Q8rmSt+H33DfKv7FOc3v+iRI+o1lbzt8jGcIosYW37IIW/2XVYq5NPdmaD5NQ59Nk26Kl/vZbwW9Fr8vg==" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "dependencies": { + "micromatch": "^4.0.2" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "engines": { + "node": ">=16" + } + }, + "node_modules/js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" + }, + "node_modules/load-yaml-file": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", + "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", + "dependencies": { + "graceful-fs": "^4.1.5", + "js-yaml": "^3.13.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "engines": { + "node": ">=6" + } + }, + "node_modules/request-light": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.7.0.tgz", + "integrity": "sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==" + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" + }, + "node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/which-pm": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.1.1.tgz", + "integrity": "sha512-xzzxNw2wMaoCWXiGE8IJ9wuPMU+EYhFksjHxrRT8kMT5SnocBPRg69YAMtyV4D12fP582RA+k3P8H9J5EMdIxQ==", + "dependencies": { + "load-yaml-file": "^0.2.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8.15" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/extensions/npm/src/features/packageJSONContribution.ts b/extensions/npm/src/features/packageJSONContribution.ts index a2f4fabcfe3..999f39664f1 100644 --- a/extensions/npm/src/features/packageJSONContribution.ts +++ b/extensions/npm/src/features/packageJSONContribution.ts @@ -293,7 +293,13 @@ export class PackageJSONContribution implements IJSONContribution { // COREPACK_ENABLE_PROJECT_SPEC makes the npm view command succeed // even if packageManager specified a package manager other than npm. const env = { ...process.env, COREPACK_ENABLE_AUTO_PIN: '0', COREPACK_ENABLE_PROJECT_SPEC: '0' }; - cp.execFile(npmCommandPath, args, { cwd, env }, (error, stdout) => { + let options: cp.ExecFileOptions = { cwd, env }; + let commandPath: string = npmCommandPath; + if (process.platform === 'win32') { + options = { cwd, env, shell: true }; + commandPath = `"${npmCommandPath}"`; + } + cp.execFile(commandPath, args, options, (error, stdout) => { if (!error) { try { const content = JSON.parse(stdout); diff --git a/extensions/npm/yarn.lock b/extensions/npm/yarn.lock deleted file mode 100644 index be4b192c67d..00000000000 --- a/extensions/npm/yarn.lock +++ /dev/null @@ -1,214 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/minimatch@^5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" - integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@types/which@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/which/-/which-3.0.0.tgz#849afdd9fdcb0b67339b9cfc80fa6ea4e0253fc5" - integrity sha512-ASCxdbsrwNfSMXALlC3Decif9rwDMu+80KGp5zI2RLRotfMsTv7fHL8W8VDp24wymzDyIFudhUeSCugrgRFfHQ== - -argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" - integrity sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY= - dependencies: - sprintf-js "~1.0.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -braces@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" - integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== - dependencies: - fill-range "^7.1.1" - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -fill-range@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" - integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== - dependencies: - to-regex-range "^5.0.1" - -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-yarn-workspace-root@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" - integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== - dependencies: - micromatch "^4.0.2" - -graceful-fs@^4.1.5: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -isexe@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-3.1.1.tgz#4a407e2bd78ddfb14bea0c27c6f7072dde775f0d" - integrity sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ== - -js-yaml@^3.13.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" - integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsonc-parser@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" - integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== - -load-yaml-file@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/load-yaml-file/-/load-yaml-file-0.2.0.tgz#af854edaf2bea89346c07549122753c07372f64d" - integrity sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw== - dependencies: - graceful-fs "^4.1.5" - js-yaml "^3.13.0" - pify "^4.0.1" - strip-bom "^3.0.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -micromatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" - integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== - dependencies: - braces "^3.0.1" - picomatch "^2.0.5" - -minimatch@^5.1.6: - version "5.1.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" - integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== - dependencies: - brace-expansion "^2.0.1" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -picomatch@^2.0.5: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== - -pify@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" - integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== - -request-light@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/request-light/-/request-light-0.7.0.tgz#885628bb2f8040c26401ebf258ec51c4ae98ac2a" - integrity sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -vscode-uri@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" - integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== - -which-pm@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/which-pm/-/which-pm-2.1.1.tgz#0be2b70c67e94a32e87b9768a94a7f0954f2dcfa" - integrity sha512-xzzxNw2wMaoCWXiGE8IJ9wuPMU+EYhFksjHxrRT8kMT5SnocBPRg69YAMtyV4D12fP582RA+k3P8H9J5EMdIxQ== - dependencies: - load-yaml-file "^0.2.0" - path-exists "^4.0.0" - -which@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/which/-/which-4.0.0.tgz#cd60b5e74503a3fbcfbf6cd6b4138a8bae644c1a" - integrity sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg== - dependencies: - isexe "^3.1.1" - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/extensions/objective-c/yarn.lock b/extensions/objective-c/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/objective-c/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/package-lock.json b/extensions/package-lock.json new file mode 100644 index 00000000000..32a0865af3d --- /dev/null +++ b/extensions/package-lock.json @@ -0,0 +1,630 @@ +{ + "name": "vscode-extensions", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vscode-extensions", + "version": "0.0.1", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "typescript": "5.6.2" + }, + "devDependencies": { + "@parcel/watcher": "2.1.0", + "esbuild": "0.23.0", + "vscode-grammar-updater": "^1.1.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz", + "integrity": "sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.0.tgz", + "integrity": "sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.0.tgz", + "integrity": "sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.0.tgz", + "integrity": "sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.0.tgz", + "integrity": "sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.0.tgz", + "integrity": "sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.0.tgz", + "integrity": "sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.0.tgz", + "integrity": "sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.0.tgz", + "integrity": "sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.0.tgz", + "integrity": "sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.0.tgz", + "integrity": "sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.0.tgz", + "integrity": "sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.0.tgz", + "integrity": "sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.0.tgz", + "integrity": "sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.0.tgz", + "integrity": "sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.0.tgz", + "integrity": "sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.0.tgz", + "integrity": "sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.0.tgz", + "integrity": "sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.0.tgz", + "integrity": "sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.0.tgz", + "integrity": "sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.0.tgz", + "integrity": "sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.0.tgz", + "integrity": "sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.0.tgz", + "integrity": "sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.0.tgz", + "integrity": "sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@parcel/watcher": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.1.0.tgz", + "integrity": "sha512-8s8yYjd19pDSsBpbkOHnT6Z2+UJSuLQx61pCFM0s5wSRvKCEMDjd/cHY3/GI1szHIWbpXpsJdg3V6ISGGx9xDw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^3.2.1", + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/coffeescript": { + "version": "1.12.7", + "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-1.12.7.tgz", + "integrity": "sha512-pLXHFxQMPklVoEekowk8b3erNynC+DVJzChxS/LCBBgR6/8AJkHivkm//zbowcfc7BTCAjryuhx6gPqPRfsFoA==", + "dev": true, + "bin": { + "cake": "bin/cake", + "coffee": "bin/coffee" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/cson-parser": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/cson-parser/-/cson-parser-4.0.9.tgz", + "integrity": "sha512-I79SAcCYquWnEfXYj8hBqOOWKj6eH6zX1hhX3yqmS4K3bYp7jME3UFpHPzu3rUew0oyfc0s8T6IlWGXRAheHag==", + "dev": true, + "dependencies": { + "coffeescript": "1.12.7" + }, + "engines": { + "node": ">=10.13" + } + }, + "node_modules/esbuild": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz", + "integrity": "sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.0", + "@esbuild/android-arm": "0.23.0", + "@esbuild/android-arm64": "0.23.0", + "@esbuild/android-x64": "0.23.0", + "@esbuild/darwin-arm64": "0.23.0", + "@esbuild/darwin-x64": "0.23.0", + "@esbuild/freebsd-arm64": "0.23.0", + "@esbuild/freebsd-x64": "0.23.0", + "@esbuild/linux-arm": "0.23.0", + "@esbuild/linux-arm64": "0.23.0", + "@esbuild/linux-ia32": "0.23.0", + "@esbuild/linux-loong64": "0.23.0", + "@esbuild/linux-mips64el": "0.23.0", + "@esbuild/linux-ppc64": "0.23.0", + "@esbuild/linux-riscv64": "0.23.0", + "@esbuild/linux-s390x": "0.23.0", + "@esbuild/linux-x64": "0.23.0", + "@esbuild/netbsd-x64": "0.23.0", + "@esbuild/openbsd-arm64": "0.23.0", + "@esbuild/openbsd-x64": "0.23.0", + "@esbuild/sunos-x64": "0.23.0", + "@esbuild/win32-arm64": "0.23.0", + "@esbuild/win32-ia32": "0.23.0", + "@esbuild/win32-x64": "0.23.0" + } + }, + "node_modules/fast-plist": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/fast-plist/-/fast-plist-0.1.2.tgz", + "integrity": "sha1-pFr/NFGWAG1AbKbNzQX2kFHvNbg= sha512-2HxzrqJhmMoxVzARjYFvkzkL2dCBB8sogU5sD8gqcZWv5UCivK9/cXM9KIPDRwU+eD3mbRDN/GhW8bO/4dtMfg==", + "dev": true + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "dev": true + }, + "node_modules/node-gyp-build": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", + "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", + "dev": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "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/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/typescript": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/vscode-grammar-updater": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vscode-grammar-updater/-/vscode-grammar-updater-1.1.0.tgz", + "integrity": "sha512-rWcJXyEFK27Mh9bxfBTLaul0KiGQk0GMXj2qTDH9cy3UZVx5MrF035B03os1w4oIXwl/QDhdLnsBK0j2SNiL1A==", + "dev": true, + "dependencies": { + "cson-parser": "^4.0.9", + "fast-plist": "0.1.2" + }, + "bin": { + "vscode-grammar-updater": "bin.js" + } + } + } +} diff --git a/extensions/package.json b/extensions/package.json index 940bbe9b8a2..5cd6099229c 100644 --- a/extensions/package.json +++ b/extensions/package.json @@ -4,14 +4,14 @@ "license": "MIT", "description": "Dependencies shared by all extensions", "dependencies": { - "typescript": "^5.5.2" + "typescript": "5.6.2" }, "scripts": { "postinstall": "node ./postinstall.mjs" }, "devDependencies": { "@parcel/watcher": "2.1.0", - "esbuild": "0.20.0", + "esbuild": "0.23.0", "vscode-grammar-updater": "^1.1.0" }, "resolutions": { diff --git a/extensions/perl/yarn.lock b/extensions/perl/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/perl/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/php-language-features/.vscodeignore b/extensions/php-language-features/.vscodeignore index e45d470b4dd..e326d20ef52 100644 --- a/extensions/php-language-features/.vscodeignore +++ b/extensions/php-language-features/.vscodeignore @@ -3,4 +3,4 @@ src/** out/** tsconfig.json extension.webpack.config.js -yarn.lock +package-lock.json diff --git a/extensions/php-language-features/package-lock.json b/extensions/php-language-features/package-lock.json new file mode 100644 index 00000000000..21fdb6b8e9f --- /dev/null +++ b/extensions/php-language-features/package-lock.json @@ -0,0 +1,63 @@ +{ + "name": "php-language-features", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "php-language-features", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "which": "^2.0.2" + }, + "devDependencies": { + "@types/node": "20.x", + "@types/which": "^2.0.0" + }, + "engines": { + "vscode": "0.10.x" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/which": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/which/-/which-2.0.0.tgz", + "integrity": "sha512-JHTNOEpZnACQdsTojWggn+SQ8IucfqEhtz7g8Z0G67WdSj4x3F0X5I2c/CVcl8z/QukGrIHeQ/N49v1au74XFQ==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + } + } +} diff --git a/extensions/php-language-features/yarn.lock b/extensions/php-language-features/yarn.lock deleted file mode 100644 index ea9947b69e3..00000000000 --- a/extensions/php-language-features/yarn.lock +++ /dev/null @@ -1,32 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@types/which@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/which/-/which-2.0.0.tgz#446d35586611dee657120de8e0457382a658fc25" - integrity sha512-JHTNOEpZnACQdsTojWggn+SQ8IucfqEhtz7g8Z0G67WdSj4x3F0X5I2c/CVcl8z/QukGrIHeQ/N49v1au74XFQ== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -which@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" diff --git a/extensions/php/yarn.lock b/extensions/php/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/php/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/powershell/yarn.lock b/extensions/powershell/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/powershell/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/pug/yarn.lock b/extensions/pug/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/pug/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/python/cgmanifest.json b/extensions/python/cgmanifest.json index 37a21b2de54..ace7056c995 100644 --- a/extensions/python/cgmanifest.json +++ b/extensions/python/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "MagicStack/MagicPython", "repositoryUrl": "https://github.com/MagicStack/MagicPython", - "commitHash": "c9b3409deb69acec31bbf7913830e93a046b30cc" + "commitHash": "7d0f2b22a5ad8fccbd7341bc7b7a715169283044" } }, "license": "MIT", diff --git a/extensions/python/yarn.lock b/extensions/python/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/python/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/r/yarn.lock b/extensions/r/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/r/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/razor/yarn.lock b/extensions/razor/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/razor/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/references-view/.vscodeignore b/extensions/references-view/.vscodeignore index f6a15ed8447..4d2ffa699e4 100644 --- a/extensions/references-view/.vscodeignore +++ b/extensions/references-view/.vscodeignore @@ -3,4 +3,4 @@ src/** out/** tsconfig.json *.webpack.config.js -yarn.lock +package-lock.json diff --git a/extensions/references-view/package-lock.json b/extensions/references-view/package-lock.json new file mode 100644 index 00000000000..bb5c5e10e1f --- /dev/null +++ b/extensions/references-view/package-lock.json @@ -0,0 +1,34 @@ +{ + "name": "references-view", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "references-view", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "^1.67.0" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/extensions/references-view/yarn.lock b/extensions/references-view/yarn.lock deleted file mode 100644 index 1f4b6c2e8b4..00000000000 --- a/extensions/references-view/yarn.lock +++ /dev/null @@ -1,15 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/extensions/restructuredtext/yarn.lock b/extensions/restructuredtext/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/restructuredtext/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/ruby/yarn.lock b/extensions/ruby/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/ruby/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/rust/cgmanifest.json b/extensions/rust/cgmanifest.json index 4149933544e..a0eb585e052 100644 --- a/extensions/rust/cgmanifest.json +++ b/extensions/rust/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "rust-syntax", "repositoryUrl": "https://github.com/dustypomerleau/rust-syntax", - "commitHash": "cf3c686a50295380ce9994218138691f8767870c" + "commitHash": "e90d3dbdb61b96e4afdce6f7a3572426b1a86d9d" } }, "license": "MIT", diff --git a/extensions/rust/syntaxes/rust.tmLanguage.json b/extensions/rust/syntaxes/rust.tmLanguage.json index dcf4c44f8fd..16307e72a6a 100644 --- a/extensions/rust/syntaxes/rust.tmLanguage.json +++ b/extensions/rust/syntaxes/rust.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/dustypomerleau/rust-syntax/commit/cf3c686a50295380ce9994218138691f8767870c", + "version": "https://github.com/dustypomerleau/rust-syntax/commit/e90d3dbdb61b96e4afdce6f7a3572426b1a86d9d", "name": "Rust", "scopeName": "source.rust", "patterns": [ @@ -482,10 +482,13 @@ "name": "punctuation.brackets.angle.rust" } }, - "end": "\\{|;", + "end": "(\\{)|(;)", "endCaptures": { - "0": { + "1": { "name": "punctuation.brackets.curly.rust" + }, + "2": { + "name": "punctuation.semi.rust" } }, "patterns": [ @@ -820,7 +823,7 @@ { "comment": "dashrocket, skinny arrow", "name": "keyword.operator.arrow.skinny.rust", - "match": "->" + "match": "->|<-" }, { "comment": "hashrocket, fat arrow", diff --git a/extensions/rust/yarn.lock b/extensions/rust/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/rust/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/scss/yarn.lock b/extensions/scss/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/scss/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/search-result/.vscodeignore b/extensions/search-result/.vscodeignore index aa993f50a1d..35b808e16f7 100644 --- a/extensions/search-result/.vscodeignore +++ b/extensions/search-result/.vscodeignore @@ -3,5 +3,5 @@ out/** tsconfig.json extension.webpack.config.js extension-browser.webpack.config.js -yarn.lock +package-lock.json syntaxes/generateTMLanguage.js diff --git a/extensions/search-result/package-lock.json b/extensions/search-result/package-lock.json new file mode 100644 index 00000000000..4fbe8b97ef8 --- /dev/null +++ b/extensions/search-result/package-lock.json @@ -0,0 +1,16 @@ +{ + "name": "search-result", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "search-result", + "version": "1.0.0", + "license": "MIT", + "engines": { + "vscode": "^1.39.0" + } + } + } +} diff --git a/extensions/search-result/yarn.lock b/extensions/search-result/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/search-result/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/shaderlab/yarn.lock b/extensions/shaderlab/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/shaderlab/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/shared.webpack.config.js b/extensions/shared.webpack.config.js index 81eb0ffd1ce..6e5b9fd95ac 100644 --- a/extensions/shared.webpack.config.js +++ b/extensions/shared.webpack.config.js @@ -12,7 +12,6 @@ const path = require('path'); const fs = require('fs'); const merge = require('merge-options'); const CopyWebpackPlugin = require('copy-webpack-plugin'); -const { NLSBundlePlugin } = require('vscode-nls-dev/lib/webpack-bundler'); const { DefinePlugin, optimize } = require('webpack'); const tsLoaderOptions = { @@ -40,13 +39,6 @@ function withNodeDefaults(/**@type WebpackConfig & { context: string }*/extConfi test: /\.ts$/, exclude: /node_modules/, use: [{ - // vscode-nls-dev loader: - // * rewrite nls-calls - loader: 'vscode-nls-dev/lib/webpack-loader', - options: { - base: path.join(extConfig.context, 'src') - } - }, { // configure TypeScript loader: // * enable sources maps for end-to-end source maps loader: 'ts-loader', @@ -97,8 +89,7 @@ function nodePlugins(context) { patterns: [ { from: 'src', to: '.', globOptions: { ignore: ['**/test/**', '**/*.ts'] }, noErrorOnMissing: true } ] - }), - new NLSBundlePlugin(id) + }) ]; } /** @@ -117,6 +108,7 @@ function withBrowserDefaults(/**@type WebpackConfig & { context: string }*/extCo extensions: ['.ts', '.js'], // support ts-files and js-files fallback: { 'path': require.resolve('path-browserify'), + 'os': require.resolve('os-browserify'), 'util': require.resolve('util') } }, @@ -195,9 +187,7 @@ function browserPlugins(context) { 'process.platform': JSON.stringify('web'), 'process.env': JSON.stringify({}), 'process.env.BROWSER_ENV': JSON.stringify('true') - }), - // TODO: bring this back once vscode-nls-dev supports browser - // new NLSBundlePlugin(id) + }) ]; } diff --git a/extensions/shellscript/cgmanifest.json b/extensions/shellscript/cgmanifest.json index 48f939ecc45..73c65b96f2c 100644 --- a/extensions/shellscript/cgmanifest.json +++ b/extensions/shellscript/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "jeff-hykin/better-shell-syntax", "repositoryUrl": "https://github.com/jeff-hykin/better-shell-syntax", - "commitHash": "6d0bc37a6b8023a5fddf75bd2b4eb1e1f962e4c2" + "commitHash": "35020b0bd79a90d3b262b4c13a8bb0b33adc1f45" } }, "license": "MIT", diff --git a/extensions/shellscript/package.json b/extensions/shellscript/package.json index 6f9e7072ab8..93333abd313 100644 --- a/extensions/shellscript/package.json +++ b/extensions/shellscript/package.json @@ -34,6 +34,7 @@ ".bash_profile", ".bash_login", ".ebuild", + ".eclass", ".profile", ".bash_logout", ".xprofile", diff --git a/extensions/shellscript/syntaxes/shell-unix-bash.tmLanguage.json b/extensions/shellscript/syntaxes/shell-unix-bash.tmLanguage.json index 7aae970d227..255638d7db7 100644 --- a/extensions/shellscript/syntaxes/shell-unix-bash.tmLanguage.json +++ b/extensions/shellscript/syntaxes/shell-unix-bash.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/jeff-hykin/better-shell-syntax/commit/6d0bc37a6b8023a5fddf75bd2b4eb1e1f962e4c2", + "version": "https://github.com/jeff-hykin/better-shell-syntax/commit/35020b0bd79a90d3b262b4c13a8bb0b33adc1f45", "name": "Shell Script", "scopeName": "source.shell", "patterns": [ @@ -1547,7 +1547,7 @@ "include": "#subshell_dollar" }, { - "begin": "(?= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz", + "integrity": "sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.0.3", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz", + "integrity": "sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz", + "integrity": "sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz", + "integrity": "sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz", + "integrity": "sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.0.4", + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", + "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.3.0.tgz", + "integrity": "sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz", + "integrity": "sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==" + }, + "node_modules/@types/vscode-webview": { + "version": "1.57.0", + "resolved": "https://registry.npmjs.org/@types/vscode-webview/-/vscode-webview-1.57.0.tgz", + "integrity": "sha512-x3Cb/SMa1IwRHfSvKaZDZOTh4cNoG505c3NjTqGlMC082m++x/ETUmtYniDsw6SSmYzZXO8KBNhYxR0+VqymqA==", + "dev": true + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz", + "integrity": "sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.0.3", + "@microsoft/1ds-post-js": "^4.0.3", + "@microsoft/applicationinsights-web-basic": "^3.0.4" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/vscode-codicons": { + "version": "0.0.14", + "resolved": "https://registry.npmjs.org/vscode-codicons/-/vscode-codicons-0.0.14.tgz", + "integrity": "sha512-6CEH5KT9ct5WMw7n5dlX7rB8ya4CUI2FSq1Wk36XaW+c5RglFtAanUV0T+gvZVVFhl/WxfjTvFHq06Hz9c1SLA==", + "deprecated": "This package is deprecated, please use @vscode/codicons https://www.npmjs.com/package/@vscode/codicons", + "dev": true + } + } +} diff --git a/extensions/simple-browser/yarn.lock b/extensions/simple-browser/yarn.lock deleted file mode 100644 index 54a1dc8fdab..00000000000 --- a/extensions/simple-browser/yarn.lock +++ /dev/null @@ -1,115 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@microsoft/1ds-core-js@4.0.3", "@microsoft/1ds-core-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz#c8a92c623745a9595e06558a866658480c33bdf9" - integrity sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/1ds-post-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz#cfcb20bb23fb6215d3f0732f60f5b7df3e624f86" - integrity sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ== - dependencies: - "@microsoft/1ds-core-js" "4.0.3" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-channel-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz#247b6fe2158fad9826cbcdf7304f885766b36624" - integrity sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A== - dependencies: - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-common@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz#c4aa53ba343f5b3c7fbf54cddd3c86a5bdcd95dc" - integrity sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-core-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz#008308b786930d94a1de8a1fbb4af0351b74653e" - integrity sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g== - dependencies: - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-shims@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f" - integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@microsoft/applicationinsights-web-basic@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz#9a23323276b4a5a0dc6a352e2de5d75e3c16b534" - integrity sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ== - dependencies: - "@microsoft/applicationinsights-channel-js" "3.0.4" - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/dynamicproto-js@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6" - integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@nevware21/ts-async@>= 0.3.0 < 2.x": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c" - integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA== - dependencies: - "@nevware21/ts-utils" ">= 0.10.0 < 2.x" - -"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.10.1 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7" - integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg== - -"@types/vscode-webview@^1.57.0": - version "1.57.0" - resolved "https://registry.yarnpkg.com/@types/vscode-webview/-/vscode-webview-1.57.0.tgz#bad5194d45ae8d03afc1c0f67f71ff5e7a243bbf" - integrity sha512-x3Cb/SMa1IwRHfSvKaZDZOTh4cNoG505c3NjTqGlMC082m++x/ETUmtYniDsw6SSmYzZXO8KBNhYxR0+VqymqA== - -"@vscode/extension-telemetry@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz#8c6c61e253ff304f46045f04edd60059b144417a" - integrity sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ== - dependencies: - "@microsoft/1ds-core-js" "^4.0.3" - "@microsoft/1ds-post-js" "^4.0.3" - "@microsoft/applicationinsights-web-basic" "^3.0.4" - -vscode-codicons@^0.0.14: - version "0.0.14" - resolved "https://registry.yarnpkg.com/vscode-codicons/-/vscode-codicons-0.0.14.tgz#e0d05418e2e195564ff6f6a2199d70415911c18f" - integrity sha512-6CEH5KT9ct5WMw7n5dlX7rB8ya4CUI2FSq1Wk36XaW+c5RglFtAanUV0T+gvZVVFhl/WxfjTvFHq06Hz9c1SLA== diff --git a/extensions/sql/package.json b/extensions/sql/package.json index c048da78d1c..5c467297f81 100644 --- a/extensions/sql/package.json +++ b/extensions/sql/package.json @@ -21,7 +21,8 @@ ".dsql" ], "aliases": [ - "SQL" + "MS SQL", + "T-SQL" ], "configuration": "./language-configuration.json" } diff --git a/extensions/sql/yarn.lock b/extensions/sql/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/sql/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/swift/cgmanifest.json b/extensions/swift/cgmanifest.json index 816621e4170..cb1ca02310f 100644 --- a/extensions/swift/cgmanifest.json +++ b/extensions/swift/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "jtbandes/swift-tmlanguage", "repositoryUrl": "https://github.com/jtbandes/swift-tmlanguage", - "commitHash": "ab893c684dd7eeb7c249139e29e931334316fda7" + "commitHash": "860eface4241cf9f2174d5fa690bd34389ac8d26" } }, "license": "MIT" diff --git a/extensions/swift/syntaxes/swift.tmLanguage.json b/extensions/swift/syntaxes/swift.tmLanguage.json index 6259b151369..b18b340f2c6 100644 --- a/extensions/swift/syntaxes/swift.tmLanguage.json +++ b/extensions/swift/syntaxes/swift.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/jtbandes/swift-tmlanguage/commit/ab893c684dd7eeb7c249139e29e931334316fda7", + "version": "https://github.com/jtbandes/swift-tmlanguage/commit/860eface4241cf9f2174d5fa690bd34389ac8d26", "name": "Swift", "scopeName": "source.swift", "comment": "See swift.tmbundle/grammar-test.swift for test cases.", @@ -52,7 +52,7 @@ }, "patterns": [ { - "match": "\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?", + "match": "\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|visionOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?", "captures": { "1": { "name": "keyword.other.platform.os.swift" @@ -580,7 +580,7 @@ } }, { - "match": "\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))", + "match": "\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|visionOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))", "captures": { "1": { "name": "keyword.other.condition.swift" @@ -2586,7 +2586,7 @@ }, "patterns": [ { - "match": "\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))", + "match": "\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS|visionOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))", "captures": { "1": { "name": "keyword.other.platform.os.swift" diff --git a/extensions/swift/yarn.lock b/extensions/swift/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/swift/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/theme-abyss/yarn.lock b/extensions/theme-abyss/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/theme-abyss/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/theme-defaults/themes/dark_vs.json b/extensions/theme-defaults/themes/dark_vs.json index 331a87bb778..b66165d69e1 100644 --- a/extensions/theme-defaults/themes/dark_vs.json +++ b/extensions/theme-defaults/themes/dark_vs.json @@ -17,6 +17,7 @@ "menu.foreground": "#CCCCCC", "menu.separatorBackground": "#454545", "menu.border": "#454545", + "menu.selectionBackground": "#0078d4", "statusBarItem.remoteForeground": "#FFF", "statusBarItem.remoteBackground": "#16825D", "ports.iconRunningProcessForeground": "#369432", diff --git a/extensions/theme-defaults/yarn.lock b/extensions/theme-defaults/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/theme-defaults/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/theme-kimbie-dark/yarn.lock b/extensions/theme-kimbie-dark/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/theme-kimbie-dark/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/theme-monokai-dimmed/yarn.lock b/extensions/theme-monokai-dimmed/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/theme-monokai-dimmed/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/theme-monokai/yarn.lock b/extensions/theme-monokai/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/theme-monokai/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/theme-quietlight/yarn.lock b/extensions/theme-quietlight/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/theme-quietlight/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/theme-red/yarn.lock b/extensions/theme-red/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/theme-red/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/theme-seti/cgmanifest.json b/extensions/theme-seti/cgmanifest.json index 7e0ad68e317..26ada7ea17a 100644 --- a/extensions/theme-seti/cgmanifest.json +++ b/extensions/theme-seti/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "seti-ui", "repositoryUrl": "https://github.com/jesseweed/seti-ui", - "commitHash": "8eec7f2e37cd8fd91a98c61d129468bb49735a94" + "commitHash": "88bcd4a8fca14aa33dd9d50781ad8af3b03c6b90" } }, "version": "0.1.0" diff --git a/extensions/theme-seti/icons/seti.woff b/extensions/theme-seti/icons/seti.woff index 5069a94ff94..d7a0f3639c7 100644 Binary files a/extensions/theme-seti/icons/seti.woff and b/extensions/theme-seti/icons/seti.woff differ diff --git a/extensions/theme-seti/icons/vs-seti-icon-theme.json b/extensions/theme-seti/icons/vs-seti-icon-theme.json index b40d561539e..0a51f2aef8c 100644 --- a/extensions/theme-seti/icons/vs-seti-icon-theme.json +++ b/extensions/theme-seti/icons/vs-seti-icon-theme.json @@ -1623,8 +1623,14 @@ "class": "_java_1", "classpath": "_java", "js.map": "_javascript", + "cjs.map": "_javascript", + "mjs.map": "_javascript", "spec.js": "_javascript_1", + "spec.cjs": "_javascript_1", + "spec.mjs": "_javascript_1", "test.js": "_javascript_1", + "test.cjs": "_javascript_1", + "test.mjs": "_javascript_1", "es": "_javascript", "es5": "_javascript", "es7": "_javascript", @@ -1717,6 +1723,7 @@ "ttf": "_font", "woff": "_font", "woff2": "_font", + "otf": "_font", "avif": "_image", "gif": "_image", "jpg": "_image", @@ -1784,6 +1791,8 @@ "fileNames": { "mix": "_hex", "karma.conf.js": "_karma", + "karma.conf.cjs": "_karma", + "karma.conf.mjs": "_karma", "karma.conf.coffee": "_karma", "readme.md": "_info", "readme.txt": "_info", @@ -1814,6 +1823,7 @@ "workspace.bazel": "_bazel", "bower.json": "_bower", "docker-healthcheck": "_docker_2", + "eslint.config.js": "_eslint", "firebase.json": "_firebase", "geckodriver": "_firefox", "gruntfile.js": "_grunt", @@ -1828,22 +1838,28 @@ "sass-lint.yml": "_sass", "stylelint.config.js": "_stylelint", "stylelint.config.cjs": "_stylelint", + "stylelint.config.mjs": "_stylelint", "yarn.clean": "_yarn", "yarn.lock": "_yarn", "webpack.config.js": "_webpack", "webpack.config.cjs": "_webpack", + "webpack.config.mjs": "_webpack", "webpack.config.ts": "_webpack", "webpack.config.build.js": "_webpack", "webpack.config.build.cjs": "_webpack", + "webpack.config.build.mjs": "_webpack", "webpack.config.build.ts": "_webpack", "webpack.common.js": "_webpack", "webpack.common.cjs": "_webpack", + "webpack.common.mjs": "_webpack", "webpack.common.ts": "_webpack", "webpack.dev.js": "_webpack", "webpack.dev.cjs": "_webpack", + "webpack.dev.mjs": "_webpack", "webpack.dev.ts": "_webpack", "webpack.prod.js": "_webpack", "webpack.prod.cjs": "_webpack", + "webpack.prod.mjs": "_webpack", "webpack.prod.ts": "_webpack", "license": "_license", "licence": "_license", @@ -2027,8 +2043,14 @@ "class": "_java_1_light", "classpath": "_java_light", "js.map": "_javascript_light", + "cjs.map": "_javascript_light", + "mjs.map": "_javascript_light", "spec.js": "_javascript_1_light", + "spec.cjs": "_javascript_1_light", + "spec.mjs": "_javascript_1_light", "test.js": "_javascript_1_light", + "test.cjs": "_javascript_1_light", + "test.mjs": "_javascript_1_light", "es": "_javascript_light", "es5": "_javascript_light", "es7": "_javascript_light", @@ -2121,6 +2143,7 @@ "ttf": "_font_light", "woff": "_font_light", "woff2": "_font_light", + "otf": "_font_light", "avif": "_image_light", "gif": "_image_light", "jpg": "_image_light", @@ -2267,6 +2290,8 @@ "fileNames": { "mix": "_hex_light", "karma.conf.js": "_karma_light", + "karma.conf.cjs": "_karma_light", + "karma.conf.mjs": "_karma_light", "karma.conf.coffee": "_karma_light", "readme.md": "_info_light", "readme.txt": "_info_light", @@ -2297,6 +2322,7 @@ "workspace.bazel": "_bazel_light", "bower.json": "_bower_light", "docker-healthcheck": "_docker_2_light", + "eslint.config.js": "_eslint_light", "firebase.json": "_firebase_light", "geckodriver": "_firefox_light", "gruntfile.js": "_grunt_light", @@ -2311,22 +2337,28 @@ "sass-lint.yml": "_sass_light", "stylelint.config.js": "_stylelint_light", "stylelint.config.cjs": "_stylelint_light", + "stylelint.config.mjs": "_stylelint_light", "yarn.clean": "_yarn_light", "yarn.lock": "_yarn_light", "webpack.config.js": "_webpack_light", "webpack.config.cjs": "_webpack_light", + "webpack.config.mjs": "_webpack_light", "webpack.config.ts": "_webpack_light", "webpack.config.build.js": "_webpack_light", "webpack.config.build.cjs": "_webpack_light", + "webpack.config.build.mjs": "_webpack_light", "webpack.config.build.ts": "_webpack_light", "webpack.common.js": "_webpack_light", "webpack.common.cjs": "_webpack_light", + "webpack.common.mjs": "_webpack_light", "webpack.common.ts": "_webpack_light", "webpack.dev.js": "_webpack_light", "webpack.dev.cjs": "_webpack_light", + "webpack.dev.mjs": "_webpack_light", "webpack.dev.ts": "_webpack_light", "webpack.prod.js": "_webpack_light", "webpack.prod.cjs": "_webpack_light", + "webpack.prod.mjs": "_webpack_light", "webpack.prod.ts": "_webpack_light", "license": "_license_light", "licence": "_license_light", @@ -2350,5 +2382,5 @@ "npm-debug.log": "_npm_ignored_light" } }, - "version": "https://github.com/jesseweed/seti-ui/commit/8eec7f2e37cd8fd91a98c61d129468bb49735a94" + "version": "https://github.com/jesseweed/seti-ui/commit/88bcd4a8fca14aa33dd9d50781ad8af3b03c6b90" } \ No newline at end of file diff --git a/extensions/theme-seti/yarn.lock b/extensions/theme-seti/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/theme-seti/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/theme-solarized-dark/yarn.lock b/extensions/theme-solarized-dark/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/theme-solarized-dark/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/theme-solarized-light/yarn.lock b/extensions/theme-solarized-light/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/theme-solarized-light/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/theme-tomorrow-night-blue/yarn.lock b/extensions/theme-tomorrow-night-blue/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/theme-tomorrow-night-blue/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/tunnel-forwarding/.vscodeignore b/extensions/tunnel-forwarding/.vscodeignore index 36e8b0714fa..360fcfd1c99 100644 --- a/extensions/tunnel-forwarding/.vscodeignore +++ b/extensions/tunnel-forwarding/.vscodeignore @@ -2,4 +2,4 @@ src/** tsconfig.json out/** extension.webpack.config.js -yarn.lock \ No newline at end of file +package-lock.json diff --git a/extensions/tunnel-forwarding/package-lock.json b/extensions/tunnel-forwarding/package-lock.json new file mode 100644 index 00000000000..57accdc3b8d --- /dev/null +++ b/extensions/tunnel-forwarding/package-lock.json @@ -0,0 +1,34 @@ +{ + "name": "tunnel-forwarding", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "tunnel-forwarding", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "^1.82.0" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/extensions/tunnel-forwarding/yarn.lock b/extensions/tunnel-forwarding/yarn.lock deleted file mode 100644 index 1f4b6c2e8b4..00000000000 --- a/extensions/tunnel-forwarding/yarn.lock +++ /dev/null @@ -1,15 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/extensions/typescript-basics/snippets/typescript.code-snippets b/extensions/typescript-basics/snippets/typescript.code-snippets index 35b2aa1711c..9ed695795eb 100644 --- a/extensions/typescript-basics/snippets/typescript.code-snippets +++ b/extensions/typescript-basics/snippets/typescript.code-snippets @@ -163,7 +163,7 @@ "For-Of Loop": { "prefix": "forof", "body": [ - "for (const ${1:iterator} of ${2:object}) {", + "for (const ${1:element} of ${2:object}) {", "\t$TM_SELECTED_TEXT$0", "}" ], @@ -172,7 +172,7 @@ "For-Await-Of Loop": { "prefix": "forawaitof", "body": [ - "for await (const ${1:iterator} of ${2:object}) {", + "for await (const ${1:element} of ${2:object}) {", "\t$TM_SELECTED_TEXT$0", "}" ], @@ -266,6 +266,15 @@ ], "description": "Set Timeout Function" }, + "Set Interval Function": { + "prefix": "setinterval", + "body": [ + "setInterval(() => {", + "\t$TM_SELECTED_TEXT$0", + "}, ${1:interval});" + ], + "description": "Set Interval Function" + }, "Region Start": { "prefix": "#region", "body": [ diff --git a/extensions/typescript-basics/yarn.lock b/extensions/typescript-basics/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/typescript-basics/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/typescript-language-features/.vscodeignore b/extensions/typescript-language-features/.vscodeignore index 76d64ae8237..5c4f06d4cd3 100644 --- a/extensions/typescript-language-features/.vscodeignore +++ b/extensions/typescript-language-features/.vscodeignore @@ -8,4 +8,4 @@ tsconfig.json extension.webpack.config.js extension-browser.webpack.config.js cgmanifest.json -yarn.lock +package-lock.json diff --git a/extensions/typescript-language-features/package-lock.json b/extensions/typescript-language-features/package-lock.json new file mode 100644 index 00000000000..6a19dce700f --- /dev/null +++ b/extensions/typescript-language-features/package-lock.json @@ -0,0 +1,276 @@ +{ + "name": "typescript-language-features", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "typescript-language-features", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@vscode/extension-telemetry": "^0.9.0", + "@vscode/sync-api-client": "^0.7.2", + "@vscode/sync-api-common": "^0.7.2", + "@vscode/sync-api-service": "^0.7.3", + "@vscode/ts-package-manager": "^0.0.2", + "jsonc-parser": "^3.2.0", + "semver": "7.5.2", + "vscode-tas-client": "^0.1.84", + "vscode-uri": "^3.0.3" + }, + "devDependencies": { + "@types/node": "20.x", + "@types/semver": "^5.5.0" + }, + "engines": { + "vscode": "^1.30.0" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz", + "integrity": "sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz", + "integrity": "sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.0.3", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz", + "integrity": "sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz", + "integrity": "sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz", + "integrity": "sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz", + "integrity": "sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.0.4", + "@microsoft/applicationinsights-common": "3.0.4", + "@microsoft/applicationinsights-core-js": "3.0.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.2", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.10.1 < 2.x" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", + "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.3.0.tgz", + "integrity": "sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz", + "integrity": "sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==" + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ==", + "dev": true + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz", + "integrity": "sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.0.3", + "@microsoft/1ds-post-js": "^4.0.3", + "@microsoft/applicationinsights-web-basic": "^3.0.4" + }, + "engines": { + "vscode": "^1.75.0" + } + }, + "node_modules/@vscode/sync-api-client": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@vscode/sync-api-client/-/sync-api-client-0.7.2.tgz", + "integrity": "sha512-HQHz57RVKmR8sTEen1Y/T3r6mzDX7IaUJz/O2RJkn0Qu9ThvCsakLP0N+1iiwPnPfUfmNSwQXbSw8bEQFPcpYQ==", + "dependencies": { + "@vscode/sync-api-common": "0.7.2", + "vscode-uri": "3.0.3" + }, + "engines": { + "node": ">=16.15.1" + } + }, + "node_modules/@vscode/sync-api-common": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@vscode/sync-api-common/-/sync-api-common-0.7.2.tgz", + "integrity": "sha512-ne1XEeDIYA3mp4oo1QoF1fqFedd0Vf4ybMmLb9HixbTyXy/qwMNL2p6OjXjOsmx6w2q9eqzGA5W/OPRSJxTTIQ==", + "engines": { + "node": ">=16.15.1" + } + }, + "node_modules/@vscode/sync-api-service": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@vscode/sync-api-service/-/sync-api-service-0.7.3.tgz", + "integrity": "sha512-m2AmmfG4uzfjLMgWRHQ3xnBkdwCiUTO68vdw1XuzMsOb39Jwm9xr5bVVxwOFR9lPC0FfO1H6FUxBhZQvg7itPA==", + "dependencies": { + "@vscode/sync-api-common": "0.7.2", + "vscode-uri": "3.0.3" + }, + "engines": { + "node": ">=16.15.1", + "vscode": "^1.67.0" + } + }, + "node_modules/@vscode/ts-package-manager": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@vscode/ts-package-manager/-/ts-package-manager-0.0.2.tgz", + "integrity": "sha512-cXPxGbPVTkEQI8mUiWYUwB6j3ga6M9i7yubUOCrjgZ01GeZPMSnaWRprfJ09uuy81wJjY2gfHgLsOgwrGvUBTw==", + "engines": { + "node": "*" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz", + "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tas-client": { + "version": "0.2.33", + "resolved": "https://registry.npmjs.org/tas-client/-/tas-client-0.2.33.tgz", + "integrity": "sha512-V+uqV66BOQnWxvI6HjDnE4VkInmYZUQ4dgB7gzaDyFyFSK1i1nF/j7DpS9UbQAgV9NaF1XpcyuavnM1qOeiEIg==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/vscode-tas-client": { + "version": "0.1.84", + "resolved": "https://registry.npmjs.org/vscode-tas-client/-/vscode-tas-client-0.1.84.tgz", + "integrity": "sha512-rUTrUopV+70hvx1hW5ebdw1nd6djxubkLvVxjGdyD/r5v/wcVF41LIfiAtbm5qLZDtQdsMH1IaCuDoluoIa88w==", + "dependencies": { + "tas-client": "0.2.33" + }, + "engines": { + "vscode": "^1.85.0" + } + }, + "node_modules/vscode-uri": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.3.tgz", + "integrity": "sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA==" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index 3f7fdcf252f..92a36e5f2d7 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -9,7 +9,6 @@ "aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255", "enabledApiProposals": [ "workspaceTrust", - "createFileSystemWatcher", "multiDocumentHighlightProvider", "mappedEditsProvider", "codeActionAI", @@ -678,7 +677,7 @@ }, "js/ts.implicitProjectConfig.target": { "type": "string", - "default": "ES2020", + "default": "ES2022", "markdownDescription": "%configuration.implicitProjectConfig.target%", "enum": [ "ES3", @@ -692,6 +691,8 @@ "ES2020", "ES2021", "ES2022", + "ES2023", + "ES2024", "ESNext" ], "scope": "window" @@ -1030,6 +1031,22 @@ "markdownDescription": "%typescript.preferences.autoImportFileExcludePatterns%", "scope": "resource" }, + "typescript.preferences.autoImportSpecifierExcludeRegexes": { + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "%typescript.preferences.autoImportSpecifierExcludeRegexes%", + "scope": "resource" + }, + "javascript.preferences.autoImportSpecifierExcludeRegexes": { + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "%typescript.preferences.autoImportSpecifierExcludeRegexes%", + "scope": "resource" + }, "typescript.preferences.preferTypeOnlyAutoImports": { "type": "boolean", "default": false, @@ -1074,6 +1091,146 @@ "description": "%typescript.preferences.renameMatchingJsxTags%", "scope": "language-overridable" }, + "typescript.preferences.organizeImports": { + "type": "object", + "markdownDescription": "%typescript.preferences.organizeImports%", + "properties": { + "caseSensitivity": { + "type": "string", + "enum": [ + "auto", + "caseInsensitive", + "caseSensitive" + ], + "markdownEnumDescriptions": [ + "%typescript.preferences.organizeImports.caseSensitivity.auto%", + "%typescript.preferences.organizeImports.caseSensitivity.insensitive", + "%typescript.preferences.organizeImports.caseSensitivity.sensitive%" + ], + "default": "auto" + }, + "typeOrder": { + "type": "string", + "enum": [ + "auto", + "last", + "inline", + "first" + ], + "default": "auto", + "markdownEnumDescriptions": [ + "%typescript.preferences.organizeImports.typeOrder.auto%", + "%typescript.preferences.organizeImports.typeOrder.last%", + "%typescript.preferences.organizeImports.typeOrder.inline%", + "%typescript.preferences.organizeImports.typeOrder.first%" + ] + }, + "unicodeCollation": { + "type": "string", + "enum": [ + "ordinal", + "unicode" + ], + "markdownEnumDescriptions": [ + "%typescript.preferences.organizeImports.unicodeCollation.ordinal%", + "%typescript.preferences.organizeImports.unicodeCollation.unicode%" + ], + "default": "ordinal" + }, + "locale": { + "type": "string", + "markdownDescription": "%typescript.preferences.organizeImports.locale%" + }, + "numericCollation": { + "type": "boolean", + "markdownDescription": "%typescript.preferences.organizeImports.numericCollation%" + }, + "accentCollation":{ + "type": "boolean", + "markdownDescription": "%typescript.preferences.organizeImports.accentCollation%" + }, + "caseFirst": { + "type": "string", + "markdownDescription": "%typescript.preferences.organizeImports.caseFirst%", + "enum": [ + "default", + "upper", + "lower" + ], + "default": "default" + } + } + }, + "javascript.preferences.organizeImports": { + "type": "object", + "markdownDescription": "%typescript.preferences.organizeImports%", + "properties": { + "caseSensitivity": { + "type": "string", + "enum": [ + "auto", + "caseInsensitive", + "caseSensitive" + ], + "markdownEnumDescriptions": [ + "%typescript.preferences.organizeImports.caseSensitivity.auto%", + "%typescript.preferences.organizeImports.caseSensitivity.insensitive", + "%typescript.preferences.organizeImports.caseSensitivity.sensitive%" + ], + "default": "auto" + }, + "typeOrder": { + "type": "string", + "enum": [ + "auto", + "last", + "inline", + "first" + ], + "default": "auto", + "markdownEnumDescriptions": [ + "%typescript.preferences.organizeImports.typeOrder.auto%", + "%typescript.preferences.organizeImports.typeOrder.last%", + "%typescript.preferences.organizeImports.typeOrder.inline%", + "%typescript.preferences.organizeImports.typeOrder.first%" + ] + }, + "unicodeCollation": { + "type": "string", + "enum": [ + "ordinal", + "unicode" + ], + "markdownEnumDescriptions": [ + "%typescript.preferences.organizeImports.unicodeCollation.ordinal%", + "%typescript.preferences.organizeImports.unicodeCollation.unicode%" + ], + "default": "ordinal" + }, + "locale": { + "type": "string", + "markdownDescription": "%typescript.preferences.organizeImports.locale%" + }, + "numericCollation": { + "type": "boolean", + "markdownDescription": "%typescript.preferences.organizeImports.numericCollation%" + }, + "accentCollation":{ + "type": "boolean", + "markdownDescription": "%typescript.preferences.organizeImports.accentCollation%" + }, + "caseFirst": { + "type": "string", + "markdownDescription": "%typescript.preferences.organizeImports.caseFirst%", + "enum": [ + "default", + "upper", + "lower" + ], + "default": "default" + } + } + }, "typescript.updateImportsOnFileMove.enabled": { "type": "string", "enum": [ @@ -1282,13 +1439,13 @@ }, "typescript.tsserver.web.projectWideIntellisense.suppressSemanticErrors": { "type": "boolean", - "default": true, + "default": false, "description": "%configuration.tsserver.web.projectWideIntellisense.suppressSemanticErrors%", "scope": "window" }, "typescript.tsserver.web.typeAcquisition.enabled": { "type": "boolean", - "default": false, + "default": true, "description": "%configuration.tsserver.web.typeAcquisition.enabled%", "scope": "window" }, @@ -1478,23 +1635,8 @@ "editor/context": [ { "command": "typescript.goToSourceDefinition", - "when": "tsSupportsSourceDefinition && resourceLangId == typescript", - "group": "navigation@9" - }, - { - "command": "typescript.goToSourceDefinition", - "when": "tsSupportsSourceDefinition && resourceLangId == typescriptreact", - "group": "navigation@9" - }, - { - "command": "typescript.goToSourceDefinition", - "when": "tsSupportsSourceDefinition && resourceLangId == javascript", - "group": "navigation@9" - }, - { - "command": "typescript.goToSourceDefinition", - "when": "tsSupportsSourceDefinition && resourceLangId == javascriptreact", - "group": "navigation@9" + "when": "tsSupportsSourceDefinition && (resourceLangId == typescript || resourceLangId == typescriptreact || resourceLangId == javascript || resourceLangId == javascriptreact)", + "group": "navigation@1.41" } ], "explorer/context": [ diff --git a/extensions/typescript-language-features/package.nls.json b/extensions/typescript-language-features/package.nls.json index cba24007314..d2a0ca892fa 100644 --- a/extensions/typescript-language-features/package.nls.json +++ b/extensions/typescript-language-features/package.nls.json @@ -155,6 +155,7 @@ "typescript.preferences.includePackageJsonAutoImports.on": "Always search dependencies.", "typescript.preferences.includePackageJsonAutoImports.off": "Never search dependencies.", "typescript.preferences.autoImportFileExcludePatterns": "Specify glob patterns of files to exclude from auto imports. Relative paths are resolved relative to the workspace root. Patterns are evaluated using tsconfig.json [`exclude`](https://www.typescriptlang.org/tsconfig#exclude) semantics.", + "typescript.preferences.autoImportSpecifierExcludeRegexes": "Specify regular expressions to exclude auto imports with matching import specifiers. Examples:\n\n- `^node:`\n- `lib/internal` (slashes don't need to be escaped...)\n- `/lib\\/internal/i` (...unless including surrounding slashes for `i` or `u` flags)\n- `^lodash$` (only allow subpath imports from lodash)", "typescript.preferences.preferTypeOnlyAutoImports": "Include the `type` keyword in auto-imports whenever possible. Requires using TypeScript 5.3+ in the workspace.", "typescript.workspaceSymbols.excludeLibrarySymbols": "Exclude symbols that come from library files in Go to Symbol in Workspace results. Requires using TypeScript 5.3+ in the workspace.", "typescript.updateImportsOnFileMove.enabled": "Enable/disable automatic updating of import paths when you rename or move a file in VS Code.", @@ -187,6 +188,21 @@ "typescript.preferences.renameShorthandProperties.deprecationMessage": "The setting 'typescript.preferences.renameShorthandProperties' has been deprecated in favor of 'typescript.preferences.useAliasesForRenames'", "typescript.preferences.useAliasesForRenames": "Enable/disable introducing aliases for object shorthand properties during renames.", "typescript.preferences.renameMatchingJsxTags": "When on a JSX tag, try to rename the matching tag instead of renaming the symbol. Requires using TypeScript 5.1+ in the workspace.", + "typescript.preferences.organizeImports": "Advanced preferences that control how imports are ordered.", + "javascript.preferences.organizeImports": "Advanced preferences that control how imports are ordered.", + "typescript.preferences.organizeImports.caseSensitivity.auto": "Detect case-sensitivity for import sorting.", + "typescript.preferences.organizeImports.caseSensitivity.insensitive": "Sort imports case-insensitively.", + "typescript.preferences.organizeImports.caseSensitivity.sensitive": "Sort imports case-sensitively.", + "typescript.preferences.organizeImports.typeOrder.auto": "Detect where type-only named imports should be sorted.", + "typescript.preferences.organizeImports.typeOrder.last": "Type only named imports are sorted to the end of the import list.", + "typescript.preferences.organizeImports.typeOrder.inline": "Named imports are sorted by name only.", + "typescript.preferences.organizeImports.typeOrder.first": "Type only named imports are sorted to the end of the import list.", + "typescript.preferences.organizeImports.unicodeCollation.ordinal": "Sort imports using the numeric value of each code point.", + "typescript.preferences.organizeImports.unicodeCollation.unicode": "Sort imports using the Unicode code collation.", + "typescript.preferences.organizeImports.locale": "Overrides the locale used for collation. Specify `auto` to use the UI locale. Only applies to `organizeImportsCollation: 'unicode'`.", + "typescript.preferences.organizeImports.caseFirst": "Indicates whether upper-case comes before lower-case. Only applies to `organizeImportsCollation: 'unicode'`.", + "typescript.preferences.organizeImports.numericCollation": "Sort numeric strings by integer value.", + "typescript.preferences.organizeImports.accentCollation": "Compare characters with diacritical marks as unequal to base character.", "typescript.workspaceSymbols.scope": "Controls which files are searched by [Go to Symbol in Workspace](https://code.visualstudio.com/docs/editor/editingevolved#_open-symbol-by-name).", "typescript.workspaceSymbols.scope.allOpenProjects": "Search all open JavaScript or TypeScript projects for symbols.", "typescript.workspaceSymbols.scope.currentProject": "Only search for symbols in the current JavaScript or TypeScript project.", diff --git a/extensions/typescript-language-features/schemas/package.schema.json b/extensions/typescript-language-features/schemas/package.schema.json index c135ea39ec1..1cd2b1ed8ea 100644 --- a/extensions/typescript-language-features/schemas/package.schema.json +++ b/extensions/typescript-language-features/schemas/package.schema.json @@ -1,6 +1,5 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "TypeScript contributions to package.json", "type": "object", "properties": { "contributes": { diff --git a/extensions/typescript-language-features/src/configuration/configuration.ts b/extensions/typescript-language-features/src/configuration/configuration.ts index 639f3d346e0..1a18fea783d 100644 --- a/extensions/typescript-language-features/src/configuration/configuration.ts +++ b/extensions/typescript-language-features/src/configuration/configuration.ts @@ -117,7 +117,7 @@ export interface TypeScriptServiceConfiguration { readonly enableProjectDiagnostics: boolean; readonly maxTsServerMemory: number; readonly enablePromptUseWorkspaceTsdk: boolean; - readonly useVsCodeWatcher: boolean; // TODO@bpasero remove this setting eventually + readonly useVsCodeWatcher: boolean; readonly watchOptions: Proto.WatchOptions | undefined; readonly includePackageJsonAutoImports: 'auto' | 'on' | 'off' | undefined; readonly enableTsServerTracing: boolean; @@ -223,7 +223,12 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu } private readUseVsCodeWatcher(configuration: vscode.WorkspaceConfiguration): boolean { - return configuration.get('typescript.tsserver.experimental.useVsCodeWatcher', false); + const watcherExcludes = configuration.get>('files.watcherExclude') ?? {}; + if (watcherExcludes['**/node_modules/*/**'] /* VS Code default prior to 1.94.x */ === true) { + return false; // we cannot use the VS Code watcher if node_modules are excluded + } + + return configuration.get('typescript.tsserver.experimental.useVsCodeWatcher', true); } private readWatchOptions(configuration: vscode.WorkspaceConfiguration): Proto.WatchOptions | undefined { @@ -263,11 +268,11 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu } private readWebProjectWideIntellisenseSuppressSemanticErrors(configuration: vscode.WorkspaceConfiguration): boolean { - return configuration.get('typescript.tsserver.web.projectWideIntellisense.suppressSemanticErrors', true); + return this.readWebTypeAcquisition(configuration) && configuration.get('typescript.tsserver.web.projectWideIntellisense.suppressSemanticErrors', false); } private readWebTypeAcquisition(configuration: vscode.WorkspaceConfiguration): boolean { - return configuration.get('typescript.tsserver.web.typeAcquisition.enabled', false); + return configuration.get('typescript.tsserver.web.typeAcquisition.enabled', true); } private readEnableRegionDiagnostics(configuration: vscode.WorkspaceConfiguration): boolean { diff --git a/extensions/typescript-language-features/src/extension.browser.ts b/extensions/typescript-language-features/src/extension.browser.ts index 2f6bd2127e1..b87a41901bb 100644 --- a/extensions/typescript-language-features/src/extension.browser.ts +++ b/extensions/typescript-language-features/src/extension.browser.ts @@ -11,8 +11,7 @@ import { registerBaseCommands } from './commands/index'; import { TypeScriptServiceConfiguration } from './configuration/configuration'; import { BrowserServiceConfigurationProvider } from './configuration/configuration.browser'; import { ExperimentationTelemetryReporter, IExperimentationTelemetryReporter } from './experimentTelemetryReporter'; -import { AutoInstallerFs } from './filesystems/autoInstallerFs'; -import { MemFs } from './filesystems/memFs'; +import { registerAtaSupport } from './filesystems/ata'; import { createLazyClientHost, lazilyActivateClient } from './lazyClientHost'; import { Logger } from './logging/logger'; import RemoteRepositories from './remoteRepositories.browser'; @@ -25,7 +24,7 @@ import { ITypeScriptVersionProvider, TypeScriptVersion, TypeScriptVersionSource import { ActiveJsTsEditorTracker } from './ui/activeJsTsEditorTracker'; import { Disposable } from './utils/dispose'; import { getPackageInfo } from './utils/packageInfo'; -import { isWebAndHasSharedArrayBuffers, supportsReadableByteStreams } from './utils/platform'; +import { isWebAndHasSharedArrayBuffers } from './utils/platform'; class StaticVersionProvider implements ITypeScriptVersionProvider { @@ -62,7 +61,7 @@ export async function activate(context: vscode.ExtensionContext): Promise { new TypeScriptVersion( TypeScriptVersionSource.Bundled, vscode.Uri.joinPath(context.extensionUri, 'dist/browser/typescript/tsserver.web.js').toString(), - API.fromSimpleString('5.4.5'))); + API.fromSimpleString('5.6.2'))); let experimentTelemetryReporter: IExperimentationTelemetryReporter | undefined; const packageInfo = getPackageInfo(context); @@ -102,16 +101,7 @@ export async function activate(context: vscode.ExtensionContext): Promise { await startPreloadWorkspaceContentsIfNeeded(context, logger); })); - if (supportsReadableByteStreams()) { - context.subscriptions.push(vscode.workspace.registerFileSystemProvider('vscode-global-typings', new MemFs(), { - isCaseSensitive: true, - isReadonly: false - })); - context.subscriptions.push(vscode.workspace.registerFileSystemProvider('vscode-node-modules', new AutoInstallerFs(), { - isCaseSensitive: true, - isReadonly: false - })); - } + context.subscriptions.push(registerAtaSupport(logger)); return getExtensionApi(onCompletionAccepted.event, pluginManager); } diff --git a/extensions/typescript-language-features/src/filesystems/ata.ts b/extensions/typescript-language-features/src/filesystems/ata.ts new file mode 100644 index 00000000000..b5e43244e1b --- /dev/null +++ b/extensions/typescript-language-features/src/filesystems/ata.ts @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import { conditionalRegistration, requireGlobalConfiguration } from '../languageFeatures/util/dependentRegistration'; +import { supportsReadableByteStreams } from '../utils/platform'; +import { AutoInstallerFs } from './autoInstallerFs'; +import { MemFs } from './memFs'; +import { Logger } from '../logging/logger'; + +export function registerAtaSupport(logger: Logger): vscode.Disposable { + if (!supportsReadableByteStreams()) { + return vscode.Disposable.from(); + } + + return conditionalRegistration([ + requireGlobalConfiguration('typescript', 'tsserver.web.typeAcquisition.enabled'), + ], () => { + return vscode.Disposable.from( + // Ata + vscode.workspace.registerFileSystemProvider('vscode-global-typings', new MemFs('global-typings', logger), { + isCaseSensitive: true, + isReadonly: false, + }), + + // Read accesses to node_modules + vscode.workspace.registerFileSystemProvider('vscode-node-modules', new AutoInstallerFs(logger), { + isCaseSensitive: true, + isReadonly: false + })); + }); +} diff --git a/extensions/typescript-language-features/src/filesystems/autoInstallerFs.ts b/extensions/typescript-language-features/src/filesystems/autoInstallerFs.ts index 4e69fce8cda..d639b7fe999 100644 --- a/extensions/typescript-language-features/src/filesystems/autoInstallerFs.ts +++ b/extensions/typescript-language-features/src/filesystems/autoInstallerFs.ts @@ -3,50 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { PackageManager } from '@vscode/ts-package-manager'; +import { basename, join } from 'path'; import * as vscode from 'vscode'; -import { MemFs } from './memFs'; import { URI } from 'vscode-uri'; -import { PackageManager, FileSystem, packagePath } from '@vscode/ts-package-manager'; -import { join, basename, dirname } from 'path'; +import { Disposable } from '../utils/dispose'; +import { MemFs } from './memFs'; +import { Logger } from '../logging/logger'; const TEXT_DECODER = new TextDecoder('utf-8'); const TEXT_ENCODER = new TextEncoder(); -export class AutoInstallerFs implements vscode.FileSystemProvider { - - private readonly memfs = new MemFs(); - private readonly fs: FileSystem; - private readonly projectCache = new Map>(); - private readonly watcher: vscode.FileSystemWatcher; - private readonly _emitter = new vscode.EventEmitter(); - - readonly onDidChangeFile: vscode.Event = this._emitter.event; - - constructor() { - this.watcher = vscode.workspace.createFileSystemWatcher('**/{package.json,package-lock.json,package-lock.kdl}'); - const handler = (uri: URI) => { - const root = dirname(uri.path); - if (this.projectCache.delete(root)) { - (async () => { - const pm = new PackageManager(this.fs); - const opts = await this.getInstallOpts(uri, root); - const proj = await pm.resolveProject(root, opts); - proj.pruneExtraneous(); - // TODO: should this fire on vscode-node-modules instead? - // NB(kmarchan): This should tell TSServer that there's - // been changes inside node_modules and it needs to - // re-evaluate things. - this._emitter.fire([{ - type: vscode.FileChangeType.Changed, - uri: uri.with({ path: join(root, 'node_modules') }) - }]); - })(); - } - }; - this.watcher.onDidChange(handler); - this.watcher.onDidCreate(handler); - this.watcher.onDidDelete(handler); - const memfs = this.memfs; +export class AutoInstallerFs extends Disposable implements vscode.FileSystemProvider { + + private readonly memfs: MemFs; + private readonly packageManager: PackageManager; + private readonly _projectCache = new Map | undefined>(); + + private readonly _emitter = this._register(new vscode.EventEmitter()); + readonly onDidChangeFile = this._emitter.event; + + constructor( + private readonly logger: Logger + ) { + super(); + + const memfs = new MemFs('auto-installer', logger); + this.memfs = memfs; memfs.onDidChangeFile((e) => { this._emitter.fire(e.map(ev => ({ type: ev.type, @@ -54,7 +37,8 @@ export class AutoInstallerFs implements vscode.FileSystemProvider { uri: ev.uri.with({ scheme: 'memfs' }) }))); }); - this.fs = { + + this.packageManager = new PackageManager({ readDirectory(path: string, _extensions?: readonly string[], _exclude?: readonly string[], _include?: readonly string[], _depth?: number): string[] { return memfs.readDirectory(URI.file(path)).map(([name, _]) => name); }, @@ -87,17 +71,17 @@ export class AutoInstallerFs implements vscode.FileSystemProvider { return undefined; } } - }; + }); } watch(resource: vscode.Uri): vscode.Disposable { - const mapped = URI.file(new MappedUri(resource).path); - console.log('watching', mapped); - return this.memfs.watch(mapped); + this.logger.trace(`AutoInstallerFs.watch. Resource: ${resource.toString()}}`); + return this.memfs.watch(resource); } async stat(uri: vscode.Uri): Promise { - // console.log('stat', uri.toString()); + this.logger.trace(`AutoInstallerFs.stat: ${uri}`); + const mapped = new MappedUri(uri); // TODO: case sensitivity configuration @@ -119,7 +103,8 @@ export class AutoInstallerFs implements vscode.FileSystemProvider { } async readDirectory(uri: vscode.Uri): Promise<[string, vscode.FileType][]> { - // console.log('readDirectory', uri.toString()); + this.logger.trace(`AutoInstallerFs.readDirectory: ${uri}`); + const mapped = new MappedUri(uri); await this.ensurePackageContents(mapped); @@ -127,7 +112,8 @@ export class AutoInstallerFs implements vscode.FileSystemProvider { } async readFile(uri: vscode.Uri): Promise { - // console.log('readFile', uri.toString()); + this.logger.trace(`AutoInstallerFs.readFile: ${uri}`); + const mapped = new MappedUri(uri); await this.ensurePackageContents(mapped); @@ -151,8 +137,6 @@ export class AutoInstallerFs implements vscode.FileSystemProvider { } private async ensurePackageContents(incomingUri: MappedUri): Promise { - // console.log('ensurePackageContents', incomingUri.path); - // If we're not looking for something inside node_modules, bail early. if (!incomingUri.path.includes('node_modules')) { throw vscode.FileSystemError.FileNotFound(); @@ -163,34 +147,37 @@ export class AutoInstallerFs implements vscode.FileSystemProvider { throw vscode.FileSystemError.FileNotFound(); } - const root = this.getProjectRoot(incomingUri.path); - - const pkgPath = packagePath(incomingUri.path); - if (!root || this.projectCache.get(root)?.has(pkgPath)) { + const root = await this.getProjectRoot(incomingUri.original); + if (!root) { return; } - const proj = await (new PackageManager(this.fs)).resolveProject(root, await this.getInstallOpts(incomingUri.original, root)); + this.logger.trace(`AutoInstallerFs.ensurePackageContents. Path: ${incomingUri.path}, Root: ${root}`); - const restore = proj.restorePackageAt(incomingUri.path); - try { - await restore; - } catch (e) { - console.error(`failed to restore package at ${incomingUri.path}: `, e); - throw e; - } - if (!this.projectCache.has(root)) { - this.projectCache.set(root, new Set()); + const existingInstall = this._projectCache.get(root); + if (existingInstall) { + this.logger.trace(`AutoInstallerFs.ensurePackageContents. Found ongoing install for: ${root}/node_modules`); + return existingInstall; } - this.projectCache.get(root)!.add(pkgPath); + + const installing = (async () => { + const proj = await this.packageManager.resolveProject(root, await this.getInstallOpts(incomingUri.original, root)); + try { + await proj.restore(); + } catch (e) { + console.error(`failed to restore package at ${incomingUri.path}: `, e); + throw e; + } + })(); + this._projectCache.set(root, installing); + await installing; } private async getInstallOpts(originalUri: URI, root: string) { const vsfs = vscode.workspace.fs; - let pkgJson; - try { - pkgJson = TEXT_DECODER.decode(await vsfs.readFile(originalUri.with({ path: join(root, 'package.json') }))); - } catch (e) { } + + // We definitely need a package.json to be there. + const pkgJson = TEXT_DECODER.decode(await vsfs.readFile(originalUri.with({ path: join(root, 'package.json') }))); let kdlLock; try { @@ -209,13 +196,20 @@ export class AutoInstallerFs implements vscode.FileSystemProvider { }; } - private getProjectRoot(path: string): string | undefined { - const pkgPath = path.match(/(^.*)\/node_modules/); - return pkgPath?.[1]; + private async getProjectRoot(incomingUri: URI): Promise { + const vsfs = vscode.workspace.fs; + const pkgPath = incomingUri.path.match(/^(.*?)\/node_modules/); + const ret = pkgPath?.[1]; + if (!ret) { + return; + } + try { + await vsfs.stat(incomingUri.with({ path: join(ret, 'package.json') })); + return ret; + } catch (e) { + return; + } } - - // --- manage file events - } class MappedUri { @@ -227,7 +221,7 @@ class MappedUri { const parts = uri.path.match(/^\/([^\/]+)\/([^\/]*)(?:\/(.+))?$/); if (!parts) { - throw new Error(`Invalid path: ${uri.path}`); + throw new Error(`Invalid uri: ${uri.toString()}, ${uri.path}`); } const scheme = parts[1]; diff --git a/extensions/typescript-language-features/src/filesystems/memFs.ts b/extensions/typescript-language-features/src/filesystems/memFs.ts index eeeb60e957d..05c4e7c3db7 100644 --- a/extensions/typescript-language-features/src/filesystems/memFs.ts +++ b/extensions/typescript-language-features/src/filesystems/memFs.ts @@ -3,8 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; import { basename, dirname } from 'path'; +import * as vscode from 'vscode'; +import { Logger } from '../logging/logger'; export class MemFs implements vscode.FileSystemProvider { @@ -14,8 +15,13 @@ export class MemFs implements vscode.FileSystemProvider { 0, ); + constructor( + private readonly id: string, + private readonly logger: Logger, + ) { } + stat(uri: vscode.Uri): vscode.FileStat { - // console.log('stat', uri.toString()); + this.logger.trace(`MemFs.stat ${this.id}. uri: ${uri}`); const entry = this.getEntry(uri); if (!entry) { throw vscode.FileSystemError.FileNotFound(); @@ -25,7 +31,7 @@ export class MemFs implements vscode.FileSystemProvider { } readDirectory(uri: vscode.Uri): [string, vscode.FileType][] { - // console.log('readDirectory', uri.toString()); + this.logger.trace(`MemFs.readDirectory ${this.id}. uri: ${uri}`); const entry = this.getEntry(uri); if (!entry) { @@ -39,7 +45,7 @@ export class MemFs implements vscode.FileSystemProvider { } readFile(uri: vscode.Uri): Uint8Array { - // console.log('readFile', uri.toString()); + this.logger.trace(`MemFs.readFile ${this.id}. uri: ${uri}`); const entry = this.getEntry(uri); if (!entry) { @@ -54,7 +60,7 @@ export class MemFs implements vscode.FileSystemProvider { } writeFile(uri: vscode.Uri, content: Uint8Array, { create, overwrite }: { create: boolean; overwrite: boolean }): void { - // console.log('writeFile', uri.toString()); + this.logger.trace(`MemFs.writeFile ${this.id}. uri: ${uri}`); const dir = this.getParent(uri); @@ -98,7 +104,8 @@ export class MemFs implements vscode.FileSystemProvider { } createDirectory(uri: vscode.Uri): void { - // console.log('createDirectory', uri.toString()); + this.logger.trace(`MemFs.createDirectory ${this.id}. uri: ${uri}`); + const dir = this.getParent(uri); const now = Date.now() / 1000; dir.contents.set(basename(uri.path), new FsDirectoryEntry(new Map(), now, now)); diff --git a/extensions/typescript-language-features/src/languageFeatures/completions.ts b/extensions/typescript-language-features/src/languageFeatures/completions.ts index 708d7e028dd..749e74b4048 100644 --- a/extensions/typescript-language-features/src/languageFeatures/completions.ts +++ b/extensions/typescript-language-features/src/languageFeatures/completions.ts @@ -58,6 +58,7 @@ class MyCompletionItem extends vscode.CompletionItem { private readonly completionContext: CompletionContext, public readonly metadata: any | undefined, client: ITypeScriptServiceClient, + defaultCommitCharacters: readonly string[] | undefined, ) { const label = tsEntry.name || (tsEntry.insertText ?? ''); super(label, MyCompletionItem.convertKind(tsEntry.kind)); @@ -93,7 +94,7 @@ class MyCompletionItem extends vscode.CompletionItem { this.useCodeSnippet = completionContext.completeFunctionCalls && (this.kind === vscode.CompletionItemKind.Function || this.kind === vscode.CompletionItemKind.Method); this.range = this.getRangeFromReplacementSpan(tsEntry, completionContext); - this.commitCharacters = MyCompletionItem.getCommitCharacters(completionContext, tsEntry); + this.commitCharacters = MyCompletionItem.getCommitCharacters(completionContext, tsEntry, defaultCommitCharacters); this.insertText = isSnippet && tsEntry.insertText ? new vscode.SnippetString(tsEntry.insertText) : tsEntry.insertText; this.filterText = tsEntry.filterText || this.getFilterText(completionContext.line, tsEntry.insertText); @@ -500,7 +501,22 @@ class MyCompletionItem extends vscode.CompletionItem { } } - private static getCommitCharacters(context: CompletionContext, entry: Proto.CompletionEntry): string[] | undefined { + private static getCommitCharacters( + context: CompletionContext, + entry: Proto.CompletionEntry, + defaultCommitCharacters: readonly string[] | undefined, + ): string[] | undefined { + let commitCharacters = entry.commitCharacters ?? (defaultCommitCharacters ? Array.from(defaultCommitCharacters) : undefined); + if (commitCharacters) { + if (context.enableCallCompletions + && !context.isNewIdentifierLocation + && entry.kind !== PConst.Kind.warning + && entry.kind !== PConst.Kind.string) { + commitCharacters.push('('); + } + return commitCharacters; + } + if (entry.kind === PConst.Kind.warning || entry.kind === PConst.Kind.string) { // Ambient JS word based suggestion, strings return undefined; } @@ -509,7 +525,7 @@ class MyCompletionItem extends vscode.CompletionItem { return undefined; } - const commitCharacters: string[] = ['.', ',', ';']; + commitCharacters = ['.', ',', ';']; if (context.enableCallCompletions) { commitCharacters.push('('); } @@ -735,52 +751,39 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider< triggerKind: typeConverters.CompletionTriggerKind.toProtocolCompletionTriggerKind(context.triggerKind), }; - let isNewIdentifierLocation = true; - let isIncomplete = false; - let isMemberCompletion = false; let dotAccessorContext: DotAccessorContext | undefined; - let entries: ReadonlyArray; - let metadata: any | undefined; let response: ServerResponse.Response | undefined; let duration: number | undefined; let optionalReplacementRange: vscode.Range | undefined; - if (this.client.apiVersion.gte(API.v300)) { - const startTime = Date.now(); - try { - response = await this.client.interruptGetErr(() => this.client.execute('completionInfo', args, token)); - } finally { - duration = Date.now() - startTime; - } - if (response.type !== 'response' || !response.body) { - this.logCompletionsTelemetry(duration, response); - return undefined; - } - isNewIdentifierLocation = response.body.isNewIdentifierLocation; - isMemberCompletion = response.body.isMemberCompletion; - if (isMemberCompletion) { - const dotMatch = line.text.slice(0, position.character).match(/\??\.\s*$/) || undefined; - if (dotMatch) { - const range = new vscode.Range(position.translate({ characterDelta: -dotMatch[0].length }), position); - const text = document.getText(range); - dotAccessorContext = { range, text }; - } - } - isIncomplete = !!response.body.isIncomplete || (response.metadata as any)?.isIncomplete; - entries = response.body.entries; - metadata = response.metadata; + const startTime = Date.now(); + try { + response = await this.client.interruptGetErr(() => this.client.execute('completionInfo', args, token)); + } finally { + duration = Date.now() - startTime; + } - if (response.body.optionalReplacementSpan) { - optionalReplacementRange = typeConverters.Range.fromTextSpan(response.body.optionalReplacementSpan); - } - } else { - const response = await this.client.interruptGetErr(() => this.client.execute('completions', args, token)); - if (response.type !== 'response' || !response.body) { - return undefined; + if (response.type !== 'response' || !response.body) { + this.logCompletionsTelemetry(duration, response); + return undefined; + } + const isNewIdentifierLocation = response.body.isNewIdentifierLocation; + const isMemberCompletion = response.body.isMemberCompletion; + if (isMemberCompletion) { + const dotMatch = line.text.slice(0, position.character).match(/\??\.\s*$/) || undefined; + if (dotMatch) { + const range = new vscode.Range(position.translate({ characterDelta: -dotMatch[0].length }), position); + const text = document.getText(range); + dotAccessorContext = { range, text }; } + } + const isIncomplete = !!response.body.isIncomplete || (response.metadata as any)?.isIncomplete; + const entries = response.body.entries; + const metadata = response.metadata; + const defaultCommitCharacters = Object.freeze(response.body.defaultCommitCharacters); - entries = response.body; - metadata = response.metadata; + if (response.body.optionalReplacementSpan) { + optionalReplacementRange = typeConverters.Range.fromTextSpan(response.body.optionalReplacementSpan); } const completionContext: CompletionContext = { @@ -799,7 +802,14 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider< const items: MyCompletionItem[] = []; for (const entry of entries) { if (!shouldExcludeCompletionEntry(entry, completionConfiguration)) { - const item = new MyCompletionItem(position, document, entry, completionContext, metadata, this.client); + const item = new MyCompletionItem( + position, + document, + entry, + completionContext, + metadata, + this.client, + defaultCommitCharacters); item.command = { command: ApplyCompletionCommand.ID, title: '', @@ -856,11 +866,11 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider< private getTsTriggerCharacter(context: vscode.CompletionContext): Proto.CompletionsTriggerCharacter | undefined { switch (context.triggerCharacter) { - case '@': { // Workaround for https://github.com/microsoft/TypeScript/issues/27321 - return this.client.apiVersion.gte(API.v310) && this.client.apiVersion.lt(API.v320) ? undefined : '@'; + case '@': { + return '@'; } - case '#': { // Workaround for https://github.com/microsoft/TypeScript/issues/36367 - return this.client.apiVersion.lt(API.v381) ? undefined : '#'; + case '#': { + return '#'; } case ' ': { return this.client.apiVersion.gte(API.v430) ? ' ' : undefined; diff --git a/extensions/typescript-language-features/src/languageFeatures/copyPaste.ts b/extensions/typescript-language-features/src/languageFeatures/copyPaste.ts index 83a7bb38639..3e2e61a8a52 100644 --- a/extensions/typescript-language-features/src/languageFeatures/copyPaste.ts +++ b/extensions/typescript-language-features/src/languageFeatures/copyPaste.ts @@ -106,7 +106,7 @@ class DocumentPasteProvider implements vscode.DocumentPasteEditProvider { pasteLocations: ranges.map(typeConverters.Range.toTextSpan), copiedFrom }, token)); - if (response.type !== 'response' || !response.body || token.isCancellationRequested) { + if (response.type !== 'response' || !response.body?.edits.length || token.isCancellationRequested) { return; } diff --git a/extensions/typescript-language-features/src/languageFeatures/diagnostics.ts b/extensions/typescript-language-features/src/languageFeatures/diagnostics.ts index 990aefdfa56..d86f64637c6 100644 --- a/extensions/typescript-language-features/src/languageFeatures/diagnostics.ts +++ b/extensions/typescript-language-features/src/languageFeatures/diagnostics.ts @@ -4,13 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; +import { TypeScriptServiceConfiguration } from '../configuration/configuration'; import { DiagnosticLanguage } from '../configuration/languageDescription'; +import { TelemetryReporter } from '../logging/telemetry'; +import { DiagnosticPerformanceData as TsDiagnosticPerformanceData } from '../tsServer/protocol/protocol'; import * as arrays from '../utils/arrays'; import { Disposable } from '../utils/dispose'; -import { ResourceMap } from '../utils/resourceMap'; -import { TelemetryReporter } from '../logging/telemetry'; -import { TypeScriptServiceConfiguration } from '../configuration/configuration'; import { equals } from '../utils/objects'; +import { ResourceMap } from '../utils/resourceMap'; function diagnosticsEquals(a: vscode.Diagnostic, b: vscode.Diagnostic): boolean { if (a === b) { @@ -173,6 +174,10 @@ class DiagnosticSettings { } } +interface DiagnosticPerformanceData extends TsDiagnosticPerformanceData { + fileLineCount?: number; +} + class DiagnosticsTelemetryManager extends Disposable { private readonly _diagnosticCodesMap = new Map(); @@ -194,6 +199,33 @@ class DiagnosticsTelemetryManager extends Disposable { this._registerTelemetryEventEmitter(); } + public logDiagnosticsPerformanceTelemetry(performanceData: DiagnosticPerformanceData[]): void { + for (const data of performanceData) { + /* __GDPR__ + "diagnostics.performance" : { + "owner": "mjbvz", + "syntaxDiagDuration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, + "semanticDiagDuration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, + "suggestionDiagDuration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, + "regionSemanticDiagDuration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, + "fileLineCount" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, + "${include}": [ + "${TypeScriptCommonProperties}" + ] + } + */ + this._telemetryReporter.logTelemetry('diagnostics.performance', + { + syntaxDiagDuration: data.syntaxDiag, + semanticDiagDuration: data.semanticDiag, + suggestionDiagDuration: data.suggestionDiag, + regionSemanticDiagDuration: data.regionSemanticDiag, + fileLineCount: data.fileLineCount, + }, + ); + } + } + private _updateAllDiagnosticCodesAfterTimeout() { clearTimeout(this._timeout); this._timeout = setTimeout(() => this._updateDiagnosticCodes(), 5000); @@ -257,6 +289,8 @@ export class DiagnosticsManager extends Disposable { private readonly _updateDelay = 50; + private readonly _diagnosticsTelemetryManager: DiagnosticsTelemetryManager | undefined; + constructor( owner: string, configuration: TypeScriptServiceConfiguration, @@ -270,7 +304,7 @@ export class DiagnosticsManager extends Disposable { this._currentDiagnostics = this._register(vscode.languages.createDiagnosticCollection(owner)); // Here we are selecting only 1 user out of 1000 to send telemetry diagnostics if (Math.random() * 1000 <= 1 || configuration.enableDiagnosticsTelemetry) { - this._register(new DiagnosticsTelemetryManager(telemetryReporter, this._currentDiagnostics)); + this._diagnosticsTelemetryManager = this._register(new DiagnosticsTelemetryManager(telemetryReporter, this._currentDiagnostics)); } } @@ -349,6 +383,10 @@ export class DiagnosticsManager extends Disposable { return this._currentDiagnostics.get(file) || []; } + public logDiagnosticsPerformanceTelemetry(performanceData: DiagnosticPerformanceData[]): void { + this._diagnosticsTelemetryManager?.logDiagnosticsPerformanceTelemetry(performanceData); + } + private scheduleDiagnosticsUpdate(file: vscode.Uri) { if (!this._pendingUpdates.has(file)) { this._pendingUpdates.set(file, setTimeout(() => this.updateCurrentDiagnostics(file), this._updateDelay)); diff --git a/extensions/typescript-language-features/src/languageFeatures/fileConfigurationManager.ts b/extensions/typescript-language-features/src/languageFeatures/fileConfigurationManager.ts index bddd062b3e8..0b5a4c65d3b 100644 --- a/extensions/typescript-language-features/src/languageFeatures/fileConfigurationManager.ts +++ b/extensions/typescript-language-features/src/languageFeatures/fileConfigurationManager.ts @@ -5,12 +5,12 @@ import * as path from 'path'; import * as vscode from 'vscode'; -import type * as Proto from '../tsServer/protocol/protocol'; +import * as fileSchemes from '../configuration/fileSchemes'; +import { isTypeScriptDocument } from '../configuration/languageIds'; import { API } from '../tsServer/api'; +import type * as Proto from '../tsServer/protocol/protocol'; import { ITypeScriptServiceClient } from '../typescriptService'; import { Disposable } from '../utils/dispose'; -import * as fileSchemes from '../configuration/fileSchemes'; -import { isTypeScriptDocument } from '../configuration/languageIds'; import { equals } from '../utils/objects'; import { ResourceMap } from '../utils/resourceMap'; @@ -191,6 +191,7 @@ export default class FileConfigurationManager extends Disposable { includeCompletionsWithClassMemberSnippets: config.get('suggest.classMemberSnippets.enabled', true), includeCompletionsWithObjectLiteralMethodSnippets: config.get('suggest.objectLiteralMethodSnippets.enabled', true), autoImportFileExcludePatterns: this.getAutoImportFileExcludePatternsPreference(preferencesConfig, vscode.workspace.getWorkspaceFolder(document.uri)?.uri), + autoImportSpecifierExcludeRegexes: preferencesConfig.get('autoImportSpecifierExcludeRegexes'), preferTypeOnlyAutoImports: preferencesConfig.get('preferTypeOnlyAutoImports', false), useLabelDetailsInCompletionEntries: true, allowIncompleteCompletions: true, @@ -199,6 +200,7 @@ export default class FileConfigurationManager extends Disposable { interactiveInlayHints: true, includeCompletionsForModuleExports: config.get('suggest.autoImports'), ...getInlayHintsPreferences(config), + ...this.getOrganizeImportsPreferences(preferencesConfig), }; return preferences; @@ -208,7 +210,7 @@ export default class FileConfigurationManager extends Disposable { switch (config.get('quoteStyle')) { case 'single': return 'single'; case 'double': return 'double'; - default: return this.client.apiVersion.gte(API.v333) ? 'auto' : undefined; + default: return 'auto'; } } @@ -227,6 +229,23 @@ export default class FileConfigurationManager extends Disposable { wildcardPrefix + '**' + path.sep + p; }); } + + private getOrganizeImportsPreferences(config: vscode.WorkspaceConfiguration): Proto.UserPreferences { + return { + // More specific settings + organizeImportsAccentCollation: config.get('organizeImports.accentCollation'), + organizeImportsCaseFirst: withDefaultAsUndefined(config.get<'default' | 'upper' | 'lower'>('organizeImports.caseFirst', 'default'), 'default'), + organizeImportsCollation: config.get<'ordinal' | 'unicode'>('organizeImports.collation'), + organizeImportsIgnoreCase: withDefaultAsUndefined(config.get<'auto' | 'caseInsensitive' | 'caseSensitive'>('organizeImports.caseSensitivity'), 'auto'), + organizeImportsLocale: config.get('organizeImports.locale'), + organizeImportsNumericCollation: config.get('organizeImports.numericCollation'), + organizeImportsTypeOrder: withDefaultAsUndefined(config.get<'auto' | 'last' | 'inline' | 'first'>('organizeImports.typeOrder', 'auto'), 'auto'), + }; + } +} + +function withDefaultAsUndefined(value: T, def: O): Exclude | undefined { + return value === def ? undefined : value as Exclude; } export class InlayHintSettingNames { diff --git a/extensions/typescript-language-features/src/languageFeatures/fixAll.ts b/extensions/typescript-language-features/src/languageFeatures/fixAll.ts index 690439218a8..09ab205d918 100644 --- a/extensions/typescript-language-features/src/languageFeatures/fixAll.ts +++ b/extensions/typescript-language-features/src/languageFeatures/fixAll.ts @@ -5,7 +5,6 @@ import * as vscode from 'vscode'; import { DocumentSelector } from '../configuration/documentSelector'; -import { API } from '../tsServer/api'; import * as errorCodes from '../tsServer/protocol/errorCodes'; import * as fixNames from '../tsServer/protocol/fixNames'; import type * as Proto from '../tsServer/protocol/protocol'; @@ -13,7 +12,7 @@ import * as typeConverters from '../typeConverters'; import { ClientCapability, ITypeScriptServiceClient } from '../typescriptService'; import { DiagnosticsManager } from './diagnostics'; import FileConfigurationManager from './fileConfigurationManager'; -import { conditionalRegistration, requireMinVersion, requireSomeCapability } from './util/dependentRegistration'; +import { conditionalRegistration, requireSomeCapability } from './util/dependentRegistration'; interface AutoFix { @@ -250,7 +249,6 @@ export function register( diagnosticsManager: DiagnosticsManager, ) { return conditionalRegistration([ - requireMinVersion(client, API.v300), requireSomeCapability(client, ClientCapability.Semantic), ], () => { const provider = new TypeScriptAutoFixProvider(client, fileConfigurationManager, diagnosticsManager); diff --git a/extensions/typescript-language-features/src/languageFeatures/rename.ts b/extensions/typescript-language-features/src/languageFeatures/rename.ts index 19dc5b93c99..5c86190a53e 100644 --- a/extensions/typescript-language-features/src/languageFeatures/rename.ts +++ b/extensions/typescript-language-features/src/languageFeatures/rename.ts @@ -36,10 +36,6 @@ class TypeScriptRenameProvider implements vscode.RenameProvider { position: vscode.Position, token: vscode.CancellationToken ): Promise { - if (this.client.apiVersion.lt(API.v310)) { - return undefined; - } - const response = await this.execRename(document, position, token); if (!response) { return undefined; diff --git a/extensions/typescript-language-features/src/languageFeatures/semanticTokens.ts b/extensions/typescript-language-features/src/languageFeatures/semanticTokens.ts index 48c9af7a5a5..7f8d60d3875 100644 --- a/extensions/typescript-language-features/src/languageFeatures/semanticTokens.ts +++ b/extensions/typescript-language-features/src/languageFeatures/semanticTokens.ts @@ -4,11 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; +import { DocumentSelector } from '../configuration/documentSelector'; import * as Proto from '../tsServer/protocol/protocol'; -import { API } from '../tsServer/api'; import { ClientCapability, ITypeScriptServiceClient } from '../typescriptService'; -import { conditionalRegistration, requireMinVersion, requireSomeCapability } from './util/dependentRegistration'; -import { DocumentSelector } from '../configuration/documentSelector'; +import { conditionalRegistration, requireSomeCapability } from './util/dependentRegistration'; // as we don't do deltas, for performance reasons, don't compute semantic tokens for documents above that limit const CONTENT_LENGTH_LIMIT = 100000; @@ -18,7 +17,6 @@ export function register( client: ITypeScriptServiceClient, ) { return conditionalRegistration([ - requireMinVersion(client, API.v370), requireSomeCapability(client, ClientCapability.Semantic), ], () => { const provider = new DocumentSemanticTokensProvider(client); diff --git a/extensions/typescript-language-features/src/languageFeatures/smartSelect.ts b/extensions/typescript-language-features/src/languageFeatures/smartSelect.ts index 80887d65180..fa6a6096d37 100644 --- a/extensions/typescript-language-features/src/languageFeatures/smartSelect.ts +++ b/extensions/typescript-language-features/src/languageFeatures/smartSelect.ts @@ -5,14 +5,11 @@ import * as vscode from 'vscode'; import { DocumentSelector } from '../configuration/documentSelector'; -import { API } from '../tsServer/api'; import type * as Proto from '../tsServer/protocol/protocol'; import * as typeConverters from '../typeConverters'; import { ITypeScriptServiceClient } from '../typescriptService'; -import { conditionalRegistration, requireMinVersion } from './util/dependentRegistration'; class SmartSelection implements vscode.SelectionRangeProvider { - public static readonly minVersion = API.v350; public constructor( private readonly client: ITypeScriptServiceClient @@ -53,9 +50,5 @@ export function register( selector: DocumentSelector, client: ITypeScriptServiceClient, ) { - return conditionalRegistration([ - requireMinVersion(client, SmartSelection.minVersion), - ], () => { - return vscode.languages.registerSelectionRangeProvider(selector.syntax, new SmartSelection(client)); - }); + return vscode.languages.registerSelectionRangeProvider(selector.syntax, new SmartSelection(client)); } diff --git a/extensions/typescript-language-features/src/languageFeatures/tagClosing.ts b/extensions/typescript-language-features/src/languageFeatures/tagClosing.ts index 45ac08e14a4..6b47feb3d00 100644 --- a/extensions/typescript-language-features/src/languageFeatures/tagClosing.ts +++ b/extensions/typescript-language-features/src/languageFeatures/tagClosing.ts @@ -4,17 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import type * as Proto from '../tsServer/protocol/protocol'; -import { API } from '../tsServer/api'; -import { ITypeScriptServiceClient } from '../typescriptService'; -import { Condition, conditionalRegistration, requireMinVersion } from './util/dependentRegistration'; -import { Disposable } from '../utils/dispose'; import { DocumentSelector } from '../configuration/documentSelector'; import { LanguageDescription } from '../configuration/languageDescription'; +import type * as Proto from '../tsServer/protocol/protocol'; import * as typeConverters from '../typeConverters'; +import { ITypeScriptServiceClient } from '../typescriptService'; +import { Disposable } from '../utils/dispose'; +import { Condition, conditionalRegistration } from './util/dependentRegistration'; class TagClosing extends Disposable { - public static readonly minVersion = API.v300; private _disposed = false; private _timeout: NodeJS.Timeout | undefined = undefined; @@ -167,7 +165,6 @@ export function register( client: ITypeScriptServiceClient, ) { return conditionalRegistration([ - requireMinVersion(client, TagClosing.minVersion), requireActiveDocumentSetting(selector.syntax, language) ], () => new TagClosing(client)); } diff --git a/extensions/typescript-language-features/src/languageFeatures/updatePathsOnRename.ts b/extensions/typescript-language-features/src/languageFeatures/updatePathsOnRename.ts index 91ca9612e70..bdaa1fc69ff 100644 --- a/extensions/typescript-language-features/src/languageFeatures/updatePathsOnRename.ts +++ b/extensions/typescript-language-features/src/languageFeatures/updatePathsOnRename.ts @@ -7,7 +7,6 @@ import * as path from 'path'; import * as vscode from 'vscode'; import * as fileSchemes from '../configuration/fileSchemes'; import { doesResourceLookLikeATypeScriptFile } from '../configuration/languageDescription'; -import { API } from '../tsServer/api'; import type * as Proto from '../tsServer/protocol/protocol'; import * as typeConverters from '../typeConverters'; import { ClientCapability, ITypeScriptServiceClient } from '../typescriptService'; @@ -15,7 +14,7 @@ import { Delayer } from '../utils/async'; import { nulToken } from '../utils/cancellation'; import { Disposable } from '../utils/dispose'; import FileConfigurationManager from './fileConfigurationManager'; -import { conditionalRegistration, requireMinVersion, requireSomeCapability } from './util/dependentRegistration'; +import { conditionalRegistration, requireSomeCapability } from './util/dependentRegistration'; const updateImportsOnFileMoveName = 'updateImportsOnFileMove.enabled'; @@ -43,7 +42,6 @@ interface RenameAction { } class UpdateImportsOnFileRenameHandler extends Disposable { - public static readonly minVersion = API.v300; private readonly _delayer = new Delayer(50); private readonly _pendingRenames = new Set(); @@ -289,7 +287,6 @@ export function register( handles: (uri: vscode.Uri) => Promise, ) { return conditionalRegistration([ - requireMinVersion(client, UpdateImportsOnFileRenameHandler.minVersion), requireSomeCapability(client, ClientCapability.Semantic), ], () => { return new UpdateImportsOnFileRenameHandler(client, fileConfigurationManager, handles); diff --git a/extensions/typescript-language-features/src/languageFeatures/util/textRendering.ts b/extensions/typescript-language-features/src/languageFeatures/util/textRendering.ts index fe26dd64029..af1a7e601b4 100644 --- a/extensions/typescript-language-features/src/languageFeatures/util/textRendering.ts +++ b/extensions/typescript-language-features/src/languageFeatures/util/textRendering.ts @@ -15,24 +15,6 @@ export interface IFilePathToResourceConverter { toResource(filepath: string): vscode.Uri; } -function replaceLinks(text: string): string { - return text - // Http(s) links - .replace(/\{@(link|linkplain|linkcode) (https?:\/\/[^ |}]+?)(?:[| ]([^{}\n]+?))?\}/gi, (_, tag: string, link: string, text?: string) => { - switch (tag) { - case 'linkcode': - return `[\`${text ? text.trim() : link}\`](${link})`; - - default: - return `[${text ? text.trim() : link}](${link})`; - } - }); -} - -function processInlineTags(text: string): string { - return replaceLinks(text); -} - function getTagBodyText( tag: Proto.JSDocTagInfo, filePathConverter: IFilePathToResourceConverter, @@ -67,18 +49,19 @@ function getTagBodyText( case 'author': { // fix obsucated email address, #80898 const emailMatch = text.match(/(.+)\s<([-.\w]+@[-.\w]+)>/); - if (emailMatch === null) { return text; } else { return `${emailMatch[1]} ${emailMatch[2]}`; } } - case 'default': + case 'default': { return makeCodeblock(text); + } + default: { + return text; + } } - - return processInlineTags(text); } function getTagDocumentation( @@ -98,11 +81,10 @@ function getTagDocumentation( if (!doc) { return label; } - return label + (doc.match(/\r\n|\n/g) ? ' \n' + processInlineTags(doc) : ` \u2014 ${processInlineTags(doc)}`); + return label + (doc.match(/\r\n|\n/g) ? ' \n' + doc : ` \u2014 ${doc}`); } break; } - case 'return': case 'returns': { // For return(s), we require a non-empty body @@ -147,7 +129,7 @@ export function asPlainTextWithLinks( parts: readonly Proto.SymbolDisplayPart[] | string, filePathConverter: IFilePathToResourceConverter, ): string { - return processInlineTags(convertLinkTags(parts, filePathConverter)); + return convertLinkTags(parts, filePathConverter); } /** @@ -187,10 +169,10 @@ function convertLinkTags( if (text) { if (/^https?:/.test(text)) { const parts = text.split(' '); - if (parts.length === 1) { + if (parts.length === 1 && !currentLink.linkcode) { out.push(`<${parts[0]}>`); - } else if (parts.length > 1) { - const linkText = parts.slice(1).join(' '); + } else { + const linkText = parts.length > 1 ? parts.slice(1).join(' ') : parts[0]; out.push(`[${currentLink.linkcode ? '`' + escapeMarkdownSyntaxTokensForCode(linkText) + '`' : linkText}](${parts[0]})`); } } else { @@ -224,7 +206,7 @@ function convertLinkTags( break; } } - return processInlineTags(out.join('')); + return out.join(''); } function escapeMarkdownSyntaxTokensForCode(text: string): string { diff --git a/extensions/typescript-language-features/src/test/unit/textRendering.test.ts b/extensions/typescript-language-features/src/test/unit/textRendering.test.ts index b13f682f715..c2a8bafb8c0 100644 --- a/extensions/typescript-language-features/src/test/unit/textRendering.test.ts +++ b/extensions/typescript-language-features/src/test/unit/textRendering.test.ts @@ -28,17 +28,19 @@ suite('typescript.previewer', () => { test('Should parse url jsdoc @link', () => { assert.strictEqual( documentationToMarkdown( - 'x {@link http://www.example.com/foo} y {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler} z', + // 'x {@link http://www.example.com/foo} y {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler} z', + [{ "text": "x ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "http://www.example.com/foo", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " y ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "https://api.jquery.com/bind/#bind-eventType-eventData-handler", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " z", "kind": "text" }], [], noopToResource, undefined ).value, - 'x [http://www.example.com/foo](http://www.example.com/foo) y [https://api.jquery.com/bind/#bind-eventType-eventData-handler](https://api.jquery.com/bind/#bind-eventType-eventData-handler) z'); + 'x y z'); }); test('Should parse url jsdoc @link with text', () => { assert.strictEqual( documentationToMarkdown( - 'x {@link http://www.example.com/foo abc xyz} y {@link http://www.example.com/bar|b a z} z', + // 'x {@link http://www.example.com/foo abc xyz} y {@link http://www.example.com/bar|b a z} z', + [{ "text": "x ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "http://www.example.com/foo abc xyz", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " y ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "http://www.example.com/bar b a z", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " z", "kind": "text" }], [], noopToResource, undefined ).value, @@ -48,11 +50,12 @@ suite('typescript.previewer', () => { test('Should treat @linkcode jsdocs links as monospace', () => { assert.strictEqual( documentationToMarkdown( - 'x {@linkcode http://www.example.com/foo} y {@linkplain http://www.example.com/bar} z', + // 'x {@linkcode http://www.example.com/foo} y {@linkplain http://www.example.com/bar} z', + [{ "text": "x ", "kind": "text" }, { "text": "{@linkcode ", "kind": "link" }, { "text": "http://www.example.com/foo", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " y ", "kind": "text" }, { "text": "{@linkplain ", "kind": "link" }, { "text": "http://www.example.com/bar", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " z", "kind": "text" }], [], noopToResource, undefined ).value, - 'x [`http://www.example.com/foo`](http://www.example.com/foo) y [http://www.example.com/bar](http://www.example.com/bar) z'); + 'x [`http://www.example.com/foo`](http://www.example.com/foo) y z'); }); test('Should parse url jsdoc @link in param tag', () => { @@ -60,22 +63,13 @@ suite('typescript.previewer', () => { tagsToMarkdown([ { name: 'param', - text: 'a x {@link http://www.example.com/foo abc xyz} y {@link http://www.example.com/bar|b a z} z' + // a x {@link http://www.example.com/foo abc xyz} y {@link http://www.example.com/bar|b a z} z + text: [{ "text": "a", "kind": "parameterName" }, { "text": " ", "kind": "space" }, { "text": "x ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "http://www.example.com/foo abc xyz", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " y ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "http://www.example.com/bar b a z", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " z", "kind": "text" }], } ], noopToResource), '*@param* `a` — x [abc xyz](http://www.example.com/foo) y [b a z](http://www.example.com/bar) z'); }); - test('Should ignore unclosed jsdocs @link', () => { - assert.strictEqual( - documentationToMarkdown( - 'x {@link http://www.example.com/foo y {@link http://www.example.com/bar bar} z', - [], - noopToResource, undefined - ).value, - 'x {@link http://www.example.com/foo y [bar](http://www.example.com/bar) z'); - }); - test('Should support non-ascii characters in parameter name (#90108)', () => { assert.strictEqual( tagsToMarkdown([ diff --git a/extensions/typescript-language-features/src/tsServer/api.ts b/extensions/typescript-language-features/src/tsServer/api.ts index 4beb29d1b2b..b70810989ec 100644 --- a/extensions/typescript-language-features/src/tsServer/api.ts +++ b/extensions/typescript-language-features/src/tsServer/api.ts @@ -13,16 +13,7 @@ export class API { } public static readonly defaultVersion = API.fromSimpleString('1.0.0'); - public static readonly v300 = API.fromSimpleString('3.0.0'); - public static readonly v310 = API.fromSimpleString('3.1.0'); - public static readonly v314 = API.fromSimpleString('3.1.4'); - public static readonly v320 = API.fromSimpleString('3.2.0'); - public static readonly v333 = API.fromSimpleString('3.3.3'); - public static readonly v340 = API.fromSimpleString('3.4.0'); - public static readonly v350 = API.fromSimpleString('3.5.0'); - public static readonly v370 = API.fromSimpleString('3.7.0'); public static readonly v380 = API.fromSimpleString('3.8.0'); - public static readonly v381 = API.fromSimpleString('3.8.1'); public static readonly v390 = API.fromSimpleString('3.9.0'); public static readonly v400 = API.fromSimpleString('4.0.0'); public static readonly v401 = API.fromSimpleString('4.0.1'); diff --git a/extensions/typescript-language-features/src/tsServer/bufferSyncSupport.ts b/extensions/typescript-language-features/src/tsServer/bufferSyncSupport.ts index 32707f1c049..356c1703831 100644 --- a/extensions/typescript-language-features/src/tsServer/bufferSyncSupport.ts +++ b/extensions/typescript-language-features/src/tsServer/bufferSyncSupport.ts @@ -78,24 +78,14 @@ class BufferSynchronizer { } public open(resource: vscode.Uri, args: Proto.OpenRequestArgs) { - if (this.supportsBatching) { - this.updatePending(resource, new OpenOperation(args, args.scriptKindName)); - } else { - this.client.executeWithoutWaitingForResponse('open', args); - } + this.updatePending(resource, new OpenOperation(args, args.scriptKindName)); } /** * @return Was the buffer open? */ public close(resource: vscode.Uri, filepath: string, scriptKind: ScriptKind | undefined): boolean { - if (this.supportsBatching) { - return this.updatePending(resource, new CloseOperation(filepath, scriptKind)); - } else { - const args: Proto.FileRequestArgs = { file: filepath }; - this.client.executeWithoutWaitingForResponse('close', args); - return true; - } + return this.updatePending(resource, new CloseOperation(filepath, scriptKind)); } public change(resource: vscode.Uri, filepath: string, events: readonly vscode.TextDocumentContentChangeEvent[]) { @@ -103,24 +93,14 @@ class BufferSynchronizer { return; } - if (this.supportsBatching) { - this.updatePending(resource, new ChangeOperation({ - fileName: filepath, - textChanges: events.map((change): Proto.CodeEdit => ({ - newText: change.text, - start: typeConverters.Position.toLocation(change.range.start), - end: typeConverters.Position.toLocation(change.range.end), - })).reverse(), // Send the edits end-of-document to start-of-document order - })); - } else { - for (const { range, text } of events) { - const args: Proto.ChangeRequestArgs = { - insertString: text, - ...typeConverters.Range.toFormattingRequestArgs(filepath, range) - }; - this.client.executeWithoutWaitingForResponse('change', args); - } - } + this.updatePending(resource, new ChangeOperation({ + fileName: filepath, + textChanges: events.map((change): Proto.CodeEdit => ({ + newText: change.text, + start: typeConverters.Position.toLocation(change.range.start), + end: typeConverters.Position.toLocation(change.range.end), + })).reverse(), // Send the edits end-of-document to start-of-document order + })); } public reset(): void { @@ -136,12 +116,6 @@ class BufferSynchronizer { } private flush() { - if (!this.supportsBatching) { - // We've already eagerly synchronized - this._pending.clear(); - return; - } - if (this._pending.size > 0) { const closedFiles: string[] = []; const openFiles: Proto.OpenRequestArgs[] = []; @@ -158,10 +132,6 @@ class BufferSynchronizer { } } - private get supportsBatching(): boolean { - return this.client.apiVersion.gte(API.v340); - } - private updatePending(resource: vscode.Uri, op: BufferOperation): boolean { switch (op.type) { case BufferOperationType.Close: { @@ -662,6 +632,10 @@ export default class BufferSyncSupport extends Disposable { this.synchronizer.beforeCommand(command); } + public lineCount(resource: vscode.Uri): number | undefined { + return this.syncedBuffers.get(resource)?.lineCount; + } + private onDidCloseTextDocument(document: vscode.TextDocument): void { this.closeResource(document.uri); } diff --git a/extensions/typescript-language-features/src/tsServer/protocol/protocol.const.ts b/extensions/typescript-language-features/src/tsServer/protocol/protocol.const.ts index f1b0cca26a4..ed4806e6fdd 100644 --- a/extensions/typescript-language-features/src/tsServer/protocol/protocol.const.ts +++ b/extensions/typescript-language-features/src/tsServer/protocol/protocol.const.ts @@ -92,6 +92,7 @@ export enum EventName { createFileWatcher = 'createFileWatcher', createDirectoryWatcher = 'createDirectoryWatcher', closeFileWatcher = 'closeFileWatcher', + requestCompleted = 'requestCompleted', } export enum OrganizeImportsMode { diff --git a/extensions/typescript-language-features/src/tsServer/server.ts b/extensions/typescript-language-features/src/tsServer/server.ts index 883aa6830bd..4e41f7aa79a 100644 --- a/extensions/typescript-language-features/src/tsServer/server.ts +++ b/extensions/typescript-language-features/src/tsServer/server.ts @@ -166,6 +166,9 @@ export class SingleTsServer extends Disposable implements ITypeScriptServer { this._tracer.traceRequestCompleted(this._serverId, 'requestCompleted', seq, callback); callback.onSuccess(undefined); } + if ((event as Proto.RequestCompletedEvent).body.performanceData) { + this._onEvent.fire(event); + } } else { this._tracer.traceEvent(this._serverId, event); this._onEvent.fire(event); diff --git a/extensions/typescript-language-features/src/tsServer/serverProcess.browser.ts b/extensions/typescript-language-features/src/tsServer/serverProcess.browser.ts index 71daf1fb0b6..5adf1866112 100644 --- a/extensions/typescript-language-features/src/tsServer/serverProcess.browser.ts +++ b/extensions/typescript-language-features/src/tsServer/serverProcess.browser.ts @@ -40,7 +40,7 @@ export class WorkerServerProcessFactory implements TsServerProcessFactory { version: TypeScriptVersion, args: readonly string[], kind: TsServerProcessKind, - _configuration: TypeScriptServiceConfiguration, + configuration: TypeScriptServiceConfiguration, _versionManager: TypeScriptVersionManager, _nodeVersionManager: NodeVersionManager, tsServerLog: TsServerLog | undefined, @@ -50,10 +50,10 @@ export class WorkerServerProcessFactory implements TsServerProcessFactory { ...args, // Explicitly give TS Server its path so it can load local resources '--executingFilePath', tsServerPath, + // Enable/disable web type acquisition + (configuration.webTypeAcquisitionEnabled && supportsReadableByteStreams() ? '--experimentalTypeAcquisition' : '--disableAutomaticTypingAcquisition'), ]; - if (_configuration.webTypeAcquisitionEnabled && supportsReadableByteStreams()) { - launchArgs.push('--experimentalTypeAcquisition'); - } + return new WorkerServerProcess(kind, tsServerPath, this._extensionUri, launchArgs, tsServerLog, this._logger); } } diff --git a/extensions/typescript-language-features/src/tsServer/spawner.ts b/extensions/typescript-language-features/src/tsServer/spawner.ts index 364c0f07dae..162fdf6d3d1 100644 --- a/extensions/typescript-language-features/src/tsServer/spawner.ts +++ b/extensions/typescript-language-features/src/tsServer/spawner.ts @@ -116,12 +116,9 @@ export class TypeScriptServerSpawner { return CompositeServerType.Single; case SyntaxServerConfiguration.Auto: - if (version.apiVersion?.gte(API.v340)) { - return version.apiVersion?.gte(API.v400) - ? CompositeServerType.DynamicSeparateSyntax - : CompositeServerType.SeparateSyntax; - } - return CompositeServerType.Single; + return version.apiVersion?.gte(API.v400) + ? CompositeServerType.DynamicSeparateSyntax + : CompositeServerType.SeparateSyntax; } } diff --git a/extensions/typescript-language-features/src/tsconfig.ts b/extensions/typescript-language-features/src/tsconfig.ts index 04f08a128bc..e85c715e875 100644 --- a/extensions/typescript-language-features/src/tsconfig.ts +++ b/extensions/typescript-language-features/src/tsconfig.ts @@ -76,6 +76,10 @@ function inferredProjectConfigSnippet( config: TypeScriptServiceConfiguration ) { const baseConfig = inferredProjectCompilerOptions(version, projectType, config); + if (projectType === ProjectType.TypeScript) { + delete baseConfig.allowImportingTsExtensions; + } + const compilerOptions = Object.keys(baseConfig).map(key => `"${key}": ${JSON.stringify(baseConfig[key])}`); return new vscode.SnippetString(`{ "compilerOptions": { diff --git a/extensions/typescript-language-features/src/typeConverters.ts b/extensions/typescript-language-features/src/typeConverters.ts index 067a1ff3c0a..a860251bb59 100644 --- a/extensions/typescript-language-features/src/typeConverters.ts +++ b/extensions/typescript-language-features/src/typeConverters.ts @@ -26,7 +26,6 @@ export namespace Range { Math.max(0, start.line - 1), Math.max(start.offset - 1, 0), Math.max(0, end.line - 1), Math.max(0, end.offset - 1)); - // @ts-expect-error until ts 5.6 export const toFileRange = (range: vscode.Range): Proto.FileRange => ({ startLine: range.start.line + 1, startOffset: range.start.character + 1, @@ -38,7 +37,7 @@ export namespace Range { file, ...toFileRange(range) }); - // @ts-expect-error until ts 5.6 + export const toFileRangesRequestArgs = (file: string, ranges: vscode.Range[]): Proto.FileRangesRequestArgs => ({ file, ranges: ranges.map(toFileRange) diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index da6408b827b..2c162cfe615 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -5,6 +5,7 @@ import * as path from 'path'; import * as vscode from 'vscode'; +import { homedir } from 'os'; import { ServiceConfigurationProvider, SyntaxServerConfiguration, TsServerLogLevel, TypeScriptServiceConfiguration, areServiceConfigurationsEqual } from './configuration/configuration'; import * as fileSchemes from './configuration/fileSchemes'; import { Schemes } from './configuration/schemes'; @@ -30,6 +31,7 @@ import { TypeScriptVersionManager } from './tsServer/versionManager'; import { ITypeScriptVersionProvider, TypeScriptVersion } from './tsServer/versionProvider'; import { ClientCapabilities, ClientCapability, ExecConfig, ITypeScriptServiceClient, ServerResponse, TypeScriptRequests } from './typescriptService'; import { Disposable, DisposableStore, disposeAll } from './utils/dispose'; +import { hash } from './utils/hash'; import { isWeb, isWebAndHasSharedArrayBuffers } from './utils/platform'; @@ -141,7 +143,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType constructor( private readonly context: vscode.ExtensionContext, - onCaseInsenitiveFileSystem: boolean, + onCaseInsensitiveFileSystem: boolean, services: { pluginManager: PluginManager; logDirectoryProvider: ILogDirectoryProvider; @@ -191,7 +193,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType this.restartTsServer(); })); - this.bufferSyncSupport = new BufferSyncSupport(this, allModeIds, onCaseInsenitiveFileSystem); + this.bufferSyncSupport = new BufferSyncSupport(this, allModeIds, onCaseInsensitiveFileSystem); this.onReady(() => { this.bufferSyncSupport.listen(); }); this.bufferSyncSupport.onDelete(resource => { @@ -232,7 +234,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType return this.apiVersion.fullVersionString; }); - this.diagnosticsManager = new DiagnosticsManager('typescript', this._configuration, this.telemetryReporter, onCaseInsenitiveFileSystem); + this.diagnosticsManager = new DiagnosticsManager('typescript', this._configuration, this.telemetryReporter, onCaseInsensitiveFileSystem); this.typescriptServerSpawner = new TypeScriptServerSpawner(this.versionProvider, this._versionManager, this._nodeVersionManager, this.logDirectoryProvider, this.pluginPathsProvider, this.logger, this.telemetryReporter, this.tracer, this.processFactory); this._register(this.pluginManager.onDidUpdateConfig(update => { @@ -424,17 +426,31 @@ export default class TypeScriptServiceClient extends Disposable implements IType this.serverState = new ServerState.Running(handle, apiVersion, undefined, true); this.lastStart = Date.now(); + + /* __GDPR__FRAGMENT__ + "TypeScriptServerEnvCommonProperties" : { + "hasGlobalPlugins": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "globalPluginNameHashes": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + } + */ + const typeScriptServerEnvCommonProperties = { + hasGlobalPlugins: this.pluginManager.plugins.length > 0, + globalPluginNameHashes: JSON.stringify(this.pluginManager.plugins.map(plugin => hash(plugin.name))), + }; + /* __GDPR__ "tsserver.spawned" : { "owner": "mjbvz", "${include}": [ - "${TypeScriptCommonProperties}" + "${TypeScriptCommonProperties}", + "${TypeScriptServerEnvCommonProperties}" ], "localTypeScriptVersion": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "typeScriptVersionSource": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } } */ this.logTelemetry('tsserver.spawned', { + ...typeScriptServerEnvCommonProperties, localTypeScriptVersion: this.versionProvider.localVersion ? this.versionProvider.localVersion.displayName : '', typeScriptVersionSource: version.source, }); @@ -459,11 +475,14 @@ export default class TypeScriptServiceClient extends Disposable implements IType "tsserver.error" : { "owner": "mjbvz", "${include}": [ - "${TypeScriptCommonProperties}" + "${TypeScriptCommonProperties}", + "${TypeScriptServerEnvCommonProperties}" ] } */ - this.logTelemetry('tsserver.error'); + this.logTelemetry('tsserver.error', { + ...typeScriptServerEnvCommonProperties + }); this.serviceExited(false, apiVersion); }); @@ -476,14 +495,19 @@ export default class TypeScriptServiceClient extends Disposable implements IType /* __GDPR__ "tsserver.exitWithCode" : { "owner": "mjbvz", - "code" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }, - "signal" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }, "${include}": [ - "${TypeScriptCommonProperties}" - ] + "${TypeScriptCommonProperties}", + "${TypeScriptServerEnvCommonProperties}" + ], + "code" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }, + "signal" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" } } */ - this.logTelemetry('tsserver.exitWithCode', { code: code ?? undefined, signal: signal ?? undefined }); + this.logTelemetry('tsserver.exitWithCode', { + ...typeScriptServerEnvCommonProperties, + code: code ?? undefined, + signal: signal ?? undefined, + }); if (this.token !== mytoken) { // this is coming from an old process @@ -673,7 +697,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType if (!this._isPromptingAfterCrash) { if (this.pluginManager.plugins.length) { prompt = vscode.window.showWarningMessage( - vscode.l10n.t("The JS/TS language service crashed.\nThis may be caused by a plugin contributed by one of these extensions: {0}.\nPlease try disabling these extensions before filing an issue against VS Code.", pluginExtensionList), reportIssueItem); + vscode.l10n.t("The JS/TS language service crashed.\nThis may be caused by a plugin contributed by one of these extensions: {0}.\nPlease try disabling these extensions before filing an issue against VS Code.", pluginExtensionList)); } else { prompt = vscode.window.showWarningMessage( vscode.l10n.t("The JS/TS language service crashed."), @@ -959,20 +983,19 @@ export default class TypeScriptServiceClient extends Disposable implements IType kind: getDiagnosticsKind(event), resource: this.toResource(diagnosticEvent.body.file), diagnostics: diagnosticEvent.body.diagnostics, - // @ts-expect-error until ts 5.6 spans: diagnosticEvent.body.spans, }); } - break; + return; } case EventName.configFileDiag: this._onConfigDiagnosticsReceived.fire(event as Proto.ConfigFileDiagnosticEvent); - break; + return; case EventName.telemetry: { const body = (event as Proto.TelemetryEvent).body; this.dispatchTelemetryEvent(body); - break; + return; } case EventName.projectLanguageServiceState: { const body = (event as Proto.ProjectLanguageServiceStateEvent).body!; @@ -980,7 +1003,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType this.serverState.updateLanguageServiceEnabled(body.languageServiceEnabled); } this._onProjectLanguageServiceStateChanged.fire(body); - break; + return; } case EventName.projectsUpdatedInBackground: { this.loadingIndicator.reset(); @@ -988,56 +1011,87 @@ export default class TypeScriptServiceClient extends Disposable implements IType const body = (event as Proto.ProjectsUpdatedInBackgroundEvent).body; const resources = body.openFiles.map(file => this.toResource(file)); this.bufferSyncSupport.getErr(resources); - break; + return; } case EventName.beginInstallTypes: this._onDidBeginInstallTypings.fire((event as Proto.BeginInstallTypesEvent).body); - break; + return; case EventName.endInstallTypes: this._onDidEndInstallTypings.fire((event as Proto.EndInstallTypesEvent).body); - break; + return; case EventName.typesInstallerInitializationFailed: this._onTypesInstallerInitializationFailed.fire((event as Proto.TypesInstallerInitializationFailedEvent).body); - break; + return; case EventName.surveyReady: this._onSurveyReady.fire((event as Proto.SurveyReadyEvent).body); - break; + return; case EventName.projectLoadingStart: this.loadingIndicator.startedLoadingProject((event as Proto.ProjectLoadingStartEvent).body.projectName); - break; + return; case EventName.projectLoadingFinish: this.loadingIndicator.finishedLoadingProject((event as Proto.ProjectLoadingFinishEvent).body.projectName); - break; + return; + + case EventName.createDirectoryWatcher: { + const fpath = (event.body as Proto.CreateDirectoryWatcherEventBody).path; + if (fpath.startsWith(inMemoryResourcePrefix)) { + return; + } + if (process.platform === 'darwin' && fpath === path.join(homedir(), 'Library')) { + // ignore directory watch requests on ~/Library + // until microsoft/TypeScript#59831 is resolved + return; + } - case EventName.createDirectoryWatcher: this.createFileSystemWatcher( (event.body as Proto.CreateDirectoryWatcherEventBody).id, new vscode.RelativePattern( - vscode.Uri.file((event.body as Proto.CreateDirectoryWatcherEventBody).path), + vscode.Uri.file(fpath), (event.body as Proto.CreateDirectoryWatcherEventBody).recursive ? '**' : '*' ), (event.body as Proto.CreateDirectoryWatcherEventBody).ignoreUpdate ); - break; + return; + } + case EventName.createFileWatcher: { + const path = (event.body as Proto.CreateFileWatcherEventBody).path; + if (path.startsWith(inMemoryResourcePrefix)) { + return; + } - case EventName.createFileWatcher: this.createFileSystemWatcher( (event.body as Proto.CreateFileWatcherEventBody).id, new vscode.RelativePattern( - vscode.Uri.file((event.body as Proto.CreateFileWatcherEventBody).path), + vscode.Uri.file(path), '*' ) ); - break; - + return; + } case EventName.closeFileWatcher: this.closeFileSystemWatcher(event.body.id); - break; + return; + + case EventName.requestCompleted: { + const diagnosticsDuration = (event.body as Proto.RequestCompletedEventBody).performanceData?.diagnosticsDuration; + if (diagnosticsDuration) { + this.diagnosticsManager.logDiagnosticsPerformanceTelemetry( + diagnosticsDuration.map(fileData => { + const resource = this.toResource(fileData.file); + return { + ...fileData, + fileLineCount: this.bufferSyncSupport.lineCount(resource), + }; + }) + ); + } + return; + } } } @@ -1098,7 +1152,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType ignoreChangeEvents?: boolean, ) { const disposable = new DisposableStore(); - const watcher = disposable.add(vscode.workspace.createFileSystemWatcher(pattern, { excludes: [] /* TODO:: need to fill in excludes list */, ignoreChangeEvents })); + const watcher = disposable.add(vscode.workspace.createFileSystemWatcher(pattern, undefined, ignoreChangeEvents)); disposable.add(watcher.onDidChange(changeFile => this.addWatchEvent(id, 'updated', changeFile.fsPath) )); @@ -1121,13 +1175,9 @@ export default class TypeScriptServiceClient extends Disposable implements IType this.watches.set(id, disposable); } - private closeFileSystemWatcher( - id: number, - ) { + private closeFileSystemWatcher(id: number) { const existing = this.watches.get(id); - if (existing) { - existing.dispose(); - } + existing?.dispose(); } private dispatchTelemetryEvent(telemetryData: Proto.TelemetryEventBody): void { @@ -1161,6 +1211,8 @@ export default class TypeScriptServiceClient extends Disposable implements IType break; } } + + // Add plugin data here if (telemetryData.telemetryEventName === 'projectInfo') { if (this.serverState.type === ServerState.Type.Running) { this.serverState.updateTsserverVersion(properties['version']); @@ -1183,9 +1235,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType } private configurePlugin(pluginName: string, configuration: {}): any { - if (this.apiVersion.gte(API.v314)) { - this.executeWithoutWaitingForResponse('configurePlugin', { pluginName, configuration }); - } + this.executeWithoutWaitingForResponse('configurePlugin', { pluginName, configuration }); } } diff --git a/extensions/typescript-language-features/src/ui/activeJsTsEditorTracker.ts b/extensions/typescript-language-features/src/ui/activeJsTsEditorTracker.ts index 3da1f5a8570..c3cae6321ff 100644 --- a/extensions/typescript-language-features/src/ui/activeJsTsEditorTracker.ts +++ b/extensions/typescript-language-features/src/ui/activeJsTsEditorTracker.ts @@ -28,6 +28,7 @@ export class ActiveJsTsEditorTracker extends Disposable { this._register(vscode.window.onDidChangeActiveTextEditor(_ => this.update())); this._register(vscode.window.onDidChangeVisibleTextEditors(_ => this.update())); + this._register(vscode.window.tabGroups.onDidChangeTabGroups(_ => this.update())); this.update(); } diff --git a/extensions/typescript-language-features/src/ui/intellisenseStatus.ts b/extensions/typescript-language-features/src/ui/intellisenseStatus.ts index 1a6ea63f427..e26e2b3719f 100644 --- a/extensions/typescript-language-features/src/ui/intellisenseStatus.ts +++ b/extensions/typescript-language-features/src/ui/intellisenseStatus.ts @@ -43,6 +43,8 @@ namespace IntellisenseState { export type State = typeof None | Pending | Resolved | typeof SyntaxOnly; } +type CreateOrOpenConfigCommandArgs = [root: vscode.Uri, projectType: ProjectType]; + export class IntellisenseStatus extends Disposable { public readonly openOpenConfigCommandId = '_typescript.openConfig'; @@ -62,7 +64,7 @@ export class IntellisenseStatus extends Disposable { commandManager.register({ id: this.openOpenConfigCommandId, - execute: async (root: vscode.Uri, projectType: ProjectType) => { + execute: async (...[root, projectType]: CreateOrOpenConfigCommandArgs) => { if (this._state.type === IntellisenseState.Type.Resolved) { await openProjectConfigOrPromptToCreate(projectType, this._client, root, this._state.configFile); } else if (this._state.type === IntellisenseState.Type.Pending) { @@ -72,7 +74,7 @@ export class IntellisenseStatus extends Disposable { }); commandManager.register({ id: this.createOrOpenConfigCommandId, - execute: async (root: vscode.Uri, projectType: ProjectType) => { + execute: async (...[root, projectType]: CreateOrOpenConfigCommandArgs) => { await openOrCreateConfig(this._client.apiVersion, projectType, root, this._client.configuration); }, }); @@ -182,7 +184,7 @@ export class IntellisenseStatus extends Disposable { title: this._state.projectType === ProjectType.TypeScript ? vscode.l10n.t("Configure tsconfig") : vscode.l10n.t("Configure jsconfig"), - arguments: [rootPath], + arguments: [rootPath, this._state.projectType] satisfies CreateOrOpenConfigCommandArgs, }; } else { statusItem.text = vscode.workspace.asRelativePath(this._state.configFile); @@ -190,7 +192,7 @@ export class IntellisenseStatus extends Disposable { statusItem.command = { command: this.openOpenConfigCommandId, title: vscode.l10n.t("Open config file"), - arguments: [rootPath], + arguments: [rootPath, this._state.projectType] satisfies CreateOrOpenConfigCommandArgs, }; } break; diff --git a/extensions/typescript-language-features/src/ui/managedFileContext.ts b/extensions/typescript-language-features/src/ui/managedFileContext.ts index 0b929f85277..1da4588a334 100644 --- a/extensions/typescript-language-features/src/ui/managedFileContext.ts +++ b/extensions/typescript-language-features/src/ui/managedFileContext.ts @@ -10,7 +10,7 @@ import { isSupportedLanguageMode } from '../configuration/languageIds'; import { Disposable } from '../utils/dispose'; import { ActiveJsTsEditorTracker } from './activeJsTsEditorTracker'; -/**E +/** * When clause context set when the current file is managed by vscode's built-in typescript extension. */ export default class ManagedFileContextManager extends Disposable { diff --git a/extensions/typescript-language-features/src/utils/async.ts b/extensions/typescript-language-features/src/utils/async.ts index db92754fd2e..9523d7fe67a 100644 --- a/extensions/typescript-language-features/src/utils/async.ts +++ b/extensions/typescript-language-features/src/utils/async.ts @@ -70,3 +70,94 @@ export function setImmediate(callback: (...args: any[]) => void, ...args: any[]) return { dispose: () => clearTimeout(handle) }; } } + + +/** + * A helper to prevent accumulation of sequential async tasks. + * + * Imagine a mail man with the sole task of delivering letters. As soon as + * a letter submitted for delivery, he drives to the destination, delivers it + * and returns to his base. Imagine that during the trip, N more letters were submitted. + * When the mail man returns, he picks those N letters and delivers them all in a + * single trip. Even though N+1 submissions occurred, only 2 deliveries were made. + * + * The throttler implements this via the queue() method, by providing it a task + * factory. Following the example: + * + * const throttler = new Throttler(); + * const letters = []; + * + * function deliver() { + * const lettersToDeliver = letters; + * letters = []; + * return makeTheTrip(lettersToDeliver); + * } + * + * function onLetterReceived(l) { + * letters.push(l); + * throttler.queue(deliver); + * } + */ +export class Throttler { + + private activePromise: Promise | null; + private queuedPromise: Promise | null; + private queuedPromiseFactory: ITask> | null; + + private isDisposed = false; + + constructor() { + this.activePromise = null; + this.queuedPromise = null; + this.queuedPromiseFactory = null; + } + + queue(promiseFactory: ITask>): Promise { + if (this.isDisposed) { + return Promise.reject(new Error('Throttler is disposed')); + } + + if (this.activePromise) { + this.queuedPromiseFactory = promiseFactory; + + if (!this.queuedPromise) { + const onComplete = () => { + this.queuedPromise = null; + + if (this.isDisposed) { + return; + } + + const result = this.queue(this.queuedPromiseFactory!); + this.queuedPromiseFactory = null; + + return result; + }; + + this.queuedPromise = new Promise(resolve => { + this.activePromise!.then(onComplete, onComplete).then(resolve); + }); + } + + return new Promise((resolve, reject) => { + this.queuedPromise!.then(resolve, reject); + }); + } + + this.activePromise = promiseFactory(); + + return new Promise((resolve, reject) => { + this.activePromise!.then((result: T) => { + this.activePromise = null; + resolve(result); + }, (err: unknown) => { + this.activePromise = null; + reject(err); + }); + }); + } + + dispose(): void { + this.isDisposed = true; + } +} diff --git a/extensions/typescript-language-features/src/utils/hash.ts b/extensions/typescript-language-features/src/utils/hash.ts new file mode 100644 index 00000000000..b009808968d --- /dev/null +++ b/extensions/typescript-language-features/src/utils/hash.ts @@ -0,0 +1,58 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/** + * Return a hash value for an object. + */ +export function hash(obj: any, hashVal = 0): number { + switch (typeof obj) { + case 'object': + if (obj === null) { + return numberHash(349, hashVal); + } else if (Array.isArray(obj)) { + return arrayHash(obj, hashVal); + } + return objectHash(obj, hashVal); + case 'string': + return stringHash(obj, hashVal); + case 'boolean': + return booleanHash(obj, hashVal); + case 'number': + return numberHash(obj, hashVal); + case 'undefined': + return 937 * 31; + default: + return numberHash(obj, 617); + } +} + +function numberHash(val: number, initialHashVal: number): number { + return (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32 +} + +function booleanHash(b: boolean, initialHashVal: number): number { + return numberHash(b ? 433 : 863, initialHashVal); +} + +function stringHash(s: string, hashVal: number) { + hashVal = numberHash(149417, hashVal); + for (let i = 0, length = s.length; i < length; i++) { + hashVal = numberHash(s.charCodeAt(i), hashVal); + } + return hashVal; +} + +function arrayHash(arr: any[], initialHashVal: number): number { + initialHashVal = numberHash(104579, initialHashVal); + return arr.reduce((hashVal, item) => hash(item, hashVal), initialHashVal); +} + +function objectHash(obj: any, initialHashVal: number): number { + initialHashVal = numberHash(181387, initialHashVal); + return Object.keys(obj).sort().reduce((hashVal, key) => { + hashVal = stringHash(key, hashVal); + return hash(obj[key], hashVal); + }, initialHashVal); +} diff --git a/extensions/typescript-language-features/tsconfig.json b/extensions/typescript-language-features/tsconfig.json index 65557839ba6..44097665a9c 100644 --- a/extensions/typescript-language-features/tsconfig.json +++ b/extensions/typescript-language-features/tsconfig.json @@ -11,7 +11,6 @@ "include": [ "src/**/*", "../../src/vscode-dts/vscode.d.ts", - "../../src/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts", "../../src/vscode-dts/vscode.proposed.codeActionAI.d.ts", "../../src/vscode-dts/vscode.proposed.codeActionRanges.d.ts", "../../src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts", diff --git a/extensions/typescript-language-features/web/README.md b/extensions/typescript-language-features/web/README.md index eda9e9cb00b..8d4689b34f0 100644 --- a/extensions/typescript-language-features/web/README.md +++ b/extensions/typescript-language-features/web/README.md @@ -6,8 +6,8 @@ Language server host for typescript using vscode's sync-api in the browser. To test this out, you'll need three shells: -1. `yarn watch` for vscode itself -2. `yarn watch-web` for the web side +1. `npm i` for vscode itself +2. `npm run watch-web` for the web side 3. `node /scripts/code-web.js --coi` The last command will open a browser window. You'll want to add `?vscode-coi=` diff --git a/extensions/typescript-language-features/web/src/fileWatcherManager.ts b/extensions/typescript-language-features/web/src/fileWatcherManager.ts index 5bbce244688..6ae4472e503 100644 --- a/extensions/typescript-language-features/web/src/fileWatcherManager.ts +++ b/extensions/typescript-language-features/web/src/fileWatcherManager.ts @@ -53,9 +53,9 @@ export class FileWatcherManager { this.watchFiles.set(path, { callback, pollingInterval, options }); const watchIds = [++this.watchId]; this.watchPort.postMessage({ type: 'watchFile', uri: uri, id: watchIds[0] }); - if (this.enabledExperimentalTypeAcquisition && looksLikeNodeModules(path)) { + if (this.enabledExperimentalTypeAcquisition && looksLikeNodeModules(path) && uri.scheme !== 'vscode-global-typings') { watchIds.push(++this.watchId); - this.watchPort.postMessage({ type: 'watchFile', uri: mapUri(uri, 'vscode-node-modules'), id: watchIds[1] }); + this.watchPort.postMessage({ type: 'watchFile', uri: mapUri(uri, 'vscode-global-typings'), id: watchIds[1] }); } return { close: () => { diff --git a/extensions/typescript-language-features/web/src/serverHost.ts b/extensions/typescript-language-features/web/src/serverHost.ts index f2f9ca95996..dedec85991f 100644 --- a/extensions/typescript-language-features/web/src/serverHost.ts +++ b/extensions/typescript-language-features/web/src/serverHost.ts @@ -11,6 +11,7 @@ import { FileWatcherManager } from './fileWatcherManager'; import { Logger } from './logging'; import { PathMapper, looksLikeNodeModules, mapUri } from './pathMapper'; import { findArgument, hasArgument } from './util/args'; +import { URI } from 'vscode-uri'; type ServerHostWithImport = ts.server.ServerHost & { importPlugin(root: string, moduleName: string): Promise }; @@ -338,13 +339,24 @@ function createServerHost( // For module resolution only. `node_modules` is also automatically mapped // as if all node_modules-like paths are symlinked. function realpath(path: string): string { + if (path.startsWith('/^/')) { + // In memory file. No mapping needed + return path; + } + const isNm = looksLikeNodeModules(path) && !path.startsWith('/vscode-global-typings/'); // skip paths without .. or ./ or /. And things that look like node_modules if (!isNm && !path.match(/\.\.|\/\.|\.\//)) { return path; } - let uri = pathMapper.toResource(path); + let uri: URI; + try { + uri = pathMapper.toResource(path); + } catch { + return path; + } + if (isNm) { uri = mapUri(uri, 'vscode-node-modules'); } diff --git a/extensions/typescript-language-features/web/src/typingsInstaller/typingsInstaller.ts b/extensions/typescript-language-features/web/src/typingsInstaller/typingsInstaller.ts index 7c40993d6df..1f7790dc783 100644 --- a/extensions/typescript-language-features/web/src/typingsInstaller/typingsInstaller.ts +++ b/extensions/typescript-language-features/web/src/typingsInstaller/typingsInstaller.ts @@ -70,10 +70,12 @@ export class WebTypingsInstallerClient implements ts.server.ITypingsInstaller { break; case 'event::beginInstallTypes': case 'event::endInstallTypes': + // TODO(@zkat): maybe do something with this? + case 'action::watchTypingLocations': // Don't care. break; default: - throw new Error(`unexpected response: ${response}`); + throw new Error(`unexpected response: ${JSON.stringify(response)}`); } } diff --git a/extensions/typescript-language-features/yarn.lock b/extensions/typescript-language-features/yarn.lock deleted file mode 100644 index e43e95500ce..00000000000 --- a/extensions/typescript-language-features/yarn.lock +++ /dev/null @@ -1,194 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@microsoft/1ds-core-js@4.0.3", "@microsoft/1ds-core-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-4.0.3.tgz#c8a92c623745a9595e06558a866658480c33bdf9" - integrity sha512-FrxNLVAPsAvD7+l63TlNS/Kodvpct2WulpDSn1dI4Xuy0kF4E2H867kHdwL/iY1Bj3zA3FSy/jvE4+OcDws7ug== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/1ds-post-js@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-4.0.3.tgz#cfcb20bb23fb6215d3f0732f60f5b7df3e624f86" - integrity sha512-uewvmUtXKd7ttypiKQGdYI6i7UUpPkOznLayzIFrJ4r2xnG6jhPjpKRncHFXPQcM4XSWO3yf5PQ3xAbPq9t7ZQ== - dependencies: - "@microsoft/1ds-core-js" "4.0.3" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-channel-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.4.tgz#247b6fe2158fad9826cbcdf7304f885766b36624" - integrity sha512-6TlfExmErQ8Y+/ChbkyWl+jyt4wg3T6p7lwXDsUCB0LgZmlEWMaCUS0YlT73JCWmE8j7vxW8yUm0lgsgmHns3A== - dependencies: - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-common@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.4.tgz#c4aa53ba343f5b3c7fbf54cddd3c86a5bdcd95dc" - integrity sha512-r5gWaw/K9+tKfuo2GtDiDiKASgOkPOCrKW+wZzFvuR06uuwvWjbVQ6yW/YbnfuhRF5M65ksUiMi0eCMwEOGq7Q== - dependencies: - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-core-js@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.4.tgz#008308b786930d94a1de8a1fbb4af0351b74653e" - integrity sha512-anxy5kEkqBmVoEqJiJzaaXXA0wzqZi9U4zGd05xFJ04lWckP8dG3zyT3+GGdg7rDelqLTNGxndeYoFmDv63u1g== - dependencies: - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/applicationinsights-shims@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f" - integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@microsoft/applicationinsights-web-basic@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.4.tgz#9a23323276b4a5a0dc6a352e2de5d75e3c16b534" - integrity sha512-KfoxPlLlf0JT12ADb23C5iGye/yFouoMgHEKULxkSQcYY9SsW/8rVrqqvoYKAL+u215CZU2A8Kc8sR3ehEaPCQ== - dependencies: - "@microsoft/applicationinsights-channel-js" "3.0.4" - "@microsoft/applicationinsights-common" "3.0.4" - "@microsoft/applicationinsights-core-js" "3.0.4" - "@microsoft/applicationinsights-shims" "3.0.1" - "@microsoft/dynamicproto-js" "^2.0.2" - "@nevware21/ts-async" ">= 0.3.0 < 2.x" - "@nevware21/ts-utils" ">= 0.10.1 < 2.x" - -"@microsoft/dynamicproto-js@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6" - integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg== - dependencies: - "@nevware21/ts-utils" ">= 0.9.4 < 2.x" - -"@nevware21/ts-async@>= 0.3.0 < 2.x": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c" - integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA== - dependencies: - "@nevware21/ts-utils" ">= 0.10.0 < 2.x" - -"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.10.1 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7" - integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg== - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -"@types/semver@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" - integrity sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ== - -"@vscode/extension-telemetry@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.9.0.tgz#8c6c61e253ff304f46045f04edd60059b144417a" - integrity sha512-37RxGHXrs3GoXPgCUKQhghEu0gxs8j27RLjQwwtSf4WhPdJKz8UrqMYzpsXlliQ05zURYmtdGZst9C6+hfWXaQ== - dependencies: - "@microsoft/1ds-core-js" "^4.0.3" - "@microsoft/1ds-post-js" "^4.0.3" - "@microsoft/applicationinsights-web-basic" "^3.0.4" - -"@vscode/sync-api-client@^0.7.2": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@vscode/sync-api-client/-/sync-api-client-0.7.2.tgz#0644bff66a5eff636bcd8eb483d34796b9f90d2d" - integrity sha512-HQHz57RVKmR8sTEen1Y/T3r6mzDX7IaUJz/O2RJkn0Qu9ThvCsakLP0N+1iiwPnPfUfmNSwQXbSw8bEQFPcpYQ== - dependencies: - "@vscode/sync-api-common" "0.7.2" - vscode-uri "3.0.3" - -"@vscode/sync-api-common@0.7.2", "@vscode/sync-api-common@^0.7.2": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@vscode/sync-api-common/-/sync-api-common-0.7.2.tgz#705060ee6a0108c24e145e687613becdb4292b33" - integrity sha512-ne1XEeDIYA3mp4oo1QoF1fqFedd0Vf4ybMmLb9HixbTyXy/qwMNL2p6OjXjOsmx6w2q9eqzGA5W/OPRSJxTTIQ== - -"@vscode/sync-api-service@^0.7.3": - version "0.7.3" - resolved "https://registry.yarnpkg.com/@vscode/sync-api-service/-/sync-api-service-0.7.3.tgz#6cb7bd23c4a7378e4b92ca3638501a9be1937152" - integrity sha512-m2AmmfG4uzfjLMgWRHQ3xnBkdwCiUTO68vdw1XuzMsOb39Jwm9xr5bVVxwOFR9lPC0FfO1H6FUxBhZQvg7itPA== - dependencies: - "@vscode/sync-api-common" "0.7.2" - vscode-uri "3.0.3" - -"@vscode/ts-package-manager@^0.0.2": - version "0.0.2" - resolved "https://registry.yarnpkg.com/@vscode/ts-package-manager/-/ts-package-manager-0.0.2.tgz#d1cade5ff0d01da8c5b5b00bf79d80e7156771cf" - integrity sha512-cXPxGbPVTkEQI8mUiWYUwB6j3ga6M9i7yubUOCrjgZ01GeZPMSnaWRprfJ09uuy81wJjY2gfHgLsOgwrGvUBTw== - -jsonc-parser@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" - integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -semver@7.5.2: - version "7.5.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.2.tgz#5b851e66d1be07c1cdaf37dfc856f543325a2beb" - integrity sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ== - dependencies: - lru-cache "^6.0.0" - -tas-client@0.2.33: - version "0.2.33" - resolved "https://registry.yarnpkg.com/tas-client/-/tas-client-0.2.33.tgz#451bf114a8a64748030ce4068ab7d079958402e6" - integrity sha512-V+uqV66BOQnWxvI6HjDnE4VkInmYZUQ4dgB7gzaDyFyFSK1i1nF/j7DpS9UbQAgV9NaF1XpcyuavnM1qOeiEIg== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -vscode-tas-client@^0.1.84: - version "0.1.84" - resolved "https://registry.yarnpkg.com/vscode-tas-client/-/vscode-tas-client-0.1.84.tgz#906bdcfd8c9e1dc04321d6bc0335184f9119968e" - integrity sha512-rUTrUopV+70hvx1hW5ebdw1nd6djxubkLvVxjGdyD/r5v/wcVF41LIfiAtbm5qLZDtQdsMH1IaCuDoluoIa88w== - dependencies: - tas-client "0.2.33" - -vscode-uri@3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.3.tgz#a95c1ce2e6f41b7549f86279d19f47951e4f4d84" - integrity sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA== - -vscode-uri@^3.0.3: - version "3.0.7" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.7.tgz#6d19fef387ee6b46c479e5fb00870e15e58c1eb8" - integrity sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/extensions/vb/yarn.lock b/extensions/vb/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/vb/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/vscode-api-tests/package-lock.json b/extensions/vscode-api-tests/package-lock.json new file mode 100644 index 00000000000..cd90b33ca49 --- /dev/null +++ b/extensions/vscode-api-tests/package-lock.json @@ -0,0 +1,278 @@ +{ + "name": "vscode-api-tests", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vscode-api-tests", + "version": "0.0.1", + "license": "MIT", + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "20.x", + "@types/node-forge": "^1.3.11", + "node-forge": "^1.3.1", + "straightforward": "^4.2.2" + }, + "engines": { + "vscode": "^1.55.0" + } + }, + "node_modules/@types/mocha": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-forge": { + "version": "1.3.11", + "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz", + "integrity": "sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "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/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "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/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/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "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/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "dev": true, + "engines": { + "node": ">= 6.13.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/straightforward": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/straightforward/-/straightforward-4.2.2.tgz", + "integrity": "sha512-MxfuNnyTP4RPjadI3DkYIcNIp0DMXeDmAXY4/6QivU8lLIPGUqaS5VsEkaQ2QC+FICzc7QTb/lJPRIhGRKVuMA==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "yargs": "^17.6.2" + }, + "bin": { + "straightforward": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "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/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/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/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/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + } + } +} diff --git a/extensions/vscode-api-tests/package.json b/extensions/vscode-api-tests/package.json index 7e8b96839f4..8a1032fef2c 100644 --- a/extensions/vscode-api-tests/package.json +++ b/extensions/vscode-api-tests/package.json @@ -47,7 +47,6 @@ "telemetry", "terminalDataWriteEvent", "terminalDimensions", - "terminalShellIntegration", "testObserver", "textSearchProvider", "timeline", @@ -112,6 +111,13 @@ "farboo.get": { "type": "string", "default": "get-prop" + }, + "integration-test.http.proxy": { + "type": "string" + }, + "integration-test.http.proxyAuth": { + "type": "string", + "default": "get-prop" } } }, @@ -251,7 +257,8 @@ "@types/mocha": "^9.1.1", "@types/node": "20.x", "@types/node-forge": "^1.3.11", - "node-forge": "^1.3.1" + "node-forge": "^1.3.1", + "straightforward": "^4.2.2" }, "repository": { "type": "git", diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/chat.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/chat.test.ts index ca72f39feb8..2b1110c23bf 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/chat.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/chat.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import 'mocha'; import { ChatContext, ChatRequest, ChatResult, ChatVariableLevel, Disposable, Event, EventEmitter, chat, commands } from 'vscode'; -import { DeferredPromise, asPromise, assertNoRpc, closeAllEditors, disposeAll } from '../utils'; +import { DeferredPromise, asPromise, assertNoRpc, closeAllEditors, delay, disposeAll } from '../utils'; suite('chat', () => { @@ -36,7 +36,6 @@ suite('chat', () => { const participant = chat.createChatParticipant(id, (request, context, _progress, _token) => { emitter.fire({ request, context }); }); - participant.isDefault = true; disposables.push(participant); return emitter.event; } @@ -89,7 +88,6 @@ suite('chat', () => { const participant = chat.createChatParticipant('api-test.participant', (_request, _context, _progress, _token) => { return { metadata: { key: 'value' } }; }); - participant.isDefault = true; participant.followupProvider = { provideFollowups(result, _context, _token) { deferred.complete(result); @@ -123,4 +121,33 @@ suite('chat', () => { const request3 = await asPromise(onRequest2); assert.strictEqual(request3.context.history.length, 2); // request + response = 2 }); + + test('title provider is called for first request', async () => { + let calls = 0; + const deferred = new DeferredPromise(); + const participant = chat.createChatParticipant('api-test.participant', (_request, _context, _progress, _token) => { + return { metadata: { key: 'value' } }; + }); + participant.titleProvider = { + provideChatTitle(_context, _token) { + calls++; + deferred.complete(); + return 'title'; + } + }; + disposables.push(participant); + + await commands.executeCommand('workbench.action.chat.newChat'); + commands.executeCommand('workbench.action.chat.open', { query: '@participant /hello friend' }); + + // Wait for title provider to be called once + await deferred.p; + assert.strictEqual(calls, 1); + + commands.executeCommand('workbench.action.chat.open', { query: '@participant /hello friend' }); + await delay(500); + + // Title provider was not called again + assert.strictEqual(calls, 1); + }); }); diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.api.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.api.test.ts index f9d8d6a82db..e4489090017 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.api.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.api.test.ts @@ -18,6 +18,10 @@ async function openRandomNotebookDocument() { return vscode.workspace.openNotebookDocument(uri); } +async function openUntitledNotebookDocument(data?: vscode.NotebookData) { + return vscode.workspace.openNotebookDocument('notebookCoreTest', data); +} + export async function saveAllFilesAndCloseAll() { await saveAllEditors(); await closeAllEditors(); @@ -147,6 +151,7 @@ const apiTestSerializer: vscode.NotebookSerializer = { teardown(async function () { disposeAll(testDisposables); testDisposables.length = 0; + await revertAllDirty(); await saveAllFilesAndCloseAll(); }); @@ -188,6 +193,27 @@ const apiTestSerializer: vscode.NotebookSerializer = { assert.strictEqual(vscode.window.activeNotebookEditor!.notebook.uri.toString(), document.uri.toString()); }); + test('Opening an utitled notebook without content will only open the editor when shown.', async function () { + const document = await openUntitledNotebookDocument(); + + assert.strictEqual(vscode.window.activeNotebookEditor, undefined); + + // opening a cell-uri opens a notebook editor + await vscode.window.showNotebookDocument(document); + + assert.strictEqual(!!vscode.window.activeNotebookEditor, true); + assert.strictEqual(vscode.window.activeNotebookEditor!.notebook.uri.toString(), document.uri.toString()); + }); + + test('Opening an untitled notebook with content will open a dirty document.', async function () { + const language = 'python'; + const cell = new vscode.NotebookCellData(vscode.NotebookCellKind.Code, '', language); + const data = new vscode.NotebookData([cell]); + const doc = await vscode.workspace.openNotebookDocument('jupyter-notebook', data); + + assert.strictEqual(doc.isDirty, true); + }); + test('Cannot open notebook from cell-uri with vscode.open-command', async function () { const document = await openRandomNotebookDocument(); diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/proxy.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/proxy.test.ts index 60f100c7c1f..ccda85b442a 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/proxy.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/proxy.test.ts @@ -5,12 +5,14 @@ import * as https from 'https'; import 'mocha'; -import { assertNoRpc } from '../utils'; +import { assertNoRpc, delay } from '../utils'; import { pki } from 'node-forge'; import { AddressInfo } from 'net'; import { resetCaches } from '@vscode/proxy-agent'; +import * as vscode from 'vscode'; +import { middleware, Straightforward } from 'straightforward'; -suite('vscode API - network proxy support', () => { +(vscode.env.uiKind === vscode.UIKind.Web ? suite.skip : suite)('vscode API - network proxy support', () => { teardown(async function () { assertNoRpc(); @@ -74,4 +76,76 @@ suite('vscode API - network proxy support', () => { server.close(); } }); + + test('basic auth', async () => { + const url = 'https://example.com'; // Need to use non-local URL because local URLs are excepted from proxying. + const user = 'testuser'; + const pass = 'testpassword'; + + const sf = new Straightforward(); + let authEnabled = false; + const auth = middleware.auth({ user, pass }); + sf.onConnect.use(async (context, next) => { + if (authEnabled) { + return auth(context, next); + } + next(); + }); + sf.onConnect.use(({ clientSocket }) => { + // Shortcircuit the request. + if (authEnabled) { + clientSocket.end('HTTP/1.1 204\r\n\r\n'); + } else { + clientSocket.end('HTTP/1.1 418\r\n\r\n'); + } + }); + const proxyListen = sf.listen(0); + + try { + await proxyListen; + const proxyPort = (sf.server.address() as AddressInfo).port; + + await vscode.workspace.getConfiguration().update('integration-test.http.proxy', `PROXY 127.0.0.1:${proxyPort}`, vscode.ConfigurationTarget.Global); + await delay(1000); // Wait for the configuration change to propagate. + await new Promise((resolve, reject) => { + https.get(url, res => { + if (res.statusCode === 418) { + resolve(); + } else { + reject(new Error(`Unexpected status code (expected 418): ${res.statusCode}`)); + } + }) + .on('error', reject); + }); + + authEnabled = true; + await new Promise((resolve, reject) => { + https.get(url, res => { + if (res.statusCode === 407) { + resolve(); + } else { + reject(new Error(`Unexpected status code (expected 407): ${res.statusCode}`)); + } + }) + .on('error', reject); + }); + + await vscode.workspace.getConfiguration().update('integration-test.http.proxyAuth', `${user}:${pass}`, vscode.ConfigurationTarget.Global); + await delay(1000); // Wait for the configuration change to propagate. + await new Promise((resolve, reject) => { + https.get(url, res => { + if (res.statusCode === 204) { + resolve(); + } else { + reject(new Error(`Unexpected status code (expected 204): ${res.statusCode}`)); + } + }) + .on('error', reject); + }); + } finally { + sf.close(); + await vscode.workspace.getConfiguration().update('integration-test.http.proxy', undefined, vscode.ConfigurationTarget.Global); + await vscode.workspace.getConfiguration().update('integration-test.http.proxyAuth', undefined, vscode.ConfigurationTarget.Global); + } + }); }); diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/terminal.shellIntegration.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/terminal.shellIntegration.test.ts index a5a83c8be45..ac6287c2f35 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/terminal.shellIntegration.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/terminal.shellIntegration.test.ts @@ -10,7 +10,8 @@ import { assertNoRpc } from '../utils'; // Terminal integration tests are disabled on web https://github.com/microsoft/vscode/issues/92826 // Windows images will often not have functional shell integration -(env.uiKind === UIKind.Web || platform() === 'win32' ? suite.skip : suite)('vscode API - Terminal.shellIntegration', () => { +// TODO: Linux https://github.com/microsoft/vscode/issues/221399 +(env.uiKind === UIKind.Web || platform() === 'win32' || platform() === 'linux' ? suite.skip : suite)('vscode API - Terminal.shellIntegration', () => { const disposables: Disposable[] = []; suiteSetup(async () => { diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts index 2eb115761d1..e5d9af5791e 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts @@ -619,6 +619,7 @@ suite('vscode API - workspace', () => { test('findFiles2, exclude', () => { return vscode.workspace.findFiles2('**/image.png', { exclude: '**/sub/**' }).then((res) => { + res.forEach(r => console.log(r.toString())); assert.strictEqual(res.length, 1); }); }); diff --git a/extensions/vscode-api-tests/yarn.lock b/extensions/vscode-api-tests/yarn.lock deleted file mode 100644 index 33a2f511927..00000000000 --- a/extensions/vscode-api-tests/yarn.lock +++ /dev/null @@ -1,39 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/mocha@^9.1.1": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" - integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== - -"@types/node-forge@^1.3.11": - version "1.3.11" - resolved "https://registry.yarnpkg.com/@types/node-forge/-/node-forge-1.3.11.tgz#0972ea538ddb0f4d9c2fa0ec5db5724773a604da" - integrity sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ== - dependencies: - "@types/node" "*" - -"@types/node@*": - version "20.14.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.6.tgz#f3c19ffc98c2220e18de259bb172dd4d892a6075" - integrity sha512-JbA0XIJPL1IiNnU7PFxDXyfAwcwVVrOoqyzzyQTyMeVhBzkJVMSkC1LlVsRQ2lpqiY4n6Bb9oCS6lzDKVQxbZw== - dependencies: - undici-types "~5.26.4" - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -node-forge@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" - integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/extensions/vscode-colorize-tests/package-lock.json b/extensions/vscode-colorize-tests/package-lock.json new file mode 100644 index 00000000000..4011d73bcac --- /dev/null +++ b/extensions/vscode-colorize-tests/package-lock.json @@ -0,0 +1,42 @@ +{ + "name": "vscode-colorize-tests", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vscode-colorize-tests", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "jsonc-parser": "^3.2.0" + }, + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "*" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/extensions/vscode-colorize-tests/test/colorize-fixtures/issue-224862.yaml b/extensions/vscode-colorize-tests/test/colorize-fixtures/issue-224862.yaml new file mode 100644 index 00000000000..b807db09531 --- /dev/null +++ b/extensions/vscode-colorize-tests/test/colorize-fixtures/issue-224862.yaml @@ -0,0 +1,9 @@ +--- +foo: 1 +--- + +This is highlighted as a YAML string + +# This is highlighted as a YAML comment + +This is highlighted as a YAML error diff --git a/extensions/vscode-colorize-tests/test/colorize-fixtures/test.bat b/extensions/vscode-colorize-tests/test/colorize-fixtures/test.bat index 3e215fc5efc..91d454aa178 100644 --- a/extensions/vscode-colorize-tests/test/colorize-fixtures/test.bat +++ b/extensions/vscode-colorize-tests/test/colorize-fixtures/test.bat @@ -6,7 +6,7 @@ title VSCode Dev pushd %~dp0\.. :: Node modules -if not exist node_modules call .\scripts\npm.bat install +if not exist node_modules call npm i :: Get electron node .\node_modules\gulp\bin\gulp.js electron @@ -21,4 +21,4 @@ call echo %%LINE:rem +=%% popd -endlocal \ No newline at end of file +endlocal diff --git a/extensions/vscode-colorize-tests/test/colorize-fixtures/test.sh b/extensions/vscode-colorize-tests/test/colorize-fixtures/test.sh index 50751c1e4a7..d08aa71909e 100644 --- a/extensions/vscode-colorize-tests/test/colorize-fixtures/test.sh +++ b/extensions/vscode-colorize-tests/test/colorize-fixtures/test.sh @@ -19,7 +19,7 @@ function code() { cd $ROOT # Node modules - test -d node_modules || ./scripts/npm.sh install + test -d node_modules || npm i # Configuration export NODE_ENV=development diff --git a/extensions/vscode-colorize-tests/test/colorize-results/issue-1550_yaml.json b/extensions/vscode-colorize-tests/test/colorize-results/issue-1550_yaml.json index dac84162b3c..cc1450808af 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/issue-1550_yaml.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/issue-1550_yaml.json @@ -1,7 +1,7 @@ [ { "c": "test1", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -15,7 +15,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -29,7 +29,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -43,7 +43,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -57,7 +57,7 @@ }, { "c": "dsd", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -71,7 +71,7 @@ }, { "c": "test2", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -85,7 +85,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -99,7 +99,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -113,7 +113,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -127,7 +127,7 @@ }, { "c": "abc-def", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -141,7 +141,7 @@ }, { "c": "test-3", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -155,7 +155,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -169,7 +169,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -183,7 +183,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -197,7 +197,7 @@ }, { "c": "abcdef", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -211,7 +211,7 @@ }, { "c": "test-4", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -225,7 +225,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -239,7 +239,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -253,7 +253,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -267,7 +267,7 @@ }, { "c": "abc-def", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", diff --git a/extensions/vscode-colorize-tests/test/colorize-results/issue-224862_yaml.json b/extensions/vscode-colorize-tests/test/colorize-results/issue-224862_yaml.json new file mode 100644 index 00000000000..f79882e54e4 --- /dev/null +++ b/extensions/vscode-colorize-tests/test/colorize-results/issue-224862_yaml.json @@ -0,0 +1,310 @@ +[ + { + "c": "---", + "t": "source.yaml meta.stream.yaml meta.document.yaml entity.other.document.begin.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "foo", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6", + "dark_modern": "entity.name.tag: #569CD6", + "hc_light": "entity.name.tag: #0F4A85", + "light_modern": "entity.name.tag: #800000" + } + }, + { + "c": ":", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "1", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml constant.numeric.integer.decimal.yaml", + "r": { + "dark_plus": "constant.numeric: #B5CEA8", + "light_plus": "constant.numeric: #098658", + "dark_vs": "constant.numeric: #B5CEA8", + "light_vs": "constant.numeric: #098658", + "hc_black": "constant.numeric: #B5CEA8", + "dark_modern": "constant.numeric: #B5CEA8", + "hc_light": "constant.numeric: #096D48", + "light_modern": "constant.numeric: #098658" + } + }, + { + "c": "---", + "t": "source.yaml meta.stream.yaml meta.document.yaml entity.other.document.begin.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "This is highlighted as a YAML string", + "t": "source.yaml meta.stream.yaml meta.document.yaml string.unquoted.plain.out.yaml", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.unquoted.plain.out.yaml: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.unquoted.plain.out.yaml: #0000FF", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string.unquoted.plain.out.yaml: #0F4A85", + "light_modern": "string.unquoted.plain.out.yaml: #0000FF" + } + }, + { + "c": "#", + "t": "source.yaml meta.stream.yaml meta.document.yaml comment.line.number-sign.yaml punctuation.definition.comment.yaml", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": " This is highlighted as a YAML comment", + "t": "source.yaml meta.stream.yaml meta.document.yaml comment.line.number-sign.yaml", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668", + "dark_modern": "comment: #6A9955", + "hc_light": "comment: #515151", + "light_modern": "comment: #008000" + } + }, + { + "c": "This", + "t": "source.yaml meta.stream.yaml meta.document.yaml invalid.illegal.unrecognized.yaml", + "r": { + "dark_plus": "invalid: #F44747", + "light_plus": "invalid: #CD3131", + "dark_vs": "invalid: #F44747", + "light_vs": "invalid: #CD3131", + "hc_black": "invalid: #F44747", + "dark_modern": "invalid: #F44747", + "hc_light": "invalid: #B5200D", + "light_modern": "invalid: #CD3131" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml punctuation.whitespace.separator.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "is", + "t": "source.yaml meta.stream.yaml meta.document.yaml invalid.illegal.unrecognized.yaml", + "r": { + "dark_plus": "invalid: #F44747", + "light_plus": "invalid: #CD3131", + "dark_vs": "invalid: #F44747", + "light_vs": "invalid: #CD3131", + "hc_black": "invalid: #F44747", + "dark_modern": "invalid: #F44747", + "hc_light": "invalid: #B5200D", + "light_modern": "invalid: #CD3131" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml punctuation.whitespace.separator.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "highlighted", + "t": "source.yaml meta.stream.yaml meta.document.yaml invalid.illegal.unrecognized.yaml", + "r": { + "dark_plus": "invalid: #F44747", + "light_plus": "invalid: #CD3131", + "dark_vs": "invalid: #F44747", + "light_vs": "invalid: #CD3131", + "hc_black": "invalid: #F44747", + "dark_modern": "invalid: #F44747", + "hc_light": "invalid: #B5200D", + "light_modern": "invalid: #CD3131" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml punctuation.whitespace.separator.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "as", + "t": "source.yaml meta.stream.yaml meta.document.yaml invalid.illegal.unrecognized.yaml", + "r": { + "dark_plus": "invalid: #F44747", + "light_plus": "invalid: #CD3131", + "dark_vs": "invalid: #F44747", + "light_vs": "invalid: #CD3131", + "hc_black": "invalid: #F44747", + "dark_modern": "invalid: #F44747", + "hc_light": "invalid: #B5200D", + "light_modern": "invalid: #CD3131" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml punctuation.whitespace.separator.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "a", + "t": "source.yaml meta.stream.yaml meta.document.yaml invalid.illegal.unrecognized.yaml", + "r": { + "dark_plus": "invalid: #F44747", + "light_plus": "invalid: #CD3131", + "dark_vs": "invalid: #F44747", + "light_vs": "invalid: #CD3131", + "hc_black": "invalid: #F44747", + "dark_modern": "invalid: #F44747", + "hc_light": "invalid: #B5200D", + "light_modern": "invalid: #CD3131" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml punctuation.whitespace.separator.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "YAML", + "t": "source.yaml meta.stream.yaml meta.document.yaml invalid.illegal.unrecognized.yaml", + "r": { + "dark_plus": "invalid: #F44747", + "light_plus": "invalid: #CD3131", + "dark_vs": "invalid: #F44747", + "light_vs": "invalid: #CD3131", + "hc_black": "invalid: #F44747", + "dark_modern": "invalid: #F44747", + "hc_light": "invalid: #B5200D", + "light_modern": "invalid: #CD3131" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml punctuation.whitespace.separator.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": "error", + "t": "source.yaml meta.stream.yaml meta.document.yaml invalid.illegal.unrecognized.yaml", + "r": { + "dark_plus": "invalid: #F44747", + "light_plus": "invalid: #CD3131", + "dark_vs": "invalid: #F44747", + "light_vs": "invalid: #CD3131", + "hc_black": "invalid: #F44747", + "dark_modern": "invalid: #F44747", + "hc_light": "invalid: #B5200D", + "light_modern": "invalid: #CD3131" + } + } +] \ No newline at end of file diff --git a/extensions/vscode-colorize-tests/test/colorize-results/issue-4008_yaml.json b/extensions/vscode-colorize-tests/test/colorize-results/issue-4008_yaml.json index e1aa82e9ca3..c8c2d57d903 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/issue-4008_yaml.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/issue-4008_yaml.json @@ -1,7 +1,7 @@ [ { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -15,7 +15,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -29,7 +29,7 @@ }, { "c": "blue", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -43,7 +43,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -57,7 +57,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -71,7 +71,7 @@ }, { "c": "a=\"brown,not_brown\"", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -85,7 +85,7 @@ }, { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -99,7 +99,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -113,7 +113,7 @@ }, { "c": "not_blue", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -127,7 +127,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -141,7 +141,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -155,7 +155,7 @@ }, { "c": "foo", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -169,7 +169,7 @@ }, { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -183,7 +183,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -197,7 +197,7 @@ }, { "c": "blue", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -211,7 +211,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -225,7 +225,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -239,7 +239,7 @@ }, { "c": "foo=\"}\"", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -253,7 +253,7 @@ }, { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -267,7 +267,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -281,7 +281,7 @@ }, { "c": "not_blue", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -295,7 +295,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -309,7 +309,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -323,7 +323,7 @@ }, { "c": "1", - "t": "source.yaml constant.numeric.integer.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml constant.numeric.integer.decimal.yaml", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #098658", diff --git a/extensions/vscode-colorize-tests/test/colorize-results/issue-6303_yaml.json b/extensions/vscode-colorize-tests/test/colorize-results/issue-6303_yaml.json index 2066b677e2c..e5267d62494 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/issue-6303_yaml.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/issue-6303_yaml.json @@ -1,7 +1,7 @@ [ { "c": "swagger", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -15,7 +15,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -29,7 +29,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -43,7 +43,7 @@ }, { "c": "'", - "t": "source.yaml string.quoted.single.yaml punctuation.definition.string.begin.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml string.quoted.single.yaml punctuation.definition.string.begin.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.quoted.single.yaml: #0000FF", @@ -57,7 +57,7 @@ }, { "c": "2.0", - "t": "source.yaml string.quoted.single.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml string.quoted.single.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.quoted.single.yaml: #0000FF", @@ -71,7 +71,7 @@ }, { "c": "'", - "t": "source.yaml string.quoted.single.yaml punctuation.definition.string.end.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml string.quoted.single.yaml punctuation.definition.string.end.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.quoted.single.yaml: #0000FF", @@ -85,7 +85,7 @@ }, { "c": "info", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -99,7 +99,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -113,7 +113,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -127,7 +127,7 @@ }, { "c": "description", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -141,7 +141,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -155,7 +155,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -169,7 +169,7 @@ }, { "c": "'", - "t": "source.yaml string.quoted.single.yaml punctuation.definition.string.begin.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.quoted.single.yaml punctuation.definition.string.begin.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.quoted.single.yaml: #0000FF", @@ -183,7 +183,7 @@ }, { "c": "The API Management Service API defines an updated and refined version", - "t": "source.yaml string.quoted.single.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.quoted.single.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.quoted.single.yaml: #0000FF", @@ -196,8 +196,64 @@ } }, { - "c": " of the concepts currently known as Developer, APP, and API Product in Edge. Of", - "t": "source.yaml string.quoted.single.yaml", + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.quoted.single.yaml punctuation.whitespace.separator.yaml", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.yaml: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.yaml: #0000FF", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string.quoted.single.yaml: #0F4A85", + "light_modern": "string.quoted.single.yaml: #0000FF" + } + }, + { + "c": "of the concepts currently known as Developer, APP, and API Product in Edge. Of", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.quoted.single.yaml", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string.quoted.single.yaml: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.quoted.single.yaml: #0000FF", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string.quoted.single.yaml: #0F4A85", + "light_modern": "string.quoted.single.yaml: #0000FF" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.quoted.single.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.quoted.single.yaml: #0000FF", @@ -210,8 +266,8 @@ } }, { - "c": " note is the introduction of the API concept, missing previously from Edge", - "t": "source.yaml string.quoted.single.yaml", + "c": "note is the introduction of the API concept, missing previously from Edge", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.quoted.single.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.quoted.single.yaml: #0000FF", @@ -224,8 +280,22 @@ } }, { - "c": " ", - "t": "source.yaml string.quoted.single.yaml", + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.quoted.single.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.quoted.single.yaml: #0000FF", @@ -239,7 +309,7 @@ }, { "c": "'", - "t": "source.yaml string.quoted.single.yaml punctuation.definition.string.end.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.quoted.single.yaml punctuation.definition.string.end.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.quoted.single.yaml: #0000FF", @@ -253,7 +323,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -267,7 +337,7 @@ }, { "c": "title", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -281,7 +351,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -295,7 +365,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -309,7 +379,7 @@ }, { "c": "API Management Service API", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -323,7 +393,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -337,7 +407,7 @@ }, { "c": "version", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -351,7 +421,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -365,7 +435,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -379,7 +449,7 @@ }, { "c": "initial", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", diff --git a/extensions/vscode-colorize-tests/test/colorize-results/test-cssvariables_less.json b/extensions/vscode-colorize-tests/test/colorize-results/test-cssvariables_less.json index 856f013541b..3381f6448d0 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/test-cssvariables_less.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/test-cssvariables_less.json @@ -686,7 +686,7 @@ } }, { - "c": " 5px", + "c": " ", "t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less meta.function-call.less", "r": { "dark_plus": "default: #D4D4D4", @@ -699,6 +699,34 @@ "light_modern": "default: #3B3B3B" } }, + { + "c": "5", + "t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less meta.function-call.less constant.numeric.less", + "r": { + "dark_plus": "constant.numeric: #B5CEA8", + "light_plus": "constant.numeric: #098658", + "dark_vs": "constant.numeric: #B5CEA8", + "light_vs": "constant.numeric: #098658", + "hc_black": "constant.numeric: #B5CEA8", + "dark_modern": "constant.numeric: #B5CEA8", + "hc_light": "constant.numeric: #096D48", + "light_modern": "constant.numeric: #098658" + } + }, + { + "c": "px", + "t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less meta.function-call.less constant.numeric.less keyword.other.unit.less", + "r": { + "dark_plus": "keyword.other.unit: #B5CEA8", + "light_plus": "keyword.other.unit: #098658", + "dark_vs": "keyword.other.unit: #B5CEA8", + "light_vs": "keyword.other.unit: #098658", + "hc_black": "keyword.other.unit: #B5CEA8", + "dark_modern": "keyword.other.unit: #B5CEA8", + "hc_light": "keyword.other.unit: #096D48", + "light_modern": "keyword.other.unit: #098658" + } + }, { "c": ")", "t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less meta.function-call.less punctuation.definition.group.end.less", diff --git a/extensions/vscode-colorize-tests/test/colorize-results/test_bat.json b/extensions/vscode-colorize-tests/test/colorize-results/test_bat.json index db82378582b..853018d8458 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/test_bat.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/test_bat.json @@ -294,7 +294,7 @@ } }, { - "c": " .\\scripts\\npm.bat install", + "c": " npm i", "t": "source.batchfile", "r": { "dark_plus": "default: #D4D4D4", @@ -685,4 +685,4 @@ "light_modern": "keyword: #0000FF" } } -] \ No newline at end of file +] diff --git a/extensions/vscode-colorize-tests/test/colorize-results/test_less.json b/extensions/vscode-colorize-tests/test/colorize-results/test_less.json index 08d8b9f4fb5..a66224dd9e6 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/test_less.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/test_less.json @@ -897,16 +897,16 @@ }, { "c": " ", - "t": "source.css.less meta.property-list.less meta.property-value.less", + "t": "source.css.less meta.property-list.less meta.property-value.less variable.other.readwrite.less", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF", - "dark_modern": "default: #CCCCCC", - "hc_light": "default: #292929", - "light_modern": "default: #3B3B3B" + "dark_plus": "source.css variable: #9CDCFE", + "light_plus": "source.css variable: #E50000", + "dark_vs": "source.css variable: #9CDCFE", + "light_vs": "source.css variable: #E50000", + "hc_black": "source.css variable: #D4D4D4", + "dark_modern": "source.css variable: #9CDCFE", + "hc_light": "source.css variable: #264F78", + "light_modern": "source.css variable: #E50000" } }, { diff --git a/extensions/vscode-colorize-tests/test/colorize-results/test_sh.json b/extensions/vscode-colorize-tests/test/colorize-results/test_sh.json index 8f1cb4c388b..0dde2e0748e 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/test_sh.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/test_sh.json @@ -2380,7 +2380,7 @@ } }, { - "c": "./scripts/npm.sh", + "c": "npm", "t": "source.shell meta.function.shell meta.function.body.shell meta.statement.shell meta.statement.command.shell meta.statement.command.name.shell entity.name.function.call.shell entity.name.command.shell", "r": { "dark_plus": "entity.name.function: #DCDCAA", @@ -2408,7 +2408,7 @@ } }, { - "c": "install", + "c": "i", "t": "source.shell meta.function.shell meta.function.body.shell meta.statement.shell meta.statement.command.shell meta.argument.shell string.unquoted.argument.shell", "r": { "dark_plus": "string: #CE9178", @@ -3345,4 +3345,4 @@ "light_modern": "string: #A31515" } } -] \ No newline at end of file +] diff --git a/extensions/vscode-colorize-tests/test/colorize-results/test_yaml.json b/extensions/vscode-colorize-tests/test/colorize-results/test_yaml.json index 407cc7c7a1a..0908e19e3ea 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/test_yaml.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/test_yaml.json @@ -1,7 +1,7 @@ [ { "c": "#", - "t": "source.yaml comment.line.number-sign.yaml punctuation.definition.comment.yaml", + "t": "source.yaml meta.stream.yaml comment.line.number-sign.yaml punctuation.definition.comment.yaml", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -15,7 +15,7 @@ }, { "c": " sequencer protocols for Laser eye surgery", - "t": "source.yaml comment.line.number-sign.yaml", + "t": "source.yaml meta.stream.yaml comment.line.number-sign.yaml", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -29,7 +29,7 @@ }, { "c": "---", - "t": "source.yaml entity.other.document.begin.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml entity.other.document.begin.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -43,7 +43,7 @@ }, { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -57,7 +57,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -71,7 +71,7 @@ }, { "c": "step", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -85,7 +85,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -99,7 +99,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -113,7 +113,7 @@ }, { "c": "&", - "t": "source.yaml meta.property.yaml keyword.control.property.anchor.yaml punctuation.definition.anchor.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml keyword.control.flow.anchor.yaml punctuation.definition.anchor.yaml", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -127,21 +127,21 @@ }, { "c": "id001", - "t": "source.yaml meta.property.yaml entity.name.type.anchor.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml keyword.control.flow.anchor.yaml variable.other.anchor.yaml", "r": { - "dark_plus": "entity.name.type: #4EC9B0", - "light_plus": "entity.name.type: #267F99", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "entity.name.type: #4EC9B0", - "dark_modern": "entity.name.type: #4EC9B0", - "hc_light": "entity.name.type: #185E73", - "light_modern": "entity.name.type: #267F99" + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "keyword.control: #569CD6", + "light_vs": "keyword.control: #0000FF", + "hc_black": "variable: #9CDCFE", + "dark_modern": "variable: #9CDCFE", + "hc_light": "variable: #001080", + "light_modern": "variable: #001080" } }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -155,7 +155,7 @@ }, { "c": "#", - "t": "source.yaml comment.line.number-sign.yaml punctuation.definition.comment.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml comment.line.number-sign.yaml punctuation.definition.comment.yaml", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -169,7 +169,7 @@ }, { "c": " defines anchor label &id001", - "t": "source.yaml comment.line.number-sign.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml comment.line.number-sign.yaml", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -182,8 +182,22 @@ } }, { - "c": " ", - "t": "source.yaml", + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -197,7 +211,7 @@ }, { "c": "instrument", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -211,7 +225,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -225,7 +239,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -239,7 +253,7 @@ }, { "c": "Lasik 2000", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -252,8 +266,22 @@ } }, { - "c": " ", - "t": "source.yaml", + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -267,7 +295,7 @@ }, { "c": "pulseEnergy", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -281,7 +309,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -295,7 +323,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -309,7 +337,7 @@ }, { "c": "5.4", - "t": "source.yaml constant.numeric.float.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml constant.numeric.float.yaml", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #098658", @@ -322,8 +350,22 @@ } }, { - "c": " ", - "t": "source.yaml", + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF", + "dark_modern": "default: #CCCCCC", + "hc_light": "default: #292929", + "light_modern": "default: #3B3B3B" + } + }, + { + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -337,7 +379,7 @@ }, { "c": "spotSize", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -351,7 +393,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -365,7 +407,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -379,7 +421,7 @@ }, { "c": "1mm", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -393,7 +435,7 @@ }, { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -407,7 +449,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -421,7 +463,7 @@ }, { "c": "step", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -435,7 +477,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -449,7 +491,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -463,7 +505,7 @@ }, { "c": "*", - "t": "source.yaml keyword.control.flow.alias.yaml punctuation.definition.alias.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml keyword.control.flow.alias.yaml punctuation.definition.alias.yaml", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -477,12 +519,12 @@ }, { "c": "id001", - "t": "source.yaml variable.other.alias.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml keyword.control.flow.alias.yaml variable.other.alias.yaml", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "keyword.control: #569CD6", + "light_vs": "keyword.control: #0000FF", "hc_black": "variable: #9CDCFE", "dark_modern": "variable: #9CDCFE", "hc_light": "variable: #001080", @@ -491,7 +533,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -505,7 +547,7 @@ }, { "c": "#", - "t": "source.yaml comment.line.number-sign.yaml punctuation.definition.comment.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml comment.line.number-sign.yaml punctuation.definition.comment.yaml", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -519,7 +561,7 @@ }, { "c": " refers to the first step (with anchor &id001)", - "t": "source.yaml comment.line.number-sign.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml comment.line.number-sign.yaml", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -533,7 +575,7 @@ }, { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -547,7 +589,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -561,7 +603,7 @@ }, { "c": "step", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -575,7 +617,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -589,7 +631,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -603,7 +645,7 @@ }, { "c": "*", - "t": "source.yaml keyword.control.flow.alias.yaml punctuation.definition.alias.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml keyword.control.flow.alias.yaml punctuation.definition.alias.yaml", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -617,12 +659,12 @@ }, { "c": "id001", - "t": "source.yaml variable.other.alias.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml keyword.control.flow.alias.yaml variable.other.alias.yaml", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "keyword.control: #569CD6", + "light_vs": "keyword.control: #0000FF", "hc_black": "variable: #9CDCFE", "dark_modern": "variable: #9CDCFE", "hc_light": "variable: #001080", @@ -630,8 +672,8 @@ } }, { - "c": " ", - "t": "source.yaml", + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -644,22 +686,8 @@ } }, { - "c": "spotSize", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", - "r": { - "dark_plus": "entity.name.tag: #569CD6", - "light_plus": "entity.name.tag: #800000", - "dark_vs": "entity.name.tag: #569CD6", - "light_vs": "entity.name.tag: #800000", - "hc_black": "entity.name.tag: #569CD6", - "dark_modern": "entity.name.tag: #569CD6", - "hc_light": "entity.name.tag: #0F4A85", - "light_modern": "entity.name.tag: #800000" - } - }, - { - "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "c": " ", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -671,9 +699,23 @@ "light_modern": "default: #3B3B3B" } }, + { + "c": "spotSize:", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml invalid.illegal.unrecognized.yaml", + "r": { + "dark_plus": "invalid: #F44747", + "light_plus": "invalid: #CD3131", + "dark_vs": "invalid: #F44747", + "light_vs": "invalid: #CD3131", + "hc_black": "invalid: #F44747", + "dark_modern": "invalid: #F44747", + "hc_light": "invalid: #B5200D", + "light_modern": "invalid: #CD3131" + } + }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -687,7 +729,7 @@ }, { "c": "2mm", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -701,21 +743,21 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml punctuation.whitespace.separator.yaml", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF", - "dark_modern": "default: #CCCCCC", - "hc_light": "default: #292929", - "light_modern": "default: #3B3B3B" + "dark_plus": "string: #CE9178", + "light_plus": "string.unquoted.plain.out.yaml: #0000FF", + "dark_vs": "string: #CE9178", + "light_vs": "string.unquoted.plain.out.yaml: #0000FF", + "hc_black": "string: #CE9178", + "dark_modern": "string: #CE9178", + "hc_light": "string.unquoted.plain.out.yaml: #0F4A85", + "light_modern": "string.unquoted.plain.out.yaml: #0000FF" } }, { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -729,7 +771,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -743,7 +785,7 @@ }, { "c": "step", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -757,7 +799,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -771,7 +813,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -785,7 +827,7 @@ }, { "c": "*", - "t": "source.yaml keyword.control.flow.alias.yaml punctuation.definition.alias.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml keyword.control.flow.alias.yaml punctuation.definition.alias.yaml", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -799,12 +841,12 @@ }, { "c": "id002", - "t": "source.yaml variable.other.alias.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml keyword.control.flow.alias.yaml variable.other.alias.yaml", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "keyword.control: #569CD6", + "light_vs": "keyword.control: #0000FF", "hc_black": "variable: #9CDCFE", "dark_modern": "variable: #9CDCFE", "hc_light": "variable: #001080", @@ -813,7 +855,7 @@ }, { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -827,7 +869,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -841,7 +883,7 @@ }, { "c": "{", - "t": "source.yaml meta.flow-mapping.yaml punctuation.definition.mapping.begin.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml punctuation.definition.mapping.begin.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -855,7 +897,7 @@ }, { "c": "name", - "t": "source.yaml meta.flow-mapping.yaml meta.flow-pair.key.yaml string.unquoted.plain.in.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml meta.flow.map.implicit.yaml meta.flow.map.key.yaml string.unquoted.plain.in.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -869,7 +911,7 @@ }, { "c": ":", - "t": "source.yaml meta.flow-mapping.yaml meta.flow-pair.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml meta.flow.map.implicit.yaml meta.flow.pair.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -883,7 +925,7 @@ }, { "c": " ", - "t": "source.yaml meta.flow-mapping.yaml meta.flow-pair.yaml meta.flow-pair.value.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml meta.flow.map.implicit.yaml meta.flow.pair.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -897,7 +939,7 @@ }, { "c": "John Smith", - "t": "source.yaml meta.flow-mapping.yaml meta.flow-pair.yaml meta.flow-pair.value.yaml string.unquoted.plain.in.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml meta.flow.map.implicit.yaml meta.flow.pair.value.yaml string.unquoted.plain.in.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.in.yaml: #0000FF", @@ -911,7 +953,7 @@ }, { "c": ",", - "t": "source.yaml meta.flow-mapping.yaml punctuation.separator.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml punctuation.separator.mapping.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -925,7 +967,7 @@ }, { "c": " ", - "t": "source.yaml meta.flow-mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -939,7 +981,7 @@ }, { "c": "age", - "t": "source.yaml meta.flow-mapping.yaml meta.flow-pair.key.yaml string.unquoted.plain.in.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml meta.flow.map.implicit.yaml meta.flow.map.key.yaml string.unquoted.plain.in.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -953,7 +995,7 @@ }, { "c": ":", - "t": "source.yaml meta.flow-mapping.yaml meta.flow-pair.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml meta.flow.map.implicit.yaml meta.flow.pair.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -967,7 +1009,7 @@ }, { "c": " ", - "t": "source.yaml meta.flow-mapping.yaml meta.flow-pair.yaml meta.flow-pair.value.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml meta.flow.map.implicit.yaml meta.flow.pair.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -981,7 +1023,7 @@ }, { "c": "33", - "t": "source.yaml meta.flow-mapping.yaml meta.flow-pair.yaml meta.flow-pair.value.yaml constant.numeric.integer.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml meta.flow.map.implicit.yaml meta.flow.pair.value.yaml string.unquoted.plain.in.yaml constant.numeric.integer.decimal.yaml", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #098658", @@ -995,7 +1037,7 @@ }, { "c": "}", - "t": "source.yaml meta.flow-mapping.yaml punctuation.definition.mapping.end.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.flow.mapping.yaml punctuation.definition.mapping.end.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1009,7 +1051,7 @@ }, { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1023,7 +1065,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1037,7 +1079,7 @@ }, { "c": "name", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -1051,7 +1093,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1065,7 +1107,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1079,7 +1121,7 @@ }, { "c": "Mary Smith", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -1093,7 +1135,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1107,7 +1149,7 @@ }, { "c": "age", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -1121,7 +1163,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1135,7 +1177,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1149,7 +1191,7 @@ }, { "c": "27", - "t": "source.yaml constant.numeric.integer.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml string.unquoted.plain.out.yaml constant.numeric.integer.decimal.yaml", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #098658", @@ -1163,7 +1205,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1176,8 +1218,22 @@ } }, { - "c": "men", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "c": "m", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml invalid.illegal.expected-indentation.yaml", + "r": { + "dark_plus": "invalid: #F44747", + "light_plus": "invalid: #CD3131", + "dark_vs": "invalid: #F44747", + "light_vs": "invalid: #CD3131", + "hc_black": "invalid: #F44747", + "dark_modern": "invalid: #F44747", + "hc_light": "invalid: #B5200D", + "light_modern": "invalid: #CD3131" + } + }, + { + "c": "en", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -1191,7 +1247,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1205,7 +1261,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1219,7 +1275,7 @@ }, { "c": "[", - "t": "source.yaml meta.flow-sequence.yaml punctuation.definition.sequence.begin.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.flow.sequence.yaml punctuation.definition.sequence.begin.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1233,7 +1289,7 @@ }, { "c": "John Smith", - "t": "source.yaml meta.flow-sequence.yaml string.unquoted.plain.in.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.flow.sequence.yaml string.unquoted.plain.in.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.in.yaml: #0000FF", @@ -1247,7 +1303,7 @@ }, { "c": ",", - "t": "source.yaml meta.flow-sequence.yaml punctuation.separator.sequence.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.flow.sequence.yaml punctuation.separator.sequence.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1261,7 +1317,7 @@ }, { "c": " ", - "t": "source.yaml meta.flow-sequence.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.flow.sequence.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1275,7 +1331,7 @@ }, { "c": "Bill Jones", - "t": "source.yaml meta.flow-sequence.yaml string.unquoted.plain.in.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.flow.sequence.yaml string.unquoted.plain.in.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.in.yaml: #0000FF", @@ -1289,7 +1345,7 @@ }, { "c": "]", - "t": "source.yaml meta.flow-sequence.yaml punctuation.definition.sequence.end.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.flow.sequence.yaml punctuation.definition.sequence.end.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1302,8 +1358,36 @@ } }, { - "c": "women", - "t": "source.yaml string.unquoted.plain.out.yaml entity.name.tag.yaml", + "c": "w", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml invalid.illegal.expected-indentation.yaml", + "r": { + "dark_plus": "invalid: #F44747", + "light_plus": "invalid: #CD3131", + "dark_vs": "invalid: #F44747", + "light_vs": "invalid: #CD3131", + "hc_black": "invalid: #F44747", + "dark_modern": "invalid: #F44747", + "hc_light": "invalid: #B5200D", + "light_modern": "invalid: #CD3131" + } + }, + { + "c": "o", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml invalid.illegal.expected-indentation.yaml", + "r": { + "dark_plus": "invalid: #F44747", + "light_plus": "invalid: #CD3131", + "dark_vs": "invalid: #F44747", + "light_vs": "invalid: #CD3131", + "hc_black": "invalid: #F44747", + "dark_modern": "invalid: #F44747", + "hc_light": "invalid: #B5200D", + "light_modern": "invalid: #CD3131" + } + }, + { + "c": "men", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", "r": { "dark_plus": "entity.name.tag: #569CD6", "light_plus": "entity.name.tag: #800000", @@ -1317,7 +1401,7 @@ }, { "c": ":", - "t": "source.yaml punctuation.separator.key-value.mapping.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml punctuation.separator.map.value.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1331,7 +1415,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1345,7 +1429,7 @@ }, { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1359,7 +1443,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.block.sequence.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1373,7 +1457,7 @@ }, { "c": "Mary Smith", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.block.sequence.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", @@ -1387,7 +1471,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml punctuation.whitespace.indentation.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1401,7 +1485,7 @@ }, { "c": "-", - "t": "source.yaml punctuation.definition.block.sequence.item.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.block.sequence.yaml punctuation.definition.block.sequence.item.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1415,7 +1499,7 @@ }, { "c": " ", - "t": "source.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.block.sequence.yaml punctuation.whitespace.separator.yaml", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1429,7 +1513,7 @@ }, { "c": "Susan Williams", - "t": "source.yaml string.unquoted.plain.out.yaml", + "t": "source.yaml meta.stream.yaml meta.document.yaml meta.block.sequence.yaml meta.mapping.yaml meta.map.value.yaml meta.block.sequence.yaml string.unquoted.plain.out.yaml", "r": { "dark_plus": "string: #CE9178", "light_plus": "string.unquoted.plain.out.yaml: #0000FF", diff --git a/extensions/vscode-colorize-tests/yarn.lock b/extensions/vscode-colorize-tests/yarn.lock deleted file mode 100644 index 88c52293616..00000000000 --- a/extensions/vscode-colorize-tests/yarn.lock +++ /dev/null @@ -1,20 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -jsonc-parser@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" - integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/extensions/vscode-test-resolver/package-lock.json b/extensions/vscode-test-resolver/package-lock.json new file mode 100644 index 00000000000..367c4dca2e0 --- /dev/null +++ b/extensions/vscode-test-resolver/package-lock.json @@ -0,0 +1,34 @@ +{ + "name": "vscode-test-resolver", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vscode-test-resolver", + "version": "0.0.1", + "license": "MIT", + "devDependencies": { + "@types/node": "20.x" + }, + "engines": { + "vscode": "^1.25.0" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/extensions/vscode-test-resolver/src/extension.ts b/extensions/vscode-test-resolver/src/extension.ts index 8e12e622e05..2fab3ec306a 100644 --- a/extensions/vscode-test-resolver/src/extension.ts +++ b/extensions/vscode-test-resolver/src/extension.ts @@ -164,8 +164,8 @@ export function activate(context: vscode.ExtensionContext) { const serverCommandPath = path.join(vscodePath, 'scripts', serverCommand); outputChannel.appendLine(`Launching server: "${serverCommandPath}" ${commandArgs.join(' ')}`); - - extHostProcess = cp.spawn(serverCommandPath, commandArgs, { env, cwd: vscodePath }); + const shell = (process.platform === 'win32'); + extHostProcess = cp.spawn(serverCommandPath, commandArgs, { env, cwd: vscodePath, shell }); } else { const extensionToInstall = process.env['TESTRESOLVER_INSTALL_BUILTIN_EXTENSION']; if (extensionToInstall) { @@ -182,8 +182,8 @@ export function activate(context: vscode.ExtensionContext) { outputChannel.appendLine(`Using server build at ${serverLocation}`); outputChannel.appendLine(`Server arguments ${commandArgs.join(' ')}`); - - extHostProcess = cp.spawn(path.join(serverLocation, 'bin', serverCommand), commandArgs, { env, cwd: serverLocation }); + const shell = (process.platform === 'win32'); + extHostProcess = cp.spawn(path.join(serverLocation, 'bin', serverCommand), commandArgs, { env, cwd: serverLocation, shell }); } extHostProcess.stdout!.on('data', (data: Buffer) => processOutput(data.toString())); extHostProcess.stderr!.on('data', (data: Buffer) => processOutput(data.toString())); diff --git a/extensions/vscode-test-resolver/yarn.lock b/extensions/vscode-test-resolver/yarn.lock deleted file mode 100644 index 1f4b6c2e8b4..00000000000 --- a/extensions/vscode-test-resolver/yarn.lock +++ /dev/null @@ -1,15 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@20.x": - version "20.11.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" - integrity sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long== - dependencies: - undici-types "~5.26.4" - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== diff --git a/extensions/xml/yarn.lock b/extensions/xml/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/xml/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/yaml/build/update-grammar.js b/extensions/yaml/build/update-grammar.js new file mode 100644 index 00000000000..8684bc3e5d0 --- /dev/null +++ b/extensions/yaml/build/update-grammar.js @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +var updateGrammar = require('vscode-grammar-updater'); + +async function updateGrammars() { + await updateGrammar.update('RedCMD/YAML-Syntax-Highlighter', 'syntaxes/yaml-1.0.tmLanguage.json', './syntaxes/yaml-1.0.tmLanguage.json', undefined, 'main'); + await updateGrammar.update('RedCMD/YAML-Syntax-Highlighter', 'syntaxes/yaml-1.1.tmLanguage.json', './syntaxes/yaml-1.1.tmLanguage.json', undefined, 'main'); + await updateGrammar.update('RedCMD/YAML-Syntax-Highlighter', 'syntaxes/yaml-1.2.tmLanguage.json', './syntaxes/yaml-1.2.tmLanguage.json', undefined, 'main'); + await updateGrammar.update('RedCMD/YAML-Syntax-Highlighter', 'syntaxes/yaml-1.3.tmLanguage.json', './syntaxes/yaml-1.3.tmLanguage.json', undefined, 'main'); + await updateGrammar.update('RedCMD/YAML-Syntax-Highlighter', 'syntaxes/yaml.tmLanguage.json', './syntaxes/yaml.tmLanguage.json', undefined, 'main'); +} + +updateGrammars(); diff --git a/extensions/yaml/cgmanifest.json b/extensions/yaml/cgmanifest.json index e6c3ca158b5..83fe1e16107 100644 --- a/extensions/yaml/cgmanifest.json +++ b/extensions/yaml/cgmanifest.json @@ -4,33 +4,24 @@ "component": { "type": "git", "git": { - "name": "textmate/yaml.tmbundle", - "repositoryUrl": "https://github.com/textmate/yaml.tmbundle", - "commitHash": "e54ceae3b719506dba7e481a77cea4a8b576ae46" + "name": "RedCMD/YAML-Syntax-Highlighter", + "repositoryUrl": "https://github.com/RedCMD/YAML-Syntax-Highlighter", + "commitHash": "71a88711ec184b7dde5240c8f150ad3c2dbbd5f1" } }, "licenseDetail": [ - "Copyright (c) 2015 FichteFoll ", + "MIT License", "", - "Permission is hereby granted, free of charge, to any person obtaining a copy", - "of this software and associated documentation files (the \"Software\"), to deal", - "in the Software without restriction, including without limitation the rights", - "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", - "copies of the Software, and to permit persons to whom the Software is", - "furnished to do so, subject to the following conditions:", + "Copyright 2024 RedCMD", "", - "The above copyright notice and this permission notice shall be included in all", - "copies or substantial portions of the Software.", + "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:", "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", - "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", - "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", - "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." + "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.", + "", + "THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." ], - "license": "TextMate Bundle License", - "version": "0.0.0" + "license": "MIT", + "version": "1.1.2" } ], "version": 1 diff --git a/extensions/yaml/package.json b/extensions/yaml/package.json index 5223f71c52b..2b0ee013964 100644 --- a/extensions/yaml/package.json +++ b/extensions/yaml/package.json @@ -9,7 +9,7 @@ "vscode": "*" }, "scripts": { - "update-grammar": "node ../node_modules/vscode-grammar-updater/bin textmate/yaml.tmbundle Syntaxes/YAML.tmLanguage ./syntaxes/yaml.tmLanguage.json" + "update-grammar": "node ./build/update-grammar.js" }, "categories": ["Programming Languages"], "contributes": { @@ -56,10 +56,32 @@ "scopeName": "source.yaml", "path": "./syntaxes/yaml.tmLanguage.json" }, + { + "scopeName": "source.yaml.1.3", + "path": "./syntaxes/yaml-1.3.tmLanguage.json" + }, + { + "scopeName": "source.yaml.1.2", + "path": "./syntaxes/yaml-1.2.tmLanguage.json" + }, + { + "scopeName": "source.yaml.1.1", + "path": "./syntaxes/yaml-1.1.tmLanguage.json" + }, + { + "scopeName": "source.yaml.1.0", + "path": "./syntaxes/yaml-1.0.tmLanguage.json" + }, { "language": "yaml", "scopeName": "source.yaml", - "path": "./syntaxes/yaml.tmLanguage.json" + "path": "./syntaxes/yaml.tmLanguage.json", + "unbalancedBracketScopes": [ + "invalid.illegal", + "meta.scalar.yaml", + "storage.type.tag.shorthand.yaml", + "keyword.control.flow" + ] } ], "configurationDefaults": { diff --git a/extensions/yaml/syntaxes/yaml-1.0.tmLanguage.json b/extensions/yaml/syntaxes/yaml-1.0.tmLanguage.json new file mode 100644 index 00000000000..96afa88b231 --- /dev/null +++ b/extensions/yaml/syntaxes/yaml-1.0.tmLanguage.json @@ -0,0 +1,1144 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/RedCMD/YAML-Syntax-Highlighter/blob/master/syntaxes/yaml-1.0.tmLanguage.json", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "version": "https://github.com/RedCMD/YAML-Syntax-Highlighter/commit/71a88711ec184b7dde5240c8f150ad3c2dbbd5f1", + "name": "YAML 1.0", + "scopeName": "source.yaml.1.0", + "comment": "https://yaml.org/spec/1.0/", + "patterns": [ + { + "include": "#stream" + } + ], + "repository": { + "stream": { + "patterns": [ + { + "comment": "allows me to just use `\\G` instead of the performance heavy `(^|\\G)`", + "begin": "^(?!\\G)", + "while": "^", + "name": "meta.stream.yaml", + "patterns": [ + { + "include": "source.yaml.1.1#byte-order-mark" + }, + { + "include": "#directives" + }, + { + "include": "#document" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "begin": "\\G", + "while": "\\G", + "name": "meta.stream.yaml", + "patterns": [ + { + "include": "source.yaml.1.1#byte-order-mark" + }, + { + "include": "#directives" + }, + { + "include": "#document" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + } + ] + }, + "directive-YAML": { + "comment": "https://yaml.org/spec/1.2.2/#681-yaml-directives", + "begin": "(?=%YAML:1\\.0(?=[\\x{85 2028 2029}\r\n\t ]))", + "end": "\\G(?=%(?!YAML:1\\.0))", + "name": "meta.1.0.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#681-yaml-directives", + "begin": "\\G(%)(YAML)(:)(1\\.0)", + "while": "\\G(?!---[\\x{85 2028 2029}\r\n\t ])", + "beginCaptures": { + "1": { + "name": "punctuation.definition.directive.begin.yaml" + }, + "2": { + "name": "keyword.other.directive.yaml.yaml" + }, + "3": { + "name": "punctuation.whitespace.separator.yaml" + }, + "4": { + "name": "constant.numeric.yaml-version.yaml" + } + }, + "name": "meta.directives.yaml", + "patterns": [ + { + "include": "source.yaml.1.1#directive-invalid" + }, + { + "include": "#directives" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "begin": "\\G(?=---[\\x{85 2028 2029}\r\n\t ])", + "while": "\\G(?!%)", + "patterns": [ + { + "include": "#document" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + "directives": { + "comment": "https://yaml.org/spec/1.2.2/#68-directives", + "patterns": [ + { + "include": "source.yaml.1.3#directive-YAML" + }, + { + "include": "source.yaml.1.2#directive-YAML" + }, + { + "include": "source.yaml.1.1#directive-YAML" + }, + { + "include": "source.yaml.1.0#directive-YAML" + }, + { + "begin": "(?=%)", + "while": "\\G(?!%|---[\\x{85 2028 2029}\r\n\t ])", + "name": "meta.directives.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-reserved-directive", + "begin": "(%)([^: \\p{Cntrl}\\p{Surrogate}\\x{2028 2029 FFFE FFFF}]++)", + "end": "$", + "beginCaptures": { + "1": { + "name": "punctuation.definition.directive.begin.yaml" + }, + "2": { + "name": "keyword.other.directive.other.yaml" + } + }, + "patterns": [ + { + "match": "\\G(:)([^ \\p{Cntrl}\\p{Surrogate}\\x{2028 2029 FFFE FFFF}]++)", + "captures": { + "1": { + "name": "punctuation.whitespace.separator.yaml" + }, + "2": { + "name": "string.unquoted.directive-name.yaml" + } + } + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "match": "\\G\\.{3}(?=[\\x{85 2028 2029}\r\n\t ])", + "name": "invalid.illegal.entity.other.document.end.yaml" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + } + ] + }, + "document": { + "comment": "https://yaml.org/spec/1.2.2/#91-documents", + "patterns": [ + { + "begin": "---(?=[\\x{85 2028 2029}\r\n\t ])", + "while": "\\G(?!(?>\\.{3}|---)[\\x{85 2028 2029}\r\n\t ])", + "beginCaptures": { + "0": { + "name": "entity.other.document.begin.yaml" + } + }, + "name": "meta.document.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + }, + { + "begin": "(?=\\.{3}[\\x{85 2028 2029}\r\n\t ])", + "while": "\\G(?=[\t \\x{FEFF}]*+(?>#|$))", + "patterns": [ + { + "begin": "\\G\\.{3}", + "end": "$", + "beginCaptures": { + "0": { + "name": "entity.other.document.end.yaml" + } + }, + "patterns": [ + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "include": "source.yaml.1.1#byte-order-mark" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "begin": "\\G(?!%|[\t \\x{FEFF}]*+(?>#|$))", + "while": "\\G(?!(?>\\.{3}|---)[\\x{85 2028 2029}\r\n\t ])", + "name": "meta.document.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + } + ] + }, + "block-node": { + "patterns": [ + { + "include": "#block-sequence" + }, + { + "include": "#block-mapping" + }, + { + "include": "#block-scalar" + }, + { + "include": "source.yaml.1.1#anchor-property" + }, + { + "include": "#tag-property" + }, + { + "include": "source.yaml.1.1#alias" + }, + { + "begin": "(?=\"|')", + "while": "\\G", + "patterns": [ + { + "begin": "(?!\\G)", + "while": "\\G", + "patterns": [ + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "include": "#double" + }, + { + "include": "source.yaml.1.1#single" + } + ] + }, + { + "begin": "(?={)", + "end": "$", + "patterns": [ + { + "include": "#flow-mapping" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "begin": "(?=\\[)", + "end": "$", + "patterns": [ + { + "include": "#flow-sequence" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "include": "source.yaml.1.1#block-plain-out" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + "block-mapping": { + "//": "The check for plain keys is expensive", + "begin": "(?=((?<=[-?:]) )?+)(?[!&*][^\\x{85 2028 2029}\r\n\t ]*+[\t ]++)*+)(?=(?>(?#Double Quote)\"(?>[^\\\\\"]++|\\\\.)*+\"|(?#Single Quote)'(?>[^']++|'')*+'|(?#Flow-Map){(?>[^\\x{85 2028 2029}}]++|}[ \t]*+(?!:[\\x{85 2028 2029}\r\n\t ]))++}|(?#Flow-Seq)\\[(?>[^\\x{85 2028 2029}\\]]++|][ \t]*+(?!:[\\x{85 2028 2029}\r\n\t ]))++]|(?#Plain)(?>[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ]))(?>[^:#]++|:(?![\\x{85 2028 2029}\r\n\t ])|(?(\\1\\2)((?>[!&*][^\\x{85 2028 2029}\r\n\t ]*+[\t ]++)*+)((?>\t[\t ]*+)?+[^\\x{85 2028 2029}\r\n\t ?:\\-#!&*\"'\\[\\]{}0-9A-Za-z$()+./;<=\\\\^_~\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}])?+|( *+)([\t ]*+[^\\x{85 2028 2029}\r\n#])?+)", + "beginCaptures": { + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "punctuation.whitespace.separator.yaml" + }, + "4": { + "comment": "May cause lag on long lines starting with a tag, anchor or alias", + "patterns": [ + { + "include": "#tag-property" + }, + { + "include": "source.yaml.1.1#anchor-property" + }, + { + "include": "source.yaml.1.1#alias" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + } + }, + "whileCaptures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "comment": "May cause lag on long lines starting with a tag, anchor or alias", + "patterns": [ + { + "include": "#tag-property" + }, + { + "include": "source.yaml.1.1#anchor-property" + }, + { + "include": "source.yaml.1.1#alias" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + "3": { + "name": "invalid.illegal.expected-indentation.yaml" + }, + "4": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "5": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "name": "meta.mapping.yaml", + "patterns": [ + { + "include": "#block-map-key-double" + }, + { + "include": "source.yaml#block-map-key-single" + }, + { + "include": "source.yaml.1.1#block-map-key-plain" + }, + { + "include": "#block-map-key-explicit" + }, + { + "include": "#block-map-value" + }, + { + "include": "#flow-mapping" + }, + { + "include": "#flow-sequence" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + "block-sequence": { + "comment": "https://yaml.org/spec/1.2.2/#rule-l+block-sequence", + "begin": "(?=((?<=[-?:]) )?+)(?(\\1\\2)(?!-[\\x{85 2028 2029}\r\n\t ])((?>\t[\t ]*+)?+[^\\x{85 2028 2029}\r\n\t #\\]}])?+|(?!\\1\\2)( *+)([\t ]*+[^\\x{85 2028 2029}\r\n#])?+)", + "beginCaptures": { + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "punctuation.definition.block.sequence.item.yaml" + } + }, + "whileCaptures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "name": "invalid.illegal.expected-indentation.yaml" + }, + "3": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "4": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "name": "meta.block.sequence.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + }, + "block-map-key-explicit": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-l-block-map-explicit-key", + "begin": "(?=((?<=[-?:]) )?+)\\G( *+)(\\?)(?=[\\x{85 2028 2029}\r\n\t ])", + "while": "\\G(?>(\\1\\2)(?![?:0-9A-Za-z$()+./;<=\\\\^_~\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}&&[^\\x{2028 2029}]])((?>\t[\t ]*+)?+[^\\x{85 2028 2029}\r\n\t #\\-\\[\\]{}])?+|(?!\\1\\2)( *+)([\t ]*+[^\\x{85 2028 2029}\r\n#])?+)", + "beginCaptures": { + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "punctuation.definition.map.key.yaml" + }, + "4": { + "name": "punctuation.whitespace.separator.yaml" + } + }, + "whileCaptures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "name": "invalid.illegal.expected-indentation.yaml" + }, + "3": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "4": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "name": "meta.map.explicit.yaml", + "patterns": [ + { + "include": "#key-double" + }, + { + "include": "source.yaml#key-single" + }, + { + "include": "source.yaml.1.1#flow-key-plain-out" + }, + { + "include": "#block-map-value" + }, + { + "include": "#block-node" + } + ] + }, + "block-map-key-double": { + "comment": "https://yaml.org/spec/1.2.2/#double-quoted-style (BLOCK-KEY)", + "begin": "\\G\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.yaml" + } + }, + "name": "meta.map.key.yaml string.quoted.double.yaml entity.name.tag.yaml", + "patterns": [ + { + "match": ".[\t ]*+$", + "name": "invalid.illegal.multiline-key.yaml" + }, + { + "match": "[^\t -\\x{10FFFF}]++", + "name": "invalid.illegal.character.yaml" + }, + { + "include": "#double-escape" + } + ] + }, + "block-map-value": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-l-block-map-implicit-value", + "//": "Assumming 3rd party preprocessing variables `{{...}}` turn into valid map-keys when inside a block-mapping", + "begin": ":(?=[\\x{85 2028 2029}\r\n\t ])|(?<=}})(?=[\t ]++#|[\t ]*+$)", + "while": "\\G(?![?:!\"'0-9A-Za-z$()+./;<=\\\\^_~\\[{\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}&&[^\\x{2028 2029}]]|-[^\\x{85 2028 2029}\r\n\t ])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.map.value.yaml" + } + }, + "name": "meta.map.value.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + }, + "block-scalar": { + "comment": "https://yaml.org/spec/1.2.2/#81-block-scalar-styles", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#8111-block-indentation-indicator", + "begin": "(?>(\\|)|(>))(?[+-])?+((0)|(1)|(2)|(3)|(4)|(5)|(6)|(7)|(8)|(9))(?()|([+-]))?+", + "while": "\\G(?>(?>(?!\\5)|(?!\\6) |(?!\\7) {2}|(?!\\8) {3}|(?!\\9) {4}|(?!\\10) {5}|(?!\\11) {6}|(?!\\12) {7}|(?!\\13) {8}|(?!\\14) {9})| *+($|[^#]))", + "beginCaptures": { + "1": { + "name": "keyword.control.flow.block-scalar.literal.yaml" + }, + "2": { + "name": "keyword.control.flow.block-scalar.folded.yaml" + }, + "3": { + "name": "storage.modifier.chomping-indicator.yaml" + }, + "4": { + "name": "constant.numeric.indentation-indicator.yaml" + }, + "15": { + "name": "storage.modifier.chomping-indicator.yaml" + } + }, + "whileCaptures": { + "0": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "1": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "name": "meta.scalar.yaml", + "patterns": [ + { + "begin": "$", + "while": "\\G", + "contentName": "string.unquoted.block.yaml", + "patterns": [ + { + "include": "source.yaml#non-printable" + } + ] + }, + { + "begin": "\\G", + "end": "$", + "patterns": [ + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-b-block-header", + "//": "Soooooooo many edge cases", + "begin": "(?>(\\|)|(>))([+-]?+)", + "while": "\\G", + "beginCaptures": { + "1": { + "name": "keyword.control.flow.block-scalar.literal.yaml" + }, + "2": { + "name": "keyword.control.flow.block-scalar.folded.yaml" + }, + "3": { + "name": "storage.modifier.chomping-indicator.yaml" + } + }, + "name": "meta.scalar.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-l-literal-content", + "begin": "$", + "while": "\\G", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-l-nb-literal-text", + "//": "Find the highest indented line", + "begin": "\\G( ++)$", + "while": "\\G(?>(\\1)$|(?!\\1)( *+)($|.))", + "captures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "contentName": "string.unquoted.block.yaml", + "patterns": [ + { + "include": "source.yaml#non-printable" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-b-nb-literal-next", + "//": [ + "Funky wrapper function", + "The `end` pattern clears the parent `\\G` anchor", + "Affectively forcing this rule to only match at most once", + "https://github.com/microsoft/vscode-textmate/issues/114" + ], + "begin": "\\G(?!$)(?=( *+))", + "end": "\\G(?!\\1)(?=[\t ]*+#)", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-l-nb-literal-text", + "begin": "\\G( *+)", + "while": "\\G(?>(\\1)|( *+)($|[^\t#]|[\t ]++[^#]))", + "captures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "contentName": "string.unquoted.block.yaml", + "patterns": [ + { + "include": "source.yaml#non-printable" + } + ] + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-l-chomped-empty", + "begin": "(?!\\G)(?=[\t ]*+#)", + "while": "\\G", + "patterns": [ + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + } + ] + }, + { + "comment": "Header Comment", + "begin": "\\G", + "end": "$", + "patterns": [ + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + } + ] + } + ] + }, + "flow-node": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-seq-entry (FLOW-IN)", + "patterns": [ + { + "begin": "(?=\\[|{)", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "begin": "(?!\\G)", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "include": "#flow-mapping" + }, + { + "include": "#flow-sequence" + } + ] + }, + { + "include": "source.yaml.1.1#anchor-property" + }, + { + "include": "#tag-property" + }, + { + "include": "source.yaml.1.1#alias" + }, + { + "begin": "(?=\"|')", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "begin": "(?!\\G)", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "include": "#double" + }, + { + "include": "source.yaml.1.1#single" + } + ] + }, + { + "include": "source.yaml.1.1#flow-plain-in" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + "flow-mapping": { + "comment": "https://yaml.org/spec/1.2.2/#742-flow-mappings", + "begin": "{", + "end": "}", + "beginCaptures": { + "0": { + "name": "punctuation.definition.mapping.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.mapping.end.yaml" + } + }, + "name": "meta.flow.mapping.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-s-flow-map-entries", + "begin": "(?<={)\\G(?=[\\x{85 2028 2029}\r\n\t ,#])|,", + "end": "(?=[^\\x{85 2028 2029}\r\n\t ,#])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.mapping.yaml" + } + }, + "patterns": [ + { + "match": ",++", + "name": "invalid.illegal.separator.sequence.yaml" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "include": "#flow-mapping-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + "flow-sequence": { + "comment": "https://yaml.org/spec/1.2.2/#741-flow-sequences", + "begin": "\\[", + "end": "]", + "beginCaptures": { + "0": { + "name": "punctuation.definition.sequence.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.sequence.end.yaml" + } + }, + "name": "meta.flow.sequence.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-s-flow-seq-entries", + "begin": "(?<=\\[)\\G(?=[\\x{85 2028 2029}\r\n\t ,#])|,", + "end": "(?=[^\\x{85 2028 2029}\r\n\t ,#])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.sequence.yaml" + } + }, + "patterns": [ + { + "match": ",++", + "name": "invalid.illegal.separator.sequence.yaml" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "include": "#flow-sequence-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + "flow-mapping-map-key": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-entry (FLOW-IN)", + "patterns": [ + { + "begin": "\\?(?=[\\x{85 2028 2029}\r\n\t ,\\[\\]{}])", + "end": "(?=[,\\[\\]{}])", + "beginCaptures": { + "0": { + "name": "punctuation.definition.map.key.yaml" + } + }, + "name": "meta.flow.map.explicit.yaml", + "patterns": [ + { + "include": "#flow-mapping-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-implicit-entry (FLOW-IN)", + "begin": "(?=(?>[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ,\\[\\]{}])))", + "end": "(?=[,\\[\\]{}])", + "name": "meta.flow.map.implicit.yaml", + "patterns": [ + { + "include": "source.yaml.1.1#flow-key-plain-in" + }, + { + "match": ":(?=\\[|{)", + "name": "invalid.illegal.separator.map.yaml" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-implicit-entry (FLOW-IN)", + "begin": "(?=\"|')", + "end": "(?=[,\\[\\]{}])", + "name": "meta.flow.map.implicit.yaml", + "patterns": [ + { + "include": "#key-double" + }, + { + "include": "source.yaml#key-single" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + } + ] + }, + "flow-sequence-map-key": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-entry (FLOW-IN)", + "patterns": [ + { + "begin": "\\?(?=[\\x{85 2028 2029}\r\n\t ,\\[\\]{}])", + "end": "(?=[,\\[\\]{}])", + "beginCaptures": { + "0": { + "name": "punctuation.definition.map.key.yaml" + } + }, + "name": "meta.flow.map.explicit.yaml", + "patterns": [ + { + "include": "#flow-mapping-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-implicit-entry (FLOW-IN)", + "begin": "(?<=[\t ,\\[{]|^)(?=(?>[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))(?>[^:#,\\[\\]{}]++|:(?![\\x{85 2028 2029}\r\n\t ,\\[\\]{}])|(?\"(?>[^\\\\\"]++|\\\\.)*+\"|'(?>[^']++|'')*+')[\t ]*+:)", + "end": "(?=[,\\[\\]{}])", + "name": "meta.flow.map.implicit.yaml", + "patterns": [ + { + "include": "#key-double" + }, + { + "include": "source.yaml#key-single" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "source.yaml.1.1#presentation-detail" + } + ] + } + ] + }, + "flow-map-value-yaml": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-ns-flow-map-separate-value (FLOW-IN)", + "begin": ":(?=[\\x{85 2028 2029}\r\n\t ,\\[\\]{}])", + "end": "(?=[,\\]}])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.map.value.yaml" + } + }, + "name": "meta.flow.pair.value.yaml", + "patterns": [ + { + "include": "#flow-node" + } + ] + }, + "flow-map-value-json": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-ns-flow-map-separate-value (FLOW-IN)", + "begin": "(?<=(?>[\"'\\]}]|^)[\t ]*+):", + "end": "(?=[,\\]}])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.map.value.yaml" + } + }, + "name": "meta.flow.pair.value.yaml", + "patterns": [ + { + "include": "#flow-node" + } + ] + }, + "key-double": { + "comment": "https://yaml.org/spec/1.2.2/#double-quoted-style (FLOW-OUT)", + "begin": "\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.yaml" + } + }, + "name": "meta.map.key.yaml string.quoted.double.yaml entity.name.tag.yaml", + "patterns": [ + { + "match": "[^\t -\\x{10FFFF}]++", + "name": "invalid.illegal.character.yaml" + }, + { + "include": "#double-escape" + } + ] + }, + "double": { + "comment": "https://yaml.org/spec/1.2.2/#double-quoted-style", + "begin": "\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.yaml" + } + }, + "name": "string.quoted.double.yaml", + "patterns": [ + { + "match": "(?x[^\"]{2,0}|u[^\"]{4,0}|U[^\"]{8,0}|.)", + "name": "invalid.illegal.constant.character.escape.yaml" + } + ] + }, + "tag-property": { + "comment": "https://yaml.org/spec/1.0/#c-ns-tag-property", + "//": [ + "!^", + "!!private_ns-tag-char+", + "!global_core_ns-tag-char+_no-:/!", + "!global_vocabulary_az09-_/ns-tag-char", + "!global_domain_ns-tag-char+.ns-tag-char+,1234(-12(-12)?)?/ns-tag-char*" + ], + "begin": "(?=!)", + "end": "(?=[\\x{2028 2029}\r\n\t ])", + "name": "storage.type.tag.yaml", + "patterns": [ + { + "match": "\\G!(?=[\\x{85 2028 2029}\r\n\t ])", + "name": "punctuation.definition.tag.non-specific.yaml" + }, + { + "comment": "https://yaml.org/spec/1.0/#c-ns-private-tag", + "match": "\\G!!", + "name": "punctuation.definition.tag.private.yaml" + }, + { + "comment": "https://yaml.org/spec/1.0/#ns-ns-global-tag", + "match": "\\G!", + "name": "punctuation.definition.tag.global.yaml" + }, + { + "comment": "https://yaml.org/spec/1.0/#c-prefix", + "match": "\\^", + "name": "punctuation.definition.tag.prefix.yaml" + }, + { + "match": "%[0-9a-fA-F]{2}", + "name": "constant.character.escape.unicode.8-bit.yaml" + }, + { + "match": "%[^\\x{85 2028 2029}\r\n\t ]{2,0}", + "name": "invalid.illegal.constant.character.escape.unicode.8-bit.yaml" + }, + { + "include": "#double-escape" + }, + { + "include": "source.yaml#non-printable" + } + ] + } + } +} \ No newline at end of file diff --git a/extensions/yaml/syntaxes/yaml-1.1.tmLanguage.json b/extensions/yaml/syntaxes/yaml-1.1.tmLanguage.json new file mode 100644 index 00000000000..57a96ac1e4f --- /dev/null +++ b/extensions/yaml/syntaxes/yaml-1.1.tmLanguage.json @@ -0,0 +1,1555 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/RedCMD/YAML-Syntax-Highlighter/blob/master/syntaxes/yaml-1.1.tmLanguage.json", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "version": "https://github.com/RedCMD/YAML-Syntax-Highlighter/commit/dfd7e5f4f71f9695c5d8697ca57f81240165aa04", + "name": "YAML 1.1", + "scopeName": "source.yaml.1.1", + "comment": "https://yaml.org/spec/1.1/", + "patterns": [ + { + "include": "#stream" + } + ], + "repository": { + "stream": { + "patterns": [ + { + "comment": "allows me to just use `\\G` instead of the performance heavy `(^|\\G)`", + "begin": "^(?!\\G)", + "while": "^", + "name": "meta.stream.yaml", + "patterns": [ + { + "include": "#byte-order-mark" + }, + { + "include": "#directives" + }, + { + "include": "#document" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "begin": "\\G", + "while": "\\G", + "name": "meta.stream.yaml", + "patterns": [ + { + "include": "#byte-order-mark" + }, + { + "include": "#directives" + }, + { + "include": "#document" + }, + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "directive-YAML": { + "comment": "https://yaml.org/spec/1.2.2/#681-yaml-directives", + "begin": "(?=%YAML[ \t]+1\\.1(?=[\\x{85 2028 2029}\r\n\t ]))", + "end": "\\G(?=%(?!YAML[ \t]+1\\.1))", + "name": "meta.1.1.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#681-yaml-directives", + "begin": "\\G(%)(YAML)([ \t]+)(1\\.1)", + "while": "\\G(?!---[\\x{85 2028 2029}\r\n\t ])", + "beginCaptures": { + "1": { + "name": "punctuation.definition.directive.begin.yaml" + }, + "2": { + "name": "keyword.other.directive.yaml.yaml" + }, + "3": { + "name": "punctuation.whitespace.separator.yaml" + }, + "4": { + "name": "constant.numeric.yaml-version.yaml" + } + }, + "name": "meta.directives.yaml", + "patterns": [ + { + "include": "#directive-invalid" + }, + { + "include": "#directives" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "begin": "\\G(?=---[\\x{85 2028 2029}\r\n\t ])", + "while": "\\G(?!%)", + "patterns": [ + { + "include": "#document" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#presentation-detail" + } + ] + }, + "directives": { + "comment": "https://yaml.org/spec/1.2.2/#68-directives", + "patterns": [ + { + "include": "source.yaml.1.3#directive-YAML" + }, + { + "include": "source.yaml.1.2#directive-YAML" + }, + { + "include": "source.yaml.1.1#directive-YAML" + }, + { + "include": "source.yaml.1.0#directive-YAML" + }, + { + "begin": "(?=%)", + "while": "\\G(?!%|---[\\x{85 2028 2029}\r\n\t ])", + "name": "meta.directives.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#682-tag-directives", + "begin": "\\G(%)(TAG)(?>([\t ]++)((!)(?>[0-9A-Za-z-]*+(!))?+))?+", + "end": "$", + "applyEndPatternLast": true, + "beginCaptures": { + "1": { + "name": "punctuation.definition.directive.begin.yaml" + }, + "2": { + "name": "keyword.other.directive.tag.yaml" + }, + "3": { + "name": "punctuation.whitespace.separator.yaml" + }, + "4": { + "name": "storage.type.tag-handle.yaml" + }, + "5": { + "name": "punctuation.definition.tag.begin.yaml" + }, + "6": { + "name": "punctuation.definition.tag.end.yaml" + }, + "comment": "https://yaml.org/spec/1.2.2/#rule-c-tag-handle" + }, + "patterns": [ + { + "comment": "technically the beginning should only validate against a valid uri scheme [A-Za-z][A-Za-z0-9.+-]*", + "begin": "\\G[\t ]++(?!#)", + "end": "(?=[\\x{85 2028 2029}\r\n\t ])", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.separator.yaml" + } + }, + "contentName": "support.type.tag-prefix.yaml", + "patterns": [ + { + "match": "%[0-9a-fA-F]{2}", + "name": "constant.character.escape.unicode.8-bit.yaml" + }, + { + "match": "%[^\\x{85 2028 2029}\r\n\t ]{2,0}", + "name": "invalid.illegal.constant.character.escape.unicode.8-bit.yaml" + }, + { + "match": "\\G[,\\[\\]{}]", + "name": "invalid.illegal.character.uri.yaml" + }, + { + "include": "source.yaml#non-printable" + }, + { + "match": "[^\\x{85 2028 2029}\r\n\t a-zA-Z0-9-#;/?:@&=+$,_.!~*'()\\[\\]]++", + "name": "invalid.illegal.unrecognized.yaml" + } + ] + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-reserved-directive", + "begin": "(%)([^ \\p{Cntrl}\\p{Surrogate}\\x{2028 2029 FFFE FFFF}]++)", + "end": "$", + "beginCaptures": { + "1": { + "name": "punctuation.definition.directive.begin.yaml" + }, + "2": { + "name": "keyword.other.directive.other.yaml" + } + }, + "patterns": [ + { + "match": "\\G([\t ]++)([^ \\p{Cntrl}\\p{Surrogate}\\x{2028 2029 FFFE FFFF}]++)", + "captures": { + "1": { + "name": "punctuation.whitespace.separator.yaml" + }, + "2": { + "name": "string.unquoted.directive-name.yaml" + } + } + }, + { + "match": "([\t ]++)([^ \\p{Cntrl}\\p{Surrogate}\\x{2028 2029 FFFE FFFF}]++)", + "captures": { + "1": { + "name": "punctuation.whitespace.separator.yaml" + }, + "2": { + "name": "string.unquoted.directive-parameter.yaml" + } + } + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "match": "\\G\\.{3}(?=[\\x{85 2028 2029}\r\n\t ])", + "name": "invalid.illegal.entity.other.document.end.yaml" + }, + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "directive-invalid": { + "patterns": [ + { + "match": "\\G\\.{3}(?=[\\x{85 2028 2029}\r\n\t ])", + "name": "invalid.illegal.entity.other.document.end.yaml" + }, + { + "begin": "\\G(%)(YAML)", + "end": "$", + "beginCaptures": { + "1": { + "name": "punctuation.definition.directive.begin.yaml" + }, + "2": { + "name": "invalid.illegal.keyword.other.directive.yaml.yaml" + } + }, + "name": "meta.directive.yaml", + "patterns": [ + { + "match": "\\G([\t ]++|:)([0-9]++\\.[0-9]++)?+", + "captures": { + "1": { + "name": "punctuation.whitespace.separator.yaml" + }, + "2": { + "name": "constant.numeric.yaml-version.yaml" + } + } + }, + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "document": { + "comment": "https://yaml.org/spec/1.2.2/#91-documents", + "patterns": [ + { + "begin": "---(?=[\\x{85 2028 2029}\r\n\t ])", + "while": "\\G(?!(?>\\.{3}|---)[\\x{85 2028 2029}\r\n\t ])", + "beginCaptures": { + "0": { + "name": "entity.other.document.begin.yaml" + } + }, + "name": "meta.document.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + }, + { + "begin": "(?=\\.{3}[\\x{85 2028 2029}\r\n\t ])", + "while": "\\G(?=[\t \\x{FEFF}]*+(?>#|$))", + "patterns": [ + { + "begin": "\\G\\.{3}", + "end": "$", + "beginCaptures": { + "0": { + "name": "entity.other.document.end.yaml" + } + }, + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#byte-order-mark" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "begin": "\\G(?!%|[\t \\x{FEFF}]*+(?>#|$))", + "while": "\\G(?!(?>\\.{3}|---)[\\x{85 2028 2029}\r\n\t ])", + "name": "meta.document.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + } + ] + }, + "block-node": { + "patterns": [ + { + "include": "#block-sequence" + }, + { + "include": "#block-mapping" + }, + { + "include": "source.yaml.1.2#block-scalar" + }, + { + "include": "#anchor-property" + }, + { + "include": "#tag-property" + }, + { + "include": "#alias" + }, + { + "begin": "(?=\"|')", + "while": "\\G", + "patterns": [ + { + "begin": "(?!\\G)", + "while": "\\G", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#double" + }, + { + "include": "#single" + } + ] + }, + { + "begin": "(?={)", + "end": "$", + "patterns": [ + { + "include": "#flow-mapping" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "begin": "(?=\\[)", + "end": "$", + "patterns": [ + { + "include": "#flow-sequence" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#block-plain-out" + }, + { + "include": "#presentation-detail" + } + ] + }, + "block-mapping": { + "//": "The check for plain keys is expensive", + "begin": "(?=((?<=[-?:]) )?+)(?[!&*][^\\x{85 2028 2029}\r\n\t ]*+[\t ]++)*+)(?=(?>(?#Double Quote)\"(?>[^\\\\\"]++|\\\\.)*+\"|(?#Single Quote)'(?>[^']++|'')*+'|(?#Flow-Map){(?>[^\\x{85 2028 2029}}]++|}[ \t]*+(?!:[\\x{85 2028 2029}\r\n\t ]))++}|(?#Flow-Seq)\\[(?>[^\\x{85 2028 2029}\\]]++|][ \t]*+(?!:[\\x{85 2028 2029}\r\n\t ]))++]|(?#Plain)(?>[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ]))(?>[^:#]++|:(?![\\x{85 2028 2029}\r\n\t ])|(?(\\1\\2)((?>[!&*][^\\x{85 2028 2029}\r\n\t ]*+[\t ]++)*+)((?>\t[\t ]*+)?+[^\\x{85 2028 2029}\r\n\t ?:\\-#!&*\"'\\[\\]{}0-9A-Za-z$()+./;<=\\\\^_~\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}])?+|( *+)([\t ]*+[^\\x{85 2028 2029}\r\n#])?+)", + "beginCaptures": { + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "punctuation.whitespace.separator.yaml" + }, + "4": { + "comment": "May cause lag on long lines starting with a tag, anchor or alias", + "patterns": [ + { + "include": "#tag-property" + }, + { + "include": "#anchor-property" + }, + { + "include": "#alias" + }, + { + "include": "#presentation-detail" + } + ] + } + }, + "whileCaptures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "comment": "May cause lag on long lines starting with a tag, anchor or alias", + "patterns": [ + { + "include": "#tag-property" + }, + { + "include": "#anchor-property" + }, + { + "include": "#alias" + }, + { + "include": "#presentation-detail" + } + ] + }, + "3": { + "name": "invalid.illegal.expected-indentation.yaml" + }, + "4": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "5": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "name": "meta.mapping.yaml", + "patterns": [ + { + "include": "#block-map-key-double" + }, + { + "include": "source.yaml#block-map-key-single" + }, + { + "include": "#block-map-key-plain" + }, + { + "include": "#block-map-key-explicit" + }, + { + "include": "#block-map-value" + }, + { + "include": "#flow-mapping" + }, + { + "include": "#flow-sequence" + }, + { + "include": "#presentation-detail" + } + ] + }, + "block-sequence": { + "comment": "https://yaml.org/spec/1.2.2/#rule-l+block-sequence", + "begin": "(?=((?<=[-?:]) )?+)(?(\\1\\2)(?!-[\\x{85 2028 2029}\r\n\t ])((?>\t[\t ]*+)?+[^\\x{85 2028 2029}\r\n\t #\\]}])?+|(?!\\1\\2)( *+)([\t ]*+[^\\x{85 2028 2029}\r\n#])?+)", + "beginCaptures": { + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "punctuation.definition.block.sequence.item.yaml" + } + }, + "whileCaptures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "name": "invalid.illegal.expected-indentation.yaml" + }, + "3": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "4": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "name": "meta.block.sequence.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + }, + "block-map-key-explicit": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-l-block-map-explicit-key", + "begin": "(?=((?<=[-?:]) )?+)\\G( *+)(\\?)(?=[\\x{85 2028 2029}\r\n\t ])", + "while": "\\G(?>(\\1\\2)(?![?:0-9A-Za-z$()+./;<=\\\\^_~\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}&&[^\\x{2028 2029}]])((?>\t[\t ]*+)?+[^\\x{85 2028 2029}\r\n\t #\\-\\[\\]{}])?+|(?!\\1\\2)( *+)([\t ]*+[^\\x{85 2028 2029}\r\n#])?+)", + "beginCaptures": { + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "punctuation.definition.map.key.yaml" + }, + "4": { + "name": "punctuation.whitespace.separator.yaml" + } + }, + "whileCaptures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "name": "invalid.illegal.expected-indentation.yaml" + }, + "3": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "4": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "name": "meta.map.explicit.yaml", + "patterns": [ + { + "include": "#key-double" + }, + { + "include": "source.yaml#key-single" + }, + { + "include": "#flow-key-plain-out" + }, + { + "include": "#block-map-value" + }, + { + "include": "#block-node" + } + ] + }, + "block-map-key-double": { + "comment": "https://yaml.org/spec/1.2.2/#double-quoted-style (BLOCK-KEY)", + "begin": "\\G\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.yaml" + } + }, + "name": "meta.map.key.yaml string.quoted.double.yaml entity.name.tag.yaml", + "patterns": [ + { + "match": ".[\t ]*+$", + "name": "invalid.illegal.multiline-key.yaml" + }, + { + "match": "[^\t -\\x{10FFFF}]++", + "name": "invalid.illegal.character.yaml" + }, + { + "include": "#double-escape" + } + ] + }, + "block-map-key-plain": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-plain-one-line (BLOCK-KEY)", + "begin": "\\G(?=[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ]))", + "end": "(?=[\t ]*+:[\\x{85 2028 2029}\r\n\t ]|(?>[\t ]++|\\G)#)", + "name": "meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", + "patterns": [ + { + "include": "#tag-implicit-plain-out" + }, + { + "match": "\\G([\t ]++)(.)", + "captures": { + "1": { + "name": "punctuation.whitespace.separator.yaml" + }, + "2": { + "name": "invalid.illegal.multiline-key.yaml" + } + } + }, + { + "match": "[\t ]++$", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "include": "source.yaml#non-printable" + } + ] + }, + "block-map-value": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-l-block-map-implicit-value", + "//": "Assumming 3rd party preprocessing variables `{{...}}` turn into valid map-keys when inside a block-mapping", + "begin": ":(?=[\\x{85 2028 2029}\r\n\t ])|(?<=}})(?=[\t ]++#|[\t ]*+$)", + "while": "\\G(?![?:!\"'0-9A-Za-z$()+./;<=\\\\^_~\\[{\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}&&[^\\x{2028 2029}]]|-[^\\x{85 2028 2029}\r\n\t ])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.map.value.yaml" + } + }, + "name": "meta.map.value.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + }, + "block-plain-out": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-plain-multi-line (FLOW-OUT)", + "begin": "(?=[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ]))", + "while": "\\G", + "patterns": [ + { + "begin": "\\G", + "end": "(?=(?>[\t ]++|\\G)#)", + "name": "string.unquoted.plain.out.yaml", + "patterns": [ + { + "include": "#tag-implicit-plain-out" + }, + { + "match": ":(?=[\\x{85 2028 2029}\r\n\t ])", + "name": "invalid.illegal.multiline-key.yaml" + }, + { + "match": "\\G[\t ]++", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "match": "[\t ]++$", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "include": "source.yaml#non-printable" + } + ] + }, + { + "begin": "(?!\\G)", + "while": "\\G", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "flow-node": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-seq-entry (FLOW-IN)", + "patterns": [ + { + "begin": "(?=\\[|{)", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "begin": "(?!\\G)", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#flow-mapping" + }, + { + "include": "#flow-sequence" + } + ] + }, + { + "include": "#anchor-property" + }, + { + "include": "#tag-property" + }, + { + "include": "#alias" + }, + { + "begin": "(?=\"|')", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "begin": "(?!\\G)", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#double" + }, + { + "include": "#single" + } + ] + }, + { + "include": "#flow-plain-in" + }, + { + "include": "#presentation-detail" + } + ] + }, + "flow-mapping": { + "comment": "https://yaml.org/spec/1.2.2/#742-flow-mappings", + "begin": "{", + "end": "}", + "beginCaptures": { + "0": { + "name": "punctuation.definition.mapping.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.mapping.end.yaml" + } + }, + "name": "meta.flow.mapping.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-s-flow-map-entries", + "begin": "(?<={)\\G(?=[\\x{85 2028 2029}\r\n\t ,#])|,", + "end": "(?=[^\\x{85 2028 2029}\r\n\t ,#])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.mapping.yaml" + } + }, + "patterns": [ + { + "match": ",++", + "name": "invalid.illegal.separator.sequence.yaml" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#flow-mapping-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + "flow-sequence": { + "comment": "https://yaml.org/spec/1.2.2/#741-flow-sequences", + "begin": "\\[", + "end": "]", + "beginCaptures": { + "0": { + "name": "punctuation.definition.sequence.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.sequence.end.yaml" + } + }, + "name": "meta.flow.sequence.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-s-flow-seq-entries", + "begin": "(?<=\\[)\\G(?=[\\x{85 2028 2029}\r\n\t ,#])|,", + "end": "(?=[^\\x{85 2028 2029}\r\n\t ,#])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.sequence.yaml" + } + }, + "patterns": [ + { + "match": ",++", + "name": "invalid.illegal.separator.sequence.yaml" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#flow-sequence-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + "flow-mapping-map-key": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-entry (FLOW-IN)", + "patterns": [ + { + "begin": "\\?(?=[\\x{85 2028 2029}\r\n\t ,\\[\\]{}])", + "end": "(?=[,\\[\\]{}])", + "beginCaptures": { + "0": { + "name": "punctuation.definition.map.key.yaml" + } + }, + "name": "meta.flow.map.explicit.yaml", + "patterns": [ + { + "include": "#flow-mapping-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-implicit-entry (FLOW-IN)", + "begin": "(?=(?>[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ,\\[\\]{}])))", + "end": "(?=[,\\[\\]{}])", + "name": "meta.flow.map.implicit.yaml", + "patterns": [ + { + "include": "#flow-key-plain-in" + }, + { + "match": ":(?=\\[|{)", + "name": "invalid.illegal.separator.map.yaml" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-implicit-entry (FLOW-IN)", + "begin": "(?=\"|')", + "end": "(?=[,\\[\\]{}])", + "name": "meta.flow.map.implicit.yaml", + "patterns": [ + { + "include": "#key-double" + }, + { + "include": "source.yaml#key-single" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "flow-sequence-map-key": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-entry (FLOW-IN)", + "patterns": [ + { + "begin": "\\?(?=[\\x{85 2028 2029}\r\n\t ,\\[\\]{}])", + "end": "(?=[,\\[\\]{}])", + "beginCaptures": { + "0": { + "name": "punctuation.definition.map.key.yaml" + } + }, + "name": "meta.flow.map.explicit.yaml", + "patterns": [ + { + "include": "#flow-mapping-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-implicit-entry (FLOW-IN)", + "begin": "(?<=[\t ,\\[{]|^)(?=(?>[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))(?>[^:#,\\[\\]{}]++|:(?![\\x{85 2028 2029}\r\n\t ,\\[\\]{}])|(?\"(?>[^\\\\\"]++|\\\\.)*+\"|'(?>[^']++|'')*+')[\t ]*+:)", + "end": "(?=[,\\[\\]{}])", + "name": "meta.flow.map.implicit.yaml", + "patterns": [ + { + "include": "#key-double" + }, + { + "include": "source.yaml#key-single" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "flow-map-value-yaml": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-ns-flow-map-separate-value (FLOW-IN)", + "begin": ":(?=[\\x{85 2028 2029}\r\n\t ,\\[\\]{}])", + "end": "(?=[,\\]}])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.map.value.yaml" + } + }, + "name": "meta.flow.pair.value.yaml", + "patterns": [ + { + "include": "#flow-node" + } + ] + }, + "flow-map-value-json": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-ns-flow-map-separate-value (FLOW-IN)", + "begin": "(?<=(?>[\"'\\]}]|^)[\t ]*+):", + "end": "(?=[,\\]}])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.map.value.yaml" + } + }, + "name": "meta.flow.pair.value.yaml", + "patterns": [ + { + "include": "#flow-node" + } + ] + }, + "flow-plain-in": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-plain-multi-line (FLOW-IN)", + "begin": "(?=[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "end": "(?=(?>[\t ]++|\\G)#|[\t ]*+[,\\[\\]{}])", + "name": "string.unquoted.plain.in.yaml", + "patterns": [ + { + "include": "#tag-implicit-plain-in" + }, + { + "match": "\\G[\t ]++", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "match": "[\t ]++$", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "match": ":(?=[\\x{85 2028 2029}\r\n\t ,\\[\\]{}])", + "name": "invalid.illegal.multiline-key.yaml" + }, + { + "include": "source.yaml#non-printable" + } + ] + }, + "flow-key-plain-out": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-plain-one-line (FLOW-OUT)", + "begin": "(?=[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ]))", + "end": "(?=[\t ]*+:[\\x{85 2028 2029}\r\n\t ]|[\t ]++#)", + "name": "meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", + "patterns": [ + { + "include": "#tag-implicit-plain-out" + }, + { + "match": "\\G[\t ]++", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "match": "[\t ]++$", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "include": "source.yaml#non-printable" + } + ] + }, + "flow-key-plain-in": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-s-implicit-yaml-key (FLOW-KEY)", + "begin": "\\G(?![\\x{85 2028 2029}\r\n\t #])", + "end": "(?=[\t ]*+(?>:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]|[,\\[\\]{}])|[\t ]++#)", + "name": "meta.flow.map.key.yaml string.unquoted.plain.in.yaml entity.name.tag.yaml", + "patterns": [ + { + "include": "#tag-implicit-plain-in" + }, + { + "include": "source.yaml#non-printable" + } + ] + }, + "key-double": { + "comment": "https://yaml.org/spec/1.2.2/#double-quoted-style (FLOW-OUT)", + "begin": "\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.yaml" + } + }, + "name": "meta.map.key.yaml string.quoted.double.yaml entity.name.tag.yaml", + "patterns": [ + { + "match": "[^\t -\\x{10FFFF}]++", + "name": "invalid.illegal.character.yaml" + }, + { + "include": "#double-escape" + } + ] + }, + "double": { + "comment": "https://yaml.org/spec/1.2.2/#double-quoted-style", + "begin": "\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.yaml" + } + }, + "name": "string.quoted.double.yaml", + "patterns": [ + { + "match": "(?x[^\"]{2,0}|u[^\"]{4,0}|U[^\"]{8,0}|.)", + "name": "invalid.illegal.constant.character.escape.yaml" + } + ] + }, + "tag-implicit-plain-in": { + "comment": "https://yaml.org/type/index.html", + "patterns": [ + { + "match": "\\G(?>null|Null|NULL|~)(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.language.null.yaml" + }, + { + "match": "\\G(?>true|True|TRUE|false|False|FALSE|y|Y|yes|Yes|YES|n|N|no|No|NO|on|On|ON|off|Off|OFF)(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.language.boolean.yaml" + }, + { + "match": "\\G[-+]?+(0|[1-9][0-9_]*+)(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.integer.decimal.yaml" + }, + { + "match": "\\G[-+]?+0b[0-1_]++(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.integer.binary.yaml" + }, + { + "match": "\\G[-+]?0[0-7_]++(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.integer.octal.yaml" + }, + { + "match": "\\G[-+]?+0x[0-9a-fA-F_]++(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.integer.hexadecimal.yaml" + }, + { + "match": "\\G[-+]?+[1-9][0-9_]*+(?>:[0-5]?[0-9])++(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.integer.Sexagesimal.yaml" + }, + { + "match": "\\G[-+]?+(?>[0-9][0-9_]*+)?+\\.[0-9.]*+(?>[eE][-+][0-9]+)?+(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.float.decimal.yaml" + }, + { + "match": "\\G[-+]?+[0-9][0-9_]*+(?>:[0-5]?[0-9])++\\.[0-9_]*+(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.float.Sexagesimal.yaml" + }, + { + "match": "\\G[-+]?+\\.(?>inf|Inf|INF)(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.float.inf.yaml" + }, + { + "match": "\\G\\.(?>nan|NaN|NAN)(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.float.nan.yaml" + }, + { + "comment": "https://www.w3.org/TR/NOTE-datetime does not allow spaces, however https://yaml.org/type/timestamp.html does, but the provided regex doesn't match the TZD space in many of the YAML examples", + "match": "\\G(?>[0-9]{4}-[0-9]{2,1}-[0-9]{2,1}(?>T|t|[\t ]++)[0-9]{2,1}:[0-9]{2}:[0-9]{2}(?>\\.[0-9]*+)?+[\t ]*+(?>Z|[-+][0-9]{2,1}(?>:[0-9]{2})?+)?+|[0-9]{4}-[0-9]{2}-[0-9]{2})(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.timestamp.yaml" + }, + { + "match": "\\G<<(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.language.merge.yaml" + }, + { + "match": "\\G=(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.language.value.yaml" + }, + { + "match": "\\G(?>!|&|\\*)(?=[\t ]++#|[\t ]*+(?>[\\x{85 2028 2029}\r\n,\\]}]|:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]))", + "name": "constant.language.yaml.yaml" + } + ] + }, + "tag-implicit-plain-out": { + "comment": "https://yaml.org/type/index.html", + "patterns": [ + { + "match": "\\G(?>null|Null|NULL|~)(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.language.null.yaml" + }, + { + "match": "\\G(?>true|True|TRUE|false|False|FALSE|yes|Yes|YES|y|Y|no|No|NO|n|N|on|On|ON|off|Off|OFF)(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.language.boolean.yaml" + }, + { + "match": "\\G[-+]?+(0|[1-9][0-9_]*+)(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.numeric.integer.decimal.yaml" + }, + { + "match": "\\G[-+]?+0b[0-1_]++(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.numeric.integer.binary.yaml" + }, + { + "match": "\\G[-+]?0[0-7_]++(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.numeric.integer.octal.yaml" + }, + { + "match": "\\G[-+]?+0x[0-9a-fA-F_]++(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.numeric.integer.hexadecimal.yaml" + }, + { + "match": "\\G[-+]?+[1-9][0-9_]*+(?>:[0-5]?[0-9])++(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.numeric.integer.Sexagesimal.yaml" + }, + { + "match": "\\G[-+]?+(?>[0-9][0-9_]*+)?+\\.[0-9.]*+(?>[eE][-+][0-9]+)?+(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.numeric.float.decimal.yaml" + }, + { + "match": "\\G[-+]?+[0-9][0-9_]*+(?>:[0-5]?[0-9])++\\.[0-9_]*+(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.numeric.float.Sexagesimal.yaml" + }, + { + "match": "\\G[-+]?+\\.(?>inf|Inf|INF)(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.numeric.float.inf.yaml" + }, + { + "match": "\\G\\.(?>nan|NaN|NAN)(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.numeric.float.nan.yaml" + }, + { + "comment": "https://www.w3.org/TR/NOTE-datetime does not allow spaces, however https://yaml.org/type/timestamp.html does, but the provided regex doesn't match the TZD space in many of the YAML examples", + "match": "\\G(?>[0-9]{4}-[0-9]{2,1}-[0-9]{2,1}(?>T|t|[\t ]++)[0-9]{2,1}:[0-9]{2}:[0-9]{2}(?>\\.[0-9]*+)?+[\t ]*+(?>Z|[-+][0-9]{2,1}(?>:[0-9]{2})?+)?+|[0-9]{4}-[0-9]{2}-[0-9]{2})(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.numeric.timestamp.yaml" + }, + { + "match": "\\G<<(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.language.merge.yaml" + }, + { + "match": "\\G=(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.language.value.yaml" + }, + { + "match": "\\G(?>!|&|\\*)(?=[\t ]++#|[\t ]*+(?>$|:[\\x{85 2028 2029}\r\n\t ]))", + "name": "constant.language.yaml.yaml" + } + ] + }, + "tag-property": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-ns-tag-property", + "//": [ + "!", + "!!", + "!<>", + "!...", + "!!...", + "!<...>", + "!...!..." + ], + "patterns": [ + { + "match": "!(?=[\\x{85 2028 2029}\r\n\t ])", + "name": "storage.type.tag.non-specific.yaml punctuation.definition.tag.non-specific.yaml" + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-verbatim-tag", + "begin": "!<", + "end": ">", + "beginCaptures": { + "0": { + "name": "punctuation.definition.tag.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.yaml" + } + }, + "name": "storage.type.tag.verbatim.yaml", + "patterns": [ + { + "match": "%[0-9a-fA-F]{2}", + "name": "constant.character.escape.unicode.8-bit.yaml" + }, + { + "match": "%[^\\x{85 2028 2029}\r\n\t ]{2,0}", + "name": "invalid.illegal.constant.character.escape.unicode.8-bit.yaml" + }, + { + "include": "source.yaml#non-printable" + }, + { + "match": "[^\\x{85 2028 2029}\r\n\t a-zA-Z0-9-#;/?:@&=+$,_.!~*'()\\[\\]%>]++", + "name": "invalid.illegal.unrecognized.yaml" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-ns-shorthand-tag", + "begin": "(?=!)", + "end": "(?=[\\x{85 2028 2029}\r\n\t ,\\[\\]{}])", + "name": "storage.type.tag.shorthand.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-secondary-tag-handle", + "match": "\\G!!", + "name": "punctuation.definition.tag.secondary.yaml" + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-secondary-tag-handle", + "match": "\\G(!)[0-9A-Za-z-]++(!)", + "captures": { + "1": { + "name": "punctuation.definition.tag.named.yaml" + }, + "2": { + "name": "punctuation.definition.tag.named.yaml" + } + } + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-primary-tag-handle", + "match": "\\G!", + "name": "punctuation.definition.tag.primary.yaml" + }, + { + "match": "%[0-9a-fA-F]{2}", + "name": "constant.character.escape.unicode.8-bit.yaml" + }, + { + "match": "%[^\\x{85 2028 2029}\r\n\t ]{2,0}", + "name": "invalid.illegal.constant.character.escape.unicode.8-bit.yaml" + }, + { + "include": "source.yaml#non-printable" + }, + { + "match": "[^\\x{85 2028 2029}\r\n\t a-zA-Z0-9-#;/?:@&=+$,_.~*'()\\[\\]%]++", + "name": "invalid.illegal.unrecognized.yaml" + } + ] + } + ] + }, + "anchor-property": { + "match": "(&)([^ \\p{Cntrl}\\p{Surrogate}\\x{2028 2029 FFFE FFFF}]++)|(&)", + "captures": { + "0": { + "name": "keyword.control.flow.anchor.yaml" + }, + "1": { + "name": "punctuation.definition.anchor.yaml" + }, + "2": { + "name": "variable.other.anchor.yaml" + }, + "3": { + "name": "invalid.illegal.flow.anchor.yaml" + } + } + }, + "alias": { + "begin": "(\\*)([^ \\p{Cntrl}\\p{Surrogate}\\x{2028 2029 FFFE FFFF}]++)|(\\*)", + "end": "(?=:[\\x{85 2028 2029}\r\n\t ,\\[\\]{}]|[,\\[\\]{}])", + "captures": { + "0": { + "name": "keyword.control.flow.alias.yaml" + }, + "1": { + "name": "punctuation.definition.alias.yaml" + }, + "2": { + "name": "variable.other.alias.yaml" + }, + "3": { + "name": "invalid.illegal.flow.alias.yaml" + } + }, + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + "byte-order-mark": { + "comment": "", + "begin": "\\G", + "while": "\\G(?=[\\x{FEFF 85 2028 2029}\r\n\t ])", + "patterns": [ + { + "begin": "(?=#)", + "while": "\\G", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + { + "begin": "\\G\\x{FEFF}", + "while": "\\G", + "beginCaptures": { + "0": { + "name": "byte-order-mark.yaml" + } + }, + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#presentation-detail" + } + ] + }, + "presentation-detail": { + "patterns": [ + { + "match": "[\t ]++", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "comment": "https://yaml.org/spec/1.1/#id871136", + "match": "[\\x{85 2028 2029}\r\n]++", + "name": "punctuation.separator.line-break.yaml" + }, + { + "include": "source.yaml#non-printable" + }, + { + "include": "#comment" + }, + { + "include": "#unknown" + } + ] + }, + "comment": { + "comment": "Comments must be separated from other tokens by white space characters. `space`, `newline` or `carriage-return`. `#(.*)` causes performance issues", + "begin": "(?<=^|[\\x{FEFF 85 2028 2029} ])#", + "end": "[\\x{85 2028 2029}\r\n]", + "captures": { + "0": { + "name": "punctuation.definition.comment.yaml" + } + }, + "name": "comment.line.number-sign.yaml", + "patterns": [ + { + "include": "source.yaml#non-printable" + } + ] + }, + "unknown": { + "match": ".[[^\\x{85 2028 2029}#\"':,\\[\\]{}]&&!-~\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}]*+", + "name": "invalid.illegal.unrecognized.yaml" + } + } +} \ No newline at end of file diff --git a/extensions/yaml/syntaxes/yaml-1.2.tmLanguage.json b/extensions/yaml/syntaxes/yaml-1.2.tmLanguage.json new file mode 100644 index 00000000000..5571102d9e0 --- /dev/null +++ b/extensions/yaml/syntaxes/yaml-1.2.tmLanguage.json @@ -0,0 +1,1635 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/RedCMD/YAML-Syntax-Highlighter/blob/master/syntaxes/yaml-1.2.tmLanguage.json", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "version": "https://github.com/RedCMD/YAML-Syntax-Highlighter/commit/71a88711ec184b7dde5240c8f150ad3c2dbbd5f1", + "name": "YAML 1.2", + "scopeName": "source.yaml.1.2", + "comment": "https://yaml.org/spec/1.2.2", + "patterns": [ + { + "include": "#stream" + } + ], + "repository": { + "stream": { + "patterns": [ + { + "comment": "allows me to just use `\\G` instead of the performance heavy `(^|\\G)`", + "begin": "^(?!\\G)", + "while": "^", + "name": "meta.stream.yaml", + "patterns": [ + { + "include": "#byte-order-mark" + }, + { + "include": "#directives" + }, + { + "include": "#document" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "comment": "For when YAML is embedded inside a Markdown code-block", + "begin": "\\G", + "while": "\\G", + "name": "meta.stream.yaml", + "patterns": [ + { + "include": "#byte-order-mark" + }, + { + "include": "#directives" + }, + { + "include": "#document" + }, + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "directive-YAML": { + "comment": "https://yaml.org/spec/1.2.2/#681-yaml-directives", + "begin": "(?=%YAML[\t ]+1\\.2(?=[\r\n\t ]))", + "end": "\\G(?=(?>\\.{3}|---)[\r\n\t ])", + "name": "meta.1.2.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#681-yaml-directives", + "begin": "\\G(%)(YAML)([\t ]+)(1\\.2)", + "end": "\\G(?=---[\r\n\t ])", + "beginCaptures": { + "1": { + "name": "punctuation.definition.directive.begin.yaml" + }, + "2": { + "name": "keyword.other.directive.yaml.yaml" + }, + "3": { + "name": "punctuation.whitespace.separator.yaml" + }, + "4": { + "name": "constant.numeric.yaml-version.yaml" + } + }, + "name": "meta.directives.yaml", + "patterns": [ + { + "include": "#directive-invalid" + }, + { + "include": "#directives" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#document" + } + ] + }, + "directives": { + "comment": "https://yaml.org/spec/1.2.2/#68-directives", + "patterns": [ + { + "include": "source.yaml.1.3#directive-YAML" + }, + { + "include": "source.yaml.1.2#directive-YAML" + }, + { + "include": "source.yaml.1.1#directive-YAML" + }, + { + "include": "source.yaml.1.0#directive-YAML" + }, + { + "begin": "(?=%)", + "while": "\\G(?!%|---[\r\n\t ])", + "name": "meta.directives.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#682-tag-directives", + "begin": "\\G(%)(TAG)(?>([\t ]++)((!)(?>[0-9A-Za-z-]*+(!))?+))?+", + "end": "$", + "applyEndPatternLast": true, + "beginCaptures": { + "1": { + "name": "punctuation.definition.directive.begin.yaml" + }, + "2": { + "name": "keyword.other.directive.tag.yaml" + }, + "3": { + "name": "punctuation.whitespace.separator.yaml" + }, + "4": { + "name": "storage.type.tag-handle.yaml" + }, + "5": { + "name": "punctuation.definition.tag.begin.yaml" + }, + "6": { + "name": "punctuation.definition.tag.end.yaml" + }, + "comment": "https://yaml.org/spec/1.2.2/#rule-c-tag-handle" + }, + "patterns": [ + { + "comment": "technically the beginning should only validate against a valid uri scheme [A-Za-z][A-Za-z0-9.+-]*", + "begin": "\\G[\t ]++(?!#)", + "end": "(?=[\r\n\t ])", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.separator.yaml" + } + }, + "contentName": "support.type.tag-prefix.yaml", + "patterns": [ + { + "match": "%[0-9a-fA-F]{2}", + "name": "constant.character.escape.unicode.8-bit.yaml" + }, + { + "match": "%[^\r\n\t ]{2,0}", + "name": "invalid.illegal.constant.character.escape.unicode.8-bit.yaml" + }, + { + "match": "\\G[,\\[\\]{}]", + "name": "invalid.illegal.character.uri.yaml" + }, + { + "include": "source.yaml#non-printable" + }, + { + "match": "[^\r\n\t a-zA-Z0-9-#;/?:@&=+$,_.!~*'()\\[\\]]++", + "name": "invalid.illegal.unrecognized.yaml" + } + ] + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-reserved-directive", + "begin": "(%)([\\x{85}[^ \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]++)", + "end": "$", + "beginCaptures": { + "1": { + "name": "punctuation.definition.directive.begin.yaml" + }, + "2": { + "name": "keyword.other.directive.other.yaml" + } + }, + "patterns": [ + { + "match": "\\G([\t ]++)([\\x{85}[^ \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]++)", + "captures": { + "1": { + "name": "punctuation.whitespace.separator.yaml" + }, + "2": { + "name": "string.unquoted.directive-name.yaml" + } + } + }, + { + "match": "([\t ]++)([\\x{85}[^ \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]++)", + "captures": { + "1": { + "name": "punctuation.whitespace.separator.yaml" + }, + "2": { + "name": "string.unquoted.directive-parameter.yaml" + } + } + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "match": "\\G\\.{3}(?=[\r\n\t ])", + "name": "invalid.illegal.entity.other.document.end.yaml" + }, + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "directive-invalid": { + "patterns": [ + { + "match": "\\G\\.{3}(?=[\r\n\t ])", + "name": "invalid.illegal.entity.other.document.end.yaml" + }, + { + "begin": "\\G(%)(YAML)", + "end": "$", + "beginCaptures": { + "1": { + "name": "punctuation.definition.directive.begin.yaml" + }, + "2": { + "name": "invalid.illegal.keyword.other.directive.yaml.yaml" + } + }, + "name": "meta.directive.yaml", + "patterns": [ + { + "match": "\\G([\t ]++|:)([0-9]++\\.[0-9]++)?+", + "captures": { + "1": { + "name": "punctuation.whitespace.separator.yaml" + }, + "2": { + "name": "constant.numeric.yaml-version.yaml" + } + } + }, + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "document": { + "comment": "https://yaml.org/spec/1.2.2/#91-documents", + "patterns": [ + { + "begin": "---(?=[\r\n\t ])", + "while": "\\G(?!(?>\\.{3}|---)[\r\n\t ])", + "beginCaptures": { + "0": { + "name": "entity.other.document.begin.yaml" + } + }, + "name": "meta.document.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + }, + { + "begin": "(?=\\.{3}[\r\n\t ])", + "while": "\\G(?=[\t \\x{FEFF}]*+(?>#|$))", + "patterns": [ + { + "begin": "\\G\\.{3}", + "end": "$", + "beginCaptures": { + "0": { + "name": "entity.other.document.end.yaml" + } + }, + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#byte-order-mark" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "begin": "\\G(?!%|[\t \\x{FEFF}]*+(?>#|$))", + "while": "\\G(?!(?>\\.{3}|---)[\r\n\t ])", + "name": "meta.document.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + } + ] + }, + "block-node": { + "patterns": [ + { + "include": "#block-sequence" + }, + { + "include": "#block-mapping" + }, + { + "include": "#block-scalar" + }, + { + "include": "#anchor-property" + }, + { + "include": "#tag-property" + }, + { + "include": "#alias" + }, + { + "begin": "(?=\"|')", + "while": "\\G", + "patterns": [ + { + "begin": "(?!\\G)", + "while": "\\G", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#double" + }, + { + "include": "#single" + } + ] + }, + { + "begin": "(?={)", + "end": "$", + "patterns": [ + { + "include": "#flow-mapping" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "begin": "(?=\\[)", + "end": "$", + "patterns": [ + { + "include": "#flow-sequence" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#block-plain-out" + }, + { + "include": "#presentation-detail" + } + ] + }, + "block-mapping": { + "//": "The check for plain keys is expensive", + "begin": "(?=((?<=[-?:]) )?+)(?((?>[!&*][^\r\n\t ]*+[\t ]++)*+)(?=(?>(?#Double Quote)\"(?>[^\\\\\"]++|\\\\.)*+\"|(?#Single Quote)'(?>[^']++|'')*+'|(?#Flow-Map){(?>[^}]++|}[ \t]*+(?!:[\r\n\t ]))++}|(?#Flow-Seq)\\[(?>[^]]++|][ \t]*+(?!:[\r\n\t ]))++]|(?#Plain)(?>[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ]))(?>[^:#]++|:(?![\r\n\t ])|(?(\\1\\2)((?>[!&*][^\r\n\t ]*+[\t ]++)*+)((?>\t[\t ]*+)?+[^\r\n\t ?:\\-#!&*\"'\\[\\]{}0-9A-Za-z$()+./;<=\\\\^_~\\x{85}\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}])?+|( *+)([\t ]*+[^\r\n#])?+)", + "beginCaptures": { + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "punctuation.whitespace.separator.yaml" + }, + "4": { + "comment": "May cause lag on long lines starting with a tag, anchor or alias", + "patterns": [ + { + "include": "#tag-property" + }, + { + "include": "#anchor-property" + }, + { + "include": "#alias" + }, + { + "include": "#presentation-detail" + } + ] + } + }, + "whileCaptures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "comment": "May cause lag on long lines starting with a tag, anchor or alias", + "patterns": [ + { + "include": "#tag-property" + }, + { + "include": "#anchor-property" + }, + { + "include": "#alias" + }, + { + "include": "#presentation-detail" + } + ] + }, + "3": { + "name": "invalid.illegal.expected-indentation.yaml" + }, + "4": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "5": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "name": "meta.mapping.yaml", + "patterns": [ + { + "include": "#block-map-key-double" + }, + { + "include": "source.yaml#block-map-key-single" + }, + { + "include": "#block-map-key-plain" + }, + { + "include": "#block-map-key-explicit" + }, + { + "include": "#block-map-value" + }, + { + "include": "#flow-mapping" + }, + { + "include": "#flow-sequence" + }, + { + "include": "#presentation-detail" + } + ] + }, + "block-sequence": { + "comment": "https://yaml.org/spec/1.2.2/#rule-l+block-sequence", + "begin": "(?=((?<=[-?:]) )?+)(?(\\1\\2)(?!-[\r\n\t ])((?>\t[\t ]*+)?+[^\r\n\t #\\]}])?+|(?!\\1\\2)( *+)([\t ]*+[^\r\n#])?+)", + "beginCaptures": { + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "punctuation.definition.block.sequence.item.yaml" + } + }, + "whileCaptures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "name": "invalid.illegal.expected-indentation.yaml" + }, + "3": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "4": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "name": "meta.block.sequence.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + }, + "block-map-key-explicit": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-l-block-map-explicit-key", + "begin": "(?=((?<=[-?:]) )?+)\\G( *+)(\\?)(?=[\r\n\t ])", + "while": "\\G(?>(\\1\\2)(?![?:0-9A-Za-z$()+./;<=\\\\^_~\\x{85}\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}&&[^\\x{FEFF}]])((?>\t[\t ]*+)?+[^\r\n\t #\\-\\[\\]{}])?+|(?!\\1\\2)( *+)([\t ]*+[^\r\n#])?+)", + "beginCaptures": { + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "punctuation.definition.map.key.yaml" + }, + "4": { + "name": "punctuation.whitespace.separator.yaml" + } + }, + "whileCaptures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "name": "invalid.illegal.expected-indentation.yaml" + }, + "3": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "4": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "name": "meta.map.explicit.yaml", + "patterns": [ + { + "include": "#key-double" + }, + { + "include": "source.yaml#key-single" + }, + { + "include": "#flow-key-plain-out" + }, + { + "include": "#block-map-value" + }, + { + "include": "#block-node" + } + ] + }, + "block-map-key-double": { + "comment": "https://yaml.org/spec/1.2.2/#double-quoted-style (BLOCK-KEY)", + "begin": "\\G\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.yaml" + } + }, + "name": "meta.map.key.yaml string.quoted.double.yaml entity.name.tag.yaml", + "patterns": [ + { + "match": ".[\t ]*+$", + "name": "invalid.illegal.multiline-key.yaml" + }, + { + "match": "[^\t -\\x{10FFFF}]++", + "name": "invalid.illegal.character.yaml" + }, + { + "include": "#double-escape" + } + ] + }, + "block-map-key-plain": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-plain-one-line (BLOCK-KEY)", + "begin": "\\G(?=[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ]))", + "end": "(?=[\t ]*+:[\r\n\t ]|(?>[\t ]++|\\G)#)", + "name": "meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", + "patterns": [ + { + "include": "#tag-implicit-plain-out" + }, + { + "match": "\\G([\t ]++)(.)", + "captures": { + "1": { + "name": "punctuation.whitespace.separator.yaml" + }, + "2": { + "name": "invalid.illegal.multiline-key.yaml" + } + } + }, + { + "match": "[\t ]++$", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "match": "\\x{FEFF}", + "name": "invalid.illegal.bom.yaml" + }, + { + "include": "source.yaml#non-printable" + } + ] + }, + "block-map-value": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-l-block-map-implicit-value", + "//": "Assumming 3rd party preprocessing variables `{{...}}` turn into valid map-keys when inside a block-mapping", + "begin": ":(?=[\r\n\t ])|(?<=}})(?=[\t ]++#|[\t ]*+$)", + "while": "\\G(?![?:!\"'0-9A-Za-z$()+./;<=\\\\^_~\\[{\\x{85}\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}&&[^\\x{FEFF}]]|-[^\r\n\t ])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.map.value.yaml" + } + }, + "name": "meta.map.value.yaml", + "patterns": [ + { + "include": "#block-node" + } + ] + }, + "block-scalar": { + "comment": "https://yaml.org/spec/1.2.2/#81-block-scalar-styles", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#8111-block-indentation-indicator", + "begin": "(?>(\\|)|(>))(?[+-])?+((1)|(2)|(3)|(4)|(5)|(6)|(7)|(8)|(9))(?()|([+-]))?+", + "while": "\\G(?>(?>(?!\\5) |(?!\\6) {2}|(?!\\7) {3}|(?!\\8) {4}|(?!\\9) {5}|(?!\\10) {6}|(?!\\11) {7}|(?!\\12) {8}|(?!\\13) {9})| *+($|[^#]))", + "beginCaptures": { + "1": { + "name": "keyword.control.flow.block-scalar.literal.yaml" + }, + "2": { + "name": "keyword.control.flow.block-scalar.folded.yaml" + }, + "3": { + "name": "storage.modifier.chomping-indicator.yaml" + }, + "4": { + "name": "constant.numeric.indentation-indicator.yaml" + }, + "14": { + "name": "storage.modifier.chomping-indicator.yaml" + } + }, + "whileCaptures": { + "0": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "1": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "name": "meta.scalar.yaml", + "patterns": [ + { + "begin": "$", + "while": "\\G", + "contentName": "string.unquoted.block.yaml", + "patterns": [ + { + "include": "source.yaml#non-printable" + } + ] + }, + { + "begin": "\\G", + "end": "$", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-b-block-header", + "//": "Soooooooo many edge cases", + "begin": "(?>(\\|)|(>))([+-]?+)", + "while": "\\G", + "beginCaptures": { + "1": { + "name": "keyword.control.flow.block-scalar.literal.yaml" + }, + "2": { + "name": "keyword.control.flow.block-scalar.folded.yaml" + }, + "3": { + "name": "storage.modifier.chomping-indicator.yaml" + } + }, + "name": "meta.scalar.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-l-literal-content", + "begin": "$", + "while": "\\G", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-l-nb-literal-text", + "//": "Find the highest indented line", + "begin": "\\G( ++)$", + "while": "\\G(?>(\\1)$|(?!\\1)( *+)($|.))", + "captures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "contentName": "string.unquoted.block.yaml", + "patterns": [ + { + "include": "source.yaml#non-printable" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-b-nb-literal-next", + "//": [ + "Funky wrapper function", + "The `end` pattern clears the parent `\\G` anchor", + "Affectively forcing this rule to only match at most once", + "https://github.com/microsoft/vscode-textmate/issues/114" + ], + "begin": "\\G(?!$)(?=( *+))", + "end": "\\G(?!\\1)(?=[\t ]*+#)", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-l-nb-literal-text", + "begin": "\\G( *+)", + "while": "\\G(?>(\\1)|( *+)($|[^\t#]|[\t ]++[^#]))", + "captures": { + "1": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "2": { + "name": "punctuation.whitespace.indentation.yaml" + }, + "3": { + "name": "invalid.illegal.expected-indentation.yaml" + } + }, + "contentName": "string.unquoted.block.yaml", + "patterns": [ + { + "include": "source.yaml#non-printable" + } + ] + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-l-chomped-empty", + "begin": "(?!\\G)(?=[\t ]*+#)", + "while": "\\G", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + } + ] + }, + { + "comment": "Header Comment", + "begin": "\\G", + "end": "$", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + } + ] + } + ] + }, + "block-plain-out": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-plain-multi-line (FLOW-OUT)", + "begin": "(?=[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ]))", + "while": "\\G", + "patterns": [ + { + "begin": "\\G", + "end": "(?=(?>[\t ]++|\\G)#)", + "name": "string.unquoted.plain.out.yaml", + "patterns": [ + { + "include": "#tag-implicit-plain-out" + }, + { + "match": ":(?=[\r\n\t ])", + "name": "invalid.illegal.multiline-key.yaml" + }, + { + "match": "\\G[\t ]++", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "match": "[\t ]++$", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "match": "\\x{FEFF}", + "name": "invalid.illegal.bom.yaml" + }, + { + "include": "source.yaml#non-printable" + } + ] + }, + { + "begin": "(?!\\G)", + "while": "\\G", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "flow-node": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-seq-entry (FLOW-IN)", + "patterns": [ + { + "begin": "(?=\\[|{)", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "begin": "(?!\\G)", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#flow-mapping" + }, + { + "include": "#flow-sequence" + } + ] + }, + { + "include": "#anchor-property" + }, + { + "include": "#tag-property" + }, + { + "include": "#alias" + }, + { + "begin": "(?=\"|')", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "begin": "(?!\\G)", + "end": "(?=[:,\\]}])", + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#double" + }, + { + "include": "#single" + } + ] + }, + { + "include": "#flow-plain-in" + }, + { + "include": "#presentation-detail" + } + ] + }, + "flow-mapping": { + "comment": "https://yaml.org/spec/1.2.2/#742-flow-mappings", + "begin": "{", + "end": "}", + "beginCaptures": { + "0": { + "name": "punctuation.definition.mapping.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.mapping.end.yaml" + } + }, + "name": "meta.flow.mapping.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-s-flow-map-entries", + "begin": "(?<={)\\G(?=[\r\n\t ,#])|,", + "end": "(?=[^\r\n\t ,#])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.mapping.yaml" + } + }, + "patterns": [ + { + "match": ",++", + "name": "invalid.illegal.separator.sequence.yaml" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#flow-mapping-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + "flow-sequence": { + "comment": "https://yaml.org/spec/1.2.2/#741-flow-sequences", + "begin": "\\[", + "end": "]", + "beginCaptures": { + "0": { + "name": "punctuation.definition.sequence.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.sequence.end.yaml" + } + }, + "name": "meta.flow.sequence.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-s-flow-seq-entries", + "begin": "(?<=\\[)\\G(?=[\r\n\t ,#])|,", + "end": "(?=[^\r\n\t ,#])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.sequence.yaml" + } + }, + "patterns": [ + { + "match": ",++", + "name": "invalid.illegal.separator.sequence.yaml" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "include": "#flow-sequence-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + "flow-mapping-map-key": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-entry (FLOW-IN)", + "patterns": [ + { + "begin": "\\?(?=[\r\n\t ,\\[\\]{}])", + "end": "(?=[,\\[\\]{}])", + "beginCaptures": { + "0": { + "name": "punctuation.definition.map.key.yaml" + } + }, + "name": "meta.flow.map.explicit.yaml", + "patterns": [ + { + "include": "#flow-mapping-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-implicit-entry (FLOW-IN)", + "begin": "(?=(?>[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ,\\[\\]{}])))", + "end": "(?=[,\\[\\]{}])", + "name": "meta.flow.map.implicit.yaml", + "patterns": [ + { + "include": "#flow-key-plain-in" + }, + { + "match": ":(?=\\[|{)", + "name": "invalid.illegal.separator.map.yaml" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#presentation-detail" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-implicit-entry (FLOW-IN)", + "begin": "(?=\"|')", + "end": "(?=[,\\[\\]{}])", + "name": "meta.flow.map.implicit.yaml", + "patterns": [ + { + "include": "#key-double" + }, + { + "include": "source.yaml#key-single" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "flow-sequence-map-key": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-entry (FLOW-IN)", + "patterns": [ + { + "begin": "\\?(?=[\r\n\t ,\\[\\]{}])", + "end": "(?=[,\\[\\]{}])", + "beginCaptures": { + "0": { + "name": "punctuation.definition.map.key.yaml" + } + }, + "name": "meta.flow.map.explicit.yaml", + "patterns": [ + { + "include": "#flow-mapping-map-key" + }, + { + "include": "#flow-map-value-yaml" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#flow-node" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-flow-map-implicit-entry (FLOW-IN)", + "begin": "(?<=[\t ,\\[{]|^)(?=(?>[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ,\\[\\]{}]))(?>[^:#,\\[\\]{}]++|:(?![\r\n\t ,\\[\\]{}])|(?\"(?>[^\\\\\"]++|\\\\.)*+\"|'(?>[^']++|'')*+')[\t ]*+:)", + "end": "(?=[,\\[\\]{}])", + "name": "meta.flow.map.implicit.yaml", + "patterns": [ + { + "include": "#key-double" + }, + { + "include": "source.yaml#key-single" + }, + { + "include": "#flow-map-value-json" + }, + { + "include": "#presentation-detail" + } + ] + } + ] + }, + "flow-map-value-yaml": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-ns-flow-map-separate-value (FLOW-IN)", + "begin": ":(?=[\r\n\t ,\\[\\]{}])", + "end": "(?=[,\\]}])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.map.value.yaml" + } + }, + "name": "meta.flow.pair.value.yaml", + "patterns": [ + { + "include": "#flow-node" + } + ] + }, + "flow-map-value-json": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-ns-flow-map-separate-value (FLOW-IN)", + "begin": "(?<=(?>[\"'\\]}]|^)[\t ]*+):", + "end": "(?=[,\\]}])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.map.value.yaml" + } + }, + "name": "meta.flow.pair.value.yaml", + "patterns": [ + { + "include": "#flow-node" + } + ] + }, + "flow-plain-in": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-plain-multi-line (FLOW-IN)", + "begin": "(?=[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ,\\[\\]{}]))", + "end": "(?=(?>[\t ]++|\\G)#|[\t ]*+[,\\[\\]{}])", + "name": "string.unquoted.plain.in.yaml", + "patterns": [ + { + "include": "#tag-implicit-plain-in" + }, + { + "match": "\\G[\t ]++", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "match": "[\t ]++$", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "match": ":(?=[\r\n\t ,\\[\\]{}])", + "name": "invalid.illegal.multiline-key.yaml" + }, + { + "match": "\\x{FEFF}", + "name": "invalid.illegal.bom.yaml" + }, + { + "include": "source.yaml#non-printable" + } + ] + }, + "flow-key-plain-out": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-plain-one-line (FLOW-OUT)", + "begin": "(?=[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ]))", + "end": "(?=[\t ]*+:[\r\n\t ]|[\t ]++#)", + "name": "meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml", + "patterns": [ + { + "include": "#tag-implicit-plain-out" + }, + { + "match": "\\G[\t ]++", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "match": "[\t ]++$", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "match": "\\x{FEFF}", + "name": "invalid.illegal.bom.yaml" + }, + { + "include": "source.yaml#non-printable" + } + ] + }, + "flow-key-plain-in": { + "comment": "https://yaml.org/spec/1.2.2/#rule-ns-s-implicit-yaml-key (FLOW-KEY)", + "begin": "\\G(?![\r\n\t #])", + "end": "(?=[\t ]*+(?>:[\r\n\t ,\\[\\]{}]|[,\\[\\]{}])|[\t ]++#)", + "name": "meta.flow.map.key.yaml string.unquoted.plain.in.yaml entity.name.tag.yaml", + "patterns": [ + { + "include": "#tag-implicit-plain-in" + }, + { + "match": "\\x{FEFF}", + "name": "invalid.illegal.bom.yaml" + }, + { + "include": "source.yaml#non-printable" + } + ] + }, + "key-double": { + "comment": "https://yaml.org/spec/1.2.2/#double-quoted-style (FLOW-OUT)", + "begin": "\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.yaml" + } + }, + "name": "meta.map.key.yaml string.quoted.double.yaml entity.name.tag.yaml", + "patterns": [ + { + "match": "[^\t -\\x{10FFFF}]++", + "name": "invalid.illegal.character.yaml" + }, + { + "include": "#double-escape" + } + ] + }, + "double": { + "comment": "https://yaml.org/spec/1.2.2/#double-quoted-style", + "begin": "\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.yaml" + } + }, + "name": "string.quoted.double.yaml", + "patterns": [ + { + "match": "(?x[^\"]{2,0}|u[^\"]{4,0}|U[^\"]{8,0}|.)", + "name": "invalid.illegal.constant.character.escape.yaml" + } + ] + }, + "tag-implicit-plain-in": { + "comment": "https://yaml.org/spec/1.2.2/#103-core-schema", + "patterns": [ + { + "match": "\\G(?>null|Null|NULL|~)(?=[\t ]++#|[\t ]*+(?>[\r\n,\\]}]|:[\r\n\t ,\\[\\]{}]))", + "name": "constant.language.null.yaml" + }, + { + "match": "\\G(?>true|True|TRUE|false|False|FALSE)(?=[\t ]++#|[\t ]*+(?>[\r\n,\\]}]|:[\r\n\t ,\\[\\]{}]))", + "name": "constant.language.boolean.yaml" + }, + { + "match": "\\G[+-]?+[0-9]++(?=[\t ]++#|[\t ]*+(?>[\r\n,\\]}]|:[\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.integer.decimal.yaml" + }, + { + "match": "\\G0o[0-7]++(?=[\t ]++#|[\t ]*+(?>[\r\n,\\]}]|:[\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.integer.octal.yaml" + }, + { + "match": "\\G0x[0-9a-fA-F]++(?=[\t ]++#|[\t ]*+(?>[\r\n,\\]}]|:[\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.integer.hexadecimal.yaml" + }, + { + "match": "\\G[+-]?+(?>\\.[0-9]++|[0-9]++(?>\\.[0-9]*+)?+)(?>[eE][+-]?+[0-9]++)?+(?=[\t ]++#|[\t ]*+(?>[\r\n,\\]}]|:[\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.float.yaml" + }, + { + "match": "\\G[+-]?+\\.(?>inf|Inf|INF)(?=[\t ]++#|[\t ]*+(?>[\r\n,\\]}]|:[\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.float.inf.yaml" + }, + { + "match": "\\G\\.(?>nan|NaN|NAN)(?=[\t ]++#|[\t ]*+(?>[\r\n,\\]}]|:[\r\n\t ,\\[\\]{}]))", + "name": "constant.numeric.float.nan.yaml" + } + ] + }, + "tag-implicit-plain-out": { + "comment": "https://yaml.org/spec/1.2.2/#103-core-schema", + "patterns": [ + { + "match": "\\G(?>null|Null|NULL|~)(?=[\t ]++#|[\t ]*+(?>$|:[\r\n\t ]))", + "name": "constant.language.null.yaml" + }, + { + "match": "\\G(?>true|True|TRUE|false|False|FALSE)(?=[\t ]++#|[\t ]*+(?>$|:[\r\n\t ]))", + "name": "constant.language.boolean.yaml" + }, + { + "match": "\\G[+-]?+[0-9]++(?=[\t ]++#|[\t ]*+(?>$|:[\r\n\t ]))", + "name": "constant.numeric.integer.decimal.yaml" + }, + { + "match": "\\G0o[0-7]++(?=[\t ]++#|[\t ]*+(?>$|:[\r\n\t ]))", + "name": "constant.numeric.integer.octal.yaml" + }, + { + "match": "\\G0x[0-9a-fA-F]++(?=[\t ]++#|[\t ]*+(?>$|:[\r\n\t ]))", + "name": "constant.numeric.integer.hexadecimal.yaml" + }, + { + "match": "\\G[+-]?+(?>\\.[0-9]++|[0-9]++(?>\\.[0-9]*+)?+)(?>[eE][+-]?+[0-9]++)?+(?=[\t ]++#|[\t ]*+(?>$|:[\r\n\t ]))", + "name": "constant.numeric.float.yaml" + }, + { + "match": "\\G[+-]?+\\.(?>inf|Inf|INF)(?=[\t ]++#|[\t ]*+(?>$|:[\r\n\t ]))", + "name": "constant.numeric.float.inf.yaml" + }, + { + "match": "\\G\\.(?>nan|NaN|NAN)(?=[\t ]++#|[\t ]*+(?>$|:[\r\n\t ]))", + "name": "constant.numeric.float.nan.yaml" + } + ] + }, + "tag-property": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-ns-tag-property", + "//": [ + "!", + "!!", + "!<>", + "!...", + "!!...", + "!<...>", + "!...!..." + ], + "patterns": [ + { + "match": "!(?=[\r\n\t ])", + "name": "storage.type.tag.non-specific.yaml punctuation.definition.tag.non-specific.yaml" + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-verbatim-tag", + "begin": "!<", + "end": ">", + "beginCaptures": { + "0": { + "name": "punctuation.definition.tag.begin.yaml" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.yaml" + } + }, + "name": "storage.type.tag.verbatim.yaml", + "patterns": [ + { + "match": "%[0-9a-fA-F]{2}", + "name": "constant.character.escape.unicode.8-bit.yaml" + }, + { + "match": "%[^\r\n\t ]{2,0}", + "name": "invalid.illegal.constant.character.escape.unicode.8-bit.yaml" + }, + { + "include": "source.yaml#non-printable" + }, + { + "match": "[^\r\n\t a-zA-Z0-9-#;/?:@&=+$,_.!~*'()\\[\\]%>]++", + "name": "invalid.illegal.unrecognized.yaml" + } + ] + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-ns-shorthand-tag", + "begin": "(?=!)", + "end": "(?=[\r\n\t ,\\[\\]{}])", + "name": "storage.type.tag.shorthand.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-secondary-tag-handle", + "match": "\\G!!", + "name": "punctuation.definition.tag.secondary.yaml" + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-secondary-tag-handle", + "match": "\\G(!)[0-9A-Za-z-]++(!)", + "captures": { + "1": { + "name": "punctuation.definition.tag.named.yaml" + }, + "2": { + "name": "punctuation.definition.tag.named.yaml" + } + } + }, + { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-primary-tag-handle", + "match": "\\G!", + "name": "punctuation.definition.tag.primary.yaml" + }, + { + "match": "%[0-9a-fA-F]{2}", + "name": "constant.character.escape.unicode.8-bit.yaml" + }, + { + "match": "%[^\r\n\t ]{2,0}", + "name": "invalid.illegal.constant.character.escape.unicode.8-bit.yaml" + }, + { + "include": "source.yaml#non-printable" + }, + { + "match": "[^\r\n\t a-zA-Z0-9-#;/?:@&=+$_.~*'()%]++", + "name": "invalid.illegal.unrecognized.yaml" + } + ] + } + ] + }, + "anchor-property": { + "match": "(&)([\\x{85}[^ ,\\[\\]{}\\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]++)|(&)", + "captures": { + "0": { + "name": "keyword.control.flow.anchor.yaml" + }, + "1": { + "name": "punctuation.definition.anchor.yaml" + }, + "2": { + "name": "variable.other.anchor.yaml" + }, + "3": { + "name": "invalid.illegal.flow.anchor.yaml" + } + } + }, + "alias": { + "begin": "(\\*)([\\x{85}[^ ,\\[\\]{}\\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]++)|(\\*)", + "end": "(?=:[\r\n\t ,\\[\\]{}]|[,\\[\\]{}])", + "captures": { + "0": { + "name": "keyword.control.flow.alias.yaml" + }, + "1": { + "name": "punctuation.definition.alias.yaml" + }, + "2": { + "name": "variable.other.alias.yaml" + }, + "3": { + "name": "invalid.illegal.flow.alias.yaml" + } + }, + "patterns": [ + { + "include": "#presentation-detail" + } + ] + }, + "byte-order-mark": { + "comment": "", + "match": "\\G\\x{FEFF}++", + "name": "byte-order-mark.yaml" + }, + "presentation-detail": { + "patterns": [ + { + "match": "[\t ]++", + "name": "punctuation.whitespace.separator.yaml" + }, + { + "include": "source.yaml#non-printable" + }, + { + "include": "#comment" + }, + { + "include": "#unknown" + } + ] + }, + "comment": { + "comment": "Comments must be separated from other tokens by white space characters. `space`, `tab`, `newline` or `carriage-return`. `#(.*)` causes performance issues", + "begin": "(?<=[\\x{FEFF}\t ]|^)#", + "end": "\r|\n", + "captures": { + "0": { + "name": "punctuation.definition.comment.yaml" + } + }, + "name": "comment.line.number-sign.yaml", + "patterns": [ + { + "include": "source.yaml#non-printable" + } + ] + }, + "unknown": { + "match": ".[[^\"':,\\[\\]{}]&&!-~\\x{85}\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}]*+", + "name": "invalid.illegal.unrecognized.yaml" + } + } +} \ No newline at end of file diff --git a/extensions/yaml/syntaxes/yaml-1.3.tmLanguage.json b/extensions/yaml/syntaxes/yaml-1.3.tmLanguage.json new file mode 100644 index 00000000000..8df69f61c8c --- /dev/null +++ b/extensions/yaml/syntaxes/yaml-1.3.tmLanguage.json @@ -0,0 +1,60 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/RedCMD/YAML-Syntax-Highlighter/blob/master/syntaxes/yaml-1.3.tmLanguage.json", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "version": "https://github.com/RedCMD/YAML-Syntax-Highlighter/commit/274009903e20ac6dc37ba5763fb853744e28c9b2", + "name": "YAML 1.3", + "scopeName": "source.yaml.1.3", + "comment": "https://spec.yaml.io/main/spec/1.3.0/", + "patterns": [ + { + "include": "source.yaml" + } + ], + "repository": { + "directive-YAML": { + "comment": "https://yaml.org/spec/1.2.2/#681-yaml-directives", + "begin": "(?=%YAML[\t ]+1\\.3(?=[\r\n\t ]))", + "end": "\\G(?=(?>\\.{3}|---)[\r\n\t ])", + "name": "meta.1.3.yaml", + "patterns": [ + { + "comment": "https://yaml.org/spec/1.2.2/#681-yaml-directives", + "begin": "\\G(%)(YAML)([\t ]+)(1\\.3)", + "end": "\\G(?=---[\r\n\t ])", + "beginCaptures": { + "1": { + "name": "punctuation.definition.directive.begin.yaml" + }, + "2": { + "name": "keyword.other.directive.yaml.yaml" + }, + "3": { + "name": "punctuation.whitespace.separator.yaml" + }, + "4": { + "name": "constant.numeric.yaml-version.yaml" + } + }, + "name": "meta.directives.yaml", + "patterns": [ + { + "include": "source.yaml.1.2#directive-invalid" + }, + { + "include": "source.yaml.1.2#directives" + }, + { + "include": "source.yaml.1.2#presentation-detail" + } + ] + }, + { + "include": "source.yaml.1.2#document" + } + ] + } + } +} \ No newline at end of file diff --git a/extensions/yaml/syntaxes/yaml.tmLanguage.json b/extensions/yaml/syntaxes/yaml.tmLanguage.json index 447df713901..3a64fbd850e 100644 --- a/extensions/yaml/syntaxes/yaml.tmLanguage.json +++ b/extensions/yaml/syntaxes/yaml.tmLanguage.json @@ -1,621 +1,106 @@ { "information_for_contributors": [ - "This file has been converted from https://github.com/textmate/yaml.tmbundle/blob/master/Syntaxes/YAML.tmLanguage", + "This file has been converted from https://github.com/RedCMD/YAML-Syntax-Highlighter/blob/master/syntaxes/yaml.tmLanguage.json", "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/textmate/yaml.tmbundle/commit/e54ceae3b719506dba7e481a77cea4a8b576ae46", - "name": "YAML", + "version": "https://github.com/RedCMD/YAML-Syntax-Highlighter/commit/d4dca9f38a654ebbb13c1b72b7881e3c5864a778", + "name": "YAML Ain't Markup Language", "scopeName": "source.yaml", "patterns": [ { - "include": "#comment" - }, - { - "include": "#property" - }, - { - "include": "#directive" - }, - { - "match": "^---", - "name": "entity.other.document.begin.yaml" - }, - { - "match": "^\\.{3}", - "name": "entity.other.document.end.yaml" - }, - { - "include": "#node" - } - ], - "repository": { - "block-collection": { - "patterns": [ - { - "include": "#block-sequence" - }, - { - "include": "#block-mapping" - } - ] - }, - "block-mapping": { - "patterns": [ - { - "include": "#block-pair" - } - ] - }, - "block-node": { - "patterns": [ - { - "include": "#prototype" - }, - { - "include": "#block-scalar" - }, - { - "include": "#block-collection" - }, - { - "include": "#flow-scalar-plain-out" - }, - { - "include": "#flow-node" - } - ] - }, - "block-pair": { - "patterns": [ - { - "begin": "\\?", - "beginCaptures": { - "1": { - "name": "punctuation.definition.key-value.begin.yaml" - } - }, - "end": "(?=\\?)|^ *(:)|(:)", - "endCaptures": { - "1": { - "name": "punctuation.separator.key-value.mapping.yaml" - }, - "2": { - "name": "invalid.illegal.expected-newline.yaml" - } - }, - "name": "meta.block-mapping.yaml", - "patterns": [ - { - "include": "#block-node" - } - ] - }, - { - "begin": "(?x)\n (?=\n (?x:\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] \\S\n )\n (\n [^\\s:]\n | : \\S\n | \\s+ (?![#\\s])\n )*\n \\s*\n :\n\t\t\t\t\t\t\t(\\s|$)\n )\n ", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n )\n ", - "patterns": [ - { - "include": "#flow-scalar-plain-out-implicit-type" - }, - { - "begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] \\S\n ", - "beginCaptures": { - "0": { - "name": "entity.name.tag.yaml" - } - }, - "contentName": "entity.name.tag.yaml", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n )\n ", - "name": "string.unquoted.plain.out.yaml" - } - ] - }, - { - "match": ":(?=\\s|$)", - "name": "punctuation.separator.key-value.mapping.yaml" - } - ] - }, - "block-scalar": { - "begin": "(?:(\\|)|(>))([1-9])?([-+])?(.*\\n?)", - "beginCaptures": { - "1": { - "name": "keyword.control.flow.block-scalar.literal.yaml" - }, - "2": { - "name": "keyword.control.flow.block-scalar.folded.yaml" - }, - "3": { - "name": "constant.numeric.indentation-indicator.yaml" - }, - "4": { - "name": "storage.modifier.chomping-indicator.yaml" - }, - "5": { - "patterns": [ - { - "include": "#comment" - }, - { - "match": ".+", - "name": "invalid.illegal.expected-comment-or-newline.yaml" - } - ] - } - }, - "end": "^(?=\\S)|(?!\\G)", - "patterns": [ - { - "begin": "^([ ]+)(?! )", - "end": "^(?!\\1|\\s*$)", - "name": "string.unquoted.block.yaml" - } - ] - }, - "block-sequence": { - "match": "(-)(?!\\S)", - "name": "punctuation.definition.block.sequence.item.yaml" - }, - "comment": { - "begin": "(?:(^[ \\t]*)|[ \\t]+)(?=#\\p{Print}*$)", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.yaml" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "begin": "#", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.yaml" - } - }, - "end": "\\n", - "name": "comment.line.number-sign.yaml" - } - ] - }, - "directive": { - "begin": "^%", - "beginCaptures": { - "0": { - "name": "punctuation.definition.directive.begin.yaml" - } - }, - "end": "(?=$|[ \\t]+($|#))", - "name": "meta.directive.yaml", - "patterns": [ - { - "captures": { - "1": { - "name": "keyword.other.directive.yaml.yaml" - }, - "2": { - "name": "constant.numeric.yaml-version.yaml" - } - }, - "match": "\\G(YAML)[ \\t]+(\\d+\\.\\d+)" - }, - { - "captures": { - "1": { - "name": "keyword.other.directive.tag.yaml" - }, - "2": { - "name": "storage.type.tag-handle.yaml" - }, - "3": { - "name": "support.type.tag-prefix.yaml" - } - }, - "match": "(?x)\n \\G\n (TAG)\n (?:[ \\t]+\n ((?:!(?:[0-9A-Za-z\\-]*!)?))\n (?:[ \\t]+ (\n ! (?x: %[0-9A-Fa-f]{2} | [0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]] )*\n | (?![,!\\[\\]{}]) (?x: %[0-9A-Fa-f]{2} | [0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]] )+\n )\n )?\n )?\n " - }, - { - "captures": { - "1": { - "name": "support.other.directive.reserved.yaml" - }, - "2": { - "name": "string.unquoted.directive-name.yaml" - }, - "3": { - "name": "string.unquoted.directive-parameter.yaml" - } - }, - "match": "(?x) \\G (\\w+) (?:[ \\t]+ (\\w+) (?:[ \\t]+ (\\w+))? )?" - }, - { - "match": "\\S+", - "name": "invalid.illegal.unrecognized.yaml" - } - ] - }, - "flow-alias": { - "captures": { - "1": { - "name": "keyword.control.flow.alias.yaml" - }, - "2": { - "name": "punctuation.definition.alias.yaml" - }, - "3": { - "name": "variable.other.alias.yaml" - }, - "4": { - "name": "invalid.illegal.character.anchor.yaml" - } - }, - "match": "((\\*))([^\\s\\[\\]/{/},]+)([^\\s\\]},]\\S*)?" - }, - "flow-collection": { - "patterns": [ - { - "include": "#flow-sequence" - }, - { - "include": "#flow-mapping" - } - ] - }, - "flow-mapping": { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.mapping.begin.yaml" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.mapping.end.yaml" - } - }, - "name": "meta.flow-mapping.yaml", - "patterns": [ - { - "include": "#prototype" - }, - { - "match": ",", - "name": "punctuation.separator.mapping.yaml" - }, - { - "include": "#flow-pair" - } - ] - }, - "flow-node": { + "comment": "Support legacy FrontMatter integration", + "//": "https://github.com/microsoft/vscode-markdown-tm-grammar/pull/162", + "begin": "(?<=^-{3,}\\s*+)\\G$", + "while": "^(?! {3,0}-{3,}[ \t]*+$|[ \t]*+\\.{3}$)", "patterns": [ { - "include": "#prototype" - }, - { - "include": "#flow-alias" - }, - { - "include": "#flow-collection" - }, - { - "include": "#flow-scalar" + "include": "source.yaml.1.2" } ] }, - "flow-pair": { - "patterns": [ - { - "begin": "\\?", - "beginCaptures": { - "0": { - "name": "punctuation.definition.key-value.begin.yaml" - } - }, - "end": "(?=[},\\]])", - "name": "meta.flow-pair.explicit.yaml", - "patterns": [ - { - "include": "#prototype" - }, - { - "include": "#flow-pair" - }, - { - "include": "#flow-node" - }, - { - "begin": ":(?=\\s|$|[\\[\\]{},])", - "beginCaptures": { - "0": { - "name": "punctuation.separator.key-value.mapping.yaml" - } - }, - "end": "(?=[},\\]])", - "patterns": [ - { - "include": "#flow-value" - } - ] - } - ] - }, - { - "begin": "(?x)\n (?=\n (?:\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] [^\\s[\\[\\]{},]]\n )\n (\n [^\\s:[\\[\\]{},]]\n | : [^\\s[\\[\\]{},]]\n | \\s+ (?![#\\s])\n )*\n \\s*\n :\n\t\t\t\t\t\t\t(\\s|$)\n )\n ", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n | \\s* : [\\[\\]{},]\n | \\s* [\\[\\]{},]\n )\n ", - "name": "meta.flow-pair.key.yaml", - "patterns": [ - { - "include": "#flow-scalar-plain-in-implicit-type" - }, - { - "begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] [^\\s[\\[\\]{},]]\n ", - "beginCaptures": { - "0": { - "name": "entity.name.tag.yaml" - } - }, - "contentName": "entity.name.tag.yaml", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n | \\s* : [\\[\\]{},]\n | \\s* [\\[\\]{},]\n )\n ", - "name": "string.unquoted.plain.in.yaml" - } - ] - }, - { - "include": "#flow-node" - }, - { - "begin": ":(?=\\s|$|[\\[\\]{},])", - "captures": { - "0": { - "name": "punctuation.separator.key-value.mapping.yaml" - } - }, - "end": "(?=[},\\]])", - "name": "meta.flow-pair.yaml", - "patterns": [ - { - "include": "#flow-value" - } - ] - } - ] - }, - "flow-scalar": { - "patterns": [ - { - "include": "#flow-scalar-double-quoted" - }, - { - "include": "#flow-scalar-single-quoted" - }, - { - "include": "#flow-scalar-plain-in" - } - ] + { + "comment": "Default to YAML version 1.2", + "include": "source.yaml.1.2" + } + ], + "repository": { + "parity": { + "comment": "Yes... That is right. Due to the changes with \\x2028, \\x2029, \\x85 and 'tags'. This is all the code I was able to reuse between all YAML versions 1.3, 1.2, 1.1 and 1.0" }, - "flow-scalar-double-quoted": { - "begin": "\"", + "block-map-key-single": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-single-quoted (BLOCK-KEY)", + "begin": "\\G'", + "end": "'(?!')", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.yaml" } }, - "end": "\"", "endCaptures": { "0": { "name": "punctuation.definition.string.end.yaml" } }, - "name": "string.quoted.double.yaml", + "name": "meta.map.key.yaml string.quoted.single.yaml entity.name.tag.yaml", "patterns": [ { - "match": "\\\\([0abtnvfre \"/\\\\N_Lp]|x\\d\\d|u\\d{4}|U\\d{8})", - "name": "constant.character.escape.yaml" + "match": ".[\t ]*+$", + "name": "invalid.illegal.multiline-key.yaml" }, { - "match": "\\\\\\n", - "name": "constant.character.escape.double-quoted.newline.yaml" - } - ] - }, - "flow-scalar-plain-in": { - "patterns": [ - { - "include": "#flow-scalar-plain-in-implicit-type" + "match": "[^\t -\\x{10FFFF}]++", + "name": "invalid.illegal.character.yaml" }, { - "begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] [^\\s[\\[\\]{},]]\n ", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n | \\s* : [\\[\\]{},]\n | \\s* [\\[\\]{},]\n )\n ", - "name": "string.unquoted.plain.in.yaml" - } - ] - }, - "flow-scalar-plain-in-implicit-type": { - "patterns": [ - { - "captures": { - "1": { - "name": "constant.language.null.yaml" - }, - "2": { - "name": "constant.language.boolean.yaml" - }, - "3": { - "name": "constant.numeric.integer.yaml" - }, - "4": { - "name": "constant.numeric.float.yaml" - }, - "5": { - "name": "constant.other.timestamp.yaml" - }, - "6": { - "name": "constant.language.value.yaml" - }, - "7": { - "name": "constant.language.merge.yaml" - } - }, - "match": "(?x)\n (?x:\n (null|Null|NULL|~)\n | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)\n | (\n (?:\n [-+]? 0b [0-1_]+ # (base 2)\n | [-+]? 0 [0-7_]+ # (base 8)\n | [-+]? (?: 0|[1-9][0-9_]*) # (base 10)\n | [-+]? 0x [0-9a-fA-F_]+ # (base 16)\n | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60)\n )\n )\n | (\n (?x:\n [-+]? (?: [0-9] [0-9_]*)? \\. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10)\n | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \\. [0-9_]* # (base 60)\n | [-+]? \\. (?: inf|Inf|INF) # (infinity)\n | \\. (?: nan|NaN|NAN) # (not a number)\n )\n )\n | (\n (?x:\n \\d{4} - \\d{2} - \\d{2} # (y-m-d)\n | \\d{4} # (year)\n - \\d{1,2} # (month)\n - \\d{1,2} # (day)\n (?: [Tt] | [ \\t]+) \\d{1,2} # (hour)\n : \\d{2} # (minute)\n : \\d{2} # (second)\n (?: \\.\\d*)? # (fraction)\n (?:\n (?:[ \\t]*) Z\n | [-+] \\d{1,2} (?: :\\d{1,2})?\n )? # (time zone)\n )\n )\n | (=)\n | (<<)\n )\n (?:\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n | \\s* : [\\[\\]{},]\n | \\s* [\\[\\]{},]\n )\n )\n " - } - ] - }, - "flow-scalar-plain-out": { - "patterns": [ - { - "include": "#flow-scalar-plain-out-implicit-type" - }, - { - "begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] \\S\n ", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n )\n ", - "name": "string.unquoted.plain.out.yaml" - } - ] - }, - "flow-scalar-plain-out-implicit-type": { - "patterns": [ - { - "captures": { - "1": { - "name": "constant.language.null.yaml" - }, - "2": { - "name": "constant.language.boolean.yaml" - }, - "3": { - "name": "constant.numeric.integer.yaml" - }, - "4": { - "name": "constant.numeric.float.yaml" - }, - "5": { - "name": "constant.other.timestamp.yaml" - }, - "6": { - "name": "constant.language.value.yaml" - }, - "7": { - "name": "constant.language.merge.yaml" - } - }, - "match": "(?x)\n (?x:\n (null|Null|NULL|~)\n | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)\n | (\n (?:\n [-+]? 0b [0-1_]+ # (base 2)\n | [-+]? 0 [0-7_]+ # (base 8)\n | [-+]? (?: 0|[1-9][0-9_]*) # (base 10)\n | [-+]? 0x [0-9a-fA-F_]+ # (base 16)\n | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60)\n )\n )\n | (\n (?x:\n [-+]? (?: [0-9] [0-9_]*)? \\. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10)\n | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \\. [0-9_]* # (base 60)\n | [-+]? \\. (?: inf|Inf|INF) # (infinity)\n | \\. (?: nan|NaN|NAN) # (not a number)\n )\n )\n | (\n (?x:\n \\d{4} - \\d{2} - \\d{2} # (y-m-d)\n | \\d{4} # (year)\n - \\d{1,2} # (month)\n - \\d{1,2} # (day)\n (?: [Tt] | [ \\t]+) \\d{1,2} # (hour)\n : \\d{2} # (minute)\n : \\d{2} # (second)\n (?: \\.\\d*)? # (fraction)\n (?:\n (?:[ \\t]*) Z\n | [-+] \\d{1,2} (?: :\\d{1,2})?\n )? # (time zone)\n )\n )\n | (=)\n | (<<)\n )\n (?x:\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n )\n )\n " + "match": "''", + "name": "constant.character.escape.single-quote.yaml" } ] }, - "flow-scalar-single-quoted": { + "key-single": { + "comment": "https://yaml.org/spec/1.2.2/#rule-c-single-quoted (FLOW-OUT)", "begin": "'", + "end": "'(?!')", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.yaml" } }, - "end": "'(?!')", "endCaptures": { "0": { "name": "punctuation.definition.string.end.yaml" } }, - "name": "string.quoted.single.yaml", - "patterns": [ - { - "match": "''", - "name": "constant.character.escape.single-quoted.yaml" - } - ] - }, - "flow-sequence": { - "begin": "\\[", - "beginCaptures": { - "0": { - "name": "punctuation.definition.sequence.begin.yaml" - } - }, - "end": "\\]", - "endCaptures": { - "0": { - "name": "punctuation.definition.sequence.end.yaml" - } - }, - "name": "meta.flow-sequence.yaml", - "patterns": [ - { - "include": "#prototype" - }, - { - "match": ",", - "name": "punctuation.separator.sequence.yaml" - }, - { - "include": "#flow-pair" - }, - { - "include": "#flow-node" - } - ] - }, - "flow-value": { - "patterns": [ - { - "begin": "\\G(?![},\\]])", - "end": "(?=[},\\]])", - "name": "meta.flow-pair.value.yaml", - "patterns": [ - { - "include": "#flow-node" - } - ] - } - ] - }, - "node": { - "patterns": [ - { - "include": "#block-node" - } - ] - }, - "property": { - "begin": "(?=!|&)", - "end": "(?!\\G)", - "name": "meta.property.yaml", + "name": "meta.map.key.yaml string.quoted.single.yaml entity.name.tag.yaml", "patterns": [ { - "captures": { - "1": { - "name": "keyword.control.property.anchor.yaml" - }, - "2": { - "name": "punctuation.definition.anchor.yaml" - }, - "3": { - "name": "entity.name.type.anchor.yaml" - }, - "4": { - "name": "invalid.illegal.character.anchor.yaml" - } - }, - "match": "\\G((&))([^\\s\\[\\]/{/},]+)(\\S+)?" + "match": "[^\t -\\x{10FFFF}]++", + "name": "invalid.illegal.character.yaml" }, { - "match": "(?x)\n \\G\n (?:\n ! < (?: %[0-9A-Fa-f]{2} | [0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]] )+ >\n | (?:!(?:[0-9A-Za-z\\-]*!)?) (?: %[0-9A-Fa-f]{2} | [0-9A-Za-z\\-#;/?:@&=+$_.~*'()] )+\n | !\n )\n (?=\\ |\\t|$)\n ", - "name": "storage.type.tag-handle.yaml" - }, - { - "match": "\\S+", - "name": "invalid.illegal.tag-handle.yaml" - } - ] - }, - "prototype": { - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#property" - } - ] + "match": "''", + "name": "constant.character.escape.single-quote.yaml" + } + ] + }, + "non-printable": { + "//": { + "85": "…", + "2028": "", + "2029": "", + "10000": "𐀀", + "A0": " ", + "D7FF": "퟿", + "E000": "", + "FFFD": "�", + "FEFF": "", + "FFFF": "￿", + "10FFFF": "􏿿" + }, + "//match": "[\\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}&&[^\t\n\r\\x{85}]]++", + "match": "[^\t\n\r -~\\x{85}\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}]++", + "name": "invalid.illegal.non-printable.yaml" } } } \ No newline at end of file diff --git a/extensions/yaml/yarn.lock b/extensions/yaml/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/extensions/yaml/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/extensions/yarn.lock b/extensions/yarn.lock deleted file mode 100644 index b981143bdd0..00000000000 --- a/extensions/yarn.lock +++ /dev/null @@ -1,248 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@esbuild/aix-ppc64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.20.0.tgz#509621cca4e67caf0d18561a0c56f8b70237472f" - integrity sha512-fGFDEctNh0CcSwsiRPxiaqX0P5rq+AqE0SRhYGZ4PX46Lg1FNR6oCxJghf8YgY0WQEgQuh3lErUFE4KxLeRmmw== - -"@esbuild/android-arm64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.20.0.tgz#109a6fdc4a2783fc26193d2687827045d8fef5ab" - integrity sha512-aVpnM4lURNkp0D3qPoAzSG92VXStYmoVPOgXveAUoQBWRSuQzt51yvSju29J6AHPmwY1BjH49uR29oyfH1ra8Q== - -"@esbuild/android-arm@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.20.0.tgz#1397a2c54c476c4799f9b9073550ede496c94ba5" - integrity sha512-3bMAfInvByLHfJwYPJRlpTeaQA75n8C/QKpEaiS4HrFWFiJlNI0vzq/zCjBrhAYcPyVPG7Eo9dMrcQXuqmNk5g== - -"@esbuild/android-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.20.0.tgz#2b615abefb50dc0a70ac313971102f4ce2fdb3ca" - integrity sha512-uK7wAnlRvjkCPzh8jJ+QejFyrP8ObKuR5cBIsQZ+qbMunwR8sbd8krmMbxTLSrDhiPZaJYKQAU5Y3iMDcZPhyQ== - -"@esbuild/darwin-arm64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.20.0.tgz#5c122ed799eb0c35b9d571097f77254964c276a2" - integrity sha512-AjEcivGAlPs3UAcJedMa9qYg9eSfU6FnGHJjT8s346HSKkrcWlYezGE8VaO2xKfvvlZkgAhyvl06OJOxiMgOYQ== - -"@esbuild/darwin-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.20.0.tgz#9561d277002ba8caf1524f209de2b22e93d170c1" - integrity sha512-bsgTPoyYDnPv8ER0HqnJggXK6RyFy4PH4rtsId0V7Efa90u2+EifxytE9pZnsDgExgkARy24WUQGv9irVbTvIw== - -"@esbuild/freebsd-arm64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.0.tgz#84178986a3138e8500d17cc380044868176dd821" - integrity sha512-kQ7jYdlKS335mpGbMW5tEe3IrQFIok9r84EM3PXB8qBFJPSc6dpWfrtsC/y1pyrz82xfUIn5ZrnSHQQsd6jebQ== - -"@esbuild/freebsd-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.20.0.tgz#3f9ce53344af2f08d178551cd475629147324a83" - integrity sha512-uG8B0WSepMRsBNVXAQcHf9+Ko/Tr+XqmK7Ptel9HVmnykupXdS4J7ovSQUIi0tQGIndhbqWLaIL/qO/cWhXKyQ== - -"@esbuild/linux-arm64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.20.0.tgz#24efa685515689df4ecbc13031fa0a9dda910a11" - integrity sha512-uTtyYAP5veqi2z9b6Gr0NUoNv9F/rOzI8tOD5jKcCvRUn7T60Bb+42NDBCWNhMjkQzI0qqwXkQGo1SY41G52nw== - -"@esbuild/linux-arm@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.20.0.tgz#6b586a488e02e9b073a75a957f2952b3b6e87b4c" - integrity sha512-2ezuhdiZw8vuHf1HKSf4TIk80naTbP9At7sOqZmdVwvvMyuoDiZB49YZKLsLOfKIr77+I40dWpHVeY5JHpIEIg== - -"@esbuild/linux-ia32@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.20.0.tgz#84ce7864f762708dcebc1b123898a397dea13624" - integrity sha512-c88wwtfs8tTffPaoJ+SQn3y+lKtgTzyjkD8NgsyCtCmtoIC8RDL7PrJU05an/e9VuAke6eJqGkoMhJK1RY6z4w== - -"@esbuild/linux-loong64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.20.0.tgz#1922f571f4cae1958e3ad29439c563f7d4fd9037" - integrity sha512-lR2rr/128/6svngnVta6JN4gxSXle/yZEZL3o4XZ6esOqhyR4wsKyfu6qXAL04S4S5CgGfG+GYZnjFd4YiG3Aw== - -"@esbuild/linux-mips64el@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.20.0.tgz#7ca1bd9df3f874d18dbf46af009aebdb881188fe" - integrity sha512-9Sycc+1uUsDnJCelDf6ZNqgZQoK1mJvFtqf2MUz4ujTxGhvCWw+4chYfDLPepMEvVL9PDwn6HrXad5yOrNzIsQ== - -"@esbuild/linux-ppc64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.20.0.tgz#8f95baf05f9486343bceeb683703875d698708a4" - integrity sha512-CoWSaaAXOZd+CjbUTdXIJE/t7Oz+4g90A3VBCHLbfuc5yUQU/nFDLOzQsN0cdxgXd97lYW/psIIBdjzQIwTBGw== - -"@esbuild/linux-riscv64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.20.0.tgz#ca63b921d5fe315e28610deb0c195e79b1a262ca" - integrity sha512-mlb1hg/eYRJUpv8h/x+4ShgoNLL8wgZ64SUr26KwglTYnwAWjkhR2GpoKftDbPOCnodA9t4Y/b68H4J9XmmPzA== - -"@esbuild/linux-s390x@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.20.0.tgz#cb3d069f47dc202f785c997175f2307531371ef8" - integrity sha512-fgf9ubb53xSnOBqyvWEY6ukBNRl1mVX1srPNu06B6mNsNK20JfH6xV6jECzrQ69/VMiTLvHMicQR/PgTOgqJUQ== - -"@esbuild/linux-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.20.0.tgz#ac617e0dc14e9758d3d7efd70288c14122557dc7" - integrity sha512-H9Eu6MGse++204XZcYsse1yFHmRXEWgadk2N58O/xd50P9EvFMLJTQLg+lB4E1cF2xhLZU5luSWtGTb0l9UeSg== - -"@esbuild/netbsd-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.20.0.tgz#6cc778567f1513da6e08060e0aeb41f82eb0f53c" - integrity sha512-lCT675rTN1v8Fo+RGrE5KjSnfY0x9Og4RN7t7lVrN3vMSjy34/+3na0q7RIfWDAj0e0rCh0OL+P88lu3Rt21MQ== - -"@esbuild/openbsd-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.20.0.tgz#76848bcf76b4372574fb4d06cd0ed1fb29ec0fbe" - integrity sha512-HKoUGXz/TOVXKQ+67NhxyHv+aDSZf44QpWLa3I1lLvAwGq8x1k0T+e2HHSRvxWhfJrFxaaqre1+YyzQ99KixoA== - -"@esbuild/sunos-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.20.0.tgz#ea4cd0639bf294ad51bc08ffbb2dac297e9b4706" - integrity sha512-GDwAqgHQm1mVoPppGsoq4WJwT3vhnz/2N62CzhvApFD1eJyTroob30FPpOZabN+FgCjhG+AgcZyOPIkR8dfD7g== - -"@esbuild/win32-arm64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.20.0.tgz#a5c171e4a7f7e4e8be0e9947a65812c1535a7cf0" - integrity sha512-0vYsP8aC4TvMlOQYozoksiaxjlvUcQrac+muDqj1Fxy6jh9l9CZJzj7zmh8JGfiV49cYLTorFLxg7593pGldwQ== - -"@esbuild/win32-ia32@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.20.0.tgz#f8ac5650c412d33ea62d7551e0caf82da52b7f85" - integrity sha512-p98u4rIgfh4gdpV00IqknBD5pC84LCub+4a3MO+zjqvU5MVXOc3hqR2UgT2jI2nh3h8s9EQxmOsVI3tyzv1iFg== - -"@esbuild/win32-x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.20.0.tgz#2efddf82828aac85e64cef62482af61c29561bee" - integrity sha512-NgJnesu1RtWihtTtXGFMU5YSE6JyyHPMxCwBZK7a6/8d31GuSo9l0Ss7w1Jw5QnKUawG6UEehs883kcXf5fYwg== - -"@parcel/watcher@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.1.0.tgz#5f32969362db4893922c526a842d8af7a8538545" - integrity sha512-8s8yYjd19pDSsBpbkOHnT6Z2+UJSuLQx61pCFM0s5wSRvKCEMDjd/cHY3/GI1szHIWbpXpsJdg3V6ISGGx9xDw== - dependencies: - is-glob "^4.0.3" - micromatch "^4.0.5" - node-addon-api "^3.2.1" - node-gyp-build "^4.3.0" - -braces@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" - integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== - dependencies: - fill-range "^7.1.1" - -coffeescript@1.12.7: - version "1.12.7" - resolved "https://registry.yarnpkg.com/coffeescript/-/coffeescript-1.12.7.tgz#e57ee4c4867cf7f606bfc4a0f2d550c0981ddd27" - integrity sha512-pLXHFxQMPklVoEekowk8b3erNynC+DVJzChxS/LCBBgR6/8AJkHivkm//zbowcfc7BTCAjryuhx6gPqPRfsFoA== - -cson-parser@^4.0.9: - version "4.0.9" - resolved "https://registry.yarnpkg.com/cson-parser/-/cson-parser-4.0.9.tgz#eef0cf77edd057f97861ef800300c8239224eedb" - integrity sha512-I79SAcCYquWnEfXYj8hBqOOWKj6eH6zX1hhX3yqmS4K3bYp7jME3UFpHPzu3rUew0oyfc0s8T6IlWGXRAheHag== - dependencies: - coffeescript "1.12.7" - -esbuild@0.20.0: - version "0.20.0" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.20.0.tgz#a7170b63447286cd2ff1f01579f09970e6965da4" - integrity sha512-6iwE3Y2RVYCME1jLpBqq7LQWK3MW6vjV2bZy6gt/WrqkY+WE74Spyc0ThAOYpMtITvnjX09CrC6ym7A/m9mebA== - optionalDependencies: - "@esbuild/aix-ppc64" "0.20.0" - "@esbuild/android-arm" "0.20.0" - "@esbuild/android-arm64" "0.20.0" - "@esbuild/android-x64" "0.20.0" - "@esbuild/darwin-arm64" "0.20.0" - "@esbuild/darwin-x64" "0.20.0" - "@esbuild/freebsd-arm64" "0.20.0" - "@esbuild/freebsd-x64" "0.20.0" - "@esbuild/linux-arm" "0.20.0" - "@esbuild/linux-arm64" "0.20.0" - "@esbuild/linux-ia32" "0.20.0" - "@esbuild/linux-loong64" "0.20.0" - "@esbuild/linux-mips64el" "0.20.0" - "@esbuild/linux-ppc64" "0.20.0" - "@esbuild/linux-riscv64" "0.20.0" - "@esbuild/linux-s390x" "0.20.0" - "@esbuild/linux-x64" "0.20.0" - "@esbuild/netbsd-x64" "0.20.0" - "@esbuild/openbsd-x64" "0.20.0" - "@esbuild/sunos-x64" "0.20.0" - "@esbuild/win32-arm64" "0.20.0" - "@esbuild/win32-ia32" "0.20.0" - "@esbuild/win32-x64" "0.20.0" - -fast-plist@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/fast-plist/-/fast-plist-0.1.2.tgz#a45aff345196006d406ca6cdcd05f69051ef35b8" - integrity sha1-pFr/NFGWAG1AbKbNzQX2kFHvNbg= - -fill-range@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" - integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== - dependencies: - to-regex-range "^5.0.1" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-glob@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -micromatch@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - -node-addon-api@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161" - integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A== - -node-gyp-build@4.8.1, node-gyp-build@^4.3.0: - version "4.8.1" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.1.tgz#976d3ad905e71b76086f4f0b0d3637fe79b6cda5" - integrity sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw== - -picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -typescript@^5.5.2: - version "5.5.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.2.tgz#c26f023cb0054e657ce04f72583ea2d85f8d0507" - integrity sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew== - -vscode-grammar-updater@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/vscode-grammar-updater/-/vscode-grammar-updater-1.1.0.tgz#030eacd8b8ba8f3f2fe43c9032601f839ba811c4" - integrity sha512-rWcJXyEFK27Mh9bxfBTLaul0KiGQk0GMXj2qTDH9cy3UZVx5MrF035B03os1w4oIXwl/QDhdLnsBK0j2SNiL1A== - dependencies: - cson-parser "^4.0.9" - fast-plist "0.1.2" diff --git a/github/classifier.json b/github/classifier.json index d0a2c778997..5f322e25edd 100644 --- a/github/classifier.json +++ b/github/classifier.json @@ -124,7 +124,7 @@ "languages-basic": {"assign": ["aeschli"]}, "languages-diagnostics": {"assign": ["jrieken"]}, "languages-guessing": {"assign": ["TylerLeonhardt"]}, - "layout": {"assign": ["sbatten"]}, + "layout": {"assign": ["benibenj"]}, "lcd-text-rendering": {"assign": []}, "list-widget": {"assign": ["joaomoreno"]}, "live-preview": {"assign": ["andreamah"]}, @@ -249,7 +249,7 @@ "timeline": {"assign": ["lramos15"]}, "timeline-git": {"assign": ["lszomoru"]}, "timeline-local-history": {"assign": ["bpasero"]}, - "titlebar": {"assign": ["sbatten"]}, + "titlebar": {"assign": ["benibenj"]}, "tokenization": {"assign": ["alexdima"]}, "touch/pointer": {"assign": []}, "trackpad/scroll": {"assign": []}, @@ -278,7 +278,7 @@ "workbench-cli": {"assign": ["bpasero"]}, "workbench-diagnostics": {"assign": ["Tyriar"]}, "workbench-dnd": {"assign": ["bpasero"]}, - "workbench-editor-grid": {"assign": ["sbatten"]}, + "workbench-editor-grid": {"assign": ["benibenj"]}, "workbench-editor-groups": {"assign": ["bpasero"]}, "workbench-editor-resolver": {"assign": ["lramos15"]}, "workbench-editors": {"assign": ["bpasero"]}, @@ -299,11 +299,11 @@ "workbench-tabs": {"assign": ["benibenj"]}, "workbench-touchbar": {"assign": ["bpasero"]}, "workbench-untitled-editors": {"assign": ["bpasero"]}, - "workbench-views": {"assign": ["sbatten"]}, + "workbench-views": {"assign": ["benibenj"]}, "workbench-welcome": {"assign": ["lramos15"]}, "workbench-window": {"assign": ["bpasero"]}, "workbench-workspace": {"assign": []}, - "workbench-zen": {"assign": ["sbatten"]}, + "workbench-zen": {"assign": ["benibenj"]}, "workspace-edit": {"assign": ["jrieken"]}, "workspace-symbols": {"assign": []}, "workspace-trust": {"assign": ["lszomoru", "sbatten"]}, diff --git a/github/commands.json b/github/commands.json index df9fc791fd5..38da97915a2 100644 --- a/github/commands.json +++ b/github/commands.json @@ -156,6 +156,37 @@ "addLabel": "confirmation-pending", "removeLabel": "confirmed" }, + { + "type": "comment", + "name": "needsMoreInfo", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "updateLabels", + "addLabel": "~info-needed" + }, + { + "type": "comment", + "name": "needsPerfInfo", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "addLabel": "info-needed", + "comment": "Thanks for creating this issue regarding performance! Please follow this guide to help us diagnose performance issues: https://github.com/microsoft/vscode/wiki/Performance-Issues \n\nHappy Coding!" + }, + { + "type": "comment", + "name": "jsDebugLogs", + "action": "updateLabels", + "addLabel": "info-needed", + "comment": "Please collect trace logs using the following instructions:\n\n> If you're able to, add `\"trace\": true` to your `launch.json` and reproduce the issue. The location of the log file on your disk will be written to the Debug Console. Share that with us.\n>\n> ⚠️ This log file will not contain source code, but will contain file paths. You can drop it into https://microsoft.github.io/vscode-pwa-analyzer/index.html to see what it contains. If you'd rather not share the log publicly, you can email it to connor@xbox.com" + }, { "type": "comment", "name": "closedWith", @@ -169,6 +200,19 @@ "reason": "completed", "addLabel": "unreleased" }, + { + "type": "comment", + "name": "spam", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "invalid" + }, { "type": "comment", "name": "a11ymas", @@ -414,6 +458,32 @@ "addLabel": "*caused-by-extension", "comment": "It looks like this is caused by the Copilot extension. Please file the issue in the [Copilot Discussion Forum](https://github.com/community/community/discussions/categories/copilot). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" }, + { + "type": "comment", + "name": "gifPlease", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "comment", + "addLabel": "info-needed", + "comment": "Thanks for reporting this issue! Unfortunately, it's hard for us to understand what issue you're seeing. Please help us out by providing a screen recording showing exactly what isn't working as expected. While we can work with most standard formats, `.gif` files are preferred as they are displayed inline on GitHub. You may find https://gifcap.dev helpful as a browser-based gif recording tool.\n\nIf the issue depends on keyboard input, you can help us by enabling screencast mode for the recording (`Developer: Toggle Screencast Mode` in the command palette). Lastly, please attach this file via the GitHub web interface as emailed responses will strip files out from the issue.\n\nHappy coding!" + }, + { + "type": "comment", + "name": "confirmPlease", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "comment", + "addLabel": "info-needed", + "comment": "Please diagnose the root cause of the issue by running the command `F1 > Help: Troubleshoot Issue` and following the instructions. Once you have done that, please update the issue with the results.\n\nHappy Coding!" + }, { "__comment__": "Allows folks on the team to label issues by commenting: `\\label My-Label` ", "type": "comment", @@ -444,5 +514,29 @@ "addLabel": "verification-steps-needed", "removeLabel": "~verification-steps-needed", "comment": "Friendly ping! Looks like this issue requires some further steps to be verified. Please provide us with the steps necessary to verify this issue." + }, + { + "type": "label", + "name": "~info-needed", + "action": "updateLabels", + "addLabel": "info-needed", + "removeLabel": "~info-needed", + "comment": "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting guidelines](https://aka.ms/vscodeissuereporting). Please take the time to review these and update the issue.\n\nHappy Coding!" + }, + { + "type": "label", + "name": "~version-info-needed", + "action": "updateLabels", + "addLabel": "info-needed", + "removeLabel": "~version-info-needed", + "comment": "Thanks for creating this issue! We figured it's missing some basic information, such as a version number, or in some other way doesn't follow our [issue reporting guidelines](https://aka.ms/vscodeissuereporting). Please take the time to review these and update the issue.\n\nHappy Coding!" + }, + { + "type": "label", + "name": "~confirmation-needed", + "action": "updateLabels", + "addLabel": "info-needed", + "removeLabel": "~confirmation-needed", + "comment": "Please diagnose the root cause of the issue by running the command `F1 > Help: Troubleshoot Issue` and following the instructions. Once you have done that, please update the issue with the results.\n\nHappy Coding!" } ] diff --git a/github/workflows/author-verified.yml b/github/workflows/author-verified.yml deleted file mode 100644 index f914be2f71b..00000000000 --- a/github/workflows/author-verified.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Author Verified -on: - issues: - types: [closed] - -# also make changes in ./on-label.yml -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - if: contains(github.event.issue.labels.*.name, 'author-verification-requested') && contains(github.event.issue.labels.*.name, 'insiders-released') - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - ref: stable - path: ./actions - - name: Install Actions - if: contains(github.event.issue.labels.*.name, 'author-verification-requested') && contains(github.event.issue.labels.*.name, 'insiders-released') - run: npm install --production --prefix ./actions - - name: Run Author Verified - if: contains(github.event.issue.labels.*.name, 'author-verification-requested') && contains(github.event.issue.labels.*.name, 'insiders-released') - uses: ./actions/author-verified - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - requestVerificationComment: "This bug has been fixed in the latest release of [VS Code Insiders](https://code.visualstudio.com/insiders/)!\n\n@${author}, you can help us out by commenting `/verified` if things are now working as expected.\n\nIf things still don't seem right, please ensure you're on version ${commit} of Insiders (today's or later - you can use `Help: About` in the command palette to check), and leave a comment letting us know what isn't working as expected.\n\nHappy Coding!" - releasedLabel: insiders-released - verifiedLabel: verified - authorVerificationRequestedLabel: author-verification-requested diff --git a/github/workflows/bad-tag.yml b/github/workflows/bad-tag.yml deleted file mode 100644 index bc964fb0582..00000000000 --- a/github/workflows/bad-tag.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Bad Tag -on: - create - -jobs: - main: - runs-on: ubuntu-latest - if: github.event.ref == '1.999.0' - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - ref: stable - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions - - name: Run Bad Tag - uses: ./actions/tag-alert - with: - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - tag-name: '1.999.0' diff --git a/github/workflows/basic.yml b/github/workflows/basic.yml index 8448d05c3b8..d5f166a4aae 100644 --- a/github/workflows/basic.yml +++ b/github/workflows/basic.yml @@ -42,26 +42,26 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-cacheNodeModulesLinux-${{ steps.nodeModulesCacheKey.outputs.value }} - - name: Get yarn cache directory path - id: yarnCacheDirPath + - name: Get npm cache directory path + id: npmCacheDirPath if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - name: Cache yarn directory + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT + - name: Cache npm directory if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} uses: actions/cache@v4 with: - path: ${{ steps.yarnCacheDirPath.outputs.dir }} - key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} - restore-keys: ${{ runner.os }}-yarnCacheDir- - - name: Execute yarn + path: ${{ steps.npmCacheDirPath.outputs.dir }} + key: ${{ runner.os }}-npmCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} + restore-keys: ${{ runner.os }}-npmCacheDir- + - name: Execute npm if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 ELECTRON_SKIP_BINARY_DOWNLOAD: 1 - run: yarn --frozen-lockfile --network-timeout 180000 + run: npm ci - name: Compile and Download - run: yarn npm-run-all --max-old-space-size=4095 -lp compile "electron x64" + run: npm exec -- npm-run-all -lp compile "electron x64" - name: Run Unit Tests id: electron-unit-tests @@ -94,44 +94,45 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-cacheNodeModulesLinux-${{ steps.nodeModulesCacheKey.outputs.value }} - - name: Get yarn cache directory path - id: yarnCacheDirPath + - name: Get npm cache directory path + id: npmCacheDirPath if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - name: Cache yarn directory + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT + - name: Cache npm directory if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} uses: actions/cache@v4 with: - path: ${{ steps.yarnCacheDirPath.outputs.dir }} - key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} - restore-keys: ${{ runner.os }}-yarnCacheDir- - - name: Execute yarn + path: ${{ steps.npmCacheDirPath.outputs.dir }} + key: ${{ runner.os }}-npmCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} + restore-keys: ${{ runner.os }}-npmCacheDir- + - name: Execute npm if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 ELECTRON_SKIP_BINARY_DOWNLOAD: 1 - run: yarn --frozen-lockfile --network-timeout 180000 + run: npm ci - name: Run Hygiene Checks - run: yarn gulp hygiene + run: npm run gulp hygiene - name: Run Valid Layers Checks - run: yarn valid-layers-check + run: npm run valid-layers-check - name: Compile /build/ - run: yarn --cwd build compile + run: npm run compile + working-directory: build - name: Check clean git state run: ./.github/workflows/check-clean-git-state.sh - name: Run eslint - run: yarn eslint + run: npm run eslint - name: Run vscode-dts Compile Checks - run: yarn vscode-dts-compile-check + run: npm run vscode-dts-compile-check - name: Run Trusted Types Checks - run: yarn tsec-compile-check + run: npm run tsec-compile-check warm-cache: name: Warm up node modules cache @@ -156,20 +157,20 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-cacheNodeModulesLinux-${{ steps.nodeModulesCacheKey.outputs.value }} - - name: Get yarn cache directory path - id: yarnCacheDirPath + - name: Get npm cache directory path + id: npmCacheDirPath if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - name: Cache yarn directory + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT + - name: Cache npm directory if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} uses: actions/cache@v4 with: - path: ${{ steps.yarnCacheDirPath.outputs.dir }} - key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} - restore-keys: ${{ runner.os }}-yarnCacheDir- - - name: Execute yarn + path: ${{ steps.npmCacheDirPath.outputs.dir }} + key: ${{ runner.os }}-npmCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} + restore-keys: ${{ runner.os }}-npmCacheDir- + - name: Execute npm if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 ELECTRON_SKIP_BINARY_DOWNLOAD: 1 - run: yarn --frozen-lockfile --network-timeout 180000 + run: npm ci diff --git a/github/workflows/ci.yml b/github/workflows/ci.yml index 097bdcf8c2c..b80196eab08 100644 --- a/github/workflows/ci.yml +++ b/github/workflows/ci.yml @@ -43,23 +43,23 @@ jobs: - name: Extract node_modules archive if: ${{ steps.cacheNodeModules.outputs.cache-hit == 'true' }} run: 7z.exe x .build/node_modules_cache/cache.7z -aos - - name: Get yarn cache directory path - id: yarnCacheDirPath + - name: Get npm cache directory path + id: npmCacheDirPath if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - name: Cache yarn directory + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT + - name: Cache npm directory if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} uses: actions/cache@v4 with: - path: ${{ steps.yarnCacheDirPath.outputs.dir }} - key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} - restore-keys: ${{ runner.os }}-yarnCacheDir- - - name: Execute yarn + path: ${{ steps.npmCacheDirPath.outputs.dir }} + key: ${{ runner.os }}-npmCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} + restore-keys: ${{ runner.os }}-npmCacheDir- + - name: Execute npm if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 ELECTRON_SKIP_BINARY_DOWNLOAD: 1 - run: yarn --frozen-lockfile --network-timeout 180000 + run: npm ci - name: Create node_modules archive if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} run: | @@ -69,19 +69,20 @@ jobs: 7z.exe a .build/node_modules_cache/cache.7z -mx3 `@.build/node_modules_list.txt - name: Compile and Download - run: yarn npm-run-all --max-old-space-size=4095 -lp compile "electron x64" playwright-install download-builtin-extensions + run: npm exec -- npm-run-all -lp compile "electron x64" playwright-install download-builtin-extensions - name: Compile Integration Tests - run: yarn --cwd test/integration/browser compile + run: npm run compile + working-directory: test/integration/browser - name: Run Unit Tests (Electron) run: .\scripts\test.bat - name: Run Unit Tests (node.js) - run: yarn test-node + run: npm run test-node - name: Run Unit Tests (Browser, Chromium) - run: yarn test-browser-no-install --browser chromium + run: npm run test-browser-no-install --browser chromium - name: Run Integration Tests (Electron) run: .\scripts\test-integration.bat @@ -126,29 +127,30 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-cacheNodeModulesLinux-${{ steps.nodeModulesCacheKey.outputs.value }} - - name: Get yarn cache directory path - id: yarnCacheDirPath + - name: Get npm cache directory path + id: npmCacheDirPath if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - name: Cache yarn directory + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT + - name: Cache npm directory if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} uses: actions/cache@v4 with: - path: ${{ steps.yarnCacheDirPath.outputs.dir }} - key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} - restore-keys: ${{ runner.os }}-yarnCacheDir- - - name: Execute yarn + path: ${{ steps.npmCacheDirPath.outputs.dir }} + key: ${{ runner.os }}-npmCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} + restore-keys: ${{ runner.os }}-npmCacheDir- + - name: Execute npm if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 ELECTRON_SKIP_BINARY_DOWNLOAD: 1 - run: yarn --frozen-lockfile --network-timeout 180000 + run: npm ci - name: Compile and Download - run: yarn npm-run-all --max-old-space-size=4095 -lp compile "electron x64" playwright-install download-builtin-extensions + run: npm exec -- npm-run-all -lp compile "electron x64" playwright-install download-builtin-extensions - name: Compile Integration Tests - run: yarn --cwd test/integration/browser compile + run: npm run compile + working-directory: test/integration/browser - name: Run Unit Tests (Electron) id: electron-unit-tests @@ -156,11 +158,11 @@ jobs: - name: Run Unit Tests (node.js) id: nodejs-unit-tests - run: yarn test-node + run: npm run test-node - name: Run Unit Tests (Browser, Chromium) id: browser-unit-tests - run: DISPLAY=:10 yarn test-browser-no-install --browser chromium + run: DISPLAY=:10 npm run test-browser-no-install --browser chromium - name: Run Integration Tests (Electron) id: electron-integration-tests @@ -197,29 +199,30 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-cacheNodeModulesMacOS-${{ steps.nodeModulesCacheKey.outputs.value }} - - name: Get yarn cache directory path - id: yarnCacheDirPath + - name: Get npm cache directory path + id: npmCacheDirPath if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - name: Cache yarn directory + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT + - name: Cache npm directory if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} uses: actions/cache@v4 with: - path: ${{ steps.yarnCacheDirPath.outputs.dir }} - key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} - restore-keys: ${{ runner.os }}-yarnCacheDir- - - name: Execute yarn + path: ${{ steps.npmCacheDirPath.outputs.dir }} + key: ${{ runner.os }}-npmCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} + restore-keys: ${{ runner.os }}-npmCacheDir- + - name: Execute npm if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 ELECTRON_SKIP_BINARY_DOWNLOAD: 1 - run: yarn --frozen-lockfile --network-timeout 180000 + run: npm ci - name: Compile and Download - run: yarn npm-run-all --max-old-space-size=4095 -lp compile "electron x64" playwright-install download-builtin-extensions + run: npm exec -- npm-run-all -lp compile "electron x64" playwright-install download-builtin-extensions - name: Compile Integration Tests - run: yarn --cwd test/integration/browser compile + run: npm run compile + working-directory: test/integration/browser # This is required for SecretStorage unittests - name: Create temporary keychain @@ -232,10 +235,10 @@ jobs: run: DISPLAY=:10 ./scripts/test.sh - name: Run Unit Tests (node.js) - run: yarn test-node + run: npm run test-node - name: Run Unit Tests (Browser, Chromium) - run: DISPLAY=:10 yarn test-browser-no-install --browser chromium + run: DISPLAY=:10 npm run test-browser-no-install --browser chromium - name: Run Integration Tests (Electron) run: DISPLAY=:10 ./scripts/test-integration.sh @@ -269,44 +272,45 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-cacheNodeModulesLinux-${{ steps.nodeModulesCacheKey.outputs.value }} - - name: Get yarn cache directory path - id: yarnCacheDirPath + - name: Get npm cache directory path + id: npmCacheDirPath if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - name: Cache yarn directory + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT + - name: Cache npm directory if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} uses: actions/cache@v4 with: - path: ${{ steps.yarnCacheDirPath.outputs.dir }} - key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} - restore-keys: ${{ runner.os }}-yarnCacheDir- - - name: Execute yarn + path: ${{ steps.npmCacheDirPath.outputs.dir }} + key: ${{ runner.os }}-npmCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} + restore-keys: ${{ runner.os }}-npmCacheDir- + - name: Execute npm if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 ELECTRON_SKIP_BINARY_DOWNLOAD: 1 - run: yarn --frozen-lockfile --network-timeout 180000 + run: npm ci - name: Download Playwright - run: yarn playwright-install + run: npm run playwright-install - name: Run Hygiene Checks - run: yarn gulp hygiene + run: npm run gulp hygiene - name: Run Valid Layers Checks - run: yarn valid-layers-check + run: npm run valid-layers-check - name: Compile /build/ - run: yarn --cwd build compile + run: npm run compile + working-directory: build - name: Check clean git state run: ./.github/workflows/check-clean-git-state.sh - name: Run eslint - run: yarn eslint + run: npm run eslint - name: Run vscode-dts Compile Checks - run: yarn vscode-dts-compile-check + run: npm run vscode-dts-compile-check - name: Run Trusted Types Checks - run: yarn tsec-compile-check + run: npm run tsec-compile-check diff --git a/github/workflows/deep-classifier-assign-monitor.yml b/github/workflows/deep-classifier-assign-monitor.yml deleted file mode 100644 index cfd9abc374a..00000000000 --- a/github/workflows/deep-classifier-assign-monitor.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: "Deep Classifier: Assign Monitor" -on: - issues: - types: [assigned] - -jobs: - main: - runs-on: ubuntu-latest - if: ${{ contains(github.event.issue.labels.*.name, 'triage-needed') }} - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - ref: stable - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions - - name: "Run Classifier: Monitor" - uses: ./actions/classifier-deep/monitor - with: - botName: VSCodeTriageBot - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} diff --git a/github/workflows/deep-classifier-runner.yml b/github/workflows/deep-classifier-runner.yml deleted file mode 100644 index 81fd3516751..00000000000 --- a/github/workflows/deep-classifier-runner.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: "Deep Classifier: Runner" - -permissions: - id-token: write - contents: read - -on: - schedule: - - cron: 0 * * * * - workflow_dispatch: - repository_dispatch: - types: [trigger-deep-classifier-runner] - -jobs: - main: - runs-on: ubuntu-latest - environment: main - steps: - - uses: azure/login@v2 - with: - client-id: ${{ vars.AZURE_CLIENT_ID }} - tenant-id: ${{ vars.AZURE_TENANT_ID }} - allow-no-subscriptions: true - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - ref: stable - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions - - name: Install Additional Dependencies - # Pulls in a bunch of other packages that arent needed for the rest of the actions - run: npm install @azure/storage-blob@12.1.1 mongodb@2.2.31 - - name: "Run Classifier: Scraper" - uses: ./actions/classifier-deep/apply/fetch-sources - with: - # slightly overlapping to protect against issues slipping through the cracks if a run is delayed - until: 5 - excludeLabels: feature-request|testplan-item - configPath: classifier - blobContainerName: vscode-issue-classifier - blobStorageKey: ${{secrets.AZURE_BLOB_STORAGE_CONNECTION_STRING}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - - name: Set up Python 3.7 - uses: actions/setup-python@v5 - with: - python-version: 3.7 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade numpy==1.20.0 scipy==1.6.0 scikit-learn==0.24.1 joblib==1.0.0 nltk==3.5 simpletransformers==0.51.16 torch==1.7.1 torchvision==0.8.2 - - name: "Run Classifier: Generator" - run: python ./actions/classifier-deep/apply/generate-labels/main.py - - name: "Run Classifier: Labeler" - uses: ./actions/classifier-deep/apply/apply-labels - with: - configPath: classifier - allowLabels: "info-needed|new release|error-telemetry|*english-please|translation-required" - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} diff --git a/github/workflows/deep-classifier-scraper.yml b/github/workflows/deep-classifier-scraper.yml deleted file mode 100644 index e21061549d9..00000000000 --- a/github/workflows/deep-classifier-scraper.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: "Deep Classifier: Scraper" -on: - schedule: - - cron: 0 0 15 * * # 15th of the month - workflow_dispatch: - repository_dispatch: - types: [trigger-deep-classifier-scraper] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - ref: stable - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions - - name: Install Additional Dependencies - # Pulls in a bunch of other packages that arent needed for the rest of the actions - run: npm install @azure/storage-blob@12.1.1 - - name: "Run Classifier: Scraper" - uses: ./actions/classifier-deep/train/fetch-issues - with: - blobContainerName: vscode-issue-classifier - blobStorageKey: ${{secrets.AZURE_BLOB_STORAGE_CONNECTION_STRING}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} diff --git a/github/workflows/deep-classifier-unassign-monitor.yml b/github/workflows/deep-classifier-unassign-monitor.yml deleted file mode 100644 index d0e14e936c2..00000000000 --- a/github/workflows/deep-classifier-unassign-monitor.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: "Deep Classifier: Unassign Monitor" -on: - issues: - types: [unassigned] - -jobs: - main: - runs-on: ubuntu-latest - if: ${{ ! contains(github.event.issue.labels.*.name, 'triage-needed') }} - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - ref: stable - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions - - name: "Run Classifier: Monitor" - uses: ./actions/classifier-deep/monitor - with: - botName: VSCodeTriageBot - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} diff --git a/github/workflows/english-please.yml b/github/workflows/english-please.yml deleted file mode 100644 index 9e04d6d549c..00000000000 --- a/github/workflows/english-please.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: English Please -on: - issues: - types: [edited] - -# also make changes in ./on-label.yml and ./on-open.yml -jobs: - main: - runs-on: ubuntu-latest - if: contains(github.event.issue.labels.*.name, '*english-please') - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - ref: stable - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions - - name: Run English Please - uses: ./actions/english-please - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - cognitiveServicesAPIKey: ${{secrets.AZURE_TEXT_TRANSLATOR_KEY}} - nonEnglishLabel: "*english-please" - needsMoreInfoLabel: "info-needed" - translatorRequestedLabelPrefix: "translation-required-" - translatorRequestedLabelColor: "c29cff" diff --git a/github/workflows/feature-request.yml b/github/workflows/feature-request.yml deleted file mode 100644 index 83c0a9705c5..00000000000 --- a/github/workflows/feature-request.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Feature Request Manager -on: - repository_dispatch: - types: [trigger-feature-request-manager] - issues: - types: [milestoned] - schedule: - - cron: 20 2 * * * # 4:20am Zurich - -# also make changes in ./on-label.yml -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - if: github.event_name != 'issues' || contains(github.event.issue.labels.*.name, 'feature-request') - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - path: ./actions - ref: stable - - name: Install Actions - if: github.event_name != 'issues' || contains(github.event.issue.labels.*.name, 'feature-request') - run: npm install --production --prefix ./actions - - name: Run Feature Request Manager - if: github.event_name != 'issues' || contains(github.event.issue.labels.*.name, 'feature-request') - uses: ./actions/feature-request - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - candidateMilestoneID: 107 - candidateMilestoneName: Backlog Candidates - backlogMilestoneID: 8 - featureRequestLabel: feature-request - upvotesRequired: 20 - numCommentsOverride: 20 - initComment: "This feature request is now a candidate for our backlog. The community has 60 days to [upvote](https://github.com/microsoft/vscode/wiki/Issues-Triaging#up-voting-a-feature-request) the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!" - warnComment: "This feature request has not yet received the 20 community [upvotes](https://github.com/microsoft/vscode/wiki/Issues-Triaging#up-voting-a-feature-request) it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!" - acceptComment: ":slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!" - rejectComment: ":slightly_frowning_face: In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!" - warnDays: 10 - closeDays: 60 - milestoneDelaySeconds: 60 diff --git a/github/workflows/latest-release-monitor.yml b/github/workflows/latest-release-monitor.yml deleted file mode 100644 index f7392dc24a8..00000000000 --- a/github/workflows/latest-release-monitor.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Latest Release Monitor -on: - schedule: - - cron: 0/5 * * * * - repository_dispatch: - types: [trigger-latest-release-monitor] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - path: ./actions - ref: stable - - name: Install Actions - run: npm install --production --prefix ./actions - - name: Install Storage Module - run: npm install @azure/storage-blob@12.1.1 - - name: Run Latest Release Monitor - uses: ./actions/latest-release-monitor - with: - storageKey: ${{secrets.AZURE_BLOB_STORAGE_CONNECTION_STRING}} - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} diff --git a/github/workflows/locker.yml b/github/workflows/locker.yml deleted file mode 100644 index ef775ce8fdf..00000000000 --- a/github/workflows/locker.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Locker -on: - schedule: - - cron: 20 23 * * * # 4:20pm Redmond - repository_dispatch: - types: [trigger-locker] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - path: ./actions - ref: stable - - name: Install Actions - run: npm install --production --prefix ./actions - - name: Run Locker - uses: ./actions/locker - with: - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - daysSinceClose: 45 - daysSinceUpdate: 3 - ignoredLabel: "*out-of-scope,accessibility" - ignoreLabelUntil: "author-verification-requested" - ignoredMilestones: "Backlog Candidates" - labelUntil: "verified" diff --git a/github/workflows/monaco-editor.yml b/github/workflows/monaco-editor.yml index 8c8ae7b743d..426999ce43b 100644 --- a/github/workflows/monaco-editor.yml +++ b/github/workflows/monaco-editor.yml @@ -34,43 +34,42 @@ jobs: path: "**/node_modules" key: ${{ runner.os }}-cacheNodeModules20-${{ steps.nodeModulesCacheKey.outputs.value }} restore-keys: ${{ runner.os }}-cacheNodeModules20- - - name: Get yarn cache directory path - id: yarnCacheDirPath + - name: Get npm cache directory path + id: npmCacheDirPath if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - name: Cache yarn directory + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT + - name: Cache npm directory if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} uses: actions/cache@v4 with: - path: ${{ steps.yarnCacheDirPath.outputs.dir }} - key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} - restore-keys: ${{ runner.os }}-yarnCacheDir- + path: ${{ steps.npmCacheDirPath.outputs.dir }} + key: ${{ runner.os }}-npmCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} + restore-keys: ${{ runner.os }}-npmCacheDir- - name: Install libkrb5-dev if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} run: | sudo apt update sudo apt install -y libkrb5-dev - - name: Execute yarn + - name: Execute npm if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 ELECTRON_SKIP_BINARY_DOWNLOAD: 1 run: | - npm i -g node-gyp@9.4.0 - yarn --frozen-lockfile --network-timeout 180000 + npm ci - name: Download Playwright - run: yarn playwright-install + run: npm run playwright-install - name: Run Monaco Editor Checks - run: yarn monaco-compile-check + run: npm run monaco-compile-check - name: Editor Distro & ESM - run: yarn gulp editor-esm + run: npm run gulp editor-esm - name: Editor ESM sources check working-directory: ./test/monaco - run: yarn run esm-check + run: npm run esm-check - name: Typings validation prep run: | @@ -79,20 +78,20 @@ jobs: - name: Typings validation working-directory: ./typings-test run: | - yarn init -yp + npm init -yp ../node_modules/.bin/tsc --init echo "import '../out-monaco-editor-core';" > a.ts ../node_modules/.bin/tsc --noEmit - name: Package Editor with Webpack working-directory: ./test/monaco - run: yarn run bundle-webpack + run: npm run bundle-webpack - name: Compile Editor Tests working-directory: ./test/monaco - run: yarn run compile + run: npm run compile - name: Run Editor Tests timeout-minutes: 5 working-directory: ./test/monaco - run: yarn test + run: npm run test diff --git a/github/workflows/needs-more-info-closer.yml b/github/workflows/needs-more-info-closer.yml deleted file mode 100644 index 8db8a4246a3..00000000000 --- a/github/workflows/needs-more-info-closer.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: info-needed Closer -on: - schedule: - - cron: 20 11 * * * # 4:20am Redmond - repository_dispatch: - types: [trigger-needs-more-info] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - path: ./actions - ref: stable - - name: Install Actions - run: npm install --production --prefix ./actions - - name: Run info-needed Closer - uses: ./actions/needs-more-info-closer - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - label: info-needed - closeDays: 7 - additionalTeam: "cleidigh|usernamehw|gjsjohnmurray|IllusionMH" - closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!" - pingDays: 80 - pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if the problem no longer exists, or adding more information." diff --git a/github/workflows/no-package-lock-changes.yml b/github/workflows/no-package-lock-changes.yml new file mode 100644 index 00000000000..45d5d17407b --- /dev/null +++ b/github/workflows/no-package-lock-changes.yml @@ -0,0 +1,31 @@ +name: Prevent package-lock.json changes in PRs +on: [pull_request] + +jobs: + main: + name: Prevent package-lock.json changes in PRs + runs-on: ubuntu-latest + steps: + - uses: octokit/request-action@v2.x + id: get_permissions + with: + route: GET /repos/microsoft/vscode/collaborators/{username}/permission + username: ${{ github.event.pull_request.user.login }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set control output variable + id: control + run: | + echo "user: ${{ github.event.pull_request.user.login }}" + echo "role: ${{ fromJson(steps.get_permissions.outputs.data).permission }}" + echo "is dependabot: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}" + echo "should_run: ${{ !contains(fromJson('["admin", "maintain", "write"]'), fromJson(steps.get_permissions.outputs.data).permission) }}" + echo "should_run=${{ !contains(fromJson('["admin", "maintain", "write"]'), fromJson(steps.get_permissions.outputs.data).permission) && github.event.pull_request.user.login != 'dependabot[bot]' }}" >> $GITHUB_OUTPUT + - name: Get file changes + uses: trilom/file-changes-action@ce38c8ce2459ca3c303415eec8cb0409857b4272 + if: ${{ steps.control.outputs.should_run == 'true' }} + - name: Check for lockfile changes + if: ${{ steps.control.outputs.should_run == 'true' }} + run: | + cat $HOME/files.json | jq -e 'any(test("package-lock\\.json$|Cargo\\.lock$")) | not' \ + || (echo "Changes to package-lock.json/Cargo.lock files aren't allowed in PRs." && exit 1) diff --git a/github/workflows/on-comment.yml b/github/workflows/on-comment.yml deleted file mode 100644 index 089aa77c1e7..00000000000 --- a/github/workflows/on-comment.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: On Comment -on: - issue_comment: - types: [created] - -# also make changes in ./on-label.yml -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - path: ./actions - ref: stable - - name: Install Actions - run: npm install --production --prefix ./actions - - name: Run Commands - uses: ./actions/commands - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - config-path: commands - - name: "Run Release Pipeline Labeler" - uses: ./actions/release-pipeline - with: - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - notYetReleasedLabel: unreleased - insidersReleasedLabel: insiders-released diff --git a/github/workflows/on-label.yml b/github/workflows/on-label.yml deleted file mode 100644 index bf563734017..00000000000 --- a/github/workflows/on-label.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: On Label -on: - issues: - types: [labeled] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - ref: stable - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions - - # source of truth in ./author-verified.yml - - name: Run Author Verified - if: contains(github.event.issue.labels.*.name, 'author-verification-requested') && contains(github.event.issue.labels.*.name, 'insiders-released') - uses: ./actions/author-verified - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - requestVerificationComment: "This bug has been fixed in the latest release of [VS Code Insiders](https://code.visualstudio.com/insiders/)!\n\n@${author}, you can help us out by commenting `/verified` if things are now working as expected.\n\nIf things still don't seem right, please ensure you're on version ${commit} of Insiders (today's or later - you can use `Help: About` in the command palette to check), and leave a comment letting us know what isn't working as expected.\n\nHappy Coding!" - releasedLabel: insiders-released - verifiedLabel: verified - authorVerificationRequestedLabel: author-verification-requested - - - # also make changes in ./on-comment.yml - - name: Run Commands - uses: ./actions/commands - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - config-path: commands - - # source of truth in ./feature-request.yml - - name: Run Feature Request Manager - if: contains(github.event.issue.labels.*.name, 'feature-request') - uses: ./actions/feature-request - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - candidateMilestoneID: 107 - candidateMilestoneName: Backlog Candidates - backlogMilestoneID: 8 - featureRequestLabel: feature-request - upvotesRequired: 20 - numCommentsOverride: 20 - initComment: "This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!" - warnComment: "This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding" - acceptComment: ":slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!" - rejectComment: ":slightly_frowning_face: In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!" - warnDays: 10 - closeDays: 60 - milestoneDelaySeconds: 60 - - # source of truth in ./test-plan-item-validator.yml - - name: Run Test Plan Item Validator - if: contains(github.event.issue.labels.*.name, 'testplan-item') || contains(github.event.issue.labels.*.name, 'invalid-testplan-item') - uses: ./actions/test-plan-item-validator - with: - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - refLabel: on-testplan - label: testplan-item - invalidLabel: invalid-testplan-item - comment: Invalid test plan item. See errors below and the [test plan item spec](https://github.com/microsoft/vscode/wiki/Writing-Test-Plan-Items) for more information. This comment will go away when the issues are resolved. - - # source of truth in ./english-please.yml - - name: Run English Please - if: contains(github.event.issue.labels.*.name, '*english-please') - uses: ./actions/english-please - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - cognitiveServicesAPIKey: ${{secrets.AZURE_TEXT_TRANSLATOR_KEY}} - nonEnglishLabel: "*english-please" - needsMoreInfoLabel: "info-needed" - translatorRequestedLabelPrefix: "translation-required-" - translatorRequestedLabelColor: "c29cff" diff --git a/github/workflows/on-open.yml b/github/workflows/on-open.yml deleted file mode 100644 index 361ac11b946..00000000000 --- a/github/workflows/on-open.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: On Open -on: - issues: - types: [opened] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - ref: stable - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions - - - name: Run CopyCat (VSCodeTriageBot/testissues) - uses: ./actions/copycat - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - owner: VSCodeTriageBot - repo: testissues - - - name: Run New Release - uses: ./actions/new-release - with: - label: new release - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - labelColor: "006b75" - labelDescription: Issues found in a recent release of VS Code - oldVersionMessage: "Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is {currentVersion}. Please try upgrading to the latest version and checking whether this issue remains.\n\nHappy Coding!" - days: 5 - - - name: Run Clipboard Labeler - uses: ./actions/regex-labeler - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - label: "invalid" - mustNotMatch: "^We have written the needed data into your clipboard because it was too large to send\\. Please paste\\.$" - comment: "It looks like you're using the VS Code Issue Reporter but did not paste the text generated into the created issue. We've closed this issue, please open a new one containing the text we placed in your clipboard.\n\nHappy Coding!" - - - name: Run Clipboard Labeler (Chinese) - uses: ./actions/regex-labeler - with: - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - label: "invalid" - mustNotMatch: "^所需的数据太大,无法直接发送。我们已经将其写入剪贴板,请粘贴。$" - comment: "看起来您正在使用 VS Code 问题报告程序,但是没有将生成的文本粘贴到创建的问题中。我们将关闭这个问题,请使用剪贴板中的内容创建一个新的问题。\n\n祝您使用愉快!" - - # source of truth in ./english-please.yml - - name: Run English Please - uses: ./actions/english-please - with: - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - cognitiveServicesAPIKey: ${{secrets.AZURE_TEXT_TRANSLATOR_KEY}} - nonEnglishLabel: "*english-please" - needsMoreInfoLabel: "info-needed" - translatorRequestedLabelPrefix: "translation-required-" - translatorRequestedLabelColor: "c29cff" - # source of truth in ./test-plan-item-validator.yml - - name: Run Test Plan Item Validator - uses: ./actions/test-plan-item-validator - with: - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - refLabel: on-testplan - label: testplan-item - invalidLabel: invalid-testplan-item - comment: Invalid test plan item. See errors below and the [test plan item spec](https://github.com/microsoft/vscode/wiki/Writing-Test-Plan-Items) for more information. This comment will go away when the issues are resolved. - diff --git a/github/workflows/release-pipeline-labeler.yml b/github/workflows/release-pipeline-labeler.yml deleted file mode 100644 index 87e188a02ab..00000000000 --- a/github/workflows/release-pipeline-labeler.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: "Release Pipeline Labeler" -on: - issues: - types: [closed, reopened] - repository_dispatch: - types: [released-insider] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - ref: stable - path: ./actions - - name: Checkout Repo - if: github.event_name != 'issues' - uses: actions/checkout@v4 - with: - path: ./repo - fetch-depth: 0 - - name: Install Actions - run: npm install --production --prefix ./actions - - name: "Run Release Pipeline Labeler" - uses: ./actions/release-pipeline - with: - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} - notYetReleasedLabel: unreleased - insidersReleasedLabel: insiders-released diff --git a/github/workflows/rich-navigation.yml.off b/github/workflows/rich-navigation.yml.off index 73d073f4d7b..cc22d83030d 100644 --- a/github/workflows/rich-navigation.yml.off +++ b/github/workflows/rich-navigation.yml.off @@ -18,7 +18,7 @@ jobs: name: Cache VS Code dependencies with: path: node_modules - key: ${{ runner.os }}-dependencies-${{ hashfiles('yarn.lock') }} + key: ${{ runner.os }}-dependencies-${{ hashfiles('package-lock.json') }} restore-keys: ${{ runner.os }}-dependencies- - uses: actions/setup-node@v3 @@ -27,7 +27,7 @@ jobs: - name: Install dependencies if: steps.caching-stage.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile + run: npm ci env: CHILD_CONCURRENCY: 1 diff --git a/github/workflows/telemetry.yml b/github/workflows/telemetry.yml index d463a0e2eca..d29ea6c58da 100644 --- a/github/workflows/telemetry.yml +++ b/github/workflows/telemetry.yml @@ -16,4 +16,4 @@ jobs: - name: 'Run vscode-telemetry-extractor' run: 'npx --package=@vscode/telemetry-extractor --yes vscode-telemetry-extractor -s .' env: - GITHUB_TOKEN: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/github/workflows/test-plan-item-validator.yml b/github/workflows/test-plan-item-validator.yml deleted file mode 100644 index 117eaf6908a..00000000000 --- a/github/workflows/test-plan-item-validator.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Test Plan Item Validator -on: - issues: - types: [edited] - -# also edit in ./on-label.yml and ./on-open.yml -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout Actions - if: contains(github.event.issue.labels.*.name, 'testplan-item') || contains(github.event.issue.labels.*.name, 'invalid-testplan-item') - uses: actions/checkout@v4 - with: - repository: "microsoft/vscode-github-triage-actions" - path: ./actions - ref: stable - - name: Install Actions - if: contains(github.event.issue.labels.*.name, 'testplan-item') || contains(github.event.issue.labels.*.name, 'invalid-testplan-item') - run: npm install --production --prefix ./actions - - name: Run Test Plan Item Validator - if: contains(github.event.issue.labels.*.name, 'testplan-item') || contains(github.event.issue.labels.*.name, 'invalid-testplan-item') - uses: ./actions/test-plan-item-validator - with: - token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} - refLabel: on-testplan - label: testplan-item - invalidLabel: invalid-testplan-item - comment: Invalid test plan item. See errors below and the [test plan item spec](https://github.com/microsoft/vscode/wiki/Writing-Test-Plan-Items) for more information. This comment will go away when the issues are resolved. diff --git a/migrate.mjs b/migrate.mjs new file mode 100644 index 00000000000..ef8a8346169 --- /dev/null +++ b/migrate.mjs @@ -0,0 +1,364 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +//@ts-check + +// ***************************************************************** +// * * +// * AMD-TO-ESM MIGRATION SCRIPT * +// * * +// ***************************************************************** + +import { readFileSync, writeFileSync, unlinkSync } from 'node:fs'; +import { join, extname, dirname, relative } from 'node:path'; +import { preProcessFile } from 'typescript'; +import { existsSync, mkdirSync, readdirSync, statSync } from 'fs'; +import { fileURLToPath } from 'node:url'; + +// @ts-expect-error +import watch from './build/lib/watch/index.js'; + +const enableWatching = !process.argv.includes('--disable-watch'); +const enableInPlace = process.argv.includes('--enable-in-place'); +const esmToAmd = process.argv.includes('--enable-esm-to-amd'); +const amdToEsm = !esmToAmd; + +const srcFolder = fileURLToPath(new URL('src', import.meta.url)); +const dstFolder = fileURLToPath(new URL(enableInPlace ? 'src' : 'src2', import.meta.url)); + +const binaryFileExtensions = new Set([ + '.svg', '.ttf', '.png', '.sh', '.html', '.json', '.zsh', '.scpt', '.mp3', '.fish', '.ps1', '.psm1', '.md', '.txt', '.zip', '.pdf', '.qwoff', '.jxs', '.tst', '.wuff', '.less', '.utf16le', '.snap', '.actual', '.tsx', '.scm' +]); + +function migrate() { + console.log(`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`); + console.log(`STARTING ${amdToEsm ? 'AMD->ESM' : 'ESM->AMD'} MIGRATION of ${enableInPlace ? 'src in-place' : 'src to src2'}.`); + + // installing watcher quickly to avoid missing early events + const watchSrc = enableWatching ? watch('src/**', { base: 'src', readDelay: 200 }) : undefined; + + /** @type {string[]} */ + const files = []; + readdir(srcFolder, files); + + for (const filePath of files) { + const fileContents = readFileSync(filePath); + migrateOne(filePath, fileContents); + } + + if (amdToEsm) { + writeFileSync(join(dstFolder, 'package.json'), `{"type": "module"}`); + } else { + unlinkSync(join(dstFolder, 'package.json')); + } + + if (!enableInPlace) { + writeFileSync(join(dstFolder, '.gitignore'), `*`); + } + + console.log(`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`); + console.log(`COMPLETED ${amdToEsm ? 'AMD->ESM' : 'ESM->AMD'} MIGRATION of ${enableInPlace ? 'src in-place' : 'src to src2'}. You can now launch npm run watch-amd or npm run watch-client-amd`); + if (esmToAmd) { + console.log(`Make sure to set the environment variable VSCODE_BUILD_AMD to a string of value 'true' if you want to build VS Code as AMD`); + } + + if (watchSrc) { + console.log(`WATCHING src for changes...`); + + watchSrc.on('data', (e) => { + migrateOne(e.path, e.contents); + console.log(`Handled change event for ${e.path}.`); + }); + } +} + +/** + * @param filePath + * @param fileContents + */ +function migrateOne(filePath, fileContents) { + const fileExtension = extname(filePath); + + if (fileExtension === '.ts') { + migrateTS(filePath, fileContents.toString()); + } else if (filePath.endsWith('tsconfig.base.json')) { + const opts = JSON.parse(fileContents.toString()); + if (amdToEsm) { + opts.compilerOptions.module = 'es2022'; + opts.compilerOptions.allowSyntheticDefaultImports = true; + } else { + opts.compilerOptions.module = 'amd'; + delete opts.compilerOptions.allowSyntheticDefaultImports; + } + writeDestFile(filePath, JSON.stringify(opts, null, '\t')); + } else if (fileExtension === '.js' || fileExtension === '.cjs' || fileExtension === '.mjs' || fileExtension === '.css' || binaryFileExtensions.has(fileExtension)) { + writeDestFile(filePath, fileContents); + } else { + console.log(`ignoring ${filePath}`); + } +} + +/** + * @param fileContents + * @typedef {{pos:number;end:number;}} Import + * @return + */ +function discoverImports(fileContents) { + const info = preProcessFile(fileContents); + const search = /export .* from ['"]([^'"]+)['"]/g; + /** typedef {Import[]} */ + let result = []; + do { + const m = search.exec(fileContents); + if (!m) { + break; + } + const end = m.index + m[0].length - 2; + const pos = end - m[1].length; + result.push({ pos, end }); + } while (true); + + result = result.concat(info.importedFiles); + + result.sort((a, b) => { + return a.pos - b.pos; + }); + for (let i = 1; i < result.length; i++) { + const prev = result[i - 1]; + const curr = result[i]; + if (prev.pos === curr.pos) { + result.splice(i, 1); + i--; + } + } + return result; +} + +/** + * @param filePath + * @param fileContents + */ +function migrateTS(filePath, fileContents) { + if (filePath.endsWith('.d.ts')) { + return writeDestFile(filePath, fileContents); + } + + const imports = discoverImports(fileContents); + /** @type {Replacement[]} */ + const replacements = []; + for (let i = imports.length - 1; i >= 0; i--) { + const pos = imports[i].pos + 1; + const end = imports[i].end + 1; + const importedFilename = fileContents.substring(pos, end); + + /** @type {string|undefined} */ + let importedFilepath = undefined; + if (amdToEsm) { + if (/^vs\/css!/.test(importedFilename)) { + importedFilepath = importedFilename.substr('vs/css!'.length) + '.css'; + } else { + importedFilepath = importedFilename; + } + } else { + if (importedFilename.endsWith('.css')) { + importedFilepath = `vs/css!${importedFilename.substr(0, importedFilename.length - 4)}`; + } else if (importedFilename.endsWith('.js')) { + importedFilepath = importedFilename.substr(0, importedFilename.length - 3); + } + } + + if (typeof importedFilepath !== 'string') { + continue; + } + + /** @type {boolean} */ + let isRelativeImport; + if (amdToEsm) { + if (/(^\.\/)|(^\.\.\/)/.test(importedFilepath)) { + importedFilepath = join(dirname(filePath), importedFilepath); + isRelativeImport = true; + } else if (/^vs\//.test(importedFilepath)) { + importedFilepath = join(srcFolder, importedFilepath); + isRelativeImport = true; + } else { + importedFilepath = importedFilepath; + isRelativeImport = false; + } + } else { + importedFilepath = importedFilepath; + isRelativeImport = false; + } + + /** @type {string} */ + let replacementImport; + + if (isRelativeImport) { + replacementImport = generateRelativeImport(filePath, importedFilepath); + } else { + replacementImport = importedFilepath; + } + + replacements.push({ pos, end, text: replacementImport }); + } + + fileContents = applyReplacements(fileContents, replacements); + + writeDestFile(filePath, fileContents); +} + +/** + * @param filePath + * @param importedFilepath + */ +function generateRelativeImport(filePath, importedFilepath) { + /** @type {string} */ + let relativePath; + // See https://github.com/microsoft/TypeScript/issues/16577#issuecomment-754941937 + if (!importedFilepath.endsWith('.css') && !importedFilepath.endsWith('.cjs')) { + importedFilepath = `${importedFilepath}.js`; + } + relativePath = relative(dirname(filePath), `${importedFilepath}`); + relativePath = relativePath.replace(/\\/g, '/'); + if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) { + relativePath = './' + relativePath; + } + return relativePath; +} + +/** @typedef {{pos:number;end:number;text:string;}} Replacement */ + +/** + * @param str + * @param replacements + */ +function applyReplacements(str, replacements) { + replacements.sort((a, b) => { + return a.pos - b.pos; + }); + + /** @type {string[]} */ + const result = []; + let lastEnd = 0; + for (const replacement of replacements) { + const { pos, end, text } = replacement; + result.push(str.substring(lastEnd, pos)); + result.push(text); + lastEnd = end; + } + result.push(str.substring(lastEnd, str.length)); + return result.join(''); +} + +/** + * @param srcFilePath + * @param fileContents + */ +function writeDestFile(srcFilePath, fileContents) { + const destFilePath = srcFilePath.replace(srcFolder, dstFolder); + ensureDir(dirname(destFilePath)); + + if (/(\.ts$)|(\.js$)|(\.html$)/.test(destFilePath)) { + fileContents = toggleComments(fileContents); + } + + /** @type {Buffer | undefined} */ + let existingFileContents = undefined; + try { + existingFileContents = readFileSync(destFilePath); + } catch (err) { } + if (!buffersAreEqual(existingFileContents, fileContents)) { + writeFileSync(destFilePath, fileContents); + } + + /** + * @param fileContents + */ + function toggleComments(fileContents) { + const lines = String(fileContents).split(/\r\n|\r|\n/); + let mode = 0; + let didChange = false; + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + if (mode === 0) { + if (amdToEsm ? /\/\/ ESM-comment-begin/.test(line) : /\/\/ ESM-uncomment-begin/.test(line)) { + mode = 1; + continue; + } + if (amdToEsm ? /\/\/ ESM-uncomment-begin/.test(line) : /\/\/ ESM-comment-begin/.test(line)) { + mode = 2; + continue; + } + continue; + } + + if (mode === 1) { + if (amdToEsm ? /\/\/ ESM-comment-end/.test(line) : /\/\/ ESM-uncomment-end/.test(line)) { + mode = 0; + continue; + } + didChange = true; + lines[i] = line.replace(/^\s*/, (match) => match + '// '); + continue; + } + + if (mode === 2) { + if (amdToEsm ? /\/\/ ESM-uncomment-end/.test(line) : /\/\/ ESM-comment-end/.test(line)) { + mode = 0; + continue; + } + didChange = true; + lines[i] = line.replace(/^(\s*)\/\/ ?/, function (_, indent) { + return indent; + }); + } + } + + if (didChange) { + return lines.join('\n'); + } + return fileContents; + } +} + +/** + * @param existingFileContents + * @param fileContents + */ +function buffersAreEqual(existingFileContents, fileContents) { + if (!existingFileContents) { + return false; + } + if (typeof fileContents === 'string') { + fileContents = Buffer.from(fileContents); + } + return existingFileContents.equals(fileContents); +} + +const ensureDirCache = new Set(); +function ensureDir(dirPath) { + if (ensureDirCache.has(dirPath)) { + return; + } + ensureDirCache.add(dirPath); + ensureDir(dirname(dirPath)); + if (!existsSync(dirPath)) { + mkdirSync(dirPath); + } +} + +function readdir(dirPath, result) { + const entries = readdirSync(dirPath); + for (const entry of entries) { + const entryPath = join(dirPath, entry); + const stat = statSync(entryPath); + if (stat.isDirectory()) { + readdir(join(dirPath, entry), result); + } else { + result.push(entryPath); + } + } +} + +migrate(); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000000..0a75845e223 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,19806 @@ +{ + "name": "code-oss-dev", + "version": "1.94.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "code-oss-dev", + "version": "1.94.0", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@bpasero/watcher": "https://github.com/bpasero/watcher.git#3e5e50c275590703f3eb46fac777b720e515d0d5", + "@microsoft/1ds-core-js": "^3.2.13", + "@microsoft/1ds-post-js": "^3.2.13", + "@parcel/watcher": "2.1.0", + "@vscode/deviceid": "^0.1.1", + "@vscode/iconv-lite-umd": "0.7.0", + "@vscode/policy-watcher": "^1.1.4", + "@vscode/proxy-agent": "^0.23.0", + "@vscode/ripgrep": "^1.15.9", + "@vscode/spdlog": "^0.15.0", + "@vscode/sqlite3": "5.1.6-vscode", + "@vscode/sudo-prompt": "9.3.1", + "@vscode/tree-sitter-wasm": "^0.0.3", + "@vscode/vscode-languagedetection": "1.0.21", + "@vscode/windows-mutex": "^0.5.0", + "@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", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "jschardet": "3.1.3", + "kerberos": "2.1.1", + "minimist": "^1.2.6", + "native-is-elevated": "0.7.0", + "native-keymap": "^3.3.5", + "native-watchdog": "^1.4.1", + "node-pty": "1.1.0-beta21", + "open": "^8.4.2", + "tas-client-umd": "0.2.0", + "v8-inspect-profiler": "^0.1.1", + "vscode-oniguruma": "1.7.0", + "vscode-regexpp": "^3.1.0", + "vscode-textmate": "9.1.0", + "yauzl": "^3.0.0", + "yazl": "^2.4.3" + }, + "devDependencies": { + "@playwright/test": "^1.46.1", + "@swc/core": "1.3.62", + "@types/cookie": "^0.3.3", + "@types/debug": "^4.1.5", + "@types/gulp-svgmin": "^1.2.1", + "@types/http-proxy-agent": "^2.0.1", + "@types/kerberos": "^1.1.2", + "@types/minimist": "^1.2.1", + "@types/mocha": "^9.1.1", + "@types/node": "20.x", + "@types/sinon": "^10.0.2", + "@types/sinon-test": "^2.4.2", + "@types/trusted-types": "^1.0.6", + "@types/vscode-notebook-renderer": "^1.72.0", + "@types/webpack": "^5.28.5", + "@types/wicg-file-system-access": "^2020.9.6", + "@types/windows-foreground-love": "^0.3.0", + "@types/winreg": "^1.2.30", + "@types/yauzl": "^2.10.0", + "@types/yazl": "^2.4.2", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/experimental-utils": "^5.57.0", + "@typescript-eslint/parser": "^6.21.0", + "@vscode/gulp-electron": "^1.36.0", + "@vscode/l10n-dev": "0.0.35", + "@vscode/telemetry-extractor": "^1.10.2", + "@vscode/test-cli": "^0.0.6", + "@vscode/test-electron": "^2.4.0", + "@vscode/test-web": "^0.0.60", + "@vscode/v8-heap-parser": "^0.1.0", + "@vscode/vscode-perf": "^0.0.14", + "@webgpu/types": "^0.1.44", + "ansi-colors": "^3.2.3", + "asar": "^3.0.3", + "chromium-pickle-js": "^0.2.0", + "cookie": "^0.4.0", + "copy-webpack-plugin": "^11.0.0", + "css-loader": "^6.9.1", + "cssnano": "^6.0.3", + "debounce": "^1.0.0", + "deemon": "^1.8.0", + "electron": "30.5.0", + "eslint": "8.36.0", + "eslint-plugin-header": "3.1.1", + "eslint-plugin-jsdoc": "^46.5.0", + "eslint-plugin-local": "^1.0.0", + "event-stream": "3.3.4", + "fancy-log": "^1.3.3", + "file-loader": "^6.2.0", + "glob": "^5.0.13", + "gulp": "^4.0.0", + "gulp-azure-storage": "^0.12.1", + "gulp-bom": "^3.0.0", + "gulp-buffer": "0.0.2", + "gulp-concat": "^2.6.1", + "gulp-eslint": "^5.0.0", + "gulp-filter": "^5.1.0", + "gulp-flatmap": "^1.0.2", + "gulp-gunzip": "^1.0.0", + "gulp-gzip": "^1.4.2", + "gulp-json-editor": "^2.5.0", + "gulp-plumber": "^1.2.0", + "gulp-rename": "^1.2.0", + "gulp-replace": "^0.5.4", + "gulp-sourcemaps": "^3.0.0", + "gulp-svgmin": "^4.1.0", + "gulp-untar": "^0.0.7", + "husky": "^0.13.1", + "innosetup": "6.0.5", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-instrument": "^6.0.1", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.1", + "istanbul-reports": "^3.1.5", + "lazy.js": "^0.4.2", + "merge-options": "^1.0.1", + "mime": "^1.4.1", + "minimatch": "^3.0.4", + "minimist": "^1.2.6", + "mocha": "^10.2.0", + "mocha-junit-reporter": "^2.2.1", + "mocha-multi-reporters": "^1.5.1", + "npm-run-all": "^4.1.5", + "opn": "^6.0.0", + "os-browserify": "^0.3.0", + "p-all": "^1.0.0", + "path-browserify": "^1.0.1", + "postcss": "^8.4.33", + "postcss-nesting": "^12.0.2", + "pump": "^1.0.1", + "rcedit": "^1.1.0", + "rimraf": "^2.2.8", + "sinon": "^12.0.1", + "sinon-test": "^3.1.3", + "source-map": "0.6.1", + "source-map-support": "^0.3.2", + "style-loader": "^3.3.2", + "ts-loader": "^9.4.2", + "ts-node": "^10.9.1", + "tsec": "0.2.7", + "tslib": "^2.6.3", + "typescript": "^5.7.0-dev.20240903", + "util": "^0.12.4", + "webpack": "^5.94.0", + "webpack-cli": "^5.1.4", + "webpack-stream": "^7.0.0", + "xml2js": "^0.5.0", + "yaserver": "^0.4.0" + }, + "optionalDependencies": { + "windows-foreground-love": "0.5.0" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@azure-rest/ai-translation-text": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/@azure-rest/ai-translation-text/-/ai-translation-text-1.0.0-beta.1.tgz", + "integrity": "sha512-h1xDrmVRbk6eAAqTHxy9Npv543cWteqgop15sVXBQhadOwzHoREn+UqMCzNfvL6/AjiInUlwNSaNQK1ANgobLA==", + "dev": true, + "dependencies": { + "@azure-rest/core-client": "^1.1.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.8.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@azure-rest/core-client": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@azure-rest/core-client/-/core-client-1.4.0.tgz", + "integrity": "sha512-ozTDPBVUDR5eOnMIwhggbnVmOrka4fXCs8n8mvUo4WLLc38kki6bAOByDoVZZPz/pZy2jMt2kwfpvy/UjALj6w==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.5.0", + "@azure/core-tracing": "^1.0.1", + "@azure/core-util": "^1.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-asynciterator-polyfill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz", + "integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==", + "dev": true + }, + "node_modules/@azure/core-auth": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.7.2.tgz", + "integrity": "sha512-Igm/S3fDYmnMq1uKS38Ae1/m37B3zigdlZw+kocwEhh5GjyKjPrXKO2J6rzpC1wAxrNil/jX9BJRqBshyjnF3g==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "@azure/core-util": "^1.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-http": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-2.2.2.tgz", + "integrity": "sha512-V1DdoO9V/sFimKpdWoNBgsE+QUjQgpXYnxrTdUp5RyhsTJjvEVn/HKmTQXIHuLUUo6IyIWj+B+Dg4VaXse9dIA==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-asynciterator-polyfill": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/logger": "^1.0.0", + "@types/node-fetch": "^2.5.0", + "@types/tunnel": "^0.0.3", + "form-data": "^4.0.0", + "node-fetch": "^2.6.0", + "process": "^0.11.10", + "tough-cookie": "^4.0.0", + "tslib": "^2.2.0", + "tunnel": "^0.0.6", + "uuid": "^8.3.0", + "xml2js": "^0.4.19" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-http/node_modules/@azure/abort-controller": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.4.tgz", + "integrity": "sha512-lNUmDRVGpanCsiUN3NWxFTdwmdFI53xwhkTFfHDGTYk46ca7Ind3nanJc+U6Zj9Tv+9nTCWRBscWEW1DyKOpTw==", + "dev": true, + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@azure/core-http/node_modules/@azure/core-tracing": { + "version": "1.0.0-preview.13", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", + "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.1", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-http/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@azure/core-http/node_modules/xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", + "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "dev": true, + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/@azure/core-http/node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/@azure/core-lro": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.1.tgz", + "integrity": "sha512-HE6PBl+mlKa0eBsLwusHqAqjLc5n9ByxeDo3Hz4kF3B1hqHvRkBr4oMgoT6tX7Hc3q97KfDctDUon7EhvoeHPA==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/logger": "^1.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-lro/node_modules/@azure/abort-controller": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.4.tgz", + "integrity": "sha512-lNUmDRVGpanCsiUN3NWxFTdwmdFI53xwhkTFfHDGTYk46ca7Ind3nanJc+U6Zj9Tv+9nTCWRBscWEW1DyKOpTw==", + "dev": true, + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@azure/core-lro/node_modules/@azure/core-tracing": { + "version": "1.0.0-preview.13", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", + "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.1", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-paging": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.2.0.tgz", + "integrity": "sha512-ZX1bCjm/MjKPCN6kQD/9GJErYSoKA8YWp6YWoo5EIzcTWlSBLXu3gNaBTUl8usGl+UShiKo7b4Gdy1NSTIlpZg==", + "dev": true, + "dependencies": { + "@azure/core-asynciterator-polyfill": "^1.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-rest-pipeline": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.16.0.tgz", + "integrity": "sha512-CeuTvsXxCUmEuxH5g/aceuSl6w2EugvNHKAtKKVdiX915EjJJxAwfzNNWZreNnbxHZ2fi0zaM6wwS23x2JVqSQ==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "@azure/core-auth": "^1.4.0", + "@azure/core-tracing": "^1.0.1", + "@azure/core-util": "^1.9.0", + "@azure/logger": "^1.0.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-tracing": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.1.2.tgz", + "integrity": "sha512-dawW9ifvWAWmUm9/h+/UQ2jrdvjCJ7VJEuCJ6XVNudzcOwm53BFZH4Q845vjfgoUAM8ZxokvVNxNxAITc502YA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-util": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.9.0.tgz", + "integrity": "sha512-AfalUQ1ZppaKuxPPMsFEUdX6GZPB3d9paR9d/TTL7Ow2De8cJaC7ibi7kWVlFAVPCYo31OcnGymc0R89DX8Oaw==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/logger": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.3.tgz", + "integrity": "sha512-aK4s3Xxjrx3daZr3VylxejK3vG5ExXck5WOHDJ8in/k9AqlfIyFMMT1uG7u8mNjX+QRILTIn0/Xgschfh/dQ9g==", + "dev": true, + "dependencies": { + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/storage-blob": { + "version": "12.8.0", + "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.8.0.tgz", + "integrity": "sha512-c8+Wz19xauW0bGkTCoqZH4dYfbtBniPiGiRQOn1ca6G5jsjr4azwaTk9gwjVY8r3vY2Taf95eivLzipfIfiS4A==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-http": "^2.0.0", + "@azure/core-lro": "^2.2.0", + "@azure/core-paging": "^1.1.1", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/logger": "^1.0.0", + "events": "^3.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.4.tgz", + "integrity": "sha512-lNUmDRVGpanCsiUN3NWxFTdwmdFI53xwhkTFfHDGTYk46ca7Ind3nanJc+U6Zj9Tv+9nTCWRBscWEW1DyKOpTw==", + "dev": true, + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@azure/storage-blob/node_modules/@azure/core-tracing": { + "version": "1.0.0-preview.13", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", + "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.1", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.18.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.18.8.tgz", + "integrity": "sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.18.10", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.10.tgz", + "integrity": "sha512-JQM6k6ENcBFKVtWvLavlvi/mPcpYZ3+R+2EySDEMSMbp7Mn4FexlbbJVrx2R7Ijhr01T8gyqrOaABWIOgxeUyw==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.18.10", + "@babel/helper-compilation-targets": "^7.18.9", + "@babel/helper-module-transforms": "^7.18.9", + "@babel/helpers": "^7.18.9", + "@babel/parser": "^7.18.10", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.18.10", + "@babel/types": "^7.18.10", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "dev": true, + "dependencies": { + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.9.tgz", + "integrity": "sha512-tzLCyVmqUiFlcFoAPLA/gL9TeYrF61VLNtb+hvkuVaB5SUjW7jcfrglBIX1vUIoT7CLP3bBlIMeyEsIl2eFQNg==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.18.8", + "@babel/helper-validator-option": "^7.18.6", + "browserslist": "^4.20.2", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.9.tgz", + "integrity": "sha512-KYNqY0ICwfv19b31XzvmI/mfcylOzbLtowkw+mfvGPAQ3kfCnMLYbED3YecL5tPd8nAYFQFAd6JHp2LxZk/J1g==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-simple-access": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.18.6", + "@babel/template": "^7.18.6", + "@babel/traverse": "^7.18.9", + "@babel/types": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", + "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", + "dev": true, + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", + "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.9.tgz", + "integrity": "sha512-Jf5a+rbrLoR4eNdUmnFu8cN5eNJT6qdTdOg5IHIzq87WwyRw9PwguLFOWYgktN/60IP4fgDUawJvs7PjQIzELQ==", + "dev": true, + "dependencies": { + "@babel/template": "^7.18.6", + "@babel/traverse": "^7.18.9", + "@babel/types": "^7.18.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/types": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@bpasero/watcher": { + "version": "2.4.2-alpha.0", + "resolved": "git+ssh://git@github.com/bpasero/watcher.git#3e5e50c275590703f3eb46fac777b720e515d0d5", + "integrity": "sha512-kfF+SmdrcDHkwLdnGtK0EknGv6uPhF5tBc04dJ0xkLNMcIocZAINg1+p2ZTfqwEfCbxp+djHWw37f400fKtY7g==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@bpasero/watcher/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "license": "Apache-2.0", + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/@bpasero/watcher/node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "license": "MIT" + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@csstools/selector-specificity": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.0.1.tgz", + "integrity": "sha512-NPljRHkq4a14YzZ3YD406uaxh7s0g6eAq3L9aLOWywoqe8PkYamAvtsh7KNX6c++ihDrJ0RiU+/z7rGnhlZ5ww==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "postcss-selector-parser": "^6.0.13" + } + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz", + "integrity": "sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@electron/get": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.2.tgz", + "integrity": "sha512-eFZVFoRXb3GFGd7Ak7W4+6jBl9wBtiZ4AaYOse97ej6mKj5tkyO0dUnUChs1IhJZtx1BENo4/p4WUTXpi6vT+g==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "env-paths": "^2.2.0", + "fs-extra": "^8.1.0", + "got": "^11.8.5", + "progress": "^2.0.3", + "semver": "^6.2.0", + "sumchecker": "^3.0.1" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "global-agent": "^3.0.0" + } + }, + "node_modules/@electron/get/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/@electron/get/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@electron/get/node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/@electron/get/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@electron/get/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.40.1", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.40.1.tgz", + "integrity": "sha512-YORCdZSusAlBrFpZ77pJjc5r1bQs5caPWtAu+WWmiSo+8XaUzseapVrfAtiRFbQWnrBxxLLEwF6f6ZG/UgCQCg==", + "dev": true, + "dependencies": { + "comment-parser": "1.4.0", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.1.tgz", + "integrity": "sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.5.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.36.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.36.0.tgz", + "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@gulp-sourcemaps/identity-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz", + "integrity": "sha512-Tb+nSISZku+eQ4X1lAkevcQa+jknn/OVUgZ3XCxEKIsLsqYuPoJwJOPQeaOk75X3WPftb29GWY1eqE7GLsXb1Q==", + "dev": true, + "dependencies": { + "acorn": "^6.4.1", + "normalize-path": "^3.0.0", + "postcss": "^7.0.16", + "source-map": "^0.6.0", + "through2": "^3.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/@gulp-sourcemaps/identity-map/node_modules/picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "node_modules/@gulp-sourcemaps/identity-map/node_modules/postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "dependencies": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + } + }, + "node_modules/@gulp-sourcemaps/map-sources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", + "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o= sha512-o/EatdaGt8+x2qpb0vFLC/2Gug/xYPRXb6a+ET1wGYKozKN3krDWC/zZFZAtrzxJHuDL12mwdfEFKcKMNvc55A==", + "dev": true, + "dependencies": { + "normalize-path": "^2.0.1", + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/@gulp-sourcemaps/map-sources/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@gulp-sourcemaps/map-sources/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/@gulp-sourcemaps/map-sources/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "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.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/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/@isaacs/cliui/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==", + "dev": true + }, + "node_modules/@isaacs/cliui/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/@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/@isaacs/cliui/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/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@koa/cors": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@koa/cors/-/cors-5.0.0.tgz", + "integrity": "sha512-x/iUDjcS90W69PryLDIMgFyV21YLTnG9zOpPXS7Bkt2b8AsY3zZsIpOLBkYr9fBcF3HbkKaER5hOBZLfpLgYNw==", + "dev": true, + "dependencies": { + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@koa/router": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@koa/router/-/router-13.0.0.tgz", + "integrity": "sha512-P278xb5IoLtDn2inRsCzJVKGxt5RkjOivwxGbniMO1sI8bft1/Dr93UsRP5aByT8C74x8zqxDYyPXrQwRKIhjg==", + "dev": true, + "dependencies": { + "http-errors": "^2.0.0", + "koa-compose": "^4.1.0", + "path-to-regexp": "^6.2.2" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "3.2.13", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-3.2.13.tgz", + "integrity": "sha512-CluYTRWcEk0ObG5EWFNWhs87e2qchJUn0p2D21ZUa3PWojPZfPSBs4//WIE0MYV8Qg1Hdif2ZTwlM7TbYUjfAg==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "2.8.15", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "3.2.13", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-3.2.13.tgz", + "integrity": "sha512-HgS574fdD19Bo2vPguyznL4eDw7Pcm1cVNpvbvBLWiW3x4e1FCQ3VMXChWnAxCae8Hb0XqlA2sz332ZobBavTA==", + "dependencies": { + "@microsoft/1ds-core-js": "3.2.13", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "2.8.15", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.15.tgz", + "integrity": "sha512-yYAs9MyjGr2YijQdUSN9mVgT1ijI1FPMgcffpaPmYbHAVbQmF7bXudrBWHxmLzJlwl5rfep+Zgjli2e67lwUqQ==", + "dependencies": { + "@microsoft/applicationinsights-shims": "2.0.2", + "@microsoft/dynamicproto-js": "^1.1.9" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.2.tgz", + "integrity": "sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg==" + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.9.tgz", + "integrity": "sha512-n1VPsljTSkthsAFYdiWfC+DKzK2WwcRp83Y1YAqdX552BstvsDjft9YXppjUzp11BPsapDoO1LDgrDB0XVsfNQ==" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@octokit/auth-token": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz", + "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", + "dev": true, + "dependencies": { + "@octokit/types": "^6.0.3" + } + }, + "node_modules/@octokit/core": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz", + "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==", + "dev": true, + "dependencies": { + "@octokit/auth-token": "^2.4.4", + "@octokit/graphql": "^4.5.8", + "@octokit/request": "^5.6.3", + "@octokit/request-error": "^2.0.5", + "@octokit/types": "^6.0.3", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + } + }, + "node_modules/@octokit/endpoint": { + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", + "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", + "dev": true, + "dependencies": { + "@octokit/types": "^6.0.3", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + } + }, + "node_modules/@octokit/graphql": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz", + "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", + "dev": true, + "dependencies": { + "@octokit/request": "^5.6.0", + "@octokit/types": "^6.0.3", + "universal-user-agent": "^6.0.0" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz", + "integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==", + "dev": true + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.17.0.tgz", + "integrity": "sha512-tzMbrbnam2Mt4AhuyCHvpRkS0oZ5MvwwcQPYGtMv4tUa5kkzG58SVB0fcsLulOZQeRnOgdkZWkRUiyBlh0Bkyw==", + "dev": true, + "dependencies": { + "@octokit/types": "^6.34.0" + }, + "peerDependencies": { + "@octokit/core": ">=2" + } + }, + "node_modules/@octokit/plugin-request-log": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", + "dev": true, + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz", + "integrity": "sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA==", + "dev": true, + "dependencies": { + "@octokit/types": "^6.34.0", + "deprecation": "^2.3.1" + }, + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/@octokit/request": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz", + "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==", + "dev": true, + "dependencies": { + "@octokit/endpoint": "^6.0.1", + "@octokit/request-error": "^2.1.0", + "@octokit/types": "^6.16.1", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" + } + }, + "node_modules/@octokit/request-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", + "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", + "dev": true, + "dependencies": { + "@octokit/types": "^6.0.3", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "node_modules/@octokit/rest": { + "version": "18.12.0", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz", + "integrity": "sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q==", + "dev": true, + "dependencies": { + "@octokit/core": "^3.5.1", + "@octokit/plugin-paginate-rest": "^2.16.8", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^5.12.0" + } + }, + "node_modules/@octokit/types": { + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", + "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^11.2.0" + } + }, + "node_modules/@opentelemetry/api": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.3.tgz", + "integrity": "sha512-puWxACExDe9nxbBB3lOymQFrLYml2dVOrd7USiVRnSbgXE+KwBu+HxFvxrzfqsiSda9IWsXJG1ef7C1O2/GmKQ==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@parcel/watcher": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.1.0.tgz", + "integrity": "sha512-8s8yYjd19pDSsBpbkOHnT6Z2+UJSuLQx61pCFM0s5wSRvKCEMDjd/cHY3/GI1szHIWbpXpsJdg3V6ISGGx9xDw==", + "hasInstallScript": true, + "dependencies": { + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^3.2.1", + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "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/@playwright/browser-chromium": { + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/@playwright/browser-chromium/-/browser-chromium-1.47.0.tgz", + "integrity": "sha512-uMsRSflfEX1zDYdghRhUaLMnyoKqcVquOjo4cbIlqCpgNulDbRF7k9lUAWgobgIbefFz96a4v9/Fae+ngOuBHQ==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "playwright-core": "1.47.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@playwright/test": { + "version": "1.46.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.46.1.tgz", + "integrity": "sha512-Fq6SwLujA/DOIvNC2EL/SojJnkKf/rAwJ//APpJJHRyMi1PdKrY3Az+4XNQ51N4RTbItbIByQ0jgd1tayq1aeA==", + "dev": true, + "dependencies": { + "playwright": "1.46.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@sinonjs/commons": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz", + "integrity": "sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.7.0" + } + }, + "node_modules/@sinonjs/samsam": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-6.0.2.tgz", + "integrity": "sha512-jxPRPp9n93ci7b8hMfJOFDPRLFYadN6FSpeROFTR4UNF4i5b+EK6m4QXPO46BDhFgRy1JuS87zAnFOzCUwMJcQ==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } + }, + "node_modules/@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "dev": true + }, + "node_modules/@swc/core": { + "version": "1.3.62", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.62.tgz", + "integrity": "sha512-J58hWY+/G8vOr4J6ZH9hLg0lMSijZtqIIf4HofZezGog/pVX6sJyBJ40dZ1ploFkDIlWTWvJyqtpesBKS73gkQ==", + "dev": true, + "hasInstallScript": true, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/swc" + }, + "optionalDependencies": { + "@swc/core-darwin-arm64": "1.3.62", + "@swc/core-darwin-x64": "1.3.62", + "@swc/core-linux-arm-gnueabihf": "1.3.62", + "@swc/core-linux-arm64-gnu": "1.3.62", + "@swc/core-linux-arm64-musl": "1.3.62", + "@swc/core-linux-x64-gnu": "1.3.62", + "@swc/core-linux-x64-musl": "1.3.62", + "@swc/core-win32-arm64-msvc": "1.3.62", + "@swc/core-win32-ia32-msvc": "1.3.62", + "@swc/core-win32-x64-msvc": "1.3.62" + }, + "peerDependencies": { + "@swc/helpers": "^0.5.0" + }, + "peerDependenciesMeta": { + "@swc/helpers": { + "optional": true + } + } + }, + "node_modules/@swc/core-darwin-arm64": { + "version": "1.3.62", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.62.tgz", + "integrity": "sha512-MmGilibITz68LEje6vJlKzc2gUUSgzvB3wGLSjEORikTNeM7P8jXVxE4A8fgZqDeudJUm9HVWrxCV+pHDSwXhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-darwin-x64": { + "version": "1.3.62", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.62.tgz", + "integrity": "sha512-Xl93MMB3sCWVlYWuQIB+v6EQgzoiuQYK5tNt9lsHoIEVu2zLdkQjae+5FUHZb1VYqCXIiWcULFfVz0R4Sjb7JQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm-gnueabihf": { + "version": "1.3.62", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.62.tgz", + "integrity": "sha512-nJsp6O7kCtAjTTMcIjVB0g5y1JNiYAa5q630eiwrnaHUusEFoANDdORI3Z9vXeikMkng+6yIv9/V8Rb093xLjQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm64-gnu": { + "version": "1.3.62", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.62.tgz", + "integrity": "sha512-XGsV93vpUAopDt5y6vPwbK1Nc/MlL55L77bAZUPIiosWD1cWWPHNtNSpriE6+I+JiMHe0pqtfS/SSTk6ZkFQVw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm64-musl": { + "version": "1.3.62", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.62.tgz", + "integrity": "sha512-ESUmJjSlTTkoBy9dMG49opcNn8BmviqStMhwyeD1G8XRnmRVCZZgoBOKdvCXmJhw8bQXDhZumeaTUB+OFUKVXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-x64-gnu": { + "version": "1.3.62", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.62.tgz", + "integrity": "sha512-wnHJkt3ZBrax3SFnUHDcncG6mrSg9ZZjMhQV9Mc3JL1x1s1Gy9rGZCoBNnV/BUZWTemxIBcQbANRSDut/WO+9A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-x64-musl": { + "version": "1.3.62", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.62.tgz", + "integrity": "sha512-9oRbuTC/VshB66Rgwi3pTq3sPxSTIb8k9L1vJjES+dDMKa29DAjPtWCXG/pyZ00ufpFZgkGEuAHH5uqUcr1JQg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-arm64-msvc": { + "version": "1.3.62", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.62.tgz", + "integrity": "sha512-zv14vlF2VRrxS061XkfzGjCYnOrEo5glKJjLK5PwUKysIoVrx/L8nAbFxjkX5cObdlyoqo+ekelyBPAO+4bS0w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-ia32-msvc": { + "version": "1.3.62", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.62.tgz", + "integrity": "sha512-8MC/PZQSsOP2iA/81tAfNRqMWyEqTS/8zKUI67vPuLvpx6NAjRn3E9qBv7iFqH79iqZNzqSMo3awnLrKZyFbcw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-x64-msvc": { + "version": "1.3.62", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.62.tgz", + "integrity": "sha512-GJSmUJ95HKHZXAxiuPUmrcm/S3ivQvEzXhOZaIqYBIwUsm02vFZkClsV7eIKzWjso1t0+I/8MjrnUNaSWqh1rQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@szmarczak/http-timer": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "dev": true, + "dependencies": { + "defer-to-connect": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@tootallnate/once": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-3.0.0.tgz", + "integrity": "sha512-OAdBVB7rlwvLD+DiecSAyVKzKVmSfXbouCyM5I6wHGi4MGXIyFqErg1IvyJ7PI1e+GYZuZh7cCHV/c4LA8SKMw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/@trysound/sax": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", + "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/@ts-morph/common": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.20.0.tgz", + "integrity": "sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q==", + "dev": true, + "dependencies": { + "fast-glob": "^3.2.12", + "minimatch": "^7.4.3", + "mkdirp": "^2.1.6", + "path-browserify": "^1.0.1" + } + }, + "node_modules/@ts-morph/common/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@ts-morph/common/node_modules/minimatch": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", + "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@ts-morph/common/node_modules/mkdirp": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", + "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", + "dev": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "dev": true + }, + "node_modules/@types/cacheable-request": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", + "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", + "dev": true, + "dependencies": { + "@types/http-cache-semantics": "*", + "@types/keyv": "^3.1.4", + "@types/node": "*", + "@types/responselike": "^1.0.0" + } + }, + "node_modules/@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "node_modules/@types/cookie": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.3.3.tgz", + "integrity": "sha512-LKVP3cgXBT9RYj+t+9FDKwS5tdI+rPBXaNSkma7hvqy35lc7mAokC2zsqWJH0LaqIt3B962nuYI77hsJoT1gow==", + "dev": true + }, + "node_modules/@types/debug": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz", + "integrity": "sha512-8Hz50m2eoS56ldRlepxSBa6PWEVCtzUo/92HgLc2qTMnotJNIm7xP+UZhyWoYsyOdd5dxZ+NZLb24rsKyFs2ow==", + "dev": true, + "dependencies": { + "@types/ms": "*" + } + }, + "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==", + "dev": true + }, + "node_modules/@types/expect": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", + "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", + "dev": true + }, + "node_modules/@types/glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", + "dev": true, + "optional": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/gulp-svgmin": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/gulp-svgmin/-/gulp-svgmin-1.2.1.tgz", + "integrity": "sha512-qT/Y+C2uWJZoGw4oAjuJGZk+ImmTrx+QZbMGSzf8a1absW3wztrmMPvCF64pdogATDVUSPQDLzPWAFeIxylJTA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/svgo": "^1", + "@types/vinyl": "*" + } + }, + "node_modules/@types/http-cache-semantics": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", + "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", + "dev": true + }, + "node_modules/@types/http-proxy-agent": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/http-proxy-agent/-/http-proxy-agent-2.0.1.tgz", + "integrity": "sha512-dgsgbsgI3t+ZkdzF9H19uBaLsurIZJJjJsVpj4mCLp8B6YghQ7jVwyqhaL0PcVtuC3nOi0ZBhAi2Dd9jCUwdFA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/kerberos": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@types/kerberos/-/kerberos-1.1.2.tgz", + "integrity": "sha512-cLixfcXjdj7qohLasmC1G4fh+en4e4g7mFZiG38D+K9rS9BRKFlq1JH5dGkQzICckbu4wM+RcwSa4VRHlBg7Rg==", + "dev": true + }, + "node_modules/@types/keyv": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", + "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true, + "optional": true + }, + "node_modules/@types/minimist": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", + "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==", + "dev": true + }, + "node_modules/@types/mocha": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", + "dev": true + }, + "node_modules/@types/ms": { + "version": "0.7.32", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.32.tgz", + "integrity": "sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.14.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.13.tgz", + "integrity": "sha512-+bHoGiZb8UiQ0+WEtmph2IWQCjIqg8MDZMAV+ppRRhUZnquF5mQkP/9vpSwJClEiSM/C7fZZExPzfU0vJTyp8w==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.5.12", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", + "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "form-data": "^3.0.0" + } + }, + "node_modules/@types/node-fetch/node_modules/form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/responselike": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", + "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, + "node_modules/@types/sinon": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.2.tgz", + "integrity": "sha512-BHn8Bpkapj8Wdfxvh2jWIUoaYB/9/XhsL0oOvBfRagJtKlSl9NWPcFOz2lRukI9szwGxFtYZCTejJSqsGDbdmw==", + "dev": true, + "dependencies": { + "@sinonjs/fake-timers": "^7.1.0" + } + }, + "node_modules/@types/sinon-test": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@types/sinon-test/-/sinon-test-2.4.2.tgz", + "integrity": "sha512-3BX9mk5+o//Xzs5N4bFYxPT+QlPLrqbyNfDWkIGtk9pVIp2Nl8ctsIGXsY3F01DsCd1Zlin3FqAk6V5XqkCyJA==", + "dev": true, + "dependencies": { + "@types/sinon": "*" + } + }, + "node_modules/@types/svgo": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@types/svgo/-/svgo-1.3.6.tgz", + "integrity": "sha512-AZU7vQcy/4WFEuwnwsNsJnFwupIpbllH1++LXScN6uxT1Z4zPzdrWG97w4/I7eFKFTvfy/bHFStWjdBAg2Vjug==", + "dev": true + }, + "node_modules/@types/trusted-types": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-1.0.6.tgz", + "integrity": "sha512-230RC8sFeHoT6sSUlRO6a8cAnclO06eeiq1QDfiv2FGCLWFvvERWgwIQD4FWqD9A69BN7Lzee4OXwoMVnnsWDw==", + "dev": true + }, + "node_modules/@types/tunnel": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz", + "integrity": "sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/vinyl": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.12.tgz", + "integrity": "sha512-Sr2fYMBUVGYq8kj3UthXFAu5UN6ZW+rYr4NACjZQJvHvj+c8lYv0CahmZ2P/r7iUkN44gGUBwqxZkrKXYPb7cw==", + "dev": true, + "dependencies": { + "@types/expect": "^1.20.4", + "@types/node": "*" + } + }, + "node_modules/@types/vscode-notebook-renderer": { + "version": "1.72.0", + "resolved": "https://registry.npmjs.org/@types/vscode-notebook-renderer/-/vscode-notebook-renderer-1.72.0.tgz", + "integrity": "sha512-5iTjb39DpLn03ULUwrDR3L2Dy59RV4blSUHy0oLdQuIY11PhgWO4mXIcoFS0VxY1GZQ4IcjSf3ooT2Jrrcahnw==", + "dev": true + }, + "node_modules/@types/webpack": { + "version": "5.28.5", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.5.tgz", + "integrity": "sha512-wR87cgvxj3p6D0Crt1r5avwqffqPXUkNlnQ1mjU93G7gCuFjufZR4I6j8cz5g1F1tTYpfOOFvly+cmIQwL9wvw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "tapable": "^2.2.0", + "webpack": "^5" + } + }, + "node_modules/@types/wicg-file-system-access": { + "version": "2020.9.6", + "resolved": "https://registry.npmjs.org/@types/wicg-file-system-access/-/wicg-file-system-access-2020.9.6.tgz", + "integrity": "sha512-6hogE75Hl2Ov/jgp8ZhDaGmIF/q3J07GtXf8nCJCwKTHq7971po5+DId7grft09zG7plBwpF6ZU0yx9Du4/e1A==", + "dev": true + }, + "node_modules/@types/windows-foreground-love": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@types/windows-foreground-love/-/windows-foreground-love-0.3.0.tgz", + "integrity": "sha512-tFUVA/fiofNqOh6lZlymvQiQYPY+cZXZPR9mn9wN6/KS8uwx0zgH4Ij/jmFyRYr+x+DGZWEIeknS2BMi7FZJAQ==", + "dev": true + }, + "node_modules/@types/winreg": { + "version": "1.2.30", + "resolved": "https://registry.npmjs.org/@types/winreg/-/winreg-1.2.30.tgz", + "integrity": "sha1-kdZxDlNtNFucmwF8V0z2qNpkxRg= sha512-c4m/hnOI1j34i8hXlkZzelE6SXfOqaTWhBp0UgBuwmpiafh22OpsE261Rlg//agZtQHIY5cMgbkX8bnthUFrmA==", + "dev": true + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yazl": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@types/yazl/-/yazl-2.4.2.tgz", + "integrity": "sha512-T+9JH8O2guEjXNxqmybzQ92mJUh2oCwDDMSSimZSe1P+pceZiFROZLYmcbqkzV5EUwz6VwcKXCO2S2yUpra6XQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", + "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/experimental-utils": { + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.57.0.tgz", + "integrity": "sha512-0RnrwGQ7MmgtOSnzB/rSGYr2iXENi6L+CtPzX3g5ovo0HlruLukSEKcc4s+q0IEc+DLTDc7Edan0Y4WSQ/bFhw==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "5.57.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/scope-manager": { + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.57.0.tgz", + "integrity": "sha512-NANBNOQvllPlizl9LatX8+MHi7bx7WGIWYjPHDmQe5Si/0YEYfxSljJpoTyTWFTgRy3X8gLYSE4xQ2U+aCozSw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.57.0", + "@typescript-eslint/visitor-keys": "5.57.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/types": { + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.57.0.tgz", + "integrity": "sha512-mxsod+aZRSyLT+jiqHw1KK6xrANm19/+VFALVFP5qa/aiJnlP38qpyaTd0fEKhWvQk6YeNZ5LGwI1pDpBRBhtQ==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.0.tgz", + "integrity": "sha512-LTzQ23TV82KpO8HPnWuxM2V7ieXW8O142I7hQTxWIHDcCEIjtkat6H96PFkYBQqGFLW/G/eVVOB9Z8rcvdY/Vw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.57.0", + "@typescript-eslint/visitor-keys": "5.57.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/utils": { + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.57.0.tgz", + "integrity": "sha512-ps/4WohXV7C+LTSgAL5CApxvxbMkl9B9AUZRtnEFonpIxZDIT7wC1xfvuJONMidrkB9scs4zhtRyIwHh4+18kw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.57.0", + "@typescript-eslint/types": "5.57.0", + "@typescript-eslint/typescript-estree": "5.57.0", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.0.tgz", + "integrity": "sha512-ery2g3k0hv5BLiKpPuwYt9KBkAp2ugT6VvyShXdLOkax895EC55sP0Tx5L0fZaQueiK3fBLvHVvEl3jFS5ia+g==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.57.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@typescript-eslint/experimental-utils/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", + "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", + "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@vscode/deviceid": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@vscode/deviceid/-/deviceid-0.1.1.tgz", + "integrity": "sha512-ErpoMeKKNYAkR1IT3zxB5RtiTqEECdh8fxggupWvzuxpTAX77hwOI2NdJ7um+vupnXRBZVx4ugo0+dVHJWUkag==", + "hasInstallScript": true, + "dependencies": { + "fs-extra": "^11.2.0", + "uuid": "^9.0.1" + } + }, + "node_modules/@vscode/gulp-electron": { + "version": "1.36.0", + "resolved": "https://registry.npmjs.org/@vscode/gulp-electron/-/gulp-electron-1.36.0.tgz", + "integrity": "sha512-zGNnxN2mccAa0fgyjUn0+HUX4sv4syUfoLQru3/QAQYki1oeqnkPpCXZxhismFmWpXwTwsf5sXeh1AOs8uyU0g==", + "dev": true, + "dependencies": { + "@electron/get": "^2.0.2", + "@octokit/rest": "^18.0.14", + "event-stream": "3.3.4", + "gulp-filter": "^5.1.0", + "gulp-rename": "1.2.2", + "gulp-symdest": "^1.2.0", + "gulp-vinyl-zip": "^2.1.2", + "mkdirp": "^0.5.1", + "plist": "^3.0.1", + "progress": "^1.1.8", + "rcedit": "^0.3.0", + "rimraf": "^2.4.2", + "semver": "^4.3.4", + "sumchecker": "^3.0.1", + "temp": "^0.8.3", + "vinyl": "^3.0.0", + "vinyl-fs": "^3.0.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@vscode/gulp-electron/node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/@vscode/gulp-electron/node_modules/rcedit": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/rcedit/-/rcedit-0.3.0.tgz", + "integrity": "sha1-y17uGF5Ub57aWXwkjJkGGG+pa84= sha512-6cFo8dgNFf92BPdBNEKtwCl321wSVW6HYn3+QRQMGf0sclBMerCyMAreQDdIchfR8ECG0pAYD33NIODaJEnv4w==", + "dev": true + }, + "node_modules/@vscode/gulp-electron/node_modules/semver": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "integrity": "sha512-IrpJ+yoG4EOH8DFWuVg+8H1kW1Oaof0Wxe7cPcXW3x9BjkN/eVo54F15LyqemnDIUYskQWr9qvl/RihmSy6+xQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/@vscode/iconv-lite-umd": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz", + "integrity": "sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg==" + }, + "node_modules/@vscode/l10n-dev": { + "version": "0.0.35", + "resolved": "https://registry.npmjs.org/@vscode/l10n-dev/-/l10n-dev-0.0.35.tgz", + "integrity": "sha512-s6uzBXsVDSL69Z85HSqpc5dfKswQkeucY8L00t1TWzGalw7wkLQUKMRwuzqTq+AMwQKrRd7Po14cMoTcd11iDw==", + "dev": true, + "dependencies": { + "@azure-rest/ai-translation-text": "^1.0.0-beta.1", + "debug": "^4.3.4", + "deepmerge-json": "^1.5.0", + "glob": "^10.0.0", + "markdown-it": "^14.0.0", + "node-html-markdown": "^1.3.0", + "pseudo-localization": "^2.4.0", + "web-tree-sitter": "^0.20.8", + "xml2js": "^0.5.0", + "yargs": "^17.7.1" + }, + "bin": { + "vscode-l10n-dev": "dist/cli.js" + } + }, + "node_modules/@vscode/l10n-dev/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@vscode/l10n-dev/node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vscode/l10n-dev/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vscode/policy-watcher": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@vscode/policy-watcher/-/policy-watcher-1.1.6.tgz", + "integrity": "sha512-EoJizB6aq/mgsL42mcNLGZ5vOwdZs/EHcLQkdY6Rg4uzcRkCapQdNy20wnCsrBpv3QntgBibsS6m+JXm8efY/Q==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^6.0.0" + } + }, + "node_modules/@vscode/policy-watcher/node_modules/node-addon-api": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.0.0.tgz", + "integrity": "sha512-GyHvgPvUXBvAkXa0YvYnhilSB1A+FRYMpIVggKzPZqdaZfevZOuzfWzyvgzOwRLHBeo/MMswmJFsrNF4Nw1pmA==" + }, + "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==", + "dependencies": { + "@tootallnate/once": "^3.0.0", + "agent-base": "^7.0.1", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "socks-proxy-agent": "^8.0.1" + }, + "optionalDependencies": { + "@vscode/windows-ca-certs": "^0.3.1" + } + }, + "node_modules/@vscode/ripgrep": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/@vscode/ripgrep/-/ripgrep-1.15.9.tgz", + "integrity": "sha512-4q2PXRvUvr3bF+LsfrifmUZgSPmCNcUZo6SbEAZgArIChchkezaxLoIeQMJe/z3CCKStvaVKpBXLxN3Z8lQjFQ==", + "hasInstallScript": true, + "dependencies": { + "https-proxy-agent": "^7.0.2", + "proxy-from-env": "^1.1.0", + "yauzl": "^2.9.2" + } + }, + "node_modules/@vscode/ripgrep/node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/@vscode/spdlog": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@vscode/spdlog/-/spdlog-0.15.0.tgz", + "integrity": "sha512-5UFcQXM/G6bTRF49zJJJH3A3+47nxaXuKzT26vhTXVIiMFoV1oI9559mWOzapLEmvrntAdYtjE7Jh74lSAuMcA==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "mkdirp": "^1.0.4", + "node-addon-api": "7.1.0" + } + }, + "node_modules/@vscode/spdlog/node_modules/node-addon-api": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", + "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", + "engines": { + "node": "^16 || ^18 || >= 20" + } + }, + "node_modules/@vscode/sqlite3": { + "version": "5.1.6-vscode", + "resolved": "https://registry.npmjs.org/@vscode/sqlite3/-/sqlite3-5.1.6-vscode.tgz", + "integrity": "sha512-SzNUiijrRyJr1ly6eHIs5UcCqH/V8aaoz9mHNm5SdnJCJOX5T9RcHqO1AJ9VreHcPcRPKuG2paUpMkTeyynmYQ==", + "hasInstallScript": true, + "dependencies": { + "node-addon-api": "^4.2.0", + "tar": "^6.1.11" + } + }, + "node_modules/@vscode/sqlite3/node_modules/node-addon-api": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.2.0.tgz", + "integrity": "sha512-eazsqzwG2lskuzBqCGPi7Ac2UgOoMz8JVOXVhTvvPDYhthvNpefx8jWD8Np7Gv+2Sz0FlPWZk0nJV0z598Wn8Q==" + }, + "node_modules/@vscode/sudo-prompt": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/@vscode/sudo-prompt/-/sudo-prompt-9.3.1.tgz", + "integrity": "sha512-9ORTwwS74VaTn38tNbQhsA5U44zkJfcb0BdTSyyG6frP4e8KMtHuTXYmwefe5dpL8XB1aGSIVTaLjD3BbWb5iA==" + }, + "node_modules/@vscode/telemetry-extractor": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@vscode/telemetry-extractor/-/telemetry-extractor-1.10.2.tgz", + "integrity": "sha512-hn+KDSwIRj7LzDSFd9HALkc80UY1g16nQgWztHml+nxAZU3Hw/EoWEEDxOncvDYq9YcV+tX/cVHrVjbNL2Dg0g==", + "dev": true, + "dependencies": { + "@vscode/ripgrep": "^1.15.9", + "command-line-args": "^5.2.1", + "ts-morph": "^19.0.0" + }, + "bin": { + "vscode-telemetry-extractor": "out/extractor.js" + } + }, + "node_modules/@vscode/test-cli": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@vscode/test-cli/-/test-cli-0.0.6.tgz", + "integrity": "sha512-4i61OUv5PQr3GxhHOuUgHdgBDfIO/kXTPCsEyFiMaY4SOqQTgkTmyZLagHehjOgCfsXdcrJa3zgQ7zoc+Dh6hQ==", + "dev": true, + "dependencies": { + "@types/mocha": "^10.0.2", + "c8": "^9.1.0", + "chokidar": "^3.5.3", + "enhanced-resolve": "^5.15.0", + "glob": "^10.3.10", + "minimatch": "^9.0.3", + "mocha": "^10.2.0", + "supports-color": "^9.4.0", + "yargs": "^17.7.2" + }, + "bin": { + "vscode-test": "out/bin.mjs" + } + }, + "node_modules/@vscode/test-cli/node_modules/@types/mocha": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.2.tgz", + "integrity": "sha512-NaHL0+0lLNhX6d9rs+NSt97WH/gIlRHmszXbQ/8/MV/eVcFNdeJ/GYhrFuUc8K7WuPhRhTSdMkCp8VMzhUq85w==", + "dev": true + }, + "node_modules/@vscode/test-cli/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@vscode/test-cli/node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vscode/test-cli/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vscode/test-electron": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.4.0.tgz", + "integrity": "sha512-yojuDFEjohx6Jb+x949JRNtSn6Wk2FAh4MldLE3ck9cfvCqzwxF32QsNy1T9Oe4oT+ZfFcg0uPUCajJzOmPlTA==", + "dev": true, + "dependencies": { + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.4", + "jszip": "^3.10.1", + "ora": "^7.0.1", + "semver": "^7.6.2" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@vscode/test-web": { + "version": "0.0.60", + "resolved": "https://registry.npmjs.org/@vscode/test-web/-/test-web-0.0.60.tgz", + "integrity": "sha512-U3Eif3GZEfmtFJFTRl5IZUxlqDocslvpHCoW4uz407F9YINc2ujJPB0QG+9ZtjjowZDzFJlg60J44RqmnlA0cg==", + "dev": true, + "dependencies": { + "@koa/cors": "^5.0.0", + "@koa/router": "^13.0.0", + "@playwright/browser-chromium": "^1.47.0", + "glob": "^11.0.0", + "gunzip-maybe": "^1.4.2", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "koa": "^2.15.3", + "koa-morgan": "^1.0.1", + "koa-mount": "^4.0.0", + "koa-static": "^5.0.0", + "minimist": "^1.2.8", + "playwright": "^1.47.0", + "tar-fs": "^3.0.6", + "vscode-uri": "^3.0.8" + }, + "bin": { + "vscode-test-web": "out/server/index.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@vscode/test-web/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@vscode/test-web/node_modules/glob": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", + "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vscode/test-web/node_modules/jackspeak": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", + "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/@vscode/test-web/node_modules/lru-cache": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.1.tgz", + "integrity": "sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==", + "dev": true, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@vscode/test-web/node_modules/minimatch": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vscode/test-web/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/@vscode/test-web/node_modules/path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "dev": true, + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vscode/test-web/node_modules/playwright": { + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.0.tgz", + "integrity": "sha512-jOWiRq2pdNAX/mwLiwFYnPHpEZ4rM+fRSQpRHwEwZlP2PUANvL3+aJOF/bvISMhFD30rqMxUB4RJx9aQbfh4Ww==", + "dev": true, + "dependencies": { + "playwright-core": "1.47.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/@vscode/tree-sitter-wasm": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@vscode/tree-sitter-wasm/-/tree-sitter-wasm-0.0.3.tgz", + "integrity": "sha512-K5YmUdohFCavPqEzG2cUPcZ6555KE1qwMDCjkvSUSz+s+8Wro2xfg+syLq90y6Tq0ZSUVvpuX6yq6ukToeGaLg==" + }, + "node_modules/@vscode/v8-heap-parser": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@vscode/v8-heap-parser/-/v8-heap-parser-0.1.0.tgz", + "integrity": "sha512-3EvQak7EIOLyIGz+IP9qSwRmP08ZRWgTeoRgAXPVkkDXZ8riqJ7LDtkgx++uHBiJ3MUaSdlUYPZcLFFw7E6zGg==", + "dev": true + }, + "node_modules/@vscode/vscode-languagedetection": { + "version": "1.0.21", + "resolved": "https://registry.npmjs.org/@vscode/vscode-languagedetection/-/vscode-languagedetection-1.0.21.tgz", + "integrity": "sha512-zSUH9HYCw5qsCtd7b31yqkpaCU6jhtkKLkvOOA8yTrIRfBSOFb8PPhgmMicD7B/m+t4PwOJXzU1XDtrM9Fd3/g==", + "bin": { + "vscode-languagedetection": "cli/index.js" + } + }, + "node_modules/@vscode/vscode-perf": { + "version": "0.0.14", + "resolved": "https://registry.npmjs.org/@vscode/vscode-perf/-/vscode-perf-0.0.14.tgz", + "integrity": "sha512-mDJOIAVU3Ufj1FUX2/LZtLHobjl7zRA+oDKH3GSJYQ+RlfEvpFRoU1CRSwbE3u9fsKMX//uBDI4Q4B8+3s86uA==", + "dev": true, + "dependencies": { + "chalk": "^4.x", + "commander": "^9.4.0", + "cookie": "^0.5.0", + "js-base64": "^3.7.4", + "node-fetch": "2.6.8", + "playwright": "^1.29.2" + }, + "bin": { + "vscode-perf": "bin/vscode-perf" + }, + "engines": { + "node": ">= 16" + } + }, + "node_modules/@vscode/vscode-perf/node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@vscode/windows-ca-certs": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@vscode/windows-ca-certs/-/windows-ca-certs-0.3.1.tgz", + "integrity": "sha512-1B6hZAsqg125wuMsXiKIFkBgKx/J7YR4RT/ccYGkWAToPU9MVa40PRe+evLFUmLPH6NmPohEPlCzZLbqgvHCcQ==", + "hasInstallScript": true, + "optional": true, + "os": [ + "win32" + ], + "dependencies": { + "node-addon-api": "^3.0.2" + } + }, + "node_modules/@vscode/windows-mutex": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vscode/windows-mutex/-/windows-mutex-0.5.0.tgz", + "integrity": "sha512-iD29L9AUscpn07aAvhP2QuhrXzuKc1iQpPF6u7ybtvRbR+o+RotfbuKqqF1RDlDDrJZkL+3AZTy4D01U4nEe5A==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "7.1.0" + } + }, + "node_modules/@vscode/windows-mutex/node_modules/node-addon-api": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", + "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", + "engines": { + "node": "^16 || ^18 || >= 20" + } + }, + "node_modules/@vscode/windows-process-tree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@vscode/windows-process-tree/-/windows-process-tree-0.6.0.tgz", + "integrity": "sha512-7/DjBKKUtlmKNiAet2GRbdvfjgMKmfBeWVClIgONv8aqxGnaKca5N85eIDxh6rLMy2hKvFqIIsqgxs1Q26TWwg==", + "hasInstallScript": true, + "dependencies": { + "node-addon-api": "7.1.0" + } + }, + "node_modules/@vscode/windows-process-tree/node_modules/node-addon-api": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", + "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", + "engines": { + "node": "^16 || ^18 || >= 20" + } + }, + "node_modules/@vscode/windows-registry": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@vscode/windows-registry/-/windows-registry-1.1.0.tgz", + "integrity": "sha512-5AZzuWJpGscyiMOed0IuyEwt6iKmV5Us7zuwCDCFYMIq7tsvooO9BUiciywsvuthGz6UG4LSpeDeCxvgMVhnIw==", + "hasInstallScript": true + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", + "dev": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "dev": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.12.1" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "dev": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "dev": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "dev": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webgpu/types": { + "version": "0.1.44", + "resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.44.tgz", + "integrity": "sha512-JDpYJN5E/asw84LTYhKyvPpxGnD+bAKPtpW9Ilurf7cZpxaTbxkQcGwOd7jgB9BPBrTYQ+32ufo4HiuomTjHNQ==", + "dev": true + }, + "node_modules/@webpack-cli/configtest": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz", + "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz", + "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/serve": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz", + "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, + "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==", + "dependencies": { + "js-base64": "^3.7.5" + }, + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==" + }, + "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==" + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "node_modules/accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", + "dev": true, + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-formats/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", + "dev": true, + "engines": { + "node": ">=0.4.2" + } + }, + "node_modules/ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-cyan": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", + "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM= sha512-eCjan3AVo/SxZ0/MyIYRtkpxIu/H3xZN7URr1vXVrISxeyz8fUFz0FJziamK4sS8I+t35y4rHg1b2PklyBe/7A==", + "dev": true, + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE= sha512-HrgGIZUl8h2EHuZaU9hTR/cU5nhKxpVE1V6kdGsQ8e4zirElJ5fvtfc8N7Q1oq1aatO275i8pUFUCpNWCAnVWw==", + "dev": true, + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-red": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", + "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw= sha512-ewaIr5y+9CUTGFwZfpECUbFlGcC0GCw1oqR9RI6h1gQCd9Aj2GxSckCnPsVJnmfMZbwFYE+leZGASgkWl06Jow==", + "dev": true, + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "dependencies": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768= sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8= sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/append-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", + "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE= sha512-WLbYiXzD3y/ATLZFufV/rZvWdZOs+Z/+5v1rBZ463Jn398pa6kcde27cvozYnBoxXblGZTFfoPpsaEw0orU5BA==", + "dev": true, + "dependencies": { + "buffer-equal": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", + "dev": true + }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-filter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", + "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4= sha512-A2BETWCqhsecSvCkWAeVBFLH6sXEUGASuzkpjL3GR1SlL/PWL6M3J8EAAld2Uubmh39tvkJTqC9LeLHCUKmFXA==", + "dev": true, + "dependencies": { + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", + "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ= sha512-tVqVTHt+Q5Xb09qRkbu+DidW1yYzz5izWS2Xm2yFm7qJnmUfz4HPzNxbHkdRJbz2lrqI7S+z17xNYdFcBBO8Hw==", + "dev": true, + "dependencies": { + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE= sha512-LeZY+DZDRnvP7eMuQ6LHfCzUGxAAIViUBliK24P3hWXL6y4SortgR6Nim6xrkfSLlmH0+k+9NYNwVC2s53ZrYQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8= sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-initial": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", + "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U= sha512-BC4Yl89vneCYfpLrs5JU2aAu9/a+xWbeKhvISg9PT7eWFB9UlRvI+rKEtk6mgxWr3dSkk9gQ8hCrdqt06NXPdw==", + "dev": true, + "dependencies": { + "array-slice": "^1.0.0", + "is-number": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-initial/node_modules/is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-last": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", + "dev": true, + "dependencies": { + "is-number": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-last/node_modules/is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-sort": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", + "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", + "dev": true, + "dependencies": { + "default-compare": "^1.0.0", + "get-value": "^2.0.6", + "kind-of": "^5.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/asar": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/asar/-/asar-3.0.3.tgz", + "integrity": "sha512-k7zd+KoR+n8pl71PvgElcoKHrVNiSXtw7odKbyNpmgKe7EGRF9Pnu3uLOukD37EvavKwVFxOUpqXTIZC5B5Pmw==", + "deprecated": "Please use @electron/asar moving forward. There is no API change, just a package name change", + "dev": true, + "dependencies": { + "chromium-pickle-js": "^0.2.0", + "commander": "^5.0.0", + "glob": "^7.1.6", + "minimatch": "^3.0.4" + }, + "bin": { + "asar": "bin/asar.js" + }, + "engines": { + "node": ">=10.12.0" + }, + "optionalDependencies": { + "@types/glob": "^7.1.1" + } + }, + "node_modules/asar/node_modules/commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/asar/node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/async-done": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^2.0.0", + "stream-exhaust": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "node_modules/async-settle": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", + "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs= sha512-VPXfB4Vk49z1LHHodrEQ6Xf7W4gg1w0dAPROHngx7qgDjqmIQ+fXmwgGXTW/ITLai0YLSvWepJOP9EVpMnEAcw==", + "dev": true, + "dependencies": { + "async-done": "^1.2.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k= sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true, + "bin": { + "atob": "bin/atob.js" + }, + "engines": { + "node": ">= 4.5.0" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/b4a": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", + "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==", + "dev": true + }, + "node_modules/bach": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", + "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA= sha512-bZOOfCb3gXBXbTFXq3OZtGR88LwGeJvzu6szttaIzymOTS4ZttBNOWSv7aLZja2EMycKtRYV0Oa8SNKH/zkxvg==", + "dev": true, + "dependencies": { + "arr-filter": "^1.1.1", + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "array-each": "^1.0.0", + "array-initial": "^1.0.0", + "array-last": "^1.1.1", + "async-done": "^1.2.2", + "async-settle": "^1.0.0", + "now-and-later": "^2.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/bare-events": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.4.2.tgz", + "integrity": "sha512-qMKFd2qG/36aA4GwvKq8MxnPgCQAmBWmSyLWsJcbn8v03wvIPQ/hG1Ms8bPzndZxMDoHpxez5VOS+gC9Yi24/Q==", + "dev": true, + "optional": true + }, + "node_modules/bare-fs": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.1.tgz", + "integrity": "sha512-W/Hfxc/6VehXlsgFtbB5B4xFcsCl+pAh30cYhoFyXErf6oGrwjh8SwiPAdHgpmWonKuYpZgGywN0SXt7dgsADA==", + "dev": true, + "optional": true, + "dependencies": { + "bare-events": "^2.0.0", + "bare-path": "^2.0.0", + "bare-stream": "^2.0.0" + } + }, + "node_modules/bare-os": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.0.tgz", + "integrity": "sha512-v8DTT08AS/G0F9xrhyLtepoo9EJBJ85FRSMbu1pQUlAf6A8T0tEEQGMVObWeqpjhSPXsE0VGlluFBJu2fdoTNg==", + "dev": true, + "optional": true + }, + "node_modules/bare-path": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-2.1.3.tgz", + "integrity": "sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==", + "dev": true, + "optional": true, + "dependencies": { + "bare-os": "^2.1.0" + } + }, + "node_modules/bare-stream": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.1.3.tgz", + "integrity": "sha512-tiDAH9H/kP+tvNO5sczyn9ZAA7utrSMobyDchsnyyXBuUe2FSQWbxhtuHB8jwpHYYevVo2UJpcmvvjrbHboUUQ==", + "dev": true, + "optional": true, + "dependencies": { + "streamx": "^2.18.0" + } + }, + "node_modules/base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "dependencies": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY= sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "dev": true, + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/before-after-hook": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", + "dev": true + }, + "node_modules/big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/binaryextensions": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-1.0.1.tgz", + "integrity": "sha1-HmN0iLNbWL2l9HdL+WpSEqjJB1U= sha512-xnG0l4K3ghM62rFzDi2jcNEuICl6uQ4NgvGpqQsY7HgW8gPDeAWGOxHI/k+qZfXfMANytzrArGNPXidaCwtbmA==", + "dev": true + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo= sha512-OorbnJVPII4DuUKbjARAe8u8EfqOmkEEaSFIyoQ7OjTHn6kafxWl0wLgoZ2rXaYd7MyLcDaU4TmhfxtwgcccMQ==", + "dev": true, + "dependencies": { + "inherits": "~2.0.0" + }, + "engines": { + "node": "0.4 || >=0.5.8" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24= sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, + "node_modules/boolean": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.0.2.tgz", + "integrity": "sha512-RwywHlpCRc3/Wh81MiCKun4ydaIFyW5Ea6JbL6sRCVx5q5irDw7pMXBUFYF/jArQ6YrG36q0kpovc9P/Kd3I4g==", + "dev": true, + "optional": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha512-19OEpq7vWgsH6WkvkBJQDFvJS1uPcbFOQ4v9CU839dO+ZZXUZO6XpE6hNCqvlIIj+4fZvRiJ6DsAQ382GwiyTQ==", + "dev": true, + "dependencies": { + "pako": "~0.2.0" + } + }, + "node_modules/browserslist": { + "version": "4.22.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", + "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001580", + "electron-to-chromium": "^1.4.648", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "engines": { + "node": "*" + } + }, + "node_modules/buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74= sha512-tcBWO2Dl4e7Asr9hTGcpVrCe+F7DubpmqWCTbj4FHLmjqO2hIaC383acQubWtRJhdceqs5uBHs6Es+Sk//RKiQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "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/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/c8": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-9.1.0.tgz", + "integrity": "sha512-mBWcT5iqNir1zIkzSPyI3NCR9EZCVI3WUD+AVO17MVWTSFNyUueXE82qTeampNtTr+ilN/5Ua3j24LgbCKjDVg==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^3.1.1", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.0.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=14.14.0" + } + }, + "node_modules/cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "dependencies": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cache-content-type": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", + "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", + "dev": true, + "dependencies": { + "mime-types": "^2.1.18", + "ylru": "^1.2.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/cacheable-lookup": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", + "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", + "dev": true, + "engines": { + "node": ">=10.6.0" + } + }, + "node_modules/cacheable-request": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", + "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "dev": true, + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^4.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-api": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", + "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==", + "dev": true, + "dependencies": { + "browserslist": "^4.0.0", + "caniuse-lite": "^1.0.0", + "lodash.memoize": "^4.1.2", + "lodash.uniq": "^4.5.0" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001581", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001581.tgz", + "integrity": "sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/chrome-remote-interface": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/chrome-remote-interface/-/chrome-remote-interface-0.33.0.tgz", + "integrity": "sha512-tv/SgeBfShXk43fwFpQ9wnS7mOCPzETnzDXTNxCb6TqKOiOeIfbrJz+2NAp8GmzwizpKa058wnU1Te7apONaYg==", + "dependencies": { + "commander": "2.11.x", + "ws": "^7.2.0" + }, + "bin": { + "chrome-remote-interface": "bin/client.js" + } + }, + "node_modules/chrome-remote-interface/node_modules/commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" + }, + "node_modules/chrome-remote-interface/node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/chrome-trace-event/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/chromium-pickle-js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", + "integrity": "sha1-BKEGZywYsIWrd02YPfo+oTjyIgU= sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==", + "dev": true + }, + "node_modules/ci-info": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", + "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", + "dev": true + }, + "node_modules/class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", + "deprecated": "Please upgrade to v0.1.7", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", + "deprecated": "Please upgrade to v0.1.5", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dev": true, + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/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/cliui/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/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg= sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/clone-deep/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/clone-deep/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + } + }, + "node_modules/clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag==", + "dev": true + }, + "node_modules/cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "node_modules/cloneable-readable/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/code-block-writer": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-12.0.0.tgz", + "integrity": "sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==", + "dev": true + }, + "node_modules/code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/collection-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", + "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw= sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA==", + "dev": true, + "dependencies": { + "arr-map": "^2.0.2", + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==", + "dev": true, + "dependencies": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "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/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/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/colord": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", + "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", + "dev": true + }, + "node_modules/colorette": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", + "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", + "dev": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/combined-stream/node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk= sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/command-line-args": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", + "dev": true, + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/comment-parser": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.0.tgz", + "integrity": "sha512-QLyTNiZ2KDOibvFPlZ6ZngVsZ/0gYnE6uTXi5aoDg8ed3AkJAz4sEje3Y8a29hQ1s6A99MZXe47fLAXQ1rTqaw==", + "dev": true, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/concat-with-sourcemaps": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", + "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", + "dev": true, + "dependencies": { + "source-map": "^0.6.1" + } + }, + "node_modules/config-chain": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", + "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", + "dev": true, + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dev": true, + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-disposition/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookies": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.9.1.tgz", + "integrity": "sha512-TG2hpqe4ELx54QER/S3HQ9SRVnQnGBtKUz5bLQWtYAQ+o6GpgMs6sYUvaiJjVxb+UXwhRhAEP3m7LbsIZ77Hmw==", + "dev": true, + "dependencies": { + "depd": "~2.0.0", + "keygrip": "~1.1.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/copy-props": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz", + "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==", + "dev": true, + "dependencies": { + "each-props": "^1.3.2", + "is-plain-object": "^5.0.0" + } + }, + "node_modules/copy-webpack-plugin": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz", + "integrity": "sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ==", + "dev": true, + "dependencies": { + "fast-glob": "^3.2.11", + "glob-parent": "^6.0.1", + "globby": "^13.1.1", + "normalize-path": "^3.0.0", + "schema-utils": "^4.0.0", + "serialize-javascript": "^6.0.0" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + } + }, + "node_modules/copy-webpack-plugin/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/copy-webpack-plugin/node_modules/globby": { + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz", + "integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==", + "dev": true, + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/copy-webpack-plugin/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/css": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/css/-/css-3.0.0.tgz", + "integrity": "sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.4", + "source-map": "^0.6.1", + "source-map-resolve": "^0.6.0" + } + }, + "node_modules/css-declaration-sorter": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-7.1.1.tgz", + "integrity": "sha512-dZ3bVTEEc1vxr3Bek9vGwfB5Z6ESPULhcRvO472mfjVnj8jRcTnKO8/JTczlvxM10Myb+wBM++1MtdO76eWcaQ==", + "dev": true, + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "postcss": "^8.0.9" + } + }, + "node_modules/css-loader": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.9.1.tgz", + "integrity": "sha512-OzABOh0+26JKFdMzlK6PY1u5Zx8+Ck7CVRlcGNZoY9qwJjdfu2VWFuprTIpPW+Av5TZTVViYWcFQaEEQURLknQ==", + "dev": true, + "dependencies": { + "icss-utils": "^5.1.0", + "postcss": "^8.4.33", + "postcss-modules-extract-imports": "^3.0.0", + "postcss-modules-local-by-default": "^4.0.4", + "postcss-modules-scope": "^3.1.1", + "postcss-modules-values": "^4.0.0", + "postcss-value-parser": "^4.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + } + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cssnano": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-6.0.3.tgz", + "integrity": "sha512-MRq4CIj8pnyZpcI2qs6wswoYoDD1t0aL28n+41c1Ukcpm56m1h6mCexIHBGjfZfnTqtGSSCP4/fB1ovxgjBOiw==", + "dev": true, + "dependencies": { + "cssnano-preset-default": "^6.0.3", + "lilconfig": "^3.0.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/cssnano" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/cssnano-preset-default": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-6.0.3.tgz", + "integrity": "sha512-4y3H370aZCkT9Ev8P4SO4bZbt+AExeKhh8wTbms/X7OLDo5E7AYUUy6YPxa/uF5Grf+AJwNcCnxKhZynJ6luBA==", + "dev": true, + "dependencies": { + "css-declaration-sorter": "^7.1.1", + "cssnano-utils": "^4.0.1", + "postcss-calc": "^9.0.1", + "postcss-colormin": "^6.0.2", + "postcss-convert-values": "^6.0.2", + "postcss-discard-comments": "^6.0.1", + "postcss-discard-duplicates": "^6.0.1", + "postcss-discard-empty": "^6.0.1", + "postcss-discard-overridden": "^6.0.1", + "postcss-merge-longhand": "^6.0.2", + "postcss-merge-rules": "^6.0.3", + "postcss-minify-font-values": "^6.0.1", + "postcss-minify-gradients": "^6.0.1", + "postcss-minify-params": "^6.0.2", + "postcss-minify-selectors": "^6.0.2", + "postcss-normalize-charset": "^6.0.1", + "postcss-normalize-display-values": "^6.0.1", + "postcss-normalize-positions": "^6.0.1", + "postcss-normalize-repeat-style": "^6.0.1", + "postcss-normalize-string": "^6.0.1", + "postcss-normalize-timing-functions": "^6.0.1", + "postcss-normalize-unicode": "^6.0.2", + "postcss-normalize-url": "^6.0.1", + "postcss-normalize-whitespace": "^6.0.1", + "postcss-ordered-values": "^6.0.1", + "postcss-reduce-initial": "^6.0.2", + "postcss-reduce-transforms": "^6.0.1", + "postcss-svgo": "^6.0.2", + "postcss-unique-selectors": "^6.0.2" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/cssnano-utils": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-4.0.1.tgz", + "integrity": "sha512-6qQuYDqsGoiXssZ3zct6dcMxiqfT6epy7x4R0TQJadd4LWO3sPR6JH6ZByOvVLoZ6EdwPGgd7+DR1EmX3tiXQQ==", + "dev": true, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/csso": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", + "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "dev": true, + "dependencies": { + "css-tree": "^1.1.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "dependencies": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "node_modules/debounce": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.1.0.tgz", + "integrity": "sha512-ZQVKfRVlwRfD150ndzEK8M90ABT+Y/JQKs4Y7U4MXdpuoUkkrr4DwKbVux3YjylA5bUMUj0Nc3pMxPJX6N2QQQ==", + "dev": true + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/debug-fabulous": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz", + "integrity": "sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg==", + "dev": true, + "dependencies": { + "debug": "3.X", + "memoizee": "0.4.X", + "object-assign": "4.X" + } + }, + "node_modules/debug-fabulous/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decode-uri-component": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deemon": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/deemon/-/deemon-1.8.0.tgz", + "integrity": "sha512-qcuSMls/W5DdoEKKAF0PiNQrc8+tItFjvszfjNm1YqNv1p5wwEt+6qILA9sws6eM81nmNwD38ducqlgIXzQlsQ==", + "dev": true, + "dependencies": { + "bl": "^4.0.2", + "tree-kill": "^1.2.2" + }, + "bin": { + "deemon": "src/deemon.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw==", + "dev": true + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/deepmerge": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-3.1.0.tgz", + "integrity": "sha512-/TnecbwXEdycfbsM2++O3eGiatEFHjjNciHEwJclM+T5Kd94qD1AP+2elP/Mq0L5b9VZJao5znR01Mz6eX8Seg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deepmerge-json": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/deepmerge-json/-/deepmerge-json-1.5.0.tgz", + "integrity": "sha512-jZRrDmBKjmGcqMFEUJ14FjMJwm05Qaked+1vxaALRtF0UAl7lPU8OLWXFxvoeg3jbQM249VPFVn8g2znaQkEtA==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/default-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", + "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", + "dev": true, + "dependencies": { + "kind-of": "^5.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-resolution": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", + "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ= sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "engines": { + "node": ">=8" + } + }, + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "dependencies": { + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/delayed-stream": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.6.tgz", + "integrity": "sha1-omRst+w9XXd0YUZwp6Zd4MFz7bw= sha512-Si7mB08fdumvLNFddq3HQOoYf8BUxfITyZi+0RBn1sbojFm8c4gD1+3se7qVEji1uiVVLYE0Np0laaS9E+j6ag==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-indent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", + "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50= sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= sha512-CwffZFvlJffUg9zZA0uqrjQayUTC8ob94pnr5sFwaVv3IOmkfUHcWH+jXaQK3askE51Cqe8/9Ql/0uXNwqZ8Zg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-node": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", + "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==", + "dev": true, + "optional": true + }, + "node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E= sha512-sxNZ+ljy+RA1maXoUReeqBBpBC6RLKmg5ewzV+x+mSETmWNoKdZN6vcQjpFROemza23hGFskJtFNoUWUaQ+R4Q==", + "dev": true + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/duplexify/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/each-props": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", + "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.1", + "object.defaults": "^1.1.0" + } + }, + "node_modules/each-props/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "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/editorconfig": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.2.tgz", + "integrity": "sha512-GWjSI19PVJAM9IZRGOS+YKI8LN+/sjkSjNyvxL5ucqP9/IqtYNXBaQ/6c/hkPNYQHyOHra2KoXZI/JVpuqwmcQ==", + "dev": true, + "dependencies": { + "@types/node": "^10.11.7", + "@types/semver": "^5.5.0", + "commander": "^2.19.0", + "lru-cache": "^4.1.3", + "semver": "^5.6.0", + "sigmund": "^1.0.1" + }, + "bin": { + "editorconfig": "bin/editorconfig" + } + }, + "node_modules/editorconfig/node_modules/@types/node": { + "version": "10.12.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.21.tgz", + "integrity": "sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==", + "dev": true + }, + "node_modules/editorconfig/node_modules/@types/semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ==", + "dev": true + }, + "node_modules/editorconfig/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/editorconfig/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true + }, + "node_modules/electron": { + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/electron/-/electron-30.5.0.tgz", + "integrity": "sha512-20c774PEsCFRzIgpZIaY6t/wTYxam0MfxQt5t+wG8aStHsl81FchUyLbDo4a59goqE7mHjLOdBDlxmZk88IgRw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@electron/get": "^2.0.0", + "@types/node": "^20.9.0", + "extract-zip": "^2.0.1" + }, + "bin": { + "electron": "cli.js" + }, + "engines": { + "node": ">= 12.20.55" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.648", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.648.tgz", + "integrity": "sha512-EmFMarXeqJp9cUKu/QEciEApn0S/xRcpZWuAm32U7NgoZCimjsilKXHRO9saeEW55eHZagIDg6XTUOv32w9pjg==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", + "dev": true + }, + "node_modules/emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/env-paths": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", + "integrity": "sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, + "dependencies": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.0.tgz", + "integrity": "sha512-pqrTKmwEIgafsYZAGw9kszYzmagcE/n4dbgwGWLEXg7J4QFJVQRBld8j3Q3GNez79jzxZshq0bcT962QHOghjw==", + "dev": true + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es5-ext": { + "version": "0.10.63", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.63.tgz", + "integrity": "sha512-hUCZd2Byj/mNKjfP9jXrdVZ62B8KuA/VoK7X8nUh5qT+AxDmcbvZz041oDVZdbIN1qW6XY9VDNwzkvKnZvK2TQ==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", + "next-tick": "^1.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true, + "optional": true + }, + "node_modules/es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c= sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "dev": true, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "dependencies": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "node_modules/es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "dev": true, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.36.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.36.0.tgz", + "integrity": "sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.0.1", + "@eslint/js": "8.36.0", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.5.0", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-header": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz", + "integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==", + "dev": true, + "peerDependencies": { + "eslint": ">=7.7.0" + } + }, + "node_modules/eslint-plugin-jsdoc": { + "version": "46.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.5.0.tgz", + "integrity": "sha512-aulXdA4I1dyWpzyS1Nh/GNoS6PavzeucxEapnMR4JUERowWvaEk2Y4A5irpHAcdXtBBHLVe8WIhdXNjoAlGQgA==", + "dev": true, + "dependencies": { + "@es-joy/jsdoccomment": "~0.40.1", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.0", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.5.4", + "spdx-expression-parse": "^3.0.1" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/eslint-plugin-local": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-local/-/eslint-plugin-local-1.0.0.tgz", + "integrity": "sha512-bcwcQnKL/Iw5Vi/F2lG1he5oKD2OGjhsLmrcctkWrWq5TujgiaYb0cj3pZgr3XI54inNVnneOFdAx1daLoYLJQ==", + "dev": true + }, + "node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "dev": true, + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esniff/node_modules/type": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", + "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==", + "dev": true + }, + "node_modules/espree": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.0.tgz", + "integrity": "sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw==", + "dev": true, + "dependencies": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk= sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "dev": true, + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "node_modules/event-stream": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE= sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==", + "dev": true, + "dependencies": { + "duplexer": "~0.1.1", + "from": "~0", + "map-stream": "~0.1.0", + "pause-stream": "0.0.11", + "split": "0.3", + "stream-combiner": "~0.0.4", + "through": "~2.3.1" + } + }, + "node_modules/events": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", + "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI= sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==", + "dev": true, + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", + "deprecated": "Please upgrade to v0.1.7", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", + "deprecated": "Please upgrade to v0.1.5", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", + "dev": true, + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "dependencies": { + "type": "^2.0.0" + } + }, + "node_modules/ext/node_modules/type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", + "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==", + "dev": true + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dev": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/external-editor/node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY= sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/extract-zip/node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/fancy-log": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", + "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", + "dev": true, + "dependencies": { + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "parse-node-version": "^1.0.0", + "time-stamp": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", + "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz", + "integrity": "sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/file-loader": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz", + "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==", + "dev": true, + "dependencies": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^4.0.0 || ^5.0.0" + } + }, + "node_modules/file-loader/node_modules/schema-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-parent-dir": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/find-parent-dir/-/find-parent-dir-0.3.1.tgz", + "integrity": "sha512-o4UcykWV/XN9wm+jMEtWLPlV8RXCZnMhQI6F6OdHeSez7iiJWePw8ijOlskJZMsaQoGR/b7dH6lO02HhaTN7+A==", + "dev": true + }, + "node_modules/find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", + "dev": true, + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "dev": true, + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/findup-sync/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fined": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/fined/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/flagged-respawn": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flat-cache/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "node_modules/flush-write-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs= sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==", + "dev": true, + "dependencies": { + "for-in": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "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/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==", + "dev": true, + "dependencies": { + "map-cache": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4= sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==", + "dev": true + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", + "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-minipass/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes= sha512-+vSd9frUnapVC2RZYfL3FCB2p3g4TBhaUmrsWlSudsGdnxIuUvBB2QM1VZeBtc49QFwrp+wQLrDs3+xxDgI5gQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/fs-mkdirp-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/fs-mkdirp-stream/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8= sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "deprecated": "This package is no longer supported.", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + }, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/fstream/node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stdin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stream/node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4= sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + }, + "node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ= sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==", + "dev": true, + "dependencies": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/glob-stream/node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-stream/node_modules/glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "node_modules/glob-stream/node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "node_modules/glob-watcher": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz", + "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==", + "dev": true, + "dependencies": { + "anymatch": "^2.0.0", + "async-done": "^1.2.0", + "chokidar": "^2.0.0", + "is-negated-glob": "^1.0.0", + "just-debounce": "^1.0.0", + "normalize-path": "^3.0.0", + "object.defaults": "^1.1.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/glob-watcher/node_modules/anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "dependencies": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "node_modules/glob-watcher/node_modules/anymatch/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "deprecated": "Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies", + "dev": true, + "dependencies": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "optionalDependencies": { + "fsevents": "^1.2.7" + } + }, + "node_modules/glob-watcher/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "deprecated": "The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + }, + "engines": { + "node": ">= 4.0" + } + }, + "node_modules/glob-watcher/node_modules/glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "node_modules/glob-watcher/node_modules/glob-parent/node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==", + "dev": true, + "dependencies": { + "binary-extensions": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/micromatch/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-watcher/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/glob-watcher/node_modules/readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/glob-watcher/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/global-agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", + "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", + "dev": true, + "optional": true, + "dependencies": { + "boolean": "^3.0.1", + "es6-error": "^4.1.1", + "matcher": "^3.0.0", + "roarr": "^2.15.3", + "semver": "^7.3.2", + "serialize-error": "^7.0.1" + }, + "engines": { + "node": ">=10.0" + } + }, + "node_modules/global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "dependencies": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/global-prefix/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/globals": { + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.1.tgz", + "integrity": "sha512-mJPRTc/P39NH/iNG4mXa9aIhNymaQikTrnspeCa2ZuJ+mH2QN/rXwtX3XwKrHqWgUQFbNZKtHM105aHzJalElw==", + "dev": true, + "optional": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glogg": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", + "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", + "dev": true, + "dependencies": { + "sparkles": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/got": { + "version": "11.8.5", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.5.tgz", + "integrity": "sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^4.0.0", + "@szmarczak/http-timer": "^4.0.5", + "@types/cacheable-request": "^6.0.1", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^5.0.3", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "http2-wrapper": "^1.0.0-beta.5.2", + "lowercase-keys": "^2.0.0", + "p-cancelable": "^2.0.0", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=10.19.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/gulp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", + "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", + "dev": true, + "dependencies": { + "glob-watcher": "^5.0.3", + "gulp-cli": "^2.2.0", + "undertaker": "^1.2.1", + "vinyl-fs": "^3.0.0" + }, + "bin": { + "gulp": "bin/gulp.js" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-azure-storage": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/gulp-azure-storage/-/gulp-azure-storage-0.12.1.tgz", + "integrity": "sha512-n/hx8bbGsqrcizruqDTX6zy2FUdkTDGAz04IdopNxNTZivZmizf8u9WLYJreUE6/qCnSJnyjS1HP82+mLk7rjg==", + "dev": true, + "dependencies": { + "@azure/storage-blob": "^12.8.0", + "delayed-stream": "0.0.6", + "event-stream": "3.3.4", + "mime": "^1.3.4", + "progress": "^1.1.8", + "queue": "^3.0.10", + "streamifier": "^0.1.1", + "vinyl": "^2.2.0", + "vinyl-fs": "^3.0.3", + "yargs": "^15.3.0" + }, + "bin": { + "upload-to-azure": "bin/upload.js" + } + }, + "node_modules/gulp-azure-storage/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/gulp-azure-storage/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/gulp-azure-storage/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-azure-storage/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/gulp-azure-storage/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/gulp-azure-storage/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/gulp-azure-storage/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gulp-azure-storage/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/gulp-azure-storage/node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-azure-storage/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/gulp-azure-storage/node_modules/vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "dependencies": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-azure-storage/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/gulp-azure-storage/node_modules/y18n": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "dev": true + }, + "node_modules/gulp-azure-storage/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/gulp-azure-storage/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/gulp-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gulp-bom/-/gulp-bom-3.0.0.tgz", + "integrity": "sha512-iw/J94F+MVlxG64Q17BSkHsyjpY17qHl3N3A/jDdrL77zQBkhKtTiKLqM4di9CUX/qFToyyeDsOWwH+rESBgmA==", + "dev": true, + "dependencies": { + "plugin-error": "^1.0.1", + "through2": "^3.0.1" + }, + "engines": { + "node": ">=8" + }, + "peerDependencies": { + "gulp": ">=4" + }, + "peerDependenciesMeta": { + "gulp": { + "optional": true + } + } + }, + "node_modules/gulp-buffer": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/gulp-buffer/-/gulp-buffer-0.0.2.tgz", + "integrity": "sha1-r4G0NGEBc2tJlC7GyfqGf/5zcDY= sha512-EBkbjjTH2gRr2B8KBAcomdTemfZHqiKs8CxSYdaW0Hq3zxltQFrCg9BBmKVHC9cfxX/3l2BZK5oiGHYNJ/gcVw==", + "dev": true, + "dependencies": { + "through2": "~0.4.0" + } + }, + "node_modules/gulp-buffer/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true + }, + "node_modules/gulp-buffer/node_modules/object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY= sha512-ncrLw+X55z7bkl5PnUvHwFK9FcGuFYo9gtjws2XtSzL+aZ8tm830P60WJ0dSmFVaSalWieW5MD7kEdnXda9yJw==", + "dev": true + }, + "node_modules/gulp-buffer/node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/gulp-buffer/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "dev": true + }, + "node_modules/gulp-buffer/node_modules/through2": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz", + "integrity": "sha1-2/WGYDEVHsg1K7bE22SiKSqEC5s= sha512-45Llu+EwHKtAZYTPPVn3XZHBgakWMN3rokhEv5hu596XP+cNgplMg+Gj+1nmAvj+L0K7+N49zBKx5rah5u0QIQ==", + "dev": true, + "dependencies": { + "readable-stream": "~1.0.17", + "xtend": "~2.1.1" + } + }, + "node_modules/gulp-buffer/node_modules/xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os= sha512-vMNKzr2rHP9Dp/e1NQFnLQlwlhp9L/LfvnsVdHxN1f+uggyVI3i08uD14GPvCToPkdsRfyPqIyYGmIk58V98ZQ==", + "dev": true, + "dependencies": { + "object-keys": "~0.4.0" + }, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/gulp-cli": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz", + "integrity": "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==", + "dev": true, + "dependencies": { + "ansi-colors": "^1.0.1", + "archy": "^1.0.0", + "array-sort": "^1.0.0", + "color-support": "^1.1.3", + "concat-stream": "^1.6.0", + "copy-props": "^2.0.1", + "fancy-log": "^1.3.2", + "gulplog": "^1.0.0", + "interpret": "^1.4.0", + "isobject": "^3.0.1", + "liftoff": "^3.1.0", + "matchdep": "^2.0.0", + "mute-stdout": "^1.0.0", + "pretty-hrtime": "^1.0.0", + "replace-homedir": "^1.0.0", + "semver-greatest-satisfied-range": "^1.1.0", + "v8flags": "^3.2.0", + "yargs": "^7.1.0" + }, + "bin": { + "gulp": "bin/gulp.js" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-cli/node_modules/ansi-colors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", + "dev": true, + "dependencies": { + "ansi-wrap": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", + "dev": true, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "node_modules/gulp-cli/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "node_modules/gulp-cli/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs= sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==", + "dev": true + }, + "node_modules/gulp-cli/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "dev": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==", + "dev": true + }, + "node_modules/gulp-cli/node_modules/wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", + "dev": true, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "dev": true + }, + "node_modules/gulp-cli/node_modules/yargs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz", + "integrity": "sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==", + "dev": true, + "dependencies": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.1" + } + }, + "node_modules/gulp-cli/node_modules/yargs-parser": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz", + "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", + "dev": true, + "dependencies": { + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" + } + }, + "node_modules/gulp-concat": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz", + "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M= sha512-a2scActrQrDBpBbR3WUZGyGS1JEPLg5PZJdIa7/Bi3GuKAmPYDK6SFhy/NZq5R8KsKKFvtfR0fakbUCcKGCCjg==", + "dev": true, + "dependencies": { + "concat-with-sourcemaps": "^1.0.0", + "through2": "^2.0.0", + "vinyl": "^2.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-concat/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/gulp-concat/node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-concat/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/gulp-concat/node_modules/vinyl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", + "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw= sha512-M5D/ZRG7KC3ETrV7iA/GNF/lznml4dZ7ggwtYbqM/B+0INyNTjCdFhw4TqMq//PtNbPpceE7wOqKqK5YfUThPA==", + "dev": true, + "dependencies": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-eslint": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/gulp-eslint/-/gulp-eslint-5.0.0.tgz", + "integrity": "sha512-9GUqCqh85C7rP9120cpxXuZz2ayq3BZc85pCTuPJS03VQYxne0aWPIXWx6LSvsGPa3uRqtSO537vaugOh+5cXg==", + "dev": true, + "dependencies": { + "eslint": "^5.0.1", + "fancy-log": "^1.3.2", + "plugin-error": "^1.0.1" + } + }, + "node_modules/gulp-eslint/node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/gulp-eslint/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/gulp-eslint/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/gulp-eslint/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/gulp-eslint/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/gulp-eslint/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/gulp-eslint/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/gulp-eslint/node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/gulp-eslint/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/gulp-eslint/node_modules/eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^6.14.0 || ^8.10.0 || >=9.10.0" + } + }, + "node_modules/gulp-eslint/node_modules/eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/gulp-eslint/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/gulp-eslint/node_modules/espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "dev": true, + "dependencies": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/gulp-eslint/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/gulp-eslint/node_modules/file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "dependencies": { + "flat-cache": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/gulp-eslint/node_modules/flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "dependencies": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/gulp-eslint/node_modules/flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "node_modules/gulp-eslint/node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/gulp-eslint/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/gulp-eslint/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/gulp-eslint/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/gulp-eslint/node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/gulp-eslint/node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/gulp-eslint/node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/gulp-eslint/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/gulp-eslint/node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/gulp-eslint/node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/gulp-eslint/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/gulp-eslint/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-eslint/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-eslint/node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "node_modules/gulp-eslint/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8= sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/gulp-eslint/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo= sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-eslint/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/gulp-eslint/node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/gulp-eslint/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/gulp-filter": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-5.1.0.tgz", + "integrity": "sha1-oF4Rr/sHz33PQafeHLe2OsN4PnM= sha512-ZERu1ipbPmjrNQ2dQD6lL4BjrJQG66P/c5XiyMMBqV+tUAJ+fLOyYIL/qnXd2pHmw/G/r7CLQb9ttANvQWbpfQ==", + "dev": true, + "dependencies": { + "multimatch": "^2.0.0", + "plugin-error": "^0.1.2", + "streamfilter": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/gulp-filter/node_modules/arr-diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", + "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo= sha512-OQwDZUqYaQwyyhDJHThmzId8daf4/RFNLaeh3AevmSeZ5Y7ug4Ga/yKc6l6kTZOBW781rCj103ZuTh8GAsB3+Q==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-filter/node_modules/arr-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", + "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0= sha512-t5db90jq+qdgk8aFnxEkjqta0B/GHrM1pxzuuZz2zWsOXc5nKu3t+76s/PQBA8FTcM/ipspIH9jWG4OxCBc2eA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-filter/node_modules/array-slice": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU= sha512-rlVfZW/1Ph2SNySXwR9QYkChp8EkOEiTMO5Vwx60usw04i4nWemkm9RXmQqgkQFaLHsqLuADvjp6IfgL9l2M8Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-filter/node_modules/extend-shallow": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", + "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE= sha512-L7AGmkO6jhDkEBBGWlLtftA80Xq8DipnrRPr0pyi7GQLXkaq9JYA4xF4z6qnadIC6euiTDKco0cGSU9muw+WTw==", + "dev": true, + "dependencies": { + "kind-of": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-filter/node_modules/kind-of": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", + "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ= sha512-aUH6ElPnMGon2/YkxRIigV32MOpTVcoXQ1Oo8aYn40s+sJ3j+0gFZsT8HKDcxNy7Fi9zuquWtGaGAahOdv5p/g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-filter/node_modules/plugin-error": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", + "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4= sha512-WzZHcm4+GO34sjFMxQMqZbsz3xiNEgonCskQ9v+IroMmYgk/tas8dG+Hr2D6IbRPybZ12oWpzE/w3cGJ6FJzOw==", + "dev": true, + "dependencies": { + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-flatmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/gulp-flatmap/-/gulp-flatmap-1.0.2.tgz", + "integrity": "sha512-xm+Ax2vPL/xiMBqLFI++wUyPtncm3b55ztGHewmRcoG/sYb0OUTatjSacOud3fee77rnk+jOgnDEHhwBtMHgFA==", + "dev": true, + "dependencies": { + "plugin-error": "0.1.2", + "through2": "2.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-flatmap/node_modules/arr-diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", + "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo= sha512-OQwDZUqYaQwyyhDJHThmzId8daf4/RFNLaeh3AevmSeZ5Y7ug4Ga/yKc6l6kTZOBW781rCj103ZuTh8GAsB3+Q==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-flatmap/node_modules/arr-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", + "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0= sha512-t5db90jq+qdgk8aFnxEkjqta0B/GHrM1pxzuuZz2zWsOXc5nKu3t+76s/PQBA8FTcM/ipspIH9jWG4OxCBc2eA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-flatmap/node_modules/array-slice": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU= sha512-rlVfZW/1Ph2SNySXwR9QYkChp8EkOEiTMO5Vwx60usw04i4nWemkm9RXmQqgkQFaLHsqLuADvjp6IfgL9l2M8Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-flatmap/node_modules/extend-shallow": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", + "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE= sha512-L7AGmkO6jhDkEBBGWlLtftA80Xq8DipnrRPr0pyi7GQLXkaq9JYA4xF4z6qnadIC6euiTDKco0cGSU9muw+WTw==", + "dev": true, + "dependencies": { + "kind-of": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-flatmap/node_modules/kind-of": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", + "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ= sha512-aUH6ElPnMGon2/YkxRIigV32MOpTVcoXQ1Oo8aYn40s+sJ3j+0gFZsT8HKDcxNy7Fi9zuquWtGaGAahOdv5p/g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-flatmap/node_modules/plugin-error": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", + "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4= sha512-WzZHcm4+GO34sjFMxQMqZbsz3xiNEgonCskQ9v+IroMmYgk/tas8dG+Hr2D6IbRPybZ12oWpzE/w3cGJ6FJzOw==", + "dev": true, + "dependencies": { + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-flatmap/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/gulp-flatmap/node_modules/through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4= sha512-tmNYYHFqXmaKSSlOU4ZbQ82cxmFQa5LRWKFtWCNkGIiZ3/VHmOffCeWfBRZZRyXAhNP9itVMR+cuvomBOPlm8g==", + "dev": true, + "dependencies": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "node_modules/gulp-gunzip": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/gulp-gunzip/-/gulp-gunzip-1.1.0.tgz", + "integrity": "sha512-3INeprGyz5fUtAs75k6wVslGuRZIjKAoQp39xA7Bz350ReqkrfYaLYqjZ67XyIfLytRXdzeX04f+DnBduYhQWw==", + "dev": true, + "dependencies": { + "through2": "~2.0.3", + "vinyl": "~2.0.1" + } + }, + "node_modules/gulp-gunzip/node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4= sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/gulp-gunzip/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/gulp-gunzip/node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-gunzip/node_modules/through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4= sha512-tmNYYHFqXmaKSSlOU4ZbQ82cxmFQa5LRWKFtWCNkGIiZ3/VHmOffCeWfBRZZRyXAhNP9itVMR+cuvomBOPlm8g==", + "dev": true, + "dependencies": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "node_modules/gulp-gunzip/node_modules/vinyl": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.0.2.tgz", + "integrity": "sha1-CjcT2NTpIhxY8QyhbAEWyeJe2nw= sha512-ViPXqulxjb1yXxaf/kQZfLHkd2ppnVBWPq4XmvW377vcBTxHFtHR5NRfYsdXsiKpWndKRoCdn11DfEnoCz1Inw==", + "dev": true, + "dependencies": { + "clone": "^1.0.0", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "is-stream": "^1.1.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-gzip": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/gulp-gzip/-/gulp-gzip-1.4.2.tgz", + "integrity": "sha512-ZIxfkUwk2XmZPTT9pPHrHUQlZMyp9nPhg2sfoeN27mBGpi7OaHnOD+WCN41NXjfJQ69lV1nQ9LLm1hYxx4h3UQ==", + "dev": true, + "dependencies": { + "ansi-colors": "^1.0.1", + "bytes": "^3.0.0", + "fancy-log": "^1.3.2", + "plugin-error": "^1.0.0", + "stream-to-array": "^2.3.0", + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/gulp-gzip/node_modules/ansi-colors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", + "dev": true, + "dependencies": { + "ansi-wrap": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-gzip/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/gulp-gzip/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/gulp-json-editor": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/gulp-json-editor/-/gulp-json-editor-2.5.0.tgz", + "integrity": "sha512-HyrBSaE+Di6oQbKsfNM6X7dPFowOuTTuVYjxratU8QAiW7LR7Rydm+/fSS3OehdnuP++A/07q/nksihuD5FZSA==", + "dev": true, + "dependencies": { + "deepmerge": "^3.0.0", + "detect-indent": "^5.0.0", + "js-beautify": "^1.8.9", + "plugin-error": "^1.0.1", + "through2": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/gulp-plumber": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gulp-plumber/-/gulp-plumber-1.2.0.tgz", + "integrity": "sha512-L/LJftsbKoHbVj6dN5pvMsyJn9jYI0wT0nMg3G6VZhDac4NesezecYTi8/48rHi+yEic3sUpw6jlSc7qNWh32A==", + "dev": true, + "dependencies": { + "chalk": "^1.1.3", + "fancy-log": "^1.3.2", + "plugin-error": "^0.1.2", + "through2": "^2.0.3" + }, + "engines": { + "node": ">=0.10", + "npm": ">=1.2.10" + } + }, + "node_modules/gulp-plumber/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-plumber/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-plumber/node_modules/arr-diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", + "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo= sha512-OQwDZUqYaQwyyhDJHThmzId8daf4/RFNLaeh3AevmSeZ5Y7ug4Ga/yKc6l6kTZOBW781rCj103ZuTh8GAsB3+Q==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-plumber/node_modules/arr-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", + "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0= sha512-t5db90jq+qdgk8aFnxEkjqta0B/GHrM1pxzuuZz2zWsOXc5nKu3t+76s/PQBA8FTcM/ipspIH9jWG4OxCBc2eA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-plumber/node_modules/array-slice": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU= sha512-rlVfZW/1Ph2SNySXwR9QYkChp8EkOEiTMO5Vwx60usw04i4nWemkm9RXmQqgkQFaLHsqLuADvjp6IfgL9l2M8Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-plumber/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-plumber/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/gulp-plumber/node_modules/extend-shallow": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", + "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE= sha512-L7AGmkO6jhDkEBBGWlLtftA80Xq8DipnrRPr0pyi7GQLXkaq9JYA4xF4z6qnadIC6euiTDKco0cGSU9muw+WTw==", + "dev": true, + "dependencies": { + "kind-of": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-plumber/node_modules/kind-of": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", + "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ= sha512-aUH6ElPnMGon2/YkxRIigV32MOpTVcoXQ1Oo8aYn40s+sJ3j+0gFZsT8HKDcxNy7Fi9zuquWtGaGAahOdv5p/g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-plumber/node_modules/plugin-error": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", + "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4= sha512-WzZHcm4+GO34sjFMxQMqZbsz3xiNEgonCskQ9v+IroMmYgk/tas8dG+Hr2D6IbRPybZ12oWpzE/w3cGJ6FJzOw==", + "dev": true, + "dependencies": { + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-plumber/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/gulp-plumber/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-plumber/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/gulp-plumber/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/gulp-rename": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.2.2.tgz", + "integrity": "sha1-OtRCh2PwXidk3sHGfYaNsnVoeBc= sha512-qhfUlYwq5zIP4cpRjx+np2vZVnr0xCRQrF3RsGel8uqL47Gu3yjmllSfnvJyl/39zYuxS68e1nnxImbm7388vw==", + "dev": true, + "engines": { + "node": ">=0.10.0", + "npm": ">=1.2.10" + } + }, + "node_modules/gulp-replace": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/gulp-replace/-/gulp-replace-0.5.4.tgz", + "integrity": "sha1-aaZ5FLvRPFYr/xT1BKQDeWqg2qk= sha512-lHL+zKJN8uV95UkONnfRkoj2yJxPPupt2SahxA4vo5c+Ee3+WaIiMdWbOyUhg8BhAROQrWKnnxKOWPdVrnBwGw==", + "dev": true, + "dependencies": { + "istextorbinary": "1.0.2", + "readable-stream": "^2.0.1", + "replacestream": "^4.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/gulp-replace/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/gulp-sourcemaps": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-3.0.0.tgz", + "integrity": "sha512-RqvUckJkuYqy4VaIH60RMal4ZtG0IbQ6PXMNkNsshEGJ9cldUPRb/YCgboYae+CLAs1HQNb4ADTKCx65HInquQ==", + "dev": true, + "dependencies": { + "@gulp-sourcemaps/identity-map": "^2.0.1", + "@gulp-sourcemaps/map-sources": "^1.0.0", + "acorn": "^6.4.1", + "convert-source-map": "^1.0.0", + "css": "^3.0.0", + "debug-fabulous": "^1.0.0", + "detect-newline": "^2.0.0", + "graceful-fs": "^4.0.0", + "source-map": "^0.6.0", + "strip-bom-string": "^1.0.0", + "through2": "^2.0.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gulp-sourcemaps/node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/gulp-sourcemaps/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/gulp-sourcemaps/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/gulp-svgmin": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/gulp-svgmin/-/gulp-svgmin-4.1.0.tgz", + "integrity": "sha512-WKpif+yu3+oIlp1e11CQi5F64YddP699l2mFmxpz8swv8/P8dhxVcMKdCPFWouArlVyn7Ma1eWCJHw5gx4NMtw==", + "dev": true, + "dependencies": { + "lodash.clonedeep": "^4.5.0", + "plugin-error": "^1.0.1", + "svgo": "^2.7.0" + } + }, + "node_modules/gulp-symdest": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/gulp-symdest/-/gulp-symdest-1.3.0.tgz", + "integrity": "sha512-n1VaNYMpyOq4GfyQyIwRZhXOOsQVdEy56BCFxL4hu+stKwYeSQcZxLX5FOZL6jZUlBYXCWlXL+E5JU13ZMldIw==", + "dev": true, + "dependencies": { + "event-stream": "3.3.4", + "mkdirp": "^0.5.1", + "queue": "^3.1.0", + "vinyl-fs": "^3.0.3" + } + }, + "node_modules/gulp-symdest/node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/gulp-untar": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/gulp-untar/-/gulp-untar-0.0.7.tgz", + "integrity": "sha512-0QfbCH2a1k2qkTLWPqTX+QO4qNsHn3kC546YhAP3/n0h+nvtyGITDuDrYBMDZeW4WnFijmkOvBWa5HshTic1tw==", + "dev": true, + "dependencies": { + "event-stream": "~3.3.4", + "streamifier": "~0.1.1", + "tar": "^2.2.1", + "through2": "~2.0.3", + "vinyl": "^1.2.0" + } + }, + "node_modules/gulp-untar/node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4= sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/gulp-untar/node_modules/clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE= sha512-dhUqc57gSMCo6TX85FLfe51eC/s+Im2MLkAgJwfaRRexR2tA4dd3eLEW4L6efzHc2iNorrRRXITifnDLlRrhaA==", + "dev": true + }, + "node_modules/gulp-untar/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/gulp-untar/node_modules/replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ= sha512-AFBWBy9EVRTa/LhEcG8QDP3FvpwZqmvN2QFDuJswFeaVhWnZMp8q3E6Zd90SR04PlIwfGdyVjNyLPyen/ek5CQ==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gulp-untar/node_modules/tar": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", + "deprecated": "This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.", + "dev": true, + "dependencies": { + "block-stream": "*", + "fstream": "^1.0.12", + "inherits": "2" + } + }, + "node_modules/gulp-untar/node_modules/through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4= sha512-tmNYYHFqXmaKSSlOU4ZbQ82cxmFQa5LRWKFtWCNkGIiZ3/VHmOffCeWfBRZZRyXAhNP9itVMR+cuvomBOPlm8g==", + "dev": true, + "dependencies": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "node_modules/gulp-untar/node_modules/vinyl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ= sha512-Ci3wnR2uuSAWFMSglZuB8Z2apBdtOyz8CV7dC6/U1XbltXBC+IuutUkXQISz01P+US2ouBuesSbV6zILZ6BuzQ==", + "dev": true, + "dependencies": { + "clone": "^1.0.0", + "clone-stats": "^0.0.1", + "replace-ext": "0.0.1" + }, + "engines": { + "node": ">= 0.9" + } + }, + "node_modules/gulp-vinyl-zip": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/gulp-vinyl-zip/-/gulp-vinyl-zip-2.1.2.tgz", + "integrity": "sha512-wJn09jsb8PyvUeyFF7y7ImEJqJwYy40BqL9GKfJs6UGpaGW9A+N68Q+ajsIpb9AeR6lAdjMbIdDPclIGo1/b7Q==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "event-stream": "3.3.4", + "queue": "^4.2.1", + "through2": "^2.0.3", + "vinyl": "^2.0.2", + "vinyl-fs": "^3.0.3", + "yauzl": "^2.2.1", + "yazl": "^2.2.1" + } + }, + "node_modules/gulp-vinyl-zip/node_modules/fd-slicer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", + "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU= sha512-MX1ZLPIuKED51hrI4++K+1B0VX87Cs4EkybD2q12Ysuf5p4vkmHqMvQJRlDwROqFr4D2Pzyit5wGQxf30grIcw==", + "dev": true, + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/gulp-vinyl-zip/node_modules/queue": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/queue/-/queue-4.5.0.tgz", + "integrity": "sha512-DwxpAnqJuoQa+wyDgQuwkSshkhlqIlWEvwvdAY27fDPunZ2cVJzXU4JyjY+5l7zs7oGLaYAQm4MbLOVFAHFBzA==", + "dev": true, + "dependencies": { + "inherits": "~2.0.0" + } + }, + "node_modules/gulp-vinyl-zip/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/gulp-vinyl-zip/node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-vinyl-zip/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/gulp-vinyl-zip/node_modules/vinyl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", + "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "dev": true, + "dependencies": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-vinyl-zip/node_modules/yauzl": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.9.1.tgz", + "integrity": "sha1-qBmB6nCleUYTOIPwKcWCGok1mn8= sha512-tOFjaiYI4cNrDuqujDv5G1KdCmGtuIULZqLv263CCADNQlNInl8sJPD+Gf3neEVecFQ0sw6D4oJTI/dqlunkSw==", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.0.1" + } + }, + "node_modules/gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U= sha512-hm6N8nrm3Y08jXie48jsC55eCZz9mnb4OirAStEk2deqeyhXU3C1otDVh+ccttMuc1sBi6RX6ZJ720hs9RCvgw==", + "dev": true, + "dependencies": { + "glogg": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gunzip-maybe": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/gunzip-maybe/-/gunzip-maybe-1.4.2.tgz", + "integrity": "sha512-4haO1M4mLO91PW57BMsDFf75UmwoRX0GkdD+Faw+Lr+r/OZrOCS0pIBwOL1xCKQqnQzbNFGgK2V2CpBUPeFNTw==", + "dev": true, + "dependencies": { + "browserify-zlib": "^0.1.4", + "is-deflate": "^1.0.0", + "is-gzip": "^1.0.0", + "peek-stream": "^1.1.0", + "pumpify": "^1.3.3", + "through2": "^2.0.3" + }, + "bin": { + "gunzip-maybe": "bin.js" + } + }, + "node_modules/gunzip-maybe/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/gunzip-maybe/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0= sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", + "dev": true, + "dependencies": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc= sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "dependencies": { + "parse-passwd": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/html-escaper": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.0.tgz", + "integrity": "sha512-a4u9BeERWGu/S8JiWEAQcdrg9v4QArtP9keViQjGMdff20fBdd8waotXaNmODqBe6uZ3Nafi7K/ho4gCQHV3Ig==", + "dev": true + }, + "node_modules/http-assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.5.0.tgz", + "integrity": "sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==", + "dev": true, + "dependencies": { + "deep-equal": "~1.0.1", + "http-errors": "~1.8.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-assert/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-assert/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-assert/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http2-wrapper": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", + "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "dev": true, + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.0.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/husky": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/husky/-/husky-0.13.4.tgz", + "integrity": "sha512-kafsK/82ndSVKJe1IoR/z7NKkiI2LYM6H+VNI/YlKOeoOXEJTpD65TNu05Zx7pzSZzLuAdMt4fHgpUsnd6HJ7A==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "chalk": "^1.1.3", + "find-parent-dir": "^0.3.0", + "is-ci": "^1.0.9", + "normalize-path": "^1.0.0" + } + }, + "node_modules/husky/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/husky/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/husky/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/husky/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/husky/node_modules/normalize-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-1.0.0.tgz", + "integrity": "sha512-7WyT0w8jhpDStXRq5836AMmihQwq2nrUVQrgjvUo/p/NZf9uy/MeJ246lBJVmWuYXMlJuG9BNZHF0hWjfTbQUA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/husky/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/husky/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/icss-utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "dev": true + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o= sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "node_modules/innosetup": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/innosetup/-/innosetup-6.0.5.tgz", + "integrity": "sha512-XRvidEN0dcxe7NrGXBjl/clfNRfmyakSDtgKaJgvZ3ciKE5ArQOVGqUJcLyPhllqHhMzYGpbUF3ZTZvtKVDP2g==", + "dev": true, + "bin": { + "innosetup-compiler": "lib/iscc" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "dependencies": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "dev": true, + "dependencies": { + "restore-cursor": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/inquirer/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/inquirer/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/inquirer/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368= sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", + "dev": true, + "dependencies": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "node_modules/inquirer/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/string-width/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8= sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/inquirer/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY= sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "dependencies": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "deprecated": "Please upgrade to v1.0.1", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "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.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-ci": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", + "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", + "dev": true, + "dependencies": { + "ci-info": "^1.5.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, + "node_modules/is-core-module": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "deprecated": "Please upgrade to v1.0.1", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-deflate": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-deflate/-/is-deflate-1.0.0.tgz", + "integrity": "sha512-YDoFpuZWu1VRXlsnlYMzKyVRITXj7Ej/V9gXQ2/pAe7X1J7M/RNOqaIYi6qUn+B7nGyB9pDXrv02dsB58d2ZAQ==", + "dev": true + }, + "node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-descriptor/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extendable/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz", + "integrity": "sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-gzip": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-gzip/-/is-gzip-1.0.0.tgz", + "integrity": "sha512-rcfALRIb1YewtnksfRIHGcIY93QnK8BIQ/2c9yDYcG/Y6+vRoJuTWBmmSEbyLLYtXm7q35pHOHbZFQBaLrhlWQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI= sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", + "dev": true + }, + "node_modules/is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "dependencies": { + "is-unc-path": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ= sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "dependencies": { + "unc-path-regex": "^0.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", + "dev": true + }, + "node_modules/is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= sha512-AhiROmoEFDSsjx8hW+5sGwgKVIORcXnrlAx/R0ZSeaPw70Vw0CqkGBBhHGL58Uox2eXnU1AnvXJl1XlyedO5bA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8= sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz", + "integrity": "sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istextorbinary": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-1.0.2.tgz", + "integrity": "sha1-rOGTVNGpoBc+/rEITOD4ewrX3s8= sha512-qZ5ptUDuni2pdCngFTraYa5kalQ0mX47Mhn08tT0DZZv/7yhX1eMb9lFtXVbWhFtgRtpLG/UdqVAjh9teO5x+w==", + "dev": true, + "dependencies": { + "binaryextensions": "~1.0.0", + "textextensions": "~1.0.0" + }, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/js-base64": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", + "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==" + }, + "node_modules/js-beautify": { + "version": "1.8.9", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.8.9.tgz", + "integrity": "sha512-MwPmLywK9RSX0SPsUJjN7i+RQY9w/yC17Lbrq9ViEefpLRgqAR2BgrMN2AbifkUuhDV8tRauLhLda/9+bE0YQA==", + "dev": true, + "dependencies": { + "config-chain": "^1.1.12", + "editorconfig": "^0.15.2", + "glob": "^7.1.3", + "mkdirp": "~0.5.0", + "nopt": "~4.0.1" + }, + "bin": { + "css-beautify": "js/bin/css-beautify.js", + "html-beautify": "js/bin/html-beautify.js", + "js-beautify": "js/bin/js-beautify.js" + } + }, + "node_modules/js-beautify/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/js-beautify/node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/js-sdsl": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", + "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, + "node_modules/jschardet": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz", + "integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "dev": true, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true, + "optional": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dev": true, + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/jszip/node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, + "node_modules/jszip/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/just-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", + "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo= sha512-/QLqfspz7WJ+TPmzDp5WJOlm2r3j+/12rGo7dG5uwD9vGM5sWg8p251b7Us0p19JqjddJzcYOK2v6FN92nREmg==", + "dev": true + }, + "node_modules/just-extend": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", + "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", + "dev": true + }, + "node_modules/kerberos": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/kerberos/-/kerberos-2.1.1.tgz", + "integrity": "sha512-414s1G/qgK2T60cXnZsHbtRj8Ynjg0DBlQWeY99tkyqQ2e8vGgFHvxRdvjTlLHg/SxBA0zLQcGE6Pk6Dfq/BCA==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^6.1.0", + "prebuild-install": "^7.1.2" + }, + "engines": { + "node": ">=12.9.0" + } + }, + "node_modules/kerberos/node_modules/node-addon-api": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==" + }, + "node_modules/keygrip": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", + "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", + "dev": true, + "dependencies": { + "tsscmp": "1.0.6" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/keyv": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", + "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/koa": { + "version": "2.15.3", + "resolved": "https://registry.npmjs.org/koa/-/koa-2.15.3.tgz", + "integrity": "sha512-j/8tY9j5t+GVMLeioLaxweJiKUayFhlGqNTzf2ZGwL0ZCQijd2RLHK0SLW5Tsko8YyyqCZC2cojIb0/s62qTAg==", + "dev": true, + "dependencies": { + "accepts": "^1.3.5", + "cache-content-type": "^1.0.0", + "content-disposition": "~0.5.2", + "content-type": "^1.0.4", + "cookies": "~0.9.0", + "debug": "^4.3.2", + "delegates": "^1.0.0", + "depd": "^2.0.0", + "destroy": "^1.0.4", + "encodeurl": "^1.0.2", + "escape-html": "^1.0.3", + "fresh": "~0.5.2", + "http-assert": "^1.3.0", + "http-errors": "^1.6.3", + "is-generator-function": "^1.0.7", + "koa-compose": "^4.1.0", + "koa-convert": "^2.0.0", + "on-finished": "^2.3.0", + "only": "~0.0.2", + "parseurl": "^1.3.2", + "statuses": "^1.5.0", + "type-is": "^1.6.16", + "vary": "^1.1.2" + }, + "engines": { + "node": "^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4" + } + }, + "node_modules/koa-compose": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz", + "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==", + "dev": true + }, + "node_modules/koa-convert": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-2.0.0.tgz", + "integrity": "sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==", + "dev": true, + "dependencies": { + "co": "^4.6.0", + "koa-compose": "^4.1.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/koa-morgan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/koa-morgan/-/koa-morgan-1.0.1.tgz", + "integrity": "sha1-CAUuDODYOdPEMXi5CluzQkvvH5k= sha512-JOUdCNlc21G50afBXfErUrr1RKymbgzlrO5KURY+wmDG1Uvd2jmxUJcHgylb/mYXy2SjiNZyYim/ptUBGsIi3A==", + "dev": true, + "dependencies": { + "morgan": "^1.6.1" + } + }, + "node_modules/koa-mount": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/koa-mount/-/koa-mount-4.0.0.tgz", + "integrity": "sha512-rm71jaA/P+6HeCpoRhmCv8KVBIi0tfGuO/dMKicbQnQW/YJntJ6MnnspkodoA4QstMVEZArsCphmd0bJEtoMjQ==", + "dev": true, + "dependencies": { + "debug": "^4.0.1", + "koa-compose": "^4.1.0" + }, + "engines": { + "node": ">= 7.6.0" + } + }, + "node_modules/koa-send": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/koa-send/-/koa-send-5.0.1.tgz", + "integrity": "sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "http-errors": "^1.7.3", + "resolve-path": "^1.4.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/koa-send/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/koa-send/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/koa-send/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/koa-static": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/koa-static/-/koa-static-5.0.0.tgz", + "integrity": "sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==", + "dev": true, + "dependencies": { + "debug": "^3.1.0", + "koa-send": "^5.0.0" + }, + "engines": { + "node": ">= 7.6.0" + } + }, + "node_modules/koa-static/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/koa/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/koa/node_modules/http-errors/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/koa/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/last-run": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", + "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls= sha512-U/VxvpX4N/rFvPzr3qG5EtLKEnNI0emvIQB3/ecEwv+8GHaUKbIB8vxv1Oai5FAF0d0r7LXHhLLe5K/yChm5GQ==", + "dev": true, + "dependencies": { + "default-resolution": "^2.0.0", + "es6-weak-map": "^2.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/lazy.js": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/lazy.js/-/lazy.js-0.4.3.tgz", + "integrity": "sha1-h/Z6B602VVEh5P/xUg3zG+Znhtg= sha512-kHcnVaCZzhv6P+YgC4iRZFw62+biYIcBYU8qqKzJysC7cdKwPgb3WRtcBPyINTSLZwsjyFdBtd97sHbkseTZKw==", + "dev": true + }, + "node_modules/lazystream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", + "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ= sha512-/330KFbmC/zKdtZoVDRwvkJ8snrJyBPfoZ39zsJl2O24HOE1CTNiEbeZmHXmjBVxTSSv7JlJEXPYhU83DhA2yg==", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", + "dev": true, + "dependencies": { + "invert-kv": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", + "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI= sha512-IpSVCk9AYvLHo5ctcIXxOBpMWUe+4TKN3VPWAKUbJikkmsGp0VrSM8IttVc32D6J4WUsiPE6aEFRNmIoF/gdow==", + "dev": true, + "dependencies": { + "flush-write-stream": "^1.0.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dev": true, + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/liftoff": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", + "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", + "dev": true, + "dependencies": { + "extend": "^3.0.0", + "findup-sync": "^3.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/liftoff/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lilconfig": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", + "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "dev": true, + "dependencies": { + "uc.micro": "^2.0.0" + } + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs= sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/loader-runner": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", + "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "dev": true, + "engines": { + "node": ">=6.11.5" + } + }, + "node_modules/loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY= sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true + }, + "node_modules/lodash.clone": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz", + "integrity": "sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y= sha512-GhrVeweiTD6uTmmn5hV/lzgCQhccwReIVRLHp7LT4SopOjqEZ5BbX8b5WWEtAKasjmy8hR7ZPwsYlxRCku5odg==", + "dev": true + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "dev": true + }, + "node_modules/lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", + "dev": true + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lodash.some": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", + "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0= sha512-j7MJE+TuT51q9ggt4fSgVqro163BEFjAt3u97IqU+JA2DkWl80nFTrowzLpZ/BnpN7rrl0JA/593NAdd8p/scQ==", + "dev": true + }, + "node_modules/lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", + "dev": true + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM= sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==", + "dev": true, + "dependencies": { + "es5-ext": "~0.10.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/make-iterator/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g==", + "dev": true + }, + "node_modules/map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==", + "dev": true, + "dependencies": { + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/markdown-it": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, + "node_modules/matchdep": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", + "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4= sha512-LFgVbaHIHMqCRuCZyfCtUOq9/Lnzhi7Z0KFUE2fhD54+JN2jLh3hC02RLkqauJ3U4soU6H1J3tfj/Byk7GoEjA==", + "dev": true, + "dependencies": { + "findup-sync": "^2.0.0", + "micromatch": "^3.0.4", + "resolve": "^1.4.0", + "stack-trace": "0.0.10" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/matchdep/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matchdep/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matchdep/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matchdep/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matchdep/node_modules/findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw= sha512-vs+3unmJT45eczmcAZ6zMJtxN3l/QXeccaXQx5cu/MeJMhewVfoWZqibRkOxPnmoR59+Zy5hjabfQc6JLSah4g==", + "dev": true, + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/matchdep/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matchdep/node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matchdep/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matchdep/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matchdep/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matchdep/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matchdep/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matcher": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", + "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", + "dev": true, + "optional": true, + "dependencies": { + "escape-string-regexp": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dev": true, + "dependencies": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, + "node_modules/mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "dev": true + }, + "node_modules/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "dev": true + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memoizee": { + "version": "0.4.15", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", + "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==", + "dev": true, + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.53", + "es6-weak-map": "^2.0.3", + "event-emitter": "^0.3.5", + "is-promise": "^2.2.2", + "lru-queue": "^0.1.0", + "next-tick": "^1.1.0", + "timers-ext": "^0.1.7" + } + }, + "node_modules/memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "dev": true, + "dependencies": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + }, + "engines": { + "node": ">=4.3.0 <5.0.0 || >=5.10" + } + }, + "node_modules/memory-fs/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI= sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/merge-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-1.0.1.tgz", + "integrity": "sha512-iuPV41VWKWBIOpBsjoxjDZw8/GbSfZ2mk7N1453bwMrfzdrIk7EzBd+8UVR6rkw67th7xnk9Dytl3J+lHPdxvg==", + "dev": true, + "dependencies": { + "is-plain-obj": "^1.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.28", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", + "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", + "dev": true, + "dependencies": { + "mime-db": "1.45.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", + "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "dependencies": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, + "node_modules/mocha": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", + "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "dev": true, + "dependencies": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/mocha-junit-reporter": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-2.2.1.tgz", + "integrity": "sha512-iDn2tlKHn8Vh8o4nCzcUVW4q7iXp7cC4EB78N0cDHIobLymyHNwe0XG8HEHHjc3hJlXm0Vy6zcrxaIhnI2fWmw==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "md5": "^2.3.0", + "mkdirp": "^3.0.0", + "strip-ansi": "^6.0.1", + "xml": "^1.0.1" + }, + "peerDependencies": { + "mocha": ">=2.2.5" + } + }, + "node_modules/mocha-junit-reporter/node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha-multi-reporters": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/mocha-multi-reporters/-/mocha-multi-reporters-1.5.1.tgz", + "integrity": "sha512-Yb4QJOaGLIcmB0VY7Wif5AjvLMUFAdV57D2TWEva1Y0kU/3LjKpeRVmlMIfuO1SVbauve459kgtIizADqxMWPg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "lodash": "^4.17.15" + }, + "engines": { + "node": ">=6.0.0" + }, + "peerDependencies": { + "mocha": ">=3.1.2" + } + }, + "node_modules/mocha/node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/mocha/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/mocha/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mocha/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/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/morgan": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", + "dev": true, + "dependencies": { + "basic-auth": "~2.0.1", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-finished": "~2.3.0", + "on-headers": "~1.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/morgan/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/morgan/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/morgan/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/multimatch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis= sha512-0mzK8ymiWdehTBiJh0vClAzGyQbdtyWqzSVx//EK4N/D+599RFlGfTAsKw2zMSABtDG9C6Ul2+t8f2Lbdjf5mA==", + "dev": true, + "dependencies": { + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/multimatch/node_modules/array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==", + "dev": true, + "dependencies": { + "array-uniq": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mute-stdout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", + "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", + "dev": true + }, + "node_modules/nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "dev": true, + "optional": true + }, + "node_modules/nanoid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + }, + "node_modules/native-is-elevated": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/native-is-elevated/-/native-is-elevated-0.7.0.tgz", + "integrity": "sha512-tp8hUqK7vexBiyIWKMvmRxdG6kqUtO+3eay9iB0i16NYgvCqE5wMe1Y0guHilpkmRgvVXEWNW4et1+qqcwpLBA==", + "hasInstallScript": true + }, + "node_modules/native-keymap": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/native-keymap/-/native-keymap-3.3.5.tgz", + "integrity": "sha512-7XDOLPNX1FnUFC/cX3cioBz2M+dO212ai9DuwpfKFzkPu3xTmEzOm5xewOMLXE4V9YoRhNPxvq1H2YpPWDgSsg==", + "hasInstallScript": true + }, + "node_modules/native-watchdog": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/native-watchdog/-/native-watchdog-1.4.2.tgz", + "integrity": "sha512-iT3Uj6FFdrW5vHbQ/ybiznLus9oiUoMJ8A8nyugXv9rV3EBhIodmGs+mztrwQyyBc+PB5/CrskAH/WxaUVRRSQ==", + "hasInstallScript": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "dev": true + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/nise": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.0.tgz", + "integrity": "sha512-W5WlHu+wvo3PaKLsJJkgPup2LrsXCcm7AWwyNZkUnn5rwPkuPBi3Iwk5SQtN0mv+K65k7nKKjwNQ30wg3wLAQQ==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.7.0", + "@sinonjs/fake-timers": "^7.0.4", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "path-to-regexp": "^1.7.0" + } + }, + "node_modules/nise/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true + }, + "node_modules/nise/node_modules/path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dev": true, + "dependencies": { + "isarray": "0.0.1" + } + }, + "node_modules/node-abi": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.8.0.tgz", + "integrity": "sha512-tzua9qWWi7iW4I42vUPKM+SfaF0vQSLAm4yO5J83mSwB7GeoWrDKC/K+8YCnYNwqP5duwazbw2X9l4m8SC2cUw==", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" + }, + "node_modules/node-fetch": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.8.tgz", + "integrity": "sha512-RZ6dBYuj8dRSfxpUSu+NsdF1dpPpluJxwOp+6IoDp/sH2QNDSvurYsAa+F1WxY2RjA1iP93xhcsUoYbF2XBqVg==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp-build": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", + "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/node-html-markdown": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/node-html-markdown/-/node-html-markdown-1.3.0.tgz", + "integrity": "sha512-OeFi3QwC/cPjvVKZ114tzzu+YoR+v9UXW5RwSXGUqGb0qCl0DvP406tzdL7SFn8pZrMyzXoisfG2zcuF9+zw4g==", + "dev": true, + "dependencies": { + "node-html-parser": "^6.1.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/node-html-parser": { + "version": "6.1.13", + "resolved": "https://registry.npmjs.org/node-html-parser/-/node-html-parser-6.1.13.tgz", + "integrity": "sha512-qIsTMOY4C/dAa5Q5vsobRpOOvPfC4pB61UVW2uSwZNUp0QU/jCekTal1vMmbO0DgdHeLUJpv/ARmDqErVxA3Sg==", + "dev": true, + "dependencies": { + "css-select": "^5.1.0", + "he": "1.2.0" + } + }, + "node_modules/node-pty": { + "version": "1.1.0-beta21", + "resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.1.0-beta21.tgz", + "integrity": "sha512-FYpnY9g8qMQLTpqyeY9NVli6YfCWwvG6v6gmaDBbPjlc1VMp/+Zivq0SStDrRr1aciGnFCZzpL0BzdMnmbDnAw==", + "hasInstallScript": true, + "dependencies": { + "node-addon-api": "^7.1.0" + } + }, + "node_modules/node-pty/node_modules/node-addon-api": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", + "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", + "engines": { + "node": "^16 || ^18 || >= 20" + } + }, + "node_modules/node-releases": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "dev": true + }, + "node_modules/nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= sha512-+5XZFpQZEY0cg5JaxLwGxDlKNKYxuXwGt8/Oi3UXm5/4ymrJve9d2CURituxv3rSrVCGZj4m1U1JlHTdcKt2Ng==", + "dev": true, + "dependencies": { + "abbrev": "1", + "osenv": "^0.1.4" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-url": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/now-and-later": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "dev": true, + "dependencies": { + "once": "^1.3.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm-run-all/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/npm-run-all/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/npm-run-all/node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/npm-run-all/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/npm-run-all/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/npm-run-all/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/nth-check": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.1.tgz", + "integrity": "sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw= sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==", + "dev": true, + "dependencies": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", + "deprecated": "Please upgrade to v0.1.7", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", + "deprecated": "Please upgrade to v0.1.5", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==", + "dev": true, + "dependencies": { + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8= sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==", + "dev": true, + "dependencies": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc= sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==", + "dev": true, + "dependencies": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.reduce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", + "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60= sha512-naLhxxpUESbNkRqc35oQ2scZSJueHGQNUfMW/0U37IgN6tE2dgDWg3whf+NEliy3F/QysrO48XKUz/nGPe+AQw==", + "dev": true, + "dependencies": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E= sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/only": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz", + "integrity": "sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q= sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==", + "dev": true + }, + "node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/opn": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-6.0.0.tgz", + "integrity": "sha512-I9PKfIZC+e4RXZ/qr1RhgyCnGgYX0UEIlXgWnCOVACIvFgaC9rz6Won7xbdhoHrd8IIhV7YEpHjreNUNkqCGkQ==", + "deprecated": "The package has been renamed to `open`", + "dev": true, + "dependencies": { + "is-wsl": "^1.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/opn/node_modules/is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/ora": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-7.0.1.tgz", + "integrity": "sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==", + "dev": true, + "dependencies": { + "chalk": "^5.3.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.9.0", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.3.0", + "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", + "string-width": "^6.1.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/log-symbols": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "dev": true, + "dependencies": { + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/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/ordered-read-streams": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4= sha512-Z87aSjx3r5c0ZB7bcJqIgIRX5bxR7A4aSzvIbaxd0oTkWBCOoKfuGHiKj60CHVUgg1Phm5yMZzBdt8XqRs73Mw==", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.1" + } + }, + "node_modules/ordered-read-streams/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", + "dev": true + }, + "node_modules/os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M= sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==", + "dev": true, + "dependencies": { + "lcid": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "deprecated": "This package is no longer supported.", + "dev": true, + "dependencies": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "node_modules/p-all": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-all/-/p-all-1.0.0.tgz", + "integrity": "sha1-k731OlWiOCH9+pi0F0qZv38x340= sha512-OtbznqfGjQT+i89LK9C9YPh1G8d6n8xgsJ8yRVXrx6PRXrlOthNJhP+dHxrPopty8fugYb1DodpwrzP7z0Mtvw==", + "dev": true, + "dependencies": { + "p-map": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-cancelable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", + "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz", + "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "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/pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", + "dev": true + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE= sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==", + "dev": true, + "dependencies": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, + "node_modules/path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q==", + "dev": true + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18= sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", + "dev": true + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc= sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==", + "dev": true, + "dependencies": { + "path-root-regex": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0= sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "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.3.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.0.tgz", + "integrity": "sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/path-to-regexp": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU= sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==", + "dev": true, + "dependencies": { + "through": "~2.3" + } + }, + "node_modules/peek-stream": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/peek-stream/-/peek-stream-1.1.3.tgz", + "integrity": "sha512-FhJ+YbOSBb9/rIl2ZeE/QHEsWn7PqNYt8ARAY3kIgNGOk13g9FGyIY6JIl/xB/3TFRVoTv5as0l11weORrTekA==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "duplexify": "^3.5.0", + "through2": "^2.0.3" + } + }, + "node_modules/peek-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/peek-stream/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA= sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==" + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "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/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA= sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o= sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "dev": true, + "dependencies": { + "pinkie": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/playwright": { + "version": "1.46.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.46.1.tgz", + "integrity": "sha512-oPcr1yqoXLCkgKtD5eNUPLiN40rYEM39odNpIb6VE6S7/15gJmA1NzVv6zJYusV0e7tzvkU/utBFNa/Kpxmwng==", + "dev": true, + "dependencies": { + "playwright-core": "1.46.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.0.tgz", + "integrity": "sha512-1DyHT8OqkcfCkYUD9zzUTfg7EfTd+6a8MkD/NWOvjo0u/SCNd5YmY/lJwFvUZOxJbWNds+ei7ic2+R/cRz/PDg==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/playwright/node_modules/playwright-core": { + "version": "1.46.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.46.1.tgz", + "integrity": "sha512-h9LqIQaAv+CYvWzsZ+h3RsrqCStkBHlgo6/TJlFst3cOTlLghBQlJwPOZKQJTKNaD3QIB7aAVQ+gfWbN3NXB7A==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/plist": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.5.tgz", + "integrity": "sha512-83vX4eYdQp3vP9SxuYgEM/G/pJQqLUz/V/xzPrzruLs7fz7jxGQ1msZ/mg1nwZxUSuOp4sb+/bEIbRrbzZRxDA==", + "dev": true, + "dependencies": { + "base64-js": "^1.5.1", + "xmlbuilder": "^9.0.7" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/plist/node_modules/xmlbuilder": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= sha512-7YXTQc3P2l9+0rjaUbLwMKRhtmwg1M1eDf6nag7urC7pIPYLD9W/jmzQ4ptRSUbodw5S0jfoGTflLemQibSpeQ==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/plugin-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz", + "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==", + "dev": true, + "dependencies": { + "ansi-colors": "^1.0.1", + "arr-diff": "^4.0.0", + "arr-union": "^3.1.0", + "extend-shallow": "^3.0.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/plugin-error/node_modules/ansi-colors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", + "dev": true, + "dependencies": { + "ansi-wrap": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-calc": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-9.0.1.tgz", + "integrity": "sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.11", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.2" + } + }, + "node_modules/postcss-colormin": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-6.0.2.tgz", + "integrity": "sha512-TXKOxs9LWcdYo5cgmcSHPkyrLAh86hX1ijmyy6J8SbOhyv6ua053M3ZAM/0j44UsnQNIWdl8gb5L7xX2htKeLw==", + "dev": true, + "dependencies": { + "browserslist": "^4.22.2", + "caniuse-api": "^3.0.0", + "colord": "^2.9.1", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-convert-values": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-6.0.2.tgz", + "integrity": "sha512-aeBmaTnGQ+NUSVQT8aY0sKyAD/BaLJenEKZ03YK0JnDE1w1Rr8XShoxdal2V2H26xTJKr3v5haByOhJuyT4UYw==", + "dev": true, + "dependencies": { + "browserslist": "^4.22.2", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-discard-comments": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-6.0.1.tgz", + "integrity": "sha512-f1KYNPtqYLUeZGCHQPKzzFtsHaRuECe6jLakf/RjSRqvF5XHLZnM2+fXLhb8Qh/HBFHs3M4cSLb1k3B899RYIg==", + "dev": true, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-discard-duplicates": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-6.0.1.tgz", + "integrity": "sha512-1hvUs76HLYR8zkScbwyJ8oJEugfPV+WchpnA+26fpJ7Smzs51CzGBHC32RS03psuX/2l0l0UKh2StzNxOrKCYg==", + "dev": true, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-discard-empty": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-6.0.1.tgz", + "integrity": "sha512-yitcmKwmVWtNsrrRqGJ7/C0YRy53i0mjexBDQ9zYxDwTWVBgbU4+C9jIZLmQlTDT9zhml+u0OMFJh8+31krmOg==", + "dev": true, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-discard-overridden": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-6.0.1.tgz", + "integrity": "sha512-qs0ehZMMZpSESbRkw1+inkf51kak6OOzNRaoLd/U7Fatp0aN2HQ1rxGOrJvYcRAN9VpX8kUF13R2ofn8OlvFVA==", + "dev": true, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-merge-longhand": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-6.0.2.tgz", + "integrity": "sha512-+yfVB7gEM8SrCo9w2lCApKIEzrTKl5yS1F4yGhV3kSim6JzbfLGJyhR1B6X+6vOT0U33Mgx7iv4X9MVWuaSAfw==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0", + "stylehacks": "^6.0.2" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-merge-rules": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-6.0.3.tgz", + "integrity": "sha512-yfkDqSHGohy8sGYIJwBmIGDv4K4/WrJPX355XrxQb/CSsT4Kc/RxDi6akqn5s9bap85AWgv21ArcUWwWdGNSHA==", + "dev": true, + "dependencies": { + "browserslist": "^4.22.2", + "caniuse-api": "^3.0.0", + "cssnano-utils": "^4.0.1", + "postcss-selector-parser": "^6.0.15" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-minify-font-values": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-6.0.1.tgz", + "integrity": "sha512-tIwmF1zUPoN6xOtA/2FgVk1ZKrLcCvE0dpZLtzyyte0j9zUeB8RTbCqrHZGjJlxOvNWKMYtunLrrl7HPOiR46w==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-minify-gradients": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-6.0.1.tgz", + "integrity": "sha512-M1RJWVjd6IOLPl1hYiOd5HQHgpp6cvJVLrieQYS9y07Yo8itAr6jaekzJphaJFR0tcg4kRewCk3kna9uHBxn/w==", + "dev": true, + "dependencies": { + "colord": "^2.9.1", + "cssnano-utils": "^4.0.1", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-minify-params": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-6.0.2.tgz", + "integrity": "sha512-zwQtbrPEBDj+ApELZ6QylLf2/c5zmASoOuA4DzolyVGdV38iR2I5QRMsZcHkcdkZzxpN8RS4cN7LPskOkTwTZw==", + "dev": true, + "dependencies": { + "browserslist": "^4.22.2", + "cssnano-utils": "^4.0.1", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-minify-selectors": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-6.0.2.tgz", + "integrity": "sha512-0b+m+w7OAvZejPQdN2GjsXLv5o0jqYHX3aoV0e7RBKPCsB7TYG5KKWBFhGnB/iP3213Ts8c5H4wLPLMm7z28Sg==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.15" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-modules-extract-imports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", + "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-local-by-default": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.4.tgz", + "integrity": "sha512-L4QzMnOdVwRm1Qb8m4x8jsZzKAaPAgrUF1r/hjDR2Xj7R+8Zsf97jAlSQzWtKx5YNiNGN8QxmPFIc/sh+RQl+Q==", + "dev": true, + "dependencies": { + "icss-utils": "^5.0.0", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.1.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-scope": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.1.1.tgz", + "integrity": "sha512-uZgqzdTleelWjzJY+Fhti6F3C9iF1JR/dODLs/JDefozYcKTBCdD8BIl6nNPbTbcLnGrk56hzwZC2DaGNvYjzA==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.4" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", + "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", + "dev": true, + "dependencies": { + "icss-utils": "^5.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-nesting": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-12.0.2.tgz", + "integrity": "sha512-63PpJHSeNs93S3ZUIyi+7kKx4JqOIEJ6QYtG3x+0qA4J03+4n0iwsyA1GAHyWxsHYljQS4/4ZK1o2sMi70b5wQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "dependencies": { + "@csstools/selector-specificity": "^3.0.1", + "postcss-selector-parser": "^6.0.13" + }, + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "postcss": "^8.4" + } + }, + "node_modules/postcss-normalize-charset": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-6.0.1.tgz", + "integrity": "sha512-aW5LbMNRZ+oDV57PF9K+WI1Z8MPnF+A8qbajg/T8PP126YrGX1f9IQx21GI2OlGz7XFJi/fNi0GTbY948XJtXg==", + "dev": true, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-normalize-display-values": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-6.0.1.tgz", + "integrity": "sha512-mc3vxp2bEuCb4LgCcmG1y6lKJu1Co8T+rKHrcbShJwUmKJiEl761qb/QQCfFwlrvSeET3jksolCR/RZuMURudw==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-normalize-positions": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-6.0.1.tgz", + "integrity": "sha512-HRsq8u/0unKNvm0cvwxcOUEcakFXqZ41fv3FOdPn916XFUrympjr+03oaLkuZENz3HE9RrQE9yU0Xv43ThWjQg==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-normalize-repeat-style": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-6.0.1.tgz", + "integrity": "sha512-Gbb2nmCy6tTiA7Sh2MBs3fj9W8swonk6lw+dFFeQT68B0Pzwp1kvisJQkdV6rbbMSd9brMlS8I8ts52tAGWmGQ==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-normalize-string": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-6.0.1.tgz", + "integrity": "sha512-5Fhx/+xzALJD9EI26Aq23hXwmv97Zfy2VFrt5PLT8lAhnBIZvmaT5pQk+NuJ/GWj/QWaKSKbnoKDGLbV6qnhXg==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-normalize-timing-functions": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-6.0.1.tgz", + "integrity": "sha512-4zcczzHqmCU7L5dqTB9rzeqPWRMc0K2HoR+Bfl+FSMbqGBUcP5LRfgcH4BdRtLuzVQK1/FHdFoGT3F7rkEnY+g==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-normalize-unicode": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-6.0.2.tgz", + "integrity": "sha512-Ff2VdAYCTGyMUwpevTZPZ4w0+mPjbZzLLyoLh/RMpqUqeQKZ+xMm31hkxBavDcGKcxm6ACzGk0nBfZ8LZkStKA==", + "dev": true, + "dependencies": { + "browserslist": "^4.22.2", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-normalize-url": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-6.0.1.tgz", + "integrity": "sha512-jEXL15tXSvbjm0yzUV7FBiEXwhIa9H88JOXDGQzmcWoB4mSjZIsmtto066s2iW9FYuIrIF4k04HA2BKAOpbsaQ==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-normalize-whitespace": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-6.0.1.tgz", + "integrity": "sha512-76i3NpWf6bB8UHlVuLRxG4zW2YykF9CTEcq/9LGAiz2qBuX5cBStadkk0jSkg9a9TCIXbMQz7yzrygKoCW9JuA==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-ordered-values": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-6.0.1.tgz", + "integrity": "sha512-XXbb1O/MW9HdEhnBxitZpPFbIvDgbo9NK4c/5bOfiKpnIGZDoL2xd7/e6jW5DYLsWxBbs+1nZEnVgnjnlFViaA==", + "dev": true, + "dependencies": { + "cssnano-utils": "^4.0.1", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-reduce-initial": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-6.0.2.tgz", + "integrity": "sha512-YGKalhNlCLcjcLvjU5nF8FyeCTkCO5UtvJEt0hrPZVCTtRLSOH4z00T1UntQPj4dUmIYZgMj8qK77JbSX95hSw==", + "dev": true, + "dependencies": { + "browserslist": "^4.22.2", + "caniuse-api": "^3.0.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-reduce-transforms": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-6.0.1.tgz", + "integrity": "sha512-fUbV81OkUe75JM+VYO1gr/IoA2b/dRiH6HvMwhrIBSUrxq3jNZQZitSnugcTLDi1KkQh1eR/zi+iyxviUNBkcQ==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.15", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.15.tgz", + "integrity": "sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-svgo": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-6.0.2.tgz", + "integrity": "sha512-IH5R9SjkTkh0kfFOQDImyy1+mTCb+E830+9SV1O+AaDcoHTvfsvt6WwJeo7KwcHbFnevZVCsXhDmjFiGVuwqFQ==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0", + "svgo": "^3.2.0" + }, + "engines": { + "node": "^14 || ^16 || >= 18" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-svgo/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/postcss-svgo/node_modules/css-tree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/postcss-svgo/node_modules/csso": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", + "dev": true, + "dependencies": { + "css-tree": "~2.2.0" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/postcss-svgo/node_modules/csso/node_modules/css-tree": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/postcss-svgo/node_modules/csso/node_modules/mdn-data": { + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", + "dev": true + }, + "node_modules/postcss-svgo/node_modules/mdn-data": { + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", + "dev": true + }, + "node_modules/postcss-svgo/node_modules/svgo": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.2.0.tgz", + "integrity": "sha512-4PP6CMW/V7l/GmKRKzsLR8xxjdHTV4IMvhTnpuHwwBazSIlw5W/5SmPjN8Dwyt7lKbSJrRDgp4t9ph0HgChFBQ==", + "dev": true, + "dependencies": { + "@trysound/sax": "0.2.0", + "commander": "^7.2.0", + "css-select": "^5.1.0", + "css-tree": "^2.3.1", + "css-what": "^6.1.0", + "csso": "^5.0.5", + "picocolors": "^1.0.0" + }, + "bin": { + "svgo": "bin/svgo" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/svgo" + } + }, + "node_modules/postcss-unique-selectors": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-6.0.2.tgz", + "integrity": "sha512-8IZGQ94nechdG7Y9Sh9FlIY2b4uS8/k8kdKRX040XHsS3B6d1HrJAkXrBSsSu4SuARruSsUjW3nlSw8BHkaAYQ==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.15" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true + }, + "node_modules/postcss/node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/prebuild-install": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", + "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prebuild-install/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, + "node_modules/prebuild-install/node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/prebuild-install/node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/prebuild-install/node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI= sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/progress": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74= sha512-UdA8mJ4weIkUBO224tIarHzuHs4HuYiJvsuGT7j/SPQiUJVjYvNDBIPa0hAorduOfjGohB/qHWRa/lrrWX/mXw==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY= sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "dev": true + }, + "node_modules/pseudo-localization": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/pseudo-localization/-/pseudo-localization-2.4.0.tgz", + "integrity": "sha512-ISYMOKY8+f+PmiXMFw2y6KLY74LBrv/8ml/VjjoVEV2k+MS+OJZz7ydciK5ntJwxPrKQPTU1+oXq9Mx2b0zEzg==", + "dev": true, + "dependencies": { + "flat": "^5.0.2", + "get-stdin": "^7.0.0", + "typescript": "^4.7.4", + "yargs": "^17.2.1" + }, + "bin": { + "pseudo-localization": "bin/pseudo-localize" + } + }, + "node_modules/pseudo-localization/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM= sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", + "dev": true + }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "node_modules/pump": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.2.tgz", + "integrity": "sha1-Oz7mUS+U8OV1U4wXmV+fFpkKXVE= sha512-0l9Rf87wCGXiNCxHxjixpBTPa0iLYFp6an+fwXp7Yz6Fxyhdo7YiBsV76yqzwajT/2+XjKdiCaCDVIcvyEHqCA==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "dependencies": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "node_modules/pumpify/node_modules/pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "node_modules/queue": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/queue/-/queue-3.1.0.tgz", + "integrity": "sha1-bEnQHwCeIlZ4h4nyv/rGuLmZBYU= sha512-z3XqdkYJ/YVQuAAoAKLcePEk2BZDMZR2jv2hTrpQb0K5M0dUbiwADr48N1F63M4ChD/GwPc/LeaA9VC5dJFfTA==", + "dev": true, + "dependencies": { + "inherits": "~2.0.0" + } + }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "dev": true + }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo= sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/rcedit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/rcedit/-/rcedit-1.1.0.tgz", + "integrity": "sha512-JkXJ0IrUcdupLoIx6gE4YcFaMVSGtu7kQf4NJoDJUnfBZGuATmJ2Yal2v55KTltp+WV8dGr7A0RtOzx6jmtM6Q==", + "dev": true + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", + "dev": true, + "dependencies": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", + "dev": true, + "dependencies": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg-up/node_modules/load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg-up/node_modules/parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", + "dev": true, + "dependencies": { + "error-ex": "^1.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg-up/node_modules/path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", + "dev": true, + "dependencies": { + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg-up/node_modules/path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg-up/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg-up/node_modules/read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", + "dev": true, + "dependencies": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg-up/node_modules/strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", + "dev": true, + "dependencies": { + "is-utf8": "^0.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg/node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true, + "engines": { + "node": ">=6.5.0" + } + }, + "node_modules/remove-bom-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/remove-bom-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM= sha512-wigO8/O08XHb8YPzpDDT+QmRANfW6vLqxfaXm1YXhnFf3AkSLyjfG3GEFg4McZkmgL7KvCj5u2KczkvSP6NfHA==", + "dev": true, + "dependencies": { + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/remove-bom-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/remove-bom-stream/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8= sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==", + "dev": true + }, + "node_modules/repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc= sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/replace-ext": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-2.0.0.tgz", + "integrity": "sha512-UszKE5KVK6JvyD92nzMn9cDapSk6w/CaFZ96CnmDMUqH9oowfxF/ZjRITD25H4DnOQClLA4/j7jLGXXLVKxAug==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/replace-homedir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", + "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw= sha512-CHPV/GAglbIB1tnQgaiysb8H2yCy8WQ7lcEwQ/eT+kLj0QHV8LnJW0zpqpE7RSkrMSRoa+EBoag86clf7WAgSg==", + "dev": true, + "dependencies": { + "homedir-polyfill": "^1.0.1", + "is-absolute": "^1.0.0", + "remove-trailing-separator": "^1.1.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/replacestream": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/replacestream/-/replacestream-4.0.3.tgz", + "integrity": "sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.3", + "object-assign": "^4.0.1", + "readable-stream": "^2.0.2" + } + }, + "node_modules/replacestream/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/replacestream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I= sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, + "node_modules/resolve": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "dev": true + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", + "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE= sha512-NYDgziiroVeDC29xq7bp/CacZERYsA9bXYd1ZmcJlF3BcrZv5pTb4NG7SjdyKDnXZ84aC4vo2u6sNKIA1LCu/A==", + "dev": true, + "dependencies": { + "value-or-function": "^3.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/resolve-path": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve-path/-/resolve-path-1.4.0.tgz", + "integrity": "sha1-xL2p9e+y/OZSR4c6s2u02DT+Fvc= sha512-i1xevIst/Qa+nA9olDxLWnLk8YZbi8R/7JPbCMcgyWaFR6bKWaexgJgEB5oc2PKMjYdrHynyz0NY+if+H98t1w==", + "dev": true, + "dependencies": { + "http-errors": "~1.6.2", + "path-is-absolute": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/resolve-path/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/resolve-path/node_modules/http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/resolve-path/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "dev": true + }, + "node_modules/resolve-path/node_modules/setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + }, + "node_modules/resolve-path/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "dev": true + }, + "node_modules/responselike": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", + "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", + "dev": true, + "dependencies": { + "lowercase-keys": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "node_modules/ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/roarr": { + "version": "2.15.4", + "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", + "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", + "dev": true, + "optional": true, + "dependencies": { + "boolean": "^3.0.1", + "detect-node": "^2.0.4", + "globalthis": "^1.0.1", + "json-stringify-safe": "^5.0.1", + "semver-compare": "^1.0.0", + "sprintf-js": "^1.1.2" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/run-parallel": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/rxjs": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", + "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/rxjs/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4= sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", + "dev": true, + "dependencies": { + "ret": "~0.1.10" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "node_modules/schema-utils": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", + "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.8.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.0.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/schema-utils/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/schema-utils/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w= sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", + "dev": true, + "optional": true + }, + "node_modules/semver-greatest-satisfied-range": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", + "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els= sha512-Ny/iyOzSSa8M5ML46IAx3iXc6tfOsYU2R4AXi2UpHk60Zrgyq6eqPj/xiOfS0rRl/iiQ/rdJkVjw/5cdUyCntQ==", + "dev": true, + "dependencies": { + "sver-compat": "^1.5.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/serialize-error": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", + "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", + "dev": true, + "optional": true, + "dependencies": { + "type-fest": "^0.13.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/serialize-error/node_modules/type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc= sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-value/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-value/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-value/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shallow-clone/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", + "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", + "dev": true + }, + "node_modules/sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA= sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/sinon": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-12.0.1.tgz", + "integrity": "sha512-iGu29Xhym33ydkAT+aNQFBINakjq69kKO6ByPvTsm3yyIACfyQttRTP03aBP/I8GfhFmLzrnKwNNkr0ORb1udg==", + "deprecated": "16.1.1", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.8.3", + "@sinonjs/fake-timers": "^8.1.0", + "@sinonjs/samsam": "^6.0.2", + "diff": "^5.0.0", + "nise": "^5.1.0", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + } + }, + "node_modules/sinon-test": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/sinon-test/-/sinon-test-3.1.3.tgz", + "integrity": "sha512-jBDvPVW2z8uAoiud3Nqc6+e8+WX6UTB1gPQuYXK00mSnp9m/JYyeLdBjLlqbnk1DVmsgRCAHSoXYPNLHp0t56Q==", + "dev": true, + "peerDependencies": { + "sinon": "2.x - 13.x" + } + }, + "node_modules/sinon/node_modules/@sinonjs/fake-timers": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz", + "integrity": "sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.7.0" + } + }, + "node_modules/sinon/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/sinon/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/slice-ansi/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/slice-ansi/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "dependencies": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "dependencies": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY= sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "dependencies": { + "kind-of": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/snapdragon/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", + "deprecated": "Please upgrade to v0.1.7", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", + "deprecated": "Please upgrade to v0.1.5", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/snapdragon/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", + "dev": true, + "dependencies": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "node_modules/socks": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", + "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "dependencies": { + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-resolve": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", + "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", + "dev": true, + "dependencies": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0" + } + }, + "node_modules/source-map-support": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.3.3.tgz", + "integrity": "sha1-NJAJd9W6PwfHdX7nLnO7GptTdU8= sha512-9O4+y9n64RewmFoKUZ/5Tx9IHIcXM6Q+RTSw6ehnqybUz4a7iwR3Eaw80uLtqqQ5D0C+5H03D4KKGo9PdP33Gg==", + "dev": true, + "dependencies": { + "source-map": "0.1.32" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.1.32", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz", + "integrity": "sha1-yLbBZ3l7pHQKjqMyUhYv8IWRsmY= sha512-htQyLrrRLkQ87Zfrir4/yN+vAUd6DNjVayEjTSHXu29AYQJw57I4/xEL/M6p6E/woPNJwvZt6rVlzc7gFEJccQ==", + "dev": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= sha512-liJwHPI9x9d9w5WSIjM58MqGmmb7XzNqwdUA3kSBQ4lmDngexlKwawGzK3J1mKXi6+sysoMDlpVyZh9sv5vRfw==", + "deprecated": "See https://github.com/lydell/source-map-url#deprecated", + "dev": true + }, + "node_modules/sparkles": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", + "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "node_modules/split": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8= sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==", + "dev": true, + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" + }, + "node_modules/stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", + "deprecated": "Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility", + "dev": true + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==", + "dev": true, + "dependencies": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", + "deprecated": "Please upgrade to v0.1.7", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", + "deprecated": "Please upgrade to v0.1.5", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "dev": true, + "dependencies": { + "bl": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stdin-discarder/node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dev": true, + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/stdin-discarder/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/stream-combiner": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ= sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==", + "dev": true, + "dependencies": { + "duplexer": "~0.1.1" + } + }, + "node_modules/stream-exhaust": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", + "dev": true + }, + "node_modules/stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "node_modules/stream-to-array": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/stream-to-array/-/stream-to-array-2.3.0.tgz", + "integrity": "sha1-u/azn19D7DC8cbq8s3VXrOzzQ1M= sha512-UsZtOYEn4tWU2RGLOXr/o/xjRBftZRlG3dEWoaHr8j4GuypJ3isitGbVyjQKAuMu+xbiop8q224TjiZWc4XTZA==", + "dev": true, + "dependencies": { + "any-promise": "^1.1.0" + } + }, + "node_modules/streamfilter": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-1.0.5.tgz", + "integrity": "sha1-h1BxEb644phFFxe1Ec/tjwAqv1M= sha512-IHuyNEAPs3pi2ABhJ7Dbjza9Gc6Nq7NDvx14tsKw4h4cMUz4YoLOON6nghUvIZVO4NW4qvYUoED1kd6/bipTVQ==", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.2" + } + }, + "node_modules/streamfilter/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/streamifier": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/streamifier/-/streamifier-0.1.1.tgz", + "integrity": "sha1-l+mNj6TRBdYqJpHR3AfoINuN/E8= sha512-zDgl+muIlWzXNsXeyUfOk9dChMjlpkq0DRsxujtYPgyJ676yQ8jEm6zzaaWHFDg5BNcLuif0eD2MTyJdZqXpdg==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/streamx": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.18.0.tgz", + "integrity": "sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ==", + "dev": true, + "dependencies": { + "fast-fifo": "^1.3.2", + "queue-tick": "^1.0.1", + "text-decoder": "^1.1.0" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-width": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", + "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^10.2.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=16" + }, + "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.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "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.padend": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.1.tgz", + "integrity": "sha512-eCzTASPnoCr5Ht+Vn1YXgm8SB015hHKgEIMu9Nr9bQmLhRBxKRfmzSj/IQsxDFc8JInJDDFA0qXwK+xxI7wDkg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", + "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", + "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/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-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", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI= sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/style-loader": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.2.tgz", + "integrity": "sha512-RHs/vcrKdQK8wZliteNK4NKzxvLBzpuHMqYmUVWeKa6MkaIQ97ZTOS0b+zapZhy6GcrgWnvWYCMHRirC3FsUmw==", + "dev": true, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + } + }, + "node_modules/stylehacks": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-6.0.2.tgz", + "integrity": "sha512-00zvJGnCu64EpMjX8b5iCZ3us2Ptyw8+toEkb92VdmkEaRaSGBNKAoK6aWZckhXxmQP8zWiTaFaiMGIU8Ve8sg==", + "dev": true, + "dependencies": { + "browserslist": "^4.22.2", + "postcss-selector-parser": "^6.0.15" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/sumchecker": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", + "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", + "dev": true, + "dependencies": { + "debug": "^4.1.0" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/supports-color": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", + "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sver-compat": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", + "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg= sha512-aFTHfmjwizMNlNE6dsGmoAM4lHjL0CyiobWaFiXWSlD7cIxshW422Nb8KbXCmR6z+0ZEPY+daXJrDyh/vuwTyg==", + "dev": true, + "dependencies": { + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/svgo": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", + "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "dev": true, + "dependencies": { + "@trysound/sax": "0.2.0", + "commander": "^7.2.0", + "css-select": "^4.1.3", + "css-tree": "^1.1.3", + "csso": "^4.2.0", + "picocolors": "^1.0.0", + "stable": "^0.1.8" + }, + "bin": { + "svgo": "bin/svgo" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/svgo/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/svgo/node_modules/css-select": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.2.1.tgz", + "integrity": "sha512-/aUslKhzkTNCQUB2qTX84lVmfia9NyjP3WpDGtj/WxhwBzWBYUV3DgUpurHTme8UTPcPlAD1DJ+b0nN/t50zDQ==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^5.1.0", + "domhandler": "^4.3.0", + "domutils": "^2.8.0", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/svgo/node_modules/css-what": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.1.0.tgz", + "integrity": "sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/svgo/node_modules/dom-serializer": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", + "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==", + "dev": true, + "dependencies": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/svgo/node_modules/domhandler": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.0.tgz", + "integrity": "sha512-fC0aXNQXqKSFTr2wDNZDhsEYjCiYsDWl3D01kwt25hm1YIPyDGHvvi3rw+PLqHAl/m71MaiF7d5zvBr0p5UB2g==", + "dev": true, + "dependencies": { + "domelementtype": "^2.2.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/svgo/node_modules/domutils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", + "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", + "dev": true, + "dependencies": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/svgo/node_modules/entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "dev": true, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "dependencies": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/table/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/table/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/table/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/table/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/table/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tapable": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", + "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar-fs": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", + "integrity": "sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==", + "dev": true, + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^2.1.1", + "bare-path": "^2.1.0" + } + }, + "node_modules/tar-fs/node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/tar-stream": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", + "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", + "dev": true, + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/tas-client-umd": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/tas-client-umd/-/tas-client-umd-0.2.0.tgz", + "integrity": "sha512-oezN7mJVm5qZDVEby7OzxCLKUpUN5of0rY4dvOWaDF2JZBlGpd3BXceFN8B53qlTaIkVSzP65aAMT0Vc+/N25Q==" + }, + "node_modules/teex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz", + "integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==", + "dev": true, + "dependencies": { + "streamx": "^2.12.5" + } + }, + "node_modules/temp": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.4.tgz", + "integrity": "sha512-s0ZZzd0BzYv5tLSptZooSjK8oj6C+c19p7Vqta9+6NPOf7r+fxq0cJe6/oN4LTC79sy5NY8ucOJNgwsKCSbfqg==", + "dev": true, + "dependencies": { + "rimraf": "~2.6.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/terser": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.0.tgz", + "integrity": "sha512-Y/SblUl5kEyEFzhMAQdsxVHh+utAxd4IuRNJzKywY/4uzSogh3G219jqbDDxYu4MXO9CzY3tSEqmZvW6AoEDJw==", + "dev": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.20", + "jest-worker": "^27.4.5", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.1", + "terser": "^5.26.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/terser-webpack-plugin/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/terser-webpack-plugin/node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/terser/node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/text-decoder": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.1.0.tgz", + "integrity": "sha512-TmLJNj6UgX8xcUZo4UDStGQtDiTzF7BzWlzn9g7UWrjkpHr5uJTK1ld16wZ3LXb2vb6jH8qU89dW5whuMdXYdw==", + "dev": true, + "dependencies": { + "b4a": "^1.6.4" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/textextensions": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-1.0.2.tgz", + "integrity": "sha1-ZUhjk+4fK7A5pgy7oFsLaL2VAdI= sha512-jm9KjEWiDmtGLBrTqXEduGzlYTTlPaoDKdq5YRQhD0rYjo61ZNTYKZ/x5J4ajPSBH9wIYY5qm9GNG5otIKjtOA==", + "dev": true + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true + }, + "node_modules/through2": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "2 || 3" + } + }, + "node_modules/through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", + "dev": true, + "dependencies": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "node_modules/through2-filter/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2-filter/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= sha512-gLCeArryy2yNTRzTGKbZbloctj64jkZ57hj5zdraXue6aFgd6PmvVtEyiUU+hvU0v7q08oVv8r8ev0tRo6bvgw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "dev": true, + "dependencies": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, + "node_modules/to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs= sha512-rtwLUQEwT8ZeKQbyFJyomBRYXyE16U5VKuy0ftxLMK/PZb2fkOsg5r9kHdauuVDbsNdIBoC/HCthpidamQFXYA==", + "dev": true, + "dependencies": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-object-path/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "dependencies": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/to-through": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", + "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY= sha512-+QIz37Ly7acM4EMdw2PRN389OneM5+d844tirkGp4dPKzI5OE72V9OsbFp+CIYJDahZ41ZV05hNtcPAQUAm9/Q==", + "dev": true, + "dependencies": { + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/to-through/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/to-through/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tough-cookie": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "dev": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tough-cookie/node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/tough-cookie/node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/ts-loader": { + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", + "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "typescript": "*", + "webpack": "^5.0.0" + } + }, + "node_modules/ts-morph": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-19.0.0.tgz", + "integrity": "sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ==", + "dev": true, + "dependencies": { + "@ts-morph/common": "~0.20.0", + "code-block-writer": "^12.0.0" + } + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/tsec": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/tsec/-/tsec-0.2.7.tgz", + "integrity": "sha512-Pj9DuBBWLEo8p7QsbrEdXzW/u6QJBcib0ZGOTXkeSDx+PLXFY7hwyZE9Tfhp3TA3LQNpYouyT0WmzXRyUW4otQ==", + "dev": true, + "dependencies": { + "glob": "^7.1.1", + "minimatch": "^3.0.3" + }, + "bin": { + "tsec": "bin/tsec" + }, + "peerDependencies": { + "@bazel/bazelisk": ">=1.7.5", + "@bazel/concatjs": ">=5.3.0", + "typescript": ">=3.9.2" + } + }, + "node_modules/tsec/node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "dev": true + }, + "node_modules/tsscmp": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", + "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==", + "dev": true, + "engines": { + "node": ">=0.6.x" + } + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "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==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true + }, + "node_modules/unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo= sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/undertaker": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz", + "integrity": "sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "bach": "^1.0.0", + "collection-map": "^1.0.0", + "es6-weak-map": "^2.0.1", + "fast-levenshtein": "^1.0.0", + "last-run": "^1.1.0", + "object.defaults": "^1.0.0", + "object.reduce": "^1.0.0", + "undertaker-registry": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/undertaker-registry": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA= sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/undertaker/node_modules/fast-levenshtein": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz", + "integrity": "sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk= sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw==", + "dev": true + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/union-value/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unique-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", + "dev": true, + "dependencies": { + "json-stable-stringify-without-jsonify": "^1.0.1", + "through2-filter": "^3.0.0" + } + }, + "node_modules/universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==", + "dev": true, + "dependencies": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", + "dev": true, + "dependencies": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", + "dev": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E= sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true, + "engines": { + "node": ">=4", + "yarn": "*" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/uri-js/node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "dev": true + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/v8-inspect-profiler": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/v8-inspect-profiler/-/v8-inspect-profiler-0.1.1.tgz", + "integrity": "sha512-GB3X9w7w+y9v4gq85olmf/bM3F2hj2DjjwvVpDXIziW5JBy8cDcIQ/K7m8xJVDWiFemxRX2Dxoo1k6JDvLMTig==", + "dependencies": { + "chrome-remote-interface": "^0.33.0" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/v8flags": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "dev": true, + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/value-or-function": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", + "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM= sha512-jdBB2FrWvQC/pnPtIqcLsMaQgjhdb6B7tk1MMyTKapox+tQZbdRP4uLxu/JY0t7fbfDCUMnuelzEYv5GsxHhdg==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vinyl": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-3.0.0.tgz", + "integrity": "sha512-rC2VRfAVVCGEgjnxHUnpIVh3AGuk62rP3tqVrn+yab0YH7UULisC085+NYH+mnqf3Wx4SpSi1RQMwudL89N03g==", + "dev": true, + "dependencies": { + "clone": "^2.1.2", + "clone-stats": "^1.0.0", + "remove-trailing-separator": "^1.1.0", + "replace-ext": "^2.0.0", + "teex": "^1.0.1" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "dev": true, + "dependencies": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-fs/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/vinyl-fs/node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-fs/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/vinyl-fs/node_modules/vinyl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", + "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw= sha512-M5D/ZRG7KC3ETrV7iA/GNF/lznml4dZ7ggwtYbqM/B+0INyNTjCdFhw4TqMq//PtNbPpceE7wOqKqK5YfUThPA==", + "dev": true, + "dependencies": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-sourcemap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY= sha512-NiibMgt6VJGJmyw7vtzhctDcfKch4e4n9TBeoWlirb7FMg9/1Ov9k+A5ZRAtywBpRPiyECvQRQllYM8dECegVA==", + "dev": true, + "dependencies": { + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-sourcemap/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/vinyl-sourcemap/node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-sourcemap/node_modules/vinyl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", + "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw= sha512-M5D/ZRG7KC3ETrV7iA/GNF/lznml4dZ7ggwtYbqM/B+0INyNTjCdFhw4TqMq//PtNbPpceE7wOqKqK5YfUThPA==", + "dev": true, + "dependencies": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==" + }, + "node_modules/vscode-regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/vscode-regexpp/-/vscode-regexpp-3.1.0.tgz", + "integrity": "sha512-pqtN65VC1jRLawfluX4Y80MMG0DHJydWhe5ZwMHewZD6sys4LbU6lHwFAHxeuaVE6Y6+xZOtAw+9hvq7/0ejkg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/vscode-textmate": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-9.1.0.tgz", + "integrity": "sha512-lxKSVp2DkFOx9RDAvpiYUrB9/KT1fAfi1aE8CBGstP8N7rLF+Seifj8kDA198X0mYj1CjQUC+81+nQf8CO0nVA==" + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==", + "dev": true + }, + "node_modules/watchpack": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz", + "integrity": "sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==", + "dev": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/web-tree-sitter": { + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.20.8.tgz", + "integrity": "sha512-weOVgZ3aAARgdnb220GqYuh7+rZU0Ka9k9yfKtGAzEYMa6GgiCzW9JjQRJyCJakvibQW+dfjJdihjInKuuCAUQ==", + "dev": true + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/webpack": { + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", + "acorn": "^8.7.1", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-cli": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", + "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", + "dev": true, + "dependencies": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^2.1.1", + "@webpack-cli/info": "^2.0.2", + "@webpack-cli/serve": "^2.0.5", + "colorette": "^2.0.14", + "commander": "^10.0.1", + "cross-spawn": "^7.0.3", + "envinfo": "^7.7.3", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^3.1.1", + "rechoir": "^0.8.0", + "webpack-merge": "^5.7.3" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "5.x.x" + }, + "peerDependenciesMeta": { + "@webpack-cli/generators": { + "optional": true + }, + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/webpack-cli/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/webpack-cli/node_modules/interpret": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack-cli/node_modules/rechoir": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "dev": true, + "dependencies": { + "resolve": "^1.20.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/webpack-merge": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", + "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", + "dev": true, + "dependencies": { + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack-stream": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webpack-stream/-/webpack-stream-7.0.0.tgz", + "integrity": "sha512-XoAQTHyCaYMo6TS7Atv1HYhtmBgKiVLONJbzLBl2V3eibXQ2IT/MCRM841RW/r3vToKD5ivrTJFWgd/ghoxoRg==", + "dev": true, + "dependencies": { + "fancy-log": "^1.3.3", + "lodash.clone": "^4.3.2", + "lodash.some": "^4.2.2", + "memory-fs": "^0.5.0", + "plugin-error": "^1.0.1", + "supports-color": "^8.1.1", + "through": "^2.3.8", + "vinyl": "^2.2.1" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "webpack": "^5.21.2" + } + }, + "node_modules/webpack-stream/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/webpack-stream/node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/webpack-stream/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/webpack-stream/node_modules/vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "dependencies": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/webpack/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/webpack/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/webpack/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0= sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", + "dev": true + }, + "node_modules/which-typed-array": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, + "node_modules/windows-foreground-love": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/windows-foreground-love/-/windows-foreground-love-0.5.0.tgz", + "integrity": "sha512-yjBwmKEmQBDk3Z7yg/U9hizGWat8C6Pe4MQWl5bN6mvPU81Bt6HV2k/6mGlK3ETJLW1hCLhYx2wcGh+ykUUCyA==", + "hasInstallScript": true, + "optional": true + }, + "node_modules/word-wrap": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true + }, + "node_modules/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": { + "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/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/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/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/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "dependencies": { + "mkdirp": "^0.5.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/write/node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true + }, + "node_modules/xml2js": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", + "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", + "dev": true, + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xml2js/node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", + "dev": true + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/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/yargs/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/yaserver": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/yaserver/-/yaserver-0.4.0.tgz", + "integrity": "sha512-98Vj4sgqB1fLcpf2wK7h3dFCaabISHU9CXZHaAx3QLkvTTCD31MzMcNbw5V5jZFBK7ffkFqfWig6B20KQt4wtA==", + "dev": true, + "bin": { + "yaserver": "bin/yaserver" + } + }, + "node_modules/yauzl": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-3.1.1.tgz", + "integrity": "sha512-MPxA7oN5cvGV0wzfkeHKF2/+Q4TkMpHSWGRy/96I4Cozljmx0ph91+Muxh6HegEtDC4GftJ8qYDE51vghFiEYA==", + "dependencies": { + "buffer-crc32": "~0.2.3", + "pend": "~1.2.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yazl": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.4.3.tgz", + "integrity": "sha1-7CblzIfVYBud+EMtvdPNLlFzoHE= sha512-cIUrm3/81iF/BzuyORI7ppz1vGHAhA62JYzAFFC+rwJ2jQF1LcYxY9UXx4XyUXojkCnol0SvPuc+Toc7FO4W8g==", + "dependencies": { + "buffer-crc32": "~0.2.3" + } + }, + "node_modules/ylru": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.2.1.tgz", + "integrity": "sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json index e5374d6d30e..19f589aeb66 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", - "version": "1.91.0", - "distro": "951ec3be152d660cf34920fc3d734d32691bd880", + "version": "1.94.0", + "distro": "ec2b3389b77fdd0b0220a2a1b1136fad81583843", "author": { "name": "Microsoft Corporation" }, @@ -11,32 +11,37 @@ "scripts": { "test": "echo Please run any of the test scripts from the scripts folder.", "test-browser": "npx playwright install && node test/unit/browser/index.js", + "test-browser-amd": "npx playwright install && node test/unit/browser/index.amd.js", "test-browser-no-install": "node test/unit/browser/index.js", - "test-node": "mocha test/unit/node/index.js --delay --ui=tdd --timeout=5000 --exit", + "test-browser-amd-no-install": "node test/unit/browser/index.amd.js", + "test-node": "mocha test/unit/node/index.mjs --delay --ui=tdd --timeout=5000 --exit", + "test-node-amd": "mocha test/unit/node/index.amd.js --delay --ui=tdd --timeout=5000 --exit", "test-extension": "vscode-test", "preinstall": "node build/npm/preinstall.js", "postinstall": "node build/npm/postinstall.js", - "compile": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js compile", + "compile": "node ./node_modules/gulp/bin/gulp.js compile", "watch": "npm-run-all -lp watch-client watch-extensions", - "watchd": "deemon yarn watch", - "watch-webd": "deemon yarn watch-web", - "kill-watchd": "deemon --kill yarn watch", - "kill-watch-webd": "deemon --kill yarn watch-web", - "restart-watchd": "deemon --restart yarn watch", - "restart-watch-webd": "deemon --restart yarn watch-web", - "watch-client": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-client", - "watch-clientd": "deemon yarn watch-client", - "kill-watch-clientd": "deemon --kill yarn watch-client", - "watch-extensions": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-extensions watch-extension-media", - "watch-extensionsd": "deemon yarn watch-extensions", - "kill-watch-extensionsd": "deemon --kill yarn watch-extensions", + "watch-amd": "npm-run-all -lp watch-client-amd watch-extensions", + "watchd": "deemon npm run watch", + "watch-webd": "deemon npm run watch-web", + "kill-watchd": "deemon --kill npm run watch", + "kill-watch-webd": "deemon --kill npm run watch-web", + "restart-watchd": "deemon --restart npm run watch", + "restart-watch-webd": "deemon --restart npm run watch-web", + "watch-client": "node --max-old-space-size=8192 ./node_modules/gulp/bin/gulp.js watch-client", + "watch-client-amd": "node --max-old-space-size=8192 ./node_modules/gulp/bin/gulp.js watch-client-amd", + "watch-clientd": "deemon npm run watch-client", + "kill-watch-clientd": "deemon --kill npm run watch-client", + "watch-extensions": "node --max-old-space-size=8192 ./node_modules/gulp/bin/gulp.js watch-extensions watch-extension-media", + "watch-extensionsd": "deemon npm run watch-extensions", + "kill-watch-extensionsd": "deemon --kill npm run watch-extensions", "precommit": "node build/hygiene.js", "gulp": "node --max-old-space-size=8192 ./node_modules/gulp/bin/gulp.js", "electron": "node build/lib/electron", "7z": "7z", "update-grammars": "node build/npm/update-all-grammars.mjs", "update-localization-extension": "node build/npm/update-localization-extension.js", - "smoketest": "node build/lib/preLaunch.js && cd test/smoke && yarn compile && node test/index.js", + "smoketest": "node build/lib/preLaunch.js && cd test/smoke && npm run compile && node test/index.js", "smoketest-no-compile": "cd test/smoke && node test/index.js", "download-builtin-extensions": "node build/lib/builtInExtensions.js", "download-builtin-extensions-cg": "node build/lib/builtInExtensionsCG.js", @@ -45,71 +50,73 @@ "vscode-dts-compile-check": "tsc -p src/tsconfig.vscode-dts.json && tsc -p src/tsconfig.vscode-proposed-dts.json", "valid-layers-check": "node build/lib/layersChecker.js", "update-distro": "node build/npm/update-distro.mjs", - "web": "echo 'yarn web' is replaced by './scripts/code-server' or './scripts/code-web'", + "web": "echo 'npm run web' is replaced by './scripts/code-server' or './scripts/code-web'", "compile-cli": "gulp compile-cli", - "compile-web": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js compile-web", - "watch-web": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-web", - "watch-cli": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-cli", + "compile-web": "node ./node_modules/gulp/bin/gulp.js compile-web", + "watch-web": "node ./node_modules/gulp/bin/gulp.js watch-web", + "watch-cli": "node ./node_modules/gulp/bin/gulp.js watch-cli", "eslint": "node build/eslint", "stylelint": "node build/stylelint", - "playwright-install": "node build/azure-pipelines/common/installPlaywright.js", - "compile-build": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js compile-build", - "compile-extensions-build": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js compile-extensions-build", - "minify-vscode": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js minify-vscode", - "minify-vscode-reh": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js minify-vscode-reh", - "minify-vscode-reh-web": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js minify-vscode-reh-web", - "hygiene": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js hygiene", - "core-ci": "node --max-old-space-size=8095 ./node_modules/gulp/bin/gulp.js core-ci", - "core-ci-pr": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js core-ci-pr", - "extensions-ci": "node --max-old-space-size=8095 ./node_modules/gulp/bin/gulp.js extensions-ci", - "extensions-ci-pr": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js extensions-ci-pr", + "playwright-install": "npm exec playwright install", + "compile-build": "node ./node_modules/gulp/bin/gulp.js compile-build", + "compile-extensions-build": "node ./node_modules/gulp/bin/gulp.js compile-extensions-build", + "minify-vscode": "node ./node_modules/gulp/bin/gulp.js minify-vscode", + "minify-vscode-reh": "node ./node_modules/gulp/bin/gulp.js minify-vscode-reh", + "minify-vscode-reh-web": "node ./node_modules/gulp/bin/gulp.js minify-vscode-reh-web", + "hygiene": "node ./node_modules/gulp/bin/gulp.js hygiene", + "core-ci": "node ./node_modules/gulp/bin/gulp.js core-ci", + "core-ci-pr": "node ./node_modules/gulp/bin/gulp.js core-ci-pr", + "extensions-ci": "node ./node_modules/gulp/bin/gulp.js extensions-ci", + "extensions-ci-pr": "node ./node_modules/gulp/bin/gulp.js extensions-ci-pr", "perf": "node scripts/code-perf.js", - "update-build-ts-version": "yarn add typescript@next && tsc -p ./build/tsconfig.build.json" + "update-build-ts-version": "npm install typescript@next && tsc -p ./build/tsconfig.build.json" }, "dependencies": { - "@floating-ui/dom": "^1.6.10", "@microsoft/1ds-core-js": "^3.2.13", "@microsoft/1ds-post-js": "^3.2.13", "@parcel/watcher": "2.1.0", + "@bpasero/watcher": "https://github.com/bpasero/watcher.git#3e5e50c275590703f3eb46fac777b720e515d0d5", "@vscode/deviceid": "^0.1.1", "@vscode/iconv-lite-umd": "0.7.0", "@vscode/policy-watcher": "^1.1.4", - "@vscode/proxy-agent": "^0.20.0", + "@vscode/proxy-agent": "^0.23.0", "@vscode/ripgrep": "^1.15.9", "@vscode/spdlog": "^0.15.0", "@vscode/sqlite3": "5.1.6-vscode", "@vscode/sudo-prompt": "9.3.1", + "@vscode/tree-sitter-wasm": "^0.0.3", "@vscode/vscode-languagedetection": "1.0.21", "@vscode/windows-mutex": "^0.5.0", "@vscode/windows-process-tree": "^0.6.0", "@vscode/windows-registry": "^1.1.0", - "@xterm/addon-clipboard": "0.2.0-beta.4", - "@xterm/addon-image": "0.9.0-beta.21", - "@xterm/addon-search": "0.16.0-beta.21", - "@xterm/addon-serialize": "0.14.0-beta.21", - "@xterm/addon-unicode11": "0.9.0-beta.21", - "@xterm/addon-webgl": "0.19.0-beta.21", - "@xterm/headless": "5.6.0-beta.21", - "@xterm/xterm": "5.6.0-beta.21", + "@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", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.2", - "jschardet": "3.1.2", - "kerberos": "^2.0.1", + "jschardet": "3.1.3", + "kerberos": "2.1.1", "minimist": "^1.2.6", "native-is-elevated": "0.7.0", "native-keymap": "^3.3.5", "native-watchdog": "^1.4.1", - "node-pty": "1.1.0-beta11", + "node-pty": "1.1.0-beta21", + "open": "^8.4.2", "tas-client-umd": "0.2.0", "v8-inspect-profiler": "^0.1.1", "vscode-oniguruma": "1.7.0", "vscode-regexpp": "^3.1.0", - "vscode-textmate": "9.0.0", + "vscode-textmate": "9.1.0", "yauzl": "^3.0.0", "yazl": "^2.4.3" }, "devDependencies": { - "@playwright/test": "^1.40.1", + "@playwright/test": "^1.46.1", "@swc/core": "1.3.62", "@types/cookie": "^0.3.3", "@types/debug": "^4.1.5", @@ -136,10 +143,11 @@ "@vscode/l10n-dev": "0.0.35", "@vscode/telemetry-extractor": "^1.10.2", "@vscode/test-cli": "^0.0.6", - "@vscode/test-electron": "^2.3.8", - "@vscode/test-web": "^0.0.50", + "@vscode/test-electron": "^2.4.0", + "@vscode/test-web": "^0.0.60", "@vscode/v8-heap-parser": "^0.1.0", "@vscode/vscode-perf": "^0.0.14", + "@webgpu/types": "^0.1.44", "ansi-colors": "^3.2.3", "asar": "^3.0.3", "chromium-pickle-js": "^0.2.0", @@ -149,7 +157,7 @@ "cssnano": "^6.0.3", "debounce": "^1.0.0", "deemon": "^1.8.0", - "electron": "29.4.0", + "electron": "30.5.0", "eslint": "8.36.0", "eslint-plugin-header": "3.1.1", "eslint-plugin-jsdoc": "^46.5.0", @@ -187,7 +195,6 @@ "mime": "^1.4.1", "minimatch": "^3.0.4", "minimist": "^1.2.6", - "mkdirp": "^1.0.4", "mocha": "^10.2.0", "mocha-junit-reporter": "^2.2.1", "mocha-multi-reporters": "^1.5.1", @@ -195,6 +202,7 @@ "opn": "^6.0.0", "p-all": "^1.0.0", "path-browserify": "^1.0.1", + "os-browserify": "^0.3.0", "postcss": "^8.4.33", "postcss-nesting": "^12.0.2", "pump": "^1.0.1", @@ -208,16 +216,16 @@ "ts-loader": "^9.4.2", "ts-node": "^10.9.1", "tsec": "0.2.7", - "typescript": "^5.6.0-dev.20240618", + "tslib": "^2.6.3", + "typescript": "^5.7.0-dev.20240903", "util": "^0.12.4", - "vscode-nls-dev": "^3.3.1", - "webpack": "^5.91.0", + "webpack": "^5.94.0", "webpack-cli": "^5.1.4", "webpack-stream": "^7.0.0", "xml2js": "^0.5.0", "yaserver": "^0.4.0" }, - "resolutions": { + "overrides": { "node-gyp-build": "4.8.1" }, "repository": { diff --git a/product.json b/product.json index d2d3bf7a361..908be250245 100644 --- a/product.json +++ b/product.json @@ -34,8 +34,8 @@ "builtInExtensions": [ { "name": "ms-vscode.js-debug-companion", - "version": "1.1.2", - "sha256": "e034b8b41beb4e97e02c70f7175bd88abe66048374c2bd629f54bb33354bc2aa", + "version": "1.1.3", + "sha256": "7380a890787452f14b2db7835dfa94de538caf358ebc263f9d46dd68ac52de93", "repo": "https://github.com/microsoft/vscode-js-debug-companion", "metadata": { "id": "99cb0b7f-7354-4278-b8da-6cc79972169d", @@ -50,8 +50,8 @@ }, { "name": "ms-vscode.js-debug", - "version": "1.90.0", - "sha256": "1317dd7d1ac50641c1534a3e957ecbc94349f4fbd897acb916da11eea3208a66", + "version": "1.93.0", + "sha256": "9339cb8e6b77f554df54d79e71f533279cb76b0f9b04c207f633bfd507442b6a", "repo": "https://github.com/microsoft/vscode-js-debug", "metadata": { "id": "25629058-ddac-4e17-abba-74678e126c5d", diff --git a/remote/.npmrc b/remote/.npmrc new file mode 100644 index 00000000000..d6905a0c0f9 --- /dev/null +++ b/remote/.npmrc @@ -0,0 +1,7 @@ +disturl="https://nodejs.org/dist" +target="20.16.0" +ms_build_id="289487" +runtime="node" +build_from_source="true" +legacy-peer-deps="true" +timeout=180000 diff --git a/remote/.yarnrc b/remote/.yarnrc deleted file mode 100644 index 4c99388e889..00000000000 --- a/remote/.yarnrc +++ /dev/null @@ -1,5 +0,0 @@ -disturl "https://nodejs.org/dist" -target "20.11.1" -ms_build_id "275039" -runtime "node" -build_from_source "true" diff --git a/remote/package-lock.json b/remote/package-lock.json new file mode 100644 index 00000000000..d889e767cdc --- /dev/null +++ b/remote/package-lock.json @@ -0,0 +1,1158 @@ +{ + "name": "vscode-reh", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vscode-reh", + "version": "0.0.0", + "dependencies": { + "@bpasero/watcher": "https://github.com/bpasero/watcher.git#3e5e50c275590703f3eb46fac777b720e515d0d5", + "@microsoft/1ds-core-js": "^3.2.13", + "@microsoft/1ds-post-js": "^3.2.13", + "@parcel/watcher": "2.1.0", + "@vscode/deviceid": "^0.1.1", + "@vscode/iconv-lite-umd": "0.7.0", + "@vscode/proxy-agent": "^0.23.0", + "@vscode/ripgrep": "^1.15.9", + "@vscode/spdlog": "^0.15.0", + "@vscode/tree-sitter-wasm": "^0.0.3", + "@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", + "cookie": "^0.4.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "jschardet": "3.1.3", + "kerberos": "2.1.1", + "minimist": "^1.2.6", + "native-watchdog": "^1.4.1", + "node-pty": "1.1.0-beta21", + "tas-client-umd": "0.2.0", + "vscode-oniguruma": "1.7.0", + "vscode-regexpp": "^3.1.0", + "vscode-textmate": "9.1.0", + "yauzl": "^3.0.0", + "yazl": "^2.4.3" + } + }, + "node_modules/@bpasero/watcher": { + "version": "2.4.2-alpha.0", + "resolved": "git+ssh://git@github.com/bpasero/watcher.git#3e5e50c275590703f3eb46fac777b720e515d0d5", + "integrity": "sha512-kfF+SmdrcDHkwLdnGtK0EknGv6uPhF5tBc04dJ0xkLNMcIocZAINg1+p2ZTfqwEfCbxp+djHWw37f400fKtY7g==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@bpasero/watcher/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "license": "Apache-2.0", + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/@bpasero/watcher/node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "license": "MIT" + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "3.2.13", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-3.2.13.tgz", + "integrity": "sha512-CluYTRWcEk0ObG5EWFNWhs87e2qchJUn0p2D21ZUa3PWojPZfPSBs4//WIE0MYV8Qg1Hdif2ZTwlM7TbYUjfAg==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "2.8.15", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "3.2.13", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-3.2.13.tgz", + "integrity": "sha512-HgS574fdD19Bo2vPguyznL4eDw7Pcm1cVNpvbvBLWiW3x4e1FCQ3VMXChWnAxCae8Hb0XqlA2sz332ZobBavTA==", + "dependencies": { + "@microsoft/1ds-core-js": "3.2.13", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "2.8.15", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.15.tgz", + "integrity": "sha512-yYAs9MyjGr2YijQdUSN9mVgT1ijI1FPMgcffpaPmYbHAVbQmF7bXudrBWHxmLzJlwl5rfep+Zgjli2e67lwUqQ==", + "dependencies": { + "@microsoft/applicationinsights-shims": "2.0.2", + "@microsoft/dynamicproto-js": "^1.1.9" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.2.tgz", + "integrity": "sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg==" + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.9.tgz", + "integrity": "sha512-n1VPsljTSkthsAFYdiWfC+DKzK2WwcRp83Y1YAqdX552BstvsDjft9YXppjUzp11BPsapDoO1LDgrDB0XVsfNQ==" + }, + "node_modules/@parcel/watcher": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.1.0.tgz", + "integrity": "sha512-8s8yYjd19pDSsBpbkOHnT6Z2+UJSuLQx61pCFM0s5wSRvKCEMDjd/cHY3/GI1szHIWbpXpsJdg3V6ISGGx9xDw==", + "hasInstallScript": true, + "dependencies": { + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^3.2.1", + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tootallnate/once": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-3.0.0.tgz", + "integrity": "sha512-OAdBVB7rlwvLD+DiecSAyVKzKVmSfXbouCyM5I6wHGi4MGXIyFqErg1IvyJ7PI1e+GYZuZh7cCHV/c4LA8SKMw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/@vscode/deviceid": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@vscode/deviceid/-/deviceid-0.1.1.tgz", + "integrity": "sha512-ErpoMeKKNYAkR1IT3zxB5RtiTqEECdh8fxggupWvzuxpTAX77hwOI2NdJ7um+vupnXRBZVx4ugo0+dVHJWUkag==", + "hasInstallScript": true, + "dependencies": { + "fs-extra": "^11.2.0", + "uuid": "^9.0.1" + } + }, + "node_modules/@vscode/iconv-lite-umd": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz", + "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==", + "dependencies": { + "@tootallnate/once": "^3.0.0", + "agent-base": "^7.0.1", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "socks-proxy-agent": "^8.0.1" + }, + "optionalDependencies": { + "@vscode/windows-ca-certs": "^0.3.1" + } + }, + "node_modules/@vscode/ripgrep": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/@vscode/ripgrep/-/ripgrep-1.15.9.tgz", + "integrity": "sha512-4q2PXRvUvr3bF+LsfrifmUZgSPmCNcUZo6SbEAZgArIChchkezaxLoIeQMJe/z3CCKStvaVKpBXLxN3Z8lQjFQ==", + "hasInstallScript": true, + "dependencies": { + "https-proxy-agent": "^7.0.2", + "proxy-from-env": "^1.1.0", + "yauzl": "^2.9.2" + } + }, + "node_modules/@vscode/ripgrep/node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/@vscode/spdlog": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@vscode/spdlog/-/spdlog-0.15.0.tgz", + "integrity": "sha512-5UFcQXM/G6bTRF49zJJJH3A3+47nxaXuKzT26vhTXVIiMFoV1oI9559mWOzapLEmvrntAdYtjE7Jh74lSAuMcA==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "mkdirp": "^1.0.4", + "node-addon-api": "7.1.0" + } + }, + "node_modules/@vscode/spdlog/node_modules/node-addon-api": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", + "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", + "engines": { + "node": "^16 || ^18 || >= 20" + } + }, + "node_modules/@vscode/tree-sitter-wasm": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@vscode/tree-sitter-wasm/-/tree-sitter-wasm-0.0.3.tgz", + "integrity": "sha512-K5YmUdohFCavPqEzG2cUPcZ6555KE1qwMDCjkvSUSz+s+8Wro2xfg+syLq90y6Tq0ZSUVvpuX6yq6ukToeGaLg==" + }, + "node_modules/@vscode/vscode-languagedetection": { + "version": "1.0.21", + "resolved": "https://registry.npmjs.org/@vscode/vscode-languagedetection/-/vscode-languagedetection-1.0.21.tgz", + "integrity": "sha512-zSUH9HYCw5qsCtd7b31yqkpaCU6jhtkKLkvOOA8yTrIRfBSOFb8PPhgmMicD7B/m+t4PwOJXzU1XDtrM9Fd3/g==", + "bin": { + "vscode-languagedetection": "cli/index.js" + } + }, + "node_modules/@vscode/windows-ca-certs": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@vscode/windows-ca-certs/-/windows-ca-certs-0.3.1.tgz", + "integrity": "sha512-1B6hZAsqg125wuMsXiKIFkBgKx/J7YR4RT/ccYGkWAToPU9MVa40PRe+evLFUmLPH6NmPohEPlCzZLbqgvHCcQ==", + "hasInstallScript": true, + "optional": true, + "os": [ + "win32" + ], + "dependencies": { + "node-addon-api": "^3.0.2" + } + }, + "node_modules/@vscode/windows-process-tree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@vscode/windows-process-tree/-/windows-process-tree-0.6.0.tgz", + "integrity": "sha512-7/DjBKKUtlmKNiAet2GRbdvfjgMKmfBeWVClIgONv8aqxGnaKca5N85eIDxh6rLMy2hKvFqIIsqgxs1Q26TWwg==", + "hasInstallScript": true, + "dependencies": { + "node-addon-api": "7.1.0" + } + }, + "node_modules/@vscode/windows-process-tree/node_modules/node-addon-api": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", + "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", + "engines": { + "node": "^16 || ^18 || >= 20" + } + }, + "node_modules/@vscode/windows-registry": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@vscode/windows-registry/-/windows-registry-1.1.0.tgz", + "integrity": "sha512-5AZzuWJpGscyiMOed0IuyEwt6iKmV5Us7zuwCDCFYMIq7tsvooO9BUiciywsvuthGz6UG4LSpeDeCxvgMVhnIw==", + "hasInstallScript": true + }, + "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==", + "dependencies": { + "js-base64": "^3.7.5" + }, + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==" + }, + "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==" + }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "engines": { + "node": "*" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, + "node_modules/cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4= sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/http-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", + "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", + "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/js-base64": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", + "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==" + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, + "node_modules/jschardet": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz", + "integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/kerberos": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/kerberos/-/kerberos-2.1.1.tgz", + "integrity": "sha512-414s1G/qgK2T60cXnZsHbtRj8Ynjg0DBlQWeY99tkyqQ2e8vGgFHvxRdvjTlLHg/SxBA0zLQcGE6Pk6Dfq/BCA==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^6.1.0", + "prebuild-install": "^7.1.2" + }, + "engines": { + "node": ">=12.9.0" + } + }, + "node_modules/kerberos/node_modules/node-addon-api": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + }, + "node_modules/native-watchdog": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/native-watchdog/-/native-watchdog-1.4.2.tgz", + "integrity": "sha512-iT3Uj6FFdrW5vHbQ/ybiznLus9oiUoMJ8A8nyugXv9rV3EBhIodmGs+mztrwQyyBc+PB5/CrskAH/WxaUVRRSQ==", + "hasInstallScript": true + }, + "node_modules/node-abi": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.8.0.tgz", + "integrity": "sha512-tzua9qWWi7iW4I42vUPKM+SfaF0vQSLAm4yO5J83mSwB7GeoWrDKC/K+8YCnYNwqP5duwazbw2X9l4m8SC2cUw==", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" + }, + "node_modules/node-gyp-build": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", + "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/node-pty": { + "version": "1.1.0-beta21", + "resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.1.0-beta21.tgz", + "integrity": "sha512-FYpnY9g8qMQLTpqyeY9NVli6YfCWwvG6v6gmaDBbPjlc1VMp/+Zivq0SStDrRr1aciGnFCZzpL0BzdMnmbDnAw==", + "hasInstallScript": true, + "dependencies": { + "node-addon-api": "^7.1.0" + } + }, + "node_modules/node-pty/node_modules/node-addon-api": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", + "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", + "engines": { + "node": "^16 || ^18 || >= 20" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E= sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA= sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==" + }, + "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/prebuild-install": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", + "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", + "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "dependencies": { + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo= sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tas-client-umd": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/tas-client-umd/-/tas-client-umd-0.2.0.tgz", + "integrity": "sha512-oezN7mJVm5qZDVEby7OzxCLKUpUN5of0rY4dvOWaDF2JZBlGpd3BXceFN8B53qlTaIkVSzP65aAMT0Vc+/N25Q==" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==" + }, + "node_modules/vscode-regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/vscode-regexpp/-/vscode-regexpp-3.1.0.tgz", + "integrity": "sha512-pqtN65VC1jRLawfluX4Y80MMG0DHJydWhe5ZwMHewZD6sys4LbU6lHwFAHxeuaVE6Y6+xZOtAw+9hvq7/0ejkg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/vscode-textmate": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-9.1.0.tgz", + "integrity": "sha512-lxKSVp2DkFOx9RDAvpiYUrB9/KT1fAfi1aE8CBGstP8N7rLF+Seifj8kDA198X0mYj1CjQUC+81+nQf8CO0nVA==" + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yauzl": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-3.1.1.tgz", + "integrity": "sha512-MPxA7oN5cvGV0wzfkeHKF2/+Q4TkMpHSWGRy/96I4Cozljmx0ph91+Muxh6HegEtDC4GftJ8qYDE51vghFiEYA==", + "dependencies": { + "buffer-crc32": "~0.2.3", + "pend": "~1.2.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yazl": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.4.3.tgz", + "integrity": "sha1-7CblzIfVYBud+EMtvdPNLlFzoHE= sha512-cIUrm3/81iF/BzuyORI7ppz1vGHAhA62JYzAFFC+rwJ2jQF1LcYxY9UXx4XyUXojkCnol0SvPuc+Toc7FO4W8g==", + "dependencies": { + "buffer-crc32": "~0.2.3" + } + } + } +} diff --git a/remote/package.json b/remote/package.json index c9b813f2b65..c4e1431b462 100644 --- a/remote/package.json +++ b/remote/package.json @@ -6,38 +6,40 @@ "@microsoft/1ds-core-js": "^3.2.13", "@microsoft/1ds-post-js": "^3.2.13", "@parcel/watcher": "2.1.0", + "@bpasero/watcher": "https://github.com/bpasero/watcher.git#3e5e50c275590703f3eb46fac777b720e515d0d5", "@vscode/deviceid": "^0.1.1", "@vscode/iconv-lite-umd": "0.7.0", - "@vscode/proxy-agent": "^0.20.0", + "@vscode/proxy-agent": "^0.23.0", "@vscode/ripgrep": "^1.15.9", "@vscode/spdlog": "^0.15.0", + "@vscode/tree-sitter-wasm": "^0.0.3", "@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.4", - "@xterm/addon-image": "0.9.0-beta.21", - "@xterm/addon-search": "0.16.0-beta.21", - "@xterm/addon-serialize": "0.14.0-beta.21", - "@xterm/addon-unicode11": "0.9.0-beta.21", - "@xterm/addon-webgl": "0.19.0-beta.21", - "@xterm/headless": "5.6.0-beta.21", - "@xterm/xterm": "5.6.0-beta.21", + "@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", "cookie": "^0.4.0", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.2", - "jschardet": "3.1.2", - "kerberos": "^2.0.1", + "jschardet": "3.1.3", + "kerberos": "2.1.1", "minimist": "^1.2.6", "native-watchdog": "^1.4.1", - "node-pty": "1.1.0-beta11", + "node-pty": "1.1.0-beta21", "tas-client-umd": "0.2.0", "vscode-oniguruma": "1.7.0", "vscode-regexpp": "^3.1.0", - "vscode-textmate": "9.0.0", + "vscode-textmate": "9.1.0", "yauzl": "^3.0.0", "yazl": "^2.4.3" }, - "resolutions": { + "overrides": { "node-gyp-build": "4.8.1" } } diff --git a/remote/web/package-lock.json b/remote/web/package-lock.json new file mode 100644 index 00000000000..332f3ccf36b --- /dev/null +++ b/remote/web/package-lock.json @@ -0,0 +1,174 @@ +{ + "name": "vscode-web", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vscode-web", + "version": "0.0.0", + "dependencies": { + "@microsoft/1ds-core-js": "^3.2.13", + "@microsoft/1ds-post-js": "^3.2.13", + "@vscode/iconv-lite-umd": "0.7.0", + "@vscode/tree-sitter-wasm": "^0.0.3", + "@vscode/vscode-languagedetection": "1.0.21", + "@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", + "jschardet": "3.1.3", + "tas-client-umd": "0.2.0", + "vscode-oniguruma": "1.7.0", + "vscode-textmate": "9.1.0" + } + }, + "node_modules/@microsoft/1ds-core-js": { + "version": "3.2.13", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-3.2.13.tgz", + "integrity": "sha512-CluYTRWcEk0ObG5EWFNWhs87e2qchJUn0p2D21ZUa3PWojPZfPSBs4//WIE0MYV8Qg1Hdif2ZTwlM7TbYUjfAg==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "2.8.15", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "3.2.13", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-3.2.13.tgz", + "integrity": "sha512-HgS574fdD19Bo2vPguyznL4eDw7Pcm1cVNpvbvBLWiW3x4e1FCQ3VMXChWnAxCae8Hb0XqlA2sz332ZobBavTA==", + "dependencies": { + "@microsoft/1ds-core-js": "3.2.13", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "2.8.15", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.15.tgz", + "integrity": "sha512-yYAs9MyjGr2YijQdUSN9mVgT1ijI1FPMgcffpaPmYbHAVbQmF7bXudrBWHxmLzJlwl5rfep+Zgjli2e67lwUqQ==", + "dependencies": { + "@microsoft/applicationinsights-shims": "2.0.2", + "@microsoft/dynamicproto-js": "^1.1.9" + }, + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.2.tgz", + "integrity": "sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg==" + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.9.tgz", + "integrity": "sha512-n1VPsljTSkthsAFYdiWfC+DKzK2WwcRp83Y1YAqdX552BstvsDjft9YXppjUzp11BPsapDoO1LDgrDB0XVsfNQ==" + }, + "node_modules/@vscode/iconv-lite-umd": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz", + "integrity": "sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg==" + }, + "node_modules/@vscode/tree-sitter-wasm": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@vscode/tree-sitter-wasm/-/tree-sitter-wasm-0.0.3.tgz", + "integrity": "sha512-K5YmUdohFCavPqEzG2cUPcZ6555KE1qwMDCjkvSUSz+s+8Wro2xfg+syLq90y6Tq0ZSUVvpuX6yq6ukToeGaLg==" + }, + "node_modules/@vscode/vscode-languagedetection": { + "version": "1.0.21", + "resolved": "https://registry.npmjs.org/@vscode/vscode-languagedetection/-/vscode-languagedetection-1.0.21.tgz", + "integrity": "sha512-zSUH9HYCw5qsCtd7b31yqkpaCU6jhtkKLkvOOA8yTrIRfBSOFb8PPhgmMicD7B/m+t4PwOJXzU1XDtrM9Fd3/g==", + "bin": { + "vscode-languagedetection": "cli/index.js" + } + }, + "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==", + "dependencies": { + "js-base64": "^3.7.5" + }, + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==", + "peerDependencies": { + "@xterm/xterm": "^5.6.0-beta.56" + } + }, + "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==" + }, + "node_modules/js-base64": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", + "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==" + }, + "node_modules/jschardet": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz", + "integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/tas-client-umd": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/tas-client-umd/-/tas-client-umd-0.2.0.tgz", + "integrity": "sha512-oezN7mJVm5qZDVEby7OzxCLKUpUN5of0rY4dvOWaDF2JZBlGpd3BXceFN8B53qlTaIkVSzP65aAMT0Vc+/N25Q==" + }, + "node_modules/vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==" + }, + "node_modules/vscode-textmate": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-9.1.0.tgz", + "integrity": "sha512-lxKSVp2DkFOx9RDAvpiYUrB9/KT1fAfi1aE8CBGstP8N7rLF+Seifj8kDA198X0mYj1CjQUC+81+nQf8CO0nVA==" + } + } +} diff --git a/remote/web/package.json b/remote/web/package.json index a6c63532460..c4d2eaeb540 100644 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -6,17 +6,18 @@ "@microsoft/1ds-core-js": "^3.2.13", "@microsoft/1ds-post-js": "^3.2.13", "@vscode/iconv-lite-umd": "0.7.0", + "@vscode/tree-sitter-wasm": "^0.0.3", "@vscode/vscode-languagedetection": "1.0.21", - "@xterm/addon-clipboard": "0.2.0-beta.4", - "@xterm/addon-image": "0.9.0-beta.21", - "@xterm/addon-search": "0.16.0-beta.21", - "@xterm/addon-serialize": "0.14.0-beta.21", - "@xterm/addon-unicode11": "0.9.0-beta.21", - "@xterm/addon-webgl": "0.19.0-beta.21", - "@xterm/xterm": "5.6.0-beta.21", - "jschardet": "3.1.2", + "@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", + "jschardet": "3.1.3", "tas-client-umd": "0.2.0", "vscode-oniguruma": "1.7.0", - "vscode-textmate": "9.0.0" + "vscode-textmate": "9.1.0" } } diff --git a/remote/web/yarn.lock b/remote/web/yarn.lock deleted file mode 100644 index 3a330eae061..00000000000 --- a/remote/web/yarn.lock +++ /dev/null @@ -1,111 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@microsoft/1ds-core-js@3.2.13", "@microsoft/1ds-core-js@^3.2.13": - version "3.2.13" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-3.2.13.tgz#0c105ed75091bae3f1555c0334704fa9911c58fb" - integrity sha512-CluYTRWcEk0ObG5EWFNWhs87e2qchJUn0p2D21ZUa3PWojPZfPSBs4//WIE0MYV8Qg1Hdif2ZTwlM7TbYUjfAg== - dependencies: - "@microsoft/applicationinsights-core-js" "2.8.15" - "@microsoft/applicationinsights-shims" "^2.0.2" - "@microsoft/dynamicproto-js" "^1.1.7" - -"@microsoft/1ds-post-js@^3.2.13": - version "3.2.13" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-3.2.13.tgz#560aacac8a92fdbb79e8c2ebcb293d56e19f51aa" - integrity sha512-HgS574fdD19Bo2vPguyznL4eDw7Pcm1cVNpvbvBLWiW3x4e1FCQ3VMXChWnAxCae8Hb0XqlA2sz332ZobBavTA== - dependencies: - "@microsoft/1ds-core-js" "3.2.13" - "@microsoft/applicationinsights-shims" "^2.0.2" - "@microsoft/dynamicproto-js" "^1.1.7" - -"@microsoft/applicationinsights-core-js@2.8.15": - version "2.8.15" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.15.tgz#8fa466474260e01967fe649f14dd9e5ff91dcdc8" - integrity sha512-yYAs9MyjGr2YijQdUSN9mVgT1ijI1FPMgcffpaPmYbHAVbQmF7bXudrBWHxmLzJlwl5rfep+Zgjli2e67lwUqQ== - dependencies: - "@microsoft/applicationinsights-shims" "2.0.2" - "@microsoft/dynamicproto-js" "^1.1.9" - -"@microsoft/applicationinsights-shims@2.0.2", "@microsoft/applicationinsights-shims@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.2.tgz#92b36a09375e2d9cb2b4203383b05772be837085" - integrity sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg== - -"@microsoft/dynamicproto-js@^1.1.7", "@microsoft/dynamicproto-js@^1.1.9": - version "1.1.9" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.9.tgz#7437db7aa061162ee94e4131b69a62b8dad5dea6" - integrity sha512-n1VPsljTSkthsAFYdiWfC+DKzK2WwcRp83Y1YAqdX552BstvsDjft9YXppjUzp11BPsapDoO1LDgrDB0XVsfNQ== - -"@vscode/iconv-lite-umd@0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz#d2f1e0664ee6036408f9743fee264ea0699b0e48" - integrity sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg== - -"@vscode/vscode-languagedetection@1.0.21": - version "1.0.21" - resolved "https://registry.yarnpkg.com/@vscode/vscode-languagedetection/-/vscode-languagedetection-1.0.21.tgz#89b48f293f6aa3341bb888c1118d16ff13b032d3" - integrity sha512-zSUH9HYCw5qsCtd7b31yqkpaCU6jhtkKLkvOOA8yTrIRfBSOFb8PPhgmMicD7B/m+t4PwOJXzU1XDtrM9Fd3/g== - -"@xterm/addon-clipboard@0.2.0-beta.4": - version "0.2.0-beta.4" - resolved "https://registry.yarnpkg.com/@xterm/addon-clipboard/-/addon-clipboard-0.2.0-beta.4.tgz#9911baaebfbc07a698ae62366a596bfdeac8fa7e" - integrity sha512-p2KGTFUDK4YFthCgfsv2wT66JDTZPcIuoWeDT+TmSFbS1smDPTMCyM/rDDkGY+duHRcQsIMVzGC+2NRb/exX6A== - dependencies: - js-base64 "^3.7.5" - -"@xterm/addon-image@0.9.0-beta.21": - version "0.9.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/addon-image/-/addon-image-0.9.0-beta.21.tgz#64fe50ee623f3e518574e1cbbe649cc0c0d60265" - integrity sha512-kTArrrS7K5+WYTTO8Ktt1aYxKTO4/jUm3KmyvPVjf9iw7OhLtG9mU+X9dXo56DTAqmbIUfJgY3OQbWffcyNk7w== - -"@xterm/addon-search@0.16.0-beta.21": - version "0.16.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/addon-search/-/addon-search-0.16.0-beta.21.tgz#b8a20e83c1ff24afa675c3723244b2068255688d" - integrity sha512-RVn8yRx+w6R7abWiIttyAR0+Myh+XCYOLAkwco3iIYgzlztmox3Qp6YNzWJj0G8iwSvzxaSu7Fbjbb2PXTOSIg== - -"@xterm/addon-serialize@0.14.0-beta.21": - version "0.14.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/addon-serialize/-/addon-serialize-0.14.0-beta.21.tgz#a074c5fdd2105c07574e6848babefef2905d84cb" - integrity sha512-Eg1QT2WG0pAIV+RrPv921+dVQvQqMhoFv2DQfMYDcqNbD2mTvIbX/ecEMb1bmn3WI0jNNomQ8UHZRFNRbDA+BA== - -"@xterm/addon-unicode11@0.9.0-beta.21": - version "0.9.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/addon-unicode11/-/addon-unicode11-0.9.0-beta.21.tgz#dc843df701e518bc459e77dcd4fd65fe49adbb4b" - integrity sha512-IiHYZ+88m5MCoAyOHWQ4xXzecOh6FsDDr8lZpJktbFHyzYjBlIDQ6z9cJg+3ApApfo5Xosnmzjs27kf7wG2L0w== - -"@xterm/addon-webgl@0.19.0-beta.21": - version "0.19.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/addon-webgl/-/addon-webgl-0.19.0-beta.21.tgz#68b92a47bf6768babd57bfbaf3ac97a7c670d8df" - integrity sha512-YV8Aaxp4QokXXehSCJ7NvudZKPDyBiXv4HqENqDpQllCj4hOWC5xJYSoFoPtu5+UhlzfqqvYRX/Il7QegPFPDg== - -"@xterm/xterm@5.6.0-beta.21": - version "5.6.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/xterm/-/xterm-5.6.0-beta.21.tgz#87a4e45752e5708cffc5c583d7f15e107313eb4e" - integrity sha512-1tLJaGudNSg1hEC+ZwUU7PiUvzURzKB5v1IRaJdmZK81ZCxvEF6Qfo281pTZsZFnv2iOWqFEC0C5uRmBXLm0lQ== - -js-base64@^3.7.5: - version "3.7.7" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.7.tgz#e51b84bf78fbf5702b9541e2cb7bfcb893b43e79" - integrity sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw== - -jschardet@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-3.1.2.tgz#9bf4364deba0677fe9e3bd9e29eda57febf2e9db" - integrity sha512-mw3CBZGzW8nUBPYhFU2ztZ/kJ6NClQUQVpyzvFMfznZsoC///ZQ30J2RCUanNsr5yF22LqhgYr/lj807/ZleWA== - -tas-client-umd@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/tas-client-umd/-/tas-client-umd-0.2.0.tgz#b71cc28f4c9b14f7b62f1ca4669886aa197e390c" - integrity sha512-oezN7mJVm5qZDVEby7OzxCLKUpUN5of0rY4dvOWaDF2JZBlGpd3BXceFN8B53qlTaIkVSzP65aAMT0Vc+/N25Q== - -vscode-oniguruma@1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz#439bfad8fe71abd7798338d1cd3dc53a8beea94b" - integrity sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA== - -vscode-textmate@9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-9.0.0.tgz#313c6c8792b0507aef35aeb81b6b370b37c44d6c" - integrity sha512-Cl65diFGxz7gpwbav10HqiY/eVYTO1sjQpmRmV991Bj7wAoOAjGQ97PpQcXorDE2Uc4hnGWLY17xme+5t6MlSg== diff --git a/remote/yarn.lock b/remote/yarn.lock deleted file mode 100644 index f57d42bd604..00000000000 --- a/remote/yarn.lock +++ /dev/null @@ -1,702 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@microsoft/1ds-core-js@3.2.13", "@microsoft/1ds-core-js@^3.2.13": - version "3.2.13" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-3.2.13.tgz#0c105ed75091bae3f1555c0334704fa9911c58fb" - integrity sha512-CluYTRWcEk0ObG5EWFNWhs87e2qchJUn0p2D21ZUa3PWojPZfPSBs4//WIE0MYV8Qg1Hdif2ZTwlM7TbYUjfAg== - dependencies: - "@microsoft/applicationinsights-core-js" "2.8.15" - "@microsoft/applicationinsights-shims" "^2.0.2" - "@microsoft/dynamicproto-js" "^1.1.7" - -"@microsoft/1ds-post-js@^3.2.13": - version "3.2.13" - resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-3.2.13.tgz#560aacac8a92fdbb79e8c2ebcb293d56e19f51aa" - integrity sha512-HgS574fdD19Bo2vPguyznL4eDw7Pcm1cVNpvbvBLWiW3x4e1FCQ3VMXChWnAxCae8Hb0XqlA2sz332ZobBavTA== - dependencies: - "@microsoft/1ds-core-js" "3.2.13" - "@microsoft/applicationinsights-shims" "^2.0.2" - "@microsoft/dynamicproto-js" "^1.1.7" - -"@microsoft/applicationinsights-core-js@2.8.15": - version "2.8.15" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.15.tgz#8fa466474260e01967fe649f14dd9e5ff91dcdc8" - integrity sha512-yYAs9MyjGr2YijQdUSN9mVgT1ijI1FPMgcffpaPmYbHAVbQmF7bXudrBWHxmLzJlwl5rfep+Zgjli2e67lwUqQ== - dependencies: - "@microsoft/applicationinsights-shims" "2.0.2" - "@microsoft/dynamicproto-js" "^1.1.9" - -"@microsoft/applicationinsights-shims@2.0.2", "@microsoft/applicationinsights-shims@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.2.tgz#92b36a09375e2d9cb2b4203383b05772be837085" - integrity sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg== - -"@microsoft/dynamicproto-js@^1.1.7", "@microsoft/dynamicproto-js@^1.1.9": - version "1.1.9" - resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.9.tgz#7437db7aa061162ee94e4131b69a62b8dad5dea6" - integrity sha512-n1VPsljTSkthsAFYdiWfC+DKzK2WwcRp83Y1YAqdX552BstvsDjft9YXppjUzp11BPsapDoO1LDgrDB0XVsfNQ== - -"@parcel/watcher@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.1.0.tgz#5f32969362db4893922c526a842d8af7a8538545" - integrity sha512-8s8yYjd19pDSsBpbkOHnT6Z2+UJSuLQx61pCFM0s5wSRvKCEMDjd/cHY3/GI1szHIWbpXpsJdg3V6ISGGx9xDw== - dependencies: - is-glob "^4.0.3" - micromatch "^4.0.5" - node-addon-api "^3.2.1" - node-gyp-build "^4.3.0" - -"@tootallnate/once@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-3.0.0.tgz#d52238c9052d746c9689523e650160e70786bc9a" - integrity sha512-OAdBVB7rlwvLD+DiecSAyVKzKVmSfXbouCyM5I6wHGi4MGXIyFqErg1IvyJ7PI1e+GYZuZh7cCHV/c4LA8SKMw== - -"@vscode/deviceid@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@vscode/deviceid/-/deviceid-0.1.1.tgz#750e2930a3a8fbf3fd610096a8b915dfdb493c89" - integrity sha512-ErpoMeKKNYAkR1IT3zxB5RtiTqEECdh8fxggupWvzuxpTAX77hwOI2NdJ7um+vupnXRBZVx4ugo0+dVHJWUkag== - dependencies: - fs-extra "^11.2.0" - uuid "^9.0.1" - -"@vscode/iconv-lite-umd@0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz#d2f1e0664ee6036408f9743fee264ea0699b0e48" - integrity sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg== - -"@vscode/proxy-agent@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@vscode/proxy-agent/-/proxy-agent-0.20.0.tgz#48cbfd15e76da674bb1ba6e09a05b736d5677df0" - integrity sha512-FskCQwrFiXI+KiGgvEvUENNDffu5cDg3Cz1zWsafqvuPoPpTC88SOJl9kbeu3Y2YvSMcHx/r3tkK6ICoMaEWNQ== - dependencies: - "@tootallnate/once" "^3.0.0" - agent-base "^7.0.1" - debug "^4.3.4" - http-proxy-agent "^7.0.0" - https-proxy-agent "^7.0.2" - socks-proxy-agent "^8.0.1" - optionalDependencies: - "@vscode/windows-ca-certs" "^0.3.1" - -"@vscode/ripgrep@^1.15.9": - version "1.15.9" - resolved "https://registry.yarnpkg.com/@vscode/ripgrep/-/ripgrep-1.15.9.tgz#92279f7f28e1e49ad9a89603e10b17a4c7f9f5f1" - integrity sha512-4q2PXRvUvr3bF+LsfrifmUZgSPmCNcUZo6SbEAZgArIChchkezaxLoIeQMJe/z3CCKStvaVKpBXLxN3Z8lQjFQ== - dependencies: - https-proxy-agent "^7.0.2" - proxy-from-env "^1.1.0" - yauzl "^2.9.2" - -"@vscode/spdlog@^0.15.0": - version "0.15.0" - resolved "https://registry.yarnpkg.com/@vscode/spdlog/-/spdlog-0.15.0.tgz#37896541410ff036dc01c54e16bf131c522a057e" - integrity sha512-5UFcQXM/G6bTRF49zJJJH3A3+47nxaXuKzT26vhTXVIiMFoV1oI9559mWOzapLEmvrntAdYtjE7Jh74lSAuMcA== - dependencies: - bindings "^1.5.0" - mkdirp "^1.0.4" - node-addon-api "7.1.0" - -"@vscode/vscode-languagedetection@1.0.21": - version "1.0.21" - resolved "https://registry.yarnpkg.com/@vscode/vscode-languagedetection/-/vscode-languagedetection-1.0.21.tgz#89b48f293f6aa3341bb888c1118d16ff13b032d3" - integrity sha512-zSUH9HYCw5qsCtd7b31yqkpaCU6jhtkKLkvOOA8yTrIRfBSOFb8PPhgmMicD7B/m+t4PwOJXzU1XDtrM9Fd3/g== - -"@vscode/windows-ca-certs@^0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@vscode/windows-ca-certs/-/windows-ca-certs-0.3.1.tgz#35c88b2d2a52f7759bfb6878906c3d40421ec6a3" - integrity sha512-1B6hZAsqg125wuMsXiKIFkBgKx/J7YR4RT/ccYGkWAToPU9MVa40PRe+evLFUmLPH6NmPohEPlCzZLbqgvHCcQ== - dependencies: - node-addon-api "^3.0.2" - -"@vscode/windows-process-tree@^0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@vscode/windows-process-tree/-/windows-process-tree-0.6.0.tgz#a62400c689b27688fd689e8cac71d63c6d1956da" - integrity sha512-7/DjBKKUtlmKNiAet2GRbdvfjgMKmfBeWVClIgONv8aqxGnaKca5N85eIDxh6rLMy2hKvFqIIsqgxs1Q26TWwg== - dependencies: - node-addon-api "7.1.0" - -"@vscode/windows-registry@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@vscode/windows-registry/-/windows-registry-1.1.0.tgz#03dace7c29c46f658588b9885b9580e453ad21f9" - integrity sha512-5AZzuWJpGscyiMOed0IuyEwt6iKmV5Us7zuwCDCFYMIq7tsvooO9BUiciywsvuthGz6UG4LSpeDeCxvgMVhnIw== - -"@xterm/addon-clipboard@0.2.0-beta.4": - version "0.2.0-beta.4" - resolved "https://registry.yarnpkg.com/@xterm/addon-clipboard/-/addon-clipboard-0.2.0-beta.4.tgz#9911baaebfbc07a698ae62366a596bfdeac8fa7e" - integrity sha512-p2KGTFUDK4YFthCgfsv2wT66JDTZPcIuoWeDT+TmSFbS1smDPTMCyM/rDDkGY+duHRcQsIMVzGC+2NRb/exX6A== - dependencies: - js-base64 "^3.7.5" - -"@xterm/addon-image@0.9.0-beta.21": - version "0.9.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/addon-image/-/addon-image-0.9.0-beta.21.tgz#64fe50ee623f3e518574e1cbbe649cc0c0d60265" - integrity sha512-kTArrrS7K5+WYTTO8Ktt1aYxKTO4/jUm3KmyvPVjf9iw7OhLtG9mU+X9dXo56DTAqmbIUfJgY3OQbWffcyNk7w== - -"@xterm/addon-search@0.16.0-beta.21": - version "0.16.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/addon-search/-/addon-search-0.16.0-beta.21.tgz#b8a20e83c1ff24afa675c3723244b2068255688d" - integrity sha512-RVn8yRx+w6R7abWiIttyAR0+Myh+XCYOLAkwco3iIYgzlztmox3Qp6YNzWJj0G8iwSvzxaSu7Fbjbb2PXTOSIg== - -"@xterm/addon-serialize@0.14.0-beta.21": - version "0.14.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/addon-serialize/-/addon-serialize-0.14.0-beta.21.tgz#a074c5fdd2105c07574e6848babefef2905d84cb" - integrity sha512-Eg1QT2WG0pAIV+RrPv921+dVQvQqMhoFv2DQfMYDcqNbD2mTvIbX/ecEMb1bmn3WI0jNNomQ8UHZRFNRbDA+BA== - -"@xterm/addon-unicode11@0.9.0-beta.21": - version "0.9.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/addon-unicode11/-/addon-unicode11-0.9.0-beta.21.tgz#dc843df701e518bc459e77dcd4fd65fe49adbb4b" - integrity sha512-IiHYZ+88m5MCoAyOHWQ4xXzecOh6FsDDr8lZpJktbFHyzYjBlIDQ6z9cJg+3ApApfo5Xosnmzjs27kf7wG2L0w== - -"@xterm/addon-webgl@0.19.0-beta.21": - version "0.19.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/addon-webgl/-/addon-webgl-0.19.0-beta.21.tgz#68b92a47bf6768babd57bfbaf3ac97a7c670d8df" - integrity sha512-YV8Aaxp4QokXXehSCJ7NvudZKPDyBiXv4HqENqDpQllCj4hOWC5xJYSoFoPtu5+UhlzfqqvYRX/Il7QegPFPDg== - -"@xterm/headless@5.6.0-beta.21": - version "5.6.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/headless/-/headless-5.6.0-beta.21.tgz#110fa33b59f4bf2d1de188e318bb944c8d774e97" - integrity sha512-RtKsv7KZb/ee8hwkvMNYuUofDoBR/KWUjoB5mo10C+dHyDJcMYiG2k48cAvcaJRjPH721iOELORKQk3NAlowkg== - -"@xterm/xterm@5.6.0-beta.21": - version "5.6.0-beta.21" - resolved "https://registry.yarnpkg.com/@xterm/xterm/-/xterm-5.6.0-beta.21.tgz#87a4e45752e5708cffc5c583d7f15e107313eb4e" - integrity sha512-1tLJaGudNSg1hEC+ZwUU7PiUvzURzKB5v1IRaJdmZK81ZCxvEF6Qfo281pTZsZFnv2iOWqFEC0C5uRmBXLm0lQ== - -agent-base@^7.0.1, agent-base@^7.0.2, agent-base@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.0.tgz#536802b76bc0b34aa50195eb2442276d613e3434" - integrity sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg== - dependencies: - debug "^4.3.4" - -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -bl@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - -braces@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" - integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== - dependencies: - fill-range "^7.1.1" - -buffer-crc32@~0.2.3: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= - -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -cookie@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - -debug@4, debug@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -decompress-response@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" - integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== - dependencies: - mimic-response "^3.1.0" - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -detect-libc@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.1.tgz#e1897aa88fa6ad197862937fbc0441ef352ee0cd" - integrity sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w== - -end-of-stream@^1.1.0, end-of-stream@^1.4.1: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -expand-template@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" - integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== - -fd-slicer@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= - dependencies: - pend "~1.2.0" - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -fill-range@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" - integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== - dependencies: - to-regex-range "^5.0.1" - -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - -fs-extra@^11.2.0: - version "11.2.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" - integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -github-from-package@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" - integrity sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4= - -graceful-fs@^4.1.6, graceful-fs@^4.2.0: - version "4.2.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" - integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== - -http-proxy-agent@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz#e9096c5afd071a3fce56e6252bb321583c124673" - integrity sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ== - dependencies: - agent-base "^7.1.0" - debug "^4.3.4" - -https-proxy-agent@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz#e2645b846b90e96c6e6f347fb5b2e41f1590b09b" - integrity sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA== - dependencies: - agent-base "^7.0.2" - debug "4" - -ieee754@^1.1.13: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -inherits@^2.0.3, inherits@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ini@~1.3.0: - version "1.3.8" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" - integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== - -ip@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.1.tgz#e8f3595d33a3ea66490204234b77636965307105" - integrity sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-glob@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -js-base64@^3.7.5: - version "3.7.7" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.7.tgz#e51b84bf78fbf5702b9541e2cb7bfcb893b43e79" - integrity sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw== - -jschardet@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-3.1.2.tgz#9bf4364deba0677fe9e3bd9e29eda57febf2e9db" - integrity sha512-mw3CBZGzW8nUBPYhFU2ztZ/kJ6NClQUQVpyzvFMfznZsoC///ZQ30J2RCUanNsr5yF22LqhgYr/lj807/ZleWA== - -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - -kerberos@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/kerberos/-/kerberos-2.0.1.tgz#663b0b46883b4da84495f60f2e9e399a43a33ef5" - integrity sha512-O/jIgbdGK566eUhFwIcgalbqirYU/r76MW7/UFw06Fd9x5bSwgyZWL/Vm26aAmezQww/G9KYkmmJBkEkPk5HLw== - dependencies: - bindings "^1.5.0" - node-addon-api "^4.3.0" - prebuild-install "7.1.1" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -micromatch@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - -mimic-response@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" - integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== - -minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== - -mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" - integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== - -mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -napi-build-utils@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" - integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== - -native-watchdog@^1.4.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/native-watchdog/-/native-watchdog-1.4.2.tgz#cf9f913157ee992723aa372b6137293c663be9b7" - integrity sha512-iT3Uj6FFdrW5vHbQ/ybiznLus9oiUoMJ8A8nyugXv9rV3EBhIodmGs+mztrwQyyBc+PB5/CrskAH/WxaUVRRSQ== - -node-abi@^3.3.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.8.0.tgz#679957dc8e7aa47b0a02589dbfde4f77b29ccb32" - integrity sha512-tzua9qWWi7iW4I42vUPKM+SfaF0vQSLAm4yO5J83mSwB7GeoWrDKC/K+8YCnYNwqP5duwazbw2X9l4m8SC2cUw== - dependencies: - semver "^7.3.5" - -node-addon-api@7.1.0, node-addon-api@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-7.1.0.tgz#71f609369379c08e251c558527a107107b5e0fdb" - integrity sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g== - -node-addon-api@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.1.0.tgz#98b21931557466c6729e51cb77cd39c965f42239" - integrity sha512-flmrDNB06LIl5lywUz7YlNGZH/5p0M7W28k8hzd9Lshtdh1wshD2Y+U4h9LD6KObOy1f+fEVdgprPrEymjM5uw== - -node-addon-api@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161" - integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A== - -node-addon-api@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" - integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== - -node-gyp-build@4.8.1, node-gyp-build@^4.3.0: - version "4.8.1" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.1.tgz#976d3ad905e71b76086f4f0b0d3637fe79b6cda5" - integrity sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw== - -node-pty@1.1.0-beta11: - version "1.1.0-beta11" - resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-1.1.0-beta11.tgz#909d5dd8f9aa2a7857e7b632fd4d2d4768bdf69f" - integrity sha512-vTjF+VrvSCfPDILUkIT+YrG1Fdn06/eBRS2fc9a3JzYAvknMB1Ip8aoJhxl8hNpjWAbprmCEiV91mlfNpCD+GQ== - dependencies: - node-addon-api "^7.1.0" - -once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= - -picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -prebuild-install@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45" - integrity sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw== - dependencies: - detect-libc "^2.0.0" - expand-template "^2.0.3" - github-from-package "0.0.0" - minimist "^1.2.3" - mkdirp-classic "^0.5.3" - napi-build-utils "^1.0.1" - node-abi "^3.3.0" - pump "^3.0.0" - rc "^1.2.7" - simple-get "^4.0.0" - tar-fs "^2.0.0" - tunnel-agent "^0.6.0" - -proxy-from-env@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -readable-stream@^3.1.1, readable-stream@^3.4.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -safe-buffer@^5.0.1, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -semver@^7.3.5: - version "7.5.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - -simple-concat@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" - integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== - -simple-get@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" - integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== - dependencies: - decompress-response "^6.0.0" - once "^1.3.1" - simple-concat "^1.0.0" - -smart-buffer@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" - integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== - -socks-proxy-agent@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-8.0.1.tgz#ffc5859a66dac89b0c4dab90253b96705f3e7120" - integrity sha512-59EjPbbgg8U3x62hhKOFVAmySQUcfRQ4C7Q/D5sEHnZTQRrQlNKINks44DMR1gwXp0p4LaVIeccX2KHTTcHVqQ== - dependencies: - agent-base "^7.0.1" - debug "^4.3.4" - socks "^2.7.1" - -socks@^2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.7.1.tgz#d8e651247178fde79c0663043e07240196857d55" - integrity sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ== - dependencies: - ip "^2.0.0" - smart-buffer "^4.2.0" - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -tar-fs@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" - integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng== - dependencies: - chownr "^1.1.1" - mkdirp-classic "^0.5.2" - pump "^3.0.0" - tar-stream "^2.1.4" - -tar-stream@^2.1.4: - version "2.2.0" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" - integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== - dependencies: - bl "^4.0.3" - end-of-stream "^1.4.1" - fs-constants "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.1.1" - -tas-client-umd@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/tas-client-umd/-/tas-client-umd-0.2.0.tgz#b71cc28f4c9b14f7b62f1ca4669886aa197e390c" - integrity sha512-oezN7mJVm5qZDVEby7OzxCLKUpUN5of0rY4dvOWaDF2JZBlGpd3BXceFN8B53qlTaIkVSzP65aAMT0Vc+/N25Q== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -universalify@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" - integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== - -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -uuid@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" - integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== - -vscode-oniguruma@1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz#439bfad8fe71abd7798338d1cd3dc53a8beea94b" - integrity sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA== - -vscode-regexpp@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/vscode-regexpp/-/vscode-regexpp-3.1.0.tgz#42d059b6fffe99bd42939c0d013f632f0cad823f" - integrity sha512-pqtN65VC1jRLawfluX4Y80MMG0DHJydWhe5ZwMHewZD6sys4LbU6lHwFAHxeuaVE6Y6+xZOtAw+9hvq7/0ejkg== - -vscode-textmate@9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-9.0.0.tgz#313c6c8792b0507aef35aeb81b6b370b37c44d6c" - integrity sha512-Cl65diFGxz7gpwbav10HqiY/eVYTO1sjQpmRmV991Bj7wAoOAjGQ97PpQcXorDE2Uc4hnGWLY17xme+5t6MlSg== - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yauzl@^2.9.2: - version "2.10.0" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" - -yauzl@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-3.1.1.tgz#d85503cc34933c0bcb3646ee2b97afedbebe32e7" - integrity sha512-MPxA7oN5cvGV0wzfkeHKF2/+Q4TkMpHSWGRy/96I4Cozljmx0ph91+Muxh6HegEtDC4GftJ8qYDE51vghFiEYA== - dependencies: - buffer-crc32 "~0.2.3" - pend "~1.2.0" - -yazl@^2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/yazl/-/yazl-2.4.3.tgz#ec26e5cc87d5601b9df8432dbdd3cd2e5173a071" - integrity sha1-7CblzIfVYBud+EMtvdPNLlFzoHE= - dependencies: - buffer-crc32 "~0.2.3" diff --git a/resources/linux/debian/postinst.template b/resources/linux/debian/postinst.template index 16acb1481bf..b292cff8b29 100755 --- a/resources/linux/debian/postinst.template +++ b/resources/linux/debian/postinst.template @@ -31,24 +31,54 @@ if [ "@@NAME@@" != "code-oss" ]; then # Register apt repository eval $(apt-config shell APT_SOURCE_PARTS Dir::Etc::sourceparts/d) CODE_SOURCE_PART=${APT_SOURCE_PARTS}vscode.list + CODE_SOURCE_PART_DEB822=${APT_SOURCE_PARTS}vscode.sources eval $(apt-config shell APT_TRUSTED_PARTS Dir::Etc::trustedparts/d) CODE_TRUSTED_PART=${APT_TRUSTED_PARTS}microsoft.gpg - # Install repository source list + RET=true + if [ -e '/usr/share/debconf/confmodule' ]; then + . /usr/share/debconf/confmodule + db_get @@NAME@@/add-microsoft-repo || true + fi + + # Determine whether to install the repository source list WRITE_SOURCE=0 - if [ ! -f $CODE_SOURCE_PART ] && [ ! -f /etc/rpi-issue ]; then - # Write source list if it does not exist and we're not running on Raspberry Pi OS - WRITE_SOURCE=1 - elif grep -Eq "http:\/\/packages\.microsoft\.com\/repos\/vscode" $CODE_SOURCE_PART; then + if [ "$RET" = false ]; then + # The user does not want to add the Microsoft repository + WRITE_SOURCE=0 + elif [ -f "$CODE_SOURCE_PART_DEB822" ]; then + # The user has migrated themselves to the DEB822 format + WRITE_SOURCE=0 + elif [ -f "$CODE_SOURCE_PART" ] && (grep -q "http://packages.microsoft.com/repos/vscode" $CODE_SOURCE_PART); then + # Migrate from old repository + WRITE_SOURCE=2 + elif [ -f "$CODE_SOURCE_PART" ] && (grep -q "http://packages.microsoft.com/repos/code" $CODE_SOURCE_PART); then # Migrate from old repository + WRITE_SOURCE=2 + elif apt-cache policy | grep -q "https://packages.microsoft.com/repos/code"; then + # The user is already on the new repository + WRITE_SOURCE=0 + elif [ ! -f $CODE_SOURCE_PART ] && [ ! -f /etc/rpi-issue ]; then + # Write source list if it does not exist and we're not running on Raspberry Pi OS WRITE_SOURCE=1 elif grep -q "# disabled on upgrade to" $CODE_SOURCE_PART; then # Write source list if it was disabled by OS upgrade WRITE_SOURCE=1 fi - if [ "$WRITE_SOURCE" -eq "1" ]; then + if [ "$WRITE_SOURCE" -eq "1" ] && [ -e '/usr/share/debconf/confmodule' ]; then + # Ask the user whether to actually write the source list + db_input high @@NAME@@/add-microsoft-repo || true + db_go || true + + db_get @@NAME@@/add-microsoft-repo + if [ "$RET" = false ]; then + WRITE_SOURCE=0 + fi + fi + + if [ "$WRITE_SOURCE" -ne "0" ]; then echo "### THIS FILE IS AUTOMATICALLY CONFIGURED ### # You may comment out this entry, but any other modifications may be lost. deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/repos/code stable main" > $CODE_SOURCE_PART diff --git a/resources/linux/debian/postrm.template b/resources/linux/debian/postrm.template index fb36d522f38..dcbfda95ea0 100755 --- a/resources/linux/debian/postrm.template +++ b/resources/linux/debian/postrm.template @@ -14,3 +14,22 @@ fi if hash update-mime-database 2>/dev/null; then update-mime-database /usr/share/mime fi + +RET=true +if [ -e '/usr/share/debconf/confmodule' ]; then + . /usr/share/debconf/confmodule + db_get @@NAME@@/add-microsoft-repo || true +fi +if [ "$RET" = "true" ]; then + eval $(apt-config shell APT_SOURCE_PARTS Dir::Etc::sourceparts/d) + CODE_SOURCE_PART=${APT_SOURCE_PARTS}vscode.list + rm -f $CODE_SOURCE_PART + + eval $(apt-config shell APT_TRUSTED_PARTS Dir::Etc::trustedparts/d) + CODE_TRUSTED_PART=${APT_TRUSTED_PARTS}microsoft.gpg + rm -f $CODE_TRUSTED_PART +fi + +if [ "$1" = "purge" ] && [ -e '/usr/share/debconf/confmodule' ]; then + db_purge +fi diff --git a/resources/linux/debian/templates.template b/resources/linux/debian/templates.template new file mode 100644 index 00000000000..7be5e039b26 --- /dev/null +++ b/resources/linux/debian/templates.template @@ -0,0 +1,6 @@ +Template: @@NAME@@/add-microsoft-repo +Type: boolean +Default: true +Description: Add Microsoft apt repository for Visual Studio Code? + The installer would like to add the Microsoft repository and signing + key to update VS Code through apt. diff --git a/resources/linux/rpm/code.spec.template b/resources/linux/rpm/code.spec.template index c9e57db9562..a73bc02c3e7 100644 --- a/resources/linux/rpm/code.spec.template +++ b/resources/linux/rpm/code.spec.template @@ -19,6 +19,7 @@ Visual Studio Code is a new choice of tool that combines the simplicity of a cod # Don't generate build_id links to prevent conflicts when installing multiple # versions of VS Code alongside each other (e.g. `code` and `code-insiders`) %define _build_id_links none +%define __strip @@STRIP@@ %install # Destination directories diff --git a/resources/server/bin/helpers/check-requirements-linux.sh b/resources/server/bin/helpers/check-requirements-linux.sh index 079557869e3..8ef07a2fb1f 100644 --- a/resources/server/bin/helpers/check-requirements-linux.sh +++ b/resources/server/bin/helpers/check-requirements-linux.sh @@ -27,6 +27,7 @@ fi ARCH=$(uname -m) found_required_glibc=0 found_required_glibcxx=0 +MIN_GLIBCXX_VERSION="3.4.25" # Extract the ID value from /etc/os-release if [ -f /etc/os-release ]; then @@ -40,7 +41,10 @@ fi # Based on https://github.com/bminor/glibc/blob/520b1df08de68a3de328b65a25b86300a7ddf512/elf/cache.c#L162-L245 case $ARCH in x86_64) LDCONFIG_ARCH="x86-64";; - armv7l | armv8l) LDCONFIG_ARCH="hard-float";; + armv7l | armv8l) + MIN_GLIBCXX_VERSION="3.4.26" + LDCONFIG_ARCH="hard-float" + ;; arm64 | aarch64) BITNESS=$(getconf LONG_BIT) if [ "$BITNESS" = "32" ]; then @@ -81,7 +85,7 @@ if [ "$OS_ID" != "alpine" ]; then libstdcpp_real_path=$(readlink -f "$libstdcpp_path_line") libstdcpp_version=$(grep -ao 'GLIBCXX_[0-9]*\.[0-9]*\.[0-9]*' "$libstdcpp_real_path" | sort -V | tail -1) libstdcpp_version_number=$(echo "$libstdcpp_version" | sed 's/GLIBCXX_//') - if [ "$(printf '%s\n' "3.4.24" "$libstdcpp_version_number" | sort -V | head -n1)" = "3.4.24" ]; then + if [ "$(printf '%s\n' "$MIN_GLIBCXX_VERSION" "$libstdcpp_version_number" | sort -V | head -n1)" = "$MIN_GLIBCXX_VERSION" ]; then found_required_glibcxx=1 break fi @@ -92,7 +96,7 @@ else found_required_glibcxx=1 fi if [ "$found_required_glibcxx" = "0" ]; then - echo "Warning: Missing GLIBCXX >= 3.4.25! from $libstdcpp_real_path" + echo "Warning: Missing GLIBCXX >= $MIN_GLIBCXX_VERSION! from $libstdcpp_real_path" fi if [ "$OS_ID" = "alpine" ]; then @@ -121,6 +125,9 @@ elif [ -z "$(ldd --version 2>&1 | grep 'musl libc')" ]; then elif [ -f /usr/lib/libc.so.6 ]; then # Typical path libc_path='/usr/lib/libc.so.6' + elif [ -f /lib64/libc.so.6 ]; then + # Typical path (OpenSUSE) + libc_path='/lib64/libc.so.6' elif [ -f /usr/lib64/libc.so.6 ]; then # Typical path libc_path='/usr/lib64/libc.so.6' diff --git a/scripts/code-server.bat b/scripts/code-server.bat index 23006f829ee..940926c88ec 100644 --- a/scripts/code-server.bat +++ b/scripts/code-server.bat @@ -19,7 +19,7 @@ FOR /F "tokens=*" %%g IN ('node build/lib/node.js') do (SET NODE=%%g) if not exist "%NODE%" ( :: Download nodejs executable for remote - call yarn gulp node + call npm run gulp node ) popd diff --git a/scripts/code-server.js b/scripts/code-server.js index c043bf2671b..56945e76ca7 100644 --- a/scripts/code-server.js +++ b/scripts/code-server.js @@ -69,4 +69,3 @@ function startServer(programArgs) { } main(); - diff --git a/scripts/code-server.sh b/scripts/code-server.sh index bc910a9bb98..6070edf8cd1 100755 --- a/scripts/code-server.sh +++ b/scripts/code-server.sh @@ -18,7 +18,7 @@ function code() { NODE=$(node build/lib/node.js) if [ ! -e $NODE ];then # Load remote node - yarn gulp node + npm run gulp node fi popd diff --git a/scripts/code-web.bat b/scripts/code-web.bat index 312024c3d42..5454a9b1ad4 100644 --- a/scripts/code-web.bat +++ b/scripts/code-web.bat @@ -6,14 +6,14 @@ title VSCode Web Serverless pushd %~dp0\.. :: Sync built-in extensions -call yarn download-builtin-extensions +call npm run download-builtin-extensions :: Node executable FOR /F "tokens=*" %%g IN ('node build/lib/node.js') do (SET NODE=%%g) if not exist "%NODE%" ( :: Download nodejs executable for remote - call yarn gulp node + call npm run gulp node ) :: Launch Server diff --git a/scripts/code-web.js b/scripts/code-web.js index 467f147d027..f2dc1ff046b 100644 --- a/scripts/code-web.js +++ b/scripts/code-web.js @@ -74,6 +74,10 @@ async function main() { openSystemBrowser = true; } + if (!fs.existsSync(path.join(APP_ROOT, 'src2')) && !fs.existsSync(path.join(APP_ROOT, 'out-build', 'amd'))) { + serverArgs.push('--esm'); + } + serverArgs.push('--sourcesPath', APP_ROOT); serverArgs.push(...process.argv.slice(2).filter(v => !v.startsWith('--playground') && v !== '--no-playground')); diff --git a/scripts/code-web.sh b/scripts/code-web.sh index 19313a61e01..c5d5fcfae4f 100755 --- a/scripts/code-web.sh +++ b/scripts/code-web.sh @@ -11,12 +11,12 @@ function code() { cd $ROOT # Sync built-in extensions - yarn download-builtin-extensions + npm run download-builtin-extensions NODE=$(node build/lib/node.js) if [ ! -e $NODE ];then # Load remote node - yarn gulp node + npm run gulp node fi NODE=$(node build/lib/node.js) diff --git a/scripts/node-electron.sh b/scripts/node-electron.sh index 0a822b6c383..102fe073e4f 100755 --- a/scripts/node-electron.sh +++ b/scripts/node-electron.sh @@ -18,7 +18,7 @@ else fi # Get electron -yarn electron +npm run electron popd diff --git a/scripts/npm.bat b/scripts/npm.bat deleted file mode 100644 index bcd71804d8a..00000000000 --- a/scripts/npm.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -yarn %* diff --git a/scripts/npm.sh b/scripts/npm.sh deleted file mode 100755 index 30f11cfdcdf..00000000000 --- a/scripts/npm.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -yarn $* diff --git a/scripts/playground-server.ts b/scripts/playground-server.ts index 1c2074ee191..474f83def86 100644 --- a/scripts/playground-server.ts +++ b/scripts/playground-server.ts @@ -223,10 +223,10 @@ class DirWatcher { function handleGetFileChangesRequest(watcher: DirWatcher, fileServer: FileServer, moduleIdMapper: SimpleModuleIdPathMapper): ChainableRequestHandler { return async (req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); - const d = watcher.onDidChange(fsPath => { + const d = watcher.onDidChange((fsPath, newContent) => { const path = fileServer.filePathToUrlPath(fsPath); if (path) { - res.write(JSON.stringify({ changedPath: path, moduleId: moduleIdMapper.getModuleId(fsPath) }) + '\n'); + res.write(JSON.stringify({ changedPath: path, moduleId: moduleIdMapper.getModuleId(fsPath), newContent }) + '\n'); } }); res.on('close', () => d.dispose()); @@ -235,13 +235,15 @@ function handleGetFileChangesRequest(watcher: DirWatcher, fileServer: FileServer function makeLoaderJsHotReloadable(loaderJsCode: string, fileChangesUrl: URL): string { loaderJsCode = loaderJsCode.replace( /constructor\(env, scriptLoader, defineFunc, requireFunc, loaderAvailableTimestamp = 0\) {/, - '$&globalThis.___globalModuleManager = this;' + '$&globalThis.___globalModuleManager = this; globalThis.vscode = { process: { env: { VSCODE_DEV: true } } }' ); const ___globalModuleManager: any = undefined; // This code will be appended to loader.js function $watchChanges(fileChangesUrl: string) { + interface HotReloadConfig { } + let reloadFn; if (globalThis.$sendMessageToParent) { reloadFn = () => globalThis.$sendMessageToParent({ kind: 'reload' }); @@ -262,49 +264,18 @@ function makeLoaderJsHotReloadable(loaderJsCode: string, fileChangesUrl: URL): s buffer += new TextDecoder().decode(value); const lines = buffer.split('\n'); buffer = lines.pop()!; + + const changes: { relativePath: string; config: HotReloadConfig | undefined; path: string; newContent: string }[] = []; + for (const line of lines) { const data = JSON.parse(line); - let handled = false; - if (data.changedPath.endsWith('.css')) { - if (typeof document !== 'undefined') { - console.log('css changed', data.changedPath); - const styleSheet = [...document.querySelectorAll(`link[rel='stylesheet']`)].find((l: any) => new URL(l.href, document.location.href).pathname.endsWith(data.changedPath)) as any; - if (styleSheet) { - styleSheet.href = styleSheet.href.replace(/\?.*/, '') + '?' + Date.now(); - } - } - handled = true; - } else if (data.changedPath.endsWith('.js') && data.moduleId) { - console.log('js changed', data.changedPath); - const moduleId = ___globalModuleManager._moduleIdProvider.getModuleId(data.moduleId); - if (___globalModuleManager._modules2[moduleId]) { - const srcUrl = ___globalModuleManager._config.moduleIdToPaths(data.moduleId); - const newSrc = await (await fetch(srcUrl)).text(); - (new Function('define', newSrc))(function (deps, callback) { // CodeQL [SM01632] This code is only executed during development (as part of the dev-only playground-server). It is required for the hot-reload functionality. - const oldModule = ___globalModuleManager._modules2[moduleId]; - delete ___globalModuleManager._modules2[moduleId]; - - ___globalModuleManager.defineModule(data.moduleId, deps, callback); - const newModule = ___globalModuleManager._modules2[moduleId]; - const oldExports = { ...oldModule.exports }; - - Object.assign(oldModule.exports, newModule.exports); - newModule.exports = oldModule.exports; - - handled = true; - - for (const cb of [...globalThis.$hotReload_deprecateExports]) { - cb(oldExports, newModule.exports); - } - - if (handled) { - console.log('hot reloaded', data.moduleId); - } - }); - } - } - - if (!handled) { reloadFn(); } + const relativePath = data.changedPath.replace(/\\/g, '/').split('/out/')[1]; + changes.push({ config: {}, path: data.changedPath, relativePath, newContent: data.newContent }); + } + + const result = handleChanges(changes, 'playground-server'); + if (result.reloadFailedJsFiles.length > 0) { + reloadFn(); } } }).catch(err => { @@ -312,6 +283,163 @@ function makeLoaderJsHotReloadable(loaderJsCode: string, fileChangesUrl: URL): s setTimeout(() => $watchChanges(fileChangesUrl), 1000); }); + + function handleChanges(changes: { + relativePath: string; + config: HotReloadConfig | undefined; + path: string; + newContent: string; + }[], debugSessionName: string) { + // This function is stringified and injected into the debuggee. + + const hotReloadData: { count: number; originalWindowTitle: any; timeout: any; shouldReload: boolean } = globalThis.$hotReloadData || (globalThis.$hotReloadData = { count: 0, messageHideTimeout: undefined, shouldReload: false }); + + const reloadFailedJsFiles: { relativePath: string; path: string }[] = []; + + for (const change of changes) { + handleChange(change.relativePath, change.path, change.newContent, change.config); + } + + return { reloadFailedJsFiles }; + + function handleChange(relativePath: string, path: string, newSrc: string, config: any) { + if (relativePath.endsWith('.css')) { + handleCssChange(relativePath); + } else if (relativePath.endsWith('.js')) { + handleJsChange(relativePath, path, newSrc, config); + } + } + + function handleCssChange(relativePath: string) { + if (typeof document === 'undefined') { + return; + } + + const styleSheet = (([...document.querySelectorAll(`link[rel='stylesheet']`)] as HTMLLinkElement[])) + .find(l => new URL(l.href, document.location.href).pathname.endsWith(relativePath)); + if (styleSheet) { + setMessage(`reload ${formatPath(relativePath)} - ${new Date().toLocaleTimeString()}`); + console.log(debugSessionName, 'css reloaded', relativePath); + styleSheet.href = styleSheet.href.replace(/\?.*/, '') + '?' + Date.now(); + } else { + setMessage(`could not reload ${formatPath(relativePath)} - ${new Date().toLocaleTimeString()}`); + console.log(debugSessionName, 'ignoring css change, as stylesheet is not loaded', relativePath); + } + } + + + function handleJsChange(relativePath: string, path: string, newSrc: string, config: any) { + const moduleIdStr = trimEnd(relativePath, '.js'); + + const requireFn: any = globalThis.require; + const moduleManager = (requireFn as any).moduleManager; + if (!moduleManager) { + console.log(debugSessionName, 'ignoring js change, as moduleManager is not available', relativePath); + return; + } + + const moduleId = moduleManager._moduleIdProvider.getModuleId(moduleIdStr); + const oldModule = moduleManager._modules2[moduleId]; + + if (!oldModule) { + console.log(debugSessionName, 'ignoring js change, as module is not loaded', relativePath); + return; + } + + // Check if we can reload + const g = globalThis as any; + + // A frozen copy of the previous exports + const oldExports = Object.freeze({ ...oldModule.exports }); + const reloadFn = g.$hotReload_applyNewExports?.({ oldExports, newSrc, config }); + + if (!reloadFn) { + console.log(debugSessionName, 'ignoring js change, as module does not support hot-reload', relativePath); + hotReloadData.shouldReload = true; + + reloadFailedJsFiles.push({ relativePath, path }); + + setMessage(`hot reload not supported for ${formatPath(relativePath)} - ${new Date().toLocaleTimeString()}`); + return; + } + + // Eval maintains source maps + function newScript(/* this parameter is used by newSrc */ define) { + // eslint-disable-next-line no-eval + eval(newSrc); // CodeQL [SM01632] This code is only executed during development. It is required for the hot-reload functionality. + } + + newScript(/* define */ function (deps, callback) { + // Evaluating the new code was successful. + + // Redefine the module + delete moduleManager._modules2[moduleId]; + moduleManager.defineModule(moduleIdStr, deps, callback); + const newModule = moduleManager._modules2[moduleId]; + + + // Patch the exports of the old module, so that modules using the old module get the new exports + Object.assign(oldModule.exports, newModule.exports); + // We override the exports so that future reloads still patch the initial exports. + newModule.exports = oldModule.exports; + + const successful = reloadFn(newModule.exports); + if (!successful) { + hotReloadData.shouldReload = true; + setMessage(`hot reload failed ${formatPath(relativePath)} - ${new Date().toLocaleTimeString()}`); + console.log(debugSessionName, 'hot reload was not successful', relativePath); + return; + } + + console.log(debugSessionName, 'hot reloaded', moduleIdStr); + setMessage(`successfully reloaded ${formatPath(relativePath)} - ${new Date().toLocaleTimeString()}`); + }); + } + + function setMessage(message: string) { + const domElem = (document.querySelector('.titlebar-center .window-title')) as HTMLDivElement | undefined; + if (!domElem) { return; } + if (!hotReloadData.timeout) { + hotReloadData.originalWindowTitle = domElem.innerText; + } else { + clearTimeout(hotReloadData.timeout); + } + if (hotReloadData.shouldReload) { + message += ' (manual reload required)'; + } + + domElem.innerText = message; + hotReloadData.timeout = setTimeout(() => { + hotReloadData.timeout = undefined; + // If wanted, we can restore the previous title message + // domElem.replaceChildren(hotReloadData.originalWindowTitle); + }, 5000); + } + + function formatPath(path: string): string { + const parts = path.split('/'); + parts.reverse(); + let result = parts[0]; + parts.shift(); + for (const p of parts) { + if (result.length + p.length > 40) { + break; + } + result = p + '/' + result; + if (result.length > 20) { + break; + } + } + return result; + } + + function trimEnd(str, suffix) { + if (str.endsWith(suffix)) { + return str.substring(0, str.length - suffix.length); + } + return str; + } + } } const additionalJsCode = ` diff --git a/scripts/test-amd.bat b/scripts/test-amd.bat new file mode 100644 index 00000000000..4ecd8a43400 --- /dev/null +++ b/scripts/test-amd.bat @@ -0,0 +1,31 @@ +@echo off +setlocal + +set ELECTRON_RUN_AS_NODE= + +pushd %~dp0\.. + +:: Get Code.exe location +for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a +set NAMESHORT=%NAMESHORT: "=% +set NAMESHORT=%NAMESHORT:"=%.exe +set CODE=".build\electron\%NAMESHORT%" + +:: Download Electron if needed +call node build\lib\electron.js +if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron + +:: Run tests +set ELECTRON_ENABLE_LOGGING=1 +%CODE% .\test\unit\electron\index.amd.js --crash-reporter-directory=%~dp0\..\.build\crashes %* + +popd + +endlocal + +:: app.exit(0) is exiting with code 255 in Electron 1.7.4. +:: See https://github.com/microsoft/vscode/issues/28582 +echo errorlevel: %errorlevel% +if %errorlevel% == 255 set errorlevel=0 + +exit /b %errorlevel% diff --git a/scripts/test-amd.sh b/scripts/test-amd.sh new file mode 100755 index 00000000000..be45e090348 --- /dev/null +++ b/scripts/test-amd.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +set -e + +if [[ "$OSTYPE" == "darwin"* ]]; then + realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; } + ROOT=$(dirname $(dirname $(realpath "$0"))) +else + ROOT=$(dirname $(dirname $(readlink -f $0))) + # --disable-dev-shm-usage: when run on docker containers where size of /dev/shm + # partition < 64MB which causes OOM failure for chromium compositor that uses the partition for shared memory + LINUX_EXTRA_ARGS="--disable-dev-shm-usage" +fi + +cd $ROOT + +if [[ "$OSTYPE" == "darwin"* ]]; then + NAME=`node -p "require('./product.json').nameLong"` + CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron" +else + NAME=`node -p "require('./product.json').applicationName"` + CODE=".build/electron/$NAME" +fi + +VSCODECRASHDIR=$ROOT/.build/crashes + +# Node modules +test -d node_modules || npm i + +# Get electron +npm run electron + +# Unit Tests +if [[ "$OSTYPE" == "darwin"* ]]; then + cd $ROOT ; ulimit -n 4096 ; \ + ELECTRON_ENABLE_LOGGING=1 \ + "$CODE" \ + test/unit/electron/index.amd.js --crash-reporter-directory=$VSCODECRASHDIR "$@" +else + cd $ROOT ; \ + ELECTRON_ENABLE_LOGGING=1 \ + "$CODE" \ + test/unit/electron/index.amd.js --crash-reporter-directory=$VSCODECRASHDIR $LINUX_EXTRA_ARGS "$@" +fi diff --git a/scripts/test-integration-amd.bat b/scripts/test-integration-amd.bat new file mode 100644 index 00000000000..96231152b91 --- /dev/null +++ b/scripts/test-integration-amd.bat @@ -0,0 +1,119 @@ +@echo off +setlocal + +pushd %~dp0\.. + +set VSCODEUSERDATADIR=%TEMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,2% +set VSCODECRASHDIR=%~dp0\..\.build\crashes +set VSCODELOGSDIR=%~dp0\..\.build\logs\integration-tests + +:: Figure out which Electron to use for running tests +if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" ( + chcp 65001 + set INTEGRATION_TEST_ELECTRON_PATH=.\scripts\code.bat + set VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE=1 + + echo Running integration tests out of sources. +) else ( + set VSCODE_CLI=1 + set ELECTRON_ENABLE_LOGGING=1 + + echo Running integration tests with '%INTEGRATION_TEST_ELECTRON_PATH%' as build. +) + +echo Storing crash reports into '%VSCODECRASHDIR%'. +echo Storing log files into '%VSCODELOGSDIR%'. + + +:: Tests standalone (AMD) + +echo. +echo ### node.js integration tests +call .\scripts\test-amd.bat --runGlob **\*.integrationTest.js %* +if %errorlevel% neq 0 exit /b %errorlevel% + + +:: Tests in the extension host + +set API_TESTS_EXTRA_ARGS=--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=%VSCODECRASHDIR% --logsPath=%VSCODELOGSDIR% --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-extensions --disable-workspace-trust --user-data-dir=%VSCODEUSERDATADIR% + +echo. +echo ### API tests (folder) +call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\singlefolder-tests %API_TESTS_EXTRA_ARGS% +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. +echo ### API tests (workspace) +call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\workspace-tests %API_TESTS_EXTRA_ARGS% +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. +echo ### Colorize tests +call npm run test-extension -l vscode-colorize-tests +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. +echo ### TypeScript tests +call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\typescript-language-features\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\typescript-language-features --extensionTestsPath=%~dp0\..\extensions\typescript-language-features\out\test\unit %API_TESTS_EXTRA_ARGS% +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. +echo ### Markdown tests +call npm run test-extension -l markdown-language-features +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. +echo ### Emmet tests +call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\emmet\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test %API_TESTS_EXTRA_ARGS% +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. +echo ### Git tests +for /f "delims=" %%i in ('node -p "require('fs').realpathSync.native(require('os').tmpdir())"') do set TEMPDIR=%%i +set GITWORKSPACE=%TEMPDIR%\git-%RANDOM% +mkdir %GITWORKSPACE% +call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test %API_TESTS_EXTRA_ARGS% +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. +echo ### Ipynb tests +call npm run test-extension -l ipynb +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. +echo ### Notebook Output tests +call npm run test-extension -l notebook-renderers +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. +echo ### Configuration editing tests +set CFWORKSPACE=%TEMPDIR%\cf-%RANDOM% +mkdir %CFWORKSPACE% +call npm run test-extension -l configuration-editing +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. +echo ### GitHub Authentication tests +call npm run test-extension -l github-authentication +if %errorlevel% neq 0 exit /b %errorlevel% + +:: Tests standalone (CommonJS) + +echo. +echo ### CSS tests +call %~dp0\node-electron.bat %~dp0\..\extensions\css-language-features/server/test/index.js +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. +echo ### HTML tests +call %~dp0\node-electron.bat %~dp0\..\extensions\html-language-features/server/test/index.js +if %errorlevel% neq 0 exit /b %errorlevel% + + +:: Cleanup + +rmdir /s /q %VSCODEUSERDATADIR% + +popd + +endlocal diff --git a/scripts/test-integration-amd.sh b/scripts/test-integration-amd.sh new file mode 100755 index 00000000000..70f50cc306e --- /dev/null +++ b/scripts/test-integration-amd.sh @@ -0,0 +1,136 @@ +#!/usr/bin/env bash +set -e + +if [[ "$OSTYPE" == "darwin"* ]]; then + realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; } + ROOT=$(dirname $(dirname $(realpath "$0"))) +else + ROOT=$(dirname $(dirname $(readlink -f $0))) + # --disable-dev-shm-usage: when run on docker containers where size of /dev/shm + # partition < 64MB which causes OOM failure for chromium compositor that uses the partition for shared memory + LINUX_EXTRA_ARGS="--disable-dev-shm-usage" +fi + +VSCODEUSERDATADIR=`mktemp -d 2>/dev/null` +VSCODECRASHDIR=$ROOT/.build/crashes +VSCODELOGSDIR=$ROOT/.build/logs/integration-tests + +cd $ROOT + +# Figure out which Electron to use for running tests +if [ -z "$INTEGRATION_TEST_ELECTRON_PATH" ] +then + INTEGRATION_TEST_ELECTRON_PATH="./scripts/code.sh" + + echo "Running integration tests out of sources." +else + export VSCODE_CLI=1 + export ELECTRON_ENABLE_LOGGING=1 + + echo "Running integration tests with '$INTEGRATION_TEST_ELECTRON_PATH' as build." +fi + +echo "Storing crash reports into '$VSCODECRASHDIR'." +echo "Storing log files into '$VSCODELOGSDIR'." + + +# Tests standalone (AMD) + +echo +echo "### node.js integration tests" +echo +./scripts/test-amd.sh --runGlob **/*.integrationTest.js "$@" + + +# Tests in the extension host + +API_TESTS_EXTRA_ARGS="--disable-telemetry --skip-welcome --skip-release-notes --crash-reporter-directory=$VSCODECRASHDIR --logsPath=$VSCODELOGSDIR --no-cached-data --disable-updates --use-inmemory-secretstorage --disable-extensions --disable-workspace-trust --user-data-dir=$VSCODEUSERDATADIR" + +if [ -z "$INTEGRATION_TEST_APP_NAME" ]; then + kill_app() { true; } +else + kill_app() { killall $INTEGRATION_TEST_APP_NAME || true; } +fi + +echo +echo "### API tests (folder)" +echo +"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $ROOT/extensions/vscode-api-tests/testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/singlefolder-tests $API_TESTS_EXTRA_ARGS +kill_app + +echo +echo "### API tests (workspace)" +echo +"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $ROOT/extensions/vscode-api-tests/testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/workspace-tests $API_TESTS_EXTRA_ARGS +kill_app + +echo +echo "### Colorize tests" +echo +npm run test-extension -l vscode-colorize-tests +kill_app + +echo +echo "### TypeScript tests" +echo +"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $ROOT/extensions/typescript-language-features/test-workspace --extensionDevelopmentPath=$ROOT/extensions/typescript-language-features --extensionTestsPath=$ROOT/extensions/typescript-language-features/out/test/unit $API_TESTS_EXTRA_ARGS +kill_app + +echo +echo "### Markdown tests" +echo +npm run test-extension -l markdown-language-features +kill_app + +echo +echo "### Emmet tests" +echo +"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $ROOT/extensions/emmet/test-workspace --extensionDevelopmentPath=$ROOT/extensions/emmet --extensionTestsPath=$ROOT/extensions/emmet/out/test $API_TESTS_EXTRA_ARGS +kill_app + +echo +echo "### Git tests" +echo +"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $(mktemp -d 2>/dev/null) --extensionDevelopmentPath=$ROOT/extensions/git --extensionTestsPath=$ROOT/extensions/git/out/test $API_TESTS_EXTRA_ARGS +kill_app + +echo +echo "### Ipynb tests" +echo +npm run test-extension -l ipynb +kill_app + +echo +echo "### Notebook Output tests" +echo +npm run test-extension -l notebook-renderers +kill_app + +echo +echo "### Configuration editing tests" +echo +npm run test-extension -l configuration-editing +kill_app + +echo +echo "### GitHub Authentication tests" +echo +npm run test-extension -l github-authentication +kill_app + +# Tests standalone (CommonJS) + +echo +echo "### CSS tests" +echo +cd $ROOT/extensions/css-language-features/server && $ROOT/scripts/node-electron.sh test/index.js + +echo +echo "### HTML tests" +echo +cd $ROOT/extensions/html-language-features/server && $ROOT/scripts/node-electron.sh test/index.js + + +# Cleanup + +rm -rf $VSCODEUSERDATADIR diff --git a/scripts/test-integration.bat b/scripts/test-integration.bat index facf82828f1..1d2920935fe 100644 --- a/scripts/test-integration.bat +++ b/scripts/test-integration.bat @@ -49,7 +49,7 @@ if %errorlevel% neq 0 exit /b %errorlevel% echo. echo ### Colorize tests -call yarn test-extension -l vscode-colorize-tests +call npm run test-extension -l vscode-colorize-tests if %errorlevel% neq 0 exit /b %errorlevel% echo. @@ -59,7 +59,7 @@ if %errorlevel% neq 0 exit /b %errorlevel% echo. echo ### Markdown tests -call yarn test-extension -l markdown-language-features +call npm run test-extension -l markdown-language-features if %errorlevel% neq 0 exit /b %errorlevel% echo. @@ -77,24 +77,24 @@ if %errorlevel% neq 0 exit /b %errorlevel% echo. echo ### Ipynb tests -call yarn test-extension -l ipynb +call npm run test-extension -l ipynb if %errorlevel% neq 0 exit /b %errorlevel% echo. echo ### Notebook Output tests -call yarn test-extension -l notebook-renderers +call npm run test-extension -l notebook-renderers if %errorlevel% neq 0 exit /b %errorlevel% echo. echo ### Configuration editing tests set CFWORKSPACE=%TEMPDIR%\cf-%RANDOM% mkdir %CFWORKSPACE% -call yarn test-extension -l configuration-editing +call npm run test-extension -l configuration-editing if %errorlevel% neq 0 exit /b %errorlevel% echo. echo ### GitHub Authentication tests -call yarn test-extension -l github-authentication +call npm run test-extension -l github-authentication if %errorlevel% neq 0 exit /b %errorlevel% :: Tests standalone (CommonJS) diff --git a/scripts/test-integration.sh b/scripts/test-integration.sh index 483fb5507c5..f2aaf1a2fe6 100755 --- a/scripts/test-integration.sh +++ b/scripts/test-integration.sh @@ -67,7 +67,7 @@ kill_app echo echo "### Colorize tests" echo -yarn test-extension -l vscode-colorize-tests +npm run test-extension -l vscode-colorize-tests kill_app echo @@ -79,7 +79,7 @@ kill_app echo echo "### Markdown tests" echo -yarn test-extension -l markdown-language-features +npm run test-extension -l markdown-language-features kill_app echo @@ -97,25 +97,25 @@ kill_app echo echo "### Ipynb tests" echo -yarn test-extension -l ipynb +npm run test-extension -l ipynb kill_app echo echo "### Notebook Output tests" echo -yarn test-extension -l notebook-renderers +npm run test-extension -l notebook-renderers kill_app echo echo "### Configuration editing tests" echo -yarn test-extension -l configuration-editing +npm run test-extension -l configuration-editing kill_app echo echo "### GitHub Authentication tests" echo -yarn test-extension -l github-authentication +npm run test-extension -l github-authentication kill_app # Tests standalone (CommonJS) diff --git a/scripts/test-remote-integration.bat b/scripts/test-remote-integration.bat index c583f906503..e79466424db 100644 --- a/scripts/test-remote-integration.bat +++ b/scripts/test-remote-integration.bat @@ -9,7 +9,7 @@ IF "%~1" == "" ( set EXT_PATH=%CD:\=/%/extensions :: Download nodejs executable for remote - call yarn gulp node + call npm run gulp node ) else ( set AUTHORITY=%1 set EXT_PATH=%2 diff --git a/scripts/test-remote-integration.sh b/scripts/test-remote-integration.sh index d3e9f2a5265..4695dfa12e3 100755 --- a/scripts/test-remote-integration.sh +++ b/scripts/test-remote-integration.sh @@ -22,7 +22,7 @@ if [[ "$1" == "" ]]; then AUTHORITY=vscode-remote://test+test EXT_PATH=$ROOT/extensions # Load remote node - yarn gulp node + npm run gulp node else AUTHORITY=$1 EXT_PATH=$2 diff --git a/scripts/test-web-integration.bat b/scripts/test-web-integration.bat index 700dd0a045e..bc33dfc2a35 100644 --- a/scripts/test-web-integration.bat +++ b/scripts/test-web-integration.bat @@ -9,7 +9,7 @@ IF "%~1" == "" ( set EXT_PATH=%CD:\=/%/extensions :: Download nodejs executable for remote - call yarn gulp node + call npm run gulp node ) else ( set AUTHORITY=%1 set EXT_PATH=%2 @@ -26,8 +26,10 @@ if "%VSCODE_REMOTE_SERVER_PATH%"=="" ( ) if not exist ".\test\integration\browser\out\index.js" ( - call yarn --cwd test/integration/browser compile - call yarn playwright-install + pushd test\integration\browser + call npm run compile + popd + call npm run playwright-install ) diff --git a/scripts/test-web-integration.sh b/scripts/test-web-integration.sh index 0648a7f8cd8..a295d0bd9b5 100755 --- a/scripts/test-web-integration.sh +++ b/scripts/test-web-integration.sh @@ -18,8 +18,8 @@ else fi if [ ! -e 'test/integration/browser/out/index.js' ];then - yarn --cwd test/integration/browser compile - yarn playwright-install + (cd test/integration/browser && npm run compile) + npm run playwright-install fi diff --git a/scripts/test.sh b/scripts/test.sh index 66fde1df2c4..ae0d88cc734 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -24,10 +24,10 @@ fi VSCODECRASHDIR=$ROOT/.build/crashes # Node modules -test -d node_modules || yarn +test -d node_modules || npm i # Get electron -yarn electron +npm run electron # Unit Tests if [[ "$OSTYPE" == "darwin"* ]]; then diff --git a/scripts/xterm-update.js b/scripts/xterm-update.js index 8ede619160b..15759069604 100644 --- a/scripts/xterm-update.js +++ b/scripts/xterm-update.js @@ -75,7 +75,7 @@ async function update() { if (modulesWithVersion.length > 0) { for (const cwd of [vscodeDir, path.join(vscodeDir, 'remote'), path.join(vscodeDir, 'remote/web')]) { console.log(`${path.join(cwd, 'package.json')}: Updating\n ${modulesWithVersion.join('\n ')}`); - cp.execSync(`yarn add ${modulesWithVersion.join(' ')}`, { cwd }); + cp.execSync(`npm install ${modulesWithVersion.join(' ')}`, { cwd }); } } @@ -91,7 +91,7 @@ async function update() { if (backendOnlyModulesWithVersion.length > 0) { for (const cwd of [vscodeDir, path.join(vscodeDir, 'remote')]) { console.log(`${path.join(cwd, 'package.json')}: Updating\n ${backendOnlyModulesWithVersion.join('\n ')}`); - cp.execSync(`yarn add ${backendOnlyModulesWithVersion.join(' ')}`, { cwd }); + cp.execSync(`npm install ${backendOnlyModulesWithVersion.join(' ')}`, { cwd }); } } } diff --git a/scripts/xterm-update.ps1 b/scripts/xterm-update.ps1 index 11c282de888..2eae7fffe77 100644 --- a/scripts/xterm-update.ps1 +++ b/scripts/xterm-update.ps1 @@ -1 +1,2 @@ -node $PSScriptRoot\xterm-update.js (Get-Location) +$scriptPath = Join-Path $PSScriptRoot "xterm-update.js" +node $scriptPath (Get-Location) diff --git a/src/bootstrap-amd.js b/src/bootstrap-amd.js index cc47b050fb5..9c8daf55756 100644 --- a/src/bootstrap-amd.js +++ b/src/bootstrap-amd.js @@ -6,17 +6,54 @@ //@ts-check 'use strict'; -// Store the node.js require function in a variable -// before loading our AMD loader to avoid issues -// when this file is bundled with other files. -const nodeRequire = require; +/** + * @import { INLSConfiguration } from './vs/nls' + * @import { IProductConfiguration } from './vs/base/common/product' + */ + +// ESM-uncomment-begin +import * as path from 'path'; +import * as fs from 'fs'; +import { fileURLToPath } from 'url'; +import { createRequire, register } from 'node:module'; +import { product, pkg } from './bootstrap-meta.js'; +import './bootstrap-node.js'; +import * as performance from './vs/base/common/performance.js'; + +/** @ts-ignore */ +const require = createRequire(import.meta.url); +/** @type any */ +const module = { exports: {} }; +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +// Install a hook to module resolution to map 'fs' to 'original-fs' +if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) { + const jsCode = ` + export async function resolve(specifier, context, nextResolve) { + if (specifier === 'fs') { + return { + format: 'builtin', + shortCircuit: true, + url: 'node:original-fs' + }; + } -// VSCODE_GLOBALS: node_modules -globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => nodeRequire(String(mod)) }); + // Defer to the next hook in the chain, which would be the + // Node.js default resolve if this is the last user-specified loader. + return nextResolve(specifier, context); + }`; + register(`data:text/javascript;base64,${Buffer.from(jsCode).toString('base64')}`, import.meta.url); +} +// ESM-uncomment-end // VSCODE_GLOBALS: package/product.json -/** @type Record */ -globalThis._VSCODE_PRODUCT_JSON = require('../product.json'); +/** @type Partial */ +// ESM-comment-begin +// globalThis._VSCODE_PRODUCT_JSON = require('./bootstrap-meta').product; +// ESM-comment-end +// ESM-uncomment-begin +globalThis._VSCODE_PRODUCT_JSON = { ...product }; +// ESM-uncomment-end if (process.env['VSCODE_DEV']) { // Patch product overrides when running out of sources try { @@ -25,63 +62,179 @@ if (process.env['VSCODE_DEV']) { globalThis._VSCODE_PRODUCT_JSON = Object.assign(globalThis._VSCODE_PRODUCT_JSON, overrides); } catch (error) { /* ignore */ } } -globalThis._VSCODE_PACKAGE_JSON = require('../package.json'); - -// @ts-ignore -const loader = require('./vs/loader'); -const bootstrap = require('./bootstrap'); -const performance = require('./vs/base/common/performance'); - -// Bootstrap: NLS -const nlsConfig = bootstrap.setupNLS(); - -// Bootstrap: Loader -loader.config({ - baseUrl: bootstrap.fileUriFromPath(__dirname, { isWindows: process.platform === 'win32' }), - catchError: true, - nodeRequire, - 'vs/nls': nlsConfig, - amdModulesPattern: /^vs\//, - recordStats: true -}); - -// Running in Electron -if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) { - loader.define('fs', ['original-fs'], function (/** @type {import('fs')} */originalFS) { - return originalFS; // replace the patched electron fs with the original node fs for all AMD code - }); +// ESM-comment-begin +// globalThis._VSCODE_PACKAGE_JSON = require('./bootstrap-meta').pkg; +// ESM-comment-end +// ESM-uncomment-begin +globalThis._VSCODE_PACKAGE_JSON = { ...pkg }; +// ESM-uncomment-end + +// VSCODE_GLOBALS: file root of all resources +globalThis._VSCODE_FILE_ROOT = __dirname; + +// ESM-comment-begin +// const bootstrapNode = require('./bootstrap-node'); +// const performance = require(`./vs/base/common/performance`); +// const fs = require('fs'); +// ESM-comment-end + +//#region NLS helpers + +/** @type {Promise | undefined} */ +let setupNLSResult = undefined; + +/** + * @returns {Promise} + */ +function setupNLS() { + if (!setupNLSResult) { + setupNLSResult = doSetupNLS(); + } + + return setupNLSResult; } -// Pseudo NLS support -if (nlsConfig && nlsConfig.pseudo) { - loader(['vs/nls'], function (/** @type {import('vs/nls')} */nlsPlugin) { - nlsPlugin.setPseudoTranslation(!!nlsConfig.pseudo); - }); +/** + * @returns {Promise} + */ +async function doSetupNLS() { + performance.mark('code/amd/willLoadNls'); + + /** @type {INLSConfiguration | undefined} */ + let nlsConfig = undefined; + + /** @type {string | undefined} */ + let messagesFile; + if (process.env['VSCODE_NLS_CONFIG']) { + try { + /** @type {INLSConfiguration} */ + nlsConfig = JSON.parse(process.env['VSCODE_NLS_CONFIG']); + if (nlsConfig?.languagePack?.messagesFile) { + messagesFile = nlsConfig.languagePack.messagesFile; + } else if (nlsConfig?.defaultMessagesFile) { + messagesFile = nlsConfig.defaultMessagesFile; + } + + globalThis._VSCODE_NLS_LANGUAGE = nlsConfig?.resolvedLanguage; + } catch (e) { + console.error(`Error reading VSCODE_NLS_CONFIG from environment: ${e}`); + } + } + + if ( + process.env['VSCODE_DEV'] || // no NLS support in dev mode + !messagesFile // no NLS messages file + ) { + return undefined; + } + + try { + globalThis._VSCODE_NLS_MESSAGES = JSON.parse((await fs.promises.readFile(messagesFile)).toString()); + } catch (error) { + console.error(`Error reading NLS messages file ${messagesFile}: ${error}`); + + // Mark as corrupt: this will re-create the language pack cache next startup + if (nlsConfig?.languagePack?.corruptMarkerFile) { + try { + await fs.promises.writeFile(nlsConfig.languagePack.corruptMarkerFile, 'corrupted'); + } catch (error) { + console.error(`Error writing corrupted NLS marker file: ${error}`); + } + } + + // Fallback to the default message file to ensure english translation at least + if (nlsConfig?.defaultMessagesFile && nlsConfig.defaultMessagesFile !== messagesFile) { + try { + globalThis._VSCODE_NLS_MESSAGES = JSON.parse((await fs.promises.readFile(nlsConfig.defaultMessagesFile)).toString()); + } catch (error) { + console.error(`Error reading default NLS messages file ${nlsConfig.defaultMessagesFile}: ${error}`); + } + } + } + + performance.mark('code/amd/didLoadNls'); + + return nlsConfig; } +//#endregion + +//#region Loader Config + +// ESM-uncomment-begin /** * @param {string=} entrypoint - * @param {(value: any) => void=} onLoad - * @param {(err: Error) => void=} onError + * @param {(value: any) => void} [onLoad] + * @param {(err: Error) => void} [onError] */ -exports.load = function (entrypoint, onLoad, onError) { +module.exports.load = function (entrypoint, onLoad, onError) { if (!entrypoint) { return; } - // code cache config - if (process.env['VSCODE_CODE_CACHE_PATH']) { - loader.config({ - nodeCachedData: { - path: process.env['VSCODE_CODE_CACHE_PATH'], - seed: entrypoint - } - }); - } + entrypoint = `./${entrypoint}.js`; onLoad = onLoad || function () { }; onError = onError || function (err) { console.error(err); }; - performance.mark('code/fork/willLoadCode'); - loader([entrypoint], onLoad, onError); + setupNLS().then(() => { + performance.mark(`code/fork/willLoadCode`); + import(entrypoint).then(onLoad, onError); + }); }; +// ESM-uncomment-end + +// ESM-comment-begin +// // @ts-ignore +// const loader = require('./vs/loader'); +// +// loader.config({ +// baseUrl: bootstrapNode.fileUriFromPath(__dirname, { isWindows: process.platform === 'win32' }), +// catchError: true, +// nodeRequire, +// amdModulesPattern: /^vs\//, +// recordStats: true +// }); +// +// // Running in Electron +// if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) { +// loader.define('fs', ['original-fs'], function (/** @type {import('fs')} */originalFS) { +// return originalFS; // replace the patched electron fs with the original node fs for all AMD code +// }); +// } +// +// /** +// * @param {string=} entrypoint +// * @param {(value: any) => void} [onLoad] +// * @param {(err: Error) => void} [onError] +// */ +// module.exports.load = function (entrypoint, onLoad, onError) { +// if (!entrypoint) { +// return; +// } +// +// // code cache config +// if (process.env['VSCODE_CODE_CACHE_PATH']) { +// loader.config({ +// nodeCachedData: { +// path: process.env['VSCODE_CODE_CACHE_PATH'], +// seed: entrypoint +// } +// }); +// } +// +// onLoad = onLoad || function () { }; +// onError = onError || function (err) { console.error(err); }; +// +// setupNLS().then(() => { +// performance.mark('code/fork/willLoadCode'); +// loader([entrypoint], onLoad, onError); +// }); +// }; +// ESM-comment-end + +//#endregion + +// ESM-uncomment-begin +export const load = module.exports.load; +// ESM-uncomment-end diff --git a/extensions/markdown-language-features/server/extension.webpack.config.js b/src/bootstrap-cli.js similarity index 55% rename from extensions/markdown-language-features/server/extension.webpack.config.js rename to src/bootstrap-cli.js index aafc9c1fd96..8f077a0eeaf 100644 --- a/extensions/markdown-language-features/server/extension.webpack.config.js +++ b/src/bootstrap-cli.js @@ -4,19 +4,11 @@ *--------------------------------------------------------------------------------------------*/ //@ts-check - 'use strict'; -const withDefaults = require('../../shared.webpack.config'); -const path = require('path'); - -module.exports = withDefaults({ - context: path.join(__dirname), - entry: { - extension: './src/node/workerMain.ts', - }, - output: { - filename: 'workerMain.js', - path: path.join(__dirname, 'dist', 'node'), - } -}); +// Delete `VSCODE_CWD` very early. We have seen +// reports where `code .` would use the wrong +// current working directory due to our variable +// somehow escaping to the parent shell +// (https://github.com/microsoft/vscode/issues/126399) +delete process.env['VSCODE_CWD']; diff --git a/src/bootstrap-fork.js b/src/bootstrap-fork.js index 9de1e6f0d15..129517b608e 100644 --- a/src/bootstrap-fork.js +++ b/src/bootstrap-fork.js @@ -6,23 +6,30 @@ //@ts-check 'use strict'; -const performance = require('./vs/base/common/performance'); -performance.mark('code/fork/start'); +// ESM-comment-begin +// const performance = require('./vs/base/common/performance'); +// const bootstrapNode = require('./bootstrap-node'); +// const bootstrapAmd = require('./bootstrap-amd'); +// ESM-comment-end +// ESM-uncomment-begin +import * as performance from './vs/base/common/performance.js'; +import * as bootstrapNode from './bootstrap-node.js'; +import * as bootstrapAmd from './bootstrap-amd.js'; +// ESM-uncomment-end -const bootstrap = require('./bootstrap'); -const bootstrapNode = require('./bootstrap-node'); +performance.mark('code/fork/start'); // Crash reporter configureCrashReporter(); -// Remove global paths from the node module lookup -bootstrapNode.removeGlobalNodeModuleLookupPaths(); +// Remove global paths from the node module lookup (node.js only) +bootstrapNode.removeGlobalNodeJsModuleLookupPaths(); // Enable ASAR in our forked processes -bootstrap.enableASARSupport(); +bootstrapNode.enableASARSupport(); -if (process.env['VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH']) { - bootstrapNode.injectNodeModuleLookupPath(process.env['VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH']); +if (process.env['VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH']) { + bootstrapNode.devInjectNodeModuleLookupPath(process.env['VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH']); } // Configure: pipe logging to parent process @@ -41,7 +48,7 @@ if (process.env['VSCODE_PARENT_PID']) { } // Load AMD entry point -require('./bootstrap-amd').load(process.env['VSCODE_AMD_ENTRYPOINT']); +bootstrapAmd.load(process.env['VSCODE_AMD_ENTRYPOINT']); //#region Helpers diff --git a/src/bootstrap-import.js b/src/bootstrap-import.js new file mode 100644 index 00000000000..070b0b93b4b --- /dev/null +++ b/src/bootstrap-import.js @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +//@ts-check + +// ********************************************************************* +// * * +// * We need this to redirect to node_modules from the remote-folder. * +// * This ONLY applies when running out of source. * +// * * +// ********************************************************************* + +import { fileURLToPath, pathToFileURL } from 'node:url'; +import { promises } from 'node:fs'; +import { join } from 'node:path'; + +// SEE https://nodejs.org/docs/latest/api/module.html#initialize + +/** + * @type {Object.} + */ +const _specifierToUrl = {}; + +/** + * @param {string} injectPath + */ +export async function initialize(injectPath) { + // populate mappings + + const injectPackageJSONPath = fileURLToPath(new URL('../package.json', pathToFileURL(injectPath))); + const packageJSON = JSON.parse(String(await promises.readFile(injectPackageJSONPath))); + + for (const [name] of Object.entries(packageJSON.dependencies)) { + try { + const path = join(injectPackageJSONPath, `../node_modules/${name}/package.json`); + let { main } = JSON.parse(String(await promises.readFile(path))); + + if (!main) { + main = 'index.js'; + } + if (!main.endsWith('.js')) { + main += '.js'; + } + const mainPath = join(injectPackageJSONPath, `../node_modules/${name}/${main}`); + _specifierToUrl[name] = pathToFileURL(mainPath).href; + + } catch (err) { + console.error(name); + console.error(err); + } + } + + console.log(`[bootstrap-import] Initialized node_modules redirector for: ${injectPath}`); +} + +/** + * @param {string | number} specifier + * @param {any} context + * @param {(arg0: any, arg1: any) => any} nextResolve + */ +export async function resolve(specifier, context, nextResolve) { + + const newSpecifier = _specifierToUrl[specifier]; + if (newSpecifier !== undefined) { + // console.log('[HOOKS]', specifier, '--->', newSpecifier); + return { + format: 'commonjs', + shortCircuit: true, + url: newSpecifier + }; + } + + // Defer to the next hook in the chain, which would be the + // Node.js default resolve if this is the last user-specified loader. + return nextResolve(specifier, context); +} diff --git a/src/bootstrap-meta.js b/src/bootstrap-meta.js new file mode 100644 index 00000000000..f9a968c82f5 --- /dev/null +++ b/src/bootstrap-meta.js @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +//@ts-check +'use strict'; + +/** + * @import { IProductConfiguration } from './vs/base/common/product' + */ + +// ESM-uncomment-begin +import { createRequire } from 'node:module'; + +const require = createRequire(import.meta.url); +/** @type any */ +const module = { exports: {} }; +// ESM-uncomment-end + +/** @type Partial & { BUILD_INSERT_PRODUCT_CONFIGURATION?: string } */ +let productObj = { BUILD_INSERT_PRODUCT_CONFIGURATION: 'BUILD_INSERT_PRODUCT_CONFIGURATION' }; // DO NOT MODIFY, PATCHED DURING BUILD +if (productObj['BUILD_INSERT_PRODUCT_CONFIGURATION']) { + // @ts-ignore + productObj = require('../product.json'); // Running out of sources +} + +/** @type object & { BUILD_INSERT_PACKAGE_CONFIGURATION?: string } */ +let pkgObj = { BUILD_INSERT_PACKAGE_CONFIGURATION: 'BUILD_INSERT_PACKAGE_CONFIGURATION' }; // DO NOT MODIFY, PATCHED DURING BUILD +if (pkgObj['BUILD_INSERT_PACKAGE_CONFIGURATION']) { + // @ts-ignore + pkgObj = require('../package.json'); // Running out of sources +} + +module.exports.product = productObj; +module.exports.pkg = pkgObj; + +// ESM-uncomment-begin +export const product = module.exports.product; +export const pkg = module.exports.pkg; +// ESM-uncomment-end diff --git a/src/bootstrap-node.js b/src/bootstrap-node.js index 914b8290380..d9e8e7e9945 100644 --- a/src/bootstrap-node.js +++ b/src/bootstrap-node.js @@ -6,12 +6,46 @@ //@ts-check 'use strict'; +// ESM-comment-begin +// const path = require('path'); +// const fs = require('fs'); +// const Module = require('module'); +// ESM-comment-end +// ESM-uncomment-begin +import * as path from 'path'; +import * as fs from 'fs'; +import { fileURLToPath } from 'url'; +import { createRequire } from 'node:module'; + +/** @ts-ignore */ +const require = createRequire(import.meta.url); +/** @type any */ +const module = { exports: {} }; +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +// ESM-uncomment-end + +// increase number of stack frames(from 10, https://github.com/v8/v8/wiki/Stack-Trace-API) +Error.stackTraceLimit = 100; + +if (!process.env['VSCODE_HANDLES_SIGPIPE']) { + // Workaround for Electron not installing a handler to ignore SIGPIPE + // (https://github.com/electron/electron/issues/13254) + let didLogAboutSIGPIPE = false; + process.on('SIGPIPE', () => { + // See https://github.com/microsoft/vscode-remote-release/issues/6543 + // In certain situations, the console itself can be in a broken pipe state + // so logging SIGPIPE to the console will cause an infinite async loop + if (!didLogAboutSIGPIPE) { + didLogAboutSIGPIPE = true; + console.error(new Error(`Unexpected SIGPIPE`)); + } + }); +} + // Setup current working directory in all our node & electron processes // - Windows: call `process.chdir()` to always set application folder as cwd // - all OS: store the `process.cwd()` inside `VSCODE_CWD` for consistent lookups function setupCurrentWorkingDirectory() { - const path = require('path'); - try { // Store the `process.cwd()` inside `VSCODE_CWD` @@ -36,38 +70,52 @@ setupCurrentWorkingDirectory(); /** * Add support for redirecting the loading of node modules * + * Note: only applies when running out of sources. + * * @param {string} injectPath */ -exports.injectNodeModuleLookupPath = function (injectPath) { +module.exports.devInjectNodeModuleLookupPath = function (injectPath) { + if (!process.env['VSCODE_DEV']) { + return; // only applies running out of sources + } + if (!injectPath) { throw new Error('Missing injectPath'); } - const Module = require('module'); - const path = require('path'); - - const nodeModulesPath = path.join(__dirname, '../node_modules'); - - // @ts-ignore - const originalResolveLookupPaths = Module._resolveLookupPaths; - - // @ts-ignore - Module._resolveLookupPaths = function (moduleName, parent) { - const paths = originalResolveLookupPaths(moduleName, parent); - if (Array.isArray(paths)) { - for (let i = 0, len = paths.length; i < len; i++) { - if (paths[i] === nodeModulesPath) { - paths.splice(i, 0, injectPath); - break; - } - } - } - - return paths; - }; + const Module = require('node:module'); + // ESM-uncomment-begin + // register a loader hook + Module.register('./bootstrap-import.js', { parentURL: import.meta.url, data: injectPath }); + // ESM-uncomment-end + // ESM-comment-begin + // const nodeModulesPath = path.join(__dirname, '../node_modules'); + // + // // @ts-ignore + // const originalResolveLookupPaths = Module._resolveLookupPaths; + // + // // @ts-ignore + // Module._resolveLookupPaths = function (moduleName, parent) { + // const paths = originalResolveLookupPaths(moduleName, parent); + // if (Array.isArray(paths)) { + // for (let i = 0, len = paths.length; i < len; i++) { + // if (paths[i] === nodeModulesPath) { + // paths.splice(i, 0, injectPath); + // break; + // } + // } + // } + // + // return paths; + // }; + // ESM-comment-end }; -exports.removeGlobalNodeModuleLookupPaths = function () { +module.exports.removeGlobalNodeJsModuleLookupPaths = function () { + if (typeof process?.versions?.electron === 'string') { + return; // Electron disables global search paths in https://github.com/electron/electron/blob/3186c2f0efa92d275dc3d57b5a14a60ed3846b0e/shell/common/node_bindings.cc#L653 + } + const Module = require('module'); // @ts-ignore const globalPaths = Module.globalPaths; @@ -95,10 +143,7 @@ exports.removeGlobalNodeModuleLookupPaths = function () { * @param {Partial} product * @returns {{ portableDataPath: string; isPortable: boolean; }} */ -exports.configurePortable = function (product) { - const fs = require('fs'); - const path = require('path'); - +module.exports.configurePortable = function (product) { const appRoot = path.dirname(__dirname); /** @@ -158,3 +203,77 @@ exports.configurePortable = function (product) { isPortable }; }; + +/** + * Helper to enable ASAR support. + */ +module.exports.enableASARSupport = function () { + // ESM-comment-begin + // const NODE_MODULES_PATH = path.join(__dirname, '../node_modules'); + // const NODE_MODULES_ASAR_PATH = `${NODE_MODULES_PATH}.asar`; + // + // // @ts-ignore + // const originalResolveLookupPaths = Module._resolveLookupPaths; + // + // // @ts-ignore + // Module._resolveLookupPaths = function (request, parent) { + // const paths = originalResolveLookupPaths(request, parent); + // if (Array.isArray(paths)) { + // for (let i = 0, len = paths.length; i < len; i++) { + // if (paths[i] === NODE_MODULES_PATH) { + // paths.splice(i, 0, NODE_MODULES_ASAR_PATH); + // break; + // } + // } + // } + // + // return paths; + // }; + // ESM-comment-end +}; + +/** + * Helper to convert a file path to a URI. + * + * TODO@bpasero TODO@esm check for removal once ESM has landed. + * + * @param {string} path + * @param {{ isWindows?: boolean, scheme?: string, fallbackAuthority?: string }} config + * @returns {string} + */ +module.exports.fileUriFromPath = function (path, config) { + + // Since we are building a URI, we normalize any backslash + // to slashes and we ensure that the path begins with a '/'. + let pathName = path.replace(/\\/g, '/'); + if (pathName.length > 0 && pathName.charAt(0) !== '/') { + pathName = `/${pathName}`; + } + + /** @type {string} */ + let uri; + + // Windows: in order to support UNC paths (which start with '//') + // that have their own authority, we do not use the provided authority + // but rather preserve it. + if (config.isWindows && pathName.startsWith('//')) { + uri = encodeURI(`${config.scheme || 'file'}:${pathName}`); + } + + // Otherwise we optionally add the provided authority if specified + else { + uri = encodeURI(`${config.scheme || 'file'}://${config.fallbackAuthority || ''}${pathName}`); + } + + return uri.replace(/#/g, '%23'); +}; + +//#endregion + +// ESM-uncomment-begin +export const devInjectNodeModuleLookupPath = module.exports.devInjectNodeModuleLookupPath; +export const removeGlobalNodeJsModuleLookupPaths = module.exports.removeGlobalNodeJsModuleLookupPaths; +export const configurePortable = module.exports.configurePortable; +export const enableASARSupport = module.exports.enableASARSupport; +export const fileUriFromPath = module.exports.fileUriFromPath; +// ESM-uncomment-end diff --git a/src/vs/workbench/workbench.desktop.main.nls.js b/src/bootstrap-server.js similarity index 75% rename from src/vs/workbench/workbench.desktop.main.nls.js rename to src/bootstrap-server.js index d6a8b487eaf..b84cc6a6ef6 100644 --- a/src/vs/workbench/workbench.desktop.main.nls.js +++ b/src/bootstrap-server.js @@ -3,6 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -// NOTE: THIS FILE WILL BE OVERWRITTEN DURING BUILD TIME, DO NOT EDIT +//@ts-check +'use strict'; -define([], {}); \ No newline at end of file +// Keep bootstrap-amd.js from redefining 'fs'. +delete process.env['ELECTRON_RUN_AS_NODE']; diff --git a/src/bootstrap-window.js b/src/bootstrap-window.js index d231657094d..9b5ed26e6c6 100644 --- a/src/bootstrap-window.js +++ b/src/bootstrap-window.js @@ -10,28 +10,21 @@ /** * @import { ISandboxConfiguration } from './vs/base/parts/sandbox/common/sandboxTypes' + * @typedef {any} LoaderConfig */ /* eslint-disable no-restricted-globals */ -// Simple module style to support node.js and browser environments -(function (globalThis, factory) { - - // Node.js - if (typeof exports === 'object') { - module.exports = factory(); - } - - // Browser - else { - // @ts-ignore - globalThis.MonacoBootstrapWindow = factory(); - } -}(this, function () { - const bootstrapLib = bootstrap(); +(function (factory) { + // @ts-ignore + globalThis.MonacoBootstrapWindow = factory(); +}(function () { const preloadGlobals = sandboxGlobals(); const safeProcess = preloadGlobals.process; + // increase number of stack frames(from 10, https://github.com/v8/v8/wiki/Stack-Trace-API) + Error.stackTraceLimit = 100; + /** * @param {string[]} modulePaths * @param {(result: unknown, configuration: ISandboxConfiguration) => Promise | undefined} resultCallback @@ -82,85 +75,150 @@ developerDeveloperKeybindingsDisposable = registerDeveloperKeybindings(disallowReloadKeybinding); } - // Get the nls configuration into the process.env as early as possible - // @ts-ignore - const nlsConfig = globalThis.MonacoBootstrap.setupNLS(); - - let locale = nlsConfig.availableLanguages['*'] || 'en'; - if (locale === 'zh-tw') { - locale = 'zh-Hant'; - } else if (locale === 'zh-cn') { - locale = 'zh-Hans'; + globalThis._VSCODE_NLS_MESSAGES = configuration.nls.messages; + globalThis._VSCODE_NLS_LANGUAGE = configuration.nls.language; + let language = configuration.nls.language || 'en'; + if (language === 'zh-tw') { + language = 'zh-Hant'; + } else if (language === 'zh-cn') { + language = 'zh-Hans'; } - window.document.documentElement.setAttribute('lang', locale); + window.document.documentElement.setAttribute('lang', language); window['MonacoEnvironment'] = {}; - /** - * @typedef {any} LoaderConfig - */ - /** @type {LoaderConfig} */ - const loaderConfig = { - baseUrl: `${bootstrapLib.fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out`, - 'vs/nls': nlsConfig, - preferScriptTags: true - }; + // ESM-uncomment-begin + // Signal before require() + if (typeof options?.beforeRequire === 'function') { + options.beforeRequire(configuration); + } - // use a trusted types policy when loading via script tags - loaderConfig.trustedTypesPolicy = window.trustedTypes?.createPolicy('amdLoader', { - createScriptURL(value) { - if (value.startsWith(window.location.origin)) { - return value; - } - throw new Error(`Invalid script url: ${value}`); - } - }); - - // Teach the loader the location of the node modules we use in renderers - // This will enable to load these modules via + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/vs/code/browser/workbench/workbench.esm.html b/src/vs/code/browser/workbench/workbench.esm.html new file mode 100644 index 00000000000..77881982735 --- /dev/null +++ b/src/vs/code/browser/workbench/workbench.esm.html @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/vs/code/browser/workbench/workbench.html b/src/vs/code/browser/workbench/workbench.html index 700231f0357..a4e95165cfb 100644 --- a/src/vs/code/browser/workbench/workbench.html +++ b/src/vs/code/browser/workbench/workbench.html @@ -36,25 +36,14 @@ - - + + + + + diff --git a/src/vs/code/browser/workbench/workbench.ts b/src/vs/code/browser/workbench/workbench.ts index f8875029a8a..b98867e7ac3 100644 --- a/src/vs/code/browser/workbench/workbench.ts +++ b/src/vs/code/browser/workbench/workbench.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isStandalone } from 'vs/base/browser/browser'; -import { mainWindow } from 'vs/base/browser/window'; -import { VSBuffer, decodeBase64, encodeBase64 } from 'vs/base/common/buffer'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { parse } from 'vs/base/common/marshalling'; -import { Schemas } from 'vs/base/common/network'; -import { posix } from 'vs/base/common/path'; -import { isEqual } from 'vs/base/common/resources'; -import { ltrim } from 'vs/base/common/strings'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import product from 'vs/platform/product/common/product'; -import { ISecretStorageProvider } from 'vs/platform/secrets/common/secrets'; -import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/window/common/window'; -import type { IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from 'vs/workbench/browser/web.api'; -import { AuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService'; -import type { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService'; -import { create } from 'vs/workbench/workbench.web.main'; +import { isStandalone } from '../../../base/browser/browser.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { VSBuffer, decodeBase64, encodeBase64 } from '../../../base/common/buffer.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { parse } from '../../../base/common/marshalling.js'; +import { Schemas } from '../../../base/common/network.js'; +import { posix } from '../../../base/common/path.js'; +import { isEqual } from '../../../base/common/resources.js'; +import { ltrim } from '../../../base/common/strings.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import product from '../../../platform/product/common/product.js'; +import { ISecretStorageProvider } from '../../../platform/secrets/common/secrets.js'; +import { isFolderToOpen, isWorkspaceToOpen } from '../../../platform/window/common/window.js'; +import type { IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from '../../../workbench/browser/web.api.js'; +import { AuthenticationSessionInfo } from '../../../workbench/services/authentication/browser/authenticationService.js'; +import type { IURLCallbackProvider } from '../../../workbench/services/url/browser/urlService.js'; +import { create } from '../../../workbench/workbench.web.main.internal.js'; interface ISecretStorageCrypto { seal(data: string): Promise; diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 1c4a565adec..14f282ce406 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -4,124 +4,123 @@ *--------------------------------------------------------------------------------------------*/ import { app, BrowserWindow, protocol, session, Session, systemPreferences, WebFrameMain } from 'electron'; -import { addUNCHostToAllowlist, disableUNCAccessRestrictions } from 'vs/base/node/unc'; -import { validatedIpcMain } from 'vs/base/parts/ipc/electron-main/ipcMain'; +import { addUNCHostToAllowlist, disableUNCAccessRestrictions } from '../../base/node/unc.js'; +import { validatedIpcMain } from '../../base/parts/ipc/electron-main/ipcMain.js'; import { hostname, release } from 'os'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { isSigPipeError, onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors'; -import { isEqualOrParent } from 'vs/base/common/extpath'; -import { Event } from 'vs/base/common/event'; -import { parse } from 'vs/base/common/jsonc'; -import { getPathLabel } from 'vs/base/common/labels'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { Schemas, VSCODE_AUTHORITY } from 'vs/base/common/network'; -import { isAbsolute, join, posix } from 'vs/base/common/path'; -import { IProcessEnvironment, isLinux, isLinuxSnap, isMacintosh, isWindows, OS } from 'vs/base/common/platform'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { registerContextMenuListener } from 'vs/base/parts/contextmenu/electron-main/contextmenu'; -import { getDelayedChannel, ProxyChannel, StaticRouter } from 'vs/base/parts/ipc/common/ipc'; -import { Server as ElectronIPCServer } from 'vs/base/parts/ipc/electron-main/ipc.electron'; -import { Client as MessagePortClient } from 'vs/base/parts/ipc/electron-main/ipc.mp'; -import { Server as NodeIPCServer } from 'vs/base/parts/ipc/node/ipc.net'; -import { ProxyAuthHandler } from 'vs/code/electron-main/auth'; -import { localize } from 'vs/nls'; -import { IBackupMainService } from 'vs/platform/backup/electron-main/backup'; -import { BackupMainService } from 'vs/platform/backup/electron-main/backupMainService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ElectronExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/electron-main/extensionHostDebugIpc'; -import { IDiagnosticsService } from 'vs/platform/diagnostics/common/diagnostics'; -import { DiagnosticsMainService, IDiagnosticsMainService } from 'vs/platform/diagnostics/electron-main/diagnosticsMainService'; -import { DialogMainService, IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMainService'; -import { IEncryptionMainService } from 'vs/platform/encryption/common/encryptionService'; -import { EncryptionMainService } from 'vs/platform/encryption/electron-main/encryptionMainService'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { isLaunchedFromCli } from 'vs/platform/environment/node/argvHelper'; -import { getResolvedShellEnv } from 'vs/platform/shell/node/shellEnv'; -import { IExtensionHostStarter, ipcExtensionHostStarterChannelName } from 'vs/platform/extensions/common/extensionHostStarter'; -import { ExtensionHostStarter } from 'vs/platform/extensions/electron-main/extensionHostStarter'; -import { IExternalTerminalMainService } from 'vs/platform/externalTerminal/electron-main/externalTerminal'; -import { LinuxExternalTerminalService, MacExternalTerminalService, WindowsExternalTerminalService } from 'vs/platform/externalTerminal/node/externalTerminalService'; -import { LOCAL_FILE_SYSTEM_CHANNEL_NAME } from 'vs/platform/files/common/diskFileSystemProviderClient'; -import { IFileService } from 'vs/platform/files/common/files'; -import { DiskFileSystemProviderChannel } from 'vs/platform/files/electron-main/diskFileSystemProviderServer'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IIssueMainService, IProcessMainService } from 'vs/platform/issue/common/issue'; -import { IssueMainService } from 'vs/platform/issue/electron-main/issueMainService'; -import { ProcessMainService } from 'vs/platform/issue/electron-main/processMainService'; -import { IKeyboardLayoutMainService, KeyboardLayoutMainService } from 'vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService'; -import { ILaunchMainService, LaunchMainService } from 'vs/platform/launch/electron-main/launchMainService'; -import { ILifecycleMainService, LifecycleMainPhase, ShutdownReason } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILoggerService, ILogService } from 'vs/platform/log/common/log'; -import { IMenubarMainService, MenubarMainService } from 'vs/platform/menubar/electron-main/menubarMainService'; -import { INativeHostMainService, NativeHostMainService } from 'vs/platform/native/electron-main/nativeHostMainService'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { getRemoteAuthority } from 'vs/platform/remote/common/remoteHosts'; -import { SharedProcess } from 'vs/platform/sharedProcess/electron-main/sharedProcess'; -import { ISignService } from 'vs/platform/sign/common/sign'; -import { IStateService } from 'vs/platform/state/node/state'; -import { StorageDatabaseChannel } from 'vs/platform/storage/electron-main/storageIpc'; -import { ApplicationStorageMainService, IApplicationStorageMainService, IStorageMainService, StorageMainService } from 'vs/platform/storage/electron-main/storageMainService'; -import { resolveCommonProperties } from 'vs/platform/telemetry/common/commonProperties'; -import { ITelemetryService, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { TelemetryAppenderClient } from 'vs/platform/telemetry/common/telemetryIpc'; -import { ITelemetryServiceConfig, TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; -import { getPiiPathsFromEnvironment, getTelemetryLevel, isInternalTelemetry, NullTelemetryService, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IUpdateService } from 'vs/platform/update/common/update'; -import { UpdateChannel } from 'vs/platform/update/common/updateIpc'; -import { DarwinUpdateService } from 'vs/platform/update/electron-main/updateService.darwin'; -import { LinuxUpdateService } from 'vs/platform/update/electron-main/updateService.linux'; -import { SnapUpdateService } from 'vs/platform/update/electron-main/updateService.snap'; -import { Win32UpdateService } from 'vs/platform/update/electron-main/updateService.win32'; -import { IOpenURLOptions, IURLService } from 'vs/platform/url/common/url'; -import { URLHandlerChannelClient, URLHandlerRouter } from 'vs/platform/url/common/urlIpc'; -import { NativeURLService } from 'vs/platform/url/common/urlService'; -import { ElectronURLListener } from 'vs/platform/url/electron-main/electronUrlListener'; -import { IWebviewManagerService } from 'vs/platform/webview/common/webviewManagerService'; -import { WebviewMainService } from 'vs/platform/webview/electron-main/webviewMainService'; -import { isFolderToOpen, isWorkspaceToOpen, IWindowOpenable } from 'vs/platform/window/common/window'; -import { IWindowsMainService, OpenContext } from 'vs/platform/windows/electron-main/windows'; -import { ICodeWindow } from 'vs/platform/window/electron-main/window'; -import { WindowsMainService } from 'vs/platform/windows/electron-main/windowsMainService'; -import { ActiveWindowManager } from 'vs/platform/windows/node/windowTracker'; -import { hasWorkspaceFileExtension } from 'vs/platform/workspace/common/workspace'; -import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; -import { IWorkspacesHistoryMainService, WorkspacesHistoryMainService } from 'vs/platform/workspaces/electron-main/workspacesHistoryMainService'; -import { WorkspacesMainService } from 'vs/platform/workspaces/electron-main/workspacesMainService'; -import { IWorkspacesManagementMainService, WorkspacesManagementMainService } from 'vs/platform/workspaces/electron-main/workspacesManagementMainService'; -import { IPolicyService } from 'vs/platform/policy/common/policy'; -import { PolicyChannel } from 'vs/platform/policy/common/policyIpc'; -import { IUserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile'; -import { RequestChannel } from 'vs/platform/request/common/requestIpc'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService'; -import { ExtensionsScannerService } from 'vs/platform/extensionManagement/node/extensionsScannerService'; -import { UserDataProfilesHandler } from 'vs/platform/userDataProfile/electron-main/userDataProfilesHandler'; -import { ProfileStorageChangesListenerChannel } from 'vs/platform/userDataProfile/electron-main/userDataProfileStorageIpc'; -import { Promises, RunOnceScheduler, runWhenGlobalIdle } from 'vs/base/common/async'; -import { resolveMachineId, resolveSqmId, resolvedevDeviceId } from 'vs/platform/telemetry/electron-main/telemetryUtils'; -import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService'; -import { LoggerChannel } from 'vs/platform/log/electron-main/logIpc'; -import { ILoggerMainService } from 'vs/platform/log/electron-main/loggerService'; -import { IInitialProtocolUrls, IProtocolUrl } from 'vs/platform/url/electron-main/url'; -import { IUtilityProcessWorkerMainService, UtilityProcessWorkerMainService } from 'vs/platform/utilityProcess/electron-main/utilityProcessWorkerMainService'; -import { ipcUtilityProcessWorkerChannelName } from 'vs/platform/utilityProcess/common/utilityProcessWorkerService'; -import { firstOrDefault } from 'vs/base/common/arrays'; -import { ILocalPtyService, LocalReconnectConstants, TerminalIpcChannels, TerminalSettingId } from 'vs/platform/terminal/common/terminal'; -import { ElectronPtyHostStarter } from 'vs/platform/terminal/electron-main/electronPtyHostStarter'; -import { PtyHostService } from 'vs/platform/terminal/node/ptyHostService'; -import { NODE_REMOTE_RESOURCE_CHANNEL_NAME, NODE_REMOTE_RESOURCE_IPC_METHOD_NAME, NodeRemoteResourceResponse, NodeRemoteResourceRouter } from 'vs/platform/remote/common/electronRemoteResources'; -import { Lazy } from 'vs/base/common/lazy'; -import { IAuxiliaryWindowsMainService } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindows'; -import { AuxiliaryWindowsMainService } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindowsMainService'; -import { normalizeNFC } from 'vs/base/common/normalization'; +import { VSBuffer } from '../../base/common/buffer.js'; +import { toErrorMessage } from '../../base/common/errorMessage.js'; +import { isSigPipeError, onUnexpectedError, setUnexpectedErrorHandler } from '../../base/common/errors.js'; +import { Event } from '../../base/common/event.js'; +import { parse } from '../../base/common/jsonc.js'; +import { getPathLabel } from '../../base/common/labels.js'; +import { Disposable, DisposableStore } from '../../base/common/lifecycle.js'; +import { Schemas, VSCODE_AUTHORITY } from '../../base/common/network.js'; +import { join, posix } from '../../base/common/path.js'; +import { IProcessEnvironment, isLinux, isLinuxSnap, isMacintosh, isWindows, OS } from '../../base/common/platform.js'; +import { assertType } from '../../base/common/types.js'; +import { URI } from '../../base/common/uri.js'; +import { generateUuid } from '../../base/common/uuid.js'; +import { registerContextMenuListener } from '../../base/parts/contextmenu/electron-main/contextmenu.js'; +import { getDelayedChannel, ProxyChannel, StaticRouter } from '../../base/parts/ipc/common/ipc.js'; +import { Server as ElectronIPCServer } from '../../base/parts/ipc/electron-main/ipc.electron.js'; +import { Client as MessagePortClient } from '../../base/parts/ipc/electron-main/ipc.mp.js'; +import { Server as NodeIPCServer } from '../../base/parts/ipc/node/ipc.net.js'; +import { IProxyAuthService, ProxyAuthService } from '../../platform/native/electron-main/auth.js'; +import { localize } from '../../nls.js'; +import { IBackupMainService } from '../../platform/backup/electron-main/backup.js'; +import { BackupMainService } from '../../platform/backup/electron-main/backupMainService.js'; +import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; +import { ElectronExtensionHostDebugBroadcastChannel } from '../../platform/debug/electron-main/extensionHostDebugIpc.js'; +import { IDiagnosticsService } from '../../platform/diagnostics/common/diagnostics.js'; +import { DiagnosticsMainService, IDiagnosticsMainService } from '../../platform/diagnostics/electron-main/diagnosticsMainService.js'; +import { DialogMainService, IDialogMainService } from '../../platform/dialogs/electron-main/dialogMainService.js'; +import { IEncryptionMainService } from '../../platform/encryption/common/encryptionService.js'; +import { EncryptionMainService } from '../../platform/encryption/electron-main/encryptionMainService.js'; +import { NativeParsedArgs } from '../../platform/environment/common/argv.js'; +import { IEnvironmentMainService } from '../../platform/environment/electron-main/environmentMainService.js'; +import { isLaunchedFromCli } from '../../platform/environment/node/argvHelper.js'; +import { getResolvedShellEnv } from '../../platform/shell/node/shellEnv.js'; +import { IExtensionHostStarter, ipcExtensionHostStarterChannelName } from '../../platform/extensions/common/extensionHostStarter.js'; +import { ExtensionHostStarter } from '../../platform/extensions/electron-main/extensionHostStarter.js'; +import { IExternalTerminalMainService } from '../../platform/externalTerminal/electron-main/externalTerminal.js'; +import { LinuxExternalTerminalService, MacExternalTerminalService, WindowsExternalTerminalService } from '../../platform/externalTerminal/node/externalTerminalService.js'; +import { LOCAL_FILE_SYSTEM_CHANNEL_NAME } from '../../platform/files/common/diskFileSystemProviderClient.js'; +import { IFileService } from '../../platform/files/common/files.js'; +import { DiskFileSystemProviderChannel } from '../../platform/files/electron-main/diskFileSystemProviderServer.js'; +import { DiskFileSystemProvider } from '../../platform/files/node/diskFileSystemProvider.js'; +import { SyncDescriptor } from '../../platform/instantiation/common/descriptors.js'; +import { IInstantiationService, ServicesAccessor } from '../../platform/instantiation/common/instantiation.js'; +import { ServiceCollection } from '../../platform/instantiation/common/serviceCollection.js'; +import { IProcessMainService, IIssueMainService } from '../../platform/issue/common/issue.js'; +import { IssueMainService } from '../../platform/issue/electron-main/issueMainService.js'; +import { ProcessMainService } from '../../platform/issue/electron-main/processMainService.js'; +import { IKeyboardLayoutMainService, KeyboardLayoutMainService } from '../../platform/keyboardLayout/electron-main/keyboardLayoutMainService.js'; +import { ILaunchMainService, LaunchMainService } from '../../platform/launch/electron-main/launchMainService.js'; +import { ILifecycleMainService, LifecycleMainPhase, ShutdownReason } from '../../platform/lifecycle/electron-main/lifecycleMainService.js'; +import { ILoggerService, ILogService } from '../../platform/log/common/log.js'; +import { IMenubarMainService, MenubarMainService } from '../../platform/menubar/electron-main/menubarMainService.js'; +import { INativeHostMainService, NativeHostMainService } from '../../platform/native/electron-main/nativeHostMainService.js'; +import { IProductService } from '../../platform/product/common/productService.js'; +import { getRemoteAuthority } from '../../platform/remote/common/remoteHosts.js'; +import { SharedProcess } from '../../platform/sharedProcess/electron-main/sharedProcess.js'; +import { ISignService } from '../../platform/sign/common/sign.js'; +import { IStateService } from '../../platform/state/node/state.js'; +import { StorageDatabaseChannel } from '../../platform/storage/electron-main/storageIpc.js'; +import { ApplicationStorageMainService, IApplicationStorageMainService, IStorageMainService, StorageMainService } from '../../platform/storage/electron-main/storageMainService.js'; +import { resolveCommonProperties } from '../../platform/telemetry/common/commonProperties.js'; +import { ITelemetryService, TelemetryLevel } from '../../platform/telemetry/common/telemetry.js'; +import { TelemetryAppenderClient } from '../../platform/telemetry/common/telemetryIpc.js'; +import { ITelemetryServiceConfig, TelemetryService } from '../../platform/telemetry/common/telemetryService.js'; +import { getPiiPathsFromEnvironment, getTelemetryLevel, isInternalTelemetry, NullTelemetryService, supportsTelemetry } from '../../platform/telemetry/common/telemetryUtils.js'; +import { IUpdateService } from '../../platform/update/common/update.js'; +import { UpdateChannel } from '../../platform/update/common/updateIpc.js'; +import { DarwinUpdateService } from '../../platform/update/electron-main/updateService.darwin.js'; +import { LinuxUpdateService } from '../../platform/update/electron-main/updateService.linux.js'; +import { SnapUpdateService } from '../../platform/update/electron-main/updateService.snap.js'; +import { Win32UpdateService } from '../../platform/update/electron-main/updateService.win32.js'; +import { IOpenURLOptions, IURLService } from '../../platform/url/common/url.js'; +import { URLHandlerChannelClient, URLHandlerRouter } from '../../platform/url/common/urlIpc.js'; +import { NativeURLService } from '../../platform/url/common/urlService.js'; +import { ElectronURLListener } from '../../platform/url/electron-main/electronUrlListener.js'; +import { IWebviewManagerService } from '../../platform/webview/common/webviewManagerService.js'; +import { WebviewMainService } from '../../platform/webview/electron-main/webviewMainService.js'; +import { isFolderToOpen, isWorkspaceToOpen, IWindowOpenable } from '../../platform/window/common/window.js'; +import { IWindowsMainService, OpenContext } from '../../platform/windows/electron-main/windows.js'; +import { ICodeWindow } from '../../platform/window/electron-main/window.js'; +import { WindowsMainService } from '../../platform/windows/electron-main/windowsMainService.js'; +import { ActiveWindowManager } from '../../platform/windows/node/windowTracker.js'; +import { hasWorkspaceFileExtension } from '../../platform/workspace/common/workspace.js'; +import { IWorkspacesService } from '../../platform/workspaces/common/workspaces.js'; +import { IWorkspacesHistoryMainService, WorkspacesHistoryMainService } from '../../platform/workspaces/electron-main/workspacesHistoryMainService.js'; +import { WorkspacesMainService } from '../../platform/workspaces/electron-main/workspacesMainService.js'; +import { IWorkspacesManagementMainService, WorkspacesManagementMainService } from '../../platform/workspaces/electron-main/workspacesManagementMainService.js'; +import { IPolicyService } from '../../platform/policy/common/policy.js'; +import { PolicyChannel } from '../../platform/policy/common/policyIpc.js'; +import { IUserDataProfilesMainService } from '../../platform/userDataProfile/electron-main/userDataProfile.js'; +import { IExtensionsProfileScannerService } from '../../platform/extensionManagement/common/extensionsProfileScannerService.js'; +import { IExtensionsScannerService } from '../../platform/extensionManagement/common/extensionsScannerService.js'; +import { ExtensionsScannerService } from '../../platform/extensionManagement/node/extensionsScannerService.js'; +import { UserDataProfilesHandler } from '../../platform/userDataProfile/electron-main/userDataProfilesHandler.js'; +import { ProfileStorageChangesListenerChannel } from '../../platform/userDataProfile/electron-main/userDataProfileStorageIpc.js'; +import { Promises, RunOnceScheduler, runWhenGlobalIdle } from '../../base/common/async.js'; +import { resolveMachineId, resolveSqmId, resolvedevDeviceId } from '../../platform/telemetry/electron-main/telemetryUtils.js'; +import { ExtensionsProfileScannerService } from '../../platform/extensionManagement/node/extensionsProfileScannerService.js'; +import { LoggerChannel } from '../../platform/log/electron-main/logIpc.js'; +import { ILoggerMainService } from '../../platform/log/electron-main/loggerService.js'; +import { IInitialProtocolUrls, IProtocolUrl } from '../../platform/url/electron-main/url.js'; +import { IUtilityProcessWorkerMainService, UtilityProcessWorkerMainService } from '../../platform/utilityProcess/electron-main/utilityProcessWorkerMainService.js'; +import { ipcUtilityProcessWorkerChannelName } from '../../platform/utilityProcess/common/utilityProcessWorkerService.js'; +import { ILocalPtyService, LocalReconnectConstants, TerminalIpcChannels, TerminalSettingId } from '../../platform/terminal/common/terminal.js'; +import { ElectronPtyHostStarter } from '../../platform/terminal/electron-main/electronPtyHostStarter.js'; +import { PtyHostService } from '../../platform/terminal/node/ptyHostService.js'; +import { NODE_REMOTE_RESOURCE_CHANNEL_NAME, NODE_REMOTE_RESOURCE_IPC_METHOD_NAME, NodeRemoteResourceResponse, NodeRemoteResourceRouter } from '../../platform/remote/common/electronRemoteResources.js'; +import { Lazy } from '../../base/common/lazy.js'; +import { IAuxiliaryWindowsMainService } from '../../platform/auxiliaryWindow/electron-main/auxiliaryWindows.js'; +import { AuxiliaryWindowsMainService } from '../../platform/auxiliaryWindow/electron-main/auxiliaryWindowsMainService.js'; +import { normalizeNFC } from '../../base/common/normalization.js'; +import { ICSSDevelopmentService, CSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js'; +import { ExtensionSignatureVerificationService, IExtensionSignatureVerificationService } from '../../platform/extensionManagement/node/extensionSignatureVerificationService.js'; + /** * The main VS Code application. There will only ever be one instance, * even if the user starts many instances (e.g. from the command line). @@ -496,24 +495,6 @@ export class CodeApplication extends Disposable { return this.resolveShellEnvironment(args, env, false); }); - validatedIpcMain.handle('vscode:writeNlsFile', (event, path: unknown, data: unknown) => { - const uri = this.validateNlsPath([path]); - if (!uri || typeof data !== 'string') { - throw new Error('Invalid operation (vscode:writeNlsFile)'); - } - - return this.fileService.writeFile(uri, VSBuffer.fromString(data)); - }); - - validatedIpcMain.handle('vscode:readNlsFile', async (event, ...paths: unknown[]) => { - const uri = this.validateNlsPath(paths); - if (!uri) { - throw new Error('Invalid operation (vscode:readNlsFile)'); - } - - return (await this.fileService.readFile(uri)).value.toString(); - }); - validatedIpcMain.on('vscode:toggleDevTools', event => event.sender.toggleDevTools()); validatedIpcMain.on('vscode:openDevTools', event => event.sender.openDevTools()); @@ -529,26 +510,6 @@ export class CodeApplication extends Disposable { //#endregion } - private validateNlsPath(pathSegments: unknown[]): URI | undefined { - let path: string | undefined = undefined; - - for (const pathSegment of pathSegments) { - if (typeof pathSegment === 'string') { - if (typeof path !== 'string') { - path = pathSegment; - } else { - path = join(path, pathSegment); - } - } - } - - if (typeof path !== 'string' || !isAbsolute(path) || !isEqualOrParent(path, this.environmentMainService.cachedLanguagesPath, !isLinux)) { - return undefined; - } - - return URI.file(path); - } - private onUnexpectedError(error: Error): void { if (error) { @@ -625,7 +586,7 @@ export class CodeApplication extends Disposable { const appInstantiationService = await this.initServices(machineId, sqmId, devDeviceId, sharedProcessReady); // Auth Handler - this._register(appInstantiationService.createInstance(ProxyAuthHandler)); + appInstantiationService.invokeFunction(accessor => accessor.get(IProxyAuthService)); // Transient profiles handler this._register(appInstantiationService.createInstance(UserDataProfilesHandler)); @@ -865,34 +826,38 @@ export class CodeApplication extends Disposable { // To: vscode-remote://wsl+ubuntu/mnt/c/GitDevelopment/monaco const secondSlash = uri.path.indexOf(posix.sep, 1 /* skip over the leading slash */); + let authority: string; + let path: string; if (secondSlash !== -1) { - const authority = uri.path.substring(1, secondSlash); - const path = uri.path.substring(secondSlash); - - let query = uri.query; - const params = new URLSearchParams(uri.query); - if (params.get('windowId') === '_blank') { - // Make sure to unset any `windowId=_blank` here - // https://github.com/microsoft/vscode/issues/191902 - params.delete('windowId'); - query = params.toString(); - } + authority = uri.path.substring(1, secondSlash); + path = uri.path.substring(secondSlash); + } else { + authority = uri.path.substring(1); + path = '/'; + } - const remoteUri = URI.from({ scheme: Schemas.vscodeRemote, authority, path, query, fragment: uri.fragment }); + let query = uri.query; + const params = new URLSearchParams(uri.query); + if (params.get('windowId') === '_blank') { + // Make sure to unset any `windowId=_blank` here + // https://github.com/microsoft/vscode/issues/191902 + params.delete('windowId'); + query = params.toString(); + } - if (hasWorkspaceFileExtension(path)) { - return { workspaceUri: remoteUri }; - } + const remoteUri = URI.from({ scheme: Schemas.vscodeRemote, authority, path, query, fragment: uri.fragment }); - if (/:[\d]+$/.test(path)) { - // path with :line:column syntax - return { fileUri: remoteUri }; - } + if (hasWorkspaceFileExtension(path)) { + return { workspaceUri: remoteUri }; + } - return { folderUri: remoteUri }; + if (/:[\d]+$/.test(path)) { + // path with :line:column syntax + return { fileUri: remoteUri }; } - } + return { folderUri: remoteUri }; + } return undefined; } @@ -949,14 +914,14 @@ export class CodeApplication extends Disposable { } else { this.logService.trace('app#handleProtocolUrl() opening protocol url as window:', windowOpenableFromProtocolUrl, uri.toString(true)); - const window = firstOrDefault(await windowsMainService.open({ - context: OpenContext.API, + const window = (await windowsMainService.open({ + context: OpenContext.LINK, cli: { ...this.environmentMainService.args }, urisToOpen: [windowOpenableFromProtocolUrl], forceNewWindow: shouldOpenInNewWindow, gotoLineMode: true // remoteAuthority: will be determined based on windowOpenableFromProtocolUrl - })); + })).at(0); window?.focus(); // this should help ensuring that the right window gets focus when multiple are opened @@ -968,14 +933,14 @@ export class CodeApplication extends Disposable { if (shouldOpenInNewWindow) { this.logService.trace('app#handleProtocolUrl() opening empty window and passing in protocol url:', uri.toString(true)); - const window = firstOrDefault(await windowsMainService.open({ - context: OpenContext.API, + const window = (await windowsMainService.open({ + context: OpenContext.LINK, cli: { ...this.environmentMainService.args }, forceNewWindow: true, forceEmpty: true, gotoLineMode: true, remoteAuthority: getRemoteAuthority(uri) - })); + })).at(0); await window?.ready(); @@ -1133,6 +1098,17 @@ export class CodeApplication extends Disposable { // Utility Process Worker services.set(IUtilityProcessWorkerMainService, new SyncDescriptor(UtilityProcessWorkerMainService, undefined, true)); + // Proxy Auth + services.set(IProxyAuthService, new SyncDescriptor(ProxyAuthService)); + + // Dev Only: CSS service (for ESM) + services.set(ICSSDevelopmentService, new SyncDescriptor(CSSDevelopmentService, undefined, true)); + + if (this.productService.quality !== 'stable') { + // extensions signature verification service + services.set(IExtensionSignatureVerificationService, new SyncDescriptor(ExtensionSignatureVerificationService, undefined, true)); + } + // Init services that require it await Promises.settled([ backupMainService.initialize(), @@ -1165,7 +1141,7 @@ export class CodeApplication extends Disposable { // Local Files const diskFileSystemProvider = this.fileService.getProvider(Schemas.file); assertType(diskFileSystemProvider instanceof DiskFileSystemProvider); - const fileSystemProviderChannel = disposables.add(new DiskFileSystemProviderChannel(diskFileSystemProvider, this.logService, this.environmentMainService)); + const fileSystemProviderChannel = disposables.add(new DiskFileSystemProviderChannel(diskFileSystemProvider, this.logService, this.environmentMainService, this.configurationService)); mainProcessElectronServer.registerChannel(LOCAL_FILE_SYSTEM_CHANNEL_NAME, fileSystemProviderChannel); sharedProcessClient.then(client => client.registerChannel(LOCAL_FILE_SYSTEM_CHANNEL_NAME, fileSystemProviderChannel)); @@ -1174,9 +1150,12 @@ export class CodeApplication extends Disposable { mainProcessElectronServer.registerChannel('userDataProfiles', userDataProfilesService); sharedProcessClient.then(client => client.registerChannel('userDataProfiles', userDataProfilesService)); - // Request - const requestService = new RequestChannel(accessor.get(IRequestService)); - sharedProcessClient.then(client => client.registerChannel('request', requestService)); + if (this.productService.quality !== 'stable') { + // Extension signature verification service + const extensionSignatureVerificationService = accessor.get(IExtensionSignatureVerificationService); + sharedProcessClient.then(client => client.registerChannel('signatureVerificationService', + ProxyChannel.fromService(extensionSignatureVerificationService, disposables))); + } // Update const updateChannel = new UpdateChannel(accessor.get(IUpdateService)); diff --git a/src/vs/code/electron-main/auth.ts b/src/vs/code/electron-main/auth.ts deleted file mode 100644 index bf2a99f601c..00000000000 --- a/src/vs/code/electron-main/auth.ts +++ /dev/null @@ -1,247 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { app, AuthenticationResponseDetails, AuthInfo, Event as ElectronEvent, WebContents } from 'electron'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { hash } from 'vs/base/common/hash'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IEncryptionMainService } from 'vs/platform/encryption/common/encryptionService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IApplicationStorageMainService } from 'vs/platform/storage/electron-main/storageMainService'; -import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; - -interface ElectronAuthenticationResponseDetails extends AuthenticationResponseDetails { - firstAuthAttempt?: boolean; // https://github.com/electron/electron/blob/84a42a050e7d45225e69df5bd2d2bf9f1037ea41/shell/browser/login_handler.cc#L70 -} - -type LoginEvent = { - event: ElectronEvent; - authInfo: AuthInfo; - req: ElectronAuthenticationResponseDetails; - - callback: (username?: string, password?: string) => void; -}; - -type Credentials = { - username: string; - password: string; -}; - -enum ProxyAuthState { - - /** - * Initial state: we will try to use stored credentials - * first to reply to the auth challenge. - */ - Initial = 1, - - /** - * We used stored credentials and are still challenged, - * so we will show a login dialog next. - */ - StoredCredentialsUsed, - - /** - * Finally, if we showed a login dialog already, we will - * not show any more login dialogs until restart to reduce - * the UI noise. - */ - LoginDialogShown -} - -export class ProxyAuthHandler extends Disposable { - - private readonly PROXY_CREDENTIALS_SERVICE_KEY = 'proxy-credentials://'; - - private pendingProxyResolve: Promise | undefined = undefined; - - private state = ProxyAuthState.Initial; - - private sessionCredentials: Credentials | undefined = undefined; - - constructor( - @ILogService private readonly logService: ILogService, - @IWindowsMainService private readonly windowsMainService: IWindowsMainService, - @IEncryptionMainService private readonly encryptionMainService: IEncryptionMainService, - @IApplicationStorageMainService private readonly applicationStorageMainService: IApplicationStorageMainService - ) { - super(); - - this.registerListeners(); - } - - private registerListeners(): void { - const onLogin = Event.fromNodeEventEmitter(app, 'login', (event: ElectronEvent, webContents: WebContents, req: ElectronAuthenticationResponseDetails, authInfo: AuthInfo, callback) => ({ event, webContents, req, authInfo, callback })); - this._register(onLogin(this.onLogin, this)); - } - - private async onLogin({ event, authInfo, req, callback }: LoginEvent): Promise { - if (!authInfo.isProxy) { - return; // only for proxy - } - - if (!this.pendingProxyResolve && this.state === ProxyAuthState.LoginDialogShown && req.firstAuthAttempt) { - this.logService.trace('auth#onLogin (proxy) - exit - proxy dialog already shown'); - - return; // only one dialog per session at max (except when firstAuthAttempt: false which indicates a login problem) - } - - // Signal we handle this event on our own, otherwise - // Electron will ignore our provided credentials. - event.preventDefault(); - - let credentials: Credentials | undefined = undefined; - if (!this.pendingProxyResolve) { - this.logService.trace('auth#onLogin (proxy) - no pending proxy handling found, starting new'); - - this.pendingProxyResolve = this.resolveProxyCredentials(authInfo); - try { - credentials = await this.pendingProxyResolve; - } finally { - this.pendingProxyResolve = undefined; - } - } else { - this.logService.trace('auth#onLogin (proxy) - pending proxy handling found'); - - credentials = await this.pendingProxyResolve; - } - - // According to Electron docs, it is fine to call back without - // username or password to signal that the authentication was handled - // by us, even though without having credentials received: - // - // > If `callback` is called without a username or password, the authentication - // > request will be cancelled and the authentication error will be returned to the - // > page. - callback(credentials?.username, credentials?.password); - } - - private async resolveProxyCredentials(authInfo: AuthInfo): Promise { - this.logService.trace('auth#resolveProxyCredentials (proxy) - enter'); - - try { - const credentials = await this.doResolveProxyCredentials(authInfo); - if (credentials) { - this.logService.trace('auth#resolveProxyCredentials (proxy) - got credentials'); - - return credentials; - } else { - this.logService.trace('auth#resolveProxyCredentials (proxy) - did not get credentials'); - } - } finally { - this.logService.trace('auth#resolveProxyCredentials (proxy) - exit'); - } - - return undefined; - } - - private async doResolveProxyCredentials(authInfo: AuthInfo): Promise { - this.logService.trace('auth#doResolveProxyCredentials - enter', authInfo); - - // Compute a hash over the authentication info to be used - // with the credentials store to return the right credentials - // given the properties of the auth request - // (see https://github.com/microsoft/vscode/issues/109497) - const authInfoHash = String(hash({ scheme: authInfo.scheme, host: authInfo.host, port: authInfo.port })); - - let storedUsername: string | undefined; - let storedPassword: string | undefined; - try { - // Try to find stored credentials for the given auth info - const encryptedValue = this.applicationStorageMainService.get(this.PROXY_CREDENTIALS_SERVICE_KEY + authInfoHash, StorageScope.APPLICATION); - if (encryptedValue) { - const credentials: Credentials = JSON.parse(await this.encryptionMainService.decrypt(encryptedValue)); - storedUsername = credentials.username; - storedPassword = credentials.password; - } - } catch (error) { - this.logService.error(error); // handle errors by asking user for login via dialog - } - - // Reply with stored credentials unless we used them already. - // In that case we need to show a login dialog again because - // they seem invalid. - if (this.state !== ProxyAuthState.StoredCredentialsUsed && typeof storedUsername === 'string' && typeof storedPassword === 'string') { - this.logService.trace('auth#doResolveProxyCredentials (proxy) - exit - found stored credentials to use'); - this.state = ProxyAuthState.StoredCredentialsUsed; - - return { username: storedUsername, password: storedPassword }; - } - - // Find suitable window to show dialog: prefer to show it in the - // active window because any other network request will wait on - // the credentials and we want the user to present the dialog. - const window = this.windowsMainService.getFocusedWindow() || this.windowsMainService.getLastActiveWindow(); - if (!window) { - this.logService.trace('auth#doResolveProxyCredentials (proxy) - exit - no opened window found to show dialog in'); - - return undefined; // unexpected - } - - this.logService.trace(`auth#doResolveProxyCredentials (proxy) - asking window ${window.id} to handle proxy login`); - - // Open proxy dialog - const payload = { - authInfo, - username: this.sessionCredentials?.username ?? storedUsername, // prefer to show already used username (if any) over stored - password: this.sessionCredentials?.password ?? storedPassword, // prefer to show already used password (if any) over stored - replyChannel: `vscode:proxyAuthResponse:${generateUuid()}` - }; - window.sendWhenReady('vscode:openProxyAuthenticationDialog', CancellationToken.None, payload); - this.state = ProxyAuthState.LoginDialogShown; - - // Handle reply - const loginDialogCredentials = await new Promise(resolve => { - const proxyAuthResponseHandler = async (event: ElectronEvent, channel: string, reply: Credentials & { remember: boolean } | undefined /* canceled */) => { - if (channel === payload.replyChannel) { - this.logService.trace(`auth#doResolveProxyCredentials - exit - received credentials from window ${window.id}`); - window.win?.webContents.off('ipc-message', proxyAuthResponseHandler); - - // We got credentials from the window - if (reply) { - const credentials: Credentials = { username: reply.username, password: reply.password }; - - // Update stored credentials based on `remember` flag - try { - if (reply.remember) { - const encryptedSerializedCredentials = await this.encryptionMainService.encrypt(JSON.stringify(credentials)); - this.applicationStorageMainService.store( - this.PROXY_CREDENTIALS_SERVICE_KEY + authInfoHash, - encryptedSerializedCredentials, - StorageScope.APPLICATION, - // Always store in machine scope because we do not want these values to be synced - StorageTarget.MACHINE - ); - } else { - this.applicationStorageMainService.remove(this.PROXY_CREDENTIALS_SERVICE_KEY + authInfoHash, StorageScope.APPLICATION); - } - } catch (error) { - this.logService.error(error); // handle gracefully - } - - resolve({ username: credentials.username, password: credentials.password }); - } - - // We did not get any credentials from the window (e.g. cancelled) - else { - resolve(undefined); - } - } - }; - - window.win?.webContents.on('ipc-message', proxyAuthResponseHandler); - }); - - // Remember credentials for the session in case - // the credentials are wrong and we show the dialog - // again - this.sessionCredentials = loginDialogCredentials; - - return loginDialogCredentials; - } -} diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts index 8548fa7ce4d..3f819e1662b 100644 --- a/src/vs/code/electron-main/main.ts +++ b/src/vs/code/electron-main/main.ts @@ -3,75 +3,75 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/platform/update/common/update.config.contribution'; +import '../../platform/update/common/update.config.contribution.js'; import { app, dialog } from 'electron'; -import { unlinkSync } from 'fs'; -import { URI } from 'vs/base/common/uri'; -import { coalesce, distinct } from 'vs/base/common/arrays'; -import { Promises } from 'vs/base/common/async'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { ExpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors'; -import { IPathWithLineAndColumn, isValidBasename, parseLineAndColumnAware, sanitizeFilePath } from 'vs/base/common/extpath'; -import { Event } from 'vs/base/common/event'; -import { getPathLabel } from 'vs/base/common/labels'; -import { Schemas } from 'vs/base/common/network'; -import { basename, resolve } from 'vs/base/common/path'; -import { mark } from 'vs/base/common/performance'; -import { IProcessEnvironment, isMacintosh, isWindows, OS } from 'vs/base/common/platform'; -import { cwd } from 'vs/base/common/process'; -import { rtrim, trim } from 'vs/base/common/strings'; -import { Promises as FSPromises } from 'vs/base/node/pfs'; -import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; -import { Client as NodeIPCClient } from 'vs/base/parts/ipc/common/ipc.net'; -import { connect as nodeIPCConnect, serve as nodeIPCServe, Server as NodeIPCServer, XDG_RUNTIME_DIR } from 'vs/base/parts/ipc/node/ipc.net'; -import { CodeApplication } from 'vs/code/electron-main/app'; -import { localize } from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ConfigurationService } from 'vs/platform/configuration/common/configurationService'; -import { IDiagnosticsMainService } from 'vs/platform/diagnostics/electron-main/diagnosticsMainService'; -import { DiagnosticsService } from 'vs/platform/diagnostics/node/diagnosticsService'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { EnvironmentMainService, IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { addArg, parseMainProcessArgv } from 'vs/platform/environment/node/argvHelper'; -import { createWaitMarkerFileSync } from 'vs/platform/environment/node/wait'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILaunchMainService } from 'vs/platform/launch/electron-main/launchMainService'; -import { ILifecycleMainService, LifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { BufferLogger } from 'vs/platform/log/common/bufferLog'; -import { ConsoleMainLogger, getLogLevel, ILoggerService, ILogService } from 'vs/platform/log/common/log'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IProtocolMainService } from 'vs/platform/protocol/electron-main/protocol'; -import { ProtocolMainService } from 'vs/platform/protocol/electron-main/protocolMainService'; -import { ITunnelService } from 'vs/platform/tunnel/common/tunnel'; -import { TunnelService } from 'vs/platform/tunnel/node/tunnelService'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { RequestMainService } from 'vs/platform/request/electron-main/requestMainService'; -import { ISignService } from 'vs/platform/sign/common/sign'; -import { SignService } from 'vs/platform/sign/node/signService'; -import { IStateReadService, IStateService } from 'vs/platform/state/node/state'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IThemeMainService, ThemeMainService } from 'vs/platform/theme/electron-main/themeMainService'; -import { IUserDataProfilesMainService, UserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile'; -import { IPolicyService, NullPolicyService } from 'vs/platform/policy/common/policy'; -import { NativePolicyService } from 'vs/platform/policy/node/nativePolicyService'; -import { FilePolicyService } from 'vs/platform/policy/common/filePolicyService'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { ILoggerMainService, LoggerMainService } from 'vs/platform/log/electron-main/loggerService'; -import { LogService } from 'vs/platform/log/common/logService'; -import { massageMessageBoxOptions } from 'vs/platform/dialogs/common/dialogs'; -import { SaveStrategy, StateService } from 'vs/platform/state/node/stateService'; -import { FileUserDataProvider } from 'vs/platform/userData/common/fileUserDataProvider'; -import { addUNCHostToAllowlist, getUNCHost } from 'vs/base/node/unc'; +import { unlinkSync, promises } from 'fs'; +import { URI } from '../../base/common/uri.js'; +import { coalesce, distinct } from '../../base/common/arrays.js'; +import { Promises } from '../../base/common/async.js'; +import { toErrorMessage } from '../../base/common/errorMessage.js'; +import { ExpectedError, setUnexpectedErrorHandler } from '../../base/common/errors.js'; +import { IPathWithLineAndColumn, isValidBasename, parseLineAndColumnAware, sanitizeFilePath } from '../../base/common/extpath.js'; +import { Event } from '../../base/common/event.js'; +import { getPathLabel } from '../../base/common/labels.js'; +import { Schemas } from '../../base/common/network.js'; +import { basename, resolve } from '../../base/common/path.js'; +import { mark } from '../../base/common/performance.js'; +import { IProcessEnvironment, isMacintosh, isWindows, OS } from '../../base/common/platform.js'; +import { cwd } from '../../base/common/process.js'; +import { rtrim, trim } from '../../base/common/strings.js'; +import { Promises as FSPromises } from '../../base/node/pfs.js'; +import { ProxyChannel } from '../../base/parts/ipc/common/ipc.js'; +import { Client as NodeIPCClient } from '../../base/parts/ipc/common/ipc.net.js'; +import { connect as nodeIPCConnect, serve as nodeIPCServe, Server as NodeIPCServer, XDG_RUNTIME_DIR } from '../../base/parts/ipc/node/ipc.net.js'; +import { CodeApplication } from './app.js'; +import { localize } from '../../nls.js'; +import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; +import { ConfigurationService } from '../../platform/configuration/common/configurationService.js'; +import { IDiagnosticsMainService } from '../../platform/diagnostics/electron-main/diagnosticsMainService.js'; +import { DiagnosticsService } from '../../platform/diagnostics/node/diagnosticsService.js'; +import { NativeParsedArgs } from '../../platform/environment/common/argv.js'; +import { EnvironmentMainService, IEnvironmentMainService } from '../../platform/environment/electron-main/environmentMainService.js'; +import { addArg, parseMainProcessArgv } from '../../platform/environment/node/argvHelper.js'; +import { createWaitMarkerFileSync } from '../../platform/environment/node/wait.js'; +import { IFileService } from '../../platform/files/common/files.js'; +import { FileService } from '../../platform/files/common/fileService.js'; +import { DiskFileSystemProvider } from '../../platform/files/node/diskFileSystemProvider.js'; +import { SyncDescriptor } from '../../platform/instantiation/common/descriptors.js'; +import { IInstantiationService, ServicesAccessor } from '../../platform/instantiation/common/instantiation.js'; +import { InstantiationService } from '../../platform/instantiation/common/instantiationService.js'; +import { ServiceCollection } from '../../platform/instantiation/common/serviceCollection.js'; +import { ILaunchMainService } from '../../platform/launch/electron-main/launchMainService.js'; +import { ILifecycleMainService, LifecycleMainService } from '../../platform/lifecycle/electron-main/lifecycleMainService.js'; +import { BufferLogger } from '../../platform/log/common/bufferLog.js'; +import { ConsoleMainLogger, getLogLevel, ILoggerService, ILogService } from '../../platform/log/common/log.js'; +import product from '../../platform/product/common/product.js'; +import { IProductService } from '../../platform/product/common/productService.js'; +import { IProtocolMainService } from '../../platform/protocol/electron-main/protocol.js'; +import { ProtocolMainService } from '../../platform/protocol/electron-main/protocolMainService.js'; +import { ITunnelService } from '../../platform/tunnel/common/tunnel.js'; +import { TunnelService } from '../../platform/tunnel/node/tunnelService.js'; +import { IRequestService } from '../../platform/request/common/request.js'; +import { RequestService } from '../../platform/request/electron-utility/requestService.js'; +import { ISignService } from '../../platform/sign/common/sign.js'; +import { SignService } from '../../platform/sign/node/signService.js'; +import { IStateReadService, IStateService } from '../../platform/state/node/state.js'; +import { NullTelemetryService } from '../../platform/telemetry/common/telemetryUtils.js'; +import { IThemeMainService, ThemeMainService } from '../../platform/theme/electron-main/themeMainService.js'; +import { IUserDataProfilesMainService, UserDataProfilesMainService } from '../../platform/userDataProfile/electron-main/userDataProfile.js'; +import { IPolicyService, NullPolicyService } from '../../platform/policy/common/policy.js'; +import { NativePolicyService } from '../../platform/policy/node/nativePolicyService.js'; +import { FilePolicyService } from '../../platform/policy/common/filePolicyService.js'; +import { DisposableStore } from '../../base/common/lifecycle.js'; +import { IUriIdentityService } from '../../platform/uriIdentity/common/uriIdentity.js'; +import { UriIdentityService } from '../../platform/uriIdentity/common/uriIdentityService.js'; +import { ILoggerMainService, LoggerMainService } from '../../platform/log/electron-main/loggerService.js'; +import { LogService } from '../../platform/log/common/logService.js'; +import { massageMessageBoxOptions } from '../../platform/dialogs/common/dialogs.js'; +import { SaveStrategy, StateService } from '../../platform/state/node/stateService.js'; +import { FileUserDataProvider } from '../../platform/userData/common/fileUserDataProvider.js'; +import { addUNCHostToAllowlist, getUNCHost } from '../../base/node/unc.js'; /** * The main VS Code entry point. @@ -99,7 +99,7 @@ class CodeMain { setUnexpectedErrorHandler(err => console.error(err)); // Create services - const [instantiationService, instanceEnvironment, environmentMainService, configurationService, stateMainService, bufferLogService, productService, userDataProfilesMainService] = this.createServices(); + const [instantiationService, instanceEnvironment, environmentMainService, configurationService, stateMainService, bufferLogger, productService, userDataProfilesMainService] = this.createServices(); try { @@ -133,13 +133,13 @@ class CodeMain { }); // Delay creation of spdlog for perf reasons (https://github.com/microsoft/vscode/issues/72906) - bufferLogService.logger = loggerService.createLogger('main', { name: localize('mainLog', "Main") }); + bufferLogger.logger = loggerService.createLogger('main', { name: localize('mainLog', "Main") }); // Lifecycle Event.once(lifecycleMainService.onWillShutdown)(evt => { fileService.dispose(); configurationService.dispose(); - evt.join('instanceLockfile', FSPromises.unlink(environmentMainService.mainLockfile).catch(() => { /* ignored */ })); + evt.join('instanceLockfile', promises.unlink(environmentMainService.mainLockfile).catch(() => { /* ignored */ })); }); return instantiationService.createInstance(CodeApplication, mainProcessNodeIpcServer, instanceEnvironment).startup(); @@ -211,7 +211,7 @@ class CodeMain { services.set(ILifecycleMainService, new SyncDescriptor(LifecycleMainService, undefined, false)); // Request - services.set(IRequestService, new SyncDescriptor(RequestMainService, undefined, true)); + services.set(IRequestService, new SyncDescriptor(RequestService, undefined, true)); // Themes services.set(IThemeMainService, new SyncDescriptor(ThemeMainService)); @@ -257,7 +257,7 @@ class CodeMain { environmentMainService.workspaceStorageHome.with({ scheme: Schemas.file }).fsPath, environmentMainService.localHistoryHome.with({ scheme: Schemas.file }).fsPath, environmentMainService.backupHome - ].map(path => path ? FSPromises.mkdir(path, { recursive: true }) : undefined)), + ].map(path => path ? promises.mkdir(path, { recursive: true }) : undefined)), // State service stateService.init(), diff --git a/src/vs/code/electron-sandbox/processExplorer/processExplorer-dev.esm.html b/src/vs/code/electron-sandbox/processExplorer/processExplorer-dev.esm.html new file mode 100644 index 00000000000..19d194fc1c5 --- /dev/null +++ b/src/vs/code/electron-sandbox/processExplorer/processExplorer-dev.esm.html @@ -0,0 +1,42 @@ + + + + + + + + + +
+ + + + + + diff --git a/src/vs/code/electron-sandbox/processExplorer/processExplorer-dev.html b/src/vs/code/electron-sandbox/processExplorer/processExplorer-dev.html index 55f2c0fe81c..5bdf62c8230 100644 --- a/src/vs/code/electron-sandbox/processExplorer/processExplorer-dev.html +++ b/src/vs/code/electron-sandbox/processExplorer/processExplorer-dev.html @@ -35,8 +35,6 @@ - - - + diff --git a/src/vs/code/electron-sandbox/processExplorer/processExplorer.esm.html b/src/vs/code/electron-sandbox/processExplorer/processExplorer.esm.html new file mode 100644 index 00000000000..d2747202950 --- /dev/null +++ b/src/vs/code/electron-sandbox/processExplorer/processExplorer.esm.html @@ -0,0 +1,42 @@ + + + + + + + + + + +
+ + + + + diff --git a/src/vs/code/electron-sandbox/processExplorer/processExplorer.js b/src/vs/code/electron-sandbox/processExplorer/processExplorer.js index a81bd8c04ed..98e67e7c25c 100644 --- a/src/vs/code/electron-sandbox/processExplorer/processExplorer.js +++ b/src/vs/code/electron-sandbox/processExplorer/processExplorer.js @@ -4,8 +4,9 @@ *--------------------------------------------------------------------------------------------*/ //@ts-check +'use strict'; + (function () { - 'use strict'; /** * @import { ISandboxConfiguration } from '../../../base/parts/sandbox/common/sandboxTypes' diff --git a/src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts b/src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts index 6acf0415bb8..6ee7d3e2963 100644 --- a/src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts +++ b/src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts @@ -3,29 +3,29 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/processExplorer'; -import 'vs/base/browser/ui/codicons/codiconStyles'; // make sure codicon css is loaded -import { localize } from 'vs/nls'; -import { $, append, createStyleSheet } from 'vs/base/browser/dom'; -import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; -import { DataTree } from 'vs/base/browser/ui/tree/dataTree'; -import { IDataSource, ITreeNode, ITreeRenderer } from 'vs/base/browser/ui/tree/tree'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { ProcessItem } from 'vs/base/common/processes'; -import { IContextMenuItem } from 'vs/base/parts/contextmenu/common/contextmenu'; -import { popup } from 'vs/base/parts/contextmenu/electron-sandbox/contextmenu'; -import { ipcRenderer } from 'vs/base/parts/sandbox/electron-sandbox/globals'; -import { IRemoteDiagnosticError, isRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnostics'; -import { ByteSize } from 'vs/platform/files/common/files'; -import { ElectronIPCMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService'; -import { ProcessExplorerData, ProcessExplorerStyles, ProcessExplorerWindowConfiguration } from 'vs/platform/issue/common/issue'; -import { INativeHostService } from 'vs/platform/native/common/native'; -import { NativeHostService } from 'vs/platform/native/common/nativeHostService'; -import { getIconsStyleSheet } from 'vs/platform/theme/browser/iconsStyleSheet'; -import { applyZoom, zoomIn, zoomOut } from 'vs/platform/window/electron-sandbox/window'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { mainWindow } from 'vs/base/browser/window'; +import './media/processExplorer.css'; +import '../../../base/browser/ui/codicons/codiconStyles.js'; // make sure codicon css is loaded +import { localize } from '../../../nls.js'; +import { $, append, createStyleSheet } from '../../../base/browser/dom.js'; +import { IListVirtualDelegate } from '../../../base/browser/ui/list/list.js'; +import { DataTree } from '../../../base/browser/ui/tree/dataTree.js'; +import { IDataSource, ITreeNode, ITreeRenderer } from '../../../base/browser/ui/tree/tree.js'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { ProcessItem } from '../../../base/common/processes.js'; +import { IContextMenuItem } from '../../../base/parts/contextmenu/common/contextmenu.js'; +import { popup } from '../../../base/parts/contextmenu/electron-sandbox/contextmenu.js'; +import { ipcRenderer } from '../../../base/parts/sandbox/electron-sandbox/globals.js'; +import { IRemoteDiagnosticError, isRemoteDiagnosticError } from '../../../platform/diagnostics/common/diagnostics.js'; +import { ByteSize } from '../../../platform/files/common/files.js'; +import { ElectronIPCMainProcessService } from '../../../platform/ipc/electron-sandbox/mainProcessService.js'; +import { ProcessExplorerData, ProcessExplorerStyles, ProcessExplorerWindowConfiguration } from '../../../platform/issue/common/issue.js'; +import { INativeHostService } from '../../../platform/native/common/native.js'; +import { NativeHostService } from '../../../platform/native/common/nativeHostService.js'; +import { getIconsStyleSheet } from '../../../platform/theme/browser/iconsStyleSheet.js'; +import { applyZoom, zoomIn, zoomOut } from '../../../platform/window/electron-sandbox/window.js'; +import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { mainWindow } from '../../../base/browser/window.js'; const DEBUG_FLAGS_PATTERN = /\s--inspect(?:-brk|port)?=(?\d+)?/; const DEBUG_PORT_PATTERN = /\s--inspect-port=(?\d+)/; diff --git a/src/vs/code/electron-sandbox/workbench/workbench-dev.esm.html b/src/vs/code/electron-sandbox/workbench/workbench-dev.esm.html new file mode 100644 index 00000000000..ea5cbee848a --- /dev/null +++ b/src/vs/code/electron-sandbox/workbench/workbench-dev.esm.html @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + diff --git a/src/vs/code/electron-sandbox/workbench/workbench-dev.html b/src/vs/code/electron-sandbox/workbench/workbench-dev.html index a92bea242a4..b1be2b7527c 100644 --- a/src/vs/code/electron-sandbox/workbench/workbench-dev.html +++ b/src/vs/code/electron-sandbox/workbench/workbench-dev.html @@ -68,8 +68,7 @@ - - + diff --git a/src/vs/code/electron-sandbox/workbench/workbench.esm.html b/src/vs/code/electron-sandbox/workbench/workbench.esm.html new file mode 100644 index 00000000000..1e89448e605 --- /dev/null +++ b/src/vs/code/electron-sandbox/workbench/workbench.esm.html @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + diff --git a/src/vs/code/electron-sandbox/workbench/workbench.js b/src/vs/code/electron-sandbox/workbench/workbench.js index 25830623237..0ddbcd49ba0 100644 --- a/src/vs/code/electron-sandbox/workbench/workbench.js +++ b/src/vs/code/electron-sandbox/workbench/workbench.js @@ -3,11 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/// - //@ts-check +'use strict'; + (function () { - 'use strict'; /** * @import {INativeWindowConfiguration} from '../../../platform/window/common/window' @@ -20,13 +19,12 @@ // Add a perf entry right from the top performance.mark('code/didStartRenderer'); - // Load workbench main JS, CSS and NLS all in parallel. This is an + // Load workbench main JS and CSS all in parallel. This is an // optimization to prevent a waterfall of loading to happen, because // we know for a fact that workbench.desktop.main will depend on - // the related CSS and NLS counterparts. + // the related CSS counterpart. bootstrapWindow.load([ 'vs/workbench/workbench.desktop.main', - 'vs/nls!vs/workbench/workbench.desktop.main', 'vs/css!vs/workbench/workbench.desktop.main' ], function (desktopMain, configuration) { @@ -164,7 +162,12 @@ const style = document.createElement('style'); style.className = 'initialShellColors'; document.head.appendChild(style); - style.textContent = `body { background-color: ${shellBackground}; color: ${shellForeground}; margin: 0; padding: 0; }`; + style.textContent = `body { + background-color: ${shellBackground}; + color: ${shellForeground}; + margin: 0; + padding: 0; + }`; // set zoom level as soon as possible // @ts-ignore @@ -182,10 +185,12 @@ splash.className = baseTheme ?? 'vs-dark'; if (layoutInfo.windowBorder && colorInfo.windowBorder) { - splash.style.position = 'relative'; - splash.style.height = 'calc(100vh - 2px)'; - splash.style.width = 'calc(100vw - 2px)'; - splash.style.border = '1px solid var(--window-border-color)'; + splash.setAttribute('style', ` + position: relative; + height: calc(100vh - 2px); + width: calc(100vw - 2px); + border: 1px solid var(--window-border-color); + `); splash.style.setProperty('--window-border-color', colorInfo.windowBorder); if (layoutInfo.windowBorderRadius) { @@ -198,27 +203,108 @@ // part: title const titleDiv = document.createElement('div'); - titleDiv.setAttribute('style', `position: absolute; width: 100%; left: 0; top: 0; height: ${layoutInfo.titleBarHeight}px; background-color: ${colorInfo.titleBarBackground}; -webkit-app-region: drag;`); + titleDiv.setAttribute('style', ` + position: absolute; + width: 100%; + height: ${layoutInfo.titleBarHeight}px; + left: 0; + top: 0; + background-color: ${colorInfo.titleBarBackground}; + -webkit-app-region: drag; + `); splash.appendChild(titleDiv); + if (colorInfo.titleBarBorder && layoutInfo.titleBarHeight > 0) { + const titleBorder = document.createElement('div'); + titleBorder.setAttribute('style', ` + position: absolute; + width: 100%; + height: 1px; + left: 0; + bottom: 0; + border-bottom: 1px solid ${colorInfo.titleBarBorder}; + `); + titleDiv.appendChild(titleBorder); + } + // part: activity bar const activityDiv = document.createElement('div'); - activityDiv.setAttribute('style', `position: absolute; height: calc(100% - ${layoutInfo.titleBarHeight}px); top: ${layoutInfo.titleBarHeight}px; ${layoutInfo.sideBarSide}: 0; width: ${layoutInfo.activityBarWidth}px; background-color: ${colorInfo.activityBarBackground};`); + activityDiv.setAttribute('style', ` + position: absolute; + width: ${layoutInfo.activityBarWidth}px; + height: calc(100% - ${layoutInfo.titleBarHeight + layoutInfo.statusBarHeight}px); + top: ${layoutInfo.titleBarHeight}px; + ${layoutInfo.sideBarSide}: 0; + background-color: ${colorInfo.activityBarBackground}; + `); splash.appendChild(activityDiv); + if (colorInfo.activityBarBorder && layoutInfo.activityBarWidth > 0) { + const activityBorderDiv = document.createElement('div'); + activityBorderDiv.setAttribute('style', ` + position: absolute; + width: 1px; + height: 100%; + top: 0; + ${layoutInfo.sideBarSide === 'left' ? 'right' : 'left'}: 0; + ${layoutInfo.sideBarSide === 'left' ? 'border-right' : 'border-left'}: 1px solid ${colorInfo.activityBarBorder}; + `); + activityDiv.appendChild(activityBorderDiv); + } + // part: side bar (only when opening workspace/folder) // folder or workspace -> status bar color, sidebar if (configuration.workspace) { const sideDiv = document.createElement('div'); - sideDiv.setAttribute('style', `position: absolute; height: calc(100% - ${layoutInfo.titleBarHeight}px); top: ${layoutInfo.titleBarHeight}px; ${layoutInfo.sideBarSide}: ${layoutInfo.activityBarWidth}px; width: ${layoutInfo.sideBarWidth}px; background-color: ${colorInfo.sideBarBackground};`); + sideDiv.setAttribute('style', ` + position: absolute; + width: ${layoutInfo.sideBarWidth}px; + height: calc(100% - ${layoutInfo.titleBarHeight + layoutInfo.statusBarHeight}px); + top: ${layoutInfo.titleBarHeight}px; + ${layoutInfo.sideBarSide}: ${layoutInfo.activityBarWidth}px; + background-color: ${colorInfo.sideBarBackground}; + `); splash.appendChild(sideDiv); + + if (colorInfo.sideBarBorder && layoutInfo.sideBarWidth > 0) { + const sideBorderDiv = document.createElement('div'); + sideBorderDiv.setAttribute('style', ` + position: absolute; + width: 1px; + height: 100%; + top: 0; + right: 0; + ${layoutInfo.sideBarSide === 'left' ? 'right' : 'left'}: 0; + ${layoutInfo.sideBarSide === 'left' ? 'border-right' : 'border-left'}: 1px solid ${colorInfo.sideBarBorder}; + `); + sideDiv.appendChild(sideBorderDiv); + } } // part: statusbar const statusDiv = document.createElement('div'); - statusDiv.setAttribute('style', `position: absolute; width: 100%; bottom: 0; left: 0; height: ${layoutInfo.statusBarHeight}px; background-color: ${configuration.workspace ? colorInfo.statusBarBackground : colorInfo.statusBarNoFolderBackground};`); + statusDiv.setAttribute('style', ` + position: absolute; + width: 100%; + height: ${layoutInfo.statusBarHeight}px; + bottom: 0; + left: 0; + background-color: ${configuration.workspace ? colorInfo.statusBarBackground : colorInfo.statusBarNoFolderBackground}; + `); splash.appendChild(statusDiv); + if (colorInfo.statusBarBorder && layoutInfo.statusBarHeight > 0) { + const statusBorderDiv = document.createElement('div'); + statusBorderDiv.setAttribute('style', ` + position: absolute; + width: 100%; + height: 1px; + top: 0; + border-top: 1px solid ${colorInfo.statusBarBorder}; + `); + statusDiv.appendChild(statusBorderDiv); + } + document.body.appendChild(splash); } diff --git a/src/vs/code/node/sharedProcess/contrib/codeCacheCleaner.ts b/src/vs/code/electron-utility/sharedProcess/contrib/codeCacheCleaner.ts similarity index 79% rename from src/vs/code/node/sharedProcess/contrib/codeCacheCleaner.ts rename to src/vs/code/electron-utility/sharedProcess/contrib/codeCacheCleaner.ts index 77ae5d9786a..7560b8fac32 100644 --- a/src/vs/code/node/sharedProcess/contrib/codeCacheCleaner.ts +++ b/src/vs/code/electron-utility/sharedProcess/contrib/codeCacheCleaner.ts @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { basename, dirname, join } from 'vs/base/common/path'; -import { Promises } from 'vs/base/node/pfs'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; +import * as fs from 'fs'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { basename, dirname, join } from '../../../../base/common/path.js'; +import { Promises } from '../../../../base/node/pfs.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { IProductService } from '../../../../platform/product/common/productService.js'; export class CodeCacheCleaner extends Disposable { @@ -54,7 +55,7 @@ export class CodeCacheCleaner extends Disposable { // Delete cache folder if old enough const codeCacheEntryPath = join(codeCacheRootPath, codeCache); - const codeCacheEntryStat = await Promises.stat(codeCacheEntryPath); + const codeCacheEntryStat = await fs.promises.stat(codeCacheEntryPath); if (codeCacheEntryStat.isDirectory() && (now - codeCacheEntryStat.mtime.getTime()) > this._DataMaxAge) { this.logService.trace(`[code cache cleanup]: Removing code cache folder ${codeCache}.`); diff --git a/src/vs/code/node/sharedProcess/contrib/extensions.ts b/src/vs/code/electron-utility/sharedProcess/contrib/extensions.ts similarity index 67% rename from src/vs/code/node/sharedProcess/contrib/extensions.ts rename to src/vs/code/electron-utility/sharedProcess/contrib/extensions.ts index f1f61f5fbbf..4140b645fab 100644 --- a/src/vs/code/node/sharedProcess/contrib/extensions.ts +++ b/src/vs/code/electron-utility/sharedProcess/contrib/extensions.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { IExtensionGalleryService, IGlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionStorageService, IExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage'; -import { migrateUnsupportedExtensions } from 'vs/platform/extensionManagement/common/unsupportedExtensionsMigration'; -import { INativeServerExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStorageService } from 'vs/platform/storage/common/storage'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { IExtensionGalleryService, IGlobalExtensionEnablementService } from '../../../../platform/extensionManagement/common/extensionManagement.js'; +import { ExtensionStorageService, IExtensionStorageService } from '../../../../platform/extensionManagement/common/extensionStorage.js'; +import { migrateUnsupportedExtensions } from '../../../../platform/extensionManagement/common/unsupportedExtensionsMigration.js'; +import { INativeServerExtensionManagementService } from '../../../../platform/extensionManagement/node/extensionManagementService.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; export class ExtensionsContributions extends Disposable { constructor( diff --git a/src/vs/code/node/sharedProcess/contrib/languagePackCachedDataCleaner.ts b/src/vs/code/electron-utility/sharedProcess/contrib/languagePackCachedDataCleaner.ts similarity index 77% rename from src/vs/code/node/sharedProcess/contrib/languagePackCachedDataCleaner.ts rename to src/vs/code/electron-utility/sharedProcess/contrib/languagePackCachedDataCleaner.ts index 68d2cc16661..0c70b33f15c 100644 --- a/src/vs/code/node/sharedProcess/contrib/languagePackCachedDataCleaner.ts +++ b/src/vs/code/electron-utility/sharedProcess/contrib/languagePackCachedDataCleaner.ts @@ -3,15 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { join } from 'vs/base/common/path'; -import { Promises } from 'vs/base/node/pfs'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; +import * as fs from 'fs'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { IStringDictionary } from '../../../../base/common/collections.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { join } from '../../../../base/common/path.js'; +import { Promises } from '../../../../base/node/pfs.js'; +import { INativeEnvironmentService } from '../../../../platform/environment/common/environment.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { IProductService } from '../../../../platform/product/common/productService.js'; interface IExtensionEntry { version: string; @@ -58,7 +59,7 @@ export class LanguagePackCachedDataCleaner extends Disposable { try { const installed: IStringDictionary = Object.create(null); - const metaData: ILanguagePackFile = JSON.parse(await Promises.readFile(join(this.environmentService.userDataPath, 'languagepacks.json'), 'utf8')); + const metaData: ILanguagePackFile = JSON.parse(await fs.promises.readFile(join(this.environmentService.userDataPath, 'languagepacks.json'), 'utf8')); for (const locale of Object.keys(metaData)) { const entry = metaData[locale]; installed[`${entry.hash}.${locale}`] = true; @@ -93,7 +94,7 @@ export class LanguagePackCachedDataCleaner extends Disposable { } const candidate = join(folder, entry); - const stat = await Promises.stat(candidate); + const stat = await fs.promises.stat(candidate); if (stat.isDirectory() && (now - stat.mtime.getTime()) > this._DataMaxAge) { this.logService.trace(`[language pack cache cleanup]: Removing language pack cache folder: ${join(packEntry, entry)}`); diff --git a/src/vs/code/node/sharedProcess/contrib/localizationsUpdater.ts b/src/vs/code/electron-utility/sharedProcess/contrib/localizationsUpdater.ts similarity index 70% rename from src/vs/code/node/sharedProcess/contrib/localizationsUpdater.ts rename to src/vs/code/electron-utility/sharedProcess/contrib/localizationsUpdater.ts index f035c7d8e4f..59c74ecfb1a 100644 --- a/src/vs/code/node/sharedProcess/contrib/localizationsUpdater.ts +++ b/src/vs/code/electron-utility/sharedProcess/contrib/localizationsUpdater.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks'; -import { NativeLanguagePackService } from 'vs/platform/languagePacks/node/languagePacks'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ILanguagePackService } from '../../../../platform/languagePacks/common/languagePacks.js'; +import { NativeLanguagePackService } from '../../../../platform/languagePacks/node/languagePacks.js'; export class LocalizationsUpdater extends Disposable { diff --git a/src/vs/code/node/sharedProcess/contrib/logsDataCleaner.ts b/src/vs/code/electron-utility/sharedProcess/contrib/logsDataCleaner.ts similarity index 72% rename from src/vs/code/node/sharedProcess/contrib/logsDataCleaner.ts rename to src/vs/code/electron-utility/sharedProcess/contrib/logsDataCleaner.ts index 60a3652edf0..384a49a8d0d 100644 --- a/src/vs/code/node/sharedProcess/contrib/logsDataCleaner.ts +++ b/src/vs/code/electron-utility/sharedProcess/contrib/logsDataCleaner.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { join } from 'vs/base/common/path'; -import { basename, dirname } from 'vs/base/common/resources'; -import { Promises } from 'vs/base/node/pfs'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ILogService } from 'vs/platform/log/common/log'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { join } from '../../../../base/common/path.js'; +import { basename, dirname } from '../../../../base/common/resources.js'; +import { Promises } from '../../../../base/node/pfs.js'; +import { IEnvironmentService } from '../../../../platform/environment/common/environment.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; export class LogsDataCleaner extends Disposable { diff --git a/src/vs/code/node/sharedProcess/contrib/storageDataCleaner.ts b/src/vs/code/electron-utility/sharedProcess/contrib/storageDataCleaner.ts similarity index 71% rename from src/vs/code/node/sharedProcess/contrib/storageDataCleaner.ts rename to src/vs/code/electron-utility/sharedProcess/contrib/storageDataCleaner.ts index 23af4d227b9..6e2e213c568 100644 --- a/src/vs/code/node/sharedProcess/contrib/storageDataCleaner.ts +++ b/src/vs/code/electron-utility/sharedProcess/contrib/storageDataCleaner.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { join } from 'vs/base/common/path'; -import { Promises } from 'vs/base/node/pfs'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ILogService } from 'vs/platform/log/common/log'; -import { StorageClient } from 'vs/platform/storage/common/storageIpc'; -import { EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE } from 'vs/platform/workspace/common/workspace'; -import { NON_EMPTY_WORKSPACE_ID_LENGTH } from 'vs/platform/workspaces/node/workspaces'; -import { INativeHostService } from 'vs/platform/native/common/native'; -import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; -import { Schemas } from 'vs/base/common/network'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { join } from '../../../../base/common/path.js'; +import { Promises } from '../../../../base/node/pfs.js'; +import { INativeEnvironmentService } from '../../../../platform/environment/common/environment.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { StorageClient } from '../../../../platform/storage/common/storageIpc.js'; +import { EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE } from '../../../../platform/workspace/common/workspace.js'; +import { NON_EMPTY_WORKSPACE_ID_LENGTH } from '../../../../platform/workspaces/node/workspaces.js'; +import { INativeHostService } from '../../../../platform/native/common/native.js'; +import { IMainProcessService } from '../../../../platform/ipc/common/mainProcessService.js'; +import { Schemas } from '../../../../base/common/network.js'; export class UnusedWorkspaceStorageDataCleaner extends Disposable { diff --git a/src/vs/code/node/sharedProcess/contrib/userDataProfilesCleaner.ts b/src/vs/code/electron-utility/sharedProcess/contrib/userDataProfilesCleaner.ts similarity index 73% rename from src/vs/code/node/sharedProcess/contrib/userDataProfilesCleaner.ts rename to src/vs/code/electron-utility/sharedProcess/contrib/userDataProfilesCleaner.ts index 37c57771e24..f1fe69dd66d 100644 --- a/src/vs/code/node/sharedProcess/contrib/userDataProfilesCleaner.ts +++ b/src/vs/code/electron-utility/sharedProcess/contrib/userDataProfilesCleaner.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { IUserDataProfilesService } from '../../../../platform/userDataProfile/common/userDataProfile.js'; export class UserDataProfilesCleaner extends Disposable { diff --git a/src/vs/code/node/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts similarity index 67% rename from src/vs/code/node/sharedProcess/sharedProcessMain.ts rename to src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts index 69c81ac2498..80e8fdab810 100644 --- a/src/vs/code/node/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts @@ -4,121 +4,120 @@ *--------------------------------------------------------------------------------------------*/ import { hostname, release } from 'os'; -import { MessagePortMain, MessageEvent } from 'vs/base/parts/sandbox/node/electronTypes'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors'; -import { combinedDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { firstOrDefault } from 'vs/base/common/arrays'; -import { Emitter } from 'vs/base/common/event'; -import { ProxyChannel, StaticRouter } from 'vs/base/parts/ipc/common/ipc'; -import { IClientConnectionFilter, Server as UtilityProcessMessagePortServer, once } from 'vs/base/parts/ipc/node/ipc.mp'; -import { CodeCacheCleaner } from 'vs/code/node/sharedProcess/contrib/codeCacheCleaner'; -import { LanguagePackCachedDataCleaner } from 'vs/code/node/sharedProcess/contrib/languagePackCachedDataCleaner'; -import { LocalizationsUpdater } from 'vs/code/node/sharedProcess/contrib/localizationsUpdater'; -import { LogsDataCleaner } from 'vs/code/node/sharedProcess/contrib/logsDataCleaner'; -import { UnusedWorkspaceStorageDataCleaner } from 'vs/code/node/sharedProcess/contrib/storageDataCleaner'; -import { IChecksumService } from 'vs/platform/checksum/common/checksumService'; -import { ChecksumService } from 'vs/platform/checksum/node/checksumService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ConfigurationService } from 'vs/platform/configuration/common/configurationService'; -import { IDiagnosticsService } from 'vs/platform/diagnostics/common/diagnostics'; -import { DiagnosticsService } from 'vs/platform/diagnostics/node/diagnosticsService'; -import { IDownloadService } from 'vs/platform/download/common/download'; -import { DownloadService } from 'vs/platform/download/common/downloadService'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { GlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService'; -import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; -import { IExtensionGalleryService, IExtensionManagementService, IExtensionTipsService, IGlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionSignatureVerificationService, IExtensionSignatureVerificationService } from 'vs/platform/extensionManagement/node/extensionSignatureVerificationService'; -import { ExtensionManagementChannel, ExtensionTipsChannel } from 'vs/platform/extensionManagement/common/extensionManagementIpc'; -import { ExtensionManagementService, INativeServerExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; -import { IExtensionRecommendationNotificationService } from 'vs/platform/extensionRecommendations/common/extensionRecommendations'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks'; -import { NativeLanguagePackService } from 'vs/platform/languagePacks/node/languagePacks'; -import { ConsoleLogger, ILoggerService, ILogService } from 'vs/platform/log/common/log'; -import { LoggerChannelClient } from 'vs/platform/log/common/logIpc'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { ISharedProcessConfiguration } from 'vs/platform/sharedProcess/node/sharedProcess'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { resolveCommonProperties } from 'vs/platform/telemetry/common/commonProperties'; -import { ICustomEndpointTelemetryService, ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { TelemetryAppenderChannel } from 'vs/platform/telemetry/common/telemetryIpc'; -import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender'; -import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; -import { supportsTelemetry, ITelemetryAppender, NullAppender, NullTelemetryService, getPiiPathsFromEnvironment, isInternalTelemetry, isLoggingOnly } from 'vs/platform/telemetry/common/telemetryUtils'; -import { CustomEndpointTelemetryService } from 'vs/platform/telemetry/node/customEndpointTelemetryService'; -import { ExtensionStorageService, IExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage'; -import { IgnoredExtensionsManagementService, IIgnoredExtensionsManagementService } from 'vs/platform/userDataSync/common/ignoredExtensions'; -import { IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService, IUserDataSyncUtilService, registerConfiguration as registerUserDataSyncConfiguration, IUserDataSyncResourceProviderService } from 'vs/platform/userDataSync/common/userDataSync'; -import { IUserDataSyncAccountService, UserDataSyncAccountService } from 'vs/platform/userDataSync/common/userDataSyncAccount'; -import { UserDataSyncLocalStoreService } from 'vs/platform/userDataSync/common/userDataSyncLocalStoreService'; -import { UserDataSyncAccountServiceChannel, UserDataSyncStoreManagementServiceChannel } from 'vs/platform/userDataSync/common/userDataSyncIpc'; -import { UserDataSyncLogService } from 'vs/platform/userDataSync/common/userDataSyncLog'; -import { IUserDataSyncMachinesService, UserDataSyncMachinesService } from 'vs/platform/userDataSync/common/userDataSyncMachines'; -import { UserDataSyncEnablementService } from 'vs/platform/userDataSync/common/userDataSyncEnablementService'; -import { UserDataSyncService } from 'vs/platform/userDataSync/common/userDataSyncService'; -import { UserDataSyncServiceChannel } from 'vs/platform/userDataSync/common/userDataSyncServiceIpc'; -import { UserDataSyncStoreManagementService, UserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; -import { IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; -import { SharedProcessUserDataProfileStorageService } from 'vs/platform/userDataProfile/node/userDataProfileStorageService'; -import { ActiveWindowManager } from 'vs/platform/windows/node/windowTracker'; -import { ISignService } from 'vs/platform/sign/common/sign'; -import { SignService } from 'vs/platform/sign/node/signService'; -import { ISharedTunnelsService } from 'vs/platform/tunnel/common/tunnel'; -import { SharedTunnelsService } from 'vs/platform/tunnel/node/tunnelService'; -import { ipcSharedProcessTunnelChannelName, ISharedProcessTunnelService } from 'vs/platform/remote/common/sharedProcessTunnelService'; -import { SharedProcessTunnelService } from 'vs/platform/tunnel/node/sharedProcessTunnelService'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { isLinux } from 'vs/base/common/platform'; -import { FileUserDataProvider } from 'vs/platform/userData/common/fileUserDataProvider'; -import { DiskFileSystemProviderClient, LOCAL_FILE_SYSTEM_CHANNEL_NAME } from 'vs/platform/files/common/diskFileSystemProviderClient'; -import { InspectProfilingService as V8InspectProfilingService } from 'vs/platform/profiling/node/profilingService'; -import { IV8InspectProfilingService } from 'vs/platform/profiling/common/profiling'; -import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService'; -import { ExtensionsScannerService } from 'vs/platform/extensionManagement/node/extensionsScannerService'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { PolicyChannelClient } from 'vs/platform/policy/common/policyIpc'; -import { IPolicyService, NullPolicyService } from 'vs/platform/policy/common/policy'; -import { UserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfileIpc'; -import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender'; -import { UserDataProfilesCleaner } from 'vs/code/node/sharedProcess/contrib/userDataProfilesCleaner'; -import { IRemoteTunnelService } from 'vs/platform/remoteTunnel/common/remoteTunnel'; -import { UserDataSyncResourceProviderService } from 'vs/platform/userDataSync/common/userDataSyncResourceProvider'; -import { ExtensionsContributions } from 'vs/code/node/sharedProcess/contrib/extensions'; -import { localize } from 'vs/nls'; -import { LogService } from 'vs/platform/log/common/logService'; -import { ISharedProcessLifecycleService, SharedProcessLifecycleService } from 'vs/platform/lifecycle/node/sharedProcessLifecycleService'; -import { RemoteTunnelService } from 'vs/platform/remoteTunnel/node/remoteTunnelService'; -import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService'; -import { RequestChannelClient } from 'vs/platform/request/common/requestIpc'; -import { ExtensionRecommendationNotificationServiceChannelClient } from 'vs/platform/extensionRecommendations/common/extensionRecommendationsIpc'; -import { INativeHostService } from 'vs/platform/native/common/native'; -import { NativeHostService } from 'vs/platform/native/common/nativeHostService'; -import { UserDataAutoSyncService } from 'vs/platform/userDataSync/node/userDataAutoSyncService'; -import { ExtensionTipsService } from 'vs/platform/extensionManagement/node/extensionTipsService'; -import { IMainProcessService, MainProcessService } from 'vs/platform/ipc/common/mainProcessService'; -import { RemoteStorageService } from 'vs/platform/storage/common/storageService'; -import { IRemoteSocketFactoryService, RemoteSocketFactoryService } from 'vs/platform/remote/common/remoteSocketFactoryService'; -import { RemoteConnectionType } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { nodeSocketFactory } from 'vs/platform/remote/node/nodeSocketFactory'; -import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService'; -import { SharedProcessRawConnection, SharedProcessLifecycle } from 'vs/platform/sharedProcess/common/sharedProcess'; -import { getOSReleaseInfo } from 'vs/base/node/osReleaseInfo'; -import { getDesktopEnvironment } from 'vs/base/common/desktopEnvironmentInfo'; -import { getCodeDisplayProtocol, getDisplayProtocol } from 'vs/base/node/osDisplayProtocolInfo'; +import { MessagePortMain, MessageEvent } from '../../../base/parts/sandbox/node/electronTypes.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { onUnexpectedError, setUnexpectedErrorHandler } from '../../../base/common/errors.js'; +import { combinedDisposable, Disposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import { Emitter } from '../../../base/common/event.js'; +import { ProxyChannel, StaticRouter } from '../../../base/parts/ipc/common/ipc.js'; +import { IClientConnectionFilter, Server as UtilityProcessMessagePortServer, once } from '../../../base/parts/ipc/node/ipc.mp.js'; +import { CodeCacheCleaner } from './contrib/codeCacheCleaner.js'; +import { LanguagePackCachedDataCleaner } from './contrib/languagePackCachedDataCleaner.js'; +import { LocalizationsUpdater } from './contrib/localizationsUpdater.js'; +import { LogsDataCleaner } from './contrib/logsDataCleaner.js'; +import { UnusedWorkspaceStorageDataCleaner } from './contrib/storageDataCleaner.js'; +import { IChecksumService } from '../../../platform/checksum/common/checksumService.js'; +import { ChecksumService } from '../../../platform/checksum/node/checksumService.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { ConfigurationService } from '../../../platform/configuration/common/configurationService.js'; +import { IDiagnosticsService } from '../../../platform/diagnostics/common/diagnostics.js'; +import { DiagnosticsService } from '../../../platform/diagnostics/node/diagnosticsService.js'; +import { IDownloadService } from '../../../platform/download/common/download.js'; +import { DownloadService } from '../../../platform/download/common/downloadService.js'; +import { INativeEnvironmentService } from '../../../platform/environment/common/environment.js'; +import { GlobalExtensionEnablementService } from '../../../platform/extensionManagement/common/extensionEnablementService.js'; +import { ExtensionGalleryService } from '../../../platform/extensionManagement/common/extensionGalleryService.js'; +import { IExtensionGalleryService, IExtensionManagementService, IExtensionTipsService, IGlobalExtensionEnablementService } from '../../../platform/extensionManagement/common/extensionManagement.js'; +import { ExtensionSignatureVerificationService, IExtensionSignatureVerificationService } from '../../../platform/extensionManagement/node/extensionSignatureVerificationService.js'; +import { ExtensionManagementChannel, ExtensionTipsChannel } from '../../../platform/extensionManagement/common/extensionManagementIpc.js'; +import { ExtensionManagementService, INativeServerExtensionManagementService } from '../../../platform/extensionManagement/node/extensionManagementService.js'; +import { IExtensionRecommendationNotificationService } from '../../../platform/extensionRecommendations/common/extensionRecommendations.js'; +import { IFileService } from '../../../platform/files/common/files.js'; +import { FileService } from '../../../platform/files/common/fileService.js'; +import { DiskFileSystemProvider } from '../../../platform/files/node/diskFileSystemProvider.js'; +import { SyncDescriptor } from '../../../platform/instantiation/common/descriptors.js'; +import { IInstantiationService, ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { InstantiationService } from '../../../platform/instantiation/common/instantiationService.js'; +import { ServiceCollection } from '../../../platform/instantiation/common/serviceCollection.js'; +import { ILanguagePackService } from '../../../platform/languagePacks/common/languagePacks.js'; +import { NativeLanguagePackService } from '../../../platform/languagePacks/node/languagePacks.js'; +import { ConsoleLogger, ILoggerService, ILogService } from '../../../platform/log/common/log.js'; +import { LoggerChannelClient } from '../../../platform/log/common/logIpc.js'; +import product from '../../../platform/product/common/product.js'; +import { IProductService } from '../../../platform/product/common/productService.js'; +import { IRequestService } from '../../../platform/request/common/request.js'; +import { ISharedProcessConfiguration } from '../../../platform/sharedProcess/node/sharedProcess.js'; +import { IStorageService } from '../../../platform/storage/common/storage.js'; +import { resolveCommonProperties } from '../../../platform/telemetry/common/commonProperties.js'; +import { ICustomEndpointTelemetryService, ITelemetryService } from '../../../platform/telemetry/common/telemetry.js'; +import { TelemetryAppenderChannel } from '../../../platform/telemetry/common/telemetryIpc.js'; +import { TelemetryLogAppender } from '../../../platform/telemetry/common/telemetryLogAppender.js'; +import { TelemetryService } from '../../../platform/telemetry/common/telemetryService.js'; +import { supportsTelemetry, ITelemetryAppender, NullAppender, NullTelemetryService, getPiiPathsFromEnvironment, isInternalTelemetry, isLoggingOnly } from '../../../platform/telemetry/common/telemetryUtils.js'; +import { CustomEndpointTelemetryService } from '../../../platform/telemetry/node/customEndpointTelemetryService.js'; +import { ExtensionStorageService, IExtensionStorageService } from '../../../platform/extensionManagement/common/extensionStorage.js'; +import { IgnoredExtensionsManagementService, IIgnoredExtensionsManagementService } from '../../../platform/userDataSync/common/ignoredExtensions.js'; +import { IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService, IUserDataSyncUtilService, registerConfiguration as registerUserDataSyncConfiguration, IUserDataSyncResourceProviderService } from '../../../platform/userDataSync/common/userDataSync.js'; +import { IUserDataSyncAccountService, UserDataSyncAccountService } from '../../../platform/userDataSync/common/userDataSyncAccount.js'; +import { UserDataSyncLocalStoreService } from '../../../platform/userDataSync/common/userDataSyncLocalStoreService.js'; +import { UserDataSyncAccountServiceChannel, UserDataSyncStoreManagementServiceChannel } from '../../../platform/userDataSync/common/userDataSyncIpc.js'; +import { UserDataSyncLogService } from '../../../platform/userDataSync/common/userDataSyncLog.js'; +import { IUserDataSyncMachinesService, UserDataSyncMachinesService } from '../../../platform/userDataSync/common/userDataSyncMachines.js'; +import { UserDataSyncEnablementService } from '../../../platform/userDataSync/common/userDataSyncEnablementService.js'; +import { UserDataSyncService } from '../../../platform/userDataSync/common/userDataSyncService.js'; +import { UserDataSyncServiceChannel } from '../../../platform/userDataSync/common/userDataSyncServiceIpc.js'; +import { UserDataSyncStoreManagementService, UserDataSyncStoreService } from '../../../platform/userDataSync/common/userDataSyncStoreService.js'; +import { IUserDataProfileStorageService } from '../../../platform/userDataProfile/common/userDataProfileStorageService.js'; +import { SharedProcessUserDataProfileStorageService } from '../../../platform/userDataProfile/node/userDataProfileStorageService.js'; +import { ActiveWindowManager } from '../../../platform/windows/node/windowTracker.js'; +import { ISignService } from '../../../platform/sign/common/sign.js'; +import { SignService } from '../../../platform/sign/node/signService.js'; +import { ISharedTunnelsService } from '../../../platform/tunnel/common/tunnel.js'; +import { SharedTunnelsService } from '../../../platform/tunnel/node/tunnelService.js'; +import { ipcSharedProcessTunnelChannelName, ISharedProcessTunnelService } from '../../../platform/remote/common/sharedProcessTunnelService.js'; +import { SharedProcessTunnelService } from '../../../platform/tunnel/node/sharedProcessTunnelService.js'; +import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js'; +import { UriIdentityService } from '../../../platform/uriIdentity/common/uriIdentityService.js'; +import { isLinux } from '../../../base/common/platform.js'; +import { FileUserDataProvider } from '../../../platform/userData/common/fileUserDataProvider.js'; +import { DiskFileSystemProviderClient, LOCAL_FILE_SYSTEM_CHANNEL_NAME } from '../../../platform/files/common/diskFileSystemProviderClient.js'; +import { InspectProfilingService as V8InspectProfilingService } from '../../../platform/profiling/node/profilingService.js'; +import { IV8InspectProfilingService } from '../../../platform/profiling/common/profiling.js'; +import { IExtensionsScannerService } from '../../../platform/extensionManagement/common/extensionsScannerService.js'; +import { ExtensionsScannerService } from '../../../platform/extensionManagement/node/extensionsScannerService.js'; +import { IUserDataProfilesService } from '../../../platform/userDataProfile/common/userDataProfile.js'; +import { IExtensionsProfileScannerService } from '../../../platform/extensionManagement/common/extensionsProfileScannerService.js'; +import { PolicyChannelClient } from '../../../platform/policy/common/policyIpc.js'; +import { IPolicyService, NullPolicyService } from '../../../platform/policy/common/policy.js'; +import { UserDataProfilesService } from '../../../platform/userDataProfile/common/userDataProfileIpc.js'; +import { OneDataSystemAppender } from '../../../platform/telemetry/node/1dsAppender.js'; +import { UserDataProfilesCleaner } from './contrib/userDataProfilesCleaner.js'; +import { IRemoteTunnelService } from '../../../platform/remoteTunnel/common/remoteTunnel.js'; +import { UserDataSyncResourceProviderService } from '../../../platform/userDataSync/common/userDataSyncResourceProvider.js'; +import { ExtensionsContributions } from './contrib/extensions.js'; +import { localize } from '../../../nls.js'; +import { LogService } from '../../../platform/log/common/logService.js'; +import { ISharedProcessLifecycleService, SharedProcessLifecycleService } from '../../../platform/lifecycle/node/sharedProcessLifecycleService.js'; +import { RemoteTunnelService } from '../../../platform/remoteTunnel/node/remoteTunnelService.js'; +import { ExtensionsProfileScannerService } from '../../../platform/extensionManagement/node/extensionsProfileScannerService.js'; +import { ExtensionRecommendationNotificationServiceChannelClient } from '../../../platform/extensionRecommendations/common/extensionRecommendationsIpc.js'; +import { INativeHostService } from '../../../platform/native/common/native.js'; +import { NativeHostService } from '../../../platform/native/common/nativeHostService.js'; +import { UserDataAutoSyncService } from '../../../platform/userDataSync/node/userDataAutoSyncService.js'; +import { ExtensionTipsService } from '../../../platform/extensionManagement/node/extensionTipsService.js'; +import { IMainProcessService, MainProcessService } from '../../../platform/ipc/common/mainProcessService.js'; +import { RemoteStorageService } from '../../../platform/storage/common/storageService.js'; +import { IRemoteSocketFactoryService, RemoteSocketFactoryService } from '../../../platform/remote/common/remoteSocketFactoryService.js'; +import { RemoteConnectionType } from '../../../platform/remote/common/remoteAuthorityResolver.js'; +import { nodeSocketFactory } from '../../../platform/remote/node/nodeSocketFactory.js'; +import { NativeEnvironmentService } from '../../../platform/environment/node/environmentService.js'; +import { SharedProcessRawConnection, SharedProcessLifecycle } from '../../../platform/sharedProcess/common/sharedProcess.js'; +import { getOSReleaseInfo } from '../../../base/node/osReleaseInfo.js'; +import { getDesktopEnvironment } from '../../../base/common/desktopEnvironmentInfo.js'; +import { getCodeDisplayProtocol, getDisplayProtocol } from '../../../base/node/osDisplayProtocolInfo.js'; +import { RequestService } from '../../../platform/request/electron-utility/requestService.js'; class SharedProcessMain extends Disposable implements IClientConnectionFilter { @@ -271,7 +270,7 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter { ]); // Request - const requestService = new RequestChannelClient(mainProcessService.getChannel('request')); + const requestService = new RequestService(configurationService, environmentService, logService); services.set(IRequestService, requestService); // Checksum @@ -327,7 +326,14 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter { // Extension Management services.set(IExtensionsProfileScannerService, new SyncDescriptor(ExtensionsProfileScannerService, undefined, true)); services.set(IExtensionsScannerService, new SyncDescriptor(ExtensionsScannerService, undefined, true)); - services.set(IExtensionSignatureVerificationService, new SyncDescriptor(ExtensionSignatureVerificationService, undefined, true)); + + if (productService.quality === 'stable') { + services.set(IExtensionSignatureVerificationService, new SyncDescriptor(ExtensionSignatureVerificationService, undefined, true)); + } else { + // Do extension signature verification in the main process in insiders + services.set(IExtensionSignatureVerificationService, ProxyChannel.toService(mainProcessService.getChannel('signatureVerificationService'))); + } + services.set(INativeServerExtensionManagementService, new SyncDescriptor(ExtensionManagementService, undefined, true)); // Extension Gallery @@ -514,7 +520,7 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter { return false; } - const port = firstOrDefault(e.ports); + const port = e.ports.at(0); if (port) { this.onDidWindowConnectRaw.fire(port); diff --git a/src/vs/code/node/cli.ts b/src/vs/code/node/cli.ts index 211d1dbf3e5..b25377a804d 100644 --- a/src/vs/code/node/cli.ts +++ b/src/vs/code/node/cli.ts @@ -7,27 +7,27 @@ import { ChildProcess, spawn, SpawnOptions, StdioOptions } from 'child_process'; import { chmodSync, existsSync, readFileSync, statSync, truncateSync, unlinkSync } from 'fs'; import { homedir, release, tmpdir } from 'os'; import type { ProfilingSession, Target } from 'v8-inspect-profiler'; -import { Event } from 'vs/base/common/event'; -import { isAbsolute, resolve, join, dirname } from 'vs/base/common/path'; -import { IProcessEnvironment, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { randomPort } from 'vs/base/common/ports'; -import { whenDeleted, writeFileSync } from 'vs/base/node/pfs'; -import { findFreePort } from 'vs/base/node/ports'; -import { watchFileContents } from 'vs/platform/files/node/watcher/nodejs/nodejsWatcherLib'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { buildHelpMessage, buildVersionMessage, NATIVE_CLI_COMMANDS, OPTIONS } from 'vs/platform/environment/node/argv'; -import { addArg, parseCLIProcessArgv } from 'vs/platform/environment/node/argvHelper'; -import { getStdinFilePath, hasStdinWithoutTty, readFromStdin, stdinDataListener } from 'vs/platform/environment/node/stdin'; -import { createWaitMarkerFileSync } from 'vs/platform/environment/node/wait'; -import product from 'vs/platform/product/common/product'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { isUNC, randomPath } from 'vs/base/common/extpath'; -import { Utils } from 'vs/platform/profiling/common/profiling'; -import { FileAccess } from 'vs/base/common/network'; -import { cwd } from 'vs/base/common/process'; -import { addUNCHostToAllowlist } from 'vs/base/node/unc'; -import { URI } from 'vs/base/common/uri'; -import { DeferredPromise } from 'vs/base/common/async'; +import { Event } from '../../base/common/event.js'; +import { isAbsolute, resolve, join, dirname } from '../../base/common/path.js'; +import { IProcessEnvironment, isMacintosh, isWindows } from '../../base/common/platform.js'; +import { randomPort } from '../../base/common/ports.js'; +import { whenDeleted, writeFileSync } from '../../base/node/pfs.js'; +import { findFreePort } from '../../base/node/ports.js'; +import { watchFileContents } from '../../platform/files/node/watcher/nodejs/nodejsWatcherLib.js'; +import { NativeParsedArgs } from '../../platform/environment/common/argv.js'; +import { buildHelpMessage, buildVersionMessage, NATIVE_CLI_COMMANDS, OPTIONS } from '../../platform/environment/node/argv.js'; +import { addArg, parseCLIProcessArgv } from '../../platform/environment/node/argvHelper.js'; +import { getStdinFilePath, hasStdinWithoutTty, readFromStdin, stdinDataListener } from '../../platform/environment/node/stdin.js'; +import { createWaitMarkerFileSync } from '../../platform/environment/node/wait.js'; +import product from '../../platform/product/common/product.js'; +import { CancellationTokenSource } from '../../base/common/cancellation.js'; +import { isUNC, randomPath } from '../../base/common/extpath.js'; +import { Utils } from '../../platform/profiling/common/profiling.js'; +import { FileAccess } from '../../base/common/network.js'; +import { cwd } from '../../base/common/process.js'; +import { addUNCHostToAllowlist } from '../../base/node/unc.js'; +import { URI } from '../../base/common/uri.js'; +import { DeferredPromise } from '../../base/common/async.js'; function shouldSpawnCliProcess(argv: NativeParsedArgs): boolean { return !!argv['install-source'] @@ -39,10 +39,6 @@ function shouldSpawnCliProcess(argv: NativeParsedArgs): boolean { || !!argv['telemetry']; } -interface IMainCli { - main: (argv: NativeParsedArgs) => Promise; -} - export async function main(argv: string[]): Promise { let args: NativeParsedArgs; @@ -59,19 +55,28 @@ export async function main(argv: string[]): Promise { console.error(`'${subcommand}' command not supported in ${product.applicationName}`); return; } + const env: IProcessEnvironment = { + ...process.env + }; + // bootstrap-amd.js determines the electron environment based + // on the following variable. For the server we need to unset + // it to prevent importing any electron specific modules. + // Refs https://github.com/microsoft/vscode/issues/221883 + delete env['ELECTRON_RUN_AS_NODE']; + const tunnelArgs = argv.slice(argv.indexOf(subcommand) + 1); // all arguments behind `tunnel` return new Promise((resolve, reject) => { let tunnelProcess: ChildProcess; const stdio: StdioOptions = ['ignore', 'pipe', 'pipe']; if (process.env['VSCODE_DEV']) { - tunnelProcess = spawn('cargo', ['run', '--', subcommand, ...tunnelArgs], { cwd: join(getAppRoot(), 'cli'), stdio }); + tunnelProcess = spawn('cargo', ['run', '--', subcommand, ...tunnelArgs], { cwd: join(getAppRoot(), 'cli'), stdio, env }); } else { const appPath = process.platform === 'darwin' // ./Contents/MacOS/Electron => ./Contents/Resources/app/bin/code-tunnel-insiders ? join(dirname(dirname(process.execPath)), 'Resources', 'app') : dirname(process.execPath); const tunnelCommand = join(appPath, 'bin', `${product.tunnelApplicationName}${isWindows ? '.exe' : ''}`); - tunnelProcess = spawn(tunnelCommand, [subcommand, ...tunnelArgs], { cwd: cwd(), stdio }); + tunnelProcess = spawn(tunnelCommand, [subcommand, ...tunnelArgs], { cwd: cwd(), stdio, env }); } tunnelProcess.stdout!.pipe(process.stdout); @@ -107,12 +112,12 @@ export async function main(argv: string[]): Promise { case 'fish': file = 'fish_xdg_data/fish/vendor_conf.d/shellIntegration.fish'; break; default: throw new Error('Error using --locate-shell-integration-path: Invalid shell type'); } - console.log(join(getAppRoot(), 'out', 'vs', 'workbench', 'contrib', 'terminal', 'browser', 'media', file)); + console.log(join(getAppRoot(), 'out', 'vs', 'workbench', 'contrib', 'terminal', 'common', 'scripts', file)); } // Extensions Management else if (shouldSpawnCliProcess(args)) { - const cli = await new Promise((resolve, reject) => require(['vs/code/node/cliProcessMain'], resolve, reject)); + const cli = await import(['./cliProcessMain.js'].join('/') /* TODO@esm workaround to prevent esbuild from inlining this */); await cli.main(args); return; @@ -392,7 +397,10 @@ export async function main(argv: string[]): Promise { return false; } if (target.type === 'page') { - return target.url.indexOf('workbench/workbench.html') > 0 || target.url.indexOf('workbench/workbench-dev.html') > 0; + return target.url.indexOf('workbench/workbench.html') > 0 || + target.url.indexOf('workbench/workbench-dev.html') > 0 || + target.url.indexOf('workbench/workbench.esm.html') > 0 || + target.url.indexOf('workbench/workbench-dev.esm.html') > 0; } else { return true; } diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index 2c1d7afc54c..d3b20ecea47 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -3,67 +3,67 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'fs'; import { hostname, release } from 'os'; -import { raceTimeout } from 'vs/base/common/async'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { isSigPipeError, onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { isAbsolute, join } from 'vs/base/common/path'; -import { isWindows } from 'vs/base/common/platform'; -import { cwd } from 'vs/base/common/process'; -import { URI } from 'vs/base/common/uri'; -import { Promises } from 'vs/base/node/pfs'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ConfigurationService } from 'vs/platform/configuration/common/configurationService'; -import { IDownloadService } from 'vs/platform/download/common/download'; -import { DownloadService } from 'vs/platform/download/common/downloadService'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService'; -import { ExtensionGalleryServiceWithNoStorageService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; -import { IExtensionGalleryService, InstallOptions } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionSignatureVerificationService, IExtensionSignatureVerificationService } from 'vs/platform/extensionManagement/node/extensionSignatureVerificationService'; -import { ExtensionManagementCLI } from 'vs/platform/extensionManagement/common/extensionManagementCLI'; -import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService'; -import { ExtensionManagementService, INativeServerExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; -import { ExtensionsScannerService } from 'vs/platform/extensionManagement/node/extensionsScannerService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks'; -import { NativeLanguagePackService } from 'vs/platform/languagePacks/node/languagePacks'; -import { ConsoleLogger, getLogLevel, ILogger, ILoggerService, ILogService, LogLevel } from 'vs/platform/log/common/log'; -import { FilePolicyService } from 'vs/platform/policy/common/filePolicyService'; -import { IPolicyService, NullPolicyService } from 'vs/platform/policy/common/policy'; -import { NativePolicyService } from 'vs/platform/policy/node/nativePolicyService'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { RequestService } from 'vs/platform/request/node/requestService'; -import { SaveStrategy, StateReadonlyService } from 'vs/platform/state/node/stateService'; -import { resolveCommonProperties } from 'vs/platform/telemetry/common/commonProperties'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ITelemetryServiceConfig, TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; -import { supportsTelemetry, NullTelemetryService, getPiiPathsFromEnvironment, isInternalTelemetry, ITelemetryAppender } from 'vs/platform/telemetry/common/telemetryUtils'; -import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender'; -import { buildTelemetryMessage } from 'vs/platform/telemetry/node/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { UserDataProfilesReadonlyService } from 'vs/platform/userDataProfile/node/userDataProfile'; -import { resolveMachineId, resolveSqmId, resolvedevDeviceId } from 'vs/platform/telemetry/node/telemetryUtils'; -import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService'; -import { LogService } from 'vs/platform/log/common/logService'; -import { LoggerService } from 'vs/platform/log/node/loggerService'; -import { localize } from 'vs/nls'; -import { FileUserDataProvider } from 'vs/platform/userData/common/fileUserDataProvider'; -import { addUNCHostToAllowlist, getUNCHost } from 'vs/base/node/unc'; +import { raceTimeout } from '../../base/common/async.js'; +import { toErrorMessage } from '../../base/common/errorMessage.js'; +import { isSigPipeError, onUnexpectedError, setUnexpectedErrorHandler } from '../../base/common/errors.js'; +import { Disposable } from '../../base/common/lifecycle.js'; +import { Schemas } from '../../base/common/network.js'; +import { isAbsolute, join } from '../../base/common/path.js'; +import { isWindows } from '../../base/common/platform.js'; +import { cwd } from '../../base/common/process.js'; +import { URI } from '../../base/common/uri.js'; +import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; +import { ConfigurationService } from '../../platform/configuration/common/configurationService.js'; +import { IDownloadService } from '../../platform/download/common/download.js'; +import { DownloadService } from '../../platform/download/common/downloadService.js'; +import { NativeParsedArgs } from '../../platform/environment/common/argv.js'; +import { INativeEnvironmentService } from '../../platform/environment/common/environment.js'; +import { NativeEnvironmentService } from '../../platform/environment/node/environmentService.js'; +import { ExtensionGalleryServiceWithNoStorageService } from '../../platform/extensionManagement/common/extensionGalleryService.js'; +import { IExtensionGalleryService, InstallOptions } from '../../platform/extensionManagement/common/extensionManagement.js'; +import { ExtensionSignatureVerificationService, IExtensionSignatureVerificationService } from '../../platform/extensionManagement/node/extensionSignatureVerificationService.js'; +import { ExtensionManagementCLI } from '../../platform/extensionManagement/common/extensionManagementCLI.js'; +import { IExtensionsProfileScannerService } from '../../platform/extensionManagement/common/extensionsProfileScannerService.js'; +import { IExtensionsScannerService } from '../../platform/extensionManagement/common/extensionsScannerService.js'; +import { ExtensionManagementService, INativeServerExtensionManagementService } from '../../platform/extensionManagement/node/extensionManagementService.js'; +import { ExtensionsScannerService } from '../../platform/extensionManagement/node/extensionsScannerService.js'; +import { IFileService } from '../../platform/files/common/files.js'; +import { FileService } from '../../platform/files/common/fileService.js'; +import { DiskFileSystemProvider } from '../../platform/files/node/diskFileSystemProvider.js'; +import { SyncDescriptor } from '../../platform/instantiation/common/descriptors.js'; +import { IInstantiationService } from '../../platform/instantiation/common/instantiation.js'; +import { InstantiationService } from '../../platform/instantiation/common/instantiationService.js'; +import { ServiceCollection } from '../../platform/instantiation/common/serviceCollection.js'; +import { ILanguagePackService } from '../../platform/languagePacks/common/languagePacks.js'; +import { NativeLanguagePackService } from '../../platform/languagePacks/node/languagePacks.js'; +import { ConsoleLogger, getLogLevel, ILogger, ILoggerService, ILogService, LogLevel } from '../../platform/log/common/log.js'; +import { FilePolicyService } from '../../platform/policy/common/filePolicyService.js'; +import { IPolicyService, NullPolicyService } from '../../platform/policy/common/policy.js'; +import { NativePolicyService } from '../../platform/policy/node/nativePolicyService.js'; +import product from '../../platform/product/common/product.js'; +import { IProductService } from '../../platform/product/common/productService.js'; +import { IRequestService } from '../../platform/request/common/request.js'; +import { RequestService } from '../../platform/request/node/requestService.js'; +import { SaveStrategy, StateReadonlyService } from '../../platform/state/node/stateService.js'; +import { resolveCommonProperties } from '../../platform/telemetry/common/commonProperties.js'; +import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js'; +import { ITelemetryServiceConfig, TelemetryService } from '../../platform/telemetry/common/telemetryService.js'; +import { supportsTelemetry, NullTelemetryService, getPiiPathsFromEnvironment, isInternalTelemetry, ITelemetryAppender } from '../../platform/telemetry/common/telemetryUtils.js'; +import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js'; +import { buildTelemetryMessage } from '../../platform/telemetry/node/telemetry.js'; +import { IUriIdentityService } from '../../platform/uriIdentity/common/uriIdentity.js'; +import { UriIdentityService } from '../../platform/uriIdentity/common/uriIdentityService.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js'; +import { UserDataProfilesReadonlyService } from '../../platform/userDataProfile/node/userDataProfile.js'; +import { resolveMachineId, resolveSqmId, resolvedevDeviceId } from '../../platform/telemetry/node/telemetryUtils.js'; +import { ExtensionsProfileScannerService } from '../../platform/extensionManagement/node/extensionsProfileScannerService.js'; +import { LogService } from '../../platform/log/common/logService.js'; +import { LoggerService } from '../../platform/log/node/loggerService.js'; +import { localize } from '../../nls.js'; +import { FileUserDataProvider } from '../../platform/userData/common/fileUserDataProvider.js'; +import { addUNCHostToAllowlist, getUNCHost } from '../../base/node/unc.js'; class CliMain extends Disposable { @@ -124,7 +124,7 @@ class CliMain extends Disposable { await Promise.all([ this.allowWindowsUNCPath(environmentService.appSettingsHome.with({ scheme: Schemas.file }).fsPath), this.allowWindowsUNCPath(environmentService.extensionsPath) - ].map(path => path ? Promises.mkdir(path, { recursive: true }) : undefined)); + ].map(path => path ? fs.promises.mkdir(path, { recursive: true }) : undefined)); // Logger const loggerService = new LoggerService(getLogLevel(environmentService), environmentService.logsHome); @@ -195,7 +195,7 @@ class CliMain extends Disposable { services.set(IUriIdentityService, new UriIdentityService(fileService)); // Request - const requestService = new RequestService(configurationService, environmentService, logService, loggerService); + const requestService = new RequestService(configurationService, environmentService, logService); services.set(IRequestService, requestService); // Download Service diff --git a/src/vs/editor/browser/config/charWidthReader.ts b/src/vs/editor/browser/config/charWidthReader.ts index e1d36f142bf..98846a73d0b 100644 --- a/src/vs/editor/browser/config/charWidthReader.ts +++ b/src/vs/editor/browser/config/charWidthReader.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { BareFontInfo } from 'vs/editor/common/config/fontInfo'; +import { applyFontInfo } from './domFontInfo.js'; +import { BareFontInfo } from '../../common/config/fontInfo.js'; export const enum CharWidthRequestType { Regular = 0, diff --git a/src/vs/editor/browser/config/domFontInfo.ts b/src/vs/editor/browser/config/domFontInfo.ts index dc4f38c54b7..7c235cb9282 100644 --- a/src/vs/editor/browser/config/domFontInfo.ts +++ b/src/vs/editor/browser/config/domFontInfo.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { FastDomNode } from 'vs/base/browser/fastDomNode'; -import { BareFontInfo } from 'vs/editor/common/config/fontInfo'; +import { FastDomNode } from '../../../base/browser/fastDomNode.js'; +import { BareFontInfo } from '../../common/config/fontInfo.js'; export function applyFontInfo(domNode: FastDomNode | HTMLElement, fontInfo: BareFontInfo): void { if (domNode instanceof FastDomNode) { diff --git a/src/vs/editor/browser/config/editorConfiguration.ts b/src/vs/editor/browser/config/editorConfiguration.ts index 4de800bd521..d65d85cfe25 100644 --- a/src/vs/editor/browser/config/editorConfiguration.ts +++ b/src/vs/editor/browser/config/editorConfiguration.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as browser from 'vs/base/browser/browser'; -import * as arrays from 'vs/base/common/arrays'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import * as objects from 'vs/base/common/objects'; -import * as platform from 'vs/base/common/platform'; -import { ElementSizeObserver } from 'vs/editor/browser/config/elementSizeObserver'; -import { FontMeasurements } from 'vs/editor/browser/config/fontMeasurements'; -import { migrateOptions } from 'vs/editor/browser/config/migrateOptions'; -import { TabFocus } from 'vs/editor/browser/config/tabFocus'; -import { ComputeOptionsMemory, ConfigurationChangedEvent, EditorOption, editorOptionsRegistry, FindComputedEditorOptionValueById, IComputedEditorOptions, IEditorOptions, IEnvironmentalOptions } from 'vs/editor/common/config/editorOptions'; -import { EditorZoom } from 'vs/editor/common/config/editorZoom'; -import { BareFontInfo, FontInfo, IValidatedEditorOptions } from 'vs/editor/common/config/fontInfo'; -import { IDimension } from 'vs/editor/common/core/dimension'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { AccessibilitySupport, IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { getWindow, getWindowById } from 'vs/base/browser/dom'; -import { PixelRatio } from 'vs/base/browser/pixelRatio'; -import { MenuId } from 'vs/platform/actions/common/actions'; +import * as browser from '../../../base/browser/browser.js'; +import * as arrays from '../../../base/common/arrays.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import * as objects from '../../../base/common/objects.js'; +import * as platform from '../../../base/common/platform.js'; +import { ElementSizeObserver } from './elementSizeObserver.js'; +import { FontMeasurements } from './fontMeasurements.js'; +import { migrateOptions } from './migrateOptions.js'; +import { TabFocus } from './tabFocus.js'; +import { ComputeOptionsMemory, ConfigurationChangedEvent, EditorOption, editorOptionsRegistry, FindComputedEditorOptionValueById, IComputedEditorOptions, IEditorOptions, IEnvironmentalOptions } from '../../common/config/editorOptions.js'; +import { EditorZoom } from '../../common/config/editorZoom.js'; +import { BareFontInfo, FontInfo, IValidatedEditorOptions } from '../../common/config/fontInfo.js'; +import { IDimension } from '../../common/core/dimension.js'; +import { IEditorConfiguration } from '../../common/config/editorConfiguration.js'; +import { AccessibilitySupport, IAccessibilityService } from '../../../platform/accessibility/common/accessibility.js'; +import { getWindow, getWindowById } from '../../../base/browser/dom.js'; +import { PixelRatio } from '../../../base/browser/pixelRatio.js'; +import { MenuId } from '../../../platform/actions/common/actions.js'; export interface IEditorConstructionOptions extends IEditorOptions { /** diff --git a/src/vs/editor/browser/config/elementSizeObserver.ts b/src/vs/editor/browser/config/elementSizeObserver.ts index 33eefc3aba8..303d6377cdf 100644 --- a/src/vs/editor/browser/config/elementSizeObserver.ts +++ b/src/vs/editor/browser/config/elementSizeObserver.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { IDimension } from 'vs/editor/common/core/dimension'; -import { Emitter, Event } from 'vs/base/common/event'; -import { getWindow, scheduleAtNextAnimationFrame } from 'vs/base/browser/dom'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IDimension } from '../../common/core/dimension.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { getWindow, scheduleAtNextAnimationFrame } from '../../../base/browser/dom.js'; export class ElementSizeObserver extends Disposable { diff --git a/src/vs/editor/browser/config/fontMeasurements.ts b/src/vs/editor/browser/config/fontMeasurements.ts index 4b1ac7e21c9..d9a5cb897d9 100644 --- a/src/vs/editor/browser/config/fontMeasurements.ts +++ b/src/vs/editor/browser/config/fontMeasurements.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getWindowId } from 'vs/base/browser/dom'; -import { PixelRatio } from 'vs/base/browser/pixelRatio'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { CharWidthRequest, CharWidthRequestType, readCharWidths } from 'vs/editor/browser/config/charWidthReader'; -import { EditorFontLigatures } from 'vs/editor/common/config/editorOptions'; -import { BareFontInfo, FontInfo, SERIALIZED_FONT_INFO_VERSION } from 'vs/editor/common/config/fontInfo'; +import { getWindowId } from '../../../base/browser/dom.js'; +import { PixelRatio } from '../../../base/browser/pixelRatio.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { CharWidthRequest, CharWidthRequestType, readCharWidths } from './charWidthReader.js'; +import { EditorFontLigatures } from '../../common/config/editorOptions.js'; +import { BareFontInfo, FontInfo, SERIALIZED_FONT_INFO_VERSION } from '../../common/config/fontInfo.js'; /** * Serializable font information. diff --git a/src/vs/editor/browser/config/migrateOptions.ts b/src/vs/editor/browser/config/migrateOptions.ts index c98f644a339..622994ed7f5 100644 --- a/src/vs/editor/browser/config/migrateOptions.ts +++ b/src/vs/editor/browser/config/migrateOptions.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; +import { IEditorOptions } from '../../common/config/editorOptions.js'; export interface ISettingsReader { (key: string): any; diff --git a/src/vs/editor/browser/config/tabFocus.ts b/src/vs/editor/browser/config/tabFocus.ts index f0102e4c0c3..6d821bc2725 100644 --- a/src/vs/editor/browser/config/tabFocus.ts +++ b/src/vs/editor/browser/config/tabFocus.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; +import { Emitter, Event } from '../../../base/common/event.js'; class TabFocusImpl { private _tabFocus: boolean = false; diff --git a/src/vs/editor/browser/controller/editContext/clipboardUtils.ts b/src/vs/editor/browser/controller/editContext/clipboardUtils.ts new file mode 100644 index 00000000000..d7091d613d6 --- /dev/null +++ b/src/vs/editor/browser/controller/editContext/clipboardUtils.ts @@ -0,0 +1,86 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { IViewModel } from '../../../common/viewModel.js'; +import { Range } from '../../../common/core/range.js'; +import { isWindows } from '../../../../base/common/platform.js'; + +export function getDataToCopy(viewModel: IViewModel, modelSelections: Range[], emptySelectionClipboard: boolean, copyWithSyntaxHighlighting: boolean): ClipboardDataToCopy { + const rawTextToCopy = viewModel.getPlainTextToCopy(modelSelections, emptySelectionClipboard, isWindows); + const newLineCharacter = viewModel.model.getEOL(); + + const isFromEmptySelection = (emptySelectionClipboard && modelSelections.length === 1 && modelSelections[0].isEmpty()); + const multicursorText = (Array.isArray(rawTextToCopy) ? rawTextToCopy : null); + const text = (Array.isArray(rawTextToCopy) ? rawTextToCopy.join(newLineCharacter) : rawTextToCopy); + + let html: string | null | undefined = undefined; + let mode: string | null = null; + if (CopyOptions.forceCopyWithSyntaxHighlighting || (copyWithSyntaxHighlighting && text.length < 65536)) { + const richText = viewModel.getRichTextToCopy(modelSelections, emptySelectionClipboard); + if (richText) { + html = richText.html; + mode = richText.mode; + } + } + const dataToCopy: ClipboardDataToCopy = { + isFromEmptySelection, + multicursorText, + text, + html, + mode + }; + return dataToCopy; +} + +/** + * Every time we write to the clipboard, we record a bit of extra metadata here. + * Every time we read from the cipboard, if the text matches our last written text, + * we can fetch the previous metadata. + */ +export class InMemoryClipboardMetadataManager { + public static readonly INSTANCE = new InMemoryClipboardMetadataManager(); + + private _lastState: InMemoryClipboardMetadata | null; + + constructor() { + this._lastState = null; + } + + public set(lastCopiedValue: string, data: ClipboardStoredMetadata): void { + this._lastState = { lastCopiedValue, data }; + } + + public get(pastedText: string): ClipboardStoredMetadata | null { + if (this._lastState && this._lastState.lastCopiedValue === pastedText) { + // match! + return this._lastState.data; + } + this._lastState = null; + return null; + } +} + +export interface ClipboardDataToCopy { + isFromEmptySelection: boolean; + multicursorText: string[] | null | undefined; + text: string; + html: string | null | undefined; + mode: string | null; +} + +export interface ClipboardStoredMetadata { + version: 1; + isFromEmptySelection: boolean | undefined; + multicursorText: string[] | null | undefined; + mode: string | null; +} + +export const CopyOptions = { + forceCopyWithSyntaxHighlighting: false +}; + +interface InMemoryClipboardMetadata { + lastCopiedValue: string; + data: ClipboardStoredMetadata; +} diff --git a/src/vs/editor/browser/controller/editContext/editContextUtils.ts b/src/vs/editor/browser/controller/editContext/editContextUtils.ts new file mode 100644 index 00000000000..19f284b10c0 --- /dev/null +++ b/src/vs/editor/browser/controller/editContext/editContextUtils.ts @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { FastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { Position } from '../../../common/core/position.js'; +import { IEditorAriaOptions } from '../../editorBrowser.js'; +import { ViewPart } from '../../view/viewPart.js'; + +export abstract class AbstractEditContext extends ViewPart { + abstract domNode: FastDomNode; + abstract appendTo(overflowGuardContainer: FastDomNode): void; + abstract focus(): void; + abstract isFocused(): boolean; + abstract refreshFocusState(): void; + abstract setAriaOptions(options: IEditorAriaOptions): void; + abstract getLastRenderData(): Position | null; + abstract writeScreenReaderContent(reason: string): void; +} diff --git a/src/vs/editor/browser/controller/editContext/native/debugEditContext.ts b/src/vs/editor/browser/controller/editContext/native/debugEditContext.ts new file mode 100644 index 00000000000..301c21dc5bb --- /dev/null +++ b/src/vs/editor/browser/controller/editContext/native/debugEditContext.ts @@ -0,0 +1,225 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +const COLOR_FOR_CONTROL_BOUNDS = 'blue'; +const COLOR_FOR_SELECTION_BOUNDS = 'red'; +const COLOR_FOR_CHARACTER_BOUNDS = 'green'; + +export class DebugEditContext extends EditContext { + private _isDebugging = true; + private _controlBounds: DOMRect | null = null; + private _selectionBounds: DOMRect | null = null; + private _characterBounds: { rangeStart: number; characterBounds: DOMRect[] } | null = null; + + constructor(options?: EditContextInit | undefined) { + super(options); + } + + override updateText(rangeStart: number, rangeEnd: number, text: string): void { + super.updateText(rangeStart, rangeEnd, text); + this.renderDebug(); + } + override updateSelection(start: number, end: number): void { + super.updateSelection(start, end); + this.renderDebug(); + } + override updateControlBounds(controlBounds: DOMRect): void { + super.updateControlBounds(controlBounds); + this._controlBounds = controlBounds; + this.renderDebug(); + } + override updateSelectionBounds(selectionBounds: DOMRect): void { + super.updateSelectionBounds(selectionBounds); + this._selectionBounds = selectionBounds; + this.renderDebug(); + } + override updateCharacterBounds(rangeStart: number, characterBounds: DOMRect[]): void { + super.updateCharacterBounds(rangeStart, characterBounds); + this._characterBounds = { rangeStart, characterBounds }; + this.renderDebug(); + } + override attachedElements(): HTMLElement[] { + return super.attachedElements(); + } + + override characterBounds(): DOMRect[] { + return super.characterBounds(); + } + + private readonly _ontextupdateWrapper = new EventListenerWrapper('textupdate', this); + private readonly _ontextformatupdateWrapper = new EventListenerWrapper('textformatupdate', this); + private readonly _oncharacterboundsupdateWrapper = new EventListenerWrapper('characterboundsupdate', this); + private readonly _oncompositionstartWrapper = new EventListenerWrapper('compositionstart', this); + private readonly _oncompositionendWrapper = new EventListenerWrapper('compositionend', this); + + override get ontextupdate(): EventHandler | null { return this._ontextupdateWrapper.eventHandler; } + override set ontextupdate(value: EventHandler | null) { this._ontextupdateWrapper.eventHandler = value; } + override get ontextformatupdate(): EventHandler | null { return this._ontextformatupdateWrapper.eventHandler; } + override set ontextformatupdate(value: EventHandler | null) { this._ontextformatupdateWrapper.eventHandler = value; } + override get oncharacterboundsupdate(): EventHandler | null { return this._oncharacterboundsupdateWrapper.eventHandler; } + override set oncharacterboundsupdate(value: EventHandler | null) { this._oncharacterboundsupdateWrapper.eventHandler = value; } + override get oncompositionstart(): EventHandler | null { return this._oncompositionstartWrapper.eventHandler; } + override set oncompositionstart(value: EventHandler | null) { this._oncompositionstartWrapper.eventHandler = value; } + override get oncompositionend(): EventHandler | null { return this._oncompositionendWrapper.eventHandler; } + override set oncompositionend(value: EventHandler | null) { this._oncompositionendWrapper.eventHandler = value; } + + + private readonly _listenerMap = new Map(); + + override addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: EditContextEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + override addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void { + if (!listener) { return; } + + const debugListener = (event: Event) => { + if (this._isDebugging) { + this.renderDebug(); + console.log(`DebugEditContex.on_${type}`, event); + } + if (typeof listener === 'function') { + listener.call(this, event); + } else if (typeof listener === 'object' && 'handleEvent' in listener) { + listener.handleEvent(event); + } + }; + this._listenerMap.set(listener, debugListener); + super.addEventListener(type, debugListener, options); + this.renderDebug(); + } + + override removeEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined): void { + if (!listener) { return; } + const debugListener = this._listenerMap.get(listener); + if (debugListener) { + super.removeEventListener(type, debugListener, options); + this._listenerMap.delete(listener); + } + this.renderDebug(); + } + + override dispatchEvent(event: Event): boolean { + return super.dispatchEvent(event); + } + + public startDebugging() { + this._isDebugging = true; + this.renderDebug(); + } + + public endDebugging() { + this._isDebugging = false; + this.renderDebug(); + } + + private _disposables: { dispose(): void }[] = []; + + public renderDebug() { + this._disposables.forEach(d => d.dispose()); + this._disposables = []; + if (!this._isDebugging || this._listenerMap.size === 0) { + return; + } + if (this._controlBounds) { + this._disposables.push(createRect(this._controlBounds, COLOR_FOR_CONTROL_BOUNDS)); + } + if (this._selectionBounds) { + this._disposables.push(createRect(this._selectionBounds, COLOR_FOR_SELECTION_BOUNDS)); + } + if (this._characterBounds) { + for (const rect of this._characterBounds.characterBounds) { + this._disposables.push(createRect(rect, COLOR_FOR_CHARACTER_BOUNDS)); + } + } + this._disposables.push(createDiv(this.text, this.selectionStart, this.selectionEnd)); + } +} + +function createDiv(text: string, selectionStart: number, selectionEnd: number) { + const ret = document.createElement('div'); + ret.className = 'debug-rect-marker'; + ret.style.position = 'absolute'; + ret.style.zIndex = '999999999'; + ret.style.bottom = '50px'; + ret.style.left = '60px'; + ret.style.backgroundColor = 'white'; + ret.style.border = '1px solid black'; + ret.style.padding = '5px'; + ret.style.whiteSpace = 'pre'; + ret.style.font = '12px monospace'; + ret.style.pointerEvents = 'none'; + + const before = text.substring(0, selectionStart); + const selected = text.substring(selectionStart, selectionEnd) || '|'; + const after = text.substring(selectionEnd) + ' '; + + const beforeNode = document.createTextNode(before); + ret.appendChild(beforeNode); + + const selectedNode = document.createElement('span'); + selectedNode.style.backgroundColor = 'yellow'; + selectedNode.appendChild(document.createTextNode(selected)); + + selectedNode.style.minWidth = '2px'; + selectedNode.style.minHeight = '16px'; + ret.appendChild(selectedNode); + + const afterNode = document.createTextNode(after); + ret.appendChild(afterNode); + + // eslint-disable-next-line no-restricted-syntax + document.body.appendChild(ret); + + return { + dispose: () => { + ret.remove(); + } + }; +} + +function createRect(rect: DOMRect, color: 'green' | 'blue' | 'red') { + const ret = document.createElement('div'); + ret.className = 'debug-rect-marker'; + ret.style.position = 'absolute'; + ret.style.zIndex = '999999999'; + ret.style.outline = `2px solid ${color}`; + ret.style.pointerEvents = 'none'; + + ret.style.top = rect.top + 'px'; + ret.style.left = rect.left + 'px'; + ret.style.width = rect.width + 'px'; + ret.style.height = rect.height + 'px'; + + // eslint-disable-next-line no-restricted-syntax + document.body.appendChild(ret); + + return { + dispose: () => { + ret.remove(); + } + }; +} + +class EventListenerWrapper { + private _eventHandler: EventHandler | null = null; + + constructor( + private readonly _eventType: string, + private readonly _target: EventTarget, + ) { + } + + get eventHandler(): EventHandler | null { + return this._eventHandler; + } + + set eventHandler(value: EventHandler | null) { + if (this._eventHandler) { + this._target.removeEventListener(this._eventType, this._eventHandler); + } + this._eventHandler = value; + if (value) { + this._target.addEventListener(this._eventType, value); + } + } +} diff --git a/src/vs/editor/browser/controller/editContext/native/nativeEditContext.css b/src/vs/editor/browser/controller/editContext/native/nativeEditContext.css new file mode 100644 index 00000000000..e093d99a73f --- /dev/null +++ b/src/vs/editor/browser/controller/editContext/native/nativeEditContext.css @@ -0,0 +1,56 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +.monaco-editor .native-edit-context { + margin: 0; + padding: 0; + position: absolute; + overflow: hidden; + z-index: -10; + white-space: pre-wrap; + text-wrap: nowrap; +} + +.monaco-editor .edit-context-format-decoration { + text-decoration-line: underline; + /* TODO @aiday chose a theme color */ + text-decoration-color: blue; + color: var(--vscode-editor-foreground, inherit); + opacity: 0.8; + + &.underline-style-none { + text-decoration-line: none; + text-decoration-style: none; + } + + &.underline-style-solid { + text-decoration-style: solid; + } + + &.underline-style-dotted { + text-decoration-style: dotted; + } + + &.underline-style-dashed { + text-decoration-style: dashed; + } + + &.underline-style-wavy { + text-decoration-style: wavy; + } + + &.underline-thickness-none { + text-decoration-line: none; + text-decoration-thickness: none; + } + + &.underline-thickness-thin { + text-decoration-thickness: 1px; + } + + &.underline-thickness-thick { + text-decoration-thickness: 2px; + } +} diff --git a/src/vs/editor/browser/controller/editContext/native/nativeEditContext.ts b/src/vs/editor/browser/controller/editContext/native/nativeEditContext.ts new file mode 100644 index 00000000000..99b24b97eb8 --- /dev/null +++ b/src/vs/editor/browser/controller/editContext/native/nativeEditContext.ts @@ -0,0 +1,378 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import './nativeEditContext.css'; +import { isFirefox } from '../../../../../base/browser/browser.js'; +import { addDisposableListener } from '../../../../../base/browser/dom.js'; +import { FastDomNode } from '../../../../../base/browser/fastDomNode.js'; +import { StandardKeyboardEvent } from '../../../../../base/browser/keyboardEvent.js'; +import { KeyCode } from '../../../../../base/common/keyCodes.js'; +import { IClipboardService } from '../../../../../platform/clipboard/common/clipboardService.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { CursorState } from '../../../../common/cursorCommon.js'; +import { CursorChangeReason } from '../../../../common/cursorEvents.js'; +import { EndOfLinePreference, IModelDeltaDecoration } from '../../../../common/model.js'; +import { ViewConfigurationChangedEvent, ViewCursorStateChangedEvent } from '../../../../common/viewEvents.js'; +import { ViewContext } from '../../../../common/viewModel/viewContext.js'; +import { RestrictedRenderingContext, RenderingContext } from '../../../view/renderingContext.js'; +import { ViewController } from '../../../view/viewController.js'; +import { ClipboardStoredMetadata, getDataToCopy, InMemoryClipboardMetadataManager } from '../clipboardUtils.js'; +import { AbstractEditContext } from '../editContextUtils.js'; +import { editContextAddDisposableListener, FocusTracker, ITypeData } from './nativeEditContextUtils.js'; +import { ScreenReaderSupport } from './screenReaderSupport.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { Position } from '../../../../common/core/position.js'; +import { IVisibleRangeProvider } from '../textArea/textAreaEditContext.js'; +import { PositionOffsetTransformer } from '../../../../common/core/positionToOffset.js'; + +export class NativeEditContext extends AbstractEditContext { + + public readonly domNode: FastDomNode; + private readonly _editContext: EditContext; + private readonly _screenReaderSupport: ScreenReaderSupport; + + // Overflow guard container + private _parent: HTMLElement | undefined; + private _decorations: string[] = []; + private _primarySelection: Selection = new Selection(1, 1, 1, 1); + + private _textStartPositionWithinEditor: Position = new Position(1, 1); + + private readonly _focusTracker: FocusTracker; + + constructor( + context: ViewContext, + viewController: ViewController, + private readonly _visibleRangeProvider: IVisibleRangeProvider, + @IInstantiationService instantiationService: IInstantiationService, + @IClipboardService clipboardService: IClipboardService, + ) { + super(context); + + this.domNode = new FastDomNode(document.createElement('div')); + this.domNode.setClassName(`native-edit-context`); + this._updateDomAttributes(); + + this._focusTracker = this._register(new FocusTracker(this.domNode.domNode, (newFocusValue: boolean) => this._context.viewModel.setHasFocus(newFocusValue))); + + this._editContext = new EditContext(); + this.domNode.domNode.editContext = this._editContext; + + this._screenReaderSupport = instantiationService.createInstance(ScreenReaderSupport, this.domNode, context); + + this._register(addDisposableListener(this.domNode.domNode, 'copy', () => this._ensureClipboardGetsEditorSelection(clipboardService))); + this._register(addDisposableListener(this.domNode.domNode, 'cut', () => { + this._ensureClipboardGetsEditorSelection(clipboardService); + viewController.cut(); + })); + + this._register(addDisposableListener(this.domNode.domNode, 'keyup', (e) => viewController.emitKeyUp(new StandardKeyboardEvent(e)))); + this._register(addDisposableListener(this.domNode.domNode, 'keydown', async (e) => { + + const standardKeyboardEvent = new StandardKeyboardEvent(e); + + // When the IME is visible, the keys, like arrow-left and arrow-right, should be used to navigate in the IME, and should not be propagated further + if (standardKeyboardEvent.keyCode === KeyCode.KEY_IN_COMPOSITION) { + standardKeyboardEvent.stopPropagation(); + } + viewController.emitKeyDown(standardKeyboardEvent); + })); + this._register(addDisposableListener(this.domNode.domNode, 'beforeinput', async (e) => { + if (e.inputType === 'insertParagraph') { + this._onType(viewController, { text: '\n', replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: 0 }); + } + })); + + // Edit context events + this._register(editContextAddDisposableListener(this._editContext, 'textformatupdate', (e) => this._handleTextFormatUpdate(e))); + this._register(editContextAddDisposableListener(this._editContext, 'characterboundsupdate', (e) => this._updateCharacterBounds(e))); + this._register(editContextAddDisposableListener(this._editContext, 'textupdate', (e) => { + this._emitTypeEvent(viewController, e); + })); + this._register(editContextAddDisposableListener(this._editContext, 'compositionstart', (e) => { + // Utlimately fires onDidCompositionStart() on the editor to notify for example suggest model of composition state + // Updates the composition state of the cursor controller which determines behavior of typing with interceptors + viewController.compositionStart(); + // Emits ViewCompositionStartEvent which can be depended on by ViewEventHandlers + this._context.viewModel.onCompositionStart(); + })); + this._register(editContextAddDisposableListener(this._editContext, 'compositionend', (e) => { + // Utlimately fires compositionEnd() on the editor to notify for example suggest model of composition state + // Updates the composition state of the cursor controller which determines behavior of typing with interceptors + viewController.compositionEnd(); + // Emits ViewCompositionEndEvent which can be depended on by ViewEventHandlers + this._context.viewModel.onCompositionEnd(); + })); + } + + // --- Public methods --- + + public override dispose(): void { + // Force blue the dom node so can write in pane with no native edit context after disposal + this.domNode.domNode.blur(); + this.domNode.domNode.remove(); + super.dispose(); + } + + public appendTo(overflowGuardContainer: FastDomNode): void { + overflowGuardContainer.appendChild(this.domNode); + this._parent = overflowGuardContainer.domNode; + } + + public setAriaOptions(): void { + this._screenReaderSupport.setAriaOptions(); + } + + /* Last rendered data needed for correct hit-testing and determining the mouse position. + * Without this, the selection will blink as incorrect mouse position is calculated */ + public getLastRenderData(): Position | null { + return this._primarySelection.getPosition(); + } + + public prepareRender(ctx: RenderingContext): void { + this._screenReaderSupport.prepareRender(ctx); + this._updateEditContext(); + this._updateSelectionAndControlBounds(ctx); + } + + public render(ctx: RestrictedRenderingContext): void { + this._screenReaderSupport.render(ctx); + } + + public override onCursorStateChanged(e: ViewCursorStateChangedEvent): boolean { + this._primarySelection = e.modelSelections[0] ?? new Selection(1, 1, 1, 1); + this._screenReaderSupport.onCursorStateChanged(e); + return true; + } + + public override onConfigurationChanged(e: ViewConfigurationChangedEvent): boolean { + this._screenReaderSupport.onConfigurationChanged(e); + this._updateDomAttributes(); + return true; + } + + public writeScreenReaderContent(): void { + this._screenReaderSupport.writeScreenReaderContent(); + } + + public isFocused(): boolean { return this._focusTracker.isFocused; } + + public focus(): void { this._focusTracker.focus(); } + + public refreshFocusState(): void { } + + // --- Private methods --- + + private _updateDomAttributes(): void { + const options = this._context.configuration.options; + this.domNode.domNode.setAttribute('tabindex', String(options.get(EditorOption.tabIndex))); + } + + private _updateEditContext(): void { + const editContextState = this._getNewEditContextState(); + this._editContext.updateText(0, Number.MAX_SAFE_INTEGER, editContextState.text); + this._editContext.updateSelection(editContextState.selectionStartOffset, editContextState.selectionEndOffset); + this._textStartPositionWithinEditor = editContextState.textStartPositionWithinEditor; + } + + private _emitTypeEvent(viewController: ViewController, e: TextUpdateEvent): void { + if (!this._editContext) { + return; + } + const model = this._context.viewModel.model; + const offsetOfStartOfText = model.getOffsetAt(this._textStartPositionWithinEditor); + const offsetOfSelectionEnd = model.getOffsetAt(this._primarySelection.getEndPosition()); + const offsetOfSelectionStart = model.getOffsetAt(this._primarySelection.getStartPosition()); + const selectionEndOffset = offsetOfSelectionEnd - offsetOfStartOfText; + const selectionStartOffset = offsetOfSelectionStart - offsetOfStartOfText; + + let replaceNextCharCnt = 0; + let replacePrevCharCnt = 0; + if (e.updateRangeEnd > selectionEndOffset) { + replaceNextCharCnt = e.updateRangeEnd - selectionEndOffset; + } + if (e.updateRangeStart < selectionStartOffset) { + replacePrevCharCnt = selectionStartOffset - e.updateRangeStart; + } + let text = ''; + if (selectionStartOffset < e.updateRangeStart) { + text += this._editContext.text.substring(selectionStartOffset, e.updateRangeStart); + } + text += e.text; + if (selectionEndOffset > e.updateRangeEnd) { + text += this._editContext.text.substring(e.updateRangeEnd, selectionEndOffset); + } + const typeInput: ITypeData = { + text, + replacePrevCharCnt, + replaceNextCharCnt, + positionDelta: 0, + }; + this._onType(viewController, typeInput); + + // The selection can be non empty so need to update the cursor states after typing (which makes the selection empty) + const primaryPositionOffset = selectionStartOffset - replacePrevCharCnt + text.length; + this._updateCursorStatesAfterType(primaryPositionOffset, e.selectionStart, e.selectionEnd); + } + + private _onType(viewController: ViewController, typeInput: ITypeData): void { + if (typeInput.replacePrevCharCnt || typeInput.replaceNextCharCnt || typeInput.positionDelta) { + viewController.compositionType(typeInput.text, typeInput.replacePrevCharCnt, typeInput.replaceNextCharCnt, typeInput.positionDelta); + } else { + viewController.type(typeInput.text); + } + } + + private _updateCursorStatesAfterType(primaryPositionOffset: number, desiredSelectionStartOffset: number, desiredSelectionEndOffset: number): void { + const leftDeltaOffsetOfPrimaryCursor = desiredSelectionStartOffset - primaryPositionOffset; + const rightDeltaOffsetOfPrimaryCursor = desiredSelectionEndOffset - primaryPositionOffset; + const cursorPositions = this._context.viewModel.getCursorStates().map(cursorState => cursorState.modelState.position); + const newSelections = cursorPositions.map(cursorPosition => { + const positionLineNumber = cursorPosition.lineNumber; + const positionColumn = cursorPosition.column; + return new Selection(positionLineNumber, positionColumn + leftDeltaOffsetOfPrimaryCursor, positionLineNumber, positionColumn + rightDeltaOffsetOfPrimaryCursor); + }); + const newCursorStates = newSelections.map(selection => CursorState.fromModelSelection(selection)); + this._context.viewModel.setCursorStates('editContext', CursorChangeReason.Explicit, newCursorStates); + } + + private _getNewEditContextState(): { text: string; selectionStartOffset: number; selectionEndOffset: number; textStartPositionWithinEditor: Position } { + const model = this._context.viewModel.model; + const primarySelectionStartLine = this._primarySelection.startLineNumber; + const primarySelectionEndLine = this._primarySelection.endLineNumber; + const endColumnOfEndLineNumber = model.getLineMaxColumn(primarySelectionEndLine); + const rangeOfText = new Range(primarySelectionStartLine, 1, primarySelectionEndLine, endColumnOfEndLineNumber); + const text = model.getValueInRange(rangeOfText, EndOfLinePreference.TextDefined); + const selectionStartOffset = this._primarySelection.startColumn - 1; + const selectionEndOffset = text.length + this._primarySelection.endColumn - endColumnOfEndLineNumber; + const textStartPositionWithinEditor = rangeOfText.getStartPosition(); + return { + text, + selectionStartOffset, + selectionEndOffset, + textStartPositionWithinEditor + }; + } + + private _handleTextFormatUpdate(e: TextFormatUpdateEvent): void { + if (!this._editContext) { + return; + } + const formats = e.getTextFormats(); + const textStartPositionWithinEditor = this._textStartPositionWithinEditor; + const decorations: IModelDeltaDecoration[] = []; + formats.forEach(f => { + const textModel = this._context.viewModel.model; + const offsetOfEditContextText = textModel.getOffsetAt(textStartPositionWithinEditor); + const startPositionOfDecoration = textModel.getPositionAt(offsetOfEditContextText + f.rangeStart); + const endPositionOfDecoration = textModel.getPositionAt(offsetOfEditContextText + f.rangeEnd); + const decorationRange = Range.fromPositions(startPositionOfDecoration, endPositionOfDecoration); + const classNames = [ + 'edit-context-format-decoration', + `underline-style-${f.underlineStyle.toLowerCase()}`, + `underline-thickness-${f.underlineThickness.toLowerCase()}`, + ]; + decorations.push({ + range: decorationRange, + options: { + description: 'textFormatDecoration', + inlineClassName: classNames.join(' '), + } + }); + }); + this._decorations = this._context.viewModel.model.deltaDecorations(this._decorations, decorations); + } + + private _updateSelectionAndControlBounds(ctx: RenderingContext) { + if (!this._parent) { + return; + } + const options = this._context.configuration.options; + const lineHeight = options.get(EditorOption.lineHeight); + const contentLeft = options.get(EditorOption.layoutInfo).contentLeft; + const parentBounds = this._parent.getBoundingClientRect(); + const verticalOffsetStart = this._context.viewLayout.getVerticalOffsetForLineNumber(this._primarySelection.startLineNumber); + const editorScrollTop = this._context.viewLayout.getCurrentScrollTop(); + + const top = parentBounds.top + verticalOffsetStart - editorScrollTop; + const height = (this._primarySelection.endLineNumber - this._primarySelection.startLineNumber + 1) * lineHeight; + let left = parentBounds.left + contentLeft; + let width: number; + + if (this._primarySelection.isEmpty()) { + const linesVisibleRanges = ctx.visibleRangeForPosition(this._primarySelection.getPosition()); + if (linesVisibleRanges) { + left += linesVisibleRanges.left; + } + width = 0; + } else { + width = parentBounds.width - contentLeft; + } + + const selectionBounds = new DOMRect(left, top, width, height); + this._editContext.updateSelectionBounds(selectionBounds); + this._editContext.updateControlBounds(selectionBounds); + } + + private _updateCharacterBounds(e: CharacterBoundsUpdateEvent): void { + if (!this._parent) { + return; + } + const options = this._context.configuration.options; + const typicalHalfWidthCharacterWidth = options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth; + const lineHeight = options.get(EditorOption.lineHeight); + const contentLeft = options.get(EditorOption.layoutInfo).contentLeft; + const parentBounds = this._parent.getBoundingClientRect(); + + const characterBounds: DOMRect[] = []; + const offsetTransformer = new PositionOffsetTransformer(this._editContext.text); + for (let offset = e.rangeStart; offset < e.rangeEnd; offset++) { + const editContextStartPosition = offsetTransformer.getPosition(offset); + const textStartLineOffsetWithinEditor = this._textStartPositionWithinEditor.lineNumber - 1; + const characterStartPosition = new Position(textStartLineOffsetWithinEditor + editContextStartPosition.lineNumber, editContextStartPosition.column); + const characterEndPosition = characterStartPosition.delta(0, 1); + const characterRange = Range.fromPositions(characterStartPosition, characterEndPosition); + const characterLinesVisibleRanges = this._visibleRangeProvider.linesVisibleRangesForRange(characterRange, true) ?? []; + const characterVerticalOffset = this._context.viewLayout.getVerticalOffsetForLineNumber(characterRange.startLineNumber); + const editorScrollTop = this._context.viewLayout.getCurrentScrollTop(); + const top = parentBounds.top + characterVerticalOffset - editorScrollTop; + + let left = 0; + let width = typicalHalfWidthCharacterWidth; + if (characterLinesVisibleRanges.length > 0) { + for (const visibleRange of characterLinesVisibleRanges[0].ranges) { + left = visibleRange.left; + width = visibleRange.width; + break; + } + } + characterBounds.push(new DOMRect(parentBounds.left + contentLeft + left, top, width, lineHeight)); + } + this._editContext.updateCharacterBounds(e.rangeStart, characterBounds); + } + + private _ensureClipboardGetsEditorSelection(clipboardService: IClipboardService): void { + const options = this._context.configuration.options; + const emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard); + const copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting); + const selections = this._context.viewModel.getCursorStates().map(cursorState => cursorState.modelState.selection); + const dataToCopy = getDataToCopy(this._context.viewModel, selections, emptySelectionClipboard, copyWithSyntaxHighlighting); + const storedMetadata: ClipboardStoredMetadata = { + version: 1, + isFromEmptySelection: dataToCopy.isFromEmptySelection, + multicursorText: dataToCopy.multicursorText, + mode: dataToCopy.mode + }; + InMemoryClipboardMetadataManager.INSTANCE.set( + // When writing "LINE\r\n" to the clipboard and then pasting, + // Firefox pastes "LINE\n", so let's work around this quirk + (isFirefox ? dataToCopy.text.replace(/\r\n/g, '\n') : dataToCopy.text), + storedMetadata + ); + clipboardService.writeText(dataToCopy.text); + } +} diff --git a/src/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.ts b/src/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.ts new file mode 100644 index 00000000000..e55e1521fac --- /dev/null +++ b/src/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.ts @@ -0,0 +1,55 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { addDisposableListener } from '../../../../../base/browser/dom.js'; +import { IDisposable, Disposable } from '../../../../../base/common/lifecycle.js'; + +export interface ITypeData { + text: string; + replacePrevCharCnt: number; + replaceNextCharCnt: number; + positionDelta: number; +} + +export class FocusTracker extends Disposable { + private _isFocused: boolean = false; + + constructor( + private readonly _domNode: HTMLElement, + private readonly _onFocusChange: (newFocusValue: boolean) => void, + ) { + super(); + this._register(addDisposableListener(this._domNode, 'focus', () => this._handleFocusedChanged(true))); + this._register(addDisposableListener(this._domNode, 'blur', () => this._handleFocusedChanged(false))); + } + + private _handleFocusedChanged(focused: boolean): void { + if (this._isFocused === focused) { + return; + } + this._isFocused = focused; + this._onFocusChange(this._isFocused); + } + + public focus(): void { + // fixes: https://github.com/microsoft/vscode/issues/228147 + // Immediately call this method in order to directly set the field isFocused to true so the textInputFocus context key is evaluated correctly + this._handleFocusedChanged(true); + this._domNode.focus(); + } + + get isFocused(): boolean { + return this._isFocused; + } +} + +export function editContextAddDisposableListener(target: EventTarget, type: K, listener: (this: GlobalEventHandlers, ev: EditContextEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): IDisposable { + target.addEventListener(type, listener as any, options); + return { + dispose() { + target.removeEventListener(type, listener as any); + } + }; +} diff --git a/src/vs/editor/browser/controller/editContext/native/screenReaderSupport.ts b/src/vs/editor/browser/controller/editContext/native/screenReaderSupport.ts new file mode 100644 index 00000000000..5a93b45986c --- /dev/null +++ b/src/vs/editor/browser/controller/editContext/native/screenReaderSupport.ts @@ -0,0 +1,158 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { getActiveWindow } from '../../../../../base/browser/dom.js'; +import { FastDomNode } from '../../../../../base/browser/fastDomNode.js'; +import { AccessibilitySupport } from '../../../../../platform/accessibility/common/accessibility.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { FontInfo } from '../../../../common/config/fontInfo.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { EndOfLinePreference } from '../../../../common/model.js'; +import { ViewConfigurationChangedEvent, ViewCursorStateChangedEvent } from '../../../../common/viewEvents.js'; +import { ViewContext } from '../../../../common/viewModel/viewContext.js'; +import { applyFontInfo } from '../../../config/domFontInfo.js'; +import { RestrictedRenderingContext, RenderingContext } from '../../../view/renderingContext.js'; +import { ariaLabelForScreenReaderContent, ISimpleModel, newlinecount, PagedScreenReaderStrategy, ScreenReaderContentState } from '../screenReaderUtils.js'; + +export class ScreenReaderSupport { + + // Configuration values + private _contentLeft: number = 1; + private _contentWidth: number = 1; + private _lineHeight: number = 1; + private _fontInfo: FontInfo | undefined; + private _accessibilitySupport: AccessibilitySupport = AccessibilitySupport.Unknown; + private _accessibilityPageSize: number = 1; + + private _primarySelection: Selection = new Selection(1, 1, 1, 1); + private _screenReaderContentState: ScreenReaderContentState | undefined; + + constructor( + private readonly _domNode: FastDomNode, + private readonly _context: ViewContext, + @IKeybindingService private readonly _keybindingService: IKeybindingService, + ) { + this._updateConfigurationSettings(); + this._updateDomAttributes(); + } + + public onConfigurationChanged(e: ViewConfigurationChangedEvent): void { + this._updateConfigurationSettings(); + this._updateDomAttributes(); + if (e.hasChanged(EditorOption.accessibilitySupport)) { + this.writeScreenReaderContent(); + } + } + + private _updateConfigurationSettings(): void { + const options = this._context.configuration.options; + const layoutInfo = options.get(EditorOption.layoutInfo); + this._contentLeft = layoutInfo.contentLeft; + this._contentWidth = layoutInfo.contentWidth; + this._fontInfo = options.get(EditorOption.fontInfo); + this._lineHeight = options.get(EditorOption.lineHeight); + this._accessibilitySupport = options.get(EditorOption.accessibilitySupport); + this._accessibilityPageSize = options.get(EditorOption.accessibilityPageSize); + } + + private _updateDomAttributes(): void { + const options = this._context.configuration.options; + this._domNode.domNode.setAttribute('aria-label', ariaLabelForScreenReaderContent(options, this._keybindingService)); + const tabSize = this._context.viewModel.model.getOptions().tabSize; + const spaceWidth = options.get(EditorOption.fontInfo).spaceWidth; + this._domNode.domNode.style.tabSize = `${tabSize * spaceWidth}px`; + } + + public onCursorStateChanged(e: ViewCursorStateChangedEvent): void { + this._primarySelection = e.selections[0] ?? new Selection(1, 1, 1, 1); + } + + public prepareRender(ctx: RenderingContext): void { + this.writeScreenReaderContent(); + } + + public render(ctx: RestrictedRenderingContext): void { + if (!this._screenReaderContentState) { + return; + } + // For correct alignment of the screen reader content, we need to apply the correct font + applyFontInfo(this._domNode, this._fontInfo!); + + const verticalOffsetForPrimaryLineNumber = this._context.viewLayout.getVerticalOffsetForLineNumber(this._primarySelection.positionLineNumber); + const editorScrollTop = this._context.viewLayout.getCurrentScrollTop(); + const top = verticalOffsetForPrimaryLineNumber - editorScrollTop; + + this._domNode.setTop(top); + this._domNode.setLeft(this._contentLeft); + this._domNode.setWidth(this._contentWidth); + this._domNode.setHeight(this._lineHeight); + + // Setting position within the screen reader content by modifying scroll position + const textContentBeforeSelection = this._screenReaderContentState.value.substring(0, this._screenReaderContentState.selectionStart); + const numberOfLinesOfContentBeforeSelection = newlinecount(textContentBeforeSelection); + this._domNode.domNode.scrollTop = numberOfLinesOfContentBeforeSelection * this._lineHeight; + } + + public setAriaOptions(): void { } + + public writeScreenReaderContent(): void { + const focusedElement = getActiveWindow().document.activeElement; + if (!focusedElement || focusedElement !== this._domNode.domNode) { + return; + } + this._screenReaderContentState = this._getScreenReaderContentState(); + if (!this._screenReaderContentState) { + return; + } + if (this._domNode.domNode.textContent !== this._screenReaderContentState.value) { + this._domNode.domNode.textContent = this._screenReaderContentState.value; + } + this._setSelectionOfScreenReaderContent(this._screenReaderContentState.selectionStart, this._screenReaderContentState.selectionEnd); + } + + private _getScreenReaderContentState(): ScreenReaderContentState | undefined { + if (this._accessibilitySupport === AccessibilitySupport.Disabled) { + return; + } + const simpleModel: ISimpleModel = { + getLineCount: (): number => { + return this._context.viewModel.getLineCount(); + }, + getLineMaxColumn: (lineNumber: number): number => { + return this._context.viewModel.getLineMaxColumn(lineNumber); + }, + getValueInRange: (range: Range, eol: EndOfLinePreference): string => { + return this._context.viewModel.getValueInRange(range, eol); + }, + getValueLengthInRange: (range: Range, eol: EndOfLinePreference): number => { + return this._context.viewModel.getValueLengthInRange(range, eol); + }, + modifyPosition: (position: Position, offset: number): Position => { + return this._context.viewModel.modifyPosition(position, offset); + } + }; + return PagedScreenReaderStrategy.fromEditorSelection(simpleModel, this._primarySelection, this._accessibilityPageSize, this._accessibilitySupport === AccessibilitySupport.Unknown); + } + + private _setSelectionOfScreenReaderContent(selectionOffsetStart: number, selectionOffsetEnd: number): void { + const activeDocument = getActiveWindow().document; + const activeDocumentSelection = activeDocument.getSelection(); + if (!activeDocumentSelection) { + return; + } + const textContent = this._domNode.domNode.firstChild; + if (!textContent) { + return; + } + const range = new globalThis.Range(); + range.setStart(textContent, selectionOffsetStart); + range.setEnd(textContent, selectionOffsetEnd); + activeDocumentSelection.removeAllRanges(); + activeDocumentSelection.addRange(range); + } +} diff --git a/src/vs/editor/browser/controller/editContext/screenReaderUtils.ts b/src/vs/editor/browser/controller/editContext/screenReaderUtils.ts new file mode 100644 index 00000000000..cc2dcd3f371 --- /dev/null +++ b/src/vs/editor/browser/controller/editContext/screenReaderUtils.ts @@ -0,0 +1,138 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { EndOfLinePreference } from '../../../common/model.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { EditorOption, IComputedEditorOptions } from '../../../common/config/editorOptions.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { AccessibilitySupport } from '../../../../platform/accessibility/common/accessibility.js'; +import * as nls from '../../../../nls.js'; + +export interface ISimpleModel { + getLineCount(): number; + getLineMaxColumn(lineNumber: number): number; + getValueInRange(range: Range, eol: EndOfLinePreference): string; + getValueLengthInRange(range: Range, eol: EndOfLinePreference): number; + modifyPosition(position: Position, offset: number): Position; +} + +export interface ScreenReaderContentState { + value: string; + + /** the offset where selection starts inside `value` */ + selectionStart: number; + + /** the offset where selection ends inside `value` */ + selectionEnd: number; + + /** the editor range in the view coordinate system that matches the selection inside `value` */ + selection: Range; + + /** the visible line count (wrapped, not necessarily matching \n characters) for the text in `value` before `selectionStart` */ + newlineCountBeforeSelection: number; +} + +export class PagedScreenReaderStrategy { + private static _getPageOfLine(lineNumber: number, linesPerPage: number): number { + return Math.floor((lineNumber - 1) / linesPerPage); + } + + private static _getRangeForPage(page: number, linesPerPage: number): Range { + const offset = page * linesPerPage; + const startLineNumber = offset + 1; + const endLineNumber = offset + linesPerPage; + return new Range(startLineNumber, 1, endLineNumber + 1, 1); + } + + public static fromEditorSelection(model: ISimpleModel, selection: Range, linesPerPage: number, trimLongText: boolean): ScreenReaderContentState { + // Chromium handles very poorly text even of a few thousand chars + // Cut text to avoid stalling the entire UI + const LIMIT_CHARS = 500; + + const selectionStartPage = PagedScreenReaderStrategy._getPageOfLine(selection.startLineNumber, linesPerPage); + const selectionStartPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionStartPage, linesPerPage); + + const selectionEndPage = PagedScreenReaderStrategy._getPageOfLine(selection.endLineNumber, linesPerPage); + const selectionEndPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionEndPage, linesPerPage); + + let pretextRange = selectionStartPageRange.intersectRanges(new Range(1, 1, selection.startLineNumber, selection.startColumn))!; + if (trimLongText && model.getValueLengthInRange(pretextRange, EndOfLinePreference.LF) > LIMIT_CHARS) { + const pretextStart = model.modifyPosition(pretextRange.getEndPosition(), -LIMIT_CHARS); + pretextRange = Range.fromPositions(pretextStart, pretextRange.getEndPosition()); + } + const pretext = model.getValueInRange(pretextRange, EndOfLinePreference.LF); + + const lastLine = model.getLineCount(); + const lastLineMaxColumn = model.getLineMaxColumn(lastLine); + let posttextRange = selectionEndPageRange.intersectRanges(new Range(selection.endLineNumber, selection.endColumn, lastLine, lastLineMaxColumn))!; + if (trimLongText && model.getValueLengthInRange(posttextRange, EndOfLinePreference.LF) > LIMIT_CHARS) { + const posttextEnd = model.modifyPosition(posttextRange.getStartPosition(), LIMIT_CHARS); + posttextRange = Range.fromPositions(posttextRange.getStartPosition(), posttextEnd); + } + const posttext = model.getValueInRange(posttextRange, EndOfLinePreference.LF); + + + let text: string; + if (selectionStartPage === selectionEndPage || selectionStartPage + 1 === selectionEndPage) { + // take full selection + text = model.getValueInRange(selection, EndOfLinePreference.LF); + } else { + const selectionRange1 = selectionStartPageRange.intersectRanges(selection)!; + const selectionRange2 = selectionEndPageRange.intersectRanges(selection)!; + text = ( + model.getValueInRange(selectionRange1, EndOfLinePreference.LF) + + String.fromCharCode(8230) + + model.getValueInRange(selectionRange2, EndOfLinePreference.LF) + ); + } + if (trimLongText && text.length > 2 * LIMIT_CHARS) { + text = text.substring(0, LIMIT_CHARS) + String.fromCharCode(8230) + text.substring(text.length - LIMIT_CHARS, text.length); + } + + return { + value: pretext + text + posttext, + selection: selection, + selectionStart: pretext.length, + selectionEnd: pretext.length + text.length, + newlineCountBeforeSelection: pretextRange.endLineNumber - pretextRange.startLineNumber, + }; + } +} + +export function ariaLabelForScreenReaderContent(options: IComputedEditorOptions, keybindingService: IKeybindingService) { + const accessibilitySupport = options.get(EditorOption.accessibilitySupport); + if (accessibilitySupport === AccessibilitySupport.Disabled) { + + const toggleKeybindingLabel = keybindingService.lookupKeybinding('editor.action.toggleScreenReaderAccessibilityMode')?.getAriaLabel(); + const runCommandKeybindingLabel = keybindingService.lookupKeybinding('workbench.action.showCommands')?.getAriaLabel(); + const keybindingEditorKeybindingLabel = keybindingService.lookupKeybinding('workbench.action.openGlobalKeybindings')?.getAriaLabel(); + const editorNotAccessibleMessage = nls.localize('accessibilityModeOff', "The editor is not accessible at this time."); + if (toggleKeybindingLabel) { + return nls.localize('accessibilityOffAriaLabel', "{0} To enable screen reader optimized mode, use {1}", editorNotAccessibleMessage, toggleKeybindingLabel); + } else if (runCommandKeybindingLabel) { + return nls.localize('accessibilityOffAriaLabelNoKb', "{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.", editorNotAccessibleMessage, runCommandKeybindingLabel); + } else if (keybindingEditorKeybindingLabel) { + return nls.localize('accessibilityOffAriaLabelNoKbs', "{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.", editorNotAccessibleMessage, keybindingEditorKeybindingLabel); + } else { + // SOS + return editorNotAccessibleMessage; + } + } + return options.get(EditorOption.ariaLabel); +} + +export function newlinecount(text: string): number { + let result = 0; + let startIndex = -1; + do { + startIndex = text.indexOf('\n', startIndex + 1); + if (startIndex === -1) { + break; + } + result++; + } while (true); + return result; +} diff --git a/src/vs/editor/browser/controller/textAreaHandler.css b/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.css similarity index 100% rename from src/vs/editor/browser/controller/textAreaHandler.css rename to src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.css diff --git a/src/vs/editor/browser/controller/textAreaHandler.ts b/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.ts similarity index 85% rename from src/vs/editor/browser/controller/textAreaHandler.ts rename to src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.ts index a5f824ca450..acbc89e9e8e 100644 --- a/src/vs/editor/browser/controller/textAreaHandler.ts +++ b/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.ts @@ -3,43 +3,47 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./textAreaHandler'; -import * as nls from 'vs/nls'; -import * as browser from 'vs/base/browser/browser'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import * as platform from 'vs/base/common/platform'; -import * as strings from 'vs/base/common/strings'; -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { CopyOptions, ICompositionData, IPasteData, ITextAreaInputHost, TextAreaInput, ClipboardDataToCopy, TextAreaWrapper } from 'vs/editor/browser/controller/textAreaInput'; -import { ISimpleModel, ITypeData, PagedScreenReaderStrategy, TextAreaState, _debugComposition } from 'vs/editor/browser/controller/textAreaState'; -import { ViewController } from 'vs/editor/browser/view/viewController'; -import { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart'; -import { LineNumbersOverlay } from 'vs/editor/browser/viewParts/lineNumbers/lineNumbers'; -import { Margin } from 'vs/editor/browser/viewParts/margin/margin'; -import { RenderLineNumbersType, EditorOption, IComputedEditorOptions, EditorOptions } from 'vs/editor/common/config/editorOptions'; -import { FontInfo } from 'vs/editor/common/config/fontInfo'; -import { WordCharacterClass, getMapForWordSeparators } from 'vs/editor/common/core/wordCharacterClassifier'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { EndOfLinePreference } from 'vs/editor/common/model'; -import { RenderingContext, RestrictedRenderingContext, HorizontalPosition } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; -import { IEditorAriaOptions } from 'vs/editor/browser/editorBrowser'; -import { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from 'vs/base/browser/ui/mouseCursor/mouseCursor'; -import { TokenizationRegistry } from 'vs/editor/common/languages'; -import { ColorId, ITokenPresentation } from 'vs/editor/common/encodedTokenAttributes'; -import { Color } from 'vs/base/common/color'; -import { IME } from 'vs/base/common/ime'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import './textAreaEditContext.css'; +import * as nls from '../../../../../nls.js'; +import * as browser from '../../../../../base/browser/browser.js'; +import { FastDomNode, createFastDomNode } from '../../../../../base/browser/fastDomNode.js'; +import { IKeyboardEvent } from '../../../../../base/browser/keyboardEvent.js'; +import * as platform from '../../../../../base/common/platform.js'; +import * as strings from '../../../../../base/common/strings.js'; +import { applyFontInfo } from '../../../config/domFontInfo.js'; +import { ViewController } from '../../../view/viewController.js'; +import { PartFingerprint, PartFingerprints } from '../../../view/viewPart.js'; +import { LineNumbersOverlay } from '../../../viewParts/lineNumbers/lineNumbers.js'; +import { Margin } from '../../../viewParts/margin/margin.js'; +import { RenderLineNumbersType, EditorOption, IComputedEditorOptions, EditorOptions } from '../../../../common/config/editorOptions.js'; +import { FontInfo } from '../../../../common/config/fontInfo.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { ScrollType } from '../../../../common/editorCommon.js'; +import { EndOfLinePreference } from '../../../../common/model.js'; +import { RenderingContext, RestrictedRenderingContext, HorizontalPosition, LineVisibleRanges } from '../../../view/renderingContext.js'; +import { ViewContext } from '../../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../../common/viewEvents.js'; +import { AccessibilitySupport } from '../../../../../platform/accessibility/common/accessibility.js'; +import { IEditorAriaOptions } from '../../../editorBrowser.js'; +import { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from '../../../../../base/browser/ui/mouseCursor/mouseCursor.js'; +import { TokenizationRegistry } from '../../../../common/languages.js'; +import { ColorId, ITokenPresentation } from '../../../../common/encodedTokenAttributes.js'; +import { Color } from '../../../../../base/common/color.js'; +import { IME } from '../../../../../base/common/ime.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { AbstractEditContext } from '../editContextUtils.js'; +import { ICompositionData, IPasteData, ITextAreaInputHost, TextAreaInput, TextAreaWrapper } from './textAreaEditContextInput.js'; +import { ariaLabelForScreenReaderContent, ISimpleModel, newlinecount, PagedScreenReaderStrategy } from '../screenReaderUtils.js'; +import { ClipboardDataToCopy, getDataToCopy } from '../clipboardUtils.js'; +import { _debugComposition, ITypeData, TextAreaState } from './textAreaEditContextState.js'; +import { getMapForWordSeparators, WordCharacterClass } from '../../../../common/core/wordCharacterClassifier.js'; export interface IVisibleRangeProvider { visibleRangeForPosition(position: Position): HorizontalPosition | null; + linesVisibleRangesForRange(range: Range, includeNewLines: boolean): LineVisibleRanges[] | null; } class VisibleTextAreaData { @@ -106,7 +110,7 @@ class VisibleTextAreaData { const canUseZeroSizeTextarea = (browser.isFirefox); -export class TextAreaHandler extends ViewPart { +export class TextAreaEditContext extends AbstractEditContext { private readonly _viewController: ViewController; private readonly _visibleRangeProvider: IVisibleRangeProvider; @@ -184,7 +188,7 @@ export class TextAreaHandler extends ViewPart { this.textArea.setAttribute('autocapitalize', 'off'); this.textArea.setAttribute('autocomplete', 'off'); this.textArea.setAttribute('spellcheck', 'false'); - this.textArea.setAttribute('aria-label', this._getAriaLabel(options)); + this.textArea.setAttribute('aria-label', ariaLabelForScreenReaderContent(options, this._keybindingService)); this.textArea.setAttribute('aria-required', options.get(EditorOption.ariaRequired) ? 'true' : 'false'); this.textArea.setAttribute('tabindex', String(options.get(EditorOption.tabIndex))); this.textArea.setAttribute('role', 'textbox'); @@ -217,29 +221,7 @@ export class TextAreaHandler extends ViewPart { const textAreaInputHost: ITextAreaInputHost = { getDataToCopy: (): ClipboardDataToCopy => { - const rawTextToCopy = this._context.viewModel.getPlainTextToCopy(this._modelSelections, this._emptySelectionClipboard, platform.isWindows); - const newLineCharacter = this._context.viewModel.model.getEOL(); - - const isFromEmptySelection = (this._emptySelectionClipboard && this._modelSelections.length === 1 && this._modelSelections[0].isEmpty()); - const multicursorText = (Array.isArray(rawTextToCopy) ? rawTextToCopy : null); - const text = (Array.isArray(rawTextToCopy) ? rawTextToCopy.join(newLineCharacter) : rawTextToCopy); - - let html: string | null | undefined = undefined; - let mode: string | null = null; - if (CopyOptions.forceCopyWithSyntaxHighlighting || (this._copyWithSyntaxHighlighting && text.length < 65536)) { - const richText = this._context.viewModel.getRichTextToCopy(this._modelSelections, this._emptySelectionClipboard); - if (richText) { - html = richText.html; - mode = richText.mode; - } - } - return { - isFromEmptySelection, - multicursorText, - text, - html, - mode - }; + return getDataToCopy(this._context.viewModel, this._modelSelections, this._emptySelectionClipboard, this._copyWithSyntaxHighlighting); }, getScreenReaderContent: (): TextAreaState => { if (this._accessibilitySupport === AccessibilitySupport.Disabled) { @@ -296,7 +278,8 @@ export class TextAreaHandler extends ViewPart { return TextAreaState.EMPTY; } - return PagedScreenReaderStrategy.fromEditorSelection(simpleModel, this._selections[0], this._accessibilityPageSize, this._accessibilitySupport === AccessibilitySupport.Unknown); + const screenReaderContentState = PagedScreenReaderStrategy.fromEditorSelection(simpleModel, this._selections[0], this._accessibilityPageSize, this._accessibilitySupport === AccessibilitySupport.Unknown); + return TextAreaState.fromScreenReaderContentState(screenReaderContentState); }, deduceModelPosition: (viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position => { @@ -479,12 +462,23 @@ export class TextAreaHandler extends ViewPart { })); } + public get domNode() { + return this.textArea; + } + + appendTo(overflowGuardContainer: FastDomNode): void { + overflowGuardContainer.appendChild(this.textArea); + overflowGuardContainer.appendChild(this.textAreaCover); + } + public writeScreenReaderContent(reason: string): void { this._textAreaInput.writeNativeTextAreaContent(reason); } public override dispose(): void { super.dispose(); + this.textArea.domNode.remove(); + this.textAreaCover.domNode.remove(); } private _getAndroidWordAtPosition(position: Position): [string, number] { @@ -557,28 +551,6 @@ export class TextAreaHandler extends ViewPart { return ''; } - private _getAriaLabel(options: IComputedEditorOptions): string { - const accessibilitySupport = options.get(EditorOption.accessibilitySupport); - if (accessibilitySupport === AccessibilitySupport.Disabled) { - - const toggleKeybindingLabel = this._keybindingService.lookupKeybinding('editor.action.toggleScreenReaderAccessibilityMode')?.getAriaLabel(); - const runCommandKeybindingLabel = this._keybindingService.lookupKeybinding('workbench.action.showCommands')?.getAriaLabel(); - const keybindingEditorKeybindingLabel = this._keybindingService.lookupKeybinding('workbench.action.openGlobalKeybindings')?.getAriaLabel(); - const editorNotAccessibleMessage = nls.localize('accessibilityModeOff', "The editor is not accessible at this time."); - if (toggleKeybindingLabel) { - return nls.localize('accessibilityOffAriaLabel', "{0} To enable screen reader optimized mode, use {1}", editorNotAccessibleMessage, toggleKeybindingLabel); - } else if (runCommandKeybindingLabel) { - return nls.localize('accessibilityOffAriaLabelNoKb', "{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.", editorNotAccessibleMessage, runCommandKeybindingLabel); - } else if (keybindingEditorKeybindingLabel) { - return nls.localize('accessibilityOffAriaLabelNoKbs', "{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.", editorNotAccessibleMessage, keybindingEditorKeybindingLabel); - } else { - // SOS - return editorNotAccessibleMessage; - } - } - return options.get(EditorOption.ariaLabel); - } - private _setAccessibilityOptions(options: IComputedEditorOptions): void { this._accessibilitySupport = options.get(EditorOption.accessibilitySupport); const accessibilityPageSize = options.get(EditorOption.accessibilityPageSize); @@ -622,7 +594,7 @@ export class TextAreaHandler extends ViewPart { this.textArea.setAttribute('wrap', this._textAreaWrapping && !this._visibleTextArea ? 'on' : 'off'); const { tabSize } = this._context.viewModel.model.getOptions(); this.textArea.domNode.style.tabSize = `${tabSize * this._fontInfo.spaceWidth}px`; - this.textArea.setAttribute('aria-label', this._getAriaLabel(options)); + this.textArea.setAttribute('aria-label', ariaLabelForScreenReaderContent(options, this._keybindingService)); this.textArea.setAttribute('aria-required', options.get(EditorOption.ariaRequired) ? 'true' : 'false'); this.textArea.setAttribute('tabindex', String(options.get(EditorOption.tabIndex))); @@ -677,7 +649,7 @@ export class TextAreaHandler extends ViewPart { return this._textAreaInput.isFocused(); } - public focusTextArea(): void { + public focus(): void { this._textAreaInput.focusTextArea(); } @@ -742,7 +714,7 @@ export class TextAreaHandler extends ViewPart { const endPosition = this._visibleTextArea.endPosition; if (startPosition && endPosition && visibleStart && visibleEnd && visibleEnd.left >= this._scrollLeft && visibleStart.left <= this._scrollLeft + this._contentWidth) { const top = (this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber) - this._scrollTop); - const lineCount = this._newlinecount(this.textArea.domNode.value.substr(0, this.textArea.domNode.selectionStart)); + const lineCount = newlinecount(this.textArea.domNode.value.substr(0, this.textArea.domNode.selectionStart)); let scrollLeft = this._visibleTextArea.widthOfHiddenLineTextBefore; let left = (this._contentLeft + visibleStart.left - this._scrollLeft); @@ -834,7 +806,7 @@ export class TextAreaHandler extends ViewPart { // In case the textarea contains a word, we're going to try to align the textarea's cursor // with our cursor by scrolling the textarea as much as possible this.textArea.domNode.scrollLeft = this._primaryCursorVisibleRange.left; - const lineCount = this._textAreaInput.textAreaState.newlineCountBeforeSelection ?? this._newlinecount(this.textArea.domNode.value.substr(0, this.textArea.domNode.selectionStart)); + const lineCount = this._textAreaInput.textAreaState.newlineCountBeforeSelection ?? newlinecount(this.textArea.domNode.value.substring(0, this.textArea.domNode.selectionStart)); this.textArea.domNode.scrollTop = lineCount * this._lineHeight; return; } @@ -849,19 +821,6 @@ export class TextAreaHandler extends ViewPart { }); } - private _newlinecount(text: string): number { - let result = 0; - let startIndex = -1; - do { - startIndex = text.indexOf('\n', startIndex + 1); - if (startIndex === -1) { - break; - } - result++; - } while (true); - return result; - } - private _renderAtTopLeft(): void { // (in WebKit the textarea is 1px by 1px because it cannot handle input to a 0x0 textarea) // specifically, when doing Korean IME, setting the textarea to 0x0 breaks IME badly. diff --git a/src/vs/editor/browser/controller/textAreaInput.ts b/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.ts similarity index 92% rename from src/vs/editor/browser/controller/textAreaInput.ts rename to src/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.ts index 88e783a1f7d..87e99556b33 100644 --- a/src/vs/editor/browser/controller/textAreaInput.ts +++ b/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.ts @@ -3,23 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as browser from 'vs/base/browser/browser'; -import * as dom from 'vs/base/browser/dom'; -import { DomEmitter } from 'vs/base/browser/event'; -import { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { inputLatency } from 'vs/base/browser/performance'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { Emitter, Event } from 'vs/base/common/event'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { Disposable, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { Mimes } from 'vs/base/common/mime'; -import { OperatingSystem } from 'vs/base/common/platform'; -import * as strings from 'vs/base/common/strings'; -import { ITextAreaWrapper, ITypeData, TextAreaState, _debugComposition } from 'vs/editor/browser/controller/textAreaState'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { ILogService } from 'vs/platform/log/common/log'; +import * as browser from '../../../../../base/browser/browser.js'; +import * as dom from '../../../../../base/browser/dom.js'; +import { DomEmitter } from '../../../../../base/browser/event.js'; +import { IKeyboardEvent, StandardKeyboardEvent } from '../../../../../base/browser/keyboardEvent.js'; +import { inputLatency } from '../../../../../base/browser/performance.js'; +import { RunOnceScheduler } from '../../../../../base/common/async.js'; +import { Emitter, Event } from '../../../../../base/common/event.js'; +import { KeyCode } from '../../../../../base/common/keyCodes.js'; +import { Disposable, IDisposable, MutableDisposable } from '../../../../../base/common/lifecycle.js'; +import { Mimes } from '../../../../../base/common/mime.js'; +import { OperatingSystem } from '../../../../../base/common/platform.js'; +import * as strings from '../../../../../base/common/strings.js'; +import { Position } from '../../../../common/core/position.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js'; +import { ILogService } from '../../../../../platform/log/common/log.js'; +import { ClipboardDataToCopy, ClipboardStoredMetadata, InMemoryClipboardMetadataManager } from '../clipboardUtils.js'; +import { _debugComposition, ITextAreaWrapper, ITypeData, TextAreaState } from './textAreaEditContextState.js'; export namespace TextAreaSyntethicEvents { export const Tap = '-monaco-textarea-synthetic-tap'; @@ -29,69 +30,18 @@ export interface ICompositionData { data: string; } -export const CopyOptions = { - forceCopyWithSyntaxHighlighting: false -}; export interface IPasteData { text: string; metadata: ClipboardStoredMetadata | null; } -export interface ClipboardDataToCopy { - isFromEmptySelection: boolean; - multicursorText: string[] | null | undefined; - text: string; - html: string | null | undefined; - mode: string | null; -} - -export interface ClipboardStoredMetadata { - version: 1; - isFromEmptySelection: boolean | undefined; - multicursorText: string[] | null | undefined; - mode: string | null; -} - export interface ITextAreaInputHost { getDataToCopy(): ClipboardDataToCopy; getScreenReaderContent(): TextAreaState; deduceModelPosition(viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position; } -interface InMemoryClipboardMetadata { - lastCopiedValue: string; - data: ClipboardStoredMetadata; -} - -/** - * Every time we write to the clipboard, we record a bit of extra metadata here. - * Every time we read from the cipboard, if the text matches our last written text, - * we can fetch the previous metadata. - */ -export class InMemoryClipboardMetadataManager { - public static readonly INSTANCE = new InMemoryClipboardMetadataManager(); - - private _lastState: InMemoryClipboardMetadata | null; - - constructor() { - this._lastState = null; - } - - public set(lastCopiedValue: string, data: ClipboardStoredMetadata): void { - this._lastState = { lastCopiedValue, data }; - } - - public get(pastedText: string): ClipboardStoredMetadata | null { - if (this._lastState && this._lastState.lastCopiedValue === pastedText) { - // match! - return this._lastState.data; - } - this._lastState = null; - return null; - } -} - export interface ICompositionStartEvent { data: string; } diff --git a/src/vs/editor/browser/controller/textAreaState.ts b/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.ts similarity index 66% rename from src/vs/editor/browser/controller/textAreaState.ts rename to src/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.ts index adbf0ef7b3e..2e833a1b263 100644 --- a/src/vs/editor/browser/controller/textAreaState.ts +++ b/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { EndOfLinePreference } from 'vs/editor/common/model'; +import { commonPrefixLength, commonSuffixLength } from '../../../../../base/common/strings.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { ScreenReaderContentState } from '../screenReaderUtils.js'; export const _debugComposition = false; @@ -19,14 +19,6 @@ export interface ITextAreaWrapper { setSelectionRange(reason: string, selectionStart: number, selectionEnd: number): void; } -export interface ISimpleModel { - getLineCount(): number; - getLineMaxColumn(lineNumber: number): number; - getValueInRange(range: Range, eol: EndOfLinePreference): string; - getValueLengthInRange(range: Range, eol: EndOfLinePreference): number; - modifyPosition(position: Position, offset: number): Position; -} - export interface ITypeData { text: string; replacePrevCharCnt: number; @@ -130,12 +122,12 @@ export class TextAreaState { } const prefixLength = Math.min( - strings.commonPrefixLength(previousState.value, currentState.value), + commonPrefixLength(previousState.value, currentState.value), previousState.selectionStart, currentState.selectionStart ); const suffixLength = Math.min( - strings.commonSuffixLength(previousState.value, currentState.value), + commonSuffixLength(previousState.value, currentState.value), previousState.value.length - previousState.selectionEnd, currentState.value.length - currentState.selectionEnd ); @@ -202,8 +194,8 @@ export class TextAreaState { }; } - const prefixLength = Math.min(strings.commonPrefixLength(previousState.value, currentState.value), previousState.selectionEnd); - const suffixLength = Math.min(strings.commonSuffixLength(previousState.value, currentState.value), previousState.value.length - previousState.selectionEnd); + const prefixLength = Math.min(commonPrefixLength(previousState.value, currentState.value), previousState.selectionEnd); + const suffixLength = Math.min(commonSuffixLength(previousState.value, currentState.value), previousState.value.length - previousState.selectionEnd); const previousValue = previousState.value.substring(prefixLength, previousState.value.length - suffixLength); const currentValue = currentState.value.substring(prefixLength, currentState.value.length - suffixLength); const previousSelectionStart = previousState.selectionStart - prefixLength; @@ -223,65 +215,14 @@ export class TextAreaState { positionDelta: currentSelectionEnd - currentValue.length }; } -} - -export class PagedScreenReaderStrategy { - private static _getPageOfLine(lineNumber: number, linesPerPage: number): number { - return Math.floor((lineNumber - 1) / linesPerPage); - } - - private static _getRangeForPage(page: number, linesPerPage: number): Range { - const offset = page * linesPerPage; - const startLineNumber = offset + 1; - const endLineNumber = offset + linesPerPage; - return new Range(startLineNumber, 1, endLineNumber + 1, 1); - } - - public static fromEditorSelection(model: ISimpleModel, selection: Range, linesPerPage: number, trimLongText: boolean): TextAreaState { - // Chromium handles very poorly text even of a few thousand chars - // Cut text to avoid stalling the entire UI - const LIMIT_CHARS = 500; - - const selectionStartPage = PagedScreenReaderStrategy._getPageOfLine(selection.startLineNumber, linesPerPage); - const selectionStartPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionStartPage, linesPerPage); - - const selectionEndPage = PagedScreenReaderStrategy._getPageOfLine(selection.endLineNumber, linesPerPage); - const selectionEndPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionEndPage, linesPerPage); - let pretextRange = selectionStartPageRange.intersectRanges(new Range(1, 1, selection.startLineNumber, selection.startColumn))!; - if (trimLongText && model.getValueLengthInRange(pretextRange, EndOfLinePreference.LF) > LIMIT_CHARS) { - const pretextStart = model.modifyPosition(pretextRange.getEndPosition(), -LIMIT_CHARS); - pretextRange = Range.fromPositions(pretextStart, pretextRange.getEndPosition()); - } - const pretext = model.getValueInRange(pretextRange, EndOfLinePreference.LF); - - const lastLine = model.getLineCount(); - const lastLineMaxColumn = model.getLineMaxColumn(lastLine); - let posttextRange = selectionEndPageRange.intersectRanges(new Range(selection.endLineNumber, selection.endColumn, lastLine, lastLineMaxColumn))!; - if (trimLongText && model.getValueLengthInRange(posttextRange, EndOfLinePreference.LF) > LIMIT_CHARS) { - const posttextEnd = model.modifyPosition(posttextRange.getStartPosition(), LIMIT_CHARS); - posttextRange = Range.fromPositions(posttextRange.getStartPosition(), posttextEnd); - } - const posttext = model.getValueInRange(posttextRange, EndOfLinePreference.LF); - - - let text: string; - if (selectionStartPage === selectionEndPage || selectionStartPage + 1 === selectionEndPage) { - // take full selection - text = model.getValueInRange(selection, EndOfLinePreference.LF); - } else { - const selectionRange1 = selectionStartPageRange.intersectRanges(selection)!; - const selectionRange2 = selectionEndPageRange.intersectRanges(selection)!; - text = ( - model.getValueInRange(selectionRange1, EndOfLinePreference.LF) - + String.fromCharCode(8230) - + model.getValueInRange(selectionRange2, EndOfLinePreference.LF) - ); - } - if (trimLongText && text.length > 2 * LIMIT_CHARS) { - text = text.substring(0, LIMIT_CHARS) + String.fromCharCode(8230) + text.substring(text.length - LIMIT_CHARS, text.length); - } - - return new TextAreaState(pretext + text + posttext, pretext.length, pretext.length + text.length, selection, pretextRange.endLineNumber - pretextRange.startLineNumber); + public static fromScreenReaderContentState(screenReaderContentState: ScreenReaderContentState) { + return new TextAreaState( + screenReaderContentState.value, + screenReaderContentState.selectionStart, + screenReaderContentState.selectionEnd, + screenReaderContentState.selection, + screenReaderContentState.newlineCountBeforeSelection + ); } } diff --git a/src/vs/editor/browser/controller/mouseHandler.ts b/src/vs/editor/browser/controller/mouseHandler.ts index 55d58d6eef9..cd9b92c4ed0 100644 --- a/src/vs/editor/browser/controller/mouseHandler.ts +++ b/src/vs/editor/browser/controller/mouseHandler.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { StandardWheelEvent, IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import * as platform from 'vs/base/common/platform'; -import { HitTestContext, MouseTarget, MouseTargetFactory, PointerHandlerLastRenderData } from 'vs/editor/browser/controller/mouseTarget'; -import { IMouseTarget, IMouseTargetOutsideEditor, IMouseTargetViewZoneData, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { ClientCoordinates, EditorMouseEvent, EditorMouseEventFactory, GlobalEditorPointerMoveMonitor, createEditorPagePosition, createCoordinatesRelativeToEditor, PageCoordinates } from 'vs/editor/browser/editorDom'; -import { ViewController } from 'vs/editor/browser/view/viewController'; -import { EditorZoom } from 'vs/editor/common/config/editorZoom'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { HorizontalPosition } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewEventHandler } from 'vs/editor/common/viewEventHandler'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { NavigationCommandRevealType } from 'vs/editor/browser/coreCommands'; -import { MouseWheelClassifier } from 'vs/base/browser/ui/scrollbar/scrollableElement'; +import * as dom from '../../../base/browser/dom.js'; +import { StandardWheelEvent, IMouseWheelEvent } from '../../../base/browser/mouseEvent.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import * as platform from '../../../base/common/platform.js'; +import { HitTestContext, MouseTarget, MouseTargetFactory, PointerHandlerLastRenderData } from './mouseTarget.js'; +import { IMouseTarget, IMouseTargetOutsideEditor, IMouseTargetViewZoneData, MouseTargetType } from '../editorBrowser.js'; +import { ClientCoordinates, EditorMouseEvent, EditorMouseEventFactory, GlobalEditorPointerMoveMonitor, createEditorPagePosition, createCoordinatesRelativeToEditor, PageCoordinates } from '../editorDom.js'; +import { ViewController } from '../view/viewController.js'; +import { EditorZoom } from '../../common/config/editorZoom.js'; +import { Position } from '../../common/core/position.js'; +import { Selection } from '../../common/core/selection.js'; +import { HorizontalPosition } from '../view/renderingContext.js'; +import { ViewContext } from '../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../common/viewEvents.js'; +import { ViewEventHandler } from '../../common/viewEventHandler.js'; +import { EditorOption } from '../../common/config/editorOptions.js'; +import { NavigationCommandRevealType } from '../coreCommands.js'; +import { MouseWheelClassifier } from '../../../base/browser/ui/scrollbar/scrollableElement.js'; export interface IPointerHandlerHelper { viewDomNode: HTMLElement; diff --git a/src/vs/editor/browser/controller/mouseTarget.ts b/src/vs/editor/browser/controller/mouseTarget.ts index 4a1addb3fc0..737daf6d294 100644 --- a/src/vs/editor/browser/controller/mouseTarget.ts +++ b/src/vs/editor/browser/controller/mouseTarget.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IPointerHandlerHelper } from 'vs/editor/browser/controller/mouseHandler'; -import { IMouseTargetContentEmptyData, IMouseTargetMarginData, IMouseTarget, IMouseTargetContentEmpty, IMouseTargetContentText, IMouseTargetContentWidget, IMouseTargetMargin, IMouseTargetOutsideEditor, IMouseTargetOverlayWidget, IMouseTargetScrollbar, IMouseTargetTextarea, IMouseTargetUnknown, IMouseTargetViewZone, IMouseTargetContentTextData, IMouseTargetViewZoneData, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { ClientCoordinates, EditorMouseEvent, EditorPagePosition, PageCoordinates, CoordinatesRelativeToEditor } from 'vs/editor/browser/editorDom'; -import { PartFingerprint, PartFingerprints } from 'vs/editor/browser/view/viewPart'; -import { ViewLine } from 'vs/editor/browser/viewParts/lines/viewLine'; -import { IViewCursorRenderData } from 'vs/editor/browser/viewParts/viewCursors/viewCursor'; -import { EditorLayoutInfo, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range as EditorRange } from 'vs/editor/common/core/range'; -import { HorizontalPosition } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import { IViewModel } from 'vs/editor/common/viewModel'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; -import * as dom from 'vs/base/browser/dom'; -import { AtomicTabMoveOperations, Direction } from 'vs/editor/common/cursor/cursorAtomicMoveOperations'; -import { PositionAffinity } from 'vs/editor/common/model'; -import { InjectedText } from 'vs/editor/common/modelLineProjectionData'; -import { Mutable } from 'vs/base/common/types'; -import { Lazy } from 'vs/base/common/lazy'; +import { IPointerHandlerHelper } from './mouseHandler.js'; +import { IMouseTargetContentEmptyData, IMouseTargetMarginData, IMouseTarget, IMouseTargetContentEmpty, IMouseTargetContentText, IMouseTargetContentWidget, IMouseTargetMargin, IMouseTargetOutsideEditor, IMouseTargetOverlayWidget, IMouseTargetScrollbar, IMouseTargetTextarea, IMouseTargetUnknown, IMouseTargetViewZone, IMouseTargetContentTextData, IMouseTargetViewZoneData, MouseTargetType } from '../editorBrowser.js'; +import { ClientCoordinates, EditorMouseEvent, EditorPagePosition, PageCoordinates, CoordinatesRelativeToEditor } from '../editorDom.js'; +import { PartFingerprint, PartFingerprints } from '../view/viewPart.js'; +import { ViewLine } from '../viewParts/viewLines/viewLine.js'; +import { IViewCursorRenderData } from '../viewParts/viewCursors/viewCursor.js'; +import { EditorLayoutInfo, EditorOption } from '../../common/config/editorOptions.js'; +import { Position } from '../../common/core/position.js'; +import { Range as EditorRange } from '../../common/core/range.js'; +import { HorizontalPosition } from '../view/renderingContext.js'; +import { ViewContext } from '../../common/viewModel/viewContext.js'; +import { IViewModel } from '../../common/viewModel.js'; +import { CursorColumns } from '../../common/core/cursorColumns.js'; +import * as dom from '../../../base/browser/dom.js'; +import { AtomicTabMoveOperations, Direction } from '../../common/cursor/cursorAtomicMoveOperations.js'; +import { PositionAffinity } from '../../common/model.js'; +import { InjectedText } from '../../common/modelLineProjectionData.js'; +import { Mutable } from '../../../base/common/types.js'; +import { Lazy } from '../../../base/common/lazy.js'; const enum HitTestResultType { Unknown, diff --git a/src/vs/editor/browser/controller/pointerHandler.ts b/src/vs/editor/browser/controller/pointerHandler.ts index 2019016ac4c..80fc4825a83 100644 --- a/src/vs/editor/browser/controller/pointerHandler.ts +++ b/src/vs/editor/browser/controller/pointerHandler.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BrowserFeatures } from 'vs/base/browser/canIUse'; -import * as dom from 'vs/base/browser/dom'; -import { EventType, Gesture, GestureEvent } from 'vs/base/browser/touch'; -import { mainWindow } from 'vs/base/browser/window'; -import { Disposable } from 'vs/base/common/lifecycle'; -import * as platform from 'vs/base/common/platform'; -import { IPointerHandlerHelper, MouseHandler } from 'vs/editor/browser/controller/mouseHandler'; -import { TextAreaSyntethicEvents } from 'vs/editor/browser/controller/textAreaInput'; -import { NavigationCommandRevealType } from 'vs/editor/browser/coreCommands'; -import { IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorMouseEvent, EditorPointerEventFactory } from 'vs/editor/browser/editorDom'; -import { ViewController } from 'vs/editor/browser/view/viewController'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; +import { BrowserFeatures } from '../../../base/browser/canIUse.js'; +import * as dom from '../../../base/browser/dom.js'; +import { EventType, Gesture, GestureEvent } from '../../../base/browser/touch.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import * as platform from '../../../base/common/platform.js'; +import { IPointerHandlerHelper, MouseHandler } from './mouseHandler.js'; +import { NavigationCommandRevealType } from '../coreCommands.js'; +import { IMouseTarget, MouseTargetType } from '../editorBrowser.js'; +import { EditorMouseEvent, EditorPointerEventFactory } from '../editorDom.js'; +import { ViewController } from '../view/viewController.js'; +import { ViewContext } from '../../common/viewModel/viewContext.js'; +import { TextAreaSyntethicEvents } from './editContext/textArea/textAreaEditContextInput.js'; /** * Currently only tested on iOS 13/ iPadOS. diff --git a/src/vs/editor/browser/coreCommands.ts b/src/vs/editor/browser/coreCommands.ts index e7f0743af83..8f1459c1fea 100644 --- a/src/vs/editor/browser/coreCommands.ts +++ b/src/vs/editor/browser/coreCommands.ts @@ -3,34 +3,34 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { isFirefox } from 'vs/base/browser/browser'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import * as types from 'vs/base/common/types'; -import { status } from 'vs/base/browser/ui/aria/aria'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Command, EditorCommand, ICommandOptions, registerEditorCommand, MultiCommand, UndoCommand, RedoCommand, SelectAllCommand } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { ColumnSelection, IColumnSelectResult } from 'vs/editor/common/cursor/cursorColumnSelection'; -import { CursorState, EditOperationType, IColumnSelectData, PartialCursorState } from 'vs/editor/common/cursorCommon'; -import { DeleteOperations } from 'vs/editor/common/cursor/cursorDeleteOperations'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { CursorMove as CursorMove_, CursorMoveCommands } from 'vs/editor/common/cursor/cursorMoveCommands'; -import { TypeOperations } from 'vs/editor/common/cursor/cursorTypeOperations'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Handler, ScrollType } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { VerticalRevealType } from 'vs/editor/common/viewEvents'; -import { ICommandMetadata } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IViewModel } from 'vs/editor/common/viewModel'; -import { ISelection } from 'vs/editor/common/core/selection'; -import { getActiveElement } from 'vs/base/browser/dom'; -import { EnterOperation } from 'vs/editor/common/cursor/cursorTypeEditOperations'; +import * as nls from '../../nls.js'; +import { isFirefox } from '../../base/browser/browser.js'; +import { KeyCode, KeyMod } from '../../base/common/keyCodes.js'; +import * as types from '../../base/common/types.js'; +import { status } from '../../base/browser/ui/aria/aria.js'; +import { ICodeEditor } from './editorBrowser.js'; +import { Command, EditorCommand, ICommandOptions, registerEditorCommand, MultiCommand, UndoCommand, RedoCommand, SelectAllCommand } from './editorExtensions.js'; +import { ICodeEditorService } from './services/codeEditorService.js'; +import { ColumnSelection, IColumnSelectResult } from '../common/cursor/cursorColumnSelection.js'; +import { CursorState, EditOperationType, IColumnSelectData, PartialCursorState } from '../common/cursorCommon.js'; +import { DeleteOperations } from '../common/cursor/cursorDeleteOperations.js'; +import { CursorChangeReason } from '../common/cursorEvents.js'; +import { CursorMove as CursorMove_, CursorMoveCommands } from '../common/cursor/cursorMoveCommands.js'; +import { TypeOperations } from '../common/cursor/cursorTypeOperations.js'; +import { IPosition, Position } from '../common/core/position.js'; +import { Range } from '../common/core/range.js'; +import { Handler, ScrollType } from '../common/editorCommon.js'; +import { EditorContextKeys } from '../common/editorContextKeys.js'; +import { VerticalRevealType } from '../common/viewEvents.js'; +import { ICommandMetadata } from '../../platform/commands/common/commands.js'; +import { ContextKeyExpr } from '../../platform/contextkey/common/contextkey.js'; +import { ServicesAccessor } from '../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight, KeybindingsRegistry } from '../../platform/keybinding/common/keybindingsRegistry.js'; +import { EditorOption } from '../common/config/editorOptions.js'; +import { IViewModel } from '../common/viewModel.js'; +import { ISelection } from '../common/core/selection.js'; +import { getActiveElement, isEditableElement } from '../../base/browser/dom.js'; +import { EnterOperation } from '../common/cursor/cursorTypeEditOperations.js'; const CORE_WEIGHT = KeybindingWeight.EditorCore; @@ -318,7 +318,7 @@ abstract class EditorOrNativeTextInputCommand { target.addImplementation(1000, 'generic-dom-input-textarea', (accessor: ServicesAccessor, args: unknown) => { // Only if focused on an element that allows for entering text const activeElement = getActiveElement(); - if (activeElement && ['input', 'textarea'].indexOf(activeElement.tagName.toLowerCase()) >= 0) { + if (activeElement && isEditableElement(activeElement)) { this.runDOMCommand(activeElement); return true; } diff --git a/src/vs/editor/browser/dnd.ts b/src/vs/editor/browser/dnd.ts index 3003a4f65d5..9f74733b7f3 100644 --- a/src/vs/editor/browser/dnd.ts +++ b/src/vs/editor/browser/dnd.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DataTransfers } from 'vs/base/browser/dnd'; -import { createFileDataTransferItem, createStringDataTransferItem, IDataTransferItem, UriList, VSDataTransfer } from 'vs/base/common/dataTransfer'; -import { Mimes } from 'vs/base/common/mime'; -import { URI } from 'vs/base/common/uri'; -import { CodeDataTransfers, FileAdditionalNativeProperties } from 'vs/platform/dnd/browser/dnd'; +import { DataTransfers } from '../../base/browser/dnd.js'; +import { createFileDataTransferItem, createStringDataTransferItem, IDataTransferItem, UriList, VSDataTransfer } from '../../base/common/dataTransfer.js'; +import { Mimes } from '../../base/common/mime.js'; +import { URI } from '../../base/common/uri.js'; +import { CodeDataTransfers, FileAdditionalNativeProperties } from '../../platform/dnd/browser/dnd.js'; export function toVSDataTransfer(dataTransfer: DataTransfer) { diff --git a/src/vs/editor/browser/editorBrowser.ts b/src/vs/editor/browser/editorBrowser.ts index 2985f959335..7401ec5de61 100644 --- a/src/vs/editor/browser/editorBrowser.ts +++ b/src/vs/editor/browser/editorBrowser.ts @@ -3,28 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { IMouseEvent, IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; -import { Event } from 'vs/base/common/event'; -import { IEditorConstructionOptions } from 'vs/editor/browser/config/editorConfiguration'; -import { ConfigurationChangedEvent, EditorLayoutInfo, EditorOption, FindComputedEditorOptionValueById, IComputedEditorOptions, IDiffEditorOptions, IEditorOptions, OverviewRulerPosition } from 'vs/editor/common/config/editorOptions'; -import { IDimension } from 'vs/editor/common/core/dimension'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IWordAtPosition } from 'vs/editor/common/core/wordHelper'; -import { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { IDiffComputationResult, ILineChange } from 'vs/editor/common/diff/legacyLinesDiffComputer'; -import * as editorCommon from 'vs/editor/common/editorCommon'; -import { GlyphMarginLane, ICursorStateComputer, IIdentifiedSingleEditOperation, IModelDecoration, IModelDeltaDecoration, ITextModel, PositionAffinity } from 'vs/editor/common/model'; -import { InjectedText } from 'vs/editor/common/modelLineProjectionData'; -import { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents'; -import { IEditorWhitespace, IViewModel } from 'vs/editor/common/viewModel'; -import { OverviewRulerZone } from 'vs/editor/common/viewModel/overviewZoneManager'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { IKeyboardEvent } from '../../base/browser/keyboardEvent.js'; +import { IMouseEvent, IMouseWheelEvent } from '../../base/browser/mouseEvent.js'; +import { IBoundarySashes } from '../../base/browser/ui/sash/sash.js'; +import { Event } from '../../base/common/event.js'; +import { IEditorConstructionOptions } from './config/editorConfiguration.js'; +import { ConfigurationChangedEvent, EditorLayoutInfo, EditorOption, FindComputedEditorOptionValueById, IComputedEditorOptions, IDiffEditorOptions, IEditorOptions, OverviewRulerPosition } from '../common/config/editorOptions.js'; +import { IDimension } from '../common/core/dimension.js'; +import { IPosition, Position } from '../common/core/position.js'; +import { IRange, Range } from '../common/core/range.js'; +import { Selection } from '../common/core/selection.js'; +import { IWordAtPosition } from '../common/core/wordHelper.js'; +import { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from '../common/cursorEvents.js'; +import { IDiffComputationResult, ILineChange } from '../common/diff/legacyLinesDiffComputer.js'; +import * as editorCommon from '../common/editorCommon.js'; +import { GlyphMarginLane, ICursorStateComputer, IIdentifiedSingleEditOperation, IModelDecoration, IModelDeltaDecoration, ITextModel, PositionAffinity } from '../common/model.js'; +import { InjectedText } from '../common/modelLineProjectionData.js'; +import { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent } from '../common/textModelEvents.js'; +import { IEditorWhitespace, IViewModel } from '../common/viewModel.js'; +import { OverviewRulerZone } from '../common/viewModel/overviewZoneManager.js'; +import { MenuId } from '../../platform/actions/common/actions.js'; +import { IContextKeyService } from '../../platform/contextkey/common/contextkey.js'; +import { ServicesAccessor } from '../../platform/instantiation/common/instantiation.js'; /** * A view zone is a full horizontal rectangle that 'pushes' text down. @@ -784,6 +784,12 @@ export interface ICodeEditor extends editorCommon.IEditor { */ readonly onDidChangeHiddenAreas: Event; + /** + * An event emitted before an editor + * @internal + */ + readonly onWillTriggerEditorOperationEvent: Event; + /** * Some editor operations fire multiple events at once. * To allow users to react to multiple events fired by a single operation, diff --git a/src/vs/editor/browser/editorDom.ts b/src/vs/editor/browser/editorDom.ts index a894d0034ec..75bd4acfae7 100644 --- a/src/vs/editor/browser/editorDom.ts +++ b/src/vs/editor/browser/editorDom.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { GlobalPointerMoveMonitor } from 'vs/base/browser/globalPointerMoveMonitor'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { asCssVariable } from 'vs/platform/theme/common/colorRegistry'; -import { ThemeColor } from 'vs/base/common/themables'; +import * as dom from '../../base/browser/dom.js'; +import { GlobalPointerMoveMonitor } from '../../base/browser/globalPointerMoveMonitor.js'; +import { StandardMouseEvent } from '../../base/browser/mouseEvent.js'; +import { RunOnceScheduler } from '../../base/common/async.js'; +import { Disposable, DisposableStore, IDisposable } from '../../base/common/lifecycle.js'; +import { ICodeEditor } from './editorBrowser.js'; +import { asCssVariable } from '../../platform/theme/common/colorRegistry.js'; +import { ThemeColor } from '../../base/common/themables.js'; /** * Coordinates relative to the whole document (e.g. mouse event's pageX and pageY) diff --git a/src/vs/editor/browser/editorExtensions.ts b/src/vs/editor/browser/editorExtensions.ts index 072be21a41c..b9c67238fd5 100644 --- a/src/vs/editor/browser/editorExtensions.ts +++ b/src/vs/editor/browser/editorExtensions.ts @@ -3,28 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { Position } from 'vs/editor/common/core/position'; -import { IEditorContribution, IDiffEditorContribution } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { MenuId, MenuRegistry, Action2 } from 'vs/platform/actions/common/actions'; -import { CommandsRegistry, ICommandMetadata } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpr, IContextKeyService, ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey'; -import { ServicesAccessor as InstantiationServicesAccessor, BrandedService, IInstantiationService, IConstructorSignature } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindings, KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { assertType } from 'vs/base/common/types'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { ILogService } from 'vs/platform/log/common/log'; -import { getActiveElement } from 'vs/base/browser/dom'; +import * as nls from '../../nls.js'; +import { URI } from '../../base/common/uri.js'; +import { ICodeEditor, IDiffEditor } from './editorBrowser.js'; +import { ICodeEditorService } from './services/codeEditorService.js'; +import { Position } from '../common/core/position.js'; +import { IEditorContribution, IDiffEditorContribution } from '../common/editorCommon.js'; +import { ITextModel } from '../common/model.js'; +import { IModelService } from '../common/services/model.js'; +import { ITextModelService } from '../common/services/resolverService.js'; +import { MenuId, MenuRegistry, Action2 } from '../../platform/actions/common/actions.js'; +import { CommandsRegistry, ICommandMetadata } from '../../platform/commands/common/commands.js'; +import { ContextKeyExpr, IContextKeyService, ContextKeyExpression } from '../../platform/contextkey/common/contextkey.js'; +import { ServicesAccessor as InstantiationServicesAccessor, BrandedService, IInstantiationService, IConstructorSignature } from '../../platform/instantiation/common/instantiation.js'; +import { IKeybindings, KeybindingsRegistry, KeybindingWeight } from '../../platform/keybinding/common/keybindingsRegistry.js'; +import { Registry } from '../../platform/registry/common/platform.js'; +import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js'; +import { assertType } from '../../base/common/types.js'; +import { ThemeIcon } from '../../base/common/themables.js'; +import { IDisposable } from '../../base/common/lifecycle.js'; +import { KeyMod, KeyCode } from '../../base/common/keyCodes.js'; +import { ILogService } from '../../platform/log/common/log.js'; +import { getActiveElement } from '../../base/browser/dom.js'; export type ServicesAccessor = InstantiationServicesAccessor; export type EditorContributionCtor = IConstructorSignature; diff --git a/src/vs/editor/browser/gpu/atlas/atlas.ts b/src/vs/editor/browser/gpu/atlas/atlas.ts new file mode 100644 index 00000000000..e9719042705 --- /dev/null +++ b/src/vs/editor/browser/gpu/atlas/atlas.ts @@ -0,0 +1,95 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type { ThreeKeyMap } from '../../../../base/common/map.js'; +import type { IBoundingBox, IRasterizedGlyph } from '../raster/raster.js'; + +/** + * Information about a {@link IRasterizedGlyph rasterized glyph} that has been drawn to a texture + * atlas page. + */ +export interface ITextureAtlasPageGlyph { + /** + * The page index of the texture atlas page that the glyph was drawn to. + */ + pageIndex: number; + /** + * The index of the glyph in the texture atlas page. + */ + glyphIndex: number; + /** The x coordinate of the glyph on the texture atlas page. */ + x: number; + /** The y coordinate of the glyph on the texture atlas page. */ + y: number; + /** The width of the glyph in pixels. */ + w: number; + /** The height of the glyph in pixels. */ + h: number; + /** The x offset from {@link x} of the glyph's origin. */ + originOffsetX: number; + /** The y offset from {@link y} of the glyph's origin. */ + originOffsetY: number; +} + +/** + * A texture atlas allocator is responsible for taking rasterized glyphs, drawing them to a texture + * atlas page canvas and return information on the texture atlas glyph. + */ +export interface ITextureAtlasAllocator { + /** + * Allocates a rasterized glyph to the canvas, drawing it and returning information on its + * position in the canvas. This will return undefined if the glyph does not fit on the canvas. + */ + allocate(rasterizedGlyph: Readonly): Readonly | undefined; + /** + * Gets a usage preview of the atlas for debugging purposes. + */ + getUsagePreview(): Promise; + /** + * Gets statistics about the allocator's current state for debugging purposes. + */ + getStats(): string; +} + +/** + * A texture atlas page that can be read from but not modified. + */ +export interface IReadableTextureAtlasPage { + /** + * A unique identifier for the current state of the texture atlas page. This is a number that + * increments whenever a glyph is drawn to the page. + */ + readonly version: number; + /** + * A bounding box representing the area of the texture atlas page that is currently in use. + */ + readonly usedArea: Readonly; + /** + * An iterator over all glyphs that have been drawn to the page. This will iterate through + * glyphs in the order they have been drawn. + */ + readonly glyphs: IterableIterator>; + /** + * The source canvas for the texture atlas page. + */ + readonly source: OffscreenCanvas; + /** + * Gets a usage preview of the atlas for debugging purposes. + */ + getUsagePreview(): Promise; + /** + * Gets statistics about the allocator's current state for debugging purposes. + */ + getStats(): string; +} + +export const enum UsagePreviewColors { + Unused = '#808080', + Used = '#4040FF', + Wasted = '#FF0000', + Restricted = '#FF000088', +} + +export type GlyphMap = ThreeKeyMap; diff --git a/src/vs/editor/browser/gpu/atlas/textureAtlas.ts b/src/vs/editor/browser/gpu/atlas/textureAtlas.ts new file mode 100644 index 00000000000..e8b8ad73c7a --- /dev/null +++ b/src/vs/editor/browser/gpu/atlas/textureAtlas.ts @@ -0,0 +1,179 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { getActiveWindow } from '../../../../base/browser/dom.js'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { Disposable, dispose, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { ThreeKeyMap } from '../../../../base/common/map.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { MetadataConsts } from '../../../common/encodedTokenAttributes.js'; +import { GlyphRasterizer } from '../raster/glyphRasterizer.js'; +import type { IGlyphRasterizer } from '../raster/raster.js'; +import { IdleTaskQueue } from '../taskQueue.js'; +import type { IReadableTextureAtlasPage, ITextureAtlasPageGlyph, GlyphMap } from './atlas.js'; +import { AllocatorType, TextureAtlasPage } from './textureAtlasPage.js'; + +export interface ITextureAtlasOptions { + allocatorType?: AllocatorType; +} + +export class TextureAtlas extends Disposable { + private _colorMap!: string[]; + private readonly _warmUpTask: MutableDisposable = this._register(new MutableDisposable()); + private readonly _warmedUpRasterizers = new Set(); + private readonly _allocatorType: AllocatorType; + + /** + * The main texture atlas pages which are both larger textures and more efficiently packed + * relative to the scratch page. The idea is the main pages are drawn to and uploaded to the GPU + * much less frequently so as to not drop frames. + */ + private readonly _pages: TextureAtlasPage[] = []; + get pages(): IReadableTextureAtlasPage[] { return this._pages; } + + readonly pageSize: number; + + /** + * A maps of glyph keys to the page to start searching for the glyph. This is set before + * searching to have as little runtime overhead (branching, intermediate variables) as possible, + * so it is not guaranteed to be the actual page the glyph is on. But it is guaranteed that all + * pages with a lower index do not contain the glyph. + */ + private readonly _glyphPageIndex: GlyphMap = new ThreeKeyMap(); + + private readonly _onDidDeleteGlyphs = this._register(new Emitter()); + readonly onDidDeleteGlyphs = this._onDidDeleteGlyphs.event; + + constructor( + /** The maximum texture size supported by the GPU. */ + private readonly _maxTextureSize: number, + options: ITextureAtlasOptions | undefined, + @IThemeService private readonly _themeService: IThemeService, + @IInstantiationService private readonly _instantiationService: IInstantiationService + ) { + super(); + + this._allocatorType = options?.allocatorType ?? 'slab'; + + this._register(Event.runAndSubscribe(this._themeService.onDidColorThemeChange, () => { + // TODO: Clear entire atlas on theme change + this._colorMap = this._themeService.getColorTheme().tokenColorMap; + })); + + const dprFactor = Math.max(1, Math.floor(getActiveWindow().devicePixelRatio)); + + this.pageSize = Math.min(1024 * dprFactor, this._maxTextureSize); + this._initFirstPage(); + + this._register(toDisposable(() => dispose(this._pages))); + } + + private _initFirstPage() { + const firstPage = this._instantiationService.createInstance(TextureAtlasPage, 0, this.pageSize, this._allocatorType); + this._pages.push(firstPage); + + // IMPORTANT: The first glyph on the first page must be an empty glyph such that zeroed out + // cells end up rendering nothing + // TODO: This currently means the first slab is for 0x0 glyphs and is wasted + const nullRasterizer = new GlyphRasterizer(1, ''); + firstPage.getGlyph(nullRasterizer, '', 0); + nullRasterizer.dispose(); + } + + clear() { + // Clear all pages + for (const page of this._pages) { + page.dispose(); + } + this._pages.length = 0; + this._glyphPageIndex.clear(); + this._warmedUpRasterizers.clear(); + this._warmUpTask.clear(); + + // Recreate first + this._initFirstPage(); + + // Tell listeners + this._onDidDeleteGlyphs.fire(); + } + + getGlyph(rasterizer: IGlyphRasterizer, chars: string, metadata: number): Readonly { + // TODO: Encode font size and family into key + // Ignore metadata that doesn't affect the glyph + metadata &= ~(MetadataConsts.LANGUAGEID_MASK | MetadataConsts.TOKEN_TYPE_MASK | MetadataConsts.BALANCED_BRACKETS_MASK); + + // Warm up common glyphs + if (!this._warmedUpRasterizers.has(rasterizer.id)) { + this._warmUpAtlas(rasterizer); + this._warmedUpRasterizers.add(rasterizer.id); + } + + // Try get the glyph, overflowing to a new page if necessary + return this._tryGetGlyph(this._glyphPageIndex.get(chars, metadata, rasterizer.cacheKey) ?? 0, rasterizer, chars, metadata); + } + + private _tryGetGlyph(pageIndex: number, rasterizer: IGlyphRasterizer, chars: string, metadata: number): Readonly { + this._glyphPageIndex.set(chars, metadata, rasterizer.cacheKey, pageIndex); + return ( + this._pages[pageIndex].getGlyph(rasterizer, chars, metadata) + ?? (pageIndex + 1 < this._pages.length + ? this._tryGetGlyph(pageIndex + 1, rasterizer, chars, metadata) + : undefined) + ?? this._getGlyphFromNewPage(rasterizer, chars, metadata) + ); + } + + private _getGlyphFromNewPage(rasterizer: IGlyphRasterizer, chars: string, metadata: number): Readonly { + // TODO: Support more than 2 pages and the GPU texture layer limit + this._pages.push(this._instantiationService.createInstance(TextureAtlasPage, this._pages.length, this.pageSize, this._allocatorType)); + this._glyphPageIndex.set(chars, metadata, rasterizer.cacheKey, this._pages.length - 1); + return this._pages[this._pages.length - 1].getGlyph(rasterizer, chars, metadata)!; + } + + public getUsagePreview(): Promise { + return Promise.all(this._pages.map(e => e.getUsagePreview())); + } + + public getStats(): string[] { + return this._pages.map(e => e.getStats()); + } + + /** + * Warms up the atlas by rasterizing all printable ASCII characters for each token color. This + * is distrubuted over multiple idle callbacks to avoid blocking the main thread. + */ + private _warmUpAtlas(rasterizer: IGlyphRasterizer): void { + this._warmUpTask.value?.clear(); + const taskQueue = this._warmUpTask.value = new IdleTaskQueue(); + // Warm up using roughly the larger glyphs first to help optimize atlas allocation + // A-Z + for (let code = CharCode.A; code <= CharCode.Z; code++) { + taskQueue.enqueue(() => { + for (const fgColor of this._colorMap.keys()) { + this.getGlyph(rasterizer, String.fromCharCode(code), (fgColor << MetadataConsts.FOREGROUND_OFFSET) & MetadataConsts.FOREGROUND_MASK); + } + }); + } + // a-z + for (let code = CharCode.a; code <= CharCode.z; code++) { + taskQueue.enqueue(() => { + for (const fgColor of this._colorMap.keys()) { + this.getGlyph(rasterizer, String.fromCharCode(code), (fgColor << MetadataConsts.FOREGROUND_OFFSET) & MetadataConsts.FOREGROUND_MASK); + } + }); + } + // Remaining ascii + for (let code = CharCode.ExclamationMark; code <= CharCode.Tilde; code++) { + taskQueue.enqueue(() => { + for (const fgColor of this._colorMap.keys()) { + this.getGlyph(rasterizer, String.fromCharCode(code), (fgColor << MetadataConsts.FOREGROUND_OFFSET) & MetadataConsts.FOREGROUND_MASK); + } + }); + } + } +} + diff --git a/src/vs/editor/browser/gpu/atlas/textureAtlasPage.ts b/src/vs/editor/browser/gpu/atlas/textureAtlasPage.ts new file mode 100644 index 00000000000..a661ef64bcc --- /dev/null +++ b/src/vs/editor/browser/gpu/atlas/textureAtlasPage.ts @@ -0,0 +1,122 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Event } from '../../../../base/common/event.js'; +import { Disposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { ThreeKeyMap } from '../../../../base/common/map.js'; +import { ILogService, LogLevel } from '../../../../platform/log/common/log.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import type { IBoundingBox, IGlyphRasterizer } from '../raster/raster.js'; +import type { IReadableTextureAtlasPage, ITextureAtlasAllocator, ITextureAtlasPageGlyph, GlyphMap } from './atlas.js'; +import { TextureAtlasShelfAllocator } from './textureAtlasShelfAllocator.js'; +import { TextureAtlasSlabAllocator } from './textureAtlasSlabAllocator.js'; + +export type AllocatorType = 'shelf' | 'slab' | ((canvas: OffscreenCanvas, textureIndex: number) => ITextureAtlasAllocator); + +export class TextureAtlasPage extends Disposable implements IReadableTextureAtlasPage { + + private _version: number = 0; + get version(): number { return this._version; } + + /** + * The maximum number of glyphs that can be drawn to the page. This is currently a hard static + * cap that must not be reached as it will cause the GPU buffer to overflow. + */ + static readonly maximumGlyphCount = 5_000; + + private _usedArea: IBoundingBox = { left: 0, top: 0, right: 0, bottom: 0 }; + public get usedArea(): Readonly { return this._usedArea; } + + private readonly _canvas: OffscreenCanvas; + get source(): OffscreenCanvas { return this._canvas; } + + private readonly _glyphMap: GlyphMap = new ThreeKeyMap(); + private readonly _glyphInOrderSet: Set = new Set(); + get glyphs(): IterableIterator { + return this._glyphInOrderSet.values(); + } + + private readonly _allocator: ITextureAtlasAllocator; + private _colorMap!: string[]; + + constructor( + textureIndex: number, + pageSize: number, + allocatorType: AllocatorType, + @ILogService private readonly _logService: ILogService, + @IThemeService private readonly _themeService: IThemeService, + ) { + super(); + + this._canvas = new OffscreenCanvas(pageSize, pageSize); + + switch (allocatorType) { + case 'shelf': this._allocator = new TextureAtlasShelfAllocator(this._canvas, textureIndex); break; + case 'slab': this._allocator = new TextureAtlasSlabAllocator(this._canvas, textureIndex); break; + default: this._allocator = allocatorType(this._canvas, textureIndex); break; + } + + this._register(Event.runAndSubscribe(this._themeService.onDidColorThemeChange, () => { + // TODO: Clear entire atlas on theme change + this._colorMap = this._themeService.getColorTheme().tokenColorMap; + })); + + // Reduce impact of a memory leak if this object is not released + this._register(toDisposable(() => { + this._canvas.width = 1; + this._canvas.height = 1; + })); + } + + public getGlyph(rasterizer: IGlyphRasterizer, chars: string, metadata: number): Readonly | undefined { + // IMPORTANT: There are intentionally no intermediate variables here to aid in runtime + // optimization as it's a very hot function + return this._glyphMap.get(chars, metadata, rasterizer.cacheKey) ?? this._createGlyph(rasterizer, chars, metadata); + } + + private _createGlyph(rasterizer: IGlyphRasterizer, chars: string, metadata: number): Readonly | undefined { + // Ensure the glyph can fit on the page + if (this._glyphInOrderSet.size >= TextureAtlasPage.maximumGlyphCount) { + return undefined; + } + + // Rasterize and allocate the glyph + const rasterizedGlyph = rasterizer.rasterizeGlyph(chars, metadata, this._colorMap); + const glyph = this._allocator.allocate(rasterizedGlyph); + + // Ensure the glyph was allocated + if (glyph === undefined) { + return undefined; + } + + // Save the glyph + this._glyphMap.set(chars, metadata, rasterizer.cacheKey, glyph); + this._glyphInOrderSet.add(glyph); + + // Update page version and it's tracked used area + this._version++; + this._usedArea.right = Math.max(this._usedArea.right, glyph.x + glyph.w - 1); + this._usedArea.bottom = Math.max(this._usedArea.bottom, glyph.y + glyph.h - 1); + + if (this._logService.getLevel() === LogLevel.Trace) { + this._logService.trace('New glyph', { + chars, + metadata, + rasterizedGlyph, + glyph + }); + } + + return glyph; + } + + getUsagePreview(): Promise { + return this._allocator.getUsagePreview(); + } + + getStats(): string { + return this._allocator.getStats(); + } +} diff --git a/src/vs/editor/browser/gpu/atlas/textureAtlasShelfAllocator.ts b/src/vs/editor/browser/gpu/atlas/textureAtlasShelfAllocator.ts new file mode 100644 index 00000000000..1bbf920997f --- /dev/null +++ b/src/vs/editor/browser/gpu/atlas/textureAtlasShelfAllocator.ts @@ -0,0 +1,162 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { BugIndicatingError } from '../../../../base/common/errors.js'; +import { ensureNonNullable } from '../gpuUtils.js'; +import type { IRasterizedGlyph } from '../raster/raster.js'; +import { UsagePreviewColors, type ITextureAtlasAllocator, type ITextureAtlasPageGlyph } from './atlas.js'; + +/** + * The shelf allocator is a simple allocator that places glyphs in rows, starting a new row when the + * current row is full. Due to its simplicity, it can waste space but it is very fast. + */ +export class TextureAtlasShelfAllocator implements ITextureAtlasAllocator { + + private readonly _ctx: OffscreenCanvasRenderingContext2D; + + private _currentRow: ITextureAtlasShelf = { + x: 0, + y: 0, + h: 0 + }; + + /** A set of all glyphs allocated, this is only tracked to enable debug related functionality */ + private readonly _allocatedGlyphs: Set> = new Set(); + + private _nextIndex = 0; + + constructor( + private readonly _canvas: OffscreenCanvas, + private readonly _textureIndex: number, + ) { + this._ctx = ensureNonNullable(this._canvas.getContext('2d', { + willReadFrequently: true + })); + } + + public allocate(rasterizedGlyph: IRasterizedGlyph): ITextureAtlasPageGlyph | undefined { + // The glyph does not fit into the atlas page + const glyphWidth = rasterizedGlyph.boundingBox.right - rasterizedGlyph.boundingBox.left + 1; + const glyphHeight = rasterizedGlyph.boundingBox.bottom - rasterizedGlyph.boundingBox.top + 1; + if (glyphWidth > this._canvas.width || glyphHeight > this._canvas.height) { + throw new BugIndicatingError('Glyph is too large for the atlas page'); + } + + // Finalize and increment row if it doesn't fix horizontally + if (rasterizedGlyph.boundingBox.right - rasterizedGlyph.boundingBox.left + 1 > this._canvas.width - this._currentRow.x) { + this._currentRow.x = 0; + this._currentRow.y += this._currentRow.h; + this._currentRow.h = 1; + } + + // Return undefined if there isn't any room left + if (this._currentRow.y + rasterizedGlyph.boundingBox.bottom - rasterizedGlyph.boundingBox.top + 1 > this._canvas.height) { + return undefined; + } + + // Draw glyph + this._ctx.drawImage( + rasterizedGlyph.source, + // source + rasterizedGlyph.boundingBox.left, + rasterizedGlyph.boundingBox.top, + glyphWidth, + glyphHeight, + // destination + this._currentRow.x, + this._currentRow.y, + glyphWidth, + glyphHeight + ); + + // Create glyph object + const glyph: ITextureAtlasPageGlyph = { + pageIndex: this._textureIndex, + glyphIndex: this._nextIndex++, + x: this._currentRow.x, + y: this._currentRow.y, + w: glyphWidth, + h: glyphHeight, + originOffsetX: rasterizedGlyph.originOffset.x, + originOffsetY: rasterizedGlyph.originOffset.y + }; + + // Shift current row + this._currentRow.x += glyphWidth; + this._currentRow.h = Math.max(this._currentRow.h, glyphHeight); + + // Set the glyph + this._allocatedGlyphs.add(glyph); + + return glyph; + } + + public getUsagePreview(): Promise { + const w = this._canvas.width; + const h = this._canvas.height; + const canvas = new OffscreenCanvas(w, h); + const ctx = ensureNonNullable(canvas.getContext('2d')); + ctx.fillStyle = UsagePreviewColors.Unused; + ctx.fillRect(0, 0, w, h); + + const rowHeight: Map = new Map(); // y -> h + const rowWidth: Map = new Map(); // y -> w + for (const g of this._allocatedGlyphs) { + rowHeight.set(g.y, Math.max(rowHeight.get(g.y) ?? 0, g.h)); + rowWidth.set(g.y, Math.max(rowWidth.get(g.y) ?? 0, g.x + g.w)); + } + for (const g of this._allocatedGlyphs) { + ctx.fillStyle = UsagePreviewColors.Used; + ctx.fillRect(g.x, g.y, g.w, g.h); + ctx.fillStyle = UsagePreviewColors.Wasted; + ctx.fillRect(g.x, g.y + g.h, g.w, rowHeight.get(g.y)! - g.h); + } + for (const [rowY, rowW] of rowWidth.entries()) { + if (rowY !== this._currentRow.y) { + ctx.fillStyle = UsagePreviewColors.Wasted; + ctx.fillRect(rowW, rowY, w - rowW, rowHeight.get(rowY)!); + } + } + return canvas.convertToBlob(); + } + + getStats(): string { + const w = this._canvas.width; + const h = this._canvas.height; + + let usedPixels = 0; + let wastedPixels = 0; + const totalPixels = w * h; + + const rowHeight: Map = new Map(); // y -> h + const rowWidth: Map = new Map(); // y -> w + for (const g of this._allocatedGlyphs) { + rowHeight.set(g.y, Math.max(rowHeight.get(g.y) ?? 0, g.h)); + rowWidth.set(g.y, Math.max(rowWidth.get(g.y) ?? 0, g.x + g.w)); + } + for (const g of this._allocatedGlyphs) { + usedPixels += g.w * g.h; + wastedPixels += g.w * (rowHeight.get(g.y)! - g.h); + } + for (const [rowY, rowW] of rowWidth.entries()) { + if (rowY !== this._currentRow.y) { + wastedPixels += (w - rowW) * rowHeight.get(rowY)!; + } + } + return [ + `page${this._textureIndex}:`, + ` Total: ${totalPixels} (${w}x${h})`, + ` Used: ${usedPixels} (${((usedPixels / totalPixels) * 100).toPrecision(2)}%)`, + ` Wasted: ${wastedPixels} (${((wastedPixels / totalPixels) * 100).toPrecision(2)}%)`, + `Efficiency: ${((usedPixels / (usedPixels + wastedPixels)) * 100).toPrecision(2)}%`, + ].join('\n'); + } +} + +interface ITextureAtlasShelf { + x: number; + y: number; + h: number; +} diff --git a/src/vs/editor/browser/gpu/atlas/textureAtlasSlabAllocator.ts b/src/vs/editor/browser/gpu/atlas/textureAtlasSlabAllocator.ts new file mode 100644 index 00000000000..b41fed6978c --- /dev/null +++ b/src/vs/editor/browser/gpu/atlas/textureAtlasSlabAllocator.ts @@ -0,0 +1,433 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { getActiveWindow } from '../../../../base/browser/dom.js'; +import { BugIndicatingError } from '../../../../base/common/errors.js'; +import { TwoKeyMap } from '../../../../base/common/map.js'; +import { ensureNonNullable } from '../gpuUtils.js'; +import type { IRasterizedGlyph } from '../raster/raster.js'; +import { UsagePreviewColors, type ITextureAtlasAllocator, type ITextureAtlasPageGlyph } from './atlas.js'; + +export interface TextureAtlasSlabAllocatorOptions { + slabW?: number; + slabH?: number; +} + +/** + * The slab allocator is a more complex allocator that places glyphs in square slabs of a fixed + * size. Slabs are defined by a small range of glyphs sizes they can house, this places like-sized + * glyphs in the same slab which reduces wasted space. + * + * Slabs also may contain "unused" regions on the left and bottom depending on the size of the + * glyphs they include. This space is used to place very thin or short glyphs, which would otherwise + * waste a lot of space in their own slab. + */ +export class TextureAtlasSlabAllocator implements ITextureAtlasAllocator { + + private readonly _ctx: OffscreenCanvasRenderingContext2D; + + private readonly _slabs: ITextureAtlasSlab[] = []; + private readonly _activeSlabsByDims: TwoKeyMap = new TwoKeyMap(); + + private readonly _unusedRects: ITextureAtlasSlabUnusedRect[] = []; + + private readonly _openRegionsByHeight: Map = new Map(); + private readonly _openRegionsByWidth: Map = new Map(); + + /** A set of all glyphs allocated, this is only tracked to enable debug related functionality */ + private readonly _allocatedGlyphs: Set> = new Set(); + + private _slabW: number; + private _slabH: number; + private _slabsPerRow: number; + private _slabsPerColumn: number; + private _nextIndex = 0; + + constructor( + private readonly _canvas: OffscreenCanvas, + private readonly _textureIndex: number, + options?: TextureAtlasSlabAllocatorOptions + ) { + this._ctx = ensureNonNullable(this._canvas.getContext('2d', { + willReadFrequently: true + })); + + this._slabW = Math.min( + options?.slabW ?? (64 << (Math.floor(getActiveWindow().devicePixelRatio) - 1)), + this._canvas.width + ); + this._slabH = Math.min( + options?.slabH ?? this._slabW, + this._canvas.height + ); + this._slabsPerRow = Math.floor(this._canvas.width / this._slabW); + this._slabsPerColumn = Math.floor(this._canvas.height / this._slabH); + } + + public allocate(rasterizedGlyph: IRasterizedGlyph): ITextureAtlasPageGlyph | undefined { + // Find ideal slab, creating it if there is none suitable + const glyphWidth = rasterizedGlyph.boundingBox.right - rasterizedGlyph.boundingBox.left + 1; + const glyphHeight = rasterizedGlyph.boundingBox.bottom - rasterizedGlyph.boundingBox.top + 1; + + // The glyph does not fit into the atlas page, glyphs should never be this large in practice + if (glyphWidth > this._canvas.width || glyphHeight > this._canvas.height) { + throw new BugIndicatingError('Glyph is too large for the atlas page'); + } + + // The glyph does not fit into a slab + if (glyphWidth > this._slabW || glyphHeight > this._slabH) { + // Only if this is the allocator's first glyph, resize the slab size to fit the glyph. + if (this._allocatedGlyphs.size > 0) { + return undefined; + } + // Find the largest power of 2 devisor that the glyph fits into, this ensure there is no + // wasted space outside the allocated slabs. + let sizeCandidate = this._canvas.width; + while (glyphWidth < sizeCandidate / 2 && glyphHeight < sizeCandidate / 2) { + sizeCandidate /= 2; + } + this._slabW = sizeCandidate; + this._slabH = sizeCandidate; + this._slabsPerRow = Math.floor(this._canvas.width / this._slabW); + this._slabsPerColumn = Math.floor(this._canvas.height / this._slabH); + } + + // const dpr = getActiveWindow().devicePixelRatio; + + // TODO: Include font size as well as DPR in nearestXPixels calculation + + // Round slab glyph dimensions to the nearest x pixels, where x scaled with device pixel ratio + // const nearestXPixels = Math.max(1, Math.floor(dpr / 0.5)); + // const nearestXPixels = Math.max(1, Math.floor(dpr)); + const desiredSlabSize = { + // Nearest square number + // TODO: This can probably be optimized + // w: 1 << Math.ceil(Math.sqrt(glyphWidth)), + // h: 1 << Math.ceil(Math.sqrt(glyphHeight)), + + // Nearest x px + // w: Math.ceil(glyphWidth / nearestXPixels) * nearestXPixels, + // h: Math.ceil(glyphHeight / nearestXPixels) * nearestXPixels, + + // Round odd numbers up + // w: glyphWidth % 0 === 1 ? glyphWidth + 1 : glyphWidth, + // h: glyphHeight % 0 === 1 ? glyphHeight + 1 : glyphHeight, + + // Exact number only + w: glyphWidth, + h: glyphHeight, + }; + + // Get any existing slab + let slab = this._activeSlabsByDims.get(desiredSlabSize.w, desiredSlabSize.h); + + // Check if the slab is full + if (slab) { + const glyphsPerSlab = Math.floor(this._slabW / slab.entryW) * Math.floor(this._slabH / slab.entryH); + if (slab.count >= glyphsPerSlab) { + slab = undefined; + } + } + + let dx: number | undefined; + let dy: number | undefined; + + // Search for suitable space in unused rectangles + if (!slab) { + // Only check availability for the smallest side + if (glyphWidth < glyphHeight) { + const openRegions = this._openRegionsByWidth.get(glyphWidth); + if (openRegions?.length) { + // TODO: Don't search everything? + // Search from the end so we can typically pop it off the stack + for (let i = openRegions.length - 1; i >= 0; i--) { + const r = openRegions[i]; + if (r.w >= glyphWidth && r.h >= glyphHeight) { + dx = r.x; + dy = r.y; + if (glyphWidth < r.w) { + this._unusedRects.push({ + x: r.x + glyphWidth, + y: r.y, + w: r.w - glyphWidth, + h: glyphHeight + }); + } + r.y += glyphHeight; + r.h -= glyphHeight; + if (r.h === 0) { + if (i === openRegions.length - 1) { + openRegions.pop(); + } else { + this._unusedRects.splice(i, 1); + } + } + break; + } + } + } + } else { + const openRegions = this._openRegionsByHeight.get(glyphHeight); + if (openRegions?.length) { + // TODO: Don't search everything? + // Search from the end so we can typically pop it off the stack + for (let i = openRegions.length - 1; i >= 0; i--) { + const r = openRegions[i]; + if (r.w >= glyphWidth && r.h >= glyphHeight) { + dx = r.x; + dy = r.y; + if (glyphHeight < r.h) { + this._unusedRects.push({ + x: r.x, + y: r.y + glyphHeight, + w: glyphWidth, + h: r.h - glyphHeight + }); + } + r.x += glyphWidth; + r.w -= glyphWidth; + if (r.h === 0) { + if (i === openRegions.length - 1) { + openRegions.pop(); + } else { + this._unusedRects.splice(i, 1); + } + } + break; + } + } + } + } + } + + // Create a new slab + if (dx === undefined || dy === undefined) { + if (!slab) { + if (this._slabs.length >= this._slabsPerRow * this._slabsPerColumn) { + return undefined; + } + + slab = { + x: Math.floor(this._slabs.length % this._slabsPerRow) * this._slabW, + y: Math.floor(this._slabs.length / this._slabsPerRow) * this._slabH, + entryW: desiredSlabSize.w, + entryH: desiredSlabSize.h, + count: 0 + }; + // Track unused regions to use for small glyphs + // +-------------+----+ + // | | | + // | | | <- Unused W region + // | | | + // |-------------+----+ + // | | <- Unused H region + // +------------------+ + const unusedW = this._slabW % slab.entryW; + const unusedH = this._slabH % slab.entryH; + if (unusedW) { + addEntryToMapArray(this._openRegionsByWidth, unusedW, { + x: slab.x + this._slabW - unusedW, + w: unusedW, + y: slab.y, + h: this._slabH - (unusedH ?? 0) + }); + } + if (unusedH) { + addEntryToMapArray(this._openRegionsByHeight, unusedH, { + x: slab.x, + w: this._slabW, + y: slab.y + this._slabH - unusedH, + h: unusedH + }); + } + this._slabs.push(slab); + this._activeSlabsByDims.set(desiredSlabSize.w, desiredSlabSize.h, slab); + } + + const glyphsPerRow = Math.floor(this._slabW / slab.entryW); + dx = slab.x + Math.floor(slab.count % glyphsPerRow) * slab.entryW; + dy = slab.y + Math.floor(slab.count / glyphsPerRow) * slab.entryH; + + // Shift current row + slab.count++; + } + + // Draw glyph + this._ctx.drawImage( + rasterizedGlyph.source, + // source + rasterizedGlyph.boundingBox.left, + rasterizedGlyph.boundingBox.top, + glyphWidth, + glyphHeight, + // destination + dx, + dy, + glyphWidth, + glyphHeight + ); + + // Create glyph object + const glyph: ITextureAtlasPageGlyph = { + pageIndex: this._textureIndex, + glyphIndex: this._nextIndex++, + x: dx, + y: dy, + w: glyphWidth, + h: glyphHeight, + originOffsetX: rasterizedGlyph.originOffset.x, + originOffsetY: rasterizedGlyph.originOffset.y + }; + + // Set the glyph + this._allocatedGlyphs.add(glyph); + + return glyph; + } + + public getUsagePreview(): Promise { + const w = this._canvas.width; + const h = this._canvas.height; + const canvas = new OffscreenCanvas(w, h); + const ctx = ensureNonNullable(canvas.getContext('2d')); + + ctx.fillStyle = UsagePreviewColors.Unused; + ctx.fillRect(0, 0, w, h); + + let slabEntryPixels = 0; + let usedPixels = 0; + let slabEdgePixels = 0; + let restrictedPixels = 0; + const slabW = 64 << (Math.floor(getActiveWindow().devicePixelRatio) - 1); + const slabH = slabW; + + // Draw wasted underneath glyphs first + for (const slab of this._slabs) { + let x = 0; + let y = 0; + for (let i = 0; i < slab.count; i++) { + if (x + slab.entryW > slabW) { + x = 0; + y += slab.entryH; + } + ctx.fillStyle = UsagePreviewColors.Wasted; + ctx.fillRect(slab.x + x, slab.y + y, slab.entryW, slab.entryH); + + slabEntryPixels += slab.entryW * slab.entryH; + x += slab.entryW; + } + const entriesPerRow = Math.floor(slabW / slab.entryW); + const entriesPerCol = Math.floor(slabH / slab.entryH); + const thisSlabPixels = slab.entryW * entriesPerRow * slab.entryH * entriesPerCol; + slabEdgePixels += (slabW * slabH) - thisSlabPixels; + } + + // Draw glyphs + for (const g of this._allocatedGlyphs) { + usedPixels += g.w * g.h; + ctx.fillStyle = UsagePreviewColors.Used; + ctx.fillRect(g.x, g.y, g.w, g.h); + } + + // Draw unused space on side + const unusedRegions = Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat()); + for (const r of unusedRegions) { + ctx.fillStyle = UsagePreviewColors.Restricted; + ctx.fillRect(r.x, r.y, r.w, r.h); + restrictedPixels += r.w * r.h; + } + + + // Overlay actual glyphs on top + ctx.globalAlpha = 0.5; + ctx.drawImage(this._canvas, 0, 0); + ctx.globalAlpha = 1; + + return canvas.convertToBlob(); + } + + public getStats(): string { + const w = this._canvas.width; + const h = this._canvas.height; + + let slabEntryPixels = 0; + let usedPixels = 0; + let slabEdgePixels = 0; + let wastedPixels = 0; + let restrictedPixels = 0; + const totalPixels = w * h; + const slabW = 64 << (Math.floor(getActiveWindow().devicePixelRatio) - 1); + const slabH = slabW; + + // Draw wasted underneath glyphs first + for (const slab of this._slabs) { + let x = 0; + let y = 0; + for (let i = 0; i < slab.count; i++) { + if (x + slab.entryW > slabW) { + x = 0; + y += slab.entryH; + } + slabEntryPixels += slab.entryW * slab.entryH; + x += slab.entryW; + } + const entriesPerRow = Math.floor(slabW / slab.entryW); + const entriesPerCol = Math.floor(slabH / slab.entryH); + const thisSlabPixels = slab.entryW * entriesPerRow * slab.entryH * entriesPerCol; + slabEdgePixels += (slabW * slabH) - thisSlabPixels; + } + + // Draw glyphs + for (const g of this._allocatedGlyphs) { + usedPixels += g.w * g.h; + } + + // Draw unused space on side + const unusedRegions = Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat()); + for (const r of unusedRegions) { + restrictedPixels += r.w * r.h; + } + + const edgeUsedPixels = slabEdgePixels - restrictedPixels; + wastedPixels = slabEntryPixels - (usedPixels - edgeUsedPixels); + + // usedPixels += slabEdgePixels - restrictedPixels; + const efficiency = usedPixels / (usedPixels + wastedPixels + restrictedPixels); + + return [ + `page[${this._textureIndex}]:`, + ` Total: ${totalPixels}px (${w}x${h})`, + ` Used: ${usedPixels}px (${((usedPixels / totalPixels) * 100).toFixed(2)}%)`, + ` Wasted: ${wastedPixels}px (${((wastedPixels / totalPixels) * 100).toFixed(2)}%)`, + `Restricted: ${restrictedPixels}px (${((restrictedPixels / totalPixels) * 100).toFixed(2)}%) (hard to allocate)`, + `Efficiency: ${efficiency === 1 ? '100' : (efficiency * 100).toFixed(2)}%`, + ` Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width / slabW) * Math.floor(this._canvas.height / slabH)}` + ].join('\n'); + } +} + +interface ITextureAtlasSlab { + x: number; + y: number; + entryH: number; + entryW: number; + count: number; +} + +interface ITextureAtlasSlabUnusedRect { + x: number; + y: number; + w: number; + h: number; +} + +function addEntryToMapArray(map: Map, key: K, entry: V) { + let list = map.get(key); + if (!list) { + list = []; + map.set(key, list); + } + list.push(entry); +} diff --git a/src/vs/editor/browser/gpu/bufferDirtyTracker.ts b/src/vs/editor/browser/gpu/bufferDirtyTracker.ts new file mode 100644 index 00000000000..58c9f8c39c2 --- /dev/null +++ b/src/vs/editor/browser/gpu/bufferDirtyTracker.ts @@ -0,0 +1,72 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +export interface IBufferDirtyTrackerReader { + /** + * The index of the first dirty index. + */ + readonly dataOffset: number | undefined; + /** + * The index of the last dirty index (inclusive). + */ + readonly dirtySize: number | undefined; + /** + * Whether the buffer is dirty. + */ + readonly isDirty: boolean; + /** + * Clear the dirty state. + */ + clear(): void; +} + +/** + * A simple tracker for dirty regions in a buffer. + */ +export class BufferDirtyTracker implements IBufferDirtyTrackerReader { + + private _startIndex: number | undefined; + private _endIndex: number | undefined; + + get dataOffset(): number | undefined { + return this._startIndex; + } + + get dirtySize(): number | undefined { + if (this._startIndex === undefined || this._endIndex === undefined) { + return undefined; + } + return this._endIndex - this._startIndex + 1; + } + + get isDirty(): boolean { return this._startIndex !== undefined; } + + /** + * Flag the index(es) as modified. Returns the index flagged. + * @param index An index to flag. + * @param length An optional length to flag. Defaults to 1. + */ + flag(index: number, length: number = 1): number { + this._flag(index); + if (length > 1) { + this._flag(index + length - 1); + } + return index; + } + + private _flag(index: number) { + if (this._startIndex === undefined || index < this._startIndex) { + this._startIndex = index; + } + if (this._endIndex === undefined || index > this._endIndex) { + this._endIndex = index; + } + } + + clear() { + this._startIndex = undefined; + this._endIndex = undefined; + } +} diff --git a/src/vs/editor/browser/gpu/fullFileRenderStrategy.ts b/src/vs/editor/browser/gpu/fullFileRenderStrategy.ts new file mode 100644 index 00000000000..561185b7971 --- /dev/null +++ b/src/vs/editor/browser/gpu/fullFileRenderStrategy.ts @@ -0,0 +1,301 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { getActiveWindow } from '../../../base/browser/dom.js'; +import { BugIndicatingError } from '../../../base/common/errors.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { EditorOption } from '../../common/config/editorOptions.js'; +import { CursorColumns } from '../../common/core/cursorColumns.js'; +import type { IViewLineTokens } from '../../common/tokens/lineTokens.js'; +import type { ViewportData } from '../../common/viewLayout/viewLinesViewportData.js'; +import type { ViewLineRenderingData } from '../../common/viewModel.js'; +import type { ViewContext } from '../../common/viewModel/viewContext.js'; +import type { ViewLineOptions } from '../viewParts/viewLines/viewLineOptions.js'; +import type { ITextureAtlasPageGlyph } from './atlas/atlas.js'; +import type { TextureAtlas } from './atlas/textureAtlas.js'; +import { fullFileRenderStrategyWgsl } from './fullFileRenderStrategy.wgsl.js'; +import { BindingId, type IGpuRenderStrategy } from './gpu.js'; +import { GPULifecycle } from './gpuDisposable.js'; +import { quadVertices } from './gpuUtils.js'; +import { GlyphRasterizer } from './raster/glyphRasterizer.js'; +import { ViewGpuContext } from './viewGpuContext.js'; + + +const enum Constants { + IndicesPerCell = 6, +} + +const enum CellBufferInfo { + FloatsPerEntry = 6, + BytesPerEntry = CellBufferInfo.FloatsPerEntry * 4, + Offset_X = 0, + Offset_Y = 1, + Offset_Unused1 = 2, + Offset_Unused2 = 3, + GlyphIndex = 4, + TextureIndex = 5, +} + +export class FullFileRenderStrategy extends Disposable implements IGpuRenderStrategy { + + private static _lineCount = 3000; + private static _columnCount = 200; + + readonly wgsl: string = fullFileRenderStrategyWgsl; + + private readonly _glyphRasterizer: GlyphRasterizer; + + private _cellBindBuffer!: GPUBuffer; + + /** + * The cell value buffers, these hold the cells and their glyphs. It's double buffers such that + * the thread doesn't block when one is being uploaded to the GPU. + */ + private _cellValueBuffers!: [ArrayBuffer, ArrayBuffer]; + private _activeDoubleBufferIndex: 0 | 1 = 0; + + private readonly _upToDateLines: [Set, Set] = [new Set(), new Set()]; + private _visibleObjectCount: number = 0; + + private _scrollOffsetBindBuffer!: GPUBuffer; + private _scrollOffsetValueBuffers!: [Float32Array, Float32Array]; + + get bindGroupEntries(): GPUBindGroupEntry[] { + return [ + { binding: BindingId.Cells, resource: { buffer: this._cellBindBuffer } }, + { binding: BindingId.ScrollOffset, resource: { buffer: this._scrollOffsetBindBuffer } } + ]; + } + + constructor( + private readonly _context: ViewContext, + private readonly _device: GPUDevice, + private readonly _canvas: HTMLCanvasElement, + private readonly _atlas: TextureAtlas, + ) { + super(); + + // TODO: Detect when lines have been tokenized and clear _upToDateLines + const fontFamily = this._context.configuration.options.get(EditorOption.fontFamily); + const fontSize = this._context.configuration.options.get(EditorOption.fontSize); + + this._glyphRasterizer = this._register(new GlyphRasterizer(fontSize, fontFamily)); + + const bufferSize = FullFileRenderStrategy._lineCount * FullFileRenderStrategy._columnCount * Constants.IndicesPerCell * Float32Array.BYTES_PER_ELEMENT; + this._cellBindBuffer = this._register(GPULifecycle.createBuffer(this._device, { + label: 'Monaco full file cell buffer', + size: bufferSize, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, + })).object; + this._cellValueBuffers = [ + new ArrayBuffer(bufferSize), + new ArrayBuffer(bufferSize), + ]; + + const scrollOffsetBufferSize = 2; + this._scrollOffsetBindBuffer = this._register(GPULifecycle.createBuffer(this._device, { + label: 'Monaco scroll offset buffer', + size: scrollOffsetBufferSize * Float32Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + })).object; + this._scrollOffsetValueBuffers = [ + new Float32Array(scrollOffsetBufferSize), + new Float32Array(scrollOffsetBufferSize), + ]; + } + + reset() { + for (const bufferIndex of [0, 1]) { + // Zero out buffer and upload to GPU to prevent stale rows from rendering + const buffer = new Float32Array(this._cellValueBuffers[bufferIndex]); + buffer.fill(0, 0, buffer.length); + this._device.queue.writeBuffer(this._cellBindBuffer, 0, buffer.buffer, 0, buffer.byteLength); + this._upToDateLines[bufferIndex].clear(); + } + this._visibleObjectCount = 0; + } + + update(viewportData: ViewportData, viewLineOptions: ViewLineOptions): number { + // Pre-allocate variables to be shared within the loop - don't trust the JIT compiler to do + // this optimization to avoid additional blocking time in garbage collector + let chars = ''; + let y = 0; + let x = 0; + let screenAbsoluteX = 0; + let screenAbsoluteY = 0; + let zeroToOneX = 0; + let zeroToOneY = 0; + let wgslX = 0; + let wgslY = 0; + let xOffset = 0; + let glyph: Readonly; + let cellIndex = 0; + + let tokenStartIndex = 0; + let tokenEndIndex = 0; + let tokenMetadata = 0; + + let lineData: ViewLineRenderingData; + let content: string = ''; + let fillStartIndex = 0; + let fillEndIndex = 0; + + let tokens: IViewLineTokens; + + const dpr = getActiveWindow().devicePixelRatio; + + // Update scroll offset + const scrollOffsetBuffer = this._scrollOffsetValueBuffers[this._activeDoubleBufferIndex]; + scrollOffsetBuffer[0] = this._context.viewLayout.getCurrentScrollLeft() * dpr; + scrollOffsetBuffer[1] = this._context.viewLayout.getCurrentScrollTop() * dpr; + this._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, scrollOffsetBuffer); + + // Update cell data + const cellBuffer = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]); + const lineIndexCount = FullFileRenderStrategy._columnCount * Constants.IndicesPerCell; + + const upToDateLines = this._upToDateLines[this._activeDoubleBufferIndex]; + let dirtyLineStart = Number.MAX_SAFE_INTEGER; + let dirtyLineEnd = 0; + + for (y = viewportData.startLineNumber; y <= viewportData.endLineNumber; y++) { + + // Only attempt to render lines that the GPU renderer can handle + if (!ViewGpuContext.canRender(viewLineOptions, viewportData, y)) { + continue; + } + + // TODO: Update on dirty lines; is this known by line before rendering? + // if (upToDateLines.has(y)) { + // continue; + // } + dirtyLineStart = Math.min(dirtyLineStart, y); + dirtyLineEnd = Math.max(dirtyLineEnd, y); + + lineData = viewportData.getViewLineRenderingData(y); + content = lineData.content; + xOffset = 0; + + // See ViewLine#renderLine + // const renderLineInput = new RenderLineInput( + // options.useMonospaceOptimizations, + // options.canUseHalfwidthRightwardsArrow, + // lineData.content, + // lineData.continuesWithWrappedLine, + // lineData.isBasicASCII, + // lineData.containsRTL, + // lineData.minColumn - 1, + // lineData.tokens, + // actualInlineDecorations, + // lineData.tabSize, + // lineData.startVisibleColumn, + // options.spaceWidth, + // options.middotWidth, + // options.wsmiddotWidth, + // options.stopRenderingLineAfter, + // options.renderWhitespace, + // options.renderControlCharacters, + // options.fontLigatures !== EditorFontLigatures.OFF, + // selectionsOnLine + // ); + + tokens = lineData.tokens; + tokenStartIndex = lineData.minColumn - 1; + tokenEndIndex = 0; + for (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) { + tokenEndIndex = tokens.getEndOffset(tokenIndex); + if (tokenEndIndex <= tokenStartIndex) { + // The faux indent part of the line should have no token type + continue; + } + + + tokenMetadata = tokens.getMetadata(tokenIndex); + + // console.log(`token: start=${tokenStartIndex}, end=${tokenEndIndex}, fg=${colorMap[tokenFg]}`); + + + for (x = tokenStartIndex; x < tokenEndIndex; x++) { + // HACK: Prevent rendering past the end of the render buffer + // TODO: This needs to move to a dynamic long line rendering strategy + if (x > FullFileRenderStrategy._columnCount) { + break; + } + chars = content.charAt(x); + if (chars === ' ') { + continue; + } + if (chars === '\t') { + xOffset = CursorColumns.nextRenderTabStop(x + xOffset, lineData.tabSize) - x - 1; + continue; + } + + glyph = this._atlas.getGlyph(this._glyphRasterizer, chars, tokenMetadata); + + // TODO: Support non-standard character widths + screenAbsoluteX = Math.round((x + xOffset) * viewLineOptions.spaceWidth * dpr); + screenAbsoluteY = ( + Math.ceil(( + // Top of line including line height + viewportData.relativeVerticalOffset[y - viewportData.startLineNumber] + + // Delta to top of line after line height + Math.floor((viewportData.lineHeight - this._context.configuration.options.get(EditorOption.fontSize)) / 2) + ) * dpr) + ); + zeroToOneX = screenAbsoluteX / this._canvas.width; + zeroToOneY = screenAbsoluteY / this._canvas.height; + wgslX = zeroToOneX * 2 - 1; + wgslY = zeroToOneY * 2 - 1; + + cellIndex = ((y - 1) * FullFileRenderStrategy._columnCount + (x + xOffset)) * Constants.IndicesPerCell; + cellBuffer[cellIndex + CellBufferInfo.Offset_X] = wgslX; + cellBuffer[cellIndex + CellBufferInfo.Offset_Y] = -wgslY; + cellBuffer[cellIndex + CellBufferInfo.GlyphIndex] = glyph.glyphIndex; + cellBuffer[cellIndex + CellBufferInfo.TextureIndex] = glyph.pageIndex; + } + + tokenStartIndex = tokenEndIndex; + } + + // Clear to end of line + fillStartIndex = ((y - 1) * FullFileRenderStrategy._columnCount + (tokenEndIndex + xOffset)) * Constants.IndicesPerCell; + fillEndIndex = (y * FullFileRenderStrategy._columnCount) * Constants.IndicesPerCell; + cellBuffer.fill(0, fillStartIndex, fillEndIndex); + + upToDateLines.add(y); + } + + const visibleObjectCount = (viewportData.endLineNumber - viewportData.startLineNumber + 1) * lineIndexCount; + + // Only write when there is changed data + if (dirtyLineStart <= dirtyLineEnd) { + // Write buffer and swap it out to unblock writes + this._device.queue.writeBuffer( + this._cellBindBuffer, + (dirtyLineStart - 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT, + cellBuffer.buffer, + (dirtyLineStart - 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT, + (dirtyLineEnd - dirtyLineStart + 1) * lineIndexCount * Float32Array.BYTES_PER_ELEMENT + ); + } + + this._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1; + + this._visibleObjectCount = visibleObjectCount; + return visibleObjectCount; + } + + draw(pass: GPURenderPassEncoder, viewportData: ViewportData): void { + if (this._visibleObjectCount <= 0) { + throw new BugIndicatingError('Attempt to draw 0 objects'); + } + pass.draw( + quadVertices.length / 2, + this._visibleObjectCount, + undefined, + (viewportData.startLineNumber - 1) * FullFileRenderStrategy._columnCount + ); + } +} diff --git a/src/vs/editor/browser/gpu/fullFileRenderStrategy.wgsl.ts b/src/vs/editor/browser/gpu/fullFileRenderStrategy.wgsl.ts new file mode 100644 index 00000000000..c5072ffb616 --- /dev/null +++ b/src/vs/editor/browser/gpu/fullFileRenderStrategy.wgsl.ts @@ -0,0 +1,94 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { BindingId } from './gpu.js'; + +export const fullFileRenderStrategyWgsl = /*wgsl*/ ` +struct GlyphInfo { + position: vec2f, + size: vec2f, + origin: vec2f, +}; + +struct Vertex { + @location(0) position: vec2f, +}; + +struct Cell { + position: vec2f, + unused1: vec2f, + glyphIndex: f32, + textureIndex: f32 +}; + +struct LayoutInfo { + canvasDims: vec2f, + viewportOffset: vec2f, + viewportDims: vec2f, +} + +struct ScrollOffset { + offset: vec2f +} + +struct VSOutput { + @builtin(position) position: vec4f, + @location(1) layerIndex: f32, + @location(0) texcoord: vec2f, +}; + +// Uniforms +@group(0) @binding(${BindingId.LayoutInfoUniform}) var layoutInfo: LayoutInfo; +@group(0) @binding(${BindingId.AtlasDimensionsUniform}) var atlasDims: vec2f; +@group(0) @binding(${BindingId.ScrollOffset}) var scrollOffset: ScrollOffset; + +// Storage buffers +@group(0) @binding(${BindingId.GlyphInfo0}) var glyphInfo0: array; +@group(0) @binding(${BindingId.GlyphInfo1}) var glyphInfo1: array; +@group(0) @binding(${BindingId.Cells}) var cells: array; + +@vertex fn vs( + vert: Vertex, + @builtin(instance_index) instanceIndex: u32, + @builtin(vertex_index) vertexIndex : u32 +) -> VSOutput { + let cell = cells[instanceIndex]; + // TODO: Is there a nicer way to init this? + var glyph = glyphInfo0[0]; + let glyphIndex = u32(cell.glyphIndex); + if (u32(cell.textureIndex) == 0) { + glyph = glyphInfo0[glyphIndex]; + } else { + glyph = glyphInfo1[glyphIndex]; + } + + var vsOut: VSOutput; + // Multiple vert.position by 2,-2 to get it into clipspace which ranged from -1 to 1 + vsOut.position = vec4f( + (((vert.position * vec2f(2, -2)) / layoutInfo.canvasDims)) * glyph.size + cell.position + ((glyph.origin * vec2f(2, -2)) / layoutInfo.canvasDims) + (((layoutInfo.viewportOffset - scrollOffset.offset * vec2(1, -1)) * 2) / layoutInfo.canvasDims), + 0.0, + 1.0 + ); + + vsOut.layerIndex = cell.textureIndex; + // Textures are flipped from natural direction on the y-axis, so flip it back + vsOut.texcoord = vert.position; + vsOut.texcoord = ( + // Glyph offset (0-1) + (glyph.position / atlasDims) + + // Glyph coordinate (0-1) + (vsOut.texcoord * (glyph.size / atlasDims)) + ); + + return vsOut; +} + +@group(0) @binding(${BindingId.TextureSampler}) var ourSampler: sampler; +@group(0) @binding(${BindingId.Texture}) var ourTexture: texture_2d_array; + +@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f { + return textureSample(ourTexture, ourSampler, vsOut.texcoord, u32(vsOut.layerIndex)); +} +`; diff --git a/src/vs/editor/browser/gpu/gpu.ts b/src/vs/editor/browser/gpu/gpu.ts new file mode 100644 index 00000000000..3d4f2a28453 --- /dev/null +++ b/src/vs/editor/browser/gpu/gpu.ts @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type { ViewportData } from '../../common/viewLayout/viewLinesViewportData.js'; +import type { ViewLineOptions } from '../viewParts/viewLines/viewLineOptions.js'; + +export const enum BindingId { + GlyphInfo0, + GlyphInfo1, + Cells, + TextureSampler, + Texture, + LayoutInfoUniform, + AtlasDimensionsUniform, + ScrollOffset, +} + +export interface IGpuRenderStrategy { + readonly wgsl: string; + readonly bindGroupEntries: GPUBindGroupEntry[]; + + /** + * Resets the render strategy, clearing all data and setting up for a new frame. + */ + reset(): void; + update(viewportData: ViewportData, viewLineOptions: ViewLineOptions): number; + draw?(pass: GPURenderPassEncoder, viewportData: ViewportData): void; +} diff --git a/src/vs/editor/browser/gpu/gpuDisposable.ts b/src/vs/editor/browser/gpu/gpuDisposable.ts new file mode 100644 index 00000000000..1405eb898d2 --- /dev/null +++ b/src/vs/editor/browser/gpu/gpuDisposable.ts @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type { IReference } from '../../../base/common/lifecycle.js'; +import { isFunction } from '../../../base/common/types.js'; + +export namespace GPULifecycle { + export async function requestDevice(fallback?: (message: string) => void): Promise> { + try { + if (!navigator.gpu) { + throw new Error('This browser does not support WebGPU'); + } + const adapter = (await navigator.gpu.requestAdapter())!; + if (!adapter) { + throw new Error('This browser supports WebGPU but it appears to be disabled'); + } + return wrapDestroyableInDisposable(await adapter.requestDevice()); + } catch (e) { + if (fallback) { + fallback(e.message); + } + throw e; + } + } + + export function createBuffer(device: GPUDevice, descriptor: GPUBufferDescriptor, initialValues?: Float32Array | (() => Float32Array)): IReference { + const buffer = device.createBuffer(descriptor); + if (initialValues) { + device.queue.writeBuffer(buffer, 0, isFunction(initialValues) ? initialValues() : initialValues); + } + return wrapDestroyableInDisposable(buffer); + } + + export function createTexture(device: GPUDevice, descriptor: GPUTextureDescriptor): IReference { + return wrapDestroyableInDisposable(device.createTexture(descriptor)); + } +} + +function wrapDestroyableInDisposable(value: T): IReference { + return { + object: value, + dispose: () => value.destroy() + }; +} diff --git a/src/vs/editor/browser/gpu/gpuUtils.ts b/src/vs/editor/browser/gpu/gpuUtils.ts new file mode 100644 index 00000000000..6ced420acc2 --- /dev/null +++ b/src/vs/editor/browser/gpu/gpuUtils.ts @@ -0,0 +1,59 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { BugIndicatingError } from '../../../base/common/errors.js'; +import { toDisposable, type IDisposable } from '../../../base/common/lifecycle.js'; + +export const quadVertices = new Float32Array([ + 1, 0, + 1, 1, + 0, 1, + 0, 0, + 0, 1, + 1, 0, +]); + +export function ensureNonNullable(value: T | null): T { + if (!value) { + throw new Error(`Value "${value}" cannot be null`); + } + return value; +} + +// TODO: Move capabilities into ElementSizeObserver? +export function observeDevicePixelDimensions(element: HTMLElement, parentWindow: Window & typeof globalThis, callback: (deviceWidth: number, deviceHeight: number) => void): IDisposable { + // Observe any resizes to the element and extract the actual pixel size of the element if the + // devicePixelContentBoxSize API is supported. This allows correcting rounding errors when + // converting between CSS pixels and device pixels which causes blurry rendering when device + // pixel ratio is not a round number. + let observer: ResizeObserver | undefined = new parentWindow.ResizeObserver((entries) => { + const entry = entries.find((entry) => entry.target === element); + if (!entry) { + return; + } + + // Disconnect if devicePixelContentBoxSize isn't supported by the browser + if (!('devicePixelContentBoxSize' in entry)) { + observer?.disconnect(); + observer = undefined; + return; + } + + // Fire the callback, ignore events where the dimensions are 0x0 as the canvas is likely hidden + const width = entry.devicePixelContentBoxSize[0].inlineSize; + const height = entry.devicePixelContentBoxSize[0].blockSize; + if (width > 0 && height > 0) { + callback(width, height); + } + }); + try { + observer.observe(element, { box: ['device-pixel-content-box'] } as any); + } catch { + observer.disconnect(); + observer = undefined; + throw new BugIndicatingError('Could not observe device pixel dimensions'); + } + return toDisposable(() => observer?.disconnect()); +} diff --git a/src/vs/editor/browser/gpu/objectCollectionBuffer.ts b/src/vs/editor/browser/gpu/objectCollectionBuffer.ts new file mode 100644 index 00000000000..a61fe8c09de --- /dev/null +++ b/src/vs/editor/browser/gpu/objectCollectionBuffer.ts @@ -0,0 +1,207 @@ +/*--------------------------------------------------------------------------------------------- + * 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 '../../../base/common/event.js'; +import { Disposable, dispose, toDisposable, type IDisposable } from '../../../base/common/lifecycle.js'; +import { LinkedList } from '../../../base/common/linkedList.js'; +import { BufferDirtyTracker, type IBufferDirtyTrackerReader } from './bufferDirtyTracker.js'; + +export interface ObjectCollectionBufferPropertySpec { + name: string; +} + +export type ObjectCollectionPropertyValues = { + [K in T[number]['name']]: number; +}; + +export interface IObjectCollectionBuffer extends IDisposable { + /** + * The underlying buffer. This **should not** be modified externally. + */ + readonly buffer: ArrayBuffer; + /** + * A view of the underlying buffer. This **should not** be modified externally. + */ + readonly view: Float32Array; + /** + * The size of the used portion of the buffer (in bytes). + */ + readonly bufferUsedSize: number; + /** + * The size of the used portion of the view (in float32s). + */ + readonly viewUsedSize: number; + /** + * The number of entries in the buffer. + */ + readonly entryCount: number; + + /** + * A tracker for dirty regions in the buffer. + */ + readonly dirtyTracker: IBufferDirtyTrackerReader; + + /** + * Fires when the buffer is modified. + */ + readonly onDidChange: Event; + + /** + * Fires when the buffer is recreated. + */ + readonly onDidChangeBuffer: Event; + + /** + * Creates an entry in the collection. This will return a managed object that can be modified + * which will update the underlying buffer. + * @param data The data of the entry. + */ + createEntry(data: ObjectCollectionPropertyValues): IObjectCollectionBufferEntry; +} + +/** + * An entry in an {@link ObjectCollectionBuffer}. Property values on the entry can be changed and + * their values will be updated automatically in the buffer. + */ +export interface IObjectCollectionBufferEntry extends IDisposable { + set(propertyName: T[number]['name'], value: number): void; + get(propertyName: T[number]['name']): number; + setRaw(data: ArrayLike): void; +} + +export function createObjectCollectionBuffer( + propertySpecs: T, + capacity: number +): IObjectCollectionBuffer { + return new ObjectCollectionBuffer(propertySpecs, capacity); +} + +class ObjectCollectionBuffer extends Disposable implements IObjectCollectionBuffer { + buffer: ArrayBuffer; + view: Float32Array; + + get bufferUsedSize() { + return this.viewUsedSize * Float32Array.BYTES_PER_ELEMENT; + } + get viewUsedSize() { + return this._entries.size * this._entrySize; + } + get entryCount() { + return this._entries.size; + } + + private _dirtyTracker = new BufferDirtyTracker(); + get dirtyTracker(): IBufferDirtyTrackerReader { return this._dirtyTracker; } + + private readonly _propertySpecsMap: Map = new Map(); + private readonly _entrySize: number; + private readonly _entries: LinkedList> = new LinkedList(); + + private readonly _onDidChange = this._register(new Emitter()); + readonly onDidChange = this._onDidChange.event; + private readonly _onDidChangeBuffer = this._register(new Emitter()); + readonly onDidChangeBuffer = this._onDidChangeBuffer.event; + + constructor( + public propertySpecs: T, + public capacity: number + ) { + super(); + + this.view = new Float32Array(capacity * propertySpecs.length); + this.buffer = this.view.buffer; + this._entrySize = propertySpecs.length; + for (let i = 0; i < propertySpecs.length; i++) { + const spec = { + offset: i, + ...propertySpecs[i] + }; + this._propertySpecsMap.set(spec.name, spec); + } + this._register(toDisposable(() => dispose(this._entries))); + } + + createEntry(data: ObjectCollectionPropertyValues): IObjectCollectionBufferEntry { + if (this._entries.size === this.capacity) { + this._expandBuffer(); + this._onDidChangeBuffer.fire(); + } + + const value = new ObjectCollectionBufferEntry(this.view, this._propertySpecsMap, this._dirtyTracker, this._entries.size, data); + const removeFromEntries = this._entries.push(value); + const listeners: IDisposable[] = []; + listeners.push(Event.forward(value.onDidChange, this._onDidChange)); + listeners.push(value.onWillDispose(() => { + const deletedEntryIndex = value.i; + removeFromEntries(); + + // Shift all entries after the deleted entry to the left + this.view.set(this.view.subarray(deletedEntryIndex * this._entrySize + 2, this._entries.size * this._entrySize + 2), deletedEntryIndex * this._entrySize); + + // Update entries to reflect the new i + for (const entry of this._entries) { + if (entry.i > deletedEntryIndex) { + entry.i--; + } + } + this._dirtyTracker.flag(deletedEntryIndex, (this._entries.size - deletedEntryIndex) * this._entrySize); + dispose(listeners); + })); + return value; + } + + private _expandBuffer() { + this.capacity *= 2; + const newView = new Float32Array(this.capacity * this._entrySize); + newView.set(this.view); + this.view = newView; + this.buffer = this.view.buffer; + } +} + +class ObjectCollectionBufferEntry extends Disposable implements IObjectCollectionBufferEntry { + + private readonly _onDidChange = this._register(new Emitter()); + readonly onDidChange = this._onDidChange.event; + private readonly _onWillDispose = this._register(new Emitter()); + readonly onWillDispose = this._onWillDispose.event; + + constructor( + private _view: Float32Array, + private _propertySpecsMap: Map, + private _dirtyTracker: BufferDirtyTracker, + public i: number, + data: ObjectCollectionPropertyValues, + ) { + super(); + for (const propertySpec of this._propertySpecsMap.values()) { + this._view[this.i * this._propertySpecsMap.size + propertySpec.offset] = data[propertySpec.name as keyof typeof data]; + } + this._dirtyTracker.flag(this.i * this._propertySpecsMap.size, this._propertySpecsMap.size); + } + + override dispose() { + this._onWillDispose.fire(); + super.dispose(); + } + + set(propertyName: T[number]['name'], value: number): void { + const i = this.i * this._propertySpecsMap.size + this._propertySpecsMap.get(propertyName)!.offset; + this._view[this._dirtyTracker.flag(i)] = value; + this._onDidChange.fire(); + } + + get(propertyName: T[number]['name']): number { + return this._view[this.i * this._propertySpecsMap.size + this._propertySpecsMap.get(propertyName)!.offset]; + } + + setRaw(data: ArrayLike): void { + if (data.length !== this._propertySpecsMap.size) { + throw new Error(`Data length ${data.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`); + } + this._view.set(data, this.i * this._propertySpecsMap.size); + this._dirtyTracker.flag(this.i * this._propertySpecsMap.size, this._propertySpecsMap.size); + } +} diff --git a/src/vs/editor/browser/gpu/raster/glyphRasterizer.ts b/src/vs/editor/browser/gpu/raster/glyphRasterizer.ts new file mode 100644 index 00000000000..26010b7e386 --- /dev/null +++ b/src/vs/editor/browser/gpu/raster/glyphRasterizer.ts @@ -0,0 +1,240 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { getActiveWindow } from '../../../../base/browser/dom.js'; +import { memoize } from '../../../../base/common/decorators.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { StringBuilder } from '../../../common/core/stringBuilder.js'; +import { FontStyle, TokenMetadata } from '../../../common/encodedTokenAttributes.js'; +import { ensureNonNullable } from '../gpuUtils.js'; +import type { IBoundingBox, IGlyphRasterizer, IRasterizedGlyph } from './raster.js'; + +let nextId = 0; + +export class GlyphRasterizer extends Disposable implements IGlyphRasterizer { + public readonly id = nextId++; + + @memoize + public get cacheKey(): string { + return `${this._fontFamily}_${this._fontSize}px`; + } + + private _canvas: OffscreenCanvas; + private _ctx: OffscreenCanvasRenderingContext2D; + + private _workGlyph: IRasterizedGlyph = { + source: null!, + boundingBox: { + left: 0, + bottom: 0, + right: 0, + top: 0, + }, + originOffset: { + x: 0, + y: 0, + } + }; + private _workGlyphConfig: { chars: string | undefined; metadata: number } = { chars: undefined, metadata: 0 }; + + constructor( + private readonly _fontSize: number, + private readonly _fontFamily: string, + ) { + super(); + + const devicePixelFontSize = Math.ceil(this._fontSize * getActiveWindow().devicePixelRatio); + this._canvas = new OffscreenCanvas(devicePixelFontSize * 3, devicePixelFontSize * 3); + this._ctx = ensureNonNullable(this._canvas.getContext('2d', { + willReadFrequently: true + })); + this._ctx.textBaseline = 'top'; + this._ctx.fillStyle = '#FFFFFF'; + } + + // TODO: Support drawing multiple fonts and sizes + /** + * Rasterizes a glyph. Note that the returned object is reused across different glyphs and + * therefore is only safe for synchronous access. + */ + public rasterizeGlyph( + chars: string, + metadata: number, + colorMap: string[], + ): Readonly { + if (chars === '') { + return { + source: this._canvas, + boundingBox: { top: 0, left: 0, bottom: -1, right: -1 }, + originOffset: { x: 0, y: 0 } + }; + } + // Check if the last glyph matches the config, reuse if so. This helps avoid unnecessary + // work when the rasterizer is called multiple times like when the glyph doesn't fit into a + // page. + if (this._workGlyphConfig.chars === chars && this._workGlyphConfig.metadata === metadata) { + return this._workGlyph; + } + this._workGlyphConfig.chars = chars; + this._workGlyphConfig.metadata = metadata; + return this._rasterizeGlyph(chars, metadata, colorMap); + } + + public _rasterizeGlyph( + chars: string, + metadata: number, + colorMap: string[], + ): Readonly { + const devicePixelFontSize = Math.ceil(this._fontSize * getActiveWindow().devicePixelRatio); + const canvasDim = devicePixelFontSize * 3; + if (this._canvas.width !== canvasDim) { + this._canvas.width = canvasDim; + this._canvas.height = canvasDim; + } + + // TODO: Support workbench.fontAliasing + this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height); + + const fontSb = new StringBuilder(200); + const fontStyle = TokenMetadata.getFontStyle(metadata); + if (fontStyle & FontStyle.Italic) { + fontSb.appendString('italic '); + } + if (fontStyle & FontStyle.Bold) { + fontSb.appendString('bold '); + } + fontSb.appendString(`${devicePixelFontSize}px ${this._fontFamily}`); + this._ctx.font = fontSb.build(); + + // TODO: Support FontStyle.Strikethrough and FontStyle.Underline text decorations, these + // need to be drawn manually to the canvas. See xterm.js for "dodging" the text for + // underlines. + + const originX = devicePixelFontSize; + const originY = devicePixelFontSize; + this._ctx.fillStyle = colorMap[TokenMetadata.getForeground(metadata)]; + // TODO: This might actually be slower + // const textMetrics = this._ctx.measureText(chars); + this._ctx.textBaseline = 'top'; + this._ctx.fillText(chars, originX, originY); + + const imageData = this._ctx.getImageData(0, 0, this._canvas.width, this._canvas.height); + this._findGlyphBoundingBox(imageData, this._workGlyph.boundingBox); + // const offset = { + // x: textMetrics.actualBoundingBoxLeft, + // y: textMetrics.actualBoundingBoxAscent + // }; + // const size = { + // w: textMetrics.actualBoundingBoxRight + textMetrics.actualBoundingBoxLeft, + // y: textMetrics.actualBoundingBoxDescent + textMetrics.actualBoundingBoxAscent, + // wInt: Math.ceil(textMetrics.actualBoundingBoxRight + textMetrics.actualBoundingBoxLeft), + // yInt: Math.ceil(textMetrics.actualBoundingBoxDescent + textMetrics.actualBoundingBoxAscent), + // }; + // console.log(`${chars}_${fg}`, textMetrics, boundingBox, originX, originY, { width: boundingBox.right - boundingBox.left, height: boundingBox.bottom - boundingBox.top }); + this._workGlyph.source = this._canvas; + this._workGlyph.originOffset.x = this._workGlyph.boundingBox.left - originX; + this._workGlyph.originOffset.y = this._workGlyph.boundingBox.top - originY; + // const result2: IRasterizedGlyph = { + // source: this._canvas, + // boundingBox: { + // left: Math.floor(originX - textMetrics.actualBoundingBoxLeft), + // right: Math.ceil(originX + textMetrics.actualBoundingBoxRight), + // top: Math.floor(originY - textMetrics.actualBoundingBoxAscent), + // bottom: Math.ceil(originY + textMetrics.actualBoundingBoxDescent), + // }, + // originOffset: { + // x: Math.floor(boundingBox.left - originX), + // y: Math.floor(boundingBox.top - originY) + // } + // }; + + // TODO: Verify result 1 and 2 are the same + + // if (result2.boundingBox.left > result.boundingBox.left) { + // debugger; + // } + // if (result2.boundingBox.top > result.boundingBox.top) { + // debugger; + // } + // if (result2.boundingBox.right < result.boundingBox.right) { + // debugger; + // } + // if (result2.boundingBox.bottom < result.boundingBox.bottom) { + // debugger; + // } + // if (JSON.stringify(result2.originOffset) !== JSON.stringify(result.originOffset)) { + // debugger; + // } + + + + return this._workGlyph; + } + + // TODO: Does this even need to happen when measure text is used? + private _findGlyphBoundingBox(imageData: ImageData, outBoundingBox: IBoundingBox) { + const height = this._canvas.height; + const width = this._canvas.width; + let found = false; + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + const alphaOffset = y * width * 4 + x * 4 + 3; + if (imageData.data[alphaOffset] !== 0) { + outBoundingBox.top = y; + found = true; + break; + } + } + if (found) { + break; + } + } + outBoundingBox.left = 0; + found = false; + for (let x = 0; x < width; x++) { + for (let y = 0; y < height; y++) { + const alphaOffset = y * width * 4 + x * 4 + 3; + if (imageData.data[alphaOffset] !== 0) { + outBoundingBox.left = x; + found = true; + break; + } + } + if (found) { + break; + } + } + outBoundingBox.right = width; + found = false; + for (let x = width - 1; x >= outBoundingBox.left; x--) { + for (let y = 0; y < height; y++) { + const alphaOffset = y * width * 4 + x * 4 + 3; + if (imageData.data[alphaOffset] !== 0) { + outBoundingBox.right = x; + found = true; + break; + } + } + if (found) { + break; + } + } + outBoundingBox.bottom = outBoundingBox.top; + found = false; + for (let y = height - 1; y >= 0; y--) { + for (let x = 0; x < width; x++) { + const alphaOffset = y * width * 4 + x * 4 + 3; + if (imageData.data[alphaOffset] !== 0) { + outBoundingBox.bottom = y; + found = true; + break; + } + } + if (found) { + break; + } + } + } +} diff --git a/src/vs/editor/browser/gpu/raster/raster.ts b/src/vs/editor/browser/gpu/raster/raster.ts new file mode 100644 index 00000000000..6eb41e680b2 --- /dev/null +++ b/src/vs/editor/browser/gpu/raster/raster.ts @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type { MetadataConsts } from '../../../common/encodedTokenAttributes.js'; + +export interface IGlyphRasterizer { + /** + * A unique identifier for the rasterizer. + */ + readonly id: number; + + /** + * An identifier for properties inherent to rendering with this rasterizer. This will be the + * same as other rasterizer cache keys provided they share the same property values in question. + */ + readonly cacheKey: string; + + /** + * Rasterizes a glyph. + * @param chars The character(s) to rasterize. This can be a single character, a ligature, an + * emoji, etc. + * @param metadata The metadata of the glyph to rasterize. See {@link MetadataConsts} for how + * this works. + * @param colorMap A theme's color map. + */ + rasterizeGlyph( + chars: string, + metadata: number, + colorMap: string[], + ): Readonly; +} + +/** + * A simple bounding box in a 2D plane. + */ +export interface IBoundingBox { + /** The left x coordinate (inclusive). */ + left: number; + /** The top y coordinate (inclusive). */ + top: number; + /** The right x coordinate (inclusive). */ + right: number; + /** The bottom y coordinate (inclusive). */ + bottom: number; +} + +/** + * A glyph that has been rasterized to a canvas. + */ +export interface IRasterizedGlyph { + /** + * The source canvas the glyph was rasterized to. + */ + source: OffscreenCanvas; + /** + * The bounding box of the glyph within {@link source}. + */ + boundingBox: IBoundingBox; + /** + * The offset to the glyph's origin (where it should be drawn to). + */ + originOffset: { x: number; y: number }; +} diff --git a/src/vs/editor/browser/gpu/rectangleRenderer.ts b/src/vs/editor/browser/gpu/rectangleRenderer.ts new file mode 100644 index 00000000000..0859281f48b --- /dev/null +++ b/src/vs/editor/browser/gpu/rectangleRenderer.ts @@ -0,0 +1,291 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { getActiveWindow } from '../../../base/browser/dom.js'; +import { Event } from '../../../base/common/event.js'; +import { IReference, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { EditorOption } from '../../common/config/editorOptions.js'; +import { ViewEventHandler } from '../../common/viewEventHandler.js'; +import type { ViewScrollChangedEvent } from '../../common/viewEvents.js'; +import type { ViewportData } from '../../common/viewLayout/viewLinesViewportData.js'; +import type { ViewContext } from '../../common/viewModel/viewContext.js'; +import { GPULifecycle } from './gpuDisposable.js'; +import { observeDevicePixelDimensions, quadVertices } from './gpuUtils.js'; +import { createObjectCollectionBuffer, type IObjectCollectionBuffer, type IObjectCollectionBufferEntry } from './objectCollectionBuffer.js'; +import { RectangleRendererBindingId, rectangleRendererWgsl } from './rectangleRenderer.wgsl.js'; + +export type RectangleRendererEntrySpec = [ + { name: 'x' }, + { name: 'y' }, + { name: 'width' }, + { name: 'height' }, + { name: 'red' }, + { name: 'green' }, + { name: 'blue' }, + { name: 'alpha' }, +]; + +export class RectangleRenderer extends ViewEventHandler { + + private _device!: GPUDevice; + private _renderPassDescriptor!: GPURenderPassDescriptor; + private _renderPassColorAttachment!: GPURenderPassColorAttachment; + private _bindGroup!: GPUBindGroup; + private _pipeline!: GPURenderPipeline; + + private _vertexBuffer!: GPUBuffer; + private readonly _shapeBindBuffer: MutableDisposable> = this._register(new MutableDisposable()); + + private _scrollOffsetBindBuffer!: GPUBuffer; + private _scrollOffsetValueBuffer!: Float32Array; + + private _initialized: boolean = false; + private _scrollChanged: boolean = true; + + private readonly _shapeCollection: IObjectCollectionBuffer = this._register(createObjectCollectionBuffer([ + { name: 'x' }, + { name: 'y' }, + { name: 'width' }, + { name: 'height' }, + { name: 'red' }, + { name: 'green' }, + { name: 'blue' }, + { name: 'alpha' }, + ], 32)); + + constructor( + private readonly _context: ViewContext, + private readonly _canvas: HTMLCanvasElement, + private readonly _ctx: GPUCanvasContext, + device: Promise, + ) { + super(); + + this._context.addEventHandler(this); + + this._initWebgpu(device); + } + + private async _initWebgpu(device: Promise) { + + // #region General + + this._device = await device; + + if (this._store.isDisposed) { + return; + } + + const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + this._ctx.configure({ + device: this._device, + format: presentationFormat, + alphaMode: 'premultiplied', + }); + + this._renderPassColorAttachment = { + view: null!, // Will be filled at render time + loadOp: 'load', + storeOp: 'store', + }; + this._renderPassDescriptor = { + label: 'Monaco rectangle renderer render pass', + colorAttachments: [this._renderPassColorAttachment], + }; + + // #endregion General + + // #region Uniforms + + let layoutInfoUniformBuffer: GPUBuffer; + { + const enum Info { + FloatsPerEntry = 6, + BytesPerEntry = Info.FloatsPerEntry * 4, + Offset_CanvasWidth____ = 0, + Offset_CanvasHeight___ = 1, + Offset_ViewportOffsetX = 2, + Offset_ViewportOffsetY = 3, + Offset_ViewportWidth__ = 4, + Offset_ViewportHeight_ = 5, + } + const bufferValues = new Float32Array(Info.FloatsPerEntry); + const updateBufferValues = (canvasDevicePixelWidth: number = this._canvas.width, canvasDevicePixelHeight: number = this._canvas.height) => { + bufferValues[Info.Offset_CanvasWidth____] = canvasDevicePixelWidth; + bufferValues[Info.Offset_CanvasHeight___] = canvasDevicePixelHeight; + bufferValues[Info.Offset_ViewportOffsetX] = Math.ceil(this._context.configuration.options.get(EditorOption.layoutInfo).contentLeft * getActiveWindow().devicePixelRatio); + bufferValues[Info.Offset_ViewportOffsetY] = 0; + bufferValues[Info.Offset_ViewportWidth__] = bufferValues[Info.Offset_CanvasWidth____] - bufferValues[Info.Offset_ViewportOffsetX]; + bufferValues[Info.Offset_ViewportHeight_] = bufferValues[Info.Offset_CanvasHeight___] - bufferValues[Info.Offset_ViewportOffsetY]; + return bufferValues; + }; + layoutInfoUniformBuffer = this._register(GPULifecycle.createBuffer(this._device, { + label: 'Monaco rectangle renderer uniform buffer', + size: Info.BytesPerEntry, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }, () => updateBufferValues())).object; + this._register(observeDevicePixelDimensions(this._canvas, getActiveWindow(), (w, h) => { + this._device.queue.writeBuffer(layoutInfoUniformBuffer, 0, updateBufferValues(w, h)); + })); + } + + const scrollOffsetBufferSize = 2; + this._scrollOffsetBindBuffer = this._register(GPULifecycle.createBuffer(this._device, { + label: 'Monaco rectangle renderer scroll offset buffer', + size: scrollOffsetBufferSize * Float32Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + })).object; + this._scrollOffsetValueBuffer = new Float32Array(scrollOffsetBufferSize); + + // #endregion Uniforms + + // #region Storage buffers + + const createShapeBindBuffer = () => { + return GPULifecycle.createBuffer(this._device, { + label: 'Monaco rectangle renderer shape buffer', + size: this._shapeCollection.buffer.byteLength, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, + }); + }; + this._shapeBindBuffer.value = createShapeBindBuffer(); + this._register(Event.runAndSubscribe(this._shapeCollection.onDidChangeBuffer, () => { + this._shapeBindBuffer.value = createShapeBindBuffer(); + if (this._pipeline) { + this._updateBindGroup(this._pipeline, layoutInfoUniformBuffer); + } + })); + + // #endregion Storage buffers + + // #region Vertex buffer + + this._vertexBuffer = this._register(GPULifecycle.createBuffer(this._device, { + label: 'Monaco rectangle renderer vertex buffer', + size: quadVertices.byteLength, + usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST, + }, quadVertices)).object; + + // #endregion Vertex buffer + + // #region Shader module + + const module = this._device.createShaderModule({ + label: 'Monaco rectangle renderer shader module', + code: rectangleRendererWgsl, + }); + + // #endregion Shader module + + // #region Pipeline + + this._pipeline = this._device.createRenderPipeline({ + label: 'Monaco rectangle renderer render pipeline', + layout: 'auto', + vertex: { + module, + buffers: [ + { + arrayStride: 2 * Float32Array.BYTES_PER_ELEMENT, // 2 floats, 4 bytes each + attributes: [ + { shaderLocation: 0, offset: 0, format: 'float32x2' }, // position + ], + } + ] + }, + fragment: { + module, + targets: [ + { + format: presentationFormat, + blend: { + color: { + srcFactor: 'src-alpha', + dstFactor: 'one-minus-src-alpha' + }, + alpha: { + srcFactor: 'src-alpha', + dstFactor: 'one-minus-src-alpha' + }, + }, + } + ], + }, + }); + + // #endregion Pipeline + + // #region Bind group + + this._updateBindGroup(this._pipeline, layoutInfoUniformBuffer); + + // endregion Bind group + + this._initialized = true; + } + + private _updateBindGroup(pipeline: GPURenderPipeline, layoutInfoUniformBuffer: GPUBuffer) { + this._bindGroup = this._device.createBindGroup({ + label: 'Monaco rectangle renderer bind group', + layout: pipeline.getBindGroupLayout(0), + entries: [ + { binding: RectangleRendererBindingId.Shapes, resource: { buffer: this._shapeBindBuffer.value!.object } }, + { binding: RectangleRendererBindingId.LayoutInfoUniform, resource: { buffer: layoutInfoUniformBuffer } }, + { binding: RectangleRendererBindingId.ScrollOffset, resource: { buffer: this._scrollOffsetBindBuffer } }, + ], + }); + } + + register(x: number, y: number, width: number, height: number, red: number, green: number, blue: number, alpha: number): IObjectCollectionBufferEntry { + return this._shapeCollection.createEntry({ x, y, width, height, red, green, blue, alpha }); + } + + // --- begin event handlers + + public override onScrollChanged(e: ViewScrollChangedEvent): boolean { + this._scrollChanged = true; + return super.onScrollChanged(e); + } + + // --- end event handlers + + private _update() { + const shapes = this._shapeCollection; + if (shapes.dirtyTracker.isDirty) { + this._device.queue.writeBuffer(this._shapeBindBuffer.value!.object, 0, shapes.buffer, shapes.dirtyTracker.dataOffset, shapes.dirtyTracker.dirtySize! * shapes.view.BYTES_PER_ELEMENT); + shapes.dirtyTracker.clear(); + } + + // Update scroll offset + if (this._scrollChanged) { + const dpr = getActiveWindow().devicePixelRatio; + this._scrollOffsetValueBuffer[0] = this._context.viewLayout.getCurrentScrollLeft() * dpr; + this._scrollOffsetValueBuffer[1] = this._context.viewLayout.getCurrentScrollTop() * dpr; + this._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer); + } + } + + draw(viewportData: ViewportData) { + if (!this._initialized) { + return; + } + + this._update(); + + const encoder = this._device.createCommandEncoder({ label: 'Monaco rectangle renderer command encoder' }); + + this._renderPassColorAttachment.view = this._ctx.getCurrentTexture().createView(); + const pass = encoder.beginRenderPass(this._renderPassDescriptor); + pass.setPipeline(this._pipeline); + pass.setVertexBuffer(0, this._vertexBuffer); + pass.setBindGroup(0, this._bindGroup); + + pass.draw(quadVertices.length / 2, this._shapeCollection.entryCount); + pass.end(); + + const commandBuffer = encoder.finish(); + this._device.queue.submit([commandBuffer]); + } +} diff --git a/src/vs/editor/browser/gpu/rectangleRenderer.wgsl.ts b/src/vs/editor/browser/gpu/rectangleRenderer.wgsl.ts new file mode 100644 index 00000000000..44865c932a7 --- /dev/null +++ b/src/vs/editor/browser/gpu/rectangleRenderer.wgsl.ts @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +export const enum RectangleRendererBindingId { + Shapes, + LayoutInfoUniform, + ScrollOffset, +} + +export const rectangleRendererWgsl = /*wgsl*/ ` + +struct Vertex { + @location(0) position: vec2f, +}; + +struct LayoutInfo { + canvasDims: vec2f, + viewportOffset: vec2f, + viewportDims: vec2f, +} + +struct ScrollOffset { + offset: vec2f, +} + +struct Shape { + position: vec2f, + size: vec2f, + color: vec4f, +}; + +struct VSOutput { + @builtin(position) position: vec4f, + @location(1) color: vec4f, +}; + +// Uniforms +@group(0) @binding(${RectangleRendererBindingId.LayoutInfoUniform}) var layoutInfo: LayoutInfo; + +// Storage buffers +@group(0) @binding(${RectangleRendererBindingId.Shapes}) var shapes: array; +@group(0) @binding(${RectangleRendererBindingId.ScrollOffset}) var scrollOffset: ScrollOffset; + +@vertex fn vs( + vert: Vertex, + @builtin(instance_index) instanceIndex: u32, + @builtin(vertex_index) vertexIndex : u32 +) -> VSOutput { + let shape = shapes[instanceIndex]; + + var vsOut: VSOutput; + vsOut.position = vec4f( + ( + // Top left corner + vec2f(-1, 1) + + // Convert pixel position to clipspace + vec2f( 2, -2) / layoutInfo.canvasDims * + // Shape position and size + (layoutInfo.viewportOffset - scrollOffset.offset + shape.position + vert.position * shape.size) + ), + 0.0, + 1.0 + ); + vsOut.color = shape.color; + return vsOut; +} + +@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f { + return vsOut.color; +} +`; diff --git a/src/vs/editor/browser/gpu/taskQueue.ts b/src/vs/editor/browser/gpu/taskQueue.ts new file mode 100644 index 00000000000..27d64d01fe2 --- /dev/null +++ b/src/vs/editor/browser/gpu/taskQueue.ts @@ -0,0 +1,172 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { getActiveWindow } from '../../../base/browser/dom.js'; +import { Disposable, toDisposable } from '../../../base/common/lifecycle.js'; + +/** + * Copyright (c) 2022 The xterm.js authors. All rights reserved. + * @license MIT + */ + +interface ITaskQueue { + /** + * Adds a task to the queue which will run in a future idle callback. + * To avoid perceivable stalls on the mainthread, tasks with heavy workload + * should split their work into smaller pieces and return `true` to get + * called again until the work is done (on falsy return value). + */ + enqueue(task: () => boolean | void): void; + + /** + * Flushes the queue, running all remaining tasks synchronously. + */ + flush(): void; + + /** + * Clears any remaining tasks from the queue, these will not be run. + */ + clear(): void; +} + +interface ITaskDeadline { + timeRemaining(): number; +} +type CallbackWithDeadline = (deadline: ITaskDeadline) => void; + +abstract class TaskQueue extends Disposable implements ITaskQueue { + private _tasks: (() => boolean | void)[] = []; + private _idleCallback?: number; + private _i = 0; + + constructor() { + super(); + this._register(toDisposable(() => this.clear())); + } + + protected abstract _requestCallback(callback: CallbackWithDeadline): number; + protected abstract _cancelCallback(identifier: number): void; + + public enqueue(task: () => boolean | void): void { + this._tasks.push(task); + this._start(); + } + + public flush(): void { + while (this._i < this._tasks.length) { + if (!this._tasks[this._i]()) { + this._i++; + } + } + this.clear(); + } + + public clear(): void { + if (this._idleCallback) { + this._cancelCallback(this._idleCallback); + this._idleCallback = undefined; + } + this._i = 0; + this._tasks.length = 0; + } + + private _start(): void { + if (!this._idleCallback) { + this._idleCallback = this._requestCallback(this._process.bind(this)); + } + } + + private _process(deadline: ITaskDeadline): void { + this._idleCallback = undefined; + let taskDuration = 0; + let longestTask = 0; + let lastDeadlineRemaining = deadline.timeRemaining(); + let deadlineRemaining = 0; + while (this._i < this._tasks.length) { + taskDuration = Date.now(); + if (!this._tasks[this._i]()) { + this._i++; + } + // other than performance.now, Date.now might not be stable (changes on wall clock changes), + // this is not an issue here as a clock change during a short running task is very unlikely + // in case it still happened and leads to negative duration, simply assume 1 msec + taskDuration = Math.max(1, Date.now() - taskDuration); + longestTask = Math.max(taskDuration, longestTask); + // Guess the following task will take a similar time to the longest task in this batch, allow + // additional room to try avoid exceeding the deadline + deadlineRemaining = deadline.timeRemaining(); + if (longestTask * 1.5 > deadlineRemaining) { + // Warn when the time exceeding the deadline is over 20ms, if this happens in practice the + // task should be split into sub-tasks to ensure the UI remains responsive. + if (lastDeadlineRemaining - taskDuration < -20) { + console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(lastDeadlineRemaining - taskDuration))}ms`); + } + this._start(); + return; + } + lastDeadlineRemaining = deadlineRemaining; + } + this.clear(); + } +} + +/** + * A queue of that runs tasks over several tasks via setTimeout, trying to maintain above 60 frames + * per second. The tasks will run in the order they are enqueued, but they will run some time later, + * and care should be taken to ensure they're non-urgent and will not introduce race conditions. + */ +export class PriorityTaskQueue extends TaskQueue { + protected _requestCallback(callback: CallbackWithDeadline): number { + return getActiveWindow().setTimeout(() => callback(this._createDeadline(16))); + } + + protected _cancelCallback(identifier: number): void { + getActiveWindow().clearTimeout(identifier); + } + + private _createDeadline(duration: number): ITaskDeadline { + const end = Date.now() + duration; + return { + timeRemaining: () => Math.max(0, end - Date.now()) + }; + } +} + +/** + * A queue of that runs tasks over several idle callbacks, trying to respect the idle callback's + * deadline given by the environment. The tasks will run in the order they are enqueued, but they + * will run some time later, and care should be taken to ensure they're non-urgent and will not + * introduce race conditions. + */ +export class IdleTaskQueue extends TaskQueue { + protected _requestCallback(callback: IdleRequestCallback): number { + return getActiveWindow().requestIdleCallback(callback); + } + + protected _cancelCallback(identifier: number): void { + getActiveWindow().cancelIdleCallback(identifier); + } +} + +/** + * An object that tracks a single debounced task that will run on the next idle frame. When called + * multiple times, only the last set task will run. + */ +export class DebouncedIdleTask { + private _queue: ITaskQueue; + + constructor() { + this._queue = new IdleTaskQueue(); + } + + public set(task: () => boolean | void): void { + this._queue.clear(); + this._queue.enqueue(task); + } + + public flush(): void { + this._queue.flush(); + } +} diff --git a/src/vs/editor/browser/gpu/viewGpuContext.ts b/src/vs/editor/browser/gpu/viewGpuContext.ts new file mode 100644 index 00000000000..877c1b3a868 --- /dev/null +++ b/src/vs/editor/browser/gpu/viewGpuContext.ts @@ -0,0 +1,123 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as nls from '../../../nls.js'; +import { addDisposableListener, getActiveWindow } from '../../../base/browser/dom.js'; +import { createFastDomNode, type FastDomNode } from '../../../base/browser/fastDomNode.js'; +import { BugIndicatingError } from '../../../base/common/errors.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import type { ViewportData } from '../../common/viewLayout/viewLinesViewportData.js'; +import type { ViewLineOptions } from '../viewParts/viewLines/viewLineOptions.js'; +import { observableValue, runOnChange, type IObservable } from '../../../base/common/observable.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { TextureAtlas } from './atlas/textureAtlas.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { INotificationService, IPromptChoice, Severity } from '../../../platform/notification/common/notification.js'; +import { GPULifecycle } from './gpuDisposable.js'; +import { ensureNonNullable, observeDevicePixelDimensions } from './gpuUtils.js'; +import { RectangleRenderer } from './rectangleRenderer.js'; +import type { ViewContext } from '../../common/viewModel/viewContext.js'; + +export class ViewGpuContext extends Disposable { + readonly canvas: FastDomNode; + readonly ctx: GPUCanvasContext; + + readonly device: Promise; + + readonly rectangleRenderer: RectangleRenderer; + + private static _atlas: TextureAtlas | undefined; + + + /** + * The shared texture atlas to use across all views. + * + * @throws if called before the GPU device is resolved + */ + static get atlas(): TextureAtlas { + if (!ViewGpuContext._atlas) { + throw new BugIndicatingError('Cannot call ViewGpuContext.textureAtlas before device is resolved'); + } + return ViewGpuContext._atlas; + } + /** + * The shared texture atlas to use across all views. This is a convenience alias for + * {@link ViewGpuContext.atlas}. + * + * @throws if called before the GPU device is resolved + */ + get atlas(): TextureAtlas { + return ViewGpuContext.atlas; + } + + readonly canvasDevicePixelDimensions: IObservable<{ width: number; height: number }>; + readonly devicePixelRatio: IObservable; + + constructor( + context: ViewContext, + @IInstantiationService private readonly _instantiationService: IInstantiationService, + @INotificationService private readonly _notificationService: INotificationService, + @IConfigurationService private readonly configurationService: IConfigurationService, + ) { + super(); + + this.canvas = createFastDomNode(document.createElement('canvas')); + this.canvas.setClassName('editorCanvas'); + + this.ctx = ensureNonNullable(this.canvas.domNode.getContext('webgpu')); + + this.device = GPULifecycle.requestDevice((message) => { + const choices: IPromptChoice[] = [{ + label: nls.localize('editor.dom.render', "Use DOM-based rendering"), + run: () => this.configurationService.updateValue('editor.experimentalGpuAcceleration', 'off'), + }]; + this._notificationService.prompt(Severity.Warning, message, choices); + }).then(ref => this._register(ref).object); + this.device.then(device => { + if (!ViewGpuContext._atlas) { + ViewGpuContext._atlas = this._instantiationService.createInstance(TextureAtlas, device.limits.maxTextureDimension2D, undefined); + runOnChange(this.devicePixelRatio, () => ViewGpuContext.atlas.clear()); + } + }); + + this.rectangleRenderer = this._instantiationService.createInstance(RectangleRenderer, context, this.canvas.domNode, this.ctx, this.device); + + const dprObs = observableValue(this, getActiveWindow().devicePixelRatio); + this._register(addDisposableListener(getActiveWindow(), 'resize', () => { + dprObs.set(getActiveWindow().devicePixelRatio, undefined); + })); + this.devicePixelRatio = dprObs; + + const canvasDevicePixelDimensions = observableValue(this, { width: this.canvas.domNode.width, height: this.canvas.domNode.height }); + this._register(observeDevicePixelDimensions( + this.canvas.domNode, + getActiveWindow(), + (width, height) => { + this.canvas.domNode.width = width; + this.canvas.domNode.height = height; + canvasDevicePixelDimensions.set({ width, height }, undefined); + } + )); + this.canvasDevicePixelDimensions = canvasDevicePixelDimensions; + } + + /** + * This method determines which lines can be and are allowed to be rendered using the GPU + * renderer. Eventually this should trend all lines, except maybe exceptional cases like + * decorations that use class names. + */ + public static canRender(options: ViewLineOptions, viewportData: ViewportData, lineNumber: number): boolean { + const data = viewportData.getViewLineRenderingData(lineNumber); + if ( + data.containsRTL || + data.maxColumn > 200 || + data.continuesWithWrappedLine || + data.inlineDecorations.length > 0 + ) { + return false; + } + return true; + } +} diff --git a/src/vs/editor/browser/observableCodeEditor.ts b/src/vs/editor/browser/observableCodeEditor.ts index 195aee2cf4f..9641c87228b 100644 --- a/src/vs/editor/browser/observableCodeEditor.ts +++ b/src/vs/editor/browser/observableCodeEditor.ts @@ -3,18 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { equalsIfDefined, itemsEquals } from 'vs/base/common/equals'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, ITransaction, autorun, autorunOpts, autorunWithStoreHandleChanges, derived, derivedOpts, observableFromEvent, observableSignal, observableValue, observableValueOpts } from 'vs/base/common/observable'; -import { TransactionImpl } from 'vs/base/common/observableInternal/base'; -import { derivedWithSetter } from 'vs/base/common/observableInternal/derived'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EditorOption, FindComputedEditorOptionValueById } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model'; -import { IModelContentChangedEvent } from 'vs/editor/common/textModelEvents'; +import { equalsIfDefined, itemsEquals } from '../../base/common/equals.js'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../base/common/lifecycle.js'; +import { IObservable, ITransaction, TransactionImpl, autorun, autorunOpts, derived, derivedOpts, derivedWithSetter, observableFromEvent, observableSignal, observableValue, observableValueOpts } from '../../base/common/observable.js'; +import { EditorOption, FindComputedEditorOptionValueById } from '../common/config/editorOptions.js'; +import { Position } from '../common/core/position.js'; +import { Selection } from '../common/core/selection.js'; +import { ICursorSelectionChangedEvent } from '../common/cursorEvents.js'; +import { IModelDeltaDecoration, ITextModel } from '../common/model.js'; +import { IModelContentChangedEvent } from '../common/textModelEvents.js'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from './editorBrowser.js'; /** * Returns a facade for the code editor that provides observables for various states/events. @@ -190,6 +188,8 @@ export class ObservableCodeEditor extends Disposable { public readonly scrollLeft = observableFromEvent(this.editor.onDidScrollChange, () => this.editor.getScrollLeft()); public readonly layoutInfo = observableFromEvent(this.editor.onDidLayoutChange, () => this.editor.getLayoutInfo()); + public readonly layoutInfoContentLeft = this.layoutInfo.map(l => l.contentLeft); + public readonly layoutInfoDecorationsLeft = this.layoutInfo.map(l => l.decorationsLeft); public readonly contentWidth = observableFromEvent(this.editor.onDidContentSizeChange, () => this.editor.getContentWidth()); @@ -244,39 +244,3 @@ interface IObservableOverlayWidget { readonly minContentWidthInPx: IObservable; get allowEditorOverflow(): boolean; } - -type RemoveUndefined = T extends undefined ? never : T; -export function reactToChange(observable: IObservable, cb: (value: T, deltas: RemoveUndefined[]) => void): IDisposable { - return autorunWithStoreHandleChanges({ - createEmptyChangeSummary: () => ({ deltas: [] as RemoveUndefined[], didChange: false }), - handleChange: (context, changeSummary) => { - if (context.didChange(observable)) { - const e = context.change; - if (e !== undefined) { - changeSummary.deltas.push(e as RemoveUndefined); - } - changeSummary.didChange = true; - } - return true; - }, - }, (reader, changeSummary) => { - const value = observable.read(reader); - if (changeSummary.didChange) { - cb(value, changeSummary.deltas); - } - }); -} - -export function reactToChangeWithStore(observable: IObservable, cb: (value: T, deltas: RemoveUndefined[], store: DisposableStore) => void): IDisposable { - const store = new DisposableStore(); - const disposable = reactToChange(observable, (value, deltas) => { - store.clear(); - cb(value, deltas, store); - }); - return { - dispose() { - disposable.dispose(); - store.dispose(); - } - }; -} diff --git a/src/vs/editor/browser/services/abstractCodeEditorService.ts b/src/vs/editor/browser/services/abstractCodeEditorService.ts index 1fedb4d17c4..d92fc24c9cf 100644 --- a/src/vs/editor/browser/services/abstractCodeEditorService.ts +++ b/src/vs/editor/browser/services/abstractCodeEditorService.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable, DisposableStore, Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { LinkedList } from 'vs/base/common/linkedList'; -import * as strings from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { ICodeEditorOpenHandler, ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { IContentDecorationRenderOptions, IDecorationRenderOptions, IThemeDecorationRenderOptions, isThemeColor } from 'vs/editor/common/editorCommon'; -import { IModelDecorationOptions, IModelDecorationOverviewRulerOptions, InjectedTextOptions, ITextModel, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { IResourceEditorInput } from 'vs/platform/editor/common/editor'; -import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService'; -import { ThemeColor } from 'vs/base/common/themables'; +import * as dom from '../../../base/browser/dom.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IDisposable, DisposableStore, Disposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { LinkedList } from '../../../base/common/linkedList.js'; +import * as strings from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import { ICodeEditor, IDiffEditor } from '../editorBrowser.js'; +import { ICodeEditorOpenHandler, ICodeEditorService } from './codeEditorService.js'; +import { IContentDecorationRenderOptions, IDecorationRenderOptions, IThemeDecorationRenderOptions, isThemeColor } from '../../common/editorCommon.js'; +import { IModelDecorationOptions, IModelDecorationOverviewRulerOptions, InjectedTextOptions, ITextModel, OverviewRulerLane, TrackedRangeStickiness } from '../../common/model.js'; +import { IResourceEditorInput } from '../../../platform/editor/common/editor.js'; +import { IColorTheme, IThemeService } from '../../../platform/theme/common/themeService.js'; +import { ThemeColor } from '../../../base/common/themables.js'; export abstract class AbstractCodeEditorService extends Disposable implements ICodeEditorService { diff --git a/src/vs/editor/browser/services/bulkEditService.ts b/src/vs/editor/browser/services/bulkEditService.ts index 4f06c9ca68b..cbc88fafc2f 100644 --- a/src/vs/editor/browser/services/bulkEditService.ts +++ b/src/vs/editor/browser/services/bulkEditService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { TextEdit, WorkspaceEdit, WorkspaceEditMetadata, IWorkspaceFileEdit, WorkspaceFileEditOptions, IWorkspaceTextEdit } from 'vs/editor/common/languages'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IProgress, IProgressStep } from 'vs/platform/progress/common/progress'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { isObject } from 'vs/base/common/types'; -import { UndoRedoSource } from 'vs/platform/undoRedo/common/undoRedo'; -import { CancellationToken } from 'vs/base/common/cancellation'; +import { ICodeEditor } from '../editorBrowser.js'; +import { TextEdit, WorkspaceEdit, WorkspaceEditMetadata, IWorkspaceFileEdit, WorkspaceFileEditOptions, IWorkspaceTextEdit } from '../../common/languages.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IProgress, IProgressStep } from '../../../platform/progress/common/progress.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { isObject } from '../../../base/common/types.js'; +import { UndoRedoSource } from '../../../platform/undoRedo/common/undoRedo.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; export const IBulkEditService = createDecorator('IWorkspaceEditService'); diff --git a/src/vs/editor/browser/services/codeEditorService.ts b/src/vs/editor/browser/services/codeEditorService.ts index d7119b2506e..733018faea7 100644 --- a/src/vs/editor/browser/services/codeEditorService.ts +++ b/src/vs/editor/browser/services/codeEditorService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { IDecorationRenderOptions } from 'vs/editor/common/editorCommon'; -import { IModelDecorationOptions, ITextModel } from 'vs/editor/common/model'; -import { ITextResourceEditorInput } from 'vs/platform/editor/common/editor'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { URI } from 'vs/base/common/uri'; -import { IDisposable } from 'vs/base/common/lifecycle'; +import { Event } from '../../../base/common/event.js'; +import { ICodeEditor, IDiffEditor } from '../editorBrowser.js'; +import { IDecorationRenderOptions } from '../../common/editorCommon.js'; +import { IModelDecorationOptions, ITextModel } from '../../common/model.js'; +import { ITextResourceEditorInput } from '../../../platform/editor/common/editor.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { URI } from '../../../base/common/uri.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; export const ICodeEditorService = createDecorator('codeEditorService'); diff --git a/src/vs/editor/browser/services/editorWorkerService.ts b/src/vs/editor/browser/services/editorWorkerService.ts index aa1e41c8985..6e01c738ab5 100644 --- a/src/vs/editor/browser/services/editorWorkerService.ts +++ b/src/vs/editor/browser/services/editorWorkerService.ts @@ -3,40 +3,36 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IntervalTimer, timeout } from 'vs/base/common/async'; -import { Disposable, IDisposable, dispose, toDisposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { SimpleWorkerClient, logOnceWebWorkerWarning, IWorkerClient } from 'vs/base/common/worker/simpleWorker'; -import { DefaultWorkerFactory } from 'vs/base/browser/defaultWorkerFactory'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import * as languages from 'vs/editor/common/languages'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { EditorSimpleWorker } from 'vs/editor/common/services/editorSimpleWorker'; -import { DiffAlgorithmName, IDiffComputationResult, IEditorWorkerService, ILineChange, IUnicodeHighlightsResult } from 'vs/editor/common/services/editorWorker'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { ILogService } from 'vs/platform/log/common/log'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { canceled, onUnexpectedError } from 'vs/base/common/errors'; -import { UnicodeHighlighterOptions } from 'vs/editor/common/services/unicodeTextModelHighlighter'; -import { IEditorWorkerHost } from 'vs/editor/common/services/editorWorkerHost'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { IChange } from 'vs/editor/common/diff/legacyLinesDiffComputer'; -import { IDocumentDiff, IDocumentDiffProviderOptions } from 'vs/editor/common/diff/documentDiffProvider'; -import { ILinesDiffComputerOptions, MovedText } from 'vs/editor/common/diff/linesDiffComputer'; -import { DetailedLineRangeMapping, RangeMapping, LineRangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { SectionHeader, FindSectionHeaderOptions } from 'vs/editor/common/services/findSectionHeaders'; -import { mainWindow } from 'vs/base/browser/window'; -import { WindowIntervalTimer } from 'vs/base/browser/dom'; - -/** - * Stop syncing a model to the worker if it was not needed for 1 min. - */ -const STOP_SYNC_MODEL_DELTA_TIME_MS = 60 * 1000; +import { timeout } from '../../../base/common/async.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { logOnceWebWorkerWarning, IWorkerClient, Proxied, IWorkerDescriptor } from '../../../base/common/worker/simpleWorker.js'; +import { createWebWorker } from '../../../base/browser/defaultWorkerFactory.js'; +import { Position } from '../../common/core/position.js'; +import { IRange, Range } from '../../common/core/range.js'; +import { ITextModel } from '../../common/model.js'; +import * as languages from '../../common/languages.js'; +import { ILanguageConfigurationService } from '../../common/languages/languageConfigurationRegistry.js'; +import { EditorSimpleWorker } from '../../common/services/editorSimpleWorker.js'; +import { DiffAlgorithmName, IEditorWorkerService, ILineChange, IUnicodeHighlightsResult } from '../../common/services/editorWorker.js'; +import { IModelService } from '../../common/services/model.js'; +import { ITextResourceConfigurationService } from '../../common/services/textResourceConfiguration.js'; +import { isNonEmptyArray } from '../../../base/common/arrays.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { canceled, onUnexpectedError } from '../../../base/common/errors.js'; +import { UnicodeHighlighterOptions } from '../../common/services/unicodeTextModelHighlighter.js'; +import { ILanguageFeaturesService } from '../../common/services/languageFeatures.js'; +import { IChange } from '../../common/diff/legacyLinesDiffComputer.js'; +import { IDocumentDiff, IDocumentDiffProviderOptions } from '../../common/diff/documentDiffProvider.js'; +import { ILinesDiffComputerOptions, MovedText } from '../../common/diff/linesDiffComputer.js'; +import { DetailedLineRangeMapping, RangeMapping, LineRangeMapping } from '../../common/diff/rangeMapping.js'; +import { LineRange } from '../../common/core/lineRange.js'; +import { SectionHeader, FindSectionHeaderOptions } from '../../common/services/findSectionHeaders.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { WindowIntervalTimer } from '../../../base/browser/dom.js'; +import { WorkerTextModelSyncClient } from '../../common/services/textModelSync/textModelSync.impl.js'; +import { EditorWorkerHost } from '../../common/services/editorWorkerHost.js'; /** * Stop the worker if it was not needed for 5 min. @@ -54,7 +50,7 @@ function canSyncModel(modelService: IModelService, resource: URI): boolean { return true; } -export class EditorWorkerService extends Disposable implements IEditorWorkerService { +export abstract class EditorWorkerService extends Disposable implements IEditorWorkerService { declare readonly _serviceBrand: undefined; @@ -63,29 +59,30 @@ export class EditorWorkerService extends Disposable implements IEditorWorkerServ private readonly _logService: ILogService; constructor( + workerDescriptor: IWorkerDescriptor, @IModelService modelService: IModelService, @ITextResourceConfigurationService configurationService: ITextResourceConfigurationService, @ILogService logService: ILogService, - @ILanguageConfigurationService languageConfigurationService: ILanguageConfigurationService, + @ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService, @ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService, ) { super(); this._modelService = modelService; - this._workerManager = this._register(new WorkerManager(this._modelService, languageConfigurationService)); + this._workerManager = this._register(new WorkerManager(workerDescriptor, this._modelService)); this._logService = logService; // register default link-provider and default completions-provider this._register(languageFeaturesService.linkProvider.register({ language: '*', hasAccessToAllModels: true }, { - provideLinks: (model, token) => { + provideLinks: async (model, token) => { if (!canSyncModel(this._modelService, model.uri)) { return Promise.resolve({ links: [] }); // File too large } - return this._workerManager.withWorker().then(client => client.computeLinks(model.uri)).then(links => { - return links && { links }; - }); + const worker = await this._workerWithResources([model.uri]); + const links = await worker.$computeLinks(model.uri.toString()); + return links && { links }; } })); - this._register(languageFeaturesService.completionProvider.register('*', new WordBasedCompletionItemProvider(this._workerManager, configurationService, this._modelService, languageConfigurationService))); + this._register(languageFeaturesService.completionProvider.register('*', new WordBasedCompletionItemProvider(this._workerManager, configurationService, this._modelService, this._languageConfigurationService))); } public override dispose(): void { @@ -96,12 +93,14 @@ export class EditorWorkerService extends Disposable implements IEditorWorkerServ return canSyncModel(this._modelService, uri); } - public computedUnicodeHighlights(uri: URI, options: UnicodeHighlighterOptions, range?: IRange): Promise { - return this._workerManager.withWorker().then(client => client.computedUnicodeHighlights(uri, options, range)); + public async computedUnicodeHighlights(uri: URI, options: UnicodeHighlighterOptions, range?: IRange): Promise { + const worker = await this._workerWithResources([uri]); + return worker.$computeUnicodeHighlights(uri.toString(), options, range); } public async computeDiff(original: URI, modified: URI, options: IDocumentDiffProviderOptions, algorithm: DiffAlgorithmName): Promise { - const result = await this._workerManager.withWorker().then(client => client.computeDiff(original, modified, options, algorithm)); + const worker = await this._workerWithResources([original, modified], /* forceLargeModels */true); + const result = await worker.$computeDiff(original.toString(), modified.toString(), options, algorithm); if (!result) { return null; } @@ -137,17 +136,18 @@ export class EditorWorkerService extends Disposable implements IEditorWorkerServ return (canSyncModel(this._modelService, original) && canSyncModel(this._modelService, modified)); } - public computeDirtyDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): Promise { - return this._workerManager.withWorker().then(client => client.computeDirtyDiff(original, modified, ignoreTrimWhitespace)); + public async computeDirtyDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): Promise { + const worker = await this._workerWithResources([original, modified]); + return worker.$computeDirtyDiff(original.toString(), modified.toString(), ignoreTrimWhitespace); } - public computeMoreMinimalEdits(resource: URI, edits: languages.TextEdit[] | null | undefined, pretty: boolean = false): Promise { + public async computeMoreMinimalEdits(resource: URI, edits: languages.TextEdit[] | null | undefined, pretty: boolean = false): Promise { if (isNonEmptyArray(edits)) { if (!canSyncModel(this._modelService, resource)) { return Promise.resolve(edits); // File too large } const sw = StopWatch.create(); - const result = this._workerManager.withWorker().then(client => client.computeMoreMinimalEdits(resource, edits, pretty)); + const result = this._workerWithResources([resource]).then(worker => worker.$computeMoreMinimalEdits(resource.toString(), edits, pretty)); result.finally(() => this._logService.trace('FORMAT#computeMoreMinimalEdits', resource.toString(true), sw.elapsed())); return Promise.race([result, timeout(1000).then(() => edits)]); @@ -162,12 +162,16 @@ export class EditorWorkerService extends Disposable implements IEditorWorkerServ return Promise.resolve(edits); // File too large } const sw = StopWatch.create(); - const result = this._workerManager.withWorker().then(client => client.computeHumanReadableDiff(resource, edits, - { ignoreTrimWhitespace: false, maxComputationTimeMs: 1000, computeMoves: false, })).catch((err) => { - onUnexpectedError(err); - // In case of an exception, fall back to computeMoreMinimalEdits - return this.computeMoreMinimalEdits(resource, edits, true); - }); + const opts: ILinesDiffComputerOptions = { ignoreTrimWhitespace: false, maxComputationTimeMs: 1000, computeMoves: false }; + const result = ( + this._workerWithResources([resource]) + .then(worker => worker.$computeHumanReadableDiff(resource.toString(), edits, opts)) + .catch((err) => { + onUnexpectedError(err); + // In case of an exception, fall back to computeMoreMinimalEdits + return this.computeMoreMinimalEdits(resource, edits, true); + }) + ); result.finally(() => this._logService.trace('FORMAT#computeHumanReadableDiff', resource.toString(true), sw.elapsed())); return result; @@ -180,20 +184,47 @@ export class EditorWorkerService extends Disposable implements IEditorWorkerServ return (canSyncModel(this._modelService, resource)); } - public navigateValueSet(resource: URI, range: IRange, up: boolean): Promise { - return this._workerManager.withWorker().then(client => client.navigateValueSet(resource, range, up)); + public async navigateValueSet(resource: URI, range: IRange, up: boolean): Promise { + const model = this._modelService.getModel(resource); + if (!model) { + return null; + } + const wordDefRegExp = this._languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition(); + const wordDef = wordDefRegExp.source; + const wordDefFlags = wordDefRegExp.flags; + const worker = await this._workerWithResources([resource]); + return worker.$navigateValueSet(resource.toString(), range, up, wordDef, wordDefFlags); } - canComputeWordRanges(resource: URI): boolean { + public canComputeWordRanges(resource: URI): boolean { return canSyncModel(this._modelService, resource); } - computeWordRanges(resource: URI, range: IRange): Promise<{ [word: string]: IRange[] } | null> { - return this._workerManager.withWorker().then(client => client.computeWordRanges(resource, range)); + public async computeWordRanges(resource: URI, range: IRange): Promise<{ [word: string]: IRange[] } | null> { + const model = this._modelService.getModel(resource); + if (!model) { + return Promise.resolve(null); + } + const wordDefRegExp = this._languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition(); + const wordDef = wordDefRegExp.source; + const wordDefFlags = wordDefRegExp.flags; + const worker = await this._workerWithResources([resource]); + return worker.$computeWordRanges(resource.toString(), range, wordDef, wordDefFlags); + } + + public async findSectionHeaders(uri: URI, options: FindSectionHeaderOptions): Promise { + const worker = await this._workerWithResources([uri]); + return worker.$findSectionHeaders(uri.toString(), options); } - public findSectionHeaders(uri: URI, options: FindSectionHeaderOptions): Promise { - return this._workerManager.withWorker().then(client => client.findSectionHeaders(uri, options)); + public async computeDefaultDocumentColors(uri: URI): Promise { + const worker = await this._workerWithResources([uri]); + return worker.$computeDefaultDocumentColors(uri.toString()); + } + + private async _workerWithResources(resources: URI[], forceLargeModels: boolean = false): Promise> { + const worker = await this._workerManager.withWorker(); + return await worker.workerWithSyncedResources(resources, forceLargeModels); } } @@ -281,7 +312,10 @@ class WorkerManager extends Disposable { private _editorWorkerClient: EditorWorkerClient | null; private _lastWorkerUsedTime: number; - constructor(modelService: IModelService, private readonly languageConfigurationService: ILanguageConfigurationService) { + constructor( + private readonly _workerDescriptor: IWorkerDescriptor, + @IModelService modelService: IModelService + ) { super(); this._modelService = modelService; this._editorWorkerClient = null; @@ -335,124 +369,31 @@ class WorkerManager extends Disposable { public withWorker(): Promise { this._lastWorkerUsedTime = (new Date()).getTime(); if (!this._editorWorkerClient) { - this._editorWorkerClient = new EditorWorkerClient(this._modelService, false, 'editorWorkerService', this.languageConfigurationService); + this._editorWorkerClient = new EditorWorkerClient(this._workerDescriptor, false, this._modelService); } return Promise.resolve(this._editorWorkerClient); } } -class EditorModelManager extends Disposable { - - private readonly _proxy: EditorSimpleWorker; - private readonly _modelService: IModelService; - private _syncedModels: { [modelUrl: string]: IDisposable } = Object.create(null); - private _syncedModelsLastUsedTime: { [modelUrl: string]: number } = Object.create(null); - - constructor(proxy: EditorSimpleWorker, modelService: IModelService, keepIdleModels: boolean) { - super(); - this._proxy = proxy; - this._modelService = modelService; - - if (!keepIdleModels) { - const timer = new IntervalTimer(); - timer.cancelAndSet(() => this._checkStopModelSync(), Math.round(STOP_SYNC_MODEL_DELTA_TIME_MS / 2)); - this._register(timer); - } - } - - public override dispose(): void { - for (const modelUrl in this._syncedModels) { - dispose(this._syncedModels[modelUrl]); - } - this._syncedModels = Object.create(null); - this._syncedModelsLastUsedTime = Object.create(null); - super.dispose(); - } - - public ensureSyncedResources(resources: URI[], forceLargeModels: boolean): void { - for (const resource of resources) { - const resourceStr = resource.toString(); - - if (!this._syncedModels[resourceStr]) { - this._beginModelSync(resource, forceLargeModels); - } - if (this._syncedModels[resourceStr]) { - this._syncedModelsLastUsedTime[resourceStr] = (new Date()).getTime(); - } - } - } - - private _checkStopModelSync(): void { - const currentTime = (new Date()).getTime(); - - const toRemove: string[] = []; - for (const modelUrl in this._syncedModelsLastUsedTime) { - const elapsedTime = currentTime - this._syncedModelsLastUsedTime[modelUrl]; - if (elapsedTime > STOP_SYNC_MODEL_DELTA_TIME_MS) { - toRemove.push(modelUrl); - } - } - - for (const e of toRemove) { - this._stopModelSync(e); - } - } - - private _beginModelSync(resource: URI, forceLargeModels: boolean): void { - const model = this._modelService.getModel(resource); - if (!model) { - return; - } - if (!forceLargeModels && model.isTooLargeForSyncing()) { - return; - } - - const modelUrl = resource.toString(); - - this._proxy.acceptNewModel({ - url: model.uri.toString(), - lines: model.getLinesContent(), - EOL: model.getEOL(), - versionId: model.getVersionId() - }); - - const toDispose = new DisposableStore(); - toDispose.add(model.onDidChangeContent((e) => { - this._proxy.acceptModelChanged(modelUrl.toString(), e); - })); - toDispose.add(model.onWillDispose(() => { - this._stopModelSync(modelUrl); - })); - toDispose.add(toDisposable(() => { - this._proxy.acceptRemovedModel(modelUrl); - })); - - this._syncedModels[modelUrl] = toDispose; - } - - private _stopModelSync(modelUrl: string): void { - const toDispose = this._syncedModels[modelUrl]; - delete this._syncedModels[modelUrl]; - delete this._syncedModelsLastUsedTime[modelUrl]; - dispose(toDispose); - } -} - class SynchronousWorkerClient implements IWorkerClient { private readonly _instance: T; - private readonly _proxyObj: Promise; + public readonly proxy: Proxied; constructor(instance: T) { this._instance = instance; - this._proxyObj = Promise.resolve(this._instance); + this.proxy = this._instance as Proxied; } public dispose(): void { this._instance.dispose(); } - public getProxyObject(): Promise { - return this._proxyObj; + public setChannel(channel: string, handler: T): void { + throw new Error(`Not supported`); + } + + public getChannel(channel: string): Proxied { + throw new Error(`Not supported`); } } @@ -460,39 +401,22 @@ export interface IEditorWorkerClient { fhr(method: string, args: any[]): Promise; } -export class EditorWorkerHost implements IEditorWorkerHost { - - private readonly _workerClient: IEditorWorkerClient; - - constructor(workerClient: IEditorWorkerClient) { - this._workerClient = workerClient; - } - - // foreign host request - public fhr(method: string, args: any[]): Promise { - return this._workerClient.fhr(method, args); - } -} - export class EditorWorkerClient extends Disposable implements IEditorWorkerClient { private readonly _modelService: IModelService; private readonly _keepIdleModels: boolean; - protected _worker: IWorkerClient | null; - protected readonly _workerFactory: DefaultWorkerFactory; - private _modelManager: EditorModelManager | null; + private _worker: IWorkerClient | null; + private _modelManager: WorkerTextModelSyncClient | null; private _disposed = false; constructor( - modelService: IModelService, + private readonly _workerDescriptor: IWorkerDescriptor, keepIdleModels: boolean, - label: string | undefined, - private readonly languageConfigurationService: ILanguageConfigurationService + @IModelService modelService: IModelService, ) { super(); this._modelService = modelService; this._keepIdleModels = keepIdleModels; - this._workerFactory = new DefaultWorkerFactory(label); this._worker = null; this._modelManager = null; } @@ -505,123 +429,59 @@ export class EditorWorkerClient extends Disposable implements IEditorWorkerClien private _getOrCreateWorker(): IWorkerClient { if (!this._worker) { try { - this._worker = this._register(new SimpleWorkerClient( - this._workerFactory, - 'vs/editor/common/services/editorSimpleWorker', - new EditorWorkerHost(this) - )); + this._worker = this._register(createWebWorker(this._workerDescriptor)); + EditorWorkerHost.setChannel(this._worker, this._createEditorWorkerHost()); } catch (err) { logOnceWebWorkerWarning(err); - this._worker = new SynchronousWorkerClient(new EditorSimpleWorker(new EditorWorkerHost(this), null)); + this._worker = this._createFallbackLocalWorker(); } } return this._worker; } - protected _getProxy(): Promise { - return this._getOrCreateWorker().getProxyObject().then(undefined, (err) => { + protected async _getProxy(): Promise> { + try { + const proxy = this._getOrCreateWorker().proxy; + await proxy.$ping(); + return proxy; + } catch (err) { logOnceWebWorkerWarning(err); - this._worker = new SynchronousWorkerClient(new EditorSimpleWorker(new EditorWorkerHost(this), null)); - return this._getOrCreateWorker().getProxyObject(); - }); + this._worker = this._createFallbackLocalWorker(); + return this._worker.proxy; + } } - private _getOrCreateModelManager(proxy: EditorSimpleWorker): EditorModelManager { + private _createFallbackLocalWorker(): SynchronousWorkerClient { + return new SynchronousWorkerClient(new EditorSimpleWorker(this._createEditorWorkerHost(), null)); + } + + private _createEditorWorkerHost(): EditorWorkerHost { + return { + $fhr: (method, args) => this.fhr(method, args) + }; + } + + private _getOrCreateModelManager(proxy: Proxied): WorkerTextModelSyncClient { if (!this._modelManager) { - this._modelManager = this._register(new EditorModelManager(proxy, this._modelService, this._keepIdleModels)); + this._modelManager = this._register(new WorkerTextModelSyncClient(proxy, this._modelService, this._keepIdleModels)); } return this._modelManager; } - protected async _withSyncedResources(resources: URI[], forceLargeModels: boolean = false): Promise { + public async workerWithSyncedResources(resources: URI[], forceLargeModels: boolean = false): Promise> { if (this._disposed) { return Promise.reject(canceled()); } - return this._getProxy().then((proxy) => { - this._getOrCreateModelManager(proxy).ensureSyncedResources(resources, forceLargeModels); - return proxy; - }); - } - - public computedUnicodeHighlights(uri: URI, options: UnicodeHighlighterOptions, range?: IRange): Promise { - return this._withSyncedResources([uri]).then(proxy => { - return proxy.computeUnicodeHighlights(uri.toString(), options, range); - }); - } - - public computeDiff(original: URI, modified: URI, options: IDocumentDiffProviderOptions, algorithm: DiffAlgorithmName): Promise { - return this._withSyncedResources([original, modified], /* forceLargeModels */true).then(proxy => { - return proxy.computeDiff(original.toString(), modified.toString(), options, algorithm); - }); - } - - public computeDirtyDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): Promise { - return this._withSyncedResources([original, modified]).then(proxy => { - return proxy.computeDirtyDiff(original.toString(), modified.toString(), ignoreTrimWhitespace); - }); - } - - public computeMoreMinimalEdits(resource: URI, edits: languages.TextEdit[], pretty: boolean): Promise { - return this._withSyncedResources([resource]).then(proxy => { - return proxy.computeMoreMinimalEdits(resource.toString(), edits, pretty); - }); - } - - public computeHumanReadableDiff(resource: URI, edits: languages.TextEdit[], options: ILinesDiffComputerOptions): Promise { - return this._withSyncedResources([resource]).then(proxy => { - return proxy.computeHumanReadableDiff(resource.toString(), edits, options); - }); - } - - public computeLinks(resource: URI): Promise { - return this._withSyncedResources([resource]).then(proxy => { - return proxy.computeLinks(resource.toString()); - }); - } - - public computeDefaultDocumentColors(resource: URI): Promise { - return this._withSyncedResources([resource]).then(proxy => { - return proxy.computeDefaultDocumentColors(resource.toString()); - }); + const proxy = await this._getProxy(); + this._getOrCreateModelManager(proxy).ensureSyncedResources(resources, forceLargeModels); + return proxy; } public async textualSuggest(resources: URI[], leadingWord: string | undefined, wordDefRegExp: RegExp): Promise<{ words: string[]; duration: number } | null> { - const proxy = await this._withSyncedResources(resources); + const proxy = await this.workerWithSyncedResources(resources); const wordDef = wordDefRegExp.source; const wordDefFlags = wordDefRegExp.flags; - return proxy.textualSuggest(resources.map(r => r.toString()), leadingWord, wordDef, wordDefFlags); - } - - computeWordRanges(resource: URI, range: IRange): Promise<{ [word: string]: IRange[] } | null> { - return this._withSyncedResources([resource]).then(proxy => { - const model = this._modelService.getModel(resource); - if (!model) { - return Promise.resolve(null); - } - const wordDefRegExp = this.languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition(); - const wordDef = wordDefRegExp.source; - const wordDefFlags = wordDefRegExp.flags; - return proxy.computeWordRanges(resource.toString(), range, wordDef, wordDefFlags); - }); - } - - public navigateValueSet(resource: URI, range: IRange, up: boolean): Promise { - return this._withSyncedResources([resource]).then(proxy => { - const model = this._modelService.getModel(resource); - if (!model) { - return null; - } - const wordDefRegExp = this.languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition(); - const wordDef = wordDefRegExp.source; - const wordDefFlags = wordDefRegExp.flags; - return proxy.navigateValueSet(resource.toString(), range, up, wordDef, wordDefFlags); - }); - } - - public findSectionHeaders(uri: URI, options: FindSectionHeaderOptions): Promise { - return this._withSyncedResources([uri]).then(proxy => { - return proxy.findSectionHeaders(uri.toString(), options); - }); + return proxy.$textualSuggest(resources.map(r => r.toString()), leadingWord, wordDef, wordDefFlags); } override dispose(): void { diff --git a/src/vs/editor/browser/services/hoverService/hoverService.ts b/src/vs/editor/browser/services/hoverService/hoverService.ts index 20faf6cfa8c..249aed774b7 100644 --- a/src/vs/editor/browser/services/hoverService/hoverService.ts +++ b/src/vs/editor/browser/services/hoverService/hoverService.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { editorHoverBorder } from 'vs/platform/theme/common/colorRegistry'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { HoverWidget } from 'vs/editor/browser/services/hoverService/hoverWidget'; -import { IContextViewProvider, IDelegate } from 'vs/base/browser/ui/contextview/contextview'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement } from 'vs/base/browser/dom'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { mainWindow } from 'vs/base/browser/window'; -import { ContextViewHandler } from 'vs/platform/contextview/browser/contextViewService'; -import type { IHoverOptions, IHoverWidget, IManagedHover, IManagedHoverContentOrFactory, IManagedHoverOptions } from 'vs/base/browser/ui/hover/hover'; -import type { IHoverDelegate, IHoverDelegateTarget } from 'vs/base/browser/ui/hover/hoverDelegate'; -import { ManagedHoverWidget } from 'vs/editor/browser/services/hoverService/updatableHoverWidget'; -import { TimeoutTimer } from 'vs/base/common/async'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { editorHoverBorder } from '../../../../platform/theme/common/colorRegistry.js'; +import { IHoverService } from '../../../../platform/hover/browser/hover.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { HoverWidget } from './hoverWidget.js'; +import { IContextViewProvider, IDelegate } from '../../../../base/browser/ui/contextview/contextview.js'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { addDisposableListener, EventType, getActiveElement, isAncestorOfActiveElement, isAncestor, getWindow, isHTMLElement, isEditableElement } from '../../../../base/browser/dom.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import { ResultKind } from '../../../../platform/keybinding/common/keybindingResolver.js'; +import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js'; +import { ILayoutService } from '../../../../platform/layout/browser/layoutService.js'; +import { mainWindow } from '../../../../base/browser/window.js'; +import { ContextViewHandler } from '../../../../platform/contextview/browser/contextViewService.js'; +import type { IHoverOptions, IHoverWidget, IManagedHover, IManagedHoverContentOrFactory, IManagedHoverOptions } from '../../../../base/browser/ui/hover/hover.js'; +import type { IHoverDelegate, IHoverDelegateTarget } from '../../../../base/browser/ui/hover/hoverDelegate.js'; +import { ManagedHoverWidget } from './updatableHoverWidget.js'; +import { TimeoutTimer } from '../../../../base/common/async.js'; export class HoverService extends Disposable implements IHoverService { declare readonly _serviceBrand: undefined; @@ -293,8 +293,7 @@ export class HoverService extends Disposable implements IHoverService { // Do not show hover when focusing an input or textarea let focusDomEmitter: undefined | IDisposable; - const tagName = targetElement.tagName.toLowerCase(); - if (tagName !== 'input' && tagName !== 'textarea') { + if (!isEditableElement(targetElement)) { focusDomEmitter = addDisposableListener(targetElement, EventType.FOCUS, onFocus, true); } diff --git a/src/vs/editor/browser/services/hoverService/hoverWidget.ts b/src/vs/editor/browser/services/hoverService/hoverWidget.ts index ed929bc965c..b46758c352f 100644 --- a/src/vs/editor/browser/services/hoverService/hoverWidget.ts +++ b/src/vs/editor/browser/services/hoverService/hoverWidget.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./hover'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { Event, Emitter } from 'vs/base/common/event'; -import * as dom from 'vs/base/browser/dom'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { EDITOR_FONT_DEFAULTS, IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { HoverAction, HoverPosition, HoverWidget as BaseHoverWidget, getHoverAccessibleViewHint } from 'vs/base/browser/ui/hover/hoverWidget'; -import { Widget } from 'vs/base/browser/ui/widget'; -import { AnchorPosition } from 'vs/base/browser/ui/contextview/contextview'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { MarkdownRenderer, openLinkFromMarkdown } from 'vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; -import { isMarkdownString } from 'vs/base/common/htmlContent'; -import { localize } from 'vs/nls'; -import { isMacintosh } from 'vs/base/common/platform'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { status } from 'vs/base/browser/ui/aria/aria'; -import type { IHoverOptions, IHoverTarget, IHoverWidget } from 'vs/base/browser/ui/hover/hover'; +import './hover.css'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { Event, Emitter } from '../../../../base/common/event.js'; +import * as dom from '../../../../base/browser/dom.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { EDITOR_FONT_DEFAULTS, IEditorOptions } from '../../../common/config/editorOptions.js'; +import { HoverAction, HoverPosition, HoverWidget as BaseHoverWidget, getHoverAccessibleViewHint } from '../../../../base/browser/ui/hover/hoverWidget.js'; +import { Widget } from '../../../../base/browser/ui/widget.js'; +import { AnchorPosition } from '../../../../base/browser/ui/contextview/contextview.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { MarkdownRenderer, openLinkFromMarkdown } from '../../widget/markdownRenderer/browser/markdownRenderer.js'; +import { isMarkdownString } from '../../../../base/common/htmlContent.js'; +import { localize } from '../../../../nls.js'; +import { isMacintosh } from '../../../../base/common/platform.js'; +import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js'; +import { status } from '../../../../base/browser/ui/aria/aria.js'; +import type { IHoverOptions, IHoverTarget, IHoverWidget } from '../../../../base/browser/ui/hover/hover.js'; const $ = dom.$; type TargetRect = { @@ -222,7 +222,7 @@ export class HoverWidget extends Widget implements IHoverWidget { } // Show the hover hint if needed - if (hideOnHover && options.appearance?.showHoverHint) { + if (options.appearance?.showHoverHint) { const statusBarElement = $('div.hover-row.status-bar'); const infoElement = $('div.info'); infoElement.textContent = localize('hoverhint', 'Hold {0} key to mouse over', isMacintosh ? 'Option' : 'Alt'); diff --git a/src/vs/editor/browser/services/hoverService/updatableHoverWidget.ts b/src/vs/editor/browser/services/hoverService/updatableHoverWidget.ts index cf9b355831f..c5b656b99d3 100644 --- a/src/vs/editor/browser/services/hoverService/updatableHoverWidget.ts +++ b/src/vs/editor/browser/services/hoverService/updatableHoverWidget.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isHTMLElement } from 'vs/base/browser/dom'; -import type { IHoverWidget, IManagedHoverContent, IManagedHoverOptions } from 'vs/base/browser/ui/hover/hover'; -import type { IHoverDelegate, IHoverDelegateOptions, IHoverDelegateTarget } from 'vs/base/browser/ui/hover/hoverDelegate'; -import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { isMarkdownString, type IMarkdownString } from 'vs/base/common/htmlContent'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { isFunction, isString } from 'vs/base/common/types'; -import { localize } from 'vs/nls'; +import { isHTMLElement } from '../../../../base/browser/dom.js'; +import type { IHoverWidget, IManagedHoverContent, IManagedHoverOptions } from '../../../../base/browser/ui/hover/hover.js'; +import type { IHoverDelegate, IHoverDelegateOptions, IHoverDelegateTarget } from '../../../../base/browser/ui/hover/hoverDelegate.js'; +import { HoverPosition } from '../../../../base/browser/ui/hover/hoverWidget.js'; +import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { isMarkdownString, type IMarkdownString } from '../../../../base/common/htmlContent.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { isFunction, isString } from '../../../../base/common/types.js'; +import { localize } from '../../../../nls.js'; type IManagedHoverResolvedContent = IMarkdownString | string | HTMLElement | undefined; @@ -71,14 +71,17 @@ export class ManagedHoverWidget implements IDisposable { const hoverOptions: IHoverDelegateOptions = { content, target: this.target, + actions: options?.actions, + linkHandler: options?.linkHandler, + trapFocus: options?.trapFocus, appearance: { showPointer: this.hoverDelegate.placement === 'element', skipFadeInAnimation: !this.fadeInAnimation || !!oldHoverWidget, // do not fade in if the hover is already showing + showHoverHint: options?.appearance?.showHoverHint, }, position: { hoverPosition: HoverPosition.BELOW, }, - ...options }; this._hoverWidget = this.hoverDelegate.showHover(hoverOptions, focus); diff --git a/src/vs/editor/browser/services/markerDecorations.ts b/src/vs/editor/browser/services/markerDecorations.ts index 55fe3c63512..eb519c43fd9 100644 --- a/src/vs/editor/browser/services/markerDecorations.ts +++ b/src/vs/editor/browser/services/markerDecorations.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IMarkerDecorationsService } from 'vs/editor/common/services/markerDecorations'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; +import { IMarkerDecorationsService } from '../../common/services/markerDecorations.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../editorExtensions.js'; +import { ICodeEditor } from '../editorBrowser.js'; +import { IEditorContribution } from '../../common/editorCommon.js'; export class MarkerDecorationsContribution implements IEditorContribution { diff --git a/src/vs/editor/browser/services/openerService.ts b/src/vs/editor/browser/services/openerService.ts index 23f8d13ce46..870f27bdec7 100644 --- a/src/vs/editor/browser/services/openerService.ts +++ b/src/vs/editor/browser/services/openerService.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { mainWindow } from 'vs/base/browser/window'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { LinkedList } from 'vs/base/common/linkedList'; -import { ResourceMap } from 'vs/base/common/map'; -import { parse } from 'vs/base/common/marshalling'; -import { matchesScheme, matchesSomeScheme, Schemas } from 'vs/base/common/network'; -import { normalizePath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { EditorOpenSource } from 'vs/platform/editor/common/editor'; -import { extractSelection, IExternalOpener, IExternalUriResolver, IOpener, IOpenerService, IResolvedExternalUri, IValidator, OpenOptions, ResolveExternalUriOptions } from 'vs/platform/opener/common/opener'; +import * as dom from '../../../base/browser/dom.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { LinkedList } from '../../../base/common/linkedList.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { parse } from '../../../base/common/marshalling.js'; +import { matchesScheme, matchesSomeScheme, Schemas } from '../../../base/common/network.js'; +import { normalizePath } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { ICodeEditorService } from './codeEditorService.js'; +import { ICommandService } from '../../../platform/commands/common/commands.js'; +import { EditorOpenSource } from '../../../platform/editor/common/editor.js'; +import { extractSelection, IExternalOpener, IExternalUriResolver, IOpener, IOpenerService, IResolvedExternalUri, IValidator, OpenOptions, ResolveExternalUriOptions } from '../../../platform/opener/common/opener.js'; class CommandOpener implements IOpener { diff --git a/src/vs/editor/browser/services/treeSitter/treeSitterParserService.ts b/src/vs/editor/browser/services/treeSitter/treeSitterParserService.ts new file mode 100644 index 00000000000..015684d2838 --- /dev/null +++ b/src/vs/editor/browser/services/treeSitter/treeSitterParserService.ts @@ -0,0 +1,476 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type { Parser } from '@vscode/tree-sitter-wasm'; +import { AppResourcePath, FileAccess, nodeModulesAsarUnpackedPath, nodeModulesPath } from '../../../../base/common/network.js'; +import { EDITOR_EXPERIMENTAL_PREFER_TREESITTER, ITreeSitterParserService, ITreeSitterParseResult } from '../../../common/services/treeSitterParserService.js'; +import { IModelService } from '../../../common/services/model.js'; +import { Disposable, DisposableMap, DisposableStore, dispose, IDisposable } from '../../../../base/common/lifecycle.js'; +import { ITextModel } from '../../../common/model.js'; +import { IFileService } from '../../../../platform/files/common/files.js'; +import { IModelContentChange } from '../../../common/textModelEvents.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +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'; +import { canASAR } from '../../../../base/common/amd.js'; +import { CancellationError, isCancellationError } from '../../../../base/common/errors.js'; +import { PromiseResult } from '../../../../base/common/observable.js'; + +const EDITOR_TREESITTER_TELEMETRY = 'editor.experimental.treeSitterTelemetry'; +const MODULE_LOCATION_SUBPATH = `@vscode/tree-sitter-wasm/wasm`; +const FILENAME_TREESITTER_WASM = `tree-sitter.wasm`; + +function getModuleLocation(environmentService: IEnvironmentService): AppResourcePath { + return `${(canASAR && environmentService.isBuilt) ? nodeModulesAsarUnpackedPath : nodeModulesPath}/${MODULE_LOCATION_SUBPATH}`; +} + +export class TextModelTreeSitter extends Disposable { + private _parseResult: TreeSitterParseResult | undefined; + + get parseResult(): ITreeSitterParseResult | undefined { return this._parseResult; } + + constructor(readonly model: ITextModel, + private readonly _treeSitterLanguages: TreeSitterLanguages, + private readonly _treeSitterImporter: TreeSitterImporter, + private readonly _logService: ILogService, + private readonly _telemetryService: ITelemetryService + ) { + super(); + this._register(Event.runAndSubscribe(this.model.onDidChangeLanguage, (e => this._onDidChangeLanguage(e ? e.newLanguage : this.model.getLanguageId())))); + } + + private readonly _languageSessionDisposables = this._register(new DisposableStore()); + /** + * Be very careful when making changes to this method as it is easy to introduce race conditions. + */ + private async _onDidChangeLanguage(languageId: string) { + this._languageSessionDisposables.clear(); + this._parseResult = undefined; + + const token = cancelOnDispose(this._languageSessionDisposables); + let language: Parser.Language | undefined; + try { + language = await this._getLanguage(languageId, token); + } catch (e) { + if (isCancellationError(e)) { + return; + } + throw e; + } + + const Parser = await this._treeSitterImporter.getParserClass(); + if (token.isCancellationRequested) { + return; + } + + const treeSitterTree = this._languageSessionDisposables.add(new TreeSitterParseResult(new Parser(), language, this._logService, this._telemetryService)); + this._languageSessionDisposables.add(this.model.onDidChangeContent(e => this._onDidChangeContent(treeSitterTree, e.changes))); + await this._onDidChangeContent(treeSitterTree, []); + if (token.isCancellationRequested) { + return; + } + + this._parseResult = treeSitterTree; + } + + private _getLanguage(languageId: string, token: CancellationToken): Promise { + const language = this._treeSitterLanguages.getOrInitLanguage(languageId); + if (language) { + return Promise.resolve(language); + } + const disposables: IDisposable[] = []; + + return new Promise((resolve, reject) => { + disposables.push(this._treeSitterLanguages.onDidAddLanguage(e => { + if (e.id === languageId) { + dispose(disposables); + resolve(e.language); + } + })); + token.onCancellationRequested(() => { + dispose(disposables); + reject(new CancellationError()); + }, undefined, disposables); + }); + } + + private async _onDidChangeContent(treeSitterTree: TreeSitterParseResult, changes: IModelContentChange[]) { + return treeSitterTree.onDidChangeContent(this.model, changes); + } +} + +const enum TelemetryParseType { + Full = 'fullParse', + Incremental = 'incrementalParse' +} + +export class TreeSitterParseResult implements IDisposable, ITreeSitterParseResult { + private _tree: Parser.Tree | undefined; + private _isDisposed: boolean = false; + constructor(public readonly parser: Parser, + public /** exposed for tests **/ readonly language: Parser.Language, + private readonly _logService: ILogService, + private readonly _telemetryService: ITelemetryService) { + this.parser.setTimeoutMicros(50 * 1000); // 50 ms + this.parser.setLanguage(language); + } + dispose(): void { + this._isDisposed = true; + this._tree?.delete(); + this.parser?.delete(); + } + get tree() { return this._tree; } + private set tree(newTree: Parser.Tree | undefined) { + this._tree?.delete(); + this._tree = newTree; + } + get isDisposed() { return this._isDisposed; } + + private _onDidChangeContentQueue: Promise = Promise.resolve(); + public async onDidChangeContent(model: ITextModel, changes: IModelContentChange[]) { + this._applyEdits(model, changes); + this._onDidChangeContentQueue = this._onDidChangeContentQueue.then(() => { + if (this.isDisposed) { + // No need to continue the queue if we are disposed + return; + } + return this._parseAndUpdateTree(model); + }).catch((e) => { + this._logService.error('Error parsing tree-sitter tree', e); + }); + return this._onDidChangeContentQueue; + } + + private _newEdits = true; + private _applyEdits(model: ITextModel, changes: IModelContentChange[]) { + for (const change of changes) { + const newEndOffset = change.rangeOffset + change.text.length; + const newEndPosition = model.getPositionAt(newEndOffset); + + this.tree?.edit({ + startIndex: change.rangeOffset, + oldEndIndex: change.rangeOffset + change.rangeLength, + newEndIndex: change.rangeOffset + change.text.length, + startPosition: { row: change.range.startLineNumber - 1, column: change.range.startColumn - 1 }, + oldEndPosition: { row: change.range.endLineNumber - 1, column: change.range.endColumn - 1 }, + newEndPosition: { row: newEndPosition.lineNumber - 1, column: newEndPosition.column - 1 } + }); + this._newEdits = true; + } + } + + private async _parseAndUpdateTree(model: ITextModel) { + const tree = await this._parse(model); + if (!this._newEdits) { + this.tree = tree; + } + } + + private _parse(model: ITextModel): Promise { + let parseType: TelemetryParseType = TelemetryParseType.Full; + if (this.tree) { + parseType = TelemetryParseType.Incremental; + } + return this._parseAndYield(model, parseType); + } + + private async _parseAndYield(model: ITextModel, parseType: TelemetryParseType): Promise { + const language = model.getLanguageId(); + let tree: Parser.Tree | undefined; + let time: number = 0; + let passes: number = 0; + this._newEdits = false; + do { + const timer = performance.now(); + try { + tree = this.parser.parse((index: number, position?: Parser.Point) => this._parseCallback(model, index), this.tree); + } catch (e) { + // parsing can fail when the timeout is reached, will resume upon next loop + } finally { + time += performance.now() - timer; + passes++; + } + + // Even if the model changes and edits are applied, the tree parsing will continue correctly after the await. + await new Promise(resolve => setTimeout0(resolve)); + + if (model.isDisposed() || this.isDisposed) { + return; + } + } while (!tree && !this._newEdits); // exit if there a new edits, as anhy parsing done while there are new edits is throw away work + this.sendParseTimeTelemetry(parseType, language, time, passes); + return tree; + } + + private _parseCallback(textModel: ITextModel, index: number): string | null { + try { + return textModel.getTextBuffer().getNearestChunk(index); + } catch (e) { + this._logService.debug('Error getting chunk for tree-sitter parsing', e); + } + return null; + } + + private sendParseTimeTelemetry(parseType: TelemetryParseType, languageId: string, time: number, passes: number): void { + this._logService.debug(`Tree parsing (${parseType}) took ${time} ms and ${passes} passes.`); + type ParseTimeClassification = { + owner: 'alros'; + comment: 'Used to understand how long it takes to parse a tree-sitter tree'; + languageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The programming language ID.' }; + time: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'The ms it took to parse' }; + passes: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'The number of passes it took to parse' }; + }; + if (parseType === TelemetryParseType.Full) { + this._telemetryService.publicLog2<{ languageId: string; time: number; passes: number }, ParseTimeClassification>(`treeSitter.fullParse`, { languageId, time, passes }); + } else { + this._telemetryService.publicLog2<{ languageId: string; time: number; passes: number }, ParseTimeClassification>(`treeSitter.incrementalParse`, { languageId, time, passes }); + } + } +} + +export class TreeSitterLanguages extends Disposable { + private _languages: AsyncCache = new AsyncCache(); + public /*exposed for tests*/ readonly _onDidAddLanguage: Emitter<{ id: string; language: Parser.Language }> = this._register(new Emitter()); + /** + * If you're looking for a specific language, make sure to check if it already exists with `getLanguage` as it will kick off the process to add it if it doesn't exist. + */ + public readonly onDidAddLanguage: Event<{ id: string; language: Parser.Language }> = this._onDidAddLanguage.event; + + constructor(private readonly _treeSitterImporter: TreeSitterImporter, + private readonly _fileService: IFileService, + private readonly _environmentService: IEnvironmentService, + private readonly _registeredLanguages: Map, + ) { + super(); + } + + public getOrInitLanguage(languageId: string): Parser.Language | undefined { + if (this._languages.isCached(languageId)) { + return this._languages.getSyncIfCached(languageId); + } else { + // kick off adding the language, but don't wait + this._addLanguage(languageId); + return undefined; + } + } + + private async _addLanguage(languageId: string): Promise { + const languagePromise = this._languages.get(languageId); + if (!languagePromise) { + this._languages.set(languageId, this._fetchLanguage(languageId)); + const language = await this._languages.get(languageId); + if (!language) { + return undefined; + } + this._onDidAddLanguage.fire({ id: languageId, language }); + } + } + + private async _fetchLanguage(languageId: string): Promise { + const grammarName = this._registeredLanguages.get(languageId); + const languageLocation = this._getLanguageLocation(languageId); + if (!grammarName || !languageLocation) { + return undefined; + } + const wasmPath: AppResourcePath = `${languageLocation}/${grammarName}.wasm`; + const languageFile = await (this._fileService.readFile(FileAccess.asFileUri(wasmPath))); + const Parser = await this._treeSitterImporter.getParserClass(); + return Parser.Language.load(languageFile.value.buffer); + } + + private _getLanguageLocation(languageId: string): AppResourcePath | undefined { + const grammarName = this._registeredLanguages.get(languageId); + if (!grammarName) { + return undefined; + } + return getModuleLocation(this._environmentService); + } +} + +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'); + } + return this._treeSitterImport; + } + + private _parserClass: typeof Parser | undefined; + public async getParserClass() { + if (!this._parserClass) { + this._parserClass = (await this._getTreeSitterImport()).Parser; + } + return this._parserClass; + } +} + +export class TreeSitterTextModelService extends Disposable implements ITreeSitterParserService { + readonly _serviceBrand: undefined; + private _init!: Promise; + private _textModelTreeSitters: DisposableMap = this._register(new DisposableMap()); + private readonly _registeredLanguages: Map = new Map(); + private readonly _treeSitterImporter: TreeSitterImporter = new TreeSitterImporter(); + private readonly _treeSitterLanguages: TreeSitterLanguages; + + public readonly onDidAddLanguage: Event<{ id: string; language: Parser.Language }>; + + constructor(@IModelService private readonly _modelService: IModelService, + @IFileService fileService: IFileService, + @ITelemetryService private readonly _telemetryService: ITelemetryService, + @ILogService private readonly _logService: ILogService, + @IConfigurationService private readonly _configurationService: IConfigurationService, + @IEnvironmentService private readonly _environmentService: IEnvironmentService + ) { + super(); + this._treeSitterLanguages = this._register(new TreeSitterLanguages(this._treeSitterImporter, fileService, this._environmentService, this._registeredLanguages)); + this.onDidAddLanguage = this._treeSitterLanguages.onDidAddLanguage; + this._register(this._configurationService.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(EDITOR_EXPERIMENTAL_PREFER_TREESITTER)) { + this._supportedLanguagesChanged(); + } + })); + this._supportedLanguagesChanged(); + } + + getOrInitLanguage(languageId: string): Parser.Language | undefined { + return this._treeSitterLanguages.getOrInitLanguage(languageId); + } + + getParseResult(textModel: ITextModel): ITreeSitterParseResult | undefined { + const textModelTreeSitter = this._textModelTreeSitters.get(textModel); + return textModelTreeSitter?.parseResult; + } + + private async _doInitParser() { + const Parser = await this._treeSitterImporter.getParserClass(); + const environmentService = this._environmentService; + await Parser.init({ + locateFile(_file: string, _folder: string) { + return FileAccess.asBrowserUri(`${getModuleLocation(environmentService)}/${FILENAME_TREESITTER_WASM}`).toString(true); + } + }); + return true; + } + + private _hasInit: boolean = false; + private async _initParser(hasLanguages: boolean): Promise { + if (this._hasInit) { + return this._init; + } + + if (hasLanguages) { + this._hasInit = true; + this._init = this._doInitParser(); + + // New init, we need to deal with all the existing text models and set up listeners + this._init.then(() => this._registerModelServiceListeners()); + } else { + this._init = Promise.resolve(false); + } + return this._init; + } + + private async _supportedLanguagesChanged() { + const setting = this._getSetting(); + + let hasLanguages = true; + if (setting.length === 0) { + hasLanguages = false; + } + + if (await this._initParser(hasLanguages)) { + // Eventually, this should actually use an extension point to add tree sitter grammars, but for now they are hard coded in core + if (setting.includes('typescript')) { + this._addGrammar('typescript', 'tree-sitter-typescript'); + } else { + this._removeGrammar('typescript'); + } + } + } + + private _getSetting(): string[] { + const setting = this._configurationService.getValue(EDITOR_EXPERIMENTAL_PREFER_TREESITTER); + if (setting && setting.length > 0) { + return setting; + } else { + const expSetting = this._configurationService.getValue(EDITOR_TREESITTER_TELEMETRY); + if (expSetting) { + return ['typescript']; + } + } + return []; + } + + private async _registerModelServiceListeners() { + this._register(this._modelService.onModelAdded(model => { + this._createTextModelTreeSitter(model); + })); + this._register(this._modelService.onModelRemoved(model => { + this._textModelTreeSitters.deleteAndDispose(model); + })); + this._modelService.getModels().forEach(model => this._createTextModelTreeSitter(model)); + } + + private _createTextModelTreeSitter(model: ITextModel) { + const textModelTreeSitter = new TextModelTreeSitter(model, this._treeSitterLanguages, this._treeSitterImporter, this._logService, this._telemetryService); + this._textModelTreeSitters.set(model, textModelTreeSitter); + } + + private _addGrammar(languageId: string, grammarName: string) { + if (!this._registeredLanguages.has(languageId)) { + this._registeredLanguages.set(languageId, grammarName); + } + } + + private _removeGrammar(languageId: string) { + if (this._registeredLanguages.has(languageId)) { + this._registeredLanguages.delete('typescript'); + } + } +} + +class PromiseWithSyncAccess { + private _result: PromiseResult | undefined; + /** + * Returns undefined if the promise did not resolve yet. + */ + get result(): PromiseResult | undefined { + return this._result; + } + + constructor(public readonly promise: Promise) { + promise.then(result => { + this._result = new PromiseResult(result, undefined); + }).catch(e => { + this._result = new PromiseResult(undefined, e); + }); + } +} + +class AsyncCache { + private readonly _values = new Map>(); + + set(key: TKey, promise: Promise) { + this._values.set(key, new PromiseWithSyncAccess(promise)); + } + + get(key: TKey): Promise | undefined { + return this._values.get(key)?.promise; + } + + getSyncIfCached(key: TKey): T | undefined { + return this._values.get(key)?.result?.data; + } + + isCached(key: TKey): boolean { + return this._values.get(key)?.result !== undefined; + } +} diff --git a/src/vs/editor/browser/stableEditorScroll.ts b/src/vs/editor/browser/stableEditorScroll.ts index 986e18ac6c0..66d4d450e8e 100644 --- a/src/vs/editor/browser/stableEditorScroll.ts +++ b/src/vs/editor/browser/stableEditorScroll.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { ScrollType } from 'vs/editor/common/editorCommon'; +import { ICodeEditor } from './editorBrowser.js'; +import { Position } from '../common/core/position.js'; +import { ScrollType } from '../common/editorCommon.js'; export class StableEditorScrollState { diff --git a/src/vs/editor/browser/view.ts b/src/vs/editor/browser/view.ts index 5558cf28cd4..362331abd14 100644 --- a/src/vs/editor/browser/view.ts +++ b/src/vs/editor/browser/view.ts @@ -3,59 +3,64 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; -import { inputLatency } from 'vs/base/browser/performance'; -import { CodeWindow } from 'vs/base/browser/window'; -import { BugIndicatingError, onUnexpectedError } from 'vs/base/common/errors'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IPointerHandlerHelper } from 'vs/editor/browser/controller/mouseHandler'; -import { PointerHandlerLastRenderData } from 'vs/editor/browser/controller/mouseTarget'; -import { PointerHandler } from 'vs/editor/browser/controller/pointerHandler'; -import { IVisibleRangeProvider, TextAreaHandler } from 'vs/editor/browser/controller/textAreaHandler'; -import { IContentWidget, IContentWidgetPosition, IEditorAriaOptions, IGlyphMarginWidget, IGlyphMarginWidgetPosition, IMouseTarget, IOverlayWidget, IOverlayWidgetPosition, IViewZoneChangeAccessor } from 'vs/editor/browser/editorBrowser'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ICommandDelegate, ViewController } from 'vs/editor/browser/view/viewController'; -import { ContentViewOverlays, MarginViewOverlays } from 'vs/editor/browser/view/viewOverlays'; -import { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart'; -import { ViewUserInputEvents } from 'vs/editor/browser/view/viewUserInputEvents'; -import { BlockDecorations } from 'vs/editor/browser/viewParts/blockDecorations/blockDecorations'; -import { ViewContentWidgets } from 'vs/editor/browser/viewParts/contentWidgets/contentWidgets'; -import { CurrentLineHighlightOverlay, CurrentLineMarginHighlightOverlay } from 'vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight'; -import { DecorationsOverlay } from 'vs/editor/browser/viewParts/decorations/decorations'; -import { EditorScrollbar } from 'vs/editor/browser/viewParts/editorScrollbar/editorScrollbar'; -import { GlyphMarginWidgets } from 'vs/editor/browser/viewParts/glyphMargin/glyphMargin'; -import { IndentGuidesOverlay } from 'vs/editor/browser/viewParts/indentGuides/indentGuides'; -import { LineNumbersOverlay } from 'vs/editor/browser/viewParts/lineNumbers/lineNumbers'; -import { ViewLines } from 'vs/editor/browser/viewParts/lines/viewLines'; -import { LinesDecorationsOverlay } from 'vs/editor/browser/viewParts/linesDecorations/linesDecorations'; -import { Margin } from 'vs/editor/browser/viewParts/margin/margin'; -import { MarginViewLineDecorationsOverlay } from 'vs/editor/browser/viewParts/marginDecorations/marginDecorations'; -import { Minimap } from 'vs/editor/browser/viewParts/minimap/minimap'; -import { ViewOverlayWidgets } from 'vs/editor/browser/viewParts/overlayWidgets/overlayWidgets'; -import { DecorationsOverviewRuler } from 'vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler'; -import { OverviewRuler } from 'vs/editor/browser/viewParts/overviewRuler/overviewRuler'; -import { Rulers } from 'vs/editor/browser/viewParts/rulers/rulers'; -import { ScrollDecorationViewPart } from 'vs/editor/browser/viewParts/scrollDecoration/scrollDecoration'; -import { SelectionsOverlay } from 'vs/editor/browser/viewParts/selections/selections'; -import { ViewCursors } from 'vs/editor/browser/viewParts/viewCursors/viewCursors'; -import { ViewZones } from 'vs/editor/browser/viewParts/viewZones/viewZones'; -import { WhitespaceOverlay } from 'vs/editor/browser/viewParts/whitespace/whitespace'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { GlyphMarginLane, IGlyphMarginLanesModel } from 'vs/editor/common/model'; -import { ViewEventHandler } from 'vs/editor/common/viewEventHandler'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; -import { IViewModel } from 'vs/editor/common/viewModel'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IColorTheme, getThemeTypeSelector } from 'vs/platform/theme/common/themeService'; +import * as dom from '../../base/browser/dom.js'; +import { FastDomNode, createFastDomNode } from '../../base/browser/fastDomNode.js'; +import { IMouseWheelEvent } from '../../base/browser/mouseEvent.js'; +import { inputLatency } from '../../base/browser/performance.js'; +import { CodeWindow } from '../../base/browser/window.js'; +import { BugIndicatingError, onUnexpectedError } from '../../base/common/errors.js'; +import { IDisposable } from '../../base/common/lifecycle.js'; +import { IPointerHandlerHelper } from './controller/mouseHandler.js'; +import { PointerHandlerLastRenderData } from './controller/mouseTarget.js'; +import { PointerHandler } from './controller/pointerHandler.js'; +import { IContentWidget, IContentWidgetPosition, IEditorAriaOptions, IGlyphMarginWidget, IGlyphMarginWidgetPosition, IMouseTarget, IOverlayWidget, IOverlayWidgetPosition, IViewZoneChangeAccessor } from './editorBrowser.js'; +import { LineVisibleRanges, RenderingContext, RestrictedRenderingContext } from './view/renderingContext.js'; +import { ICommandDelegate, ViewController } from './view/viewController.js'; +import { ContentViewOverlays, MarginViewOverlays } from './view/viewOverlays.js'; +import { PartFingerprint, PartFingerprints, ViewPart } from './view/viewPart.js'; +import { ViewUserInputEvents } from './view/viewUserInputEvents.js'; +import { BlockDecorations } from './viewParts/blockDecorations/blockDecorations.js'; +import { ViewContentWidgets } from './viewParts/contentWidgets/contentWidgets.js'; +import { CurrentLineHighlightOverlay, CurrentLineMarginHighlightOverlay } from './viewParts/currentLineHighlight/currentLineHighlight.js'; +import { DecorationsOverlay } from './viewParts/decorations/decorations.js'; +import { EditorScrollbar } from './viewParts/editorScrollbar/editorScrollbar.js'; +import { GlyphMarginWidgets } from './viewParts/glyphMargin/glyphMargin.js'; +import { IndentGuidesOverlay } from './viewParts/indentGuides/indentGuides.js'; +import { LineNumbersOverlay } from './viewParts/lineNumbers/lineNumbers.js'; +import { ViewLines } from './viewParts/viewLines/viewLines.js'; +import { LinesDecorationsOverlay } from './viewParts/linesDecorations/linesDecorations.js'; +import { Margin } from './viewParts/margin/margin.js'; +import { MarginViewLineDecorationsOverlay } from './viewParts/marginDecorations/marginDecorations.js'; +import { Minimap } from './viewParts/minimap/minimap.js'; +import { ViewOverlayWidgets } from './viewParts/overlayWidgets/overlayWidgets.js'; +import { DecorationsOverviewRuler } from './viewParts/overviewRuler/decorationsOverviewRuler.js'; +import { OverviewRuler } from './viewParts/overviewRuler/overviewRuler.js'; +import { Rulers } from './viewParts/rulers/rulers.js'; +import { ScrollDecorationViewPart } from './viewParts/scrollDecoration/scrollDecoration.js'; +import { SelectionsOverlay } from './viewParts/selections/selections.js'; +import { ViewCursors } from './viewParts/viewCursors/viewCursors.js'; +import { ViewZones } from './viewParts/viewZones/viewZones.js'; +import { WhitespaceOverlay } from './viewParts/whitespace/whitespace.js'; +import { IEditorConfiguration } from '../common/config/editorConfiguration.js'; +import { EditorOption } from '../common/config/editorOptions.js'; +import { Position } from '../common/core/position.js'; +import { Range } from '../common/core/range.js'; +import { Selection } from '../common/core/selection.js'; +import { ScrollType } from '../common/editorCommon.js'; +import { GlyphMarginLane, IGlyphMarginLanesModel } from '../common/model.js'; +import { ViewEventHandler } from '../common/viewEventHandler.js'; +import * as viewEvents from '../common/viewEvents.js'; +import { ViewportData } from '../common/viewLayout/viewLinesViewportData.js'; +import { IViewModel } from '../common/viewModel.js'; +import { ViewContext } from '../common/viewModel/viewContext.js'; +import { IInstantiationService } from '../../platform/instantiation/common/instantiation.js'; +import { IColorTheme, getThemeTypeSelector } from '../../platform/theme/common/themeService.js'; +import { ViewGpuContext } from './gpu/viewGpuContext.js'; +import { ViewLinesGpu } from './viewParts/viewLinesGpu/viewLinesGpu.js'; +import { AbstractEditContext } from './controller/editContext/editContextUtils.js'; +import { IVisibleRangeProvider, TextAreaEditContext } from './controller/editContext/textArea/textAreaEditContext.js'; +import { NativeEditContext } from './controller/editContext/native/nativeEditContext.js'; +import { RulersGpu } from './viewParts/rulersGpu/rulersGpu.js'; export interface IContentWidgetData { @@ -77,10 +82,12 @@ export class View extends ViewEventHandler { private readonly _scrollbar: EditorScrollbar; private readonly _context: ViewContext; + private readonly _viewGpuContext?: ViewGpuContext; private _selections: Selection[]; // The view lines private readonly _viewLines: ViewLines; + private readonly _viewLinesGpu?: ViewLinesGpu; // These are parts, but we must do some API related calls on them, so we keep a reference private readonly _viewZones: ViewZones; @@ -89,8 +96,10 @@ export class View extends ViewEventHandler { private readonly _glyphMarginWidgets: GlyphMarginWidgets; private readonly _viewCursors: ViewCursors; private readonly _viewParts: ViewPart[]; + private readonly _viewController: ViewController; - private readonly _textAreaHandler: TextAreaHandler; + private _experimentalEditContextEnabled: boolean; + private _editContext: AbstractEditContext; private readonly _pointerHandler: PointerHandler; // Dom nodes @@ -115,7 +124,7 @@ export class View extends ViewEventHandler { this._selections = [new Selection(1, 1, 1, 1)]; this._renderAnimationFrame = null; - const viewController = new ViewController(configuration, model, userInputEvents, commandDelegate); + this._viewController = new ViewController(configuration, model, userInputEvents, commandDelegate); // The view context is passed on to most classes (basically to reduce param. counts in ctors) this._context = new ViewContext(configuration, colorTheme, model); @@ -126,8 +135,10 @@ export class View extends ViewEventHandler { this._viewParts = []; // Keyboard handler - this._textAreaHandler = this._instantiationService.createInstance(TextAreaHandler, this._context, viewController, this._createTextAreaHandlerHelper()); - this._viewParts.push(this._textAreaHandler); + this._experimentalEditContextEnabled = this._context.configuration.options.get(EditorOption.experimentalEditContextEnabled); + this._editContext = this._instantiateEditContext(this._experimentalEditContextEnabled); + + this._viewParts.push(this._editContext); // These two dom nodes must be constructed up front, since references are needed in the layout provider (scrolling & co.) this._linesContent = createFastDomNode(document.createElement('div')); @@ -139,6 +150,10 @@ export class View extends ViewEventHandler { // Set role 'code' for better screen reader support https://github.com/microsoft/vscode/issues/93438 this.domNode.setAttribute('role', 'code'); + if (this._context.configuration.options.get(EditorOption.experimentalGpuAcceleration) === 'on') { + this._viewGpuContext = this._instantiationService.createInstance(ViewGpuContext, this._context); + } + this._overflowGuardContainer = createFastDomNode(document.createElement('div')); PartFingerprints.write(this._overflowGuardContainer, PartFingerprint.OverflowGuard); this._overflowGuardContainer.setClassName('overflow-guard'); @@ -148,6 +163,9 @@ export class View extends ViewEventHandler { // View Lines this._viewLines = new ViewLines(this._context, this._linesContent); + if (this._viewGpuContext) { + this._viewLinesGpu = this._instantiationService.createInstance(ViewLinesGpu, this._context, this._viewGpuContext); + } // View Zones this._viewZones = new ViewZones(this._context); @@ -197,7 +215,9 @@ export class View extends ViewEventHandler { this._overlayWidgets = new ViewOverlayWidgets(this._context, this.domNode); this._viewParts.push(this._overlayWidgets); - const rulers = new Rulers(this._context); + const rulers = this._viewGpuContext + ? new RulersGpu(this._context, this._viewGpuContext) + : new Rulers(this._context); this._viewParts.push(rulers); const blockOutline = new BlockDecorations(this._context); @@ -214,16 +234,20 @@ export class View extends ViewEventHandler { } this._linesContent.appendChild(contentViewOverlays.getDomNode()); - this._linesContent.appendChild(rulers.domNode); + if ('domNode' in rulers) { + this._linesContent.appendChild(rulers.domNode); + } this._linesContent.appendChild(this._viewZones.domNode); this._linesContent.appendChild(this._viewLines.getDomNode()); this._linesContent.appendChild(this._contentWidgets.domNode); this._linesContent.appendChild(this._viewCursors.getDomNode()); this._overflowGuardContainer.appendChild(margin.getDomNode()); this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()); + if (this._viewGpuContext) { + this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas); + } this._overflowGuardContainer.appendChild(scrollDecoration.getDomNode()); - this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea); - this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover); + this._editContext.appendTo(this._overflowGuardContainer); this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()); this._overflowGuardContainer.appendChild(minimap.getDomNode()); this._overflowGuardContainer.appendChild(blockOutline.domNode); @@ -240,7 +264,27 @@ export class View extends ViewEventHandler { this._applyLayout(); // Pointer handler - this._pointerHandler = this._register(new PointerHandler(this._context, viewController, this._createPointerHandlerHelper())); + this._pointerHandler = this._register(new PointerHandler(this._context, this._viewController, this._createPointerHandlerHelper())); + } + + private _instantiateEditContext(experimentalEditContextEnabled: boolean): AbstractEditContext { + return this._instantiationService.createInstance(experimentalEditContextEnabled ? NativeEditContext : TextAreaEditContext, this._context, this._viewController, this._createTextAreaHandlerHelper()); + } + + private _updateEditContext(): void { + const experimentalEditContextEnabled = this._context.configuration.options.get(EditorOption.experimentalEditContextEnabled); + if (this._experimentalEditContextEnabled === experimentalEditContextEnabled) { + return; + } + this._experimentalEditContextEnabled = experimentalEditContextEnabled; + this._editContext.dispose(); + this._editContext = this._instantiateEditContext(experimentalEditContextEnabled); + this._editContext.appendTo(this._overflowGuardContainer); + // Replace the view parts with the new edit context + const indexOfEditContextHandler = this._viewParts.indexOf(this._editContext); + if (indexOfEditContextHandler !== -1) { + this._viewParts.splice(indexOfEditContextHandler, 1, this._editContext); + } } private _computeGlyphMarginLanes(): IGlyphMarginLanesModel { @@ -286,12 +330,12 @@ export class View extends ViewEventHandler { }, dispatchTextAreaEvent: (event: CustomEvent) => { - this._textAreaHandler.textArea.domNode.dispatchEvent(event); + this._editContext.domNode.domNode.dispatchEvent(event); }, getLastRenderData: (): PointerHandlerLastRenderData => { const lastViewCursorsRenderData = this._viewCursors.getLastRenderData() || []; - const lastTextareaPosition = this._textAreaHandler.getLastRenderData(); + const lastTextareaPosition = this._editContext.getLastRenderData(); return new PointerHandlerLastRenderData(lastViewCursorsRenderData, lastTextareaPosition); }, renderNow: (): void => { @@ -325,6 +369,10 @@ export class View extends ViewEventHandler { visibleRangeForPosition: (position: Position) => { this._flushAccumulatedAndRenderNow(); return this._viewLines.visibleRangeForPosition(position); + }, + linesVisibleRangesForRange: (range: Range, includeNewLines: boolean): LineVisibleRanges[] | null => { + this._flushAccumulatedAndRenderNow(); + return this._viewLines.linesVisibleRangesForRange(range, includeNewLines); } }; } @@ -345,7 +393,7 @@ export class View extends ViewEventHandler { } private _getEditorClassName() { - const focused = this._textAreaHandler.isFocused() ? ' focused' : ''; + const focused = this._editContext.isFocused() ? ' focused' : ''; return this._context.configuration.options.get(EditorOption.editorClassName) + ' ' + getThemeTypeSelector(this._context.theme.type) + focused; } @@ -356,6 +404,7 @@ export class View extends ViewEventHandler { } public override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { this.domNode.setClassName(this._getEditorClassName()); + this._updateEditContext(); this._applyLayout(); return false; } @@ -390,8 +439,10 @@ export class View extends ViewEventHandler { this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(); this._context.removeEventHandler(this); + this._viewGpuContext?.dispose(); this._viewLines.dispose(); + this._viewLinesGpu?.dispose(); // Destroy view parts for (const viewPart of this._viewParts) { @@ -408,7 +459,7 @@ export class View extends ViewEventHandler { if (this._renderAnimationFrame === null) { const rendering = this._createCoordinatedRendering(); this._renderAnimationFrame = EditorRenderingCoordinator.INSTANCE.scheduleCoordinatedRendering({ - window: dom.getWindow(this.domNode.domNode), + window: dom.getWindow(this.domNode?.domNode), prepareRenderText: () => { if (this._store.isDisposed) { throw new BugIndicatingError(); @@ -505,6 +556,11 @@ export class View extends ViewEventHandler { viewPartsToRender = this._getViewPartsToRender(); } + if (this._viewLinesGpu?.shouldRender()) { + this._viewLinesGpu.renderText(viewportData); + this._viewLinesGpu.onDidRender(); + } + return [viewPartsToRender, new RenderingContext(this._context.viewLayout, viewportData, this._viewLines)]; }, prepareRender: (viewPartsToRender: ViewPart[], ctx: RenderingContext) => { @@ -586,23 +642,23 @@ export class View extends ViewEventHandler { } public writeScreenReaderContent(reason: string): void { - this._textAreaHandler.writeScreenReaderContent(reason); + this._editContext.writeScreenReaderContent(reason); } public focus(): void { - this._textAreaHandler.focusTextArea(); + this._editContext.focus(); } public isFocused(): boolean { - return this._textAreaHandler.isFocused(); + return this._editContext.isFocused(); } public refreshFocusState() { - this._textAreaHandler.refreshFocusState(); + this._editContext.refreshFocusState(); } public setAriaOptions(options: IEditorAriaOptions): void { - this._textAreaHandler.setAriaOptions(options); + this._editContext.setAriaOptions(options); } public addContentWidget(widgetData: IContentWidgetData): void { diff --git a/src/vs/editor/browser/view/domLineBreaksComputer.ts b/src/vs/editor/browser/view/domLineBreaksComputer.ts index 2861fd8f82a..583d7f9cfa0 100644 --- a/src/vs/editor/browser/view/domLineBreaksComputer.ts +++ b/src/vs/editor/browser/view/domLineBreaksComputer.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createTrustedTypesPolicy } from 'vs/base/browser/trustedTypes'; -import { CharCode } from 'vs/base/common/charCode'; -import * as strings from 'vs/base/common/strings'; -import { assertIsDefined } from 'vs/base/common/types'; -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { WrappingIndent } from 'vs/editor/common/config/editorOptions'; -import { FontInfo } from 'vs/editor/common/config/fontInfo'; -import { StringBuilder } from 'vs/editor/common/core/stringBuilder'; -import { InjectedTextOptions } from 'vs/editor/common/model'; -import { ILineBreaksComputer, ILineBreaksComputerFactory, ModelLineProjectionData } from 'vs/editor/common/modelLineProjectionData'; -import { LineInjectedText } from 'vs/editor/common/textModelEvents'; +import { createTrustedTypesPolicy } from '../../../base/browser/trustedTypes.js'; +import { CharCode } from '../../../base/common/charCode.js'; +import * as strings from '../../../base/common/strings.js'; +import { assertIsDefined } from '../../../base/common/types.js'; +import { applyFontInfo } from '../config/domFontInfo.js'; +import { WrappingIndent } from '../../common/config/editorOptions.js'; +import { FontInfo } from '../../common/config/fontInfo.js'; +import { StringBuilder } from '../../common/core/stringBuilder.js'; +import { InjectedTextOptions } from '../../common/model.js'; +import { ILineBreaksComputer, ILineBreaksComputerFactory, ModelLineProjectionData } from '../../common/modelLineProjectionData.js'; +import { LineInjectedText } from '../../common/textModelEvents.js'; const ttPolicy = createTrustedTypesPolicy('domLineBreaksComputer', { createHTML: value => value }); diff --git a/src/vs/editor/browser/view/dynamicViewOverlay.ts b/src/vs/editor/browser/view/dynamicViewOverlay.ts index c8de7098816..048e76445fb 100644 --- a/src/vs/editor/browser/view/dynamicViewOverlay.ts +++ b/src/vs/editor/browser/view/dynamicViewOverlay.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewEventHandler } from 'vs/editor/common/viewEventHandler'; +import { RenderingContext } from './renderingContext.js'; +import { ViewEventHandler } from '../../common/viewEventHandler.js'; export abstract class DynamicViewOverlay extends ViewEventHandler { diff --git a/src/vs/editor/browser/view/renderingContext.ts b/src/vs/editor/browser/view/renderingContext.ts index 3396fb74b78..f0e601adeae 100644 --- a/src/vs/editor/browser/view/renderingContext.ts +++ b/src/vs/editor/browser/view/renderingContext.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; -import { IViewLayout, ViewModelDecoration } from 'vs/editor/common/viewModel'; +import { Position } from '../../common/core/position.js'; +import { Range } from '../../common/core/range.js'; +import { ViewportData } from '../../common/viewLayout/viewLinesViewportData.js'; +import { IViewLayout, ViewModelDecoration } from '../../common/viewModel.js'; export interface IViewLines { linesVisibleRangesForRange(range: Range, includeNewLines: boolean): LineVisibleRanges[] | null; diff --git a/src/vs/editor/browser/view/viewController.ts b/src/vs/editor/browser/view/viewController.ts index b6b8ebdd698..5e53d12d2e4 100644 --- a/src/vs/editor/browser/view/viewController.ts +++ b/src/vs/editor/browser/view/viewController.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { CoreNavigationCommands, NavigationCommandRevealType } from 'vs/editor/browser/coreCommands'; -import { IEditorMouseEvent, IPartialEditorMouseEvent } from 'vs/editor/browser/editorBrowser'; -import { ViewUserInputEvents } from 'vs/editor/browser/view/viewUserInputEvents'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { IViewModel } from 'vs/editor/common/viewModel'; -import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import * as platform from 'vs/base/common/platform'; +import { IKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { CoreNavigationCommands, NavigationCommandRevealType } from '../coreCommands.js'; +import { IEditorMouseEvent, IPartialEditorMouseEvent } from '../editorBrowser.js'; +import { ViewUserInputEvents } from './viewUserInputEvents.js'; +import { Position } from '../../common/core/position.js'; +import { Selection } from '../../common/core/selection.js'; +import { IEditorConfiguration } from '../../common/config/editorConfiguration.js'; +import { IViewModel } from '../../common/viewModel.js'; +import { IMouseWheelEvent } from '../../../base/browser/mouseEvent.js'; +import { EditorOption } from '../../common/config/editorOptions.js'; +import * as platform from '../../../base/common/platform.js'; export interface IMouseDispatchData { position: Position; diff --git a/src/vs/editor/browser/view/viewLayer.ts b/src/vs/editor/browser/view/viewLayer.ts index 971d8ae4011..7162a1bb939 100644 --- a/src/vs/editor/browser/view/viewLayer.ts +++ b/src/vs/editor/browser/view/viewLayer.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { createTrustedTypesPolicy } from 'vs/base/browser/trustedTypes'; -import { BugIndicatingError } from 'vs/base/common/errors'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { StringBuilder } from 'vs/editor/common/core/stringBuilder'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; +import { FastDomNode, createFastDomNode } from '../../../base/browser/fastDomNode.js'; +import { createTrustedTypesPolicy } from '../../../base/browser/trustedTypes.js'; +import { BugIndicatingError } from '../../../base/common/errors.js'; +import { EditorOption } from '../../common/config/editorOptions.js'; +import { StringBuilder } from '../../common/core/stringBuilder.js'; +import * as viewEvents from '../../common/viewEvents.js'; +import { ViewportData } from '../../common/viewLayout/viewLinesViewportData.js'; /** * Represents a visible line @@ -35,13 +35,17 @@ export interface ILine { onTokensChanged(): void; } +export interface ILineFactory { + createLine(): T; +} + export class RenderedLinesCollection { - private readonly _createLine: () => T; private _lines!: T[]; private _rendLineNumberStart!: number; - constructor(createLine: () => T) { - this._createLine = createLine; + constructor( + private readonly _lineFactory: ILineFactory, + ) { this._set(1, []); } @@ -201,7 +205,7 @@ export class RenderedLinesCollection { // insert inside the viewport, push out some lines, but not all remaining lines const newLines: T[] = []; for (let i = 0; i < insertCnt; i++) { - newLines[i] = this._createLine(); + newLines[i] = this._lineFactory.createLine(); } const insertIndex = insertFromLineNumber - this._rendLineNumberStart; const beforeLines = this._lines.slice(0, insertIndex); @@ -245,20 +249,14 @@ export class RenderedLinesCollection { } } -export interface IVisibleLinesHost { - createVisibleLine(): T; -} - export class VisibleLinesCollection { - private readonly _host: IVisibleLinesHost; - public readonly domNode: FastDomNode; - private readonly _linesCollection: RenderedLinesCollection; + public readonly domNode: FastDomNode = this._createDomNode(); + private readonly _linesCollection: RenderedLinesCollection = new RenderedLinesCollection(this._lineFactory); - constructor(host: IVisibleLinesHost) { - this._host = host; - this.domNode = this._createDomNode(); - this._linesCollection = new RenderedLinesCollection(() => this._host.createVisibleLine()); + constructor( + private readonly _lineFactory: ILineFactory + ) { } private _createDomNode(): FastDomNode { @@ -345,7 +343,7 @@ export class VisibleLinesCollection { const inp = this._linesCollection._get(); - const renderer = new ViewLayerRenderer(this.domNode.domNode, this._host, viewportData); + const renderer = new ViewLayerRenderer(this.domNode.domNode, this._lineFactory, viewportData); const ctx: IRendererContext = { rendLineNumberStart: inp.rendLineNumberStart, @@ -370,14 +368,11 @@ class ViewLayerRenderer { private static _ttPolicy = createTrustedTypesPolicy('editorViewLayer', { createHTML: value => value }); - readonly domNode: HTMLElement; - readonly host: IVisibleLinesHost; - readonly viewportData: ViewportData; - - constructor(domNode: HTMLElement, host: IVisibleLinesHost, viewportData: ViewportData) { - this.domNode = domNode; - this.host = host; - this.viewportData = viewportData; + constructor( + private readonly _domNode: HTMLElement, + private readonly _lineFactory: ILineFactory, + private readonly _viewportData: ViewportData, + ) { } public render(inContext: IRendererContext, startLineNumber: number, stopLineNumber: number, deltaTop: number[]): IRendererContext { @@ -394,7 +389,7 @@ class ViewLayerRenderer { ctx.linesLength = stopLineNumber - startLineNumber + 1; ctx.lines = []; for (let x = startLineNumber; x <= stopLineNumber; x++) { - ctx.lines[x - startLineNumber] = this.host.createVisibleLine(); + ctx.lines[x - startLineNumber] = this._lineFactory.createLine(); } this._finishRendering(ctx, true, deltaTop); return ctx; @@ -461,7 +456,7 @@ class ViewLayerRenderer { for (let i = startIndex; i <= endIndex; i++) { const lineNumber = rendLineNumberStart + i; - lines[i].layoutLine(lineNumber, deltaTop[lineNumber - deltaLN], this.viewportData.lineHeight); + lines[i].layoutLine(lineNumber, deltaTop[lineNumber - deltaLN], this._viewportData.lineHeight); } } @@ -469,7 +464,7 @@ class ViewLayerRenderer { const newLines: T[] = []; let newLinesLen = 0; for (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) { - newLines[newLinesLen++] = this.host.createVisibleLine(); + newLines[newLinesLen++] = this._lineFactory.createLine(); } ctx.lines = newLines.concat(ctx.lines); } @@ -486,7 +481,7 @@ class ViewLayerRenderer { const newLines: T[] = []; let newLinesLen = 0; for (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) { - newLines[newLinesLen++] = this.host.createVisibleLine(); + newLines[newLinesLen++] = this._lineFactory.createLine(); } ctx.lines = ctx.lines.concat(newLines); } @@ -505,14 +500,14 @@ class ViewLayerRenderer { if (ViewLayerRenderer._ttPolicy) { newLinesHTML = ViewLayerRenderer._ttPolicy.createHTML(newLinesHTML as string); } - const lastChild = this.domNode.lastChild; + const lastChild = this._domNode.lastChild; if (domNodeIsEmpty || !lastChild) { - this.domNode.innerHTML = newLinesHTML as string; // explains the ugly casts -> https://github.com/microsoft/vscode/issues/106396#issuecomment-692625393; + this._domNode.innerHTML = newLinesHTML as string; // explains the ugly casts -> https://github.com/microsoft/vscode/issues/106396#issuecomment-692625393; } else { lastChild.insertAdjacentHTML('afterend', newLinesHTML as string); } - let currChild = this.domNode.lastChild; + let currChild = this._domNode.lastChild; for (let i = ctx.linesLength - 1; i >= 0; i--) { const line = ctx.lines[i]; if (wasNew[i]) { @@ -565,7 +560,7 @@ class ViewLayerRenderer { continue; } - const renderResult = line.renderLine(i + rendLineNumberStart, deltaTop[i], this.viewportData.lineHeight, this.viewportData, sb); + const renderResult = line.renderLine(i + rendLineNumberStart, deltaTop[i], this._viewportData.lineHeight, this._viewportData, sb); if (!renderResult) { // line does not need rendering continue; @@ -595,7 +590,7 @@ class ViewLayerRenderer { continue; } - const renderResult = line.renderLine(i + rendLineNumberStart, deltaTop[i], this.viewportData.lineHeight, this.viewportData, sb); + const renderResult = line.renderLine(i + rendLineNumberStart, deltaTop[i], this._viewportData.lineHeight, this._viewportData, sb); if (!renderResult) { // line does not need rendering continue; diff --git a/src/vs/editor/browser/view/viewOverlays.ts b/src/vs/editor/browser/view/viewOverlays.ts index 1041fd58a58..6b8e10f341c 100644 --- a/src/vs/editor/browser/view/viewOverlays.ts +++ b/src/vs/editor/browser/view/viewOverlays.ts @@ -3,38 +3,36 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay'; -import { IVisibleLine, IVisibleLinesHost, VisibleLinesCollection } from 'vs/editor/browser/view/viewLayer'; -import { ViewPart } from 'vs/editor/browser/view/viewPart'; -import { StringBuilder } from 'vs/editor/common/core/stringBuilder'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; - -export class ViewOverlays extends ViewPart implements IVisibleLinesHost { - +import { FastDomNode, createFastDomNode } from '../../../base/browser/fastDomNode.js'; +import { applyFontInfo } from '../config/domFontInfo.js'; +import { DynamicViewOverlay } from './dynamicViewOverlay.js'; +import { IVisibleLine, VisibleLinesCollection } from './viewLayer.js'; +import { ViewPart } from './viewPart.js'; +import { StringBuilder } from '../../common/core/stringBuilder.js'; +import { RenderingContext, RestrictedRenderingContext } from './renderingContext.js'; +import { ViewContext } from '../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../common/viewEvents.js'; +import { ViewportData } from '../../common/viewLayout/viewLinesViewportData.js'; +import { EditorOption } from '../../common/config/editorOptions.js'; + +export class ViewOverlays extends ViewPart { private readonly _visibleLines: VisibleLinesCollection; protected readonly domNode: FastDomNode; - private _dynamicOverlays: DynamicViewOverlay[]; - private _isFocused: boolean; + private _dynamicOverlays: DynamicViewOverlay[] = []; + private _isFocused: boolean = false; constructor(context: ViewContext) { super(context); - this._visibleLines = new VisibleLinesCollection(this); + this._visibleLines = new VisibleLinesCollection({ + createLine: () => new ViewOverlayLine(this._dynamicOverlays) + }); this.domNode = this._visibleLines.domNode; const options = this._context.configuration.options; const fontInfo = options.get(EditorOption.fontInfo); applyFontInfo(this.domNode, fontInfo); - this._dynamicOverlays = []; - this._isFocused = false; - this.domNode.setClassName('view-overlays'); } @@ -67,14 +65,6 @@ export class ViewOverlays extends ViewPart implements IVisibleLinesHost { (event: T): void; diff --git a/src/vs/editor/browser/viewParts/blockDecorations/blockDecorations.ts b/src/vs/editor/browser/viewParts/blockDecorations/blockDecorations.ts index 49d18e74873..70fe366c06c 100644 --- a/src/vs/editor/browser/viewParts/blockDecorations/blockDecorations.ts +++ b/src/vs/editor/browser/viewParts/blockDecorations/blockDecorations.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createFastDomNode, FastDomNode } from 'vs/base/browser/fastDomNode'; -import 'vs/css!./blockDecorations'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewPart } from 'vs/editor/browser/view/viewPart'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; +import { createFastDomNode, FastDomNode } from '../../../../base/browser/fastDomNode.js'; +import './blockDecorations.css'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewPart } from '../../view/viewPart.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; export class BlockDecorations extends ViewPart { diff --git a/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts b/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts index bdf8eb77d21..be7bd39b7f9 100644 --- a/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts +++ b/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts @@ -3,20 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { ContentWidgetPositionPreference, IContentWidget } from 'vs/editor/browser/editorBrowser'; -import { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IDimension } from 'vs/editor/common/core/dimension'; -import { PositionAffinity } from 'vs/editor/common/model'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IViewModel } from 'vs/editor/common/viewModel'; - +import * as dom from '../../../../base/browser/dom.js'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { ContentWidgetPositionPreference, IContentWidget } from '../../editorBrowser.js'; +import { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IDimension } from '../../../common/core/dimension.js'; +import { PositionAffinity } from '../../../common/model.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { IViewModel } from '../../../common/viewModel.js'; + +/** + * This view part is responsible for rendering the content widgets, which are + * used for rendering elements that are associated to an editor position, + * such as suggestions or the parameter hints. + */ export class ViewContentWidgets extends ViewPart { private readonly _viewDomNode: FastDomNode; diff --git a/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts b/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts index b35970ee373..8d627025769 100644 --- a/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts +++ b/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./currentLineHighlight'; -import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay'; -import { editorLineHighlight, editorLineHighlightBorder } from 'vs/editor/common/core/editorColorRegistry'; -import { RenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import * as arrays from 'vs/base/common/arrays'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { Selection } from 'vs/editor/common/core/selection'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { isHighContrast } from 'vs/platform/theme/common/theme'; -import { Position } from 'vs/editor/common/core/position'; +import './currentLineHighlight.css'; +import { DynamicViewOverlay } from '../../view/dynamicViewOverlay.js'; +import { editorLineHighlight, editorLineHighlightBorder } from '../../../common/core/editorColorRegistry.js'; +import { RenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import * as arrays from '../../../../base/common/arrays.js'; +import { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { Selection } from '../../../common/core/selection.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { isHighContrast } from '../../../../platform/theme/common/theme.js'; +import { Position } from '../../../common/core/position.js'; export abstract class AbstractLineHighlightOverlay extends DynamicViewOverlay { private readonly _context: ViewContext; @@ -201,6 +201,9 @@ export abstract class AbstractLineHighlightOverlay extends DynamicViewOverlay { protected abstract _renderOne(ctx: RenderingContext, exact: boolean): string; } +/** + * Emphasizes the current line by drawing a border around it. + */ export class CurrentLineHighlightOverlay extends AbstractLineHighlightOverlay { protected _renderOne(ctx: RenderingContext, exact: boolean): string { @@ -215,6 +218,9 @@ export class CurrentLineHighlightOverlay extends AbstractLineHighlightOverlay { } } +/** + * Emphasizes the current line margin/gutter by drawing a border around it. + */ export class CurrentLineMarginHighlightOverlay extends AbstractLineHighlightOverlay { protected _renderOne(ctx: RenderingContext, exact: boolean): string { const className = 'current-line' + (this._shouldRenderInMargin() ? ' current-line-margin' : '') + (this._shouldRenderOther() ? ' current-line-margin-both' : '') + (this._shouldRenderInMargin() && exact ? ' current-line-exact-margin' : ''); diff --git a/src/vs/editor/browser/viewParts/decorations/decorations.ts b/src/vs/editor/browser/viewParts/decorations/decorations.ts index a3baa510464..6ae2287ccfc 100644 --- a/src/vs/editor/browser/viewParts/decorations/decorations.ts +++ b/src/vs/editor/browser/viewParts/decorations/decorations.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./decorations'; -import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay'; -import { HorizontalRange, RenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewModelDecoration } from 'vs/editor/common/viewModel'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; +import './decorations.css'; +import { DynamicViewOverlay } from '../../view/dynamicViewOverlay.js'; +import { HorizontalRange, RenderingContext } from '../../view/renderingContext.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { ViewModelDecoration } from '../../../common/viewModel.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; export class DecorationsOverlay extends DynamicViewOverlay { diff --git a/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts b/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts index 6bd21420b1d..0e0f9413ab0 100644 --- a/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts +++ b/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts @@ -3,19 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { IOverviewRulerLayoutInfo, SmoothScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; -import { ScrollableElementChangeOptions, ScrollableElementCreationOptions } from 'vs/base/browser/ui/scrollbar/scrollableElementOptions'; -import { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart'; -import { INewScrollPosition, ScrollType } from 'vs/editor/common/editorCommon'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { getThemeTypeSelector } from 'vs/platform/theme/common/themeService'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; - +import * as dom from '../../../../base/browser/dom.js'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { IOverviewRulerLayoutInfo, SmoothScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js'; +import { ScrollableElementChangeOptions, ScrollableElementCreationOptions } from '../../../../base/browser/ui/scrollbar/scrollableElementOptions.js'; +import { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js'; +import { INewScrollPosition, ScrollType } from '../../../common/editorCommon.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { getThemeTypeSelector } from '../../../../platform/theme/common/themeService.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IMouseWheelEvent } from '../../../../base/browser/mouseEvent.js'; + +/** + * The editor scrollbar built on VS Code's scrollable element that sits beside + * the minimap. + */ export class EditorScrollbar extends ViewPart { private readonly scrollbar: SmoothScrollableElement; diff --git a/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.ts b/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.ts index 164b2299b75..c1234141862 100644 --- a/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.ts +++ b/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { ArrayQueue } from 'vs/base/common/arrays'; -import 'vs/css!./glyphMargin'; -import { IGlyphMarginWidget, IGlyphMarginWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewPart } from 'vs/editor/browser/view/viewPart'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { GlyphMarginLane } from 'vs/editor/common/model'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { ArrayQueue } from '../../../../base/common/arrays.js'; +import './glyphMargin.css'; +import { IGlyphMarginWidget, IGlyphMarginWidgetPosition } from '../../editorBrowser.js'; +import { DynamicViewOverlay } from '../../view/dynamicViewOverlay.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewPart } from '../../view/viewPart.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { GlyphMarginLane } from '../../../common/model.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; /** * Represents a decoration that should be shown along the lines from `startLineNumber` to `endLineNumber`. diff --git a/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts b/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts index 50b0b2b8661..a140386e6ca 100644 --- a/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts +++ b/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts @@ -3,21 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./indentGuides'; -import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay'; -import { editorBracketHighlightingForeground1, editorBracketHighlightingForeground2, editorBracketHighlightingForeground3, editorBracketHighlightingForeground4, editorBracketHighlightingForeground5, editorBracketHighlightingForeground6, editorBracketPairGuideActiveBackground1, editorBracketPairGuideActiveBackground2, editorBracketPairGuideActiveBackground3, editorBracketPairGuideActiveBackground4, editorBracketPairGuideActiveBackground5, editorBracketPairGuideActiveBackground6, editorBracketPairGuideBackground1, editorBracketPairGuideBackground2, editorBracketPairGuideBackground3, editorBracketPairGuideBackground4, editorBracketPairGuideBackground5, editorBracketPairGuideBackground6, editorIndentGuide1, editorIndentGuide2, editorIndentGuide3, editorIndentGuide4, editorIndentGuide5, editorIndentGuide6, editorActiveIndentGuide1, editorActiveIndentGuide2, editorActiveIndentGuide3, editorActiveIndentGuide4, editorActiveIndentGuide5, editorActiveIndentGuide6 } from 'vs/editor/common/core/editorColorRegistry'; -import { RenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { EditorOption, InternalGuidesOptions } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { ArrayQueue } from 'vs/base/common/arrays'; -import { Color } from 'vs/base/common/color'; -import { isDefined } from 'vs/base/common/types'; -import { BracketPairGuidesClassNames } from 'vs/editor/common/model/guidesTextModelPart'; -import { IndentGuide, HorizontalGuidesState } from 'vs/editor/common/textModelGuides'; - +import './indentGuides.css'; +import { DynamicViewOverlay } from '../../view/dynamicViewOverlay.js'; +import { editorBracketHighlightingForeground1, editorBracketHighlightingForeground2, editorBracketHighlightingForeground3, editorBracketHighlightingForeground4, editorBracketHighlightingForeground5, editorBracketHighlightingForeground6, editorBracketPairGuideActiveBackground1, editorBracketPairGuideActiveBackground2, editorBracketPairGuideActiveBackground3, editorBracketPairGuideActiveBackground4, editorBracketPairGuideActiveBackground5, editorBracketPairGuideActiveBackground6, editorBracketPairGuideBackground1, editorBracketPairGuideBackground2, editorBracketPairGuideBackground3, editorBracketPairGuideBackground4, editorBracketPairGuideBackground5, editorBracketPairGuideBackground6, editorIndentGuide1, editorIndentGuide2, editorIndentGuide3, editorIndentGuide4, editorIndentGuide5, editorIndentGuide6, editorActiveIndentGuide1, editorActiveIndentGuide2, editorActiveIndentGuide3, editorActiveIndentGuide4, editorActiveIndentGuide5, editorActiveIndentGuide6 } from '../../../common/core/editorColorRegistry.js'; +import { RenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { EditorOption, InternalGuidesOptions } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { ArrayQueue } from '../../../../base/common/arrays.js'; +import { Color } from '../../../../base/common/color.js'; +import { isDefined } from '../../../../base/common/types.js'; +import { BracketPairGuidesClassNames } from '../../../common/model/guidesTextModelPart.js'; +import { IndentGuide, HorizontalGuidesState } from '../../../common/textModelGuides.js'; + +/** + * Indent guides are vertical lines that help identify the indentation level of + * the code. + */ export class IndentGuidesOverlay extends DynamicViewOverlay { private readonly _context: ViewContext; diff --git a/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts b/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts index dcebb27994e..ee6461fd7f8 100644 --- a/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts +++ b/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts @@ -3,18 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./lineNumbers'; -import * as platform from 'vs/base/common/platform'; -import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay'; -import { RenderLineNumbersType, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { RenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { editorDimmedLineNumber, editorLineNumbers } from 'vs/editor/common/core/editorColorRegistry'; - +import './lineNumbers.css'; +import * as platform from '../../../../base/common/platform.js'; +import { DynamicViewOverlay } from '../../view/dynamicViewOverlay.js'; +import { RenderLineNumbersType, EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { RenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { editorDimmedLineNumber, editorLineNumbers } from '../../../common/core/editorColorRegistry.js'; + +/** + * Renders line numbers to the left of the main view lines content. + */ export class LineNumbersOverlay extends DynamicViewOverlay { public static readonly CLASS_NAME = 'line-numbers'; diff --git a/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts b/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts index 9bbfeffae57..2c1b1e495f0 100644 --- a/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts +++ b/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./linesDecorations'; -import { DecorationToRender, DedupOverlay } from 'vs/editor/browser/viewParts/glyphMargin/glyphMargin'; -import { RenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; +import './linesDecorations.css'; +import { DecorationToRender, DedupOverlay } from '../glyphMargin/glyphMargin.js'; +import { RenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; export class LinesDecorationsOverlay extends DedupOverlay { diff --git a/src/vs/editor/browser/viewParts/margin/margin.ts b/src/vs/editor/browser/viewParts/margin/margin.ts index 5748c0564dd..cd4660c834d 100644 --- a/src/vs/editor/browser/viewParts/margin/margin.ts +++ b/src/vs/editor/browser/viewParts/margin/margin.ts @@ -3,15 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./margin'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { ViewPart } from 'vs/editor/browser/view/viewPart'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; - - +import './margin.css'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { ViewPart } from '../../view/viewPart.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; + +/** + * Margin is a vertical strip located on the left of the editor's content area. + * It is used for various features such as line numbers, folding markers, and + * decorations that provide additional information about the lines of code. + */ export class Margin extends ViewPart { public static readonly CLASS_NAME = 'glyph-margin'; diff --git a/src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.ts b/src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.ts index f8f879cb50e..7b814dc89a5 100644 --- a/src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.ts +++ b/src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./marginDecorations'; -import { DecorationToRender, DedupOverlay } from 'vs/editor/browser/viewParts/glyphMargin/glyphMargin'; -import { RenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; +import './marginDecorations.css'; +import { DecorationToRender, DedupOverlay } from '../glyphMargin/glyphMargin.js'; +import { RenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; export class MarginViewLineDecorationsOverlay extends DedupOverlay { private readonly _context: ViewContext; diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.ts b/src/vs/editor/browser/viewParts/minimap/minimap.ts index 7b49f5b0dea..a54d780d996 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimap.ts @@ -3,40 +3,40 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./minimap'; -import * as dom from 'vs/base/browser/dom'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { GlobalPointerMoveMonitor } from 'vs/base/browser/globalPointerMoveMonitor'; -import { CharCode } from 'vs/base/common/charCode'; -import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; -import * as platform from 'vs/base/common/platform'; -import * as strings from 'vs/base/common/strings'; -import { ILine, RenderedLinesCollection } from 'vs/editor/browser/view/viewLayer'; -import { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart'; -import { RenderMinimap, EditorOption, MINIMAP_GUTTER_WIDTH, EditorLayoutInfoComputer } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { RGBA8 } from 'vs/editor/common/core/rgba'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { ColorId } from 'vs/editor/common/encodedTokenAttributes'; -import { MinimapCharRenderer } from 'vs/editor/browser/viewParts/minimap/minimapCharRenderer'; -import { Constants } from 'vs/editor/browser/viewParts/minimap/minimapCharSheet'; -import { MinimapTokensColorTracker } from 'vs/editor/common/viewModel/minimapTokensColorTracker'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import { EditorTheme } from 'vs/editor/common/editorTheme'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewLineData, ViewModelDecoration } from 'vs/editor/common/viewModel'; -import { minimapSelection, minimapBackground, minimapForegroundOpacity, editorForeground } from 'vs/platform/theme/common/colorRegistry'; -import { ModelDecorationMinimapOptions } from 'vs/editor/common/model/textModel'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Color } from 'vs/base/common/color'; -import { GestureEvent, EventType, Gesture } from 'vs/base/browser/touch'; -import { MinimapCharRendererFactory } from 'vs/editor/browser/viewParts/minimap/minimapCharRendererFactory'; -import { MinimapPosition, MinimapSectionHeaderStyle, TextModelResolvedOptions } from 'vs/editor/common/model'; -import { createSingleCallFunction } from 'vs/base/common/functional'; -import { LRUCache } from 'vs/base/common/map'; -import { DEFAULT_FONT_FAMILY } from 'vs/base/browser/fonts'; +import './minimap.css'; +import * as dom from '../../../../base/browser/dom.js'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { GlobalPointerMoveMonitor } from '../../../../base/browser/globalPointerMoveMonitor.js'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { IDisposable, Disposable } from '../../../../base/common/lifecycle.js'; +import * as platform from '../../../../base/common/platform.js'; +import * as strings from '../../../../base/common/strings.js'; +import { ILine, RenderedLinesCollection } from '../../view/viewLayer.js'; +import { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js'; +import { RenderMinimap, EditorOption, MINIMAP_GUTTER_WIDTH, EditorLayoutInfoComputer } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { RGBA8 } from '../../../common/core/rgba.js'; +import { ScrollType } from '../../../common/editorCommon.js'; +import { IEditorConfiguration } from '../../../common/config/editorConfiguration.js'; +import { ColorId } from '../../../common/encodedTokenAttributes.js'; +import { MinimapCharRenderer } from './minimapCharRenderer.js'; +import { Constants } from './minimapCharSheet.js'; +import { MinimapTokensColorTracker } from '../../../common/viewModel/minimapTokensColorTracker.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import { EditorTheme } from '../../../common/editorTheme.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { ViewLineData, ViewModelDecoration } from '../../../common/viewModel.js'; +import { minimapSelection, minimapBackground, minimapForegroundOpacity, editorForeground } from '../../../../platform/theme/common/colorRegistry.js'; +import { ModelDecorationMinimapOptions } from '../../../common/model/textModel.js'; +import { Selection } from '../../../common/core/selection.js'; +import { Color } from '../../../../base/common/color.js'; +import { GestureEvent, EventType, Gesture } from '../../../../base/browser/touch.js'; +import { MinimapCharRendererFactory } from './minimapCharRendererFactory.js'; +import { MinimapPosition, MinimapSectionHeaderStyle, TextModelResolvedOptions } from '../../../common/model.js'; +import { createSingleCallFunction } from '../../../../base/common/functional.js'; +import { LRUCache } from '../../../../base/common/map.js'; +import { DEFAULT_FONT_FAMILY } from '../../../../base/browser/fonts.js'; /** * The orthogonal distance to the slider at which dragging "resets". This implements "snapping" @@ -445,9 +445,9 @@ class RenderData { ) { this.renderedLayout = renderedLayout; this._imageData = imageData; - this._renderedLines = new RenderedLinesCollection( - () => MinimapLine.INVALID - ); + this._renderedLines = new RenderedLinesCollection({ + createLine: () => MinimapLine.INVALID + }); this._renderedLines._set(renderedLayout.startLineNumber, lines); } @@ -803,6 +803,10 @@ class MinimapSamplingState { } } +/** + * The minimap appears beside the editor scroll bar and visualizes a zoomed out + * view of the file. + */ export class Minimap extends ViewPart implements IMinimapModel { public readonly tokensColorTracker: MinimapTokensColorTracker; diff --git a/src/vs/editor/browser/viewParts/minimap/minimapCharRenderer.ts b/src/vs/editor/browser/viewParts/minimap/minimapCharRenderer.ts index d9c20582f25..687ab96b521 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimapCharRenderer.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimapCharRenderer.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RGBA8 } from 'vs/editor/common/core/rgba'; -import { Constants, getCharIndex } from './minimapCharSheet'; -import { toUint8 } from 'vs/base/common/uint'; +import { RGBA8 } from '../../../common/core/rgba.js'; +import { Constants, getCharIndex } from './minimapCharSheet.js'; +import { toUint8 } from '../../../../base/common/uint.js'; export class MinimapCharRenderer { _minimapCharRendererBrand: void = undefined; diff --git a/src/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.ts b/src/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.ts index 7b0b9bfcd21..36846f1203b 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MinimapCharRenderer } from 'vs/editor/browser/viewParts/minimap/minimapCharRenderer'; -import { allCharCodes, Constants } from 'vs/editor/browser/viewParts/minimap/minimapCharSheet'; -import { prebakedMiniMaps } from 'vs/editor/browser/viewParts/minimap/minimapPreBaked'; -import { toUint8 } from 'vs/base/common/uint'; +import { MinimapCharRenderer } from './minimapCharRenderer.js'; +import { allCharCodes, Constants } from './minimapCharSheet.js'; +import { prebakedMiniMaps } from './minimapPreBaked.js'; +import { toUint8 } from '../../../../base/common/uint.js'; /** * Creates character renderers. It takes a 'scale' that determines how large diff --git a/src/vs/editor/browser/viewParts/minimap/minimapPreBaked.ts b/src/vs/editor/browser/viewParts/minimap/minimapPreBaked.ts index 3679e8afad5..a9b5738be6d 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimapPreBaked.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimapPreBaked.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createSingleCallFunction } from 'vs/base/common/functional'; +import { createSingleCallFunction } from '../../../../base/common/functional.js'; const charTable: { [hex: string]: number } = { '0': 0, diff --git a/src/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.ts b/src/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.ts index 5b3e86a042d..e34f35493d3 100644 --- a/src/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.ts +++ b/src/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./overlayWidgets'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { IOverlayWidget, IOverlayWidgetPosition, IOverlayWidgetPositionCoordinates, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; -import { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import * as dom from 'vs/base/browser/dom'; +import './overlayWidgets.css'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { IOverlayWidget, IOverlayWidgetPosition, IOverlayWidgetPositionCoordinates, OverlayWidgetPositionPreference } from '../../editorBrowser.js'; +import { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import * as dom from '../../../../base/browser/dom.js'; interface IWidgetData { @@ -25,6 +25,11 @@ interface IWidgetMap { [key: string]: IWidgetData; } +/* + * This view part for rendering the overlay widgets, which are + * floating widgets positioned based on the editor's viewport, + * such as the find widget. + */ export class ViewOverlayWidgets extends ViewPart { private readonly _viewDomNode: FastDomNode; diff --git a/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts b/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts index 0aa027c65a7..cdfdcb7227b 100644 --- a/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts +++ b/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { Color } from 'vs/base/common/color'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ViewPart } from 'vs/editor/browser/view/viewPart'; -import { Position } from 'vs/editor/common/core/position'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { TokenizationRegistry } from 'vs/editor/common/languages'; -import { editorCursorForeground, editorOverviewRulerBackground, editorMultiCursorSecondaryForeground, editorMultiCursorPrimaryForeground, editorRuler } from 'vs/editor/common/core/editorColorRegistry'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import { EditorTheme } from 'vs/editor/common/editorTheme'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { OverviewRulerDecorationsGroup } from 'vs/editor/common/viewModel'; -import { equals } from 'vs/base/common/arrays'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { Color } from '../../../../base/common/color.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { ViewPart } from '../../view/viewPart.js'; +import { Position } from '../../../common/core/position.js'; +import { IEditorConfiguration } from '../../../common/config/editorConfiguration.js'; +import { TokenizationRegistry } from '../../../common/languages.js'; +import { editorCursorForeground, editorOverviewRulerBackground, editorMultiCursorSecondaryForeground, editorMultiCursorPrimaryForeground, editorRuler } from '../../../common/core/editorColorRegistry.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import { EditorTheme } from '../../../common/editorTheme.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { OverviewRulerDecorationsGroup } from '../../../common/viewModel.js'; +import { equals } from '../../../../base/common/arrays.js'; class Settings { @@ -512,9 +512,7 @@ export class DecorationsOverviewRuler extends ViewPart { canvasCtx.strokeStyle = this._settings.borderColor; canvasCtx.moveTo(0, 0); canvasCtx.lineTo(0, canvasHeight); - canvasCtx.stroke(); - - canvasCtx.moveTo(0, 0); + canvasCtx.moveTo(1, 0); canvasCtx.lineTo(canvasWidth, 0); canvasCtx.stroke(); } diff --git a/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts b/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts index 78f3c94caae..11292eb56a1 100644 --- a/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts +++ b/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts @@ -3,14 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { IOverviewRuler } from 'vs/editor/browser/editorBrowser'; -import { OverviewRulerPosition, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ColorZone, OverviewRulerZone, OverviewZoneManager } from 'vs/editor/common/viewModel/overviewZoneManager'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewEventHandler } from 'vs/editor/common/viewEventHandler'; - +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { IOverviewRuler } from '../../editorBrowser.js'; +import { OverviewRulerPosition, EditorOption } from '../../../common/config/editorOptions.js'; +import { ColorZone, OverviewRulerZone, OverviewZoneManager } from '../../../common/viewModel/overviewZoneManager.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { ViewEventHandler } from '../../../common/viewEventHandler.js'; + +/** + * The overview ruler appears underneath the editor scroll bar and shows things + * like the cursor, various decorations, etc. + */ export class OverviewRuler extends ViewEventHandler implements IOverviewRuler { private readonly _context: ViewContext; diff --git a/src/vs/editor/browser/viewParts/rulers/rulers.ts b/src/vs/editor/browser/viewParts/rulers/rulers.ts index e924ed67d39..c0a46927d17 100644 --- a/src/vs/editor/browser/viewParts/rulers/rulers.ts +++ b/src/vs/editor/browser/viewParts/rulers/rulers.ts @@ -3,14 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./rulers'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { ViewPart } from 'vs/editor/browser/view/viewPart'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { EditorOption, IRulerOption } from 'vs/editor/common/config/editorOptions'; - +import './rulers.css'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { ViewPart } from '../../view/viewPart.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { EditorOption, IRulerOption } from '../../../common/config/editorOptions.js'; + +/** + * Rulers are vertical lines that appear at certain columns in the editor. There can be >= 0 rulers + * at a time. + */ export class Rulers extends ViewPart { public domNode: FastDomNode; diff --git a/src/vs/editor/browser/viewParts/rulersGpu/rulersGpu.ts b/src/vs/editor/browser/viewParts/rulersGpu/rulersGpu.ts new file mode 100644 index 00000000000..8db2dc2823e --- /dev/null +++ b/src/vs/editor/browser/viewParts/rulersGpu/rulersGpu.ts @@ -0,0 +1,80 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { ViewPart } from '../../view/viewPart.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import type { ViewGpuContext } from '../../gpu/viewGpuContext.js'; +import type { IObjectCollectionBufferEntry } from '../../gpu/objectCollectionBuffer.js'; +import type { RectangleRendererEntrySpec } from '../../gpu/rectangleRenderer.js'; +import { Color } from '../../../../base/common/color.js'; +import { editorRuler } from '../../../common/core/editorColorRegistry.js'; +import { autorun, type IReader } from '../../../../base/common/observable.js'; + +/** + * Rulers are vertical lines that appear at certain columns in the editor. There can be >= 0 rulers + * at a time. + */ +export class RulersGpu extends ViewPart { + + private readonly _gpuShapes: IObjectCollectionBufferEntry[] = []; + + constructor( + context: ViewContext, + private readonly _viewGpuContext: ViewGpuContext + ) { + super(context); + this._register(autorun(reader => this._updateEntries(reader))); + } + + // --- begin event handlers + + public override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { + this._updateEntries(undefined); + return true; + } + + // --- end event handlers + + public prepareRender(ctx: RenderingContext): void { + // Nothing to read + } + + public render(ctx: RestrictedRenderingContext): void { + // Rendering is handled by RectangleRenderer + } + + private _updateEntries(reader: IReader | undefined) { + const options = this._context.configuration.options; + const rulers = options.get(EditorOption.rulers); + const typicalHalfwidthCharacterWidth = options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth; + const devicePixelRatio = this._viewGpuContext.devicePixelRatio.read(reader); + for (let i = 0, len = rulers.length; i < len; i++) { + const ruler = rulers[i]; + const shape = this._gpuShapes[i]; + const color = ruler.color ? Color.fromHex(ruler.color) : this._context.theme.getColor(editorRuler) ?? Color.white; + const rulerData = [ + ruler.column * typicalHalfwidthCharacterWidth * devicePixelRatio, + 0, + Math.max(1, Math.ceil(devicePixelRatio)), + Number.MAX_SAFE_INTEGER, + color.rgba.r / 255, + color.rgba.g / 255, + color.rgba.b / 255, + color.rgba.a, + ] as const; + if (!shape) { + this._gpuShapes[i] = this._viewGpuContext.rectangleRenderer.register(...rulerData); + } else { + shape.setRaw(rulerData); + } + } + while (this._gpuShapes.length > rulers.length) { + this._gpuShapes.splice(-1, 1)[0].dispose(); + } + } +} diff --git a/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts b/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts index 1fc3347948b..71a9a7605c7 100644 --- a/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts +++ b/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./scrollDecoration'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { ViewPart } from 'vs/editor/browser/view/viewPart'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; +import './scrollDecoration.css'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { ViewPart } from '../../view/viewPart.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; export class ScrollDecorationViewPart extends ViewPart { diff --git a/src/vs/editor/browser/viewParts/selections/selections.ts b/src/vs/editor/browser/viewParts/selections/selections.ts index d53a5126e62..ce07d7984fa 100644 --- a/src/vs/editor/browser/viewParts/selections/selections.ts +++ b/src/vs/editor/browser/viewParts/selections/selections.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./selections'; -import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay'; -import { Range } from 'vs/editor/common/core/range'; -import { HorizontalRange, LineVisibleRanges, RenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { editorSelectionForeground } from 'vs/platform/theme/common/colorRegistry'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; +import './selections.css'; +import { DynamicViewOverlay } from '../../view/dynamicViewOverlay.js'; +import { Range } from '../../../common/core/range.js'; +import { HorizontalRange, LineVisibleRanges, RenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { editorSelectionForeground } from '../../../../platform/theme/common/colorRegistry.js'; +import { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; const enum CornerStyle { EXTERN, diff --git a/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts b/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts index 4502698cfc5..b69180772cc 100644 --- a/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts +++ b/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import * as strings from 'vs/base/common/strings'; -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { TextEditorCursorStyle, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from 'vs/base/browser/ui/mouseCursor/mouseCursor'; +import * as dom from '../../../../base/browser/dom.js'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import * as strings from '../../../../base/common/strings.js'; +import { applyFontInfo } from '../../config/domFontInfo.js'; +import { TextEditorCursorStyle, EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from '../../../../base/browser/ui/mouseCursor/mouseCursor.js'; export interface IViewCursorRenderData { domNode: HTMLElement; diff --git a/src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts b/src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts index ceb27ce5ea3..6f16ed5253b 100644 --- a/src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts +++ b/src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts @@ -3,26 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./viewCursors'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { IntervalTimer, TimeoutTimer } from 'vs/base/common/async'; -import { ViewPart } from 'vs/editor/browser/view/viewPart'; -import { IViewCursorRenderData, ViewCursor, CursorPlurality } from 'vs/editor/browser/viewParts/viewCursors/viewCursor'; -import { TextEditorCursorBlinkingStyle, TextEditorCursorStyle, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; +import './viewCursors.css'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { IntervalTimer, TimeoutTimer } from '../../../../base/common/async.js'; +import { ViewPart } from '../../view/viewPart.js'; +import { IViewCursorRenderData, ViewCursor, CursorPlurality } from './viewCursor.js'; +import { TextEditorCursorBlinkingStyle, TextEditorCursorStyle, EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; import { editorCursorBackground, editorCursorForeground, editorMultiCursorPrimaryForeground, editorMultiCursorPrimaryBackground, editorMultiCursorSecondaryForeground, editorMultiCursorSecondaryBackground -} from 'vs/editor/common/core/editorColorRegistry'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { isHighContrast } from 'vs/platform/theme/common/theme'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { WindowIntervalTimer, getWindow } from 'vs/base/browser/dom'; - +} from '../../../common/core/editorColorRegistry.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { isHighContrast } from '../../../../platform/theme/common/theme.js'; +import { CursorChangeReason } from '../../../common/cursorEvents.js'; +import { WindowIntervalTimer, getWindow } from '../../../../base/browser/dom.js'; + +/** + * View cursors is a view part responsible for rendering the primary cursor and + * any secondary cursors that are currently active. + */ export class ViewCursors extends ViewPart { static readonly BLINK_INTERVAL = 500; diff --git a/src/vs/editor/browser/viewParts/lines/domReadingContext.ts b/src/vs/editor/browser/viewParts/viewLines/domReadingContext.ts similarity index 100% rename from src/vs/editor/browser/viewParts/lines/domReadingContext.ts rename to src/vs/editor/browser/viewParts/viewLines/domReadingContext.ts diff --git a/src/vs/editor/browser/viewParts/lines/rangeUtil.ts b/src/vs/editor/browser/viewParts/viewLines/rangeUtil.ts similarity index 96% rename from src/vs/editor/browser/viewParts/lines/rangeUtil.ts rename to src/vs/editor/browser/viewParts/viewLines/rangeUtil.ts index fdb61a07f6c..3c0a4ba3964 100644 --- a/src/vs/editor/browser/viewParts/lines/rangeUtil.ts +++ b/src/vs/editor/browser/viewParts/viewLines/rangeUtil.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Constants } from 'vs/base/common/uint'; -import { FloatHorizontalRange } from 'vs/editor/browser/view/renderingContext'; -import { DomReadingContext } from 'vs/editor/browser/viewParts/lines/domReadingContext'; +import { Constants } from '../../../../base/common/uint.js'; +import { FloatHorizontalRange } from '../../view/renderingContext.js'; +import { DomReadingContext } from './domReadingContext.js'; export class RangeUtil { diff --git a/src/vs/editor/browser/viewParts/lines/viewLine.ts b/src/vs/editor/browser/viewParts/viewLines/viewLine.ts similarity index 87% rename from src/vs/editor/browser/viewParts/lines/viewLine.ts rename to src/vs/editor/browser/viewParts/viewLines/viewLine.ts index 9a5d2f556bf..5e555246cea 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLine.ts +++ b/src/vs/editor/browser/viewParts/viewLines/viewLine.ts @@ -3,21 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as browser from 'vs/base/browser/browser'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import * as platform from 'vs/base/common/platform'; -import { IVisibleLine } from 'vs/editor/browser/view/viewLayer'; -import { RangeUtil } from 'vs/editor/browser/viewParts/lines/rangeUtil'; -import { StringBuilder } from 'vs/editor/common/core/stringBuilder'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { FloatHorizontalRange, VisibleRanges } from 'vs/editor/browser/view/renderingContext'; -import { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations'; -import { CharacterMapping, ForeignElementType, RenderLineInput, renderViewLine, LineRange, DomPosition } from 'vs/editor/common/viewLayout/viewLineRenderer'; -import { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; -import { InlineDecorationType } from 'vs/editor/common/viewModel'; -import { ColorScheme, isHighContrast } from 'vs/platform/theme/common/theme'; -import { EditorOption, EditorFontLigatures } from 'vs/editor/common/config/editorOptions'; -import { DomReadingContext } from 'vs/editor/browser/viewParts/lines/domReadingContext'; +import * as browser from '../../../../base/browser/browser.js'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import * as platform from '../../../../base/common/platform.js'; +import { IVisibleLine } from '../../view/viewLayer.js'; +import { RangeUtil } from './rangeUtil.js'; +import { StringBuilder } from '../../../common/core/stringBuilder.js'; +import { FloatHorizontalRange, VisibleRanges } from '../../view/renderingContext.js'; +import { LineDecoration } from '../../../common/viewLayout/lineDecorations.js'; +import { CharacterMapping, ForeignElementType, RenderLineInput, renderViewLine, LineRange, DomPosition } from '../../../common/viewLayout/viewLineRenderer.js'; +import { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js'; +import { InlineDecorationType } from '../../../common/viewModel.js'; +import { isHighContrast } from '../../../../platform/theme/common/theme.js'; +import { EditorFontLigatures } from '../../../common/config/editorOptions.js'; +import { DomReadingContext } from './domReadingContext.js'; +import type { ViewLineOptions } from './viewLineOptions.js'; +import { ViewGpuContext } from '../../gpu/viewGpuContext.js'; const canUseFastRenderedViewLine = (function () { if (platform.isNative) { @@ -45,61 +46,6 @@ const canUseFastRenderedViewLine = (function () { let monospaceAssumptionsAreValid = true; -export class ViewLineOptions { - public readonly themeType: ColorScheme; - public readonly renderWhitespace: 'none' | 'boundary' | 'selection' | 'trailing' | 'all'; - public readonly renderControlCharacters: boolean; - public readonly spaceWidth: number; - public readonly middotWidth: number; - public readonly wsmiddotWidth: number; - public readonly useMonospaceOptimizations: boolean; - public readonly canUseHalfwidthRightwardsArrow: boolean; - public readonly lineHeight: number; - public readonly stopRenderingLineAfter: number; - public readonly fontLigatures: string; - - constructor(config: IEditorConfiguration, themeType: ColorScheme) { - this.themeType = themeType; - const options = config.options; - const fontInfo = options.get(EditorOption.fontInfo); - const experimentalWhitespaceRendering = options.get(EditorOption.experimentalWhitespaceRendering); - if (experimentalWhitespaceRendering === 'off') { - this.renderWhitespace = options.get(EditorOption.renderWhitespace); - } else { - // whitespace is rendered in a different layer - this.renderWhitespace = 'none'; - } - this.renderControlCharacters = options.get(EditorOption.renderControlCharacters); - this.spaceWidth = fontInfo.spaceWidth; - this.middotWidth = fontInfo.middotWidth; - this.wsmiddotWidth = fontInfo.wsmiddotWidth; - this.useMonospaceOptimizations = ( - fontInfo.isMonospace - && !options.get(EditorOption.disableMonospaceOptimizations) - ); - this.canUseHalfwidthRightwardsArrow = fontInfo.canUseHalfwidthRightwardsArrow; - this.lineHeight = options.get(EditorOption.lineHeight); - this.stopRenderingLineAfter = options.get(EditorOption.stopRenderingLineAfter); - this.fontLigatures = options.get(EditorOption.fontLigatures); - } - - public equals(other: ViewLineOptions): boolean { - return ( - this.themeType === other.themeType - && this.renderWhitespace === other.renderWhitespace - && this.renderControlCharacters === other.renderControlCharacters - && this.spaceWidth === other.spaceWidth - && this.middotWidth === other.middotWidth - && this.wsmiddotWidth === other.wsmiddotWidth - && this.useMonospaceOptimizations === other.useMonospaceOptimizations - && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow - && this.lineHeight === other.lineHeight - && this.stopRenderingLineAfter === other.stopRenderingLineAfter - && this.fontLigatures === other.fontLigatures - ); - } -} - export class ViewLine implements IVisibleLine { public static readonly CLASS_NAME = 'view-line'; @@ -152,6 +98,12 @@ export class ViewLine implements IVisibleLine { } public renderLine(lineNumber: number, deltaTop: number, lineHeight: number, viewportData: ViewportData, sb: StringBuilder): boolean { + if (this._options.useGpu && ViewGpuContext.canRender(this._options, viewportData, lineNumber)) { + this._renderedViewLine?.domNode?.domNode.remove(); + this._renderedViewLine = null; + return false; + } + if (this._isMaybeInvalid === false) { // it appears that nothing relevant has changed return false; diff --git a/src/vs/editor/browser/viewParts/viewLines/viewLineOptions.ts b/src/vs/editor/browser/viewParts/viewLines/viewLineOptions.ts new file mode 100644 index 00000000000..c75ea1740fe --- /dev/null +++ b/src/vs/editor/browser/viewParts/viewLines/viewLineOptions.ts @@ -0,0 +1,66 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type { ColorScheme } from '../../../../platform/theme/common/theme.js'; +import type { IEditorConfiguration } from '../../../common/config/editorConfiguration.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; + +export class ViewLineOptions { + public readonly themeType: ColorScheme; + public readonly renderWhitespace: 'none' | 'boundary' | 'selection' | 'trailing' | 'all'; + public readonly renderControlCharacters: boolean; + public readonly spaceWidth: number; + public readonly middotWidth: number; + public readonly wsmiddotWidth: number; + public readonly useMonospaceOptimizations: boolean; + public readonly canUseHalfwidthRightwardsArrow: boolean; + public readonly lineHeight: number; + public readonly stopRenderingLineAfter: number; + public readonly fontLigatures: string; + public readonly useGpu: boolean; + + constructor(config: IEditorConfiguration, themeType: ColorScheme) { + this.themeType = themeType; + const options = config.options; + const fontInfo = options.get(EditorOption.fontInfo); + const experimentalWhitespaceRendering = options.get(EditorOption.experimentalWhitespaceRendering); + if (experimentalWhitespaceRendering === 'off') { + this.renderWhitespace = options.get(EditorOption.renderWhitespace); + } else { + // whitespace is rendered in a different layer + this.renderWhitespace = 'none'; + } + this.renderControlCharacters = options.get(EditorOption.renderControlCharacters); + this.spaceWidth = fontInfo.spaceWidth; + this.middotWidth = fontInfo.middotWidth; + this.wsmiddotWidth = fontInfo.wsmiddotWidth; + this.useMonospaceOptimizations = ( + fontInfo.isMonospace + && !options.get(EditorOption.disableMonospaceOptimizations) + ); + this.canUseHalfwidthRightwardsArrow = fontInfo.canUseHalfwidthRightwardsArrow; + this.lineHeight = options.get(EditorOption.lineHeight); + this.stopRenderingLineAfter = options.get(EditorOption.stopRenderingLineAfter); + this.fontLigatures = options.get(EditorOption.fontLigatures); + this.useGpu = options.get(EditorOption.experimentalGpuAcceleration) === 'on'; + } + + public equals(other: ViewLineOptions): boolean { + return ( + this.themeType === other.themeType + && this.renderWhitespace === other.renderWhitespace + && this.renderControlCharacters === other.renderControlCharacters + && this.spaceWidth === other.spaceWidth + && this.middotWidth === other.middotWidth + && this.wsmiddotWidth === other.wsmiddotWidth + && this.useMonospaceOptimizations === other.useMonospaceOptimizations + && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow + && this.lineHeight === other.lineHeight + && this.stopRenderingLineAfter === other.stopRenderingLineAfter + && this.fontLigatures === other.fontLigatures + && this.useGpu === other.useGpu + ); + } +} diff --git a/src/vs/editor/browser/viewParts/lines/viewLines.css b/src/vs/editor/browser/viewParts/viewLines/viewLines.css similarity index 100% rename from src/vs/editor/browser/viewParts/lines/viewLines.css rename to src/vs/editor/browser/viewParts/viewLines/viewLines.css diff --git a/src/vs/editor/browser/viewParts/lines/viewLines.ts b/src/vs/editor/browser/viewParts/viewLines/viewLines.ts similarity index 94% rename from src/vs/editor/browser/viewParts/lines/viewLines.ts rename to src/vs/editor/browser/viewParts/viewLines/viewLines.ts index 220ef987255..b93a0028b0b 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLines.ts +++ b/src/vs/editor/browser/viewParts/viewLines/viewLines.ts @@ -3,27 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { FastDomNode } from 'vs/base/browser/fastDomNode'; -import { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from 'vs/base/browser/ui/mouseCursor/mouseCursor'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import * as platform from 'vs/base/common/platform'; -import { Constants } from 'vs/base/common/uint'; -import 'vs/css!./viewLines'; -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { HorizontalPosition, HorizontalRange, IViewLines, LineVisibleRanges, VisibleRanges } from 'vs/editor/browser/view/renderingContext'; -import { IVisibleLinesHost, VisibleLinesCollection } from 'vs/editor/browser/view/viewLayer'; -import { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart'; -import { DomReadingContext } from 'vs/editor/browser/viewParts/lines/domReadingContext'; -import { ViewLine, ViewLineOptions } from 'vs/editor/browser/viewParts/lines/viewLine'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; -import { Viewport } from 'vs/editor/common/viewModel'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; +import { FastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from '../../../../base/browser/ui/mouseCursor/mouseCursor.js'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import * as platform from '../../../../base/common/platform.js'; +import { Constants } from '../../../../base/common/uint.js'; +import './viewLines.css'; +import { applyFontInfo } from '../../config/domFontInfo.js'; +import { HorizontalPosition, HorizontalRange, IViewLines, LineVisibleRanges, VisibleRanges } from '../../view/renderingContext.js'; +import { VisibleLinesCollection } from '../../view/viewLayer.js'; +import { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js'; +import { DomReadingContext } from './domReadingContext.js'; +import { ViewLine } from './viewLine.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ScrollType } from '../../../common/editorCommon.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js'; +import { Viewport } from '../../../common/viewModel.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import { ViewLineOptions } from './viewLineOptions.js'; class LastRenderedData { @@ -87,7 +88,11 @@ class HorizontalRevealSelectionsRequest { type HorizontalRevealRequest = HorizontalRevealRangeRequest | HorizontalRevealSelectionsRequest; -export class ViewLines extends ViewPart implements IVisibleLinesHost, IViewLines { +/** + * The view lines part is responsible for rendering the actual content of a + * file. + */ +export class ViewLines extends ViewPart implements IViewLines { /** * Adds this amount of pixels to the right of lines (no-one wants to type near the edge of the viewport) */ @@ -122,10 +127,6 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, constructor(context: ViewContext, linesContent: FastDomNode) { super(context); - this._linesContent = linesContent; - this._textRangeRestingSpot = document.createElement('div'); - this._visibleLines = new VisibleLinesCollection(this); - this.domNode = this._visibleLines.domNode; const conf = this._context.configuration; const options = this._context.configuration.options; @@ -141,6 +142,13 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, this._canUseLayerHinting = !options.get(EditorOption.disableLayerHinting); this._viewLineOptions = new ViewLineOptions(conf, this._context.theme.type); + this._linesContent = linesContent; + this._textRangeRestingSpot = document.createElement('div'); + this._visibleLines = new VisibleLinesCollection({ + createLine: () => new ViewLine(this._viewLineOptions), + }); + this.domNode = this._visibleLines.domNode; + PartFingerprints.write(this.domNode, PartFingerprint.ViewLines); this.domNode.setClassName(`view-lines ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`); applyFontInfo(this.domNode, fontInfo); @@ -173,14 +181,6 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, return this.domNode; } - // ---- begin IVisibleLinesHost - - public createVisibleLine(): ViewLine { - return new ViewLine(this._viewLineOptions); - } - - // ---- end IVisibleLinesHost - // ---- begin view event handlers public override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { @@ -710,12 +710,10 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, let paddingBottom: number = 0; if (!shouldIgnoreScrollOff) { - const context = Math.min((viewportHeight / this._lineHeight) / 2, this._cursorSurroundingLines); - if (this._stickyScrollEnabled) { - paddingTop = Math.max(context, this._maxNumberStickyLines) * this._lineHeight; - } else { - paddingTop = context * this._lineHeight; - } + const maxLinesInViewport = (viewportHeight / this._lineHeight); + const surroundingLines = Math.max(this._cursorSurroundingLines, this._stickyScrollEnabled ? this._maxNumberStickyLines : 0); + const context = Math.min(maxLinesInViewport / 2, surroundingLines); + paddingTop = context * this._lineHeight; paddingBottom = Math.max(0, (context - 1)) * this._lineHeight; } else { if (!minimalReveal) { diff --git a/src/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.ts b/src/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.ts new file mode 100644 index 00000000000..f87eeb5f742 --- /dev/null +++ b/src/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.ts @@ -0,0 +1,393 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { getActiveWindow } from '../../../../base/browser/dom.js'; +import { BugIndicatingError } from '../../../../base/common/errors.js'; +import { autorun } from '../../../../base/common/observable.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import type { ViewLinesChangedEvent, ViewScrollChangedEvent } from '../../../common/viewEvents.js'; +import type { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js'; +import type { ViewContext } from '../../../common/viewModel/viewContext.js'; +import { TextureAtlasPage } from '../../gpu/atlas/textureAtlasPage.js'; +import { FullFileRenderStrategy } from '../../gpu/fullFileRenderStrategy.js'; +import { BindingId, type IGpuRenderStrategy } from '../../gpu/gpu.js'; +import { GPULifecycle } from '../../gpu/gpuDisposable.js'; +import { observeDevicePixelDimensions, quadVertices } from '../../gpu/gpuUtils.js'; +import { ViewGpuContext } from '../../gpu/viewGpuContext.js'; +import type { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewPart } from '../../view/viewPart.js'; +import { ViewLineOptions } from '../viewLines/viewLineOptions.js'; + + +const enum GlyphStorageBufferInfo { + FloatsPerEntry = 2 + 2 + 2, + BytesPerEntry = GlyphStorageBufferInfo.FloatsPerEntry * 4, + Offset_TexturePosition = 0, + Offset_TextureSize = 2, + Offset_OriginPosition = 4, +} + +/** + * The GPU implementation of the ViewLines part. + */ +export class ViewLinesGpu extends ViewPart { + + private readonly canvas: HTMLCanvasElement; + + private _device!: GPUDevice; + private _renderPassDescriptor!: GPURenderPassDescriptor; + private _renderPassColorAttachment!: GPURenderPassColorAttachment; + private _bindGroup!: GPUBindGroup; + private _pipeline!: GPURenderPipeline; + + private _vertexBuffer!: GPUBuffer; + + private readonly _glyphStorageBuffer: GPUBuffer[] = []; + private _atlasGpuTexture!: GPUTexture; + private readonly _atlasGpuTextureVersions: number[] = []; + + private _initialized = false; + + private _renderStrategy!: IGpuRenderStrategy; + + constructor( + context: ViewContext, + private readonly _viewGpuContext: ViewGpuContext, + @IInstantiationService private readonly _instantiationService: IInstantiationService, + @ILogService private readonly _logService: ILogService, + ) { + super(context); + + this.canvas = this._viewGpuContext.canvas.domNode; + + this._register(autorun(reader => { + /*const dims = */this._viewGpuContext.canvasDevicePixelDimensions.read(reader); + // TODO: Request render, should this just call renderText with the last viewportData + })); + + this.initWebgpu(); + } + + async initWebgpu() { + // #region General + + this._device = await this._viewGpuContext.device; + + if (this._store.isDisposed) { + return; + } + + const atlas = ViewGpuContext.atlas; + + // Rerender when the texture atlas deletes glyphs + this._register(atlas.onDidDeleteGlyphs(() => { + this._atlasGpuTextureVersions.length = 0; + this._atlasGpuTextureVersions[0] = 0; + this._atlasGpuTextureVersions[1] = 0; + this._renderStrategy.reset(); + })); + + const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + this._viewGpuContext.ctx.configure({ + device: this._device, + format: presentationFormat, + alphaMode: 'premultiplied', + }); + + this._renderPassColorAttachment = { + view: null!, // Will be filled at render time + loadOp: 'load', + storeOp: 'store', + }; + this._renderPassDescriptor = { + label: 'Monaco render pass', + colorAttachments: [this._renderPassColorAttachment], + }; + + // #endregion General + + // #region Uniforms + + let layoutInfoUniformBuffer: GPUBuffer; + { + const enum Info { + FloatsPerEntry = 6, + BytesPerEntry = Info.FloatsPerEntry * 4, + Offset_CanvasWidth____ = 0, + Offset_CanvasHeight___ = 1, + Offset_ViewportOffsetX = 2, + Offset_ViewportOffsetY = 3, + Offset_ViewportWidth__ = 4, + Offset_ViewportHeight_ = 5, + } + const bufferValues = new Float32Array(Info.FloatsPerEntry); + const updateBufferValues = (canvasDevicePixelWidth: number = this.canvas.width, canvasDevicePixelHeight: number = this.canvas.height) => { + bufferValues[Info.Offset_CanvasWidth____] = canvasDevicePixelWidth; + bufferValues[Info.Offset_CanvasHeight___] = canvasDevicePixelHeight; + bufferValues[Info.Offset_ViewportOffsetX] = Math.ceil(this._context.configuration.options.get(EditorOption.layoutInfo).contentLeft * getActiveWindow().devicePixelRatio); + bufferValues[Info.Offset_ViewportOffsetY] = 0; + bufferValues[Info.Offset_ViewportWidth__] = bufferValues[Info.Offset_CanvasWidth____] - bufferValues[Info.Offset_ViewportOffsetX]; + bufferValues[Info.Offset_ViewportHeight_] = bufferValues[Info.Offset_CanvasHeight___] - bufferValues[Info.Offset_ViewportOffsetY]; + return bufferValues; + }; + layoutInfoUniformBuffer = this._register(GPULifecycle.createBuffer(this._device, { + label: 'Monaco uniform buffer', + size: Info.BytesPerEntry, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }, () => updateBufferValues())).object; + this._register(observeDevicePixelDimensions(this.canvas, getActiveWindow(), (w, h) => { + this._device.queue.writeBuffer(layoutInfoUniformBuffer, 0, updateBufferValues(w, h)); + })); + } + + let atlasInfoUniformBuffer: GPUBuffer; + { + const enum Info { + FloatsPerEntry = 2, + BytesPerEntry = Info.FloatsPerEntry * 4, + Offset_Width_ = 0, + Offset_Height = 1, + } + atlasInfoUniformBuffer = this._register(GPULifecycle.createBuffer(this._device, { + label: 'Monaco atlas info uniform buffer', + size: Info.BytesPerEntry, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }, () => { + const values = new Float32Array(Info.FloatsPerEntry); + values[Info.Offset_Width_] = atlas.pageSize; + values[Info.Offset_Height] = atlas.pageSize; + return values; + })).object; + } + + // #endregion Uniforms + + // #region Storage buffers + + this._renderStrategy = this._register(this._instantiationService.createInstance(FullFileRenderStrategy, this._context, this._device, this.canvas, atlas)); + + this._glyphStorageBuffer[0] = this._register(GPULifecycle.createBuffer(this._device, { + label: 'Monaco glyph storage buffer', + size: GlyphStorageBufferInfo.BytesPerEntry * TextureAtlasPage.maximumGlyphCount, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, + })).object; + this._glyphStorageBuffer[1] = this._register(GPULifecycle.createBuffer(this._device, { + label: 'Monaco glyph storage buffer', + size: GlyphStorageBufferInfo.BytesPerEntry * TextureAtlasPage.maximumGlyphCount, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, + })).object; + this._atlasGpuTextureVersions[0] = 0; + this._atlasGpuTextureVersions[1] = 0; + this._atlasGpuTexture = this._register(GPULifecycle.createTexture(this._device, { + label: 'Monaco atlas texture', + format: 'rgba8unorm', + // TODO: Dynamically grow/shrink layer count + size: { width: atlas.pageSize, height: atlas.pageSize, depthOrArrayLayers: 2 }, + dimension: '2d', + usage: GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + })).object; + + this._updateAtlasStorageBufferAndTexture(); + + // #endregion Storage buffers + + // #region Vertex buffer + + this._vertexBuffer = this._register(GPULifecycle.createBuffer(this._device, { + label: 'Monaco vertex buffer', + size: quadVertices.byteLength, + usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST, + }, quadVertices)).object; + + // #endregion Vertex buffer + + // #region Shader module + + const module = this._device.createShaderModule({ + label: 'Monaco shader module', + code: this._renderStrategy.wgsl, + }); + + // #endregion Shader module + + // #region Pipeline + + this._pipeline = this._device.createRenderPipeline({ + label: 'Monaco render pipeline', + layout: 'auto', + vertex: { + module, + buffers: [ + { + arrayStride: 2 * Float32Array.BYTES_PER_ELEMENT, // 2 floats, 4 bytes each + attributes: [ + { shaderLocation: 0, offset: 0, format: 'float32x2' }, // position + ], + } + ] + }, + fragment: { + module, + targets: [ + { + format: presentationFormat, + blend: { + color: { + srcFactor: 'src-alpha', + dstFactor: 'one-minus-src-alpha' + }, + alpha: { + srcFactor: 'src-alpha', + dstFactor: 'one-minus-src-alpha' + }, + }, + } + ], + }, + }); + + // #endregion Pipeline + + // #region Bind group + + this._bindGroup = this._device.createBindGroup({ + label: 'Monaco bind group', + layout: this._pipeline.getBindGroupLayout(0), + entries: [ + // TODO: Pass in generically as array? + { binding: BindingId.GlyphInfo0, resource: { buffer: this._glyphStorageBuffer[0] } }, + { binding: BindingId.GlyphInfo1, resource: { buffer: this._glyphStorageBuffer[1] } }, + { + binding: BindingId.TextureSampler, resource: this._device.createSampler({ + label: 'Monaco atlas sampler', + magFilter: 'nearest', + minFilter: 'nearest', + }) + }, + { binding: BindingId.Texture, resource: this._atlasGpuTexture.createView() }, + { binding: BindingId.LayoutInfoUniform, resource: { buffer: layoutInfoUniformBuffer } }, + { binding: BindingId.AtlasDimensionsUniform, resource: { buffer: atlasInfoUniformBuffer } }, + ...this._renderStrategy.bindGroupEntries + ], + }); + + // endregion Bind group + + this._initialized = true; + } + + private _updateAtlasStorageBufferAndTexture() { + for (const [layerIndex, page] of ViewGpuContext.atlas.pages.entries()) { + // Skip the update if it's already the latest version + if (page.version === this._atlasGpuTextureVersions[layerIndex]) { + continue; + } + + this._logService.trace('Updating atlas page[', layerIndex, '] from version ', this._atlasGpuTextureVersions[layerIndex], ' to version ', page.version); + + // TODO: Reuse buffer instead of reconstructing each time + // TODO: Dynamically set buffer size + const values = new Float32Array(GlyphStorageBufferInfo.FloatsPerEntry * TextureAtlasPage.maximumGlyphCount); + let entryOffset = 0; + for (const glyph of page.glyphs) { + values[entryOffset + GlyphStorageBufferInfo.Offset_TexturePosition] = glyph.x; + values[entryOffset + GlyphStorageBufferInfo.Offset_TexturePosition + 1] = glyph.y; + values[entryOffset + GlyphStorageBufferInfo.Offset_TextureSize] = glyph.w; + values[entryOffset + GlyphStorageBufferInfo.Offset_TextureSize + 1] = glyph.h; + values[entryOffset + GlyphStorageBufferInfo.Offset_OriginPosition] = glyph.originOffsetX; + values[entryOffset + GlyphStorageBufferInfo.Offset_OriginPosition + 1] = glyph.originOffsetY; + entryOffset += GlyphStorageBufferInfo.FloatsPerEntry; + } + if (entryOffset / GlyphStorageBufferInfo.FloatsPerEntry > TextureAtlasPage.maximumGlyphCount) { + throw new Error(`Attempting to write more glyphs (${entryOffset / GlyphStorageBufferInfo.FloatsPerEntry}) than the GPUBuffer can hold (${TextureAtlasPage.maximumGlyphCount})`); + } + this._device.queue.writeBuffer(this._glyphStorageBuffer[layerIndex], 0, values); + if (page.usedArea.right - page.usedArea.left > 0 && page.usedArea.bottom - page.usedArea.top > 0) { + this._device.queue.copyExternalImageToTexture( + { source: page.source }, + { + texture: this._atlasGpuTexture, + origin: { + x: page.usedArea.left, + y: page.usedArea.top, + z: layerIndex + } + }, + { + width: page.usedArea.right - page.usedArea.left, + height: page.usedArea.bottom - page.usedArea.top + }, + ); + } + this._atlasGpuTextureVersions[layerIndex] = page.version; + } + } + + public static canRender(options: ViewLineOptions, viewportData: ViewportData, lineNumber: number): boolean { + const d = viewportData.getViewLineRenderingData(lineNumber); + // TODO + return d.content.indexOf('e') !== -1; + } + + public prepareRender(ctx: RenderingContext): void { + throw new BugIndicatingError('Should not be called'); + } + + public override render(ctx: RestrictedRenderingContext): void { + throw new BugIndicatingError('Should not be called'); + } + + override onLinesChanged(e: ViewLinesChangedEvent): boolean { + return true; + } + + override onScrollChanged(e: ViewScrollChangedEvent): boolean { + return true; + } + + // subscribe to more events + + public renderText(viewportData: ViewportData): void { + if (this._initialized) { + return this._renderText(viewportData); + } + } + + private _renderText(viewportData: ViewportData): void { + this._viewGpuContext.rectangleRenderer.draw(viewportData); + + const options = new ViewLineOptions(this._context.configuration, this._context.theme.type); + + const visibleObjectCount = this._renderStrategy.update(viewportData, options); + + this._updateAtlasStorageBufferAndTexture(); + + const encoder = this._device.createCommandEncoder({ label: 'Monaco command encoder' }); + + this._renderPassColorAttachment.view = this._viewGpuContext.ctx.getCurrentTexture().createView({ label: 'Monaco canvas texture view' }); + const pass = encoder.beginRenderPass(this._renderPassDescriptor); + pass.setPipeline(this._pipeline); + pass.setVertexBuffer(0, this._vertexBuffer); + + pass.setBindGroup(0, this._bindGroup); + + if (this._renderStrategy?.draw) { + // TODO: Don't draw lines if ViewLinesGpu.canRender is false + this._renderStrategy.draw(pass, viewportData); + } else { + pass.draw(quadVertices.length / 2, visibleObjectCount); + } + + pass.end(); + + const commandBuffer = encoder.finish(); + + this._device.queue.submit([commandBuffer]); + } +} diff --git a/src/vs/editor/browser/viewParts/viewZones/viewZones.ts b/src/vs/editor/browser/viewParts/viewZones/viewZones.ts index a99dac77cde..4b94e5660d3 100644 --- a/src/vs/editor/browser/viewParts/viewZones/viewZones.ts +++ b/src/vs/editor/browser/viewParts/viewZones/viewZones.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { IViewZone, IViewZoneChangeAccessor } from 'vs/editor/browser/editorBrowser'; -import { ViewPart } from 'vs/editor/browser/view/viewPart'; -import { Position } from 'vs/editor/common/core/position'; -import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { IEditorWhitespace, IViewWhitespaceViewportData, IWhitespaceChangeAccessor } from 'vs/editor/common/viewModel'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; +import { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { IViewZone, IViewZoneChangeAccessor } from '../../editorBrowser.js'; +import { ViewPart } from '../../view/viewPart.js'; +import { Position } from '../../../common/core/position.js'; +import { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { IEditorWhitespace, IViewWhitespaceViewportData, IWhitespaceChangeAccessor } from '../../../common/viewModel.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; interface IMyViewZone { whitespaceId: string; @@ -32,6 +32,11 @@ interface IComputedViewZoneProps { const invalidFunc = () => { throw new Error(`Invalid change accessor`); }; +/** + * A view zone is a rectangle that is a section that is inserted into the editor + * lines that can be used for various purposes such as showing a diffs, peeking + * an implementation, etc. + */ export class ViewZones extends ViewPart { private _zones: { [id: string]: IMyViewZone }; diff --git a/src/vs/editor/browser/viewParts/whitespace/whitespace.ts b/src/vs/editor/browser/viewParts/whitespace/whitespace.ts index 3bd29fc5e1e..56cc4692dc0 100644 --- a/src/vs/editor/browser/viewParts/whitespace/whitespace.ts +++ b/src/vs/editor/browser/viewParts/whitespace/whitespace.ts @@ -3,21 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./whitespace'; -import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay'; -import { Selection } from 'vs/editor/common/core/selection'; -import { RenderingContext } from 'vs/editor/browser/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/viewModel/viewContext'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewLineData } from 'vs/editor/common/viewModel'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import * as strings from 'vs/base/common/strings'; -import { CharCode } from 'vs/base/common/charCode'; -import { LineRange } from 'vs/editor/common/viewLayout/viewLineRenderer'; -import { Position } from 'vs/editor/common/core/position'; -import { editorWhitespaces } from 'vs/editor/common/core/editorColorRegistry'; - +import './whitespace.css'; +import { DynamicViewOverlay } from '../../view/dynamicViewOverlay.js'; +import { Selection } from '../../../common/core/selection.js'; +import { RenderingContext } from '../../view/renderingContext.js'; +import { ViewContext } from '../../../common/viewModel/viewContext.js'; +import * as viewEvents from '../../../common/viewEvents.js'; +import { ViewLineData } from '../../../common/viewModel.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IEditorConfiguration } from '../../../common/config/editorConfiguration.js'; +import * as strings from '../../../../base/common/strings.js'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { LineRange } from '../../../common/viewLayout/viewLineRenderer.js'; +import { Position } from '../../../common/core/position.js'; +import { editorWhitespaces } from '../../../common/core/editorColorRegistry.js'; + +/** + * The whitespace overlay will visual certain whitespace depending on the + * current editor configuration (boundary, selection, etc.). + */ export class WhitespaceOverlay extends DynamicViewOverlay { private readonly _context: ViewContext; diff --git a/src/vs/editor/browser/widget/codeEditor/codeEditorContributions.ts b/src/vs/editor/browser/widget/codeEditor/codeEditorContributions.ts index 840bcc4f525..107fa40928c 100644 --- a/src/vs/editor/browser/widget/codeEditor/codeEditorContributions.ts +++ b/src/vs/editor/browser/widget/codeEditor/codeEditorContributions.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getWindow, runWhenWindowIdle } from 'vs/base/browser/dom'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposable, DisposableMap, IDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, IEditorContributionDescription } from 'vs/editor/browser/editorExtensions'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { getWindow, runWhenWindowIdle } from '../../../../base/browser/dom.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Disposable, DisposableMap, IDisposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../editorBrowser.js'; +import { EditorContributionInstantiation, IEditorContributionDescription } from '../../editorExtensions.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; export class CodeEditorContributions extends Disposable { diff --git a/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts index f8ed64fba6c..bf72eb8c8ab 100644 --- a/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts @@ -3,63 +3,63 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/editor/browser/services/markerDecorations'; -import * as dom from 'vs/base/browser/dom'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; -import { Color } from 'vs/base/common/color'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, EmitterOptions, Event, EventDeliveryQueue, createEventDeliveryQueue } from 'vs/base/common/event'; -import { hash } from 'vs/base/common/hash'; -import { Disposable, DisposableStore, IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import 'vs/css!./editor'; -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { EditorConfiguration, IEditorConstructionOptions } from 'vs/editor/browser/config/editorConfiguration'; -import { TabFocus } from 'vs/editor/browser/config/tabFocus'; -import * as editorBrowser from 'vs/editor/browser/editorBrowser'; -import { EditorExtensionsRegistry, IEditorContributionDescription } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { IContentWidgetData, IGlyphMarginWidgetData, IOverlayWidgetData, View } from 'vs/editor/browser/view'; -import { DOMLineBreaksComputerFactory } from 'vs/editor/browser/view/domLineBreaksComputer'; -import { ICommandDelegate } from 'vs/editor/browser/view/viewController'; -import { ViewUserInputEvents } from 'vs/editor/browser/view/viewUserInputEvents'; -import { CodeEditorContributions } from 'vs/editor/browser/widget/codeEditor/codeEditorContributions'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { ConfigurationChangedEvent, EditorLayoutInfo, EditorOption, FindComputedEditorOptionValueById, IComputedEditorOptions, IEditorOptions, filterValidationDecorations } from 'vs/editor/common/config/editorOptions'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; -import { IDimension } from 'vs/editor/common/core/dimension'; -import { editorUnnecessaryCodeOpacity } from 'vs/editor/common/core/editorColorRegistry'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ISelection, Selection } from 'vs/editor/common/core/selection'; -import { IWordAtPosition } from 'vs/editor/common/core/wordHelper'; -import { WordOperations } from 'vs/editor/common/cursor/cursorWordOperations'; -import { CursorChangeReason, ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { InternalEditorAction } from 'vs/editor/common/editorAction'; -import * as editorCommon from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { EndOfLinePreference, IAttachedView, ICursorStateComputer, IIdentifiedSingleEditOperation, IModelDecoration, IModelDecorationOptions, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model'; -import { ClassName } from 'vs/editor/common/model/intervalTree'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents'; -import { VerticalRevealType } from 'vs/editor/common/viewEvents'; -import { IEditorWhitespace, IViewModel } from 'vs/editor/common/viewModel'; -import { MonospaceLineBreaksComputerFactory } from 'vs/editor/common/viewModel/monospaceLineBreaksComputer'; -import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; -import { OutgoingViewModelEventKind } from 'vs/editor/common/viewModelEventDispatcher'; -import * as nls from 'vs/nls'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { ContextKeyValue, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; -import { editorErrorForeground, editorHintForeground, editorInfoForeground, editorWarningForeground } from 'vs/platform/theme/common/colorRegistry'; -import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { MenuId } from 'vs/platform/actions/common/actions'; +import '../../services/markerDecorations.js'; +import * as dom from '../../../../base/browser/dom.js'; +import { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import { IMouseWheelEvent } from '../../../../base/browser/mouseEvent.js'; +import { Color } from '../../../../base/common/color.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Emitter, EmitterOptions, Event, EventDeliveryQueue, createEventDeliveryQueue } from '../../../../base/common/event.js'; +import { hash } from '../../../../base/common/hash.js'; +import { Disposable, DisposableStore, IDisposable, dispose } from '../../../../base/common/lifecycle.js'; +import { Schemas } from '../../../../base/common/network.js'; +import './editor.css'; +import { applyFontInfo } from '../../config/domFontInfo.js'; +import { EditorConfiguration, IEditorConstructionOptions } from '../../config/editorConfiguration.js'; +import { TabFocus } from '../../config/tabFocus.js'; +import * as editorBrowser from '../../editorBrowser.js'; +import { EditorExtensionsRegistry, IEditorContributionDescription } from '../../editorExtensions.js'; +import { ICodeEditorService } from '../../services/codeEditorService.js'; +import { IContentWidgetData, IGlyphMarginWidgetData, IOverlayWidgetData, View } from '../../view.js'; +import { DOMLineBreaksComputerFactory } from '../../view/domLineBreaksComputer.js'; +import { ICommandDelegate } from '../../view/viewController.js'; +import { ViewUserInputEvents } from '../../view/viewUserInputEvents.js'; +import { CodeEditorContributions } from './codeEditorContributions.js'; +import { IEditorConfiguration } from '../../../common/config/editorConfiguration.js'; +import { ConfigurationChangedEvent, EditorLayoutInfo, EditorOption, FindComputedEditorOptionValueById, IComputedEditorOptions, IEditorOptions, filterValidationDecorations } from '../../../common/config/editorOptions.js'; +import { CursorColumns } from '../../../common/core/cursorColumns.js'; +import { IDimension } from '../../../common/core/dimension.js'; +import { editorUnnecessaryCodeOpacity } from '../../../common/core/editorColorRegistry.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { ISelection, Selection } from '../../../common/core/selection.js'; +import { IWordAtPosition } from '../../../common/core/wordHelper.js'; +import { WordOperations } from '../../../common/cursor/cursorWordOperations.js'; +import { CursorChangeReason, ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from '../../../common/cursorEvents.js'; +import { InternalEditorAction } from '../../../common/editorAction.js'; +import * as editorCommon from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { EndOfLinePreference, IAttachedView, ICursorStateComputer, IIdentifiedSingleEditOperation, IModelDecoration, IModelDecorationOptions, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from '../../../common/model.js'; +import { ClassName } from '../../../common/model/intervalTree.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent } from '../../../common/textModelEvents.js'; +import { VerticalRevealType } from '../../../common/viewEvents.js'; +import { IEditorWhitespace, IViewModel } from '../../../common/viewModel.js'; +import { MonospaceLineBreaksComputerFactory } from '../../../common/viewModel/monospaceLineBreaksComputer.js'; +import { ViewModel } from '../../../common/viewModel/viewModelImpl.js'; +import { OutgoingViewModelEventKind } from '../../../common/viewModelEventDispatcher.js'; +import * as nls from '../../../../nls.js'; +import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { ContextKeyValue, IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { INotificationService, Severity } from '../../../../platform/notification/common/notification.js'; +import { editorErrorForeground, editorHintForeground, editorInfoForeground, editorWarningForeground } from '../../../../platform/theme/common/colorRegistry.js'; +import { IThemeService, registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeEditor { @@ -188,6 +188,9 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE private _updateCounter = 0; + private readonly _onWillTriggerEditorOperationEvent: Emitter = this._register(new Emitter()); + public readonly onWillTriggerEditorOperationEvent: Event = this._onWillTriggerEditorOperationEvent.event; + private readonly _onBeginUpdate: Emitter = this._register(new Emitter()); public readonly onBeginUpdate: Event = this._onBeginUpdate.event; @@ -577,7 +580,8 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE if (!this._modelData) { return -1; } - return CodeEditorWidget._getVerticalOffsetAfterPosition(this._modelData, lineNumber, 1, includeViewZones); + const maxCol = this._modelData.model.getLineMaxColumn(lineNumber); + return CodeEditorWidget._getVerticalOffsetAfterPosition(this._modelData, lineNumber, maxCol, includeViewZones); } public setHiddenAreas(ranges: IRange[], source?: unknown): void { @@ -1046,6 +1050,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE payload = payload || {}; try { + this._onWillTriggerEditorOperationEvent.fire({ source: source, handlerId: handlerId, payload: payload }); this._beginUpdate(); switch (handlerId) { diff --git a/src/vs/editor/browser/widget/codeEditor/editor.css b/src/vs/editor/browser/widget/codeEditor/editor.css index 5ef7246d0fb..d33122122de 100644 --- a/src/vs/editor/browser/widget/codeEditor/editor.css +++ b/src/vs/editor/browser/widget/codeEditor/editor.css @@ -23,6 +23,7 @@ -webkit-text-size-adjust: 100%; color: var(--vscode-editor-foreground); background-color: var(--vscode-editor-background); + overflow-wrap: initial; } .monaco-editor-background { background-color: var(--vscode-editor-background); @@ -44,6 +45,14 @@ border-style: dotted; } +.monaco-editor .editorCanvas { + position: absolute; + width: 100%; + height: 100%; + z-index: 0; + pointer-events: none; +} + /* -------------------- Misc -------------------- */ .monaco-editor .overflow-guard { diff --git a/src/vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget.ts index 9fb3a8e69c2..b716aa61109 100644 --- a/src/vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as objects from 'vs/base/common/objects'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { CodeEditorWidget, ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import { ConfigurationChangedEvent, IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; +import * as objects from '../../../../base/common/objects.js'; +import { ICodeEditor } from '../../editorBrowser.js'; +import { ICodeEditorService } from '../../services/codeEditorService.js'; +import { CodeEditorWidget, ICodeEditorWidgetOptions } from './codeEditorWidget.js'; +import { ConfigurationChangedEvent, IEditorOptions } from '../../../common/config/editorOptions.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; export class EmbeddedCodeEditorWidget extends CodeEditorWidget { private readonly _parentEditor: ICodeEditor; diff --git a/src/vs/editor/browser/widget/diffEditor/commands.ts b/src/vs/editor/browser/widget/diffEditor/commands.ts index cdfff8f57fe..9e04b2aad05 100644 --- a/src/vs/editor/browser/widget/diffEditor/commands.ts +++ b/src/vs/editor/browser/widget/diffEditor/commands.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getActiveElement } from 'vs/base/browser/dom'; -import { Codicon } from 'vs/base/common/codicons'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction2, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { localize2 } from 'vs/nls'; -import { ILocalizedString } from 'vs/platform/action/common/action'; -import { Action2, MenuId } from 'vs/platform/actions/common/actions'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import './registrations.contribution'; -import { DiffEditorSelectionHunkToolbarContext } from 'vs/editor/browser/widget/diffEditor/features/gutterFeature'; -import { URI } from 'vs/base/common/uri'; +import { getActiveElement } from '../../../../base/browser/dom.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { ICodeEditor, IDiffEditor } from '../../editorBrowser.js'; +import { EditorAction2, ServicesAccessor } from '../../editorExtensions.js'; +import { ICodeEditorService } from '../../services/codeEditorService.js'; +import { DiffEditorWidget } from './diffEditorWidget.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { localize2 } from '../../../../nls.js'; +import { ILocalizedString } from '../../../../platform/action/common/action.js'; +import { Action2, MenuId } from '../../../../platform/actions/common/actions.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import './registrations.contribution.js'; +import { DiffEditorSelectionHunkToolbarContext } from './features/gutterFeature.js'; +import { URI } from '../../../../base/common/uri.js'; export class ToggleCollapseUnchangedRegions extends Action2 { constructor() { diff --git a/src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.ts b/src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.ts index 3c27606e5d6..a5add04022d 100644 --- a/src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.ts +++ b/src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.ts @@ -3,37 +3,37 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { addDisposableListener, addStandardDisposableListener, reset } from 'vs/base/browser/dom'; -import { createTrustedTypesPolicy } from 'vs/base/browser/trustedTypes'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; -import { Action } from 'vs/base/common/actions'; -import { forEachAdjacent, groupAdjacentBy } from 'vs/base/common/arrays'; -import { Codicon } from 'vs/base/common/codicons'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, ITransaction, autorun, autorunWithStore, derived, derivedWithStore, observableValue, subtransaction, transaction } from 'vs/base/common/observable'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { applyStyle } from 'vs/editor/browser/widget/diffEditor/utils'; -import { EditorFontLigatures, EditorOption, IComputedEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { DetailedLineRangeMapping, LineRangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { ILanguageIdCodec } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ITextModel, TextModelResolvedOptions } from 'vs/editor/common/model'; -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { RenderLineInput, renderViewLine2 } from 'vs/editor/common/viewLayout/viewLineRenderer'; -import { ViewLineRenderingData } from 'vs/editor/common/viewModel'; -import { localize } from 'vs/nls'; -import { AccessibilitySignal, IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import 'vs/css!./accessibleDiffViewer'; -import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditor/components/diffEditorEditors'; +import { addDisposableListener, addStandardDisposableListener, reset } from '../../../../../base/browser/dom.js'; +import { createTrustedTypesPolicy } from '../../../../../base/browser/trustedTypes.js'; +import { ActionBar } from '../../../../../base/browser/ui/actionbar/actionbar.js'; +import { DomScrollableElement } from '../../../../../base/browser/ui/scrollbar/scrollableElement.js'; +import { Action } from '../../../../../base/common/actions.js'; +import { forEachAdjacent, groupAdjacentBy } from '../../../../../base/common/arrays.js'; +import { Codicon } from '../../../../../base/common/codicons.js'; +import { KeyCode, KeyMod } from '../../../../../base/common/keyCodes.js'; +import { Disposable, DisposableStore, toDisposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, ITransaction, autorun, autorunWithStore, derived, derivedWithStore, observableValue, subtransaction, transaction } from '../../../../../base/common/observable.js'; +import { ThemeIcon } from '../../../../../base/common/themables.js'; +import { applyFontInfo } from '../../../config/domFontInfo.js'; +import { applyStyle } from '../utils.js'; +import { EditorFontLigatures, EditorOption, IComputedEditorOptions } from '../../../../common/config/editorOptions.js'; +import { LineRange } from '../../../../common/core/lineRange.js'; +import { OffsetRange } from '../../../../common/core/offsetRange.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { DetailedLineRangeMapping, LineRangeMapping } from '../../../../common/diff/rangeMapping.js'; +import { ILanguageIdCodec } from '../../../../common/languages.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { ITextModel, TextModelResolvedOptions } from '../../../../common/model.js'; +import { LineTokens } from '../../../../common/tokens/lineTokens.js'; +import { RenderLineInput, renderViewLine2 } from '../../../../common/viewLayout/viewLineRenderer.js'; +import { ViewLineRenderingData } from '../../../../common/viewModel.js'; +import { localize } from '../../../../../nls.js'; +import { AccessibilitySignal, IAccessibilitySignalService } from '../../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { registerIcon } from '../../../../../platform/theme/common/iconRegistry.js'; +import './accessibleDiffViewer.css'; +import { DiffEditorEditors } from './diffEditorEditors.js'; const accessibleDiffViewerInsertIcon = registerIcon('diff-review-insert', Codicon.add, localize('accessibleDiffViewerInsertIcon', 'Icon for \'Insert\' in accessible diff viewer.')); const accessibleDiffViewerRemoveIcon = registerIcon('diff-review-remove', Codicon.remove, localize('accessibleDiffViewerRemoveIcon', 'Icon for \'Remove\' in accessible diff viewer.')); diff --git a/src/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.ts b/src/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.ts index a5992771a9a..609dd70fcef 100644 --- a/src/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.ts +++ b/src/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.ts @@ -3,16 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { IObservable, derived } from 'vs/base/common/observable'; -import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditor/components/diffEditorEditors'; -import { DiffEditorOptions } from 'vs/editor/browser/widget/diffEditor/diffEditorOptions'; -import { DiffEditorViewModel } from 'vs/editor/browser/widget/diffEditor/diffEditorViewModel'; -import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget'; -import { MovedBlocksLinesFeature } from 'vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature'; -import { diffAddDecoration, diffAddDecorationEmpty, diffDeleteDecoration, diffDeleteDecorationEmpty, diffLineAddDecorationBackground, diffLineAddDecorationBackgroundWithIndicator, diffLineDeleteDecorationBackground, diffLineDeleteDecorationBackgroundWithIndicator, diffWholeLineAddDecoration, diffWholeLineDeleteDecoration } from 'vs/editor/browser/widget/diffEditor/registrations.contribution'; -import { applyObservableDecorations } from 'vs/editor/browser/widget/diffEditor/utils'; -import { IModelDeltaDecoration } from 'vs/editor/common/model'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, derived } from '../../../../../base/common/observable.js'; +import { DiffEditorEditors } from './diffEditorEditors.js'; +import { allowsTrueInlineDiffRendering } from './diffEditorViewZones/diffEditorViewZones.js'; +import { DiffEditorOptions } from '../diffEditorOptions.js'; +import { DiffEditorViewModel } from '../diffEditorViewModel.js'; +import { DiffEditorWidget } from '../diffEditorWidget.js'; +import { MovedBlocksLinesFeature } from '../features/movedBlocksLinesFeature.js'; +import { diffAddDecoration, diffAddDecorationEmpty, diffDeleteDecoration, diffDeleteDecorationEmpty, diffLineAddDecorationBackground, diffLineAddDecorationBackgroundWithIndicator, diffLineDeleteDecorationBackground, diffLineDeleteDecorationBackgroundWithIndicator, diffWholeLineAddDecoration, diffWholeLineDeleteDecoration } from '../registrations.contribution.js'; +import { applyObservableDecorations } from '../utils.js'; +import { IModelDeltaDecoration } from '../../../../common/model.js'; export class DiffEditorDecorations extends Disposable { constructor( @@ -28,7 +29,8 @@ export class DiffEditorDecorations extends Disposable { } private readonly _decorations = derived(this, (reader) => { - const diff = this._diffModel.read(reader)?.diff.read(reader); + const diffModel = this._diffModel.read(reader); + const diff = diffModel?.diff.read(reader); if (!diff) { return null; } @@ -56,13 +58,29 @@ export class DiffEditorDecorations extends Disposable { modifiedDecorations.push({ range: m.lineRangeMapping.modified.toInclusiveRange()!, options: diffWholeLineAddDecoration }); } } else { + const useInlineDiff = this._options.useTrueInlineDiffRendering.read(reader) && allowsTrueInlineDiffRendering(m.lineRangeMapping); for (const i of m.lineRangeMapping.innerChanges || []) { // Don't show empty markers outside the line range if (m.lineRangeMapping.original.contains(i.originalRange.startLineNumber)) { originalDecorations.push({ range: i.originalRange, options: (i.originalRange.isEmpty() && showEmptyDecorations) ? diffDeleteDecorationEmpty : diffDeleteDecoration }); } if (m.lineRangeMapping.modified.contains(i.modifiedRange.startLineNumber)) { - modifiedDecorations.push({ range: i.modifiedRange, options: (i.modifiedRange.isEmpty() && showEmptyDecorations) ? diffAddDecorationEmpty : diffAddDecoration }); + modifiedDecorations.push({ range: i.modifiedRange, options: (i.modifiedRange.isEmpty() && showEmptyDecorations && !useInlineDiff) ? diffAddDecorationEmpty : diffAddDecoration }); + } + if (useInlineDiff) { + const deletedText = diffModel!.model.original.getValueInRange(i.originalRange); + modifiedDecorations.push({ + range: i.modifiedRange, + options: { + description: 'deleted-text', + before: { + content: deletedText, + inlineClassName: 'inline-deleted-text', + }, + zIndex: 100000, + showIfCollapsed: true, + } + }); } } } diff --git a/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.ts b/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.ts index 55b5d4a1e54..5d8f652a485 100644 --- a/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.ts +++ b/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IReader, autorunHandleChanges, derived, derivedOpts, observableFromEvent } from 'vs/base/common/observable'; -import { IEditorConstructionOptions } from 'vs/editor/browser/config/editorConfiguration'; -import { IDiffEditorConstructionOptions } from 'vs/editor/browser/editorBrowser'; -import { observableCodeEditor } from 'vs/editor/browser/observableCodeEditor'; -import { CodeEditorWidget, ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import { IDiffCodeEditorWidgetOptions } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget'; -import { OverviewRulerFeature } from 'vs/editor/browser/widget/diffEditor/features/overviewRulerFeature'; -import { EditorOptions, IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { IContentSizeChangedEvent } from 'vs/editor/common/editorCommon'; -import { localize } from 'vs/nls'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { DiffEditorOptions } from '../diffEditorOptions'; +import { Emitter } from '../../../../../base/common/event.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { IReader, autorunHandleChanges, derived, derivedOpts, observableFromEvent } from '../../../../../base/common/observable.js'; +import { IEditorConstructionOptions } from '../../../config/editorConfiguration.js'; +import { IDiffEditorConstructionOptions } from '../../../editorBrowser.js'; +import { observableCodeEditor } from '../../../observableCodeEditor.js'; +import { CodeEditorWidget, ICodeEditorWidgetOptions } from '../../codeEditor/codeEditorWidget.js'; +import { IDiffCodeEditorWidgetOptions } from '../diffEditorWidget.js'; +import { OverviewRulerFeature } from '../features/overviewRulerFeature.js'; +import { EditorOptions, IEditorOptions } from '../../../../common/config/editorOptions.js'; +import { Position } from '../../../../common/core/position.js'; +import { IContentSizeChangedEvent } from '../../../../common/editorCommon.js'; +import { localize } from '../../../../../nls.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { DiffEditorOptions } from '../diffEditorOptions.js'; export class DiffEditorEditors extends Disposable { public readonly original = this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(), this._argCodeEditorWidgetOptions.originalEditor || {})); @@ -30,7 +30,10 @@ export class DiffEditorEditors extends Disposable { public readonly modifiedScrollTop = observableFromEvent(this, this.modified.onDidScrollChange, () => /** @description modified.getScrollTop */ this.modified.getScrollTop()); public readonly modifiedScrollHeight = observableFromEvent(this, this.modified.onDidScrollChange, () => /** @description modified.getScrollHeight */ this.modified.getScrollHeight()); - public readonly modifiedModel = observableCodeEditor(this.modified).model; + public readonly modifiedObs = observableCodeEditor(this.modified); + public readonly originalObs = observableCodeEditor(this.original); + + public readonly modifiedModel = this.modifiedObs.model; public readonly modifiedSelections = observableFromEvent(this, this.modified.onDidChangeCursorSelection, () => this.modified.getSelections() ?? []); public readonly modifiedCursor = derivedOpts({ owner: this, equalsFn: Position.equals }, reader => this.modifiedSelections.read(reader)[0]?.getPosition() ?? new Position(1, 1)); diff --git a/src/vs/editor/browser/widget/diffEditor/components/diffEditorSash.ts b/src/vs/editor/browser/widget/diffEditor/components/diffEditorSash.ts index 3361129a083..8abaddcceb9 100644 --- a/src/vs/editor/browser/widget/diffEditor/components/diffEditorSash.ts +++ b/src/vs/editor/browser/widget/diffEditor/components/diffEditorSash.ts @@ -3,11 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IBoundarySashes, ISashEvent, Orientation, Sash, SashState } from 'vs/base/browser/ui/sash/sash'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IObservable, IReader, ISettableObservable, autorun, observableValue } from 'vs/base/common/observable'; -import { DiffEditorOptions } from '../diffEditorOptions'; -import { derivedWithSetter } from 'vs/base/common/observableInternal/derived'; +import { IBoundarySashes, ISashEvent, Orientation, Sash, SashState } from '../../../../../base/browser/ui/sash/sash.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, IReader, ISettableObservable, autorun, derivedWithSetter, observableValue } from '../../../../../base/common/observable.js'; +import { DiffEditorOptions } from '../diffEditorOptions.js'; export class SashLayout { public readonly sashLeft = derivedWithSetter(this, reader => { diff --git a/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.ts b/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.ts index 6a5283f2491..58e3c511825 100644 --- a/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.ts +++ b/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.ts @@ -3,33 +3,34 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { $, addDisposableListener } from 'vs/base/browser/dom'; -import { ArrayQueue } from 'vs/base/common/arrays'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { Codicon } from 'vs/base/common/codicons'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { IObservable, autorun, derived, derivedWithStore, observableFromEvent, observableValue } from 'vs/base/common/observable'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { assertIsDefined } from 'vs/base/common/types'; -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import { diffDeleteDecoration, diffRemoveIcon } from 'vs/editor/browser/widget/diffEditor/registrations.contribution'; -import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditor/components/diffEditorEditors'; -import { DiffEditorViewModel, DiffMapping } from 'vs/editor/browser/widget/diffEditor/diffEditorViewModel'; -import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget'; -import { InlineDiffDeletedCodeMargin } from 'vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin'; -import { LineSource, RenderOptions, renderLines } from 'vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines'; -import { IObservableViewZone, animatedObservable, joinCombine } from 'vs/editor/browser/widget/diffEditor/utils'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { Position } from 'vs/editor/common/core/position'; -import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { BackgroundTokenizationState } from 'vs/editor/common/tokenizationTextModelPart'; -import { InlineDecoration, InlineDecorationType } from 'vs/editor/common/viewModel'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { DiffEditorOptions } from '../../diffEditorOptions'; +import { $, addDisposableListener } from '../../../../../../base/browser/dom.js'; +import { ArrayQueue } from '../../../../../../base/common/arrays.js'; +import { RunOnceScheduler } from '../../../../../../base/common/async.js'; +import { Codicon } from '../../../../../../base/common/codicons.js'; +import { Disposable, DisposableStore } from '../../../../../../base/common/lifecycle.js'; +import { IObservable, autorun, derived, derivedWithStore, observableFromEvent, observableValue } from '../../../../../../base/common/observable.js'; +import { ThemeIcon } from '../../../../../../base/common/themables.js'; +import { assertIsDefined } from '../../../../../../base/common/types.js'; +import { applyFontInfo } from '../../../../config/domFontInfo.js'; +import { CodeEditorWidget } from '../../../codeEditor/codeEditorWidget.js'; +import { diffDeleteDecoration, diffRemoveIcon } from '../../registrations.contribution.js'; +import { DiffEditorEditors } from '../diffEditorEditors.js'; +import { DiffEditorViewModel, DiffMapping } from '../../diffEditorViewModel.js'; +import { DiffEditorWidget } from '../../diffEditorWidget.js'; +import { InlineDiffDeletedCodeMargin } from './inlineDiffDeletedCodeMargin.js'; +import { LineSource, RenderOptions, renderLines } from './renderLines.js'; +import { IObservableViewZone, animatedObservable, joinCombine } from '../../utils.js'; +import { EditorOption } from '../../../../../common/config/editorOptions.js'; +import { LineRange } from '../../../../../common/core/lineRange.js'; +import { Position } from '../../../../../common/core/position.js'; +import { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js'; +import { ScrollType } from '../../../../../common/editorCommon.js'; +import { BackgroundTokenizationState } from '../../../../../common/tokenizationTextModelPart.js'; +import { InlineDecoration, InlineDecorationType } from '../../../../../common/viewModel.js'; +import { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js'; +import { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js'; +import { DiffEditorOptions } from '../../diffEditorOptions.js'; +import { Range } from '../../../../../common/core/range.js'; /** * Ensures both editors have the same height by aligning unchanged lines. @@ -187,7 +188,7 @@ export class DiffEditorViewZones extends Disposable { const renderOptions = RenderOptions.fromEditor(this._editors.modified); for (const a of alignmentsVal) { - if (a.diff && !renderSideBySide) { + if (a.diff && !renderSideBySide && (!this._options.useTrueInlineDiffRendering.read(reader) || !allowsTrueInlineDiffRendering(a.diff))) { if (!a.originalRange.isEmpty) { originalModelTokenizationCompleted.read(reader); // Update view-zones once tokenization completes @@ -627,3 +628,17 @@ function getAdditionalLineHeights(editor: CodeEditorWidget, viewZonesToIgnore: R return result; } + +export function allowsTrueInlineDiffRendering(mapping: DetailedLineRangeMapping): boolean { + if (!mapping.innerChanges) { + return false; + } + return mapping.innerChanges.every(c => + (rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange)) + || c.originalRange.equalsRange(new Range(1, 1, 1, 1)) + ); +} + +function rangeIsSingleLine(range: Range): boolean { + return range.startLineNumber === range.endLineNumber; +} diff --git a/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.ts b/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.ts index f6d88c3afe7..fa63055ff08 100644 --- a/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.ts +++ b/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { addStandardDisposableListener, getDomNodePagePosition } from 'vs/base/browser/dom'; -import { Action } from 'vs/base/common/actions'; -import { Codicon } from 'vs/base/common/codicons'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { isIOS } from 'vs/base/common/platform'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { EndOfLineSequence, ITextModel } from 'vs/editor/common/model'; -import { localize } from 'vs/nls'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { addStandardDisposableListener, getDomNodePagePosition } from '../../../../../../base/browser/dom.js'; +import { Action } from '../../../../../../base/common/actions.js'; +import { Codicon } from '../../../../../../base/common/codicons.js'; +import { Disposable } from '../../../../../../base/common/lifecycle.js'; +import { isIOS } from '../../../../../../base/common/platform.js'; +import { ThemeIcon } from '../../../../../../base/common/themables.js'; +import { IEditorMouseEvent, MouseTargetType } from '../../../../editorBrowser.js'; +import { CodeEditorWidget } from '../../../codeEditor/codeEditorWidget.js'; +import { DiffEditorWidget } from '../../diffEditorWidget.js'; +import { EditorOption } from '../../../../../common/config/editorOptions.js'; +import { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js'; +import { EndOfLineSequence, ITextModel } from '../../../../../common/model.js'; +import { localize } from '../../../../../../nls.js'; +import { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js'; +import { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js'; export class InlineDiffDeletedCodeMargin extends Disposable { private readonly _diffActions: HTMLElement; diff --git a/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.ts b/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.ts index f9d8b3f9a08..fc20d63c8f0 100644 --- a/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.ts +++ b/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createTrustedTypesPolicy } from 'vs/base/browser/trustedTypes'; -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorFontLigatures, EditorOption, FindComputedEditorOptionValueById } from 'vs/editor/common/config/editorOptions'; -import { FontInfo } from 'vs/editor/common/config/fontInfo'; -import { StringBuilder } from 'vs/editor/common/core/stringBuilder'; -import { ModelLineProjectionData } from 'vs/editor/common/modelLineProjectionData'; -import { IViewLineTokens, LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations'; -import { RenderLineInput, renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer'; -import { InlineDecoration, ViewLineRenderingData } from 'vs/editor/common/viewModel'; +import { createTrustedTypesPolicy } from '../../../../../../base/browser/trustedTypes.js'; +import { applyFontInfo } from '../../../../config/domFontInfo.js'; +import { ICodeEditor } from '../../../../editorBrowser.js'; +import { EditorFontLigatures, EditorOption, FindComputedEditorOptionValueById } from '../../../../../common/config/editorOptions.js'; +import { FontInfo } from '../../../../../common/config/fontInfo.js'; +import { StringBuilder } from '../../../../../common/core/stringBuilder.js'; +import { ModelLineProjectionData } from '../../../../../common/modelLineProjectionData.js'; +import { IViewLineTokens, LineTokens } from '../../../../../common/tokens/lineTokens.js'; +import { LineDecoration } from '../../../../../common/viewLayout/lineDecorations.js'; +import { RenderLineInput, renderViewLine } from '../../../../../common/viewLayout/viewLineRenderer.js'; +import { InlineDecoration, ViewLineRenderingData } from '../../../../../common/viewModel.js'; const ttPolicy = createTrustedTypesPolicy('diffEditorWidget', { createHTML: value => value }); diff --git a/src/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.ts b/src/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.ts index 96a85f35eef..056db97f620 100644 --- a/src/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.ts +++ b/src/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { IDimension } from 'vs/editor/common/core/dimension'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ISelection, Selection } from 'vs/editor/common/core/selection'; -import { IDiffEditorViewModel, IEditor, IEditorAction, IEditorDecorationsCollection, IEditorModel, IEditorViewState, ScrollType } from 'vs/editor/common/editorCommon'; -import { IModelDecorationsChangeAccessor, IModelDeltaDecoration } from 'vs/editor/common/model'; +import { Emitter } from '../../../../base/common/event.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { CodeEditorWidget } from '../codeEditor/codeEditorWidget.js'; +import { IEditorOptions } from '../../../common/config/editorOptions.js'; +import { IDimension } from '../../../common/core/dimension.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { ISelection, Selection } from '../../../common/core/selection.js'; +import { IDiffEditorViewModel, IEditor, IEditorAction, IEditorDecorationsCollection, IEditorModel, IEditorViewState, ScrollType } from '../../../common/editorCommon.js'; +import { IModelDecorationsChangeAccessor, IModelDeltaDecoration } from '../../../common/model.js'; export abstract class DelegatingEditor extends Disposable implements IEditor { private static idCounter = 0; diff --git a/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts b/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts index 75017bce4c3..d264028a749 100644 --- a/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts +++ b/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Codicon } from 'vs/base/common/codicons'; -import { AccessibleDiffViewerNext, AccessibleDiffViewerPrev, CollapseAllUnchangedRegions, ExitCompareMove, RevertHunkOrSelection, ShowAllUnchangedRegions, SwitchSide, ToggleCollapseUnchangedRegions, ToggleShowMovedCodeBlocks, ToggleUseInlineViewWhenSpaceIsLimited } from 'vs/editor/browser/widget/diffEditor/commands'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { localize } from 'vs/nls'; -import { MenuId, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ContextKeyEqualsExpr, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import './registrations.contribution'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { AccessibleDiffViewerNext, AccessibleDiffViewerPrev, CollapseAllUnchangedRegions, ExitCompareMove, RevertHunkOrSelection, ShowAllUnchangedRegions, SwitchSide, ToggleCollapseUnchangedRegions, ToggleShowMovedCodeBlocks, ToggleUseInlineViewWhenSpaceIsLimited } from './commands.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { localize } from '../../../../nls.js'; +import { MenuId, MenuRegistry, registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { ContextKeyEqualsExpr, ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import './registrations.contribution.js'; registerAction2(ToggleCollapseUnchangedRegions); registerAction2(ToggleShowMovedCodeBlocks); diff --git a/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.ts b/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.ts index b53bb2660e3..0c1a533681f 100644 --- a/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.ts +++ b/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.ts @@ -3,11 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IObservable, ISettableObservable, derived, observableFromEvent, observableValue } from 'vs/base/common/observable'; -import { Constants } from 'vs/base/common/uint'; -import { diffEditorDefaultOptions } from 'vs/editor/common/config/diffEditor'; -import { IDiffEditorBaseOptions, IDiffEditorOptions, IEditorOptions, ValidDiffEditorBaseOptions, clampedFloat, clampedInt, boolean as validateBooleanOption, stringSet as validateStringSetOption } from 'vs/editor/common/config/editorOptions'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; +import { IObservable, ISettableObservable, derived, derivedConstOnceDefined, observableFromEvent, observableValue } from '../../../../base/common/observable.js'; +import { Constants } from '../../../../base/common/uint.js'; +import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js'; +import { diffEditorDefaultOptions } from '../../../common/config/diffEditor.js'; +import { IDiffEditorBaseOptions, IDiffEditorOptions, IEditorOptions, ValidDiffEditorBaseOptions, clampedFloat, clampedInt, boolean as validateBooleanOption, stringSet as validateStringSetOption } from '../../../common/config/editorOptions.js'; +import { LineRangeMapping } from '../../../common/diff/rangeMapping.js'; +import { allowsTrueInlineDiffRendering } from './components/diffEditorViewZones/diffEditorViewZones.js'; +import { DiffEditorViewModel, DiffState } from './diffEditorViewModel.js'; export class DiffEditorOptions { private readonly _options: ISettableObservable, { changedOptions: IDiffEditorOptions }>; @@ -31,9 +34,16 @@ export class DiffEditorOptions { ); public readonly renderOverviewRuler = derived(this, reader => this._options.read(reader).renderOverviewRuler); - public readonly renderSideBySide = derived(this, reader => this._options.read(reader).renderSideBySide - && !(this._options.read(reader).useInlineViewWhenSpaceIsLimited && this.couldShowInlineViewBecauseOfSize.read(reader) && !this._screenReaderMode.read(reader)) - ); + public readonly renderSideBySide = derived(this, reader => { + if (this.compactMode.read(reader)) { + if (this.shouldRenderInlineViewInSmartMode.read(reader)) { + return false; + } + } + + return this._options.read(reader).renderSideBySide + && !(this._options.read(reader).useInlineViewWhenSpaceIsLimited && this.couldShowInlineViewBecauseOfSize.read(reader) && !this._screenReaderMode.read(reader)); + }); public readonly readOnly = derived(this, reader => this._options.read(reader).readOnly); public readonly shouldRenderOldRevertArrows = derived(this, reader => { @@ -59,6 +69,14 @@ export class DiffEditorOptions { public readonly diffAlgorithm = derived(this, reader => this._options.read(reader).diffAlgorithm); public readonly showEmptyDecorations = derived(this, reader => this._options.read(reader).experimental.showEmptyDecorations!); public readonly onlyShowAccessibleDiffViewer = derived(this, reader => this._options.read(reader).onlyShowAccessibleDiffViewer); + public readonly compactMode = derived(this, reader => this._options.read(reader).compactMode); + private readonly trueInlineDiffRenderingEnabled: IObservable = derived(this, reader => + this._options.read(reader).experimental.useTrueInlineView! + ); + + public readonly useTrueInlineDiffRendering: IObservable = derived(this, reader => + !this.renderSideBySide.read(reader) && this.trueInlineDiffRenderingEnabled.read(reader) + ); public readonly hideUnchangedRegions = derived(this, reader => this._options.read(reader).hideUnchangedRegions.enabled!); public readonly hideUnchangedRegionsRevealLineCount = derived(this, reader => this._options.read(reader).hideUnchangedRegions.revealLineCount!); @@ -74,9 +92,37 @@ export class DiffEditorOptions { public setWidth(width: number): void { this._diffEditorWidth.set(width, undefined); } + + private readonly _model = observableValue(this, undefined); + + public setModel(model: DiffEditorViewModel | undefined) { + this._model.set(model, undefined); + } + + private readonly shouldRenderInlineViewInSmartMode = this._model + .map(this, model => derivedConstOnceDefined(this, reader => { + const diffs = model?.diff.read(reader); + return diffs ? isSimpleDiff(diffs, this.trueInlineDiffRenderingEnabled.read(reader)) : undefined; + })) + .flatten() + .map(this, v => !!v); + + public readonly inlineViewHideOriginalLineNumbers = this.compactMode; +} + +function isSimpleDiff(diff: DiffState, supportsTrueDiffRendering: boolean): boolean { + return diff.mappings.every(m => isInsertion(m.lineRangeMapping) || isDeletion(m.lineRangeMapping) || (supportsTrueDiffRendering && allowsTrueInlineDiffRendering(m.lineRangeMapping))); +} + +function isInsertion(mapping: LineRangeMapping): boolean { + return mapping.original.length === 0; +} + +function isDeletion(mapping: LineRangeMapping): boolean { + return mapping.modified.length === 0; } -function validateDiffEditorOptions(options: Readonly, defaults: ValidDiffEditorBaseOptions): ValidDiffEditorBaseOptions { +function validateDiffEditorOptions(options: Readonly, defaults: typeof diffEditorDefaultOptions | ValidDiffEditorBaseOptions): ValidDiffEditorBaseOptions { return { enableSplitViewResizing: validateBooleanOption(options.enableSplitViewResizing, defaults.enableSplitViewResizing), splitViewDefaultRatio: clampedFloat(options.splitViewDefaultRatio, 0.5, 0.1, 0.9), @@ -95,6 +141,7 @@ function validateDiffEditorOptions(options: Readonly, defaul experimental: { showMoves: validateBooleanOption(options.experimental?.showMoves, defaults.experimental.showMoves!), showEmptyDecorations: validateBooleanOption(options.experimental?.showEmptyDecorations, defaults.experimental.showEmptyDecorations!), + useTrueInlineView: validateBooleanOption(options.experimental?.useTrueInlineView, defaults.experimental.useTrueInlineView!), }, hideUnchangedRegions: { enabled: validateBooleanOption(options.hideUnchangedRegions?.enabled ?? (options.experimental as any)?.collapseUnchangedRegions, defaults.hideUnchangedRegions.enabled!), @@ -107,5 +154,6 @@ function validateDiffEditorOptions(options: Readonly, defaul renderSideBySideInlineBreakpoint: clampedInt(options.renderSideBySideInlineBreakpoint, defaults.renderSideBySideInlineBreakpoint, 0, Constants.MAX_SAFE_SMALL_INTEGER), useInlineViewWhenSpaceIsLimited: validateBooleanOption(options.useInlineViewWhenSpaceIsLimited, defaults.useInlineViewWhenSpaceIsLimited), renderGutterMenu: validateBooleanOption(options.renderGutterMenu, defaults.renderGutterMenu), + compactMode: validateBooleanOption(options.compactMode, defaults.compactMode), }; } diff --git a/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.ts b/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.ts index b1520c8821f..25a79288cc2 100644 --- a/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.ts +++ b/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.ts @@ -3,26 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, IReader, ISettableObservable, ITransaction, autorun, autorunWithStore, derived, observableSignal, observableSignalFromEvent, observableValue, transaction, waitForState } from 'vs/base/common/observable'; -import { IDiffProviderFactoryService } from 'vs/editor/browser/widget/diffEditor/diffProviderFactoryService'; -import { filterWithPrevious, readHotReloadableExport } from 'vs/editor/browser/widget/diffEditor/utils'; -import { ISerializedLineRange, LineRange, LineRangeSet } from 'vs/editor/common/core/lineRange'; -import { DefaultLinesDiffComputer } from 'vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer'; -import { IDocumentDiff } from 'vs/editor/common/diff/documentDiffProvider'; -import { MovedText } from 'vs/editor/common/diff/linesDiffComputer'; -import { DetailedLineRangeMapping, LineRangeMapping, RangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { IDiffEditorModel, IDiffEditorViewModel } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { TextEditInfo } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper'; -import { combineTextEditInfos } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos'; -import { DiffEditorOptions } from './diffEditorOptions'; -import { optimizeSequenceDiffs } from 'vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations'; -import { isDefined } from 'vs/base/common/types'; -import { groupAdjacentBy } from 'vs/base/common/arrays'; -import { softAssert } from 'vs/base/common/assert'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { Disposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { IObservable, IReader, ISettableObservable, ITransaction, autorun, autorunWithStore, derived, observableSignal, observableSignalFromEvent, observableValue, transaction, waitForState } from '../../../../base/common/observable.js'; +import { IDiffProviderFactoryService } from './diffProviderFactoryService.js'; +import { filterWithPrevious } from './utils.js'; +import { readHotReloadableExport } from '../../../../base/common/hotReloadHelpers.js'; +import { ISerializedLineRange, LineRange, LineRangeSet } from '../../../common/core/lineRange.js'; +import { DefaultLinesDiffComputer } from '../../../common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js'; +import { IDocumentDiff } from '../../../common/diff/documentDiffProvider.js'; +import { MovedText } from '../../../common/diff/linesDiffComputer.js'; +import { DetailedLineRangeMapping, LineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js'; +import { IDiffEditorModel, IDiffEditorViewModel } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; +import { TextEditInfo } from '../../../common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.js'; +import { combineTextEditInfos } from '../../../common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.js'; +import { DiffEditorOptions } from './diffEditorOptions.js'; +import { optimizeSequenceDiffs } from '../../../common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.js'; +import { isDefined } from '../../../../base/common/types.js'; +import { groupAdjacentBy } from '../../../../base/common/arrays.js'; +import { softAssert } from '../../../../base/common/assert.js'; export class DiffEditorViewModel extends Disposable implements IDiffEditorViewModel { private readonly _isDiffUpToDate = observableValue(this, false); @@ -393,6 +394,7 @@ function normalizeRangeMapping(rangeMapping: RangeMapping, original: ITextModel, let originalRange = rangeMapping.originalRange; let modifiedRange = rangeMapping.modifiedRange; if ( + originalRange.startColumn === 1 && modifiedRange.startColumn === 1 && (originalRange.endColumn !== 1 || modifiedRange.endColumn !== 1) && originalRange.endColumn === original.getLineMaxColumn(originalRange.endLineNumber) && modifiedRange.endColumn === modified.getLineMaxColumn(modifiedRange.endLineNumber) diff --git a/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts index 29942806d0c..da2e28f1c44 100644 --- a/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts @@ -2,51 +2,51 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getWindow, h } from 'vs/base/browser/dom'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; -import { findLast } from 'vs/base/common/arraysFind'; -import { BugIndicatingError, onUnexpectedError } from 'vs/base/common/errors'; -import { Event } from 'vs/base/common/event'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, ITransaction, autorun, autorunWithStore, derived, observableFromEvent, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from 'vs/base/common/observable'; -import { derivedDisposable } from 'vs/base/common/observableInternal/derived'; -import 'vs/css!./style'; -import { IEditorConstructionOptions } from 'vs/editor/browser/config/editorConfiguration'; -import { ICodeEditor, IDiffEditor, IDiffEditorConstructionOptions } from 'vs/editor/browser/editorBrowser'; -import { EditorExtensionsRegistry, IDiffEditorContributionDescription } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { StableEditorScrollState } from 'vs/editor/browser/stableEditorScroll'; -import { CodeEditorWidget, ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import { AccessibleDiffViewer, AccessibleDiffViewerModelFromEditors } from 'vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer'; -import { DiffEditorDecorations } from 'vs/editor/browser/widget/diffEditor/components/diffEditorDecorations'; -import { DiffEditorSash, SashLayout } from 'vs/editor/browser/widget/diffEditor/components/diffEditorSash'; -import { DiffEditorViewZones } from 'vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones'; -import { DiffEditorGutter } from 'vs/editor/browser/widget/diffEditor/features/gutterFeature'; -import { HideUnchangedRegionsFeature } from 'vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature'; -import { MovedBlocksLinesFeature } from 'vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature'; -import { OverviewRulerFeature } from 'vs/editor/browser/widget/diffEditor/features/overviewRulerFeature'; -import { RevertButtonsFeature } from 'vs/editor/browser/widget/diffEditor/features/revertButtonsFeature'; -import { CSSStyle, ObservableElementSizeObserver, applyStyle, applyViewZones, readHotReloadableExport, translatePosition } from 'vs/editor/browser/widget/diffEditor/utils'; -import { bindContextKey } from 'vs/platform/observable/common/platformObservableUtils'; -import { IDiffEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { IDimension } from 'vs/editor/common/core/dimension'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { IDiffComputationResult, ILineChange } from 'vs/editor/common/diff/legacyLinesDiffComputer'; -import { LineRangeMapping, RangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { EditorType, IDiffEditorModel, IDiffEditorViewModel, IDiffEditorViewState } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { IIdentifiedSingleEditOperation } from 'vs/editor/common/model'; -import { AccessibilitySignal, IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IEditorProgressService } from 'vs/platform/progress/common/progress'; -import { DiffEditorEditors } from './components/diffEditorEditors'; -import { DelegatingEditor } from './delegatingEditorImpl'; -import { DiffEditorOptions } from './diffEditorOptions'; -import { DiffEditorViewModel, DiffMapping, DiffState } from './diffEditorViewModel'; +import { getWindow, h } from '../../../../base/browser/dom.js'; +import { IBoundarySashes } from '../../../../base/browser/ui/sash/sash.js'; +import { findLast } from '../../../../base/common/arraysFind.js'; +import { BugIndicatingError, onUnexpectedError } from '../../../../base/common/errors.js'; +import { Event } from '../../../../base/common/event.js'; +import { readHotReloadableExport } from '../../../../base/common/hotReloadHelpers.js'; +import { toDisposable } from '../../../../base/common/lifecycle.js'; +import { IObservable, ITransaction, autorun, autorunWithStore, derived, derivedDisposable, disposableObservableValue, observableFromEvent, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from '../../../../base/common/observable.js'; +import { AccessibilitySignal, IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { bindContextKey } from '../../../../platform/observable/common/platformObservableUtils.js'; +import { IEditorProgressService } from '../../../../platform/progress/common/progress.js'; +import { IDiffEditorOptions } from '../../../common/config/editorOptions.js'; +import { IDimension } from '../../../common/core/dimension.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { CursorChangeReason, ICursorPositionChangedEvent } from '../../../common/cursorEvents.js'; +import { IDiffComputationResult, ILineChange } from '../../../common/diff/legacyLinesDiffComputer.js'; +import { LineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js'; +import { EditorType, IDiffEditorModel, IDiffEditorViewModel, IDiffEditorViewState } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { IIdentifiedSingleEditOperation } from '../../../common/model.js'; +import { IEditorConstructionOptions } from '../../config/editorConfiguration.js'; +import { ICodeEditor, IDiffEditor, IDiffEditorConstructionOptions } from '../../editorBrowser.js'; +import { EditorExtensionsRegistry, IDiffEditorContributionDescription } from '../../editorExtensions.js'; +import { ICodeEditorService } from '../../services/codeEditorService.js'; +import { StableEditorScrollState } from '../../stableEditorScroll.js'; +import { CodeEditorWidget, ICodeEditorWidgetOptions } from '../codeEditor/codeEditorWidget.js'; +import { AccessibleDiffViewer, AccessibleDiffViewerModelFromEditors } from './components/accessibleDiffViewer.js'; +import { DiffEditorDecorations } from './components/diffEditorDecorations.js'; +import { DiffEditorEditors } from './components/diffEditorEditors.js'; +import { DiffEditorSash, SashLayout } from './components/diffEditorSash.js'; +import { DiffEditorViewZones } from './components/diffEditorViewZones/diffEditorViewZones.js'; +import { DelegatingEditor } from './delegatingEditorImpl.js'; +import { DiffEditorOptions } from './diffEditorOptions.js'; +import { DiffEditorViewModel, DiffMapping, DiffState } from './diffEditorViewModel.js'; +import { DiffEditorGutter } from './features/gutterFeature.js'; +import { HideUnchangedRegionsFeature } from './features/hideUnchangedRegionsFeature.js'; +import { MovedBlocksLinesFeature } from './features/movedBlocksLinesFeature.js'; +import { OverviewRulerFeature } from './features/overviewRulerFeature.js'; +import { RevertButtonsFeature } from './features/revertButtonsFeature.js'; +import './style.css'; +import { CSSStyle, ObservableElementSizeObserver, RefCounted, applyStyle, applyViewZones, translatePosition } from './utils.js'; export interface IDiffCodeEditorWidgetOptions { originalEditor?: ICodeEditorWidgetOptions; @@ -61,8 +61,8 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor { h('div.editor.modified@modified', { style: { position: 'absolute', height: '100%', } }), h('div.accessibleDiffViewer@accessibleDiffViewer', { style: { position: 'absolute', height: '100%' } }), ]); - private readonly _diffModel = observableValue(this, undefined); - private _shouldDisposeDiffModel = false; + private readonly _diffModelSrc = this._register(disposableObservableValue | undefined>(this, undefined)); + private readonly _diffModel = derived(this, reader => this._diffModelSrc.read(reader)?.object); public readonly onDidChangeModel = Event.fromObservableLight(this._diffModel); public get onDidContentSizeChange() { return this._editors.onDidContentSizeChange; } @@ -317,12 +317,6 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor { } })); - this._register(toDisposable(() => { - if (this._shouldDisposeDiffModel) { - this._diffModel.get()?.dispose(); - } - })); - this._register(autorunWithStore((reader, store) => { store.add(new (readHotReloadableExport(RevertButtonsFeature, reader))(this._editors, this._diffModel, this._options, this)); })); @@ -337,6 +331,10 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor { })); } })); + + this._register(autorun(reader => { + this._options.setModel(this._diffModel.read(reader)); + })); } public getViewWidth(): number { @@ -386,8 +384,13 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor { } else { gutterLeft = 0; + const shouldHideOriginalLineNumbers = this._options.inlineViewHideOriginalLineNumbers.read(reader); originalLeft = gutterWidth; - originalWidth = Math.max(5, this._editors.original.getLayoutInfo().decorationsLeft); + if (shouldHideOriginalLineNumbers) { + originalWidth = 0; + } else { + originalWidth = Math.max(5, this._editors.originalObs.layoutInfoDecorationsLeft.read(reader)); + } modifiedLeft = gutterWidth + originalWidth; modifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth; @@ -473,30 +476,36 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor { override getModel(): IDiffEditorModel | null { return this._diffModel.get()?.model ?? null; } - override setModel(model: IDiffEditorModel | null | IDiffEditorViewModel, tx?: ITransaction): void { - if (!model && this._diffModel.get()) { + override setModel(model: IDiffEditorModel | null | IDiffEditorViewModel): void { + const vm = !model ? null + : ('model' in model) ? RefCounted.create(model).createNewRef(this) + : RefCounted.create(this.createViewModel(model), this); + this.setDiffModel(vm); + } + + setDiffModel(viewModel: RefCounted | null, tx?: ITransaction): void { + const currentModel = this._diffModel.get(); + + if (!viewModel && currentModel) { // Transitioning from a model to no-model this._accessibleDiffViewer.get().close(); } - const vm = model ? ('model' in model) ? { model, shouldDispose: false } : { model: this.createViewModel(model), shouldDispose: true } : undefined; - - if (this._diffModel.get() !== vm?.model) { + if (this._diffModel.get() !== viewModel?.object) { subtransaction(tx, tx => { + const vm = viewModel?.object; /** @description DiffEditorWidget.setModel */ observableFromEvent.batchEventsGlobally(tx, () => { - this._editors.original.setModel(vm ? vm.model.model.original : null); - this._editors.modified.setModel(vm ? vm.model.model.modified : null); + this._editors.original.setModel(vm ? vm.model.original : null); + this._editors.modified.setModel(vm ? vm.model.modified : null); }); - const prevValue = this._diffModel.get(); - const shouldDispose = this._shouldDisposeDiffModel; - - this._shouldDisposeDiffModel = vm?.shouldDispose ?? false; - this._diffModel.set(vm?.model as (DiffEditorViewModel | undefined), tx); - - if (shouldDispose) { - prevValue?.dispose(); - } + const prevValueRef = this._diffModelSrc.get()?.createNewRef(this); + this._diffModelSrc.set(viewModel?.createNewRef(this) as RefCounted | undefined, tx); + setTimeout(() => { + // async, so that this runs after the transaction finished. + // TODO: use the transaction to schedule disposal + prevValueRef?.dispose(); + }, 0); }); } } diff --git a/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.ts b/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.ts index 467518518d1..ab087b4ffb6 100644 --- a/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.ts +++ b/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IInstantiationService, createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { IDocumentDiff, IDocumentDiffProvider, IDocumentDiffProviderOptions } from 'vs/editor/common/diff/documentDiffProvider'; -import { DetailedLineRangeMapping, RangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { ITextModel } from 'vs/editor/common/model'; -import { DiffAlgorithmName, IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { IInstantiationService, createDecorator } from '../../../../platform/instantiation/common/instantiation.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { LineRange } from '../../../common/core/lineRange.js'; +import { IDocumentDiff, IDocumentDiffProvider, IDocumentDiffProviderOptions } from '../../../common/diff/documentDiffProvider.js'; +import { DetailedLineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js'; +import { ITextModel } from '../../../common/model.js'; +import { DiffAlgorithmName, IEditorWorkerService } from '../../../common/services/editorWorker.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; export const IDiffProviderFactoryService = createDecorator('diffProviderFactoryService'); @@ -152,7 +152,7 @@ export class WorkerBasedDocumentDiffProvider implements IDocumentDiffProvider, I // max 10 items in cache if (WorkerBasedDocumentDiffProvider.diffCache.size > 10) { - WorkerBasedDocumentDiffProvider.diffCache.delete(WorkerBasedDocumentDiffProvider.diffCache.keys().next().value); + WorkerBasedDocumentDiffProvider.diffCache.delete(WorkerBasedDocumentDiffProvider.diffCache.keys().next().value!); } WorkerBasedDocumentDiffProvider.diffCache.set(uriKey, { result, context }); diff --git a/src/vs/editor/browser/widget/diffEditor/embeddedDiffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditor/embeddedDiffEditorWidget.ts index 9156c17ead3..ce41de7bc70 100644 --- a/src/vs/editor/browser/widget/diffEditor/embeddedDiffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditor/embeddedDiffEditorWidget.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as objects from 'vs/base/common/objects'; -import { ICodeEditor, IDiffEditorConstructionOptions } from 'vs/editor/browser/editorBrowser'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { DiffEditorWidget, IDiffCodeEditorWidgetOptions } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget'; -import { ConfigurationChangedEvent, IDiffEditorOptions, IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IEditorProgressService } from 'vs/platform/progress/common/progress'; +import * as objects from '../../../../base/common/objects.js'; +import { ICodeEditor, IDiffEditorConstructionOptions } from '../../editorBrowser.js'; +import { ICodeEditorService } from '../../services/codeEditorService.js'; +import { DiffEditorWidget, IDiffCodeEditorWidgetOptions } from './diffEditorWidget.js'; +import { ConfigurationChangedEvent, IDiffEditorOptions, IEditorOptions } from '../../../common/config/editorOptions.js'; +import { IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IEditorProgressService } from '../../../../platform/progress/common/progress.js'; export class EmbeddedDiffEditorWidget extends DiffEditorWidget { private readonly _parentEditor: ICodeEditor; diff --git a/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.ts b/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.ts index 010fba5ec96..556378aebf3 100644 --- a/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.ts +++ b/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.ts @@ -3,34 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EventType, addDisposableListener, h } from 'vs/base/browser/dom'; -import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; -import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; -import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IObservable, autorun, autorunWithStore, derived, observableFromEvent, observableValue } from 'vs/base/common/observable'; -import { derivedDisposable, derivedWithSetter } from 'vs/base/common/observableInternal/derived'; -import { URI } from 'vs/base/common/uri'; -import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditor/components/diffEditorEditors'; -import { DiffEditorSash, SashLayout } from 'vs/editor/browser/widget/diffEditor/components/diffEditorSash'; -import { DiffEditorOptions } from 'vs/editor/browser/widget/diffEditor/diffEditorOptions'; -import { DiffEditorViewModel } from 'vs/editor/browser/widget/diffEditor/diffEditorViewModel'; -import { appendRemoveOnDispose, applyStyle, prependRemoveOnDispose } from 'vs/editor/browser/widget/diffEditor/utils'; -import { EditorGutter, IGutterItemInfo, IGutterItemView } from 'vs/editor/browser/widget/diffEditor/utils/editorGutter'; -import { ActionRunnerWithContext } from 'vs/editor/browser/widget/multiDiffEditor/utils'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { LineRange, LineRangeSet } from 'vs/editor/common/core/lineRange'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { Range } from 'vs/editor/common/core/range'; -import { TextEdit } from 'vs/editor/common/core/textEdit'; -import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { TextModelText } from 'vs/editor/common/model/textModelText'; -import { HiddenItemStrategy, MenuWorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { WorkbenchHoverDelegate } from 'vs/platform/hover/browser/hover'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { EventType, addDisposableListener, h } from '../../../../../base/browser/dom.js'; +import { IMouseWheelEvent } from '../../../../../base/browser/mouseEvent.js'; +import { ActionsOrientation } from '../../../../../base/browser/ui/actionbar/actionbar.js'; +import { HoverPosition } from '../../../../../base/browser/ui/hover/hoverWidget.js'; +import { IBoundarySashes } from '../../../../../base/browser/ui/sash/sash.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, autorun, autorunWithStore, derived, derivedDisposable, derivedWithSetter, observableFromEvent, observableValue } from '../../../../../base/common/observable.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { HiddenItemStrategy, MenuWorkbenchToolBar } from '../../../../../platform/actions/browser/toolbar.js'; +import { IMenuService, MenuId } from '../../../../../platform/actions/common/actions.js'; +import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; +import { WorkbenchHoverDelegate } from '../../../../../platform/hover/browser/hover.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { LineRange, LineRangeSet } from '../../../../common/core/lineRange.js'; +import { OffsetRange } from '../../../../common/core/offsetRange.js'; +import { Range } from '../../../../common/core/range.js'; +import { TextEdit } from '../../../../common/core/textEdit.js'; +import { DetailedLineRangeMapping } from '../../../../common/diff/rangeMapping.js'; +import { TextModelText } from '../../../../common/model/textModelText.js'; +import { ActionRunnerWithContext } from '../../multiDiffEditor/utils.js'; +import { DiffEditorEditors } from '../components/diffEditorEditors.js'; +import { DiffEditorSash, SashLayout } from '../components/diffEditorSash.js'; +import { DiffEditorOptions } from '../diffEditorOptions.js'; +import { DiffEditorViewModel } from '../diffEditorViewModel.js'; +import { appendRemoveOnDispose, applyStyle, prependRemoveOnDispose } from '../utils.js'; +import { EditorGutter, IGutterItemInfo, IGutterItemView } from '../utils/editorGutter.js'; const emptyArr: never[] = []; const width = 35; @@ -81,40 +80,42 @@ export class DiffEditorGutter extends Disposable { ); }).recomputeInitiallyAndOnChange(this._store); - this._register(new EditorGutter(this._editors.modified, this.elements.root, { - getIntersectingGutterItems: (range, reader) => { - const model = this._diffModel.read(reader); - if (!model) { - return []; - } - const diffs = model.diff.read(reader); - if (!diffs) { return []; } - - const selection = this._selectedDiffs.read(reader); - if (selection.length > 0) { - const m = DetailedLineRangeMapping.fromRangeMappings(selection.flatMap(s => s.rangeMappings)); - return [ - new DiffGutterItem( - m, - true, - MenuId.DiffEditorSelectionToolbar, - undefined, - model.model.original.uri, - model.model.modified.uri, - )]; - } + const gutterItems = derived(this, reader => { + const model = this._diffModel.read(reader); + if (!model) { + return []; + } + const diffs = model.diff.read(reader); + if (!diffs) { return []; } + + const selection = this._selectedDiffs.read(reader); + if (selection.length > 0) { + const m = DetailedLineRangeMapping.fromRangeMappings(selection.flatMap(s => s.rangeMappings)); + return [ + new DiffGutterItem( + m, + true, + MenuId.DiffEditorSelectionToolbar, + undefined, + model.model.original.uri, + model.model.modified.uri, + )]; + } - const currentDiff = this._currentDiff.read(reader); + const currentDiff = this._currentDiff.read(reader); - return diffs.mappings.map(m => new DiffGutterItem( - m.lineRangeMapping.withInnerChangesFromLineRanges(), - m.lineRangeMapping === currentDiff?.lineRangeMapping, - MenuId.DiffEditorHunkToolbar, - undefined, - model.model.original.uri, - model.model.modified.uri, - )); - }, + return diffs.mappings.map(m => new DiffGutterItem( + m.lineRangeMapping.withInnerChangesFromLineRanges(), + m.lineRangeMapping === currentDiff?.lineRangeMapping, + MenuId.DiffEditorHunkToolbar, + undefined, + model.model.original.uri, + model.model.modified.uri, + )); + }); + + this._register(new EditorGutter(this._editors.modified, this.elements.root, { + getIntersectingGutterItems: (range, reader) => gutterItems.read(reader), createView: (item, target) => { return this._instantiationService.createInstance(DiffToolBar, item, target, this); }, diff --git a/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.ts b/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.ts index 248f2b46d81..e87fe47e055 100644 --- a/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.ts +++ b/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.ts @@ -3,35 +3,42 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { $, addDisposableListener, getWindow, h, reset } from 'vs/base/browser/dom'; -import { renderIcon, renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels'; -import { Codicon } from 'vs/base/common/codicons'; -import { MarkdownString } from 'vs/base/common/htmlContent'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, IReader, autorun, derived, derivedWithStore, observableFromEvent, observableValue, transaction } from 'vs/base/common/observable'; -import { derivedDisposable } from 'vs/base/common/observableInternal/derived'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { isDefined } from 'vs/base/common/types'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditor/components/diffEditorEditors'; -import { DiffEditorOptions } from 'vs/editor/browser/widget/diffEditor/diffEditorOptions'; -import { DiffEditorViewModel, RevealPreference, UnchangedRegion } from 'vs/editor/browser/widget/diffEditor/diffEditorViewModel'; -import { IObservableViewZone, PlaceholderViewZone, ViewZoneOverlayWidget, applyObservableDecorations, applyStyle } from 'vs/editor/browser/widget/diffEditor/utils'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { SymbolKind, SymbolKinds } from 'vs/editor/common/languages'; -import { IModelDecorationOptions, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model'; -import { localize } from 'vs/nls'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { $, addDisposableListener, getWindow, h, reset } from '../../../../../base/browser/dom.js'; +import { renderIcon, renderLabelWithIcons } from '../../../../../base/browser/ui/iconLabel/iconLabels.js'; +import { Codicon } from '../../../../../base/common/codicons.js'; +import { MarkdownString } from '../../../../../base/common/htmlContent.js'; +import { Disposable, IDisposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, IReader, autorun, derived, derivedDisposable, derivedWithStore, observableValue, transaction } from '../../../../../base/common/observable.js'; +import { ThemeIcon } from '../../../../../base/common/themables.js'; +import { isDefined } from '../../../../../base/common/types.js'; +import { localize } from '../../../../../nls.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { LineRange } from '../../../../common/core/lineRange.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { CursorChangeReason } from '../../../../common/cursorEvents.js'; +import { SymbolKind, SymbolKinds } from '../../../../common/languages.js'; +import { IModelDecorationOptions, IModelDeltaDecoration, ITextModel } from '../../../../common/model.js'; +import { ICodeEditor } from '../../../editorBrowser.js'; +import { observableCodeEditor } from '../../../observableCodeEditor.js'; +import { DiffEditorEditors } from '../components/diffEditorEditors.js'; +import { DiffEditorOptions } from '../diffEditorOptions.js'; +import { DiffEditorViewModel, RevealPreference, UnchangedRegion } from '../diffEditorViewModel.js'; +import { IObservableViewZone, PlaceholderViewZone, ViewZoneOverlayWidget, applyObservableDecorations, applyStyle } from '../utils.js'; /** * Make sure to add the view zones to the editor! */ export class HideUnchangedRegionsFeature extends Disposable { - private static readonly _breadcrumbsSourceFactory = observableValue<((textModel: ITextModel, instantiationService: IInstantiationService) => IDiffEditorBreadcrumbsSource) | undefined>('breadcrumbsSourceFactory', undefined); + private static readonly _breadcrumbsSourceFactory = observableValue<((textModel: ITextModel, instantiationService: IInstantiationService) => IDiffEditorBreadcrumbsSource)>( + HideUnchangedRegionsFeature, () => ({ + dispose() { + }, + getBreadcrumbItems(startRange, reader) { + return []; + }, + })); public static setBreadcrumbsSourceFactory(factory: (textModel: ITextModel, instantiationService: IInstantiationService) => IDiffEditorBreadcrumbsSource) { this._breadcrumbsSourceFactory.set(factory, undefined); } @@ -97,41 +104,72 @@ export class HideUnchangedRegionsFeature extends Disposable { const modViewZones: IObservableViewZone[] = []; const sideBySide = this._options.renderSideBySide.read(reader); + const compactMode = this._options.compactMode.read(reader); + const curUnchangedRegions = unchangedRegions.read(reader); - for (const r of curUnchangedRegions) { + for (let i = 0; i < curUnchangedRegions.length; i++) { + const r = curUnchangedRegions[i]; if (r.shouldHideControls(reader)) { continue; } - { - const d = derived(this, reader => /** @description hiddenOriginalRangeStart */ r.getHiddenOriginalRange(reader).startLineNumber - 1); - const origVz = new PlaceholderViewZone(d, 24); - origViewZones.push(origVz); - store.add(new CollapsedCodeOverlayWidget( - this._editors.original, - origVz, - r, - r.originalUnchangedRange, - !sideBySide, - modifiedOutlineSource, - l => this._diffModel.get()!.ensureModifiedLineIsVisible(l, RevealPreference.FromBottom, undefined), - this._options, - )); + if (compactMode && (i === 0 || i === curUnchangedRegions.length - 1)) { + continue; } - { - const d = derived(this, reader => /** @description hiddenModifiedRangeStart */ r.getHiddenModifiedRange(reader).startLineNumber - 1); - const modViewZone = new PlaceholderViewZone(d, 24); - modViewZones.push(modViewZone); - store.add(new CollapsedCodeOverlayWidget( - this._editors.modified, - modViewZone, - r, - r.modifiedUnchangedRange, - false, - modifiedOutlineSource, - l => this._diffModel.get()!.ensureModifiedLineIsVisible(l, RevealPreference.FromBottom, undefined), - this._options, - )); + + if (compactMode) { + { + const d = derived(this, reader => /** @description hiddenOriginalRangeStart */ r.getHiddenOriginalRange(reader).startLineNumber - 1); + const origVz = new PlaceholderViewZone(d, 12); + origViewZones.push(origVz); + store.add(new CompactCollapsedCodeOverlayWidget( + this._editors.original, + origVz, + r, + !sideBySide, + )); + } + { + const d = derived(this, reader => /** @description hiddenModifiedRangeStart */ r.getHiddenModifiedRange(reader).startLineNumber - 1); + const modViewZone = new PlaceholderViewZone(d, 12); + modViewZones.push(modViewZone); + store.add(new CompactCollapsedCodeOverlayWidget( + this._editors.modified, + modViewZone, + r, + )); + } + } else { + { + const d = derived(this, reader => /** @description hiddenOriginalRangeStart */ r.getHiddenOriginalRange(reader).startLineNumber - 1); + const origVz = new PlaceholderViewZone(d, 24); + origViewZones.push(origVz); + store.add(new CollapsedCodeOverlayWidget( + this._editors.original, + origVz, + r, + r.originalUnchangedRange, + !sideBySide, + modifiedOutlineSource, + l => this._diffModel.get()!.ensureModifiedLineIsVisible(l, RevealPreference.FromBottom, undefined), + this._options, + )); + } + { + const d = derived(this, reader => /** @description hiddenModifiedRangeStart */ r.getHiddenModifiedRange(reader).startLineNumber - 1); + const modViewZone = new PlaceholderViewZone(d, 24); + modViewZones.push(modViewZone); + store.add(new CollapsedCodeOverlayWidget( + this._editors.modified, + modViewZone, + r, + r.modifiedUnchangedRange, + false, + modifiedOutlineSource, + l => this._diffModel.get()!.ensureModifiedLineIsVisible(l, RevealPreference.FromBottom, undefined), + this._options, + )); + } } } @@ -228,6 +266,39 @@ export class HideUnchangedRegionsFeature extends Disposable { } } +class CompactCollapsedCodeOverlayWidget extends ViewZoneOverlayWidget { + private readonly _nodes = h('div.diff-hidden-lines-compact', [ + h('div.line-left', []), + h('div.text@text', []), + h('div.line-right', []) + ]); + + constructor( + editor: ICodeEditor, + _viewZone: PlaceholderViewZone, + private readonly _unchangedRegion: UnchangedRegion, + private readonly _hide: boolean = false, + ) { + const root = h('div.diff-hidden-lines-widget'); + super(editor, _viewZone, root.root); + root.root.appendChild(this._nodes.root); + + if (this._hide) { + this._nodes.root.replaceChildren(); + } + + this._register(autorun(reader => { + /** @description update labels */ + + if (!this._hide) { + const lineCount = this._unchangedRegion.getHiddenModifiedRange(reader).length; + const linesHiddenText = localize('hiddenLines', '{0} hidden lines', lineCount); + this._nodes.text.innerText = linesHiddenText; + } + })); + } +} + class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget { private readonly _nodes = h('div.diff-hidden-lines', [ h('div.top@top', { title: localize('diff.hiddenLines.top', 'Click or drag to show more above') }), @@ -255,12 +326,8 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget { super(_editor, _viewZone, root.root); root.root.appendChild(this._nodes.root); - const layoutInfo = observableFromEvent(this._editor.onDidLayoutChange, () => - this._editor.getLayoutInfo() - ); - if (!this._hide) { - this._register(applyStyle(this._nodes.first, { width: layoutInfo.map((l) => l.contentLeft) })); + this._register(applyStyle(this._nodes.first, { width: observableCodeEditor(this._editor).layoutInfoContentLeft })); } else { reset(this._nodes.first); } diff --git a/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.ts b/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.ts index afb29693f81..a06947da06d 100644 --- a/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.ts +++ b/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { h } from 'vs/base/browser/dom'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { Action } from 'vs/base/common/actions'; -import { booleanComparator, compareBy, numberComparator, tieBreakComparators } from 'vs/base/common/arrays'; -import { findMaxIdx } from 'vs/base/common/arraysFind'; -import { Codicon } from 'vs/base/common/codicons'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, autorun, autorunHandleChanges, autorunWithStore, constObservable, derived, derivedWithStore, observableFromEvent, observableSignalFromEvent, observableValue, recomputeInitiallyAndOnChange } from 'vs/base/common/observable'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditor/components/diffEditorEditors'; -import { DiffEditorViewModel } from 'vs/editor/browser/widget/diffEditor/diffEditorViewModel'; -import { PlaceholderViewZone, ViewZoneOverlayWidget, applyStyle, applyViewZones } from 'vs/editor/browser/widget/diffEditor/utils'; -import { EditorLayoutInfo } from 'vs/editor/common/config/editorOptions'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { OffsetRange, OffsetRangeSet } from 'vs/editor/common/core/offsetRange'; -import { MovedText } from 'vs/editor/common/diff/linesDiffComputer'; -import { localize } from 'vs/nls'; +import { h } from '../../../../../base/browser/dom.js'; +import { ActionBar } from '../../../../../base/browser/ui/actionbar/actionbar.js'; +import { Action } from '../../../../../base/common/actions.js'; +import { booleanComparator, compareBy, numberComparator, tieBreakComparators } from '../../../../../base/common/arrays.js'; +import { findMaxIdx } from '../../../../../base/common/arraysFind.js'; +import { Codicon } from '../../../../../base/common/codicons.js'; +import { Disposable, toDisposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, autorun, autorunHandleChanges, autorunWithStore, constObservable, derived, derivedWithStore, observableFromEvent, observableSignalFromEvent, observableValue, recomputeInitiallyAndOnChange } from '../../../../../base/common/observable.js'; +import { ThemeIcon } from '../../../../../base/common/themables.js'; +import { ICodeEditor } from '../../../editorBrowser.js'; +import { DiffEditorEditors } from '../components/diffEditorEditors.js'; +import { DiffEditorViewModel } from '../diffEditorViewModel.js'; +import { PlaceholderViewZone, ViewZoneOverlayWidget, applyStyle, applyViewZones } from '../utils.js'; +import { EditorLayoutInfo } from '../../../../common/config/editorOptions.js'; +import { LineRange } from '../../../../common/core/lineRange.js'; +import { OffsetRange, OffsetRangeSet } from '../../../../common/core/offsetRange.js'; +import { MovedText } from '../../../../common/diff/linesDiffComputer.js'; +import { localize } from '../../../../../nls.js'; export class MovedBlocksLinesFeature extends Disposable { public static readonly movedCodeBlockPadding = 4; diff --git a/src/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.ts b/src/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.ts index 8141cd9452c..1db18e1478b 100644 --- a/src/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.ts +++ b/src/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EventType, addDisposableListener, addStandardDisposableListener, h } from 'vs/base/browser/dom'; -import { createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; -import { ScrollbarState } from 'vs/base/browser/ui/scrollbar/scrollbarState'; -import { Color } from 'vs/base/common/color'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IObservable, autorun, autorunWithStore, derived, observableFromEvent, observableSignalFromEvent } from 'vs/base/common/observable'; -import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditor/components/diffEditorEditors'; -import { DiffEditorViewModel } from 'vs/editor/browser/widget/diffEditor/diffEditorViewModel'; -import { appendRemoveOnDispose } from 'vs/editor/browser/widget/diffEditor/utils'; -import { EditorLayoutInfo, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { Position } from 'vs/editor/common/core/position'; -import { OverviewRulerZone } from 'vs/editor/common/viewModel/overviewZoneManager'; -import { defaultInsertColor, defaultRemoveColor, diffInserted, diffOverviewRulerInserted, diffOverviewRulerRemoved, diffRemoved } from 'vs/platform/theme/common/colorRegistry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { EventType, addDisposableListener, addStandardDisposableListener, h } from '../../../../../base/browser/dom.js'; +import { createFastDomNode } from '../../../../../base/browser/fastDomNode.js'; +import { IMouseWheelEvent } from '../../../../../base/browser/mouseEvent.js'; +import { ScrollbarState } from '../../../../../base/browser/ui/scrollbar/scrollbarState.js'; +import { Color } from '../../../../../base/common/color.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, autorun, autorunWithStore, derived, observableFromEvent, observableSignalFromEvent } from '../../../../../base/common/observable.js'; +import { CodeEditorWidget } from '../../codeEditor/codeEditorWidget.js'; +import { DiffEditorEditors } from '../components/diffEditorEditors.js'; +import { DiffEditorViewModel } from '../diffEditorViewModel.js'; +import { appendRemoveOnDispose } from '../utils.js'; +import { EditorLayoutInfo, EditorOption } from '../../../../common/config/editorOptions.js'; +import { LineRange } from '../../../../common/core/lineRange.js'; +import { Position } from '../../../../common/core/position.js'; +import { OverviewRulerZone } from '../../../../common/viewModel/overviewZoneManager.js'; +import { defaultInsertColor, defaultRemoveColor, diffInserted, diffOverviewRulerInserted, diffOverviewRulerRemoved, diffRemoved } from '../../../../../platform/theme/common/colorRegistry.js'; +import { IThemeService } from '../../../../../platform/theme/common/themeService.js'; export class OverviewRulerFeature extends Disposable { private static readonly ONE_OVERVIEW_WIDTH = 15; - public static readonly ENTIRE_DIFF_OVERVIEW_WIDTH = OverviewRulerFeature.ONE_OVERVIEW_WIDTH * 2; + public static readonly ENTIRE_DIFF_OVERVIEW_WIDTH = this.ONE_OVERVIEW_WIDTH * 2; public readonly width = OverviewRulerFeature.ENTIRE_DIFF_OVERVIEW_WIDTH; constructor( diff --git a/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.ts b/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.ts index b2a7d382320..2d94b6e0657 100644 --- a/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.ts +++ b/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { addDisposableListener, h, EventType } from 'vs/base/browser/dom'; -import { renderIcon } from 'vs/base/browser/ui/iconLabel/iconLabels'; -import { Codicon } from 'vs/base/common/codicons'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, autorunWithStore, derived } from 'vs/base/common/observable'; -import { IGlyphMarginWidget, IGlyphMarginWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditor/components/diffEditorEditors'; -import { DiffEditorOptions } from 'vs/editor/browser/widget/diffEditor/diffEditorOptions'; -import { DiffEditorViewModel } from 'vs/editor/browser/widget/diffEditor/diffEditorViewModel'; -import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget'; -import { LineRange, LineRangeSet } from 'vs/editor/common/core/lineRange'; -import { Range } from 'vs/editor/common/core/range'; -import { LineRangeMapping, RangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { GlyphMarginLane } from 'vs/editor/common/model'; -import { localize } from 'vs/nls'; +import { addDisposableListener, h, EventType } from '../../../../../base/browser/dom.js'; +import { renderIcon } from '../../../../../base/browser/ui/iconLabel/iconLabels.js'; +import { Codicon } from '../../../../../base/common/codicons.js'; +import { Disposable, toDisposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, autorunWithStore, derived } from '../../../../../base/common/observable.js'; +import { IGlyphMarginWidget, IGlyphMarginWidgetPosition } from '../../../editorBrowser.js'; +import { DiffEditorEditors } from '../components/diffEditorEditors.js'; +import { DiffEditorOptions } from '../diffEditorOptions.js'; +import { DiffEditorViewModel } from '../diffEditorViewModel.js'; +import { DiffEditorWidget } from '../diffEditorWidget.js'; +import { LineRange, LineRangeSet } from '../../../../common/core/lineRange.js'; +import { Range } from '../../../../common/core/range.js'; +import { LineRangeMapping, RangeMapping } from '../../../../common/diff/rangeMapping.js'; +import { GlyphMarginLane } from '../../../../common/model.js'; +import { localize } from '../../../../../nls.js'; const emptyArr: never[] = []; diff --git a/src/vs/editor/browser/widget/diffEditor/registrations.contribution.ts b/src/vs/editor/browser/widget/diffEditor/registrations.contribution.ts index 36bd4d465ff..2194ddadb7c 100644 --- a/src/vs/editor/browser/widget/diffEditor/registrations.contribution.ts +++ b/src/vs/editor/browser/widget/diffEditor/registrations.contribution.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { localize } from 'vs/nls'; -import { registerColor } from 'vs/platform/theme/common/colorRegistry'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { localize } from '../../../../nls.js'; +import { registerColor } from '../../../../platform/theme/common/colorRegistry.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; export const diffMoveBorder = registerColor( 'diffEditor.move.border', - { dark: '#8b8b8b9c', light: '#8b8b8b9c', hcDark: '#8b8b8b9c', hcLight: '#8b8b8b9c', }, + '#8b8b8b9c', localize('diffEditor.move.border', 'The border color for text that got moved in the diff editor.') ); export const diffMoveBorderActive = registerColor( 'diffEditor.moveActive.border', - { dark: '#FFA500', light: '#FFA500', hcDark: '#FFA500', hcLight: '#FFA500', }, + '#FFA500', localize('diffEditor.moveActive.border', 'The active border color for text that got moved in the diff editor.') ); diff --git a/src/vs/editor/browser/widget/diffEditor/style.css b/src/vs/editor/browser/widget/diffEditor/style.css index ebb52234658..4489d84be38 100644 --- a/src/vs/editor/browser/widget/diffEditor/style.css +++ b/src/vs/editor/browser/widget/diffEditor/style.css @@ -276,10 +276,14 @@ background-color: var(--vscode-diffEditorGutter-insertedLineBackground, var(--vscode-diffEditor-insertedLineBackground), var(--vscode-diffEditor-insertedTextBackground)); } -.monaco-editor .char-delete, .monaco-diff-editor .char-delete { +.monaco-editor .char-delete, .monaco-diff-editor .char-delete, .monaco-editor .inline-deleted-text { background-color: var(--vscode-diffEditor-removedTextBackground); } +.monaco-editor .inline-deleted-text { + text-decoration: line-through; +} + .monaco-editor .line-delete, .monaco-diff-editor .line-delete { background-color: var(--vscode-diffEditor-removedLineBackground, var(--vscode-diffEditor-removedTextBackground)); } @@ -395,3 +399,29 @@ } } } + + +.monaco-diff-editor .diff-hidden-lines-compact { + display: flex; + height: 11px; + .line-left, .line-right { + height: 1px; + border-top: 1px solid; + border-color: var(--vscode-editorCodeLens-foreground); + opacity: 0.5; + margin: auto; + width: 100%; + } + + .line-left { + width: 20px; + } + + .text { + color: var(--vscode-editorCodeLens-foreground); + text-wrap: nowrap; + font-size: 11px; + line-height: 11px; + margin: 0 4px; + } +} diff --git a/src/vs/editor/browser/widget/diffEditor/utils.ts b/src/vs/editor/browser/widget/diffEditor/utils.ts index 99d9580c94a..b69c5ff8f8c 100644 --- a/src/vs/editor/browser/widget/diffEditor/utils.ts +++ b/src/vs/editor/browser/widget/diffEditor/utils.ts @@ -3,19 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDimension } from 'vs/base/browser/dom'; -import { findLast } from 'vs/base/common/arraysFind'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { isHotReloadEnabled, registerHotReloadHandler } from 'vs/base/common/hotReload'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, IReader, ISettableObservable, autorun, autorunHandleChanges, autorunOpts, autorunWithStore, observableSignalFromEvent, observableValue, transaction } from 'vs/base/common/observable'; -import { ElementSizeObserver } from 'vs/editor/browser/config/elementSizeObserver'; -import { ICodeEditor, IOverlayWidget, IViewZone } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { IModelDeltaDecoration } from 'vs/editor/common/model'; -import { TextLength } from 'vs/editor/common/core/textLength'; +import { IDimension } from '../../../../base/browser/dom.js'; +import { findLast } from '../../../../base/common/arraysFind.js'; +import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { Disposable, DisposableStore, IDisposable, IReference, toDisposable } from '../../../../base/common/lifecycle.js'; +import { IObservable, ISettableObservable, autorun, autorunHandleChanges, autorunOpts, autorunWithStore, observableValue, transaction } from '../../../../base/common/observable.js'; +import { ElementSizeObserver } from '../../config/elementSizeObserver.js'; +import { ICodeEditor, IOverlayWidget, IViewZone } from '../../editorBrowser.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { DetailedLineRangeMapping } from '../../../common/diff/rangeMapping.js'; +import { IModelDeltaDecoration } from '../../../common/model.js'; +import { TextLength } from '../../../common/core/textLength.js'; export function joinCombine(arr1: readonly T[], arr2: readonly T[], keySelector: (val: T) => number, combine: (v1: T, v2: T) => T): readonly T[] { if (arr1.length === 0) { @@ -298,29 +297,6 @@ export function applyStyle(domNode: HTMLElement, style: Partial<{ [TKey in keyof }); } -export function readHotReloadableExport(value: T, reader: IReader | undefined): T { - observeHotReloadableExports([value], reader); - return value; -} - -export function observeHotReloadableExports(values: any[], reader: IReader | undefined): void { - if (isHotReloadEnabled()) { - const o = observableSignalFromEvent( - 'reload', - event => registerHotReloadHandler(({ oldExports }) => { - if (![...Object.values(oldExports)].some(v => values.includes(v))) { - return undefined; - } - return (_newExports) => { - event(undefined); - return true; - }; - }) - ); - o.read(reader); - } -} - export function applyViewZones(editor: ICodeEditor, viewZones: IObservable, setIsUpdating?: (isUpdatingViewZones: boolean) => void, zoneIds?: Set): IDisposable { const store = new DisposableStore(); const lastViewZoneIds: string[] = []; @@ -439,3 +415,104 @@ export function filterWithPrevious(arr: T[], filter: (cur: T, prev: T | undef return result; }); } + +export interface IRefCounted extends IDisposable { + createNewRef(): this; +} + +export abstract class RefCounted implements IDisposable, IReference { + public static create(value: T, debugOwner: object | undefined = undefined): RefCounted { + return new BaseRefCounted(value, value, debugOwner); + } + + public static createWithDisposable(value: T, disposable: IDisposable, debugOwner: object | undefined = undefined): RefCounted { + const store = new DisposableStore(); + store.add(disposable); + store.add(value); + return new BaseRefCounted(value, store, debugOwner); + } + + public static createOfNonDisposable(value: T, disposable: IDisposable, debugOwner: object | undefined = undefined): RefCounted { + return new BaseRefCounted(value, disposable, debugOwner); + } + + public abstract createNewRef(debugOwner?: object | undefined): RefCounted; + + public abstract dispose(): void; + + public abstract get object(): T; +} + +class BaseRefCounted extends RefCounted { + private _refCount = 1; + private _isDisposed = false; + private readonly _owners: object[] = []; + + constructor( + public override readonly object: T, + private readonly _disposable: IDisposable, + private readonly _debugOwner: object | undefined, + ) { + super(); + + if (_debugOwner) { + this._addOwner(_debugOwner); + } + } + + private _addOwner(debugOwner: object | undefined) { + if (debugOwner) { + this._owners.push(debugOwner); + } + } + + public createNewRef(debugOwner?: object | undefined): RefCounted { + this._refCount++; + if (debugOwner) { + this._addOwner(debugOwner); + } + return new ClonedRefCounted(this, debugOwner); + } + + public dispose(): void { + if (this._isDisposed) { return; } + this._isDisposed = true; + this._decreaseRefCount(this._debugOwner); + } + + public _decreaseRefCount(debugOwner?: object | undefined): void { + this._refCount--; + if (this._refCount === 0) { + this._disposable.dispose(); + } + + if (debugOwner) { + const idx = this._owners.indexOf(debugOwner); + if (idx !== -1) { + this._owners.splice(idx, 1); + } + } + } +} + +class ClonedRefCounted extends RefCounted { + private _isDisposed = false; + constructor( + private readonly _base: BaseRefCounted, + private readonly _debugOwner: object | undefined, + ) { + super(); + } + + public get object(): T { return this._base.object; } + + public createNewRef(debugOwner?: object | undefined): RefCounted { + return this._base.createNewRef(debugOwner); + } + + public dispose(): void { + if (this._isDisposed) { return; } + this._isDisposed = true; + this._base._decreaseRefCount(this._debugOwner); + } +} diff --git a/src/vs/editor/browser/widget/diffEditor/utils/editorGutter.ts b/src/vs/editor/browser/widget/diffEditor/utils/editorGutter.ts index a301fc6124b..bc149ec17ea 100644 --- a/src/vs/editor/browser/widget/diffEditor/utils/editorGutter.ts +++ b/src/vs/editor/browser/widget/diffEditor/utils/editorGutter.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { h, reset } from 'vs/base/browser/dom'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { autorun, IObservable, IReader, ISettableObservable, observableFromEvent, observableSignal, observableSignalFromEvent, observableValue, transaction } from 'vs/base/common/observable'; -import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; +import { h, reset } from '../../../../../base/browser/dom.js'; +import { Disposable, IDisposable, toDisposable } from '../../../../../base/common/lifecycle.js'; +import { autorun, IObservable, IReader, ISettableObservable, observableFromEvent, observableSignal, observableSignalFromEvent, observableValue, transaction } from '../../../../../base/common/observable.js'; +import { CodeEditorWidget } from '../../codeEditor/codeEditorWidget.js'; +import { LineRange } from '../../../../common/core/lineRange.js'; +import { OffsetRange } from '../../../../common/core/offsetRange.js'; export class EditorGutter extends Disposable { private readonly scrollTop = observableFromEvent(this, @@ -118,10 +118,10 @@ export class EditorGutter extends D gutterItem.range.startLineNumber <= this._editor.getModel()!.getLineCount() ? this._editor.getTopForLineNumber(gutterItem.range.startLineNumber, true) - scrollTop : this._editor.getBottomForLineNumber(gutterItem.range.startLineNumber - 1, false) - scrollTop; - const bottom = gutterItem.range.isEmpty - // Don't trust that `getBottomForLineNumber` for the previous line equals `getTopForLineNumber` for the current one. - ? top - : (this._editor.getBottomForLineNumber(gutterItem.range.endLineNumberExclusive - 1, true) - scrollTop); + const bottom = + gutterItem.range.endLineNumberExclusive === 1 ? + Math.max(top, this._editor.getTopForLineNumber(gutterItem.range.startLineNumber, false) - scrollTop) + : Math.max(top, this._editor.getBottomForLineNumber(gutterItem.range.endLineNumberExclusive - 1, true) - scrollTop); const height = bottom - top; view.domNode.style.top = `${top}px`; diff --git a/src/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer.ts b/src/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer.ts index bb27260aa40..33d1adc99c8 100644 --- a/src/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer.ts +++ b/src/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MarkdownRenderOptions, MarkedOptions, renderMarkdown } from 'vs/base/browser/markdownRenderer'; -import { createTrustedTypesPolicy } from 'vs/base/browser/trustedTypes'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter } from 'vs/base/common/event'; -import { IMarkdownString, MarkdownStringTrustedOptions } from 'vs/base/common/htmlContent'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import 'vs/css!./renderedMarkdown'; -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { tokenizeToString } from 'vs/editor/common/languages/textToHtmlTokenizer'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { MarkdownRenderOptions, MarkedOptions, renderMarkdown } from '../../../../../base/browser/markdownRenderer.js'; +import { createTrustedTypesPolicy } from '../../../../../base/browser/trustedTypes.js'; +import { onUnexpectedError } from '../../../../../base/common/errors.js'; +import { Emitter } from '../../../../../base/common/event.js'; +import { IMarkdownString, MarkdownStringTrustedOptions } from '../../../../../base/common/htmlContent.js'; +import { DisposableStore, IDisposable } from '../../../../../base/common/lifecycle.js'; +import './renderedMarkdown.css'; +import { applyFontInfo } from '../../../config/domFontInfo.js'; +import { ICodeEditor } from '../../../editorBrowser.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../../../../common/languages/modesRegistry.js'; +import { tokenizeToString } from '../../../../common/languages/textToHtmlTokenizer.js'; +import { IOpenerService } from '../../../../../platform/opener/common/opener.js'; export interface IMarkdownRenderResult extends IDisposable { readonly element: HTMLElement; @@ -105,11 +105,15 @@ export class MarkdownRenderer { }, asyncRenderCallback: () => this._onDidRenderAsync.fire(), actionHandler: { - callback: (link) => openLinkFromMarkdown(this._openerService, link, markdown.isTrusted), + callback: (link) => this.openMarkdownLink(link, markdown), disposables: disposables } }; } + + protected async openMarkdownLink(link: string, markdown: IMarkdownString) { + await openLinkFromMarkdown(this._openerService, link, markdown.isTrusted); + } } export async function openLinkFromMarkdown(openerService: IOpenerService, link: string, isTrusted: boolean | MarkdownStringTrustedOptions | undefined): Promise { diff --git a/src/vs/editor/browser/widget/multiDiffEditor/colors.ts b/src/vs/editor/browser/widget/multiDiffEditor/colors.ts index d58781aabfe..13652fd7f92 100644 --- a/src/vs/editor/browser/widget/multiDiffEditor/colors.ts +++ b/src/vs/editor/browser/widget/multiDiffEditor/colors.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { registerColor } from 'vs/platform/theme/common/colorRegistry'; +import { localize } from '../../../../nls.js'; +import { registerColor, editorBackground } from '../../../../platform/theme/common/colorRegistry.js'; export const multiDiffEditorHeaderBackground = registerColor( 'multiDiffEditor.headerBackground', @@ -14,7 +14,7 @@ export const multiDiffEditorHeaderBackground = registerColor( export const multiDiffEditorBackground = registerColor( 'multiDiffEditor.background', - { dark: 'editorBackground', light: 'editorBackground', hcDark: 'editorBackground', hcLight: 'editorBackground', }, + editorBackground, localize('multiDiffEditor.background', 'The background color of the multi file diff editor') ); diff --git a/src/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.ts b/src/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.ts index 7ea85f66a72..48ac35815d4 100644 --- a/src/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.ts +++ b/src/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.ts @@ -2,24 +2,25 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { h } from 'vs/base/browser/dom'; -import { Button } from 'vs/base/browser/ui/button/button'; -import { Codicon } from 'vs/base/common/codicons'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { autorun, derived, observableFromEvent } from 'vs/base/common/observable'; -import { IObservable, globalTransaction, observableValue } from 'vs/base/common/observableInternal/base'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget'; -import { DocumentDiffItemViewModel } from 'vs/editor/browser/widget/multiDiffEditor/multiDiffEditorViewModel'; -import { IWorkbenchUIElementFactory } from 'vs/editor/browser/widget/multiDiffEditor/workbenchUIElementFactory'; -import { IDiffEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { MenuWorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IObjectData, IPooledObject } from './objectPool'; -import { ActionRunnerWithContext } from './utils'; -import { createActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; +import { h } from '../../../../base/browser/dom.js'; +import { Button } from '../../../../base/browser/ui/button/button.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { autorun, derived, globalTransaction, observableValue } from '../../../../base/common/observable.js'; +import { createActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { MenuWorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { IContextKeyService, type IScopedContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { IDiffEditorOptions } from '../../../common/config/editorOptions.js'; +import { OffsetRange } from '../../../common/core/offsetRange.js'; +import { observableCodeEditor } from '../../observableCodeEditor.js'; +import { DiffEditorWidget } from '../diffEditor/diffEditorWidget.js'; +import { DocumentDiffItemViewModel } from './multiDiffEditorViewModel.js'; +import { IObjectData, IPooledObject } from './objectPool.js'; +import { ActionRunnerWithContext } from './utils.js'; +import { IWorkbenchUIElementFactory } from './workbenchUIElementFactory.js'; export class TemplateData implements IObjectData { constructor( @@ -81,8 +82,8 @@ export class DiffEditorItemTemplate extends Disposable implements IPooledObject< overflowWidgetsDomNode: this._overflowWidgetsDomNode, }, {})); - private readonly isModifedFocused = isFocused(this.editor.getModifiedEditor()); - private readonly isOriginalFocused = isFocused(this.editor.getOriginalEditor()); + private readonly isModifedFocused = observableCodeEditor(this.editor.getModifiedEditor()).isFocused; + private readonly isOriginalFocused = observableCodeEditor(this.editor.getOriginalEditor()).isFocused; public readonly isFocused = derived(this, reader => this.isModifedFocused.read(reader) || this.isOriginalFocused.read(reader)); private readonly _resourceLabel = this._workbenchUIElementFactory.createResourceLabel @@ -94,12 +95,14 @@ export class DiffEditorItemTemplate extends Disposable implements IPooledObject< : undefined; private readonly _outerEditorHeight: number; + private readonly _contextKeyService: IScopedContextKeyService; constructor( private readonly _container: HTMLElement, private readonly _overflowWidgetsDomNode: HTMLElement, private readonly _workbenchUIElementFactory: IWorkbenchUIElementFactory, @IInstantiationService private readonly _instantiationService: IInstantiationService, + @IContextKeyService _parentContextKeyService: IContextKeyService, ) { super(); @@ -155,13 +158,15 @@ export class DiffEditorItemTemplate extends Disposable implements IPooledObject< this._container.appendChild(this._elements.root); this._outerEditorHeight = this._headerHeight; - this._register(this._instantiationService.createInstance(MenuWorkbenchToolBar, this._elements.actions, MenuId.MultiDiffEditorFileToolbar, { + this._contextKeyService = this._register(_parentContextKeyService.createScoped(this._elements.actions)); + const instantiationService = this._register(this._instantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService]))); + this._register(instantiationService.createInstance(MenuWorkbenchToolBar, this._elements.actions, MenuId.MultiDiffEditorFileToolbar, { actionRunner: this._register(new ActionRunnerWithContext(() => (this._viewModel.get()?.modifiedUri))), menuOptions: { shouldForwardArgs: true, }, toolbarOptions: { primaryGroup: g => g.startsWith('navigation') }, - actionViewItemProvider: (action, options) => createActionViewItem(_instantiationService, action, options), + actionViewItemProvider: (action, options) => createActionViewItem(instantiationService, action, options), })); } @@ -173,11 +178,11 @@ export class DiffEditorItemTemplate extends Disposable implements IPooledObject< } } - private readonly _dataStore = new DisposableStore(); + private readonly _dataStore = this._register(new DisposableStore()); private _data: TemplateData | undefined; - public setData(data: TemplateData): void { + public setData(data: TemplateData | undefined): void { this._data = data; function updateOptions(options: IDiffEditorOptions): IDiffEditorOptions { return { @@ -198,13 +203,17 @@ export class DiffEditorItemTemplate extends Disposable implements IPooledObject< }; } - const value = data.viewModel.entry.value!; // TODO - - if (value.onOptionsDidChange) { - this._dataStore.add(value.onOptionsDidChange(() => { - this.editor.updateOptions(updateOptions(value.options ?? {})); - })); + if (!data) { + globalTransaction(tx => { + this._viewModel.set(undefined, tx); + this.editor.setDiffModel(null, tx); + this._dataStore.clear(); + }); + return; } + + const value = data.viewModel.documentDiffItem; + globalTransaction(tx => { this._resourceLabel?.setUri(data.viewModel.modifiedUri ?? data.viewModel.originalUri!, { strikethrough: data.viewModel.modifiedUri === undefined }); @@ -231,9 +240,25 @@ export class DiffEditorItemTemplate extends Disposable implements IPooledObject< this._dataStore.clear(); this._viewModel.set(data.viewModel, tx); - this.editor.setModel(data.viewModel.diffEditorViewModel, tx); + this.editor.setDiffModel(data.viewModel.diffEditorViewModelRef, tx); this.editor.updateOptions(updateOptions(value.options ?? {})); }); + if (value.onOptionsDidChange) { + this._dataStore.add(value.onOptionsDidChange(() => { + this.editor.updateOptions(updateOptions(value.options ?? {})); + })); + } + data.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore, value => { + if (!value) { + this.setData(undefined); + } + }); + + if (data.viewModel.documentDiffItem.contextKeys) { + for (const [key, value] of Object.entries(data.viewModel.documentDiffItem.contextKeys)) { + this._contextKeyService.createKey(key, value); + } + } } private readonly _headerHeight = /*this._elements.header.clientHeight*/ 40; @@ -276,15 +301,3 @@ export class DiffEditorItemTemplate extends Disposable implements IPooledObject< this._elements.root.style.visibility = 'hidden'; // Some editor parts are still visible } } - -function isFocused(editor: ICodeEditor): IObservable { - return observableFromEvent( - h => { - const store = new DisposableStore(); - store.add(editor.onDidFocusEditorWidget(() => h(true))); - store.add(editor.onDidBlurEditorWidget(() => h(false))); - return store; - }, - () => editor.hasTextFocus() - ); -} diff --git a/src/vs/editor/browser/widget/multiDiffEditor/model.ts b/src/vs/editor/browser/widget/multiDiffEditor/model.ts index de8f43e4edc..32077320010 100644 --- a/src/vs/editor/browser/widget/multiDiffEditor/model.ts +++ b/src/vs/editor/browser/widget/multiDiffEditor/model.ts @@ -3,38 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event, IValueWithChangeEvent } from 'vs/base/common/event'; -import { IDiffEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { ITextModel } from 'vs/editor/common/model'; -import { ContextKeyValue } from 'vs/platform/contextkey/common/contextkey'; +import { Event, IValueWithChangeEvent } from '../../../../base/common/event.js'; +import { RefCounted } from '../diffEditor/utils.js'; +import { IDiffEditorOptions } from '../../../common/config/editorOptions.js'; +import { ITextModel } from '../../../common/model.js'; +import { ContextKeyValue } from '../../../../platform/contextkey/common/contextkey.js'; export interface IMultiDiffEditorModel { - readonly documents: IValueWithChangeEvent[]>; + readonly documents: IValueWithChangeEvent[] | 'loading'>; readonly contextKeys?: Record; } -export interface LazyPromise { - request(): Promise; - readonly value: T | undefined; - readonly onHasValueDidChange: Event; -} - -export class ConstLazyPromise implements LazyPromise { - public readonly onHasValueDidChange = Event.None; - - constructor( - private readonly _value: T - ) { } - - public request(): Promise { - return Promise.resolve(this._value); - } - - public get value(): T { - return this._value; - } -} - export interface IDocumentDiffItem { /** * undefined if the file was created. @@ -47,4 +26,5 @@ export interface IDocumentDiffItem { readonly modified: ITextModel | undefined; readonly options?: IDiffEditorOptions; readonly onOptionsDidChange?: Event; + readonly contextKeys?: Record; } diff --git a/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorViewModel.ts b/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorViewModel.ts index a044eb438ed..49c674d0477 100644 --- a/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorViewModel.ts +++ b/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorViewModel.ts @@ -3,28 +3,41 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { IObservable, ITransaction, derived, observableValue, transaction } from 'vs/base/common/observable'; -import { constObservable, derivedObservableWithWritableCache, mapObservableArrayCached, observableFromValueWithChangeEvent } from 'vs/base/common/observableInternal/utils'; -import { URI } from 'vs/base/common/uri'; -import { DiffEditorOptions } from 'vs/editor/browser/widget/diffEditor/diffEditorOptions'; -import { DiffEditorViewModel } from 'vs/editor/browser/widget/diffEditor/diffEditorViewModel'; -import { IDocumentDiffItem, IMultiDiffEditorModel, LazyPromise } from 'vs/editor/browser/widget/multiDiffEditor/model'; -import { IDiffEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IDiffEditorViewModel } from 'vs/editor/common/editorCommon'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ContextKeyValue } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js'; +import { IObservable, ITransaction, constObservable, derived, derivedObservableWithWritableCache, mapObservableArrayCached, observableFromValueWithChangeEvent, observableValue, transaction } from '../../../../base/common/observable.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ContextKeyValue } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IDiffEditorOptions } from '../../../common/config/editorOptions.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IDiffEditorViewModel } from '../../../common/editorCommon.js'; +import { IModelService } from '../../../common/services/model.js'; +import { DiffEditorOptions } from '../diffEditor/diffEditorOptions.js'; +import { DiffEditorViewModel } from '../diffEditor/diffEditorViewModel.js'; +import { RefCounted } from '../diffEditor/utils.js'; +import { IDocumentDiffItem, IMultiDiffEditorModel } from './model.js'; export class MultiDiffEditorViewModel extends Disposable { - private readonly _documents = observableFromValueWithChangeEvent(this.model, this.model.documents); + private readonly _documents: IObservable[] | 'loading'> = observableFromValueWithChangeEvent(this.model, this.model.documents); - public readonly items = mapObservableArrayCached(this, this._documents, (d, store) => store.add(this._instantiationService.createInstance(DocumentDiffItemViewModel, d, this))) - .recomputeInitiallyAndOnChange(this._store); + private readonly _documentsArr = derived(this, reader => { + const result = this._documents.read(reader); + if (result === 'loading') { return []; } + return result; + }); + + public readonly isLoading = derived(this, reader => this._documents.read(reader) === 'loading'); + + public readonly items: IObservable = mapObservableArrayCached( + this, + this._documentsArr, + (d, store) => store.add(this._instantiationService.createInstance(DocumentDiffItemViewModel, d, this)) + ).recomputeInitiallyAndOnChange(this._store); public readonly focusedDiffItem = derived(this, reader => this.items.read(reader).find(i => i.isFocused.read(reader))); - public readonly activeDiffItem = derivedObservableWithWritableCache(this, (reader, lastValue) => this.focusedDiffItem.read(reader) ?? lastValue); + public readonly activeDiffItem = derivedObservableWithWritableCache(this, + (reader, lastValue) => this.focusedDiffItem.read(reader) ?? (lastValue && this.items.read(reader).indexOf(lastValue) !== -1) ? lastValue : undefined + ); public async waitForDiffs(): Promise { for (const d of this.items.get()) { @@ -61,7 +74,13 @@ export class MultiDiffEditorViewModel extends Disposable { } export class DocumentDiffItemViewModel extends Disposable { - public readonly diffEditorViewModel: IDiffEditorViewModel; + /** + * The diff editor view model keeps its inner objects alive. + */ + public readonly diffEditorViewModelRef: RefCounted; + public get diffEditorViewModel(): IDiffEditorViewModel { + return this.diffEditorViewModelRef.object; + } public readonly collapsed = observableValue(this, false); public readonly lastTemplateData = observableValue<{ contentHeight: number; selections: Selection[] | undefined }>( @@ -69,8 +88,8 @@ export class DocumentDiffItemViewModel extends Disposable { { contentHeight: 500, selections: undefined, } ); - public get originalUri(): URI | undefined { return this.entry.value!.original?.uri; } - public get modifiedUri(): URI | undefined { return this.entry.value!.modified?.uri; } + public get originalUri(): URI | undefined { return this.documentDiffItem.original?.uri; } + public get modifiedUri(): URI | undefined { return this.documentDiffItem.modified?.uri; } public readonly isActive: IObservable = derived(this, reader => this._editorViewModel.activeDiffItem.read(reader) === this); @@ -81,14 +100,27 @@ export class DocumentDiffItemViewModel extends Disposable { this._isFocusedSource.set(source, tx); } + private readonly documentDiffItemRef: RefCounted; + public get documentDiffItem(): IDocumentDiffItem { + return this.documentDiffItemRef.object; + } + + public readonly isAlive = observableValue(this, true); + constructor( - public readonly entry: LazyPromise, + documentDiffItem: RefCounted, private readonly _editorViewModel: MultiDiffEditorViewModel, @IInstantiationService private readonly _instantiationService: IInstantiationService, @IModelService private readonly _modelService: IModelService, ) { super(); + this._register(toDisposable(() => { + this.isAlive.set(false, undefined); + })); + + this.documentDiffItemRef = this._register(documentDiffItem.createNewRef(this)); + function updateOptions(options: IDiffEditorOptions): IDiffEditorOptions { return { ...options, @@ -98,20 +130,26 @@ export class DocumentDiffItemViewModel extends Disposable { }; } - const options = this._instantiationService.createInstance(DiffEditorOptions, updateOptions(this.entry.value!.options || {})); - if (this.entry.value!.onOptionsDidChange) { - this._register(this.entry.value!.onOptionsDidChange(() => { - options.updateOptions(updateOptions(this.entry.value!.options || {})); + const options = this._instantiationService.createInstance(DiffEditorOptions, updateOptions(this.documentDiffItem.options || {})); + if (this.documentDiffItem.onOptionsDidChange) { + this._register(this.documentDiffItem.onOptionsDidChange(() => { + options.updateOptions(updateOptions(this.documentDiffItem.options || {})); })); } - const originalTextModel = this.entry.value!.original ?? this._register(this._modelService.createModel('', null)); - const modifiedTextModel = this.entry.value!.modified ?? this._register(this._modelService.createModel('', null)); - - this.diffEditorViewModel = this._register(this._instantiationService.createInstance(DiffEditorViewModel, { - original: originalTextModel, - modified: modifiedTextModel, - }, options)); + const diffEditorViewModelStore = new DisposableStore(); + const originalTextModel = this.documentDiffItem.original ?? diffEditorViewModelStore.add(this._modelService.createModel('', null)); + const modifiedTextModel = this.documentDiffItem.modified ?? diffEditorViewModelStore.add(this._modelService.createModel('', null)); + diffEditorViewModelStore.add(this.documentDiffItemRef.createNewRef(this)); + + this.diffEditorViewModelRef = this._register(RefCounted.createWithDisposable( + this._instantiationService.createInstance(DiffEditorViewModel, { + original: originalTextModel, + modified: modifiedTextModel, + }, options), + diffEditorViewModelStore, + this + )); } public getKey(): string { diff --git a/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.ts b/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.ts index 496b002489b..d23ad8c87f6 100644 --- a/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.ts +++ b/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Dimension } from 'vs/base/browser/dom'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { derived, derivedWithStore, observableValue, recomputeInitiallyAndOnChange } from 'vs/base/common/observable'; -import { readHotReloadableExport } from 'vs/editor/browser/widget/diffEditor/utils'; -import { IMultiDiffEditorModel } from 'vs/editor/browser/widget/multiDiffEditor/model'; -import { IMultiDiffEditorViewState, IMultiDiffResourceId, MultiDiffEditorWidgetImpl } from 'vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl'; -import { MultiDiffEditorViewModel } from './multiDiffEditorViewModel'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import './colors'; -import { DiffEditorItemTemplate } from 'vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate'; -import { IWorkbenchUIElementFactory } from 'vs/editor/browser/widget/multiDiffEditor/workbenchUIElementFactory'; -import { Event } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { IDiffEditor } from 'vs/editor/common/editorCommon'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget'; -import { Range } from 'vs/editor/common/core/range'; +import { Dimension } from '../../../../base/browser/dom.js'; +import { Event } from '../../../../base/common/event.js'; +import { readHotReloadableExport } from '../../../../base/common/hotReloadHelpers.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { derived, derivedWithStore, observableValue, recomputeInitiallyAndOnChange } from '../../../../base/common/observable.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { Range } from '../../../common/core/range.js'; +import { IDiffEditor } from '../../../common/editorCommon.js'; +import { ICodeEditor } from '../../editorBrowser.js'; +import { DiffEditorWidget } from '../diffEditor/diffEditorWidget.js'; +import './colors.js'; +import { DiffEditorItemTemplate } from './diffEditorItemTemplate.js'; +import { IDocumentDiffItem, IMultiDiffEditorModel } from './model.js'; +import { MultiDiffEditorViewModel } from './multiDiffEditorViewModel.js'; +import { IMultiDiffEditorViewState, IMultiDiffResourceId, MultiDiffEditorWidgetImpl } from './multiDiffEditorWidgetImpl.js'; +import { IWorkbenchUIElementFactory } from './workbenchUIElementFactory.js'; export class MultiDiffEditorWidget extends Disposable { private readonly _dimension = observableValue(this, undefined); @@ -81,6 +81,10 @@ export class MultiDiffEditorWidget extends Disposable { public tryGetCodeEditor(resource: URI): { diffEditor: IDiffEditor; editor: ICodeEditor } | undefined { return this._widgetImpl.get().tryGetCodeEditor(resource); } + + public findDocumentDiffItem(resource: URI): IDocumentDiffItem | undefined { + return this._widgetImpl.get().findDocumentDiffItem(resource); + } } export interface RevealOptions { diff --git a/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.ts b/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.ts index eab554dbdfb..ec0bf3cf64c 100644 --- a/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.ts +++ b/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.ts @@ -3,34 +3,34 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Dimension, getWindow, h, scheduleAtNextAnimationFrame } from 'vs/base/browser/dom'; -import { SmoothScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; -import { compareBy, numberComparator } from 'vs/base/common/arrays'; -import { findFirstMax } from 'vs/base/common/arraysFind'; -import { BugIndicatingError } from 'vs/base/common/errors'; -import { Disposable, IReference, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, IReader, autorun, autorunWithStore, derived, derivedWithStore, observableFromEvent, observableValue } from 'vs/base/common/observable'; -import { ITransaction, disposableObservableValue, globalTransaction, transaction } from 'vs/base/common/observableInternal/base'; -import { Scrollable, ScrollbarVisibility } from 'vs/base/common/scrollable'; -import { URI } from 'vs/base/common/uri'; -import 'vs/css!./style'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { ObservableElementSizeObserver } from 'vs/editor/browser/widget/diffEditor/utils'; -import { RevealOptions } from 'vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget'; -import { IWorkbenchUIElementFactory } from 'vs/editor/browser/widget/multiDiffEditor/workbenchUIElementFactory'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { IRange } from 'vs/editor/common/core/range'; -import { ISelection, Selection } from 'vs/editor/common/core/selection'; -import { IDiffEditor } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ContextKeyValue, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { DiffEditorItemTemplate, TemplateData } from './diffEditorItemTemplate'; -import { DocumentDiffItemViewModel, MultiDiffEditorViewModel } from './multiDiffEditorViewModel'; -import { ObjectPool } from './objectPool'; -import { localize } from 'vs/nls'; +import { Dimension, getWindow, h, scheduleAtNextAnimationFrame } from '../../../../base/browser/dom.js'; +import { SmoothScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js'; +import { compareBy, numberComparator } from '../../../../base/common/arrays.js'; +import { findFirstMax } from '../../../../base/common/arraysFind.js'; +import { BugIndicatingError } from '../../../../base/common/errors.js'; +import { Disposable, IReference, toDisposable } from '../../../../base/common/lifecycle.js'; +import { IObservable, IReader, ITransaction, autorun, autorunWithStore, derived, derivedWithStore, disposableObservableValue, globalTransaction, observableFromEvent, observableValue, transaction } from '../../../../base/common/observable.js'; +import { Scrollable, ScrollbarVisibility } from '../../../../base/common/scrollable.js'; +import { URI } from '../../../../base/common/uri.js'; +import { localize } from '../../../../nls.js'; +import { ContextKeyValue, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { ITextEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { OffsetRange } from '../../../common/core/offsetRange.js'; +import { IRange } from '../../../common/core/range.js'; +import { ISelection, Selection } from '../../../common/core/selection.js'; +import { IDiffEditor } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ICodeEditor } from '../../editorBrowser.js'; +import { ObservableElementSizeObserver } from '../diffEditor/utils.js'; +import { DiffEditorItemTemplate, TemplateData } from './diffEditorItemTemplate.js'; +import { IDocumentDiffItem } from './model.js'; +import { DocumentDiffItemViewModel, MultiDiffEditorViewModel } from './multiDiffEditorViewModel.js'; +import { RevealOptions } from './multiDiffEditorWidget.js'; +import { ObjectPool } from './objectPool.js'; +import './style.css'; +import { IWorkbenchUIElementFactory } from './workbenchUIElementFactory.js'; export class MultiDiffEditorWidgetImpl extends Disposable { private readonly _scrollableElements = h('div.scrollContent', [ @@ -57,7 +57,7 @@ export class MultiDiffEditorWidgetImpl extends Disposable { private readonly _elements = h('div.monaco-component.multiDiffEditor', {}, [ h('div', {}, [this._scrollableElement.getDomNode()]), - h('div.placeholder@placeholder', {}, [h('div', [localize('noChangedFiles', 'No Changed Files') as any])]), + h('div.placeholder@placeholder', {}, [h('div')]), ]); private readonly _sizeObserver = this._register(new ObservableElementSizeObserver(this._element, undefined)); @@ -128,8 +128,6 @@ export class MultiDiffEditorWidgetImpl extends Disposable { ) { super(); - this._contextKeyService.createKey(EditorContextKeys.inMultiDiffEditor.key, true); - this._register(autorunWithStore((reader, store) => { const viewModel = this._viewModel.read(reader); if (viewModel && viewModel.contextKeys) { @@ -156,10 +154,20 @@ export class MultiDiffEditorWidgetImpl extends Disposable { this._sizeObserver.observe(dimension); })); - this._register(autorun((reader) => { - /** @description Update widget dimension */ + const placeholderMessage = derived(reader => { const items = this._viewItems.read(reader); - this._elements.placeholder.classList.toggle('visible', items.length === 0); + if (items.length > 0) { return undefined; } + + const vm = this._viewModel.read(reader); + return (!vm || vm.isLoading.read(reader)) + ? localize('loading', 'Loading...') + : localize('noChangedFiles', 'No Changed Files'); + }); + + this._register(autorun((reader) => { + const message = placeholderMessage.read(reader); + this._elements.placeholder.innerText = message ?? ''; + this._elements.placeholder.classList.toggle('visible', !!message); })); this._scrollableElements.content.style.position = 'relative'; @@ -263,6 +271,14 @@ export class MultiDiffEditorWidgetImpl extends Disposable { }); } + public findDocumentDiffItem(resource: URI): IDocumentDiffItem | undefined { + const item = this._viewItems.get().find(v => + v.viewModel.diffEditorViewModel.model.modified.uri.toString() === resource.toString() + || v.viewModel.diffEditorViewModel.model.original.uri.toString() === resource.toString() + ); + return item?.viewModel.documentDiffItem; + } + public tryGetCodeEditor(resource: URI): { diffEditor: IDiffEditor; editor: ICodeEditor } | undefined { const item = this._viewItems.get().find(v => v.viewModel.diffEditorViewModel.model.modified.uri.toString() === resource.toString() @@ -272,6 +288,7 @@ export class MultiDiffEditorWidgetImpl extends Disposable { if (!editor) { return undefined; } + if (item.viewModel.diffEditorViewModel.model.modified.uri.toString() === resource.toString()) { return { diffEditor: editor, editor: editor.getModifiedEditor() }; } else { @@ -396,7 +413,7 @@ class VirtualizedViewItem extends Disposable { } public override toString(): string { - return `VirtualViewItem(${this.viewModel.entry.value!.modified?.uri.toString()})`; + return `VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`; } public getKey(): string { diff --git a/src/vs/editor/browser/widget/multiDiffEditor/objectPool.ts b/src/vs/editor/browser/widget/multiDiffEditor/objectPool.ts index e41019fdb00..7bccd1cc59c 100644 --- a/src/vs/editor/browser/widget/multiDiffEditor/objectPool.ts +++ b/src/vs/editor/browser/widget/multiDiffEditor/objectPool.ts @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable, IReference } from 'vs/base/common/lifecycle'; +import { IDisposable, IReference } from '../../../../base/common/lifecycle.js'; export class ObjectPool> implements IDisposable { private readonly _unused = new Set(); diff --git a/src/vs/editor/browser/widget/multiDiffEditor/utils.ts b/src/vs/editor/browser/widget/multiDiffEditor/utils.ts index be9240267e1..2806ae63c43 100644 --- a/src/vs/editor/browser/widget/multiDiffEditor/utils.ts +++ b/src/vs/editor/browser/widget/multiDiffEditor/utils.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ActionRunner, IAction } from 'vs/base/common/actions'; +import { ActionRunner, IAction } from '../../../../base/common/actions.js'; export class ActionRunnerWithContext extends ActionRunner { constructor(private readonly _getContext: () => unknown) { diff --git a/src/vs/editor/browser/widget/multiDiffEditor/workbenchUIElementFactory.ts b/src/vs/editor/browser/widget/multiDiffEditor/workbenchUIElementFactory.ts index 80a018dead4..2f09d92ba05 100644 --- a/src/vs/editor/browser/widget/multiDiffEditor/workbenchUIElementFactory.ts +++ b/src/vs/editor/browser/widget/multiDiffEditor/workbenchUIElementFactory.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { URI } from '../../../../base/common/uri.js'; /** * This solves the problem that the editor layer cannot depend on the workbench layer. diff --git a/src/vs/editor/common/commands/replaceCommand.ts b/src/vs/editor/common/commands/replaceCommand.ts index a3db197aedc..f4beabe78a6 100644 --- a/src/vs/editor/common/commands/replaceCommand.ts +++ b/src/vs/editor/common/commands/replaceCommand.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { Selection, SelectionDirection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; +import { Range } from '../core/range.js'; +import { Selection, SelectionDirection } from '../core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../editorCommon.js'; +import { ITextModel } from '../model.js'; export class ReplaceCommand implements ICommand { diff --git a/src/vs/editor/common/commands/shiftCommand.ts b/src/vs/editor/common/commands/shiftCommand.ts index 3c0c9bea6fb..aa10151dedc 100644 --- a/src/vs/editor/common/commands/shiftCommand.ts +++ b/src/vs/editor/common/commands/shiftCommand.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import * as strings from 'vs/base/common/strings'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection, SelectionDirection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions'; -import { getEnterAction } from 'vs/editor/common/languages/enterAction'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; +import { CharCode } from '../../../base/common/charCode.js'; +import * as strings from '../../../base/common/strings.js'; +import { CursorColumns } from '../core/cursorColumns.js'; +import { Range } from '../core/range.js'; +import { Selection, SelectionDirection } from '../core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../editorCommon.js'; +import { ITextModel } from '../model.js'; +import { EditorAutoIndentStrategy } from '../config/editorOptions.js'; +import { getEnterAction } from '../languages/enterAction.js'; +import { ILanguageConfigurationService } from '../languages/languageConfigurationRegistry.js'; export interface IShiftCommandOpts { isUnshift: boolean; diff --git a/src/vs/editor/common/commands/surroundSelectionCommand.ts b/src/vs/editor/common/commands/surroundSelectionCommand.ts index ac170a7b61c..58ba301fa4d 100644 --- a/src/vs/editor/common/commands/surroundSelectionCommand.ts +++ b/src/vs/editor/common/commands/surroundSelectionCommand.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; +import { Range } from '../core/range.js'; +import { Position } from '../core/position.js'; +import { Selection } from '../core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../editorCommon.js'; +import { ITextModel } from '../model.js'; export class SurroundSelectionCommand implements ICommand { private readonly _range: Selection; diff --git a/src/vs/editor/common/commands/trimTrailingWhitespaceCommand.ts b/src/vs/editor/common/commands/trimTrailingWhitespaceCommand.ts index 343a5739f19..23e3f612373 100644 --- a/src/vs/editor/common/commands/trimTrailingWhitespaceCommand.ts +++ b/src/vs/editor/common/commands/trimTrailingWhitespaceCommand.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { ITextModel } from 'vs/editor/common/model'; +import * as strings from '../../../base/common/strings.js'; +import { EditOperation, ISingleEditOperation } from '../core/editOperation.js'; +import { Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { Selection } from '../core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../editorCommon.js'; +import { StandardTokenType } from '../encodedTokenAttributes.js'; +import { ITextModel } from '../model.js'; export class TrimTrailingWhitespaceCommand implements ICommand { diff --git a/src/vs/editor/common/config/diffEditor.ts b/src/vs/editor/common/config/diffEditor.ts index 2d0a312357e..43529c5b1be 100644 --- a/src/vs/editor/common/config/diffEditor.ts +++ b/src/vs/editor/common/config/diffEditor.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ValidDiffEditorBaseOptions } from 'vs/editor/common/config/editorOptions'; +import { ValidDiffEditorBaseOptions } from './editorOptions.js'; export const diffEditorDefaultOptions = { enableSplitViewResizing: true, @@ -24,6 +24,7 @@ export const diffEditorDefaultOptions = { experimental: { showMoves: false, showEmptyDecorations: true, + useTrueInlineView: false, }, hideUnchangedRegions: { enabled: false, @@ -35,4 +36,5 @@ export const diffEditorDefaultOptions = { onlyShowAccessibleDiffViewer: false, renderSideBySideInlineBreakpoint: 900, useInlineViewWhenSpaceIsLimited: true, + compactMode: false, } satisfies ValidDiffEditorBaseOptions; diff --git a/src/vs/editor/common/config/editorConfiguration.ts b/src/vs/editor/common/config/editorConfiguration.ts index ccaa98425d7..08f45386aa2 100644 --- a/src/vs/editor/common/config/editorConfiguration.ts +++ b/src/vs/editor/common/config/editorConfiguration.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ConfigurationChangedEvent, IComputedEditorOptions, IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { IDimension } from 'vs/editor/common/core/dimension'; -import { MenuId } from 'vs/platform/actions/common/actions'; +import { Event } from '../../../base/common/event.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { ConfigurationChangedEvent, IComputedEditorOptions, IEditorOptions } from './editorOptions.js'; +import { IDimension } from '../core/dimension.js'; +import { MenuId } from '../../../platform/actions/common/actions.js'; export interface IEditorConfiguration extends IDisposable { /** diff --git a/src/vs/editor/common/config/editorConfigurationSchema.ts b/src/vs/editor/common/config/editorConfigurationSchema.ts index ab2b8cc70c6..e89269b9f21 100644 --- a/src/vs/editor/common/config/editorConfigurationSchema.ts +++ b/src/vs/editor/common/config/editorConfigurationSchema.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { diffEditorDefaultOptions } from 'vs/editor/common/config/diffEditor'; -import { editorOptionsRegistry } from 'vs/editor/common/config/editorOptions'; -import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults'; -import * as nls from 'vs/nls'; -import { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationPropertySchema, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { diffEditorDefaultOptions } from './diffEditor.js'; +import { editorOptionsRegistry } from './editorOptions.js'; +import { EDITOR_MODEL_DEFAULTS } from '../core/textModelDefaults.js'; +import * as nls from '../../../nls.js'; +import { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationPropertySchema, IConfigurationRegistry } from '../../../platform/configuration/common/configurationRegistry.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; export const editorConfigurationBaseNode = Object.freeze({ id: 'editor', @@ -94,7 +94,7 @@ const editorConfiguration: IConfigurationNode = { }, 'editor.experimental.asyncTokenization': { type: 'boolean', - default: false, + default: true, description: nls.localize('editor.experimental.asyncTokenization', "Controls whether the tokenization should happen asynchronously on a web worker."), tags: ['experimental'], }, @@ -109,6 +109,12 @@ const editorConfiguration: IConfigurationNode = { description: nls.localize('editor.experimental.asyncTokenizationVerification', "Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."), tags: ['experimental'], }, + 'editor.experimental.treeSitterTelemetry': { + type: 'boolean', + default: false, + markdownDescription: nls.localize('editor.experimental.treeSitterTelemetry', "Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `editor.experimental.preferTreeSitter` for specific languages will take precedence."), + tags: ['experimental'] + }, 'editor.language.brackets': { type: ['array', 'null'], default: null, // We want to distinguish the empty array from not configured. @@ -247,7 +253,12 @@ const editorConfiguration: IConfigurationNode = { type: 'boolean', default: diffEditorDefaultOptions.experimental.showEmptyDecorations, description: nls.localize('showEmptyDecorations', "Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted."), - } + }, + 'diffEditor.experimental.useTrueInlineView': { + type: 'boolean', + default: diffEditorDefaultOptions.experimental.useTrueInlineView, + description: nls.localize('useTrueInlineView', "If enabled and the editor uses the inline view, word changes are rendered inline."), + }, } }; diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 92bba6356c9..81d4f5e3b35 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as arrays from 'vs/base/common/arrays'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import * as objects from 'vs/base/common/objects'; -import * as platform from 'vs/base/common/platform'; -import { ScrollbarVisibility } from 'vs/base/common/scrollable'; -import { Constants } from 'vs/base/common/uint'; -import { FontInfo } from 'vs/editor/common/config/fontInfo'; -import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults'; -import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/core/wordHelper'; -import * as nls from 'vs/nls'; -import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; -import { IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry'; +import * as arrays from '../../../base/common/arrays.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { IJSONSchema } from '../../../base/common/jsonSchema.js'; +import * as objects from '../../../base/common/objects.js'; +import * as platform from '../../../base/common/platform.js'; +import { ScrollbarVisibility } from '../../../base/common/scrollable.js'; +import { Constants } from '../../../base/common/uint.js'; +import { FontInfo } from './fontInfo.js'; +import { EDITOR_MODEL_DEFAULTS } from '../core/textModelDefaults.js'; +import { USUAL_WORD_SEPARATORS } from '../core/wordHelper.js'; +import * as nls from '../../../nls.js'; +import { AccessibilitySupport } from '../../../platform/accessibility/common/accessibility.js'; +import { IConfigurationPropertySchema } from '../../../platform/configuration/common/configurationRegistry.js'; //#region typed options @@ -634,6 +634,11 @@ export interface IEditorOptions { * Defaults to 'always'. */ matchBrackets?: 'never' | 'near' | 'always'; + /** + * Enable experimental rendering using WebGPU. + * Defaults to 'off'. + */ + experimentalGpuAcceleration?: 'on' | 'off'; /** * Enable experimental whitespace rendering. * Defaults to 'svg'. @@ -743,6 +748,11 @@ export interface IEditorOptions { */ dropIntoEditor?: IDropIntoEditorOptions; + /** + * Sets whether the new experimental edit context should be used instead of the text area. + */ + experimentalEditContextEnabled?: boolean; + /** * Controls support for changing how content is pasted into the editor. */ @@ -771,75 +781,96 @@ export interface IDiffEditorBaseOptions { * Defaults to true. */ enableSplitViewResizing?: boolean; + /** * The default ratio when rendering side-by-side editors. * Must be a number between 0 and 1, min sizes apply. * Defaults to 0.5 */ splitViewDefaultRatio?: number; + /** * Render the differences in two side-by-side editors. * Defaults to true. */ renderSideBySide?: boolean; + /** * When `renderSideBySide` is enabled, `useInlineViewWhenSpaceIsLimited` is set, * and the diff editor has a width less than `renderSideBySideInlineBreakpoint`, the inline view is used. */ renderSideBySideInlineBreakpoint?: number | undefined; + /** * When `renderSideBySide` is enabled, `useInlineViewWhenSpaceIsLimited` is set, * and the diff editor has a width less than `renderSideBySideInlineBreakpoint`, the inline view is used. */ useInlineViewWhenSpaceIsLimited?: boolean; + + /** + * If set, the diff editor is optimized for small views. + * Defaults to `false`. + */ + compactMode?: boolean; + /** * Timeout in milliseconds after which diff computation is cancelled. * Defaults to 5000. */ maxComputationTime?: number; + /** * Maximum supported file size in MB. * Defaults to 50. */ maxFileSize?: number; + /** * Compute the diff by ignoring leading/trailing whitespace * Defaults to true. */ ignoreTrimWhitespace?: boolean; + /** * Render +/- indicators for added/deleted changes. * Defaults to true. */ renderIndicators?: boolean; + /** * Shows icons in the glyph margin to revert changes. * Default to true. */ renderMarginRevertIcon?: boolean; + /** * Indicates if the gutter menu should be rendered. */ renderGutterMenu?: boolean; + /** * Original model should be editable? * Defaults to false. */ originalEditable?: boolean; + /** * Should the diff editor enable code lens? * Defaults to false. */ diffCodeLens?: boolean; + /** * Is the diff editor should render overview ruler * Defaults to true */ renderOverviewRuler?: boolean; + /** * Control the wrapping of the diff editor. */ diffWordWrap?: 'off' | 'on' | 'inherit'; + /** * Diff Algorithm */ @@ -857,6 +888,11 @@ export interface IDiffEditorBaseOptions { showMoves?: boolean; showEmptyDecorations?: boolean; + + /** + * Only applies when `renderSideBySide` is set to false. + */ + useTrueInlineView?: boolean; }; /** @@ -1451,7 +1487,10 @@ export const enum TextEditorCursorBlinkingStyle { Solid = 5 } -function _cursorBlinkingStyleFromString(cursorBlinkingStyle: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid'): TextEditorCursorBlinkingStyle { +/** + * @internal + */ +export function cursorBlinkingStyleFromString(cursorBlinkingStyle: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid'): TextEditorCursorBlinkingStyle { switch (cursorBlinkingStyle) { case 'blink': return TextEditorCursorBlinkingStyle.Blink; case 'smooth': return TextEditorCursorBlinkingStyle.Smooth; @@ -1509,7 +1548,10 @@ export function cursorStyleToString(cursorStyle: TextEditorCursorStyle): 'line' } } -function _cursorStyleFromString(cursorStyle: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin'): TextEditorCursorStyle { +/** + * @internal + */ +export function cursorStyleFromString(cursorStyle: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin'): TextEditorCursorStyle { switch (cursorStyle) { case 'line': return TextEditorCursorStyle.Line; case 'block': return TextEditorCursorStyle.Block; @@ -1916,12 +1958,14 @@ export interface IGotoLocationOptions { multipleDeclarations?: GoToLocationValues; multipleImplementations?: GoToLocationValues; multipleReferences?: GoToLocationValues; + multipleTests?: GoToLocationValues; alternativeDefinitionCommand?: string; alternativeTypeDefinitionCommand?: string; alternativeDeclarationCommand?: string; alternativeImplementationCommand?: string; alternativeReferenceCommand?: string; + alternativeTestsCommand?: string; } /** @@ -1939,11 +1983,13 @@ class EditorGoToLocation extends BaseEditorOption(input.multipleDeclarations, 'peek', ['peek', 'gotoAndPeek', 'goto']), multipleImplementations: input.multipleImplementations ?? stringSet(input.multipleImplementations, 'peek', ['peek', 'gotoAndPeek', 'goto']), multipleReferences: input.multipleReferences ?? stringSet(input.multipleReferences, 'peek', ['peek', 'gotoAndPeek', 'goto']), + multipleTests: input.multipleTests ?? stringSet(input.multipleTests, 'peek', ['peek', 'gotoAndPeek', 'goto']), alternativeDefinitionCommand: EditorStringOption.string(input.alternativeDefinitionCommand, this.defaultValue.alternativeDefinitionCommand), alternativeTypeDefinitionCommand: EditorStringOption.string(input.alternativeTypeDefinitionCommand, this.defaultValue.alternativeTypeDefinitionCommand), alternativeDeclarationCommand: EditorStringOption.string(input.alternativeDeclarationCommand, this.defaultValue.alternativeDeclarationCommand), alternativeImplementationCommand: EditorStringOption.string(input.alternativeImplementationCommand, this.defaultValue.alternativeImplementationCommand), alternativeReferenceCommand: EditorStringOption.string(input.alternativeReferenceCommand, this.defaultValue.alternativeReferenceCommand), + alternativeTestsCommand: EditorStringOption.string(input.alternativeTestsCommand, this.defaultValue.alternativeTestsCommand), }; } } @@ -2767,7 +2815,7 @@ export type EditorLightbulbOptions = Readonly> class EditorLightbulb extends BaseEditorOption { constructor() { - const defaults: EditorLightbulbOptions = { enabled: ShowLightbulbIconMode.On }; + const defaults: EditorLightbulbOptions = { enabled: ShowLightbulbIconMode.OnCode }; super( EditorOption.lightbulb, 'lightbulb', defaults, { @@ -2906,6 +2954,12 @@ export interface IEditorInlayHintsOptions { * Defaults to false. */ padding?: boolean; + + /** + * Maximum length for inlay hints per line + * Set to 0 to have an unlimited length. + */ + maximumLength?: number; } /** @@ -2916,7 +2970,7 @@ export type EditorInlayHintsOptions = Readonly { constructor() { - const defaults: EditorInlayHintsOptions = { enabled: 'on', fontSize: 0, fontFamily: '', padding: false }; + const defaults: EditorInlayHintsOptions = { enabled: 'on', fontSize: 0, fontFamily: '', padding: false, maximumLength: 43 }; super( EditorOption.inlayHints, 'inlayHints', defaults, { @@ -2946,6 +3000,11 @@ class EditorInlayHints extends BaseEditorOption(input.enabled, this.defaultValue.enabled, ['on', 'off', 'offUnlessPressed', 'onUnlessPressed']), fontSize: EditorIntOption.clampedInt(input.fontSize, this.defaultValue.fontSize, 0, 100), fontFamily: EditorStringOption.string(input.fontFamily, this.defaultValue.fontFamily), - padding: boolean(input.padding, this.defaultValue.padding) + padding: boolean(input.padding, this.defaultValue.padding), + maximumLength: EditorIntOption.clampedInt(input.maximumLength, this.defaultValue.maximumLength, 0, Number.MAX_SAFE_INTEGER), }; } } @@ -4071,6 +4131,8 @@ export interface IInlineSuggestOptions { showToolbar?: 'always' | 'onHover' | 'never'; + syntaxHighlightingEnabled?: boolean; + suppressSuggestions?: boolean; /** @@ -4100,7 +4162,8 @@ class InlineEditorSuggest extends BaseEditorOption; diff --git a/src/vs/editor/common/config/fontInfo.ts b/src/vs/editor/common/config/fontInfo.ts index 5dafe560d04..6854c5f7672 100644 --- a/src/vs/editor/common/config/fontInfo.ts +++ b/src/vs/editor/common/config/fontInfo.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as platform from 'vs/base/common/platform'; -import { EditorFontVariations, EditorOptions, EditorOption, FindComputedEditorOptionValueById, EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; -import { EditorZoom } from 'vs/editor/common/config/editorZoom'; +import * as platform from '../../../base/common/platform.js'; +import { EditorFontVariations, EditorOptions, EditorOption, FindComputedEditorOptionValueById, EDITOR_FONT_DEFAULTS } from './editorOptions.js'; +import { EditorZoom } from './editorZoom.js'; /** * Determined from empirical observations. diff --git a/src/vs/editor/common/core/characterClassifier.ts b/src/vs/editor/common/core/characterClassifier.ts index fb7b921eda4..595d08818f1 100644 --- a/src/vs/editor/common/core/characterClassifier.ts +++ b/src/vs/editor/common/core/characterClassifier.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { toUint8 } from 'vs/base/common/uint'; +import { toUint8 } from '../../../base/common/uint.js'; /** * A fast character classifier that uses a compact array for ASCII values. diff --git a/src/vs/editor/common/core/cursorColumns.ts b/src/vs/editor/common/core/cursorColumns.ts index 669c38b43f5..1d84b8635cc 100644 --- a/src/vs/editor/common/core/cursorColumns.ts +++ b/src/vs/editor/common/core/cursorColumns.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import * as strings from 'vs/base/common/strings'; +import { CharCode } from '../../../base/common/charCode.js'; +import * as strings from '../../../base/common/strings.js'; /** * A column in a position is the gap between two adjacent characters. The methods here @@ -128,7 +128,7 @@ export class CursorColumns { * @see {@link CursorColumns} */ public static nextIndentTabStop(visibleColumn: number, indentSize: number): number { - return visibleColumn + indentSize - visibleColumn % indentSize; + return CursorColumns.nextRenderTabStop(visibleColumn, indentSize); } /** @@ -144,6 +144,6 @@ export class CursorColumns { * @see {@link CursorColumns} */ public static prevIndentTabStop(column: number, indentSize: number): number { - return Math.max(0, column - 1 - (column - 1) % indentSize); + return CursorColumns.prevRenderTabStop(column, indentSize); } } diff --git a/src/vs/editor/common/core/editOperation.ts b/src/vs/editor/common/core/editOperation.ts index 59a06a7dcc5..047330dc2ad 100644 --- a/src/vs/editor/common/core/editOperation.ts +++ b/src/vs/editor/common/core/editOperation.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; +import { Position } from './position.js'; +import { IRange, Range } from './range.js'; /** * A single edit operation, that acts as a simple replace. diff --git a/src/vs/editor/common/core/editorColorRegistry.ts b/src/vs/editor/common/core/editorColorRegistry.ts index f7ad150e80c..1bcf7252443 100644 --- a/src/vs/editor/common/core/editorColorRegistry.ts +++ b/src/vs/editor/common/core/editorColorRegistry.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { Color, RGBA } from 'vs/base/common/color'; -import { activeContrastBorder, editorBackground, registerColor, editorWarningForeground, editorInfoForeground, editorWarningBorder, editorInfoBorder, contrastBorder, editorFindMatchHighlight, editorWarningBackground } from 'vs/platform/theme/common/colorRegistry'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import * as nls from '../../../nls.js'; +import { Color, RGBA } from '../../../base/common/color.js'; +import { activeContrastBorder, editorBackground, registerColor, editorWarningForeground, editorInfoForeground, editorWarningBorder, editorInfoBorder, contrastBorder, editorFindMatchHighlight, editorWarningBackground } from '../../../platform/theme/common/colorRegistry.js'; +import { registerThemingParticipant } from '../../../platform/theme/common/themeService.js'; /** * Definition of the editor colors */ -export const editorLineHighlight = registerColor('editor.lineHighlightBackground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('lineHighlight', 'Background color for the highlight of line at the cursor position.')); +export const editorLineHighlight = registerColor('editor.lineHighlightBackground', null, nls.localize('lineHighlight', 'Background color for the highlight of line at the cursor position.')); export const editorLineHighlightBorder = registerColor('editor.lineHighlightBorder', { dark: '#282828', light: '#eeeeee', hcDark: '#f38518', hcLight: contrastBorder }, nls.localize('lineHighlightBorderBox', 'Background color for the border around the line at the cursor position.')); export const editorRangeHighlight = registerColor('editor.rangeHighlightBackground', { dark: '#ffffff0b', light: '#fdff0033', hcDark: null, hcLight: null }, nls.localize('rangeHighlight', 'Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations.'), true); export const editorRangeHighlightBorder = registerColor('editor.rangeHighlightBorder', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize('rangeHighlightBorder', 'Background color of the border around highlighted ranges.')); @@ -21,32 +21,32 @@ export const editorSymbolHighlightBorder = registerColor('editor.symbolHighlight export const editorCursorForeground = registerColor('editorCursor.foreground', { dark: '#AEAFAD', light: Color.black, hcDark: Color.white, hcLight: '#0F4A85' }, nls.localize('caret', 'Color of the editor cursor.')); export const editorCursorBackground = registerColor('editorCursor.background', null, nls.localize('editorCursorBackground', 'The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.')); export const editorMultiCursorPrimaryForeground = registerColor('editorMultiCursor.primary.foreground', editorCursorForeground, nls.localize('editorMultiCursorPrimaryForeground', 'Color of the primary editor cursor when multiple cursors are present.')); -export const editorMultiCursorPrimaryBackground = registerColor('editorMultiCursor.primary.background', { dark: editorCursorBackground, light: editorCursorBackground, hcDark: editorCursorBackground, hcLight: editorCursorBackground }, nls.localize('editorMultiCursorPrimaryBackground', 'The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.')); -export const editorMultiCursorSecondaryForeground = registerColor('editorMultiCursor.secondary.foreground', { dark: editorCursorForeground, light: editorCursorForeground, hcDark: editorCursorForeground, hcLight: editorCursorForeground }, nls.localize('editorMultiCursorSecondaryForeground', 'Color of secondary editor cursors when multiple cursors are present.')); -export const editorMultiCursorSecondaryBackground = registerColor('editorMultiCursor.secondary.background', { dark: editorCursorBackground, light: editorCursorBackground, hcDark: editorCursorBackground, hcLight: editorCursorBackground }, nls.localize('editorMultiCursorSecondaryBackground', 'The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.')); +export const editorMultiCursorPrimaryBackground = registerColor('editorMultiCursor.primary.background', editorCursorBackground, nls.localize('editorMultiCursorPrimaryBackground', 'The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.')); +export const editorMultiCursorSecondaryForeground = registerColor('editorMultiCursor.secondary.foreground', editorCursorForeground, nls.localize('editorMultiCursorSecondaryForeground', 'Color of secondary editor cursors when multiple cursors are present.')); +export const editorMultiCursorSecondaryBackground = registerColor('editorMultiCursor.secondary.background', editorCursorBackground, nls.localize('editorMultiCursorSecondaryBackground', 'The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.')); export const editorWhitespaces = registerColor('editorWhitespace.foreground', { dark: '#e3e4e229', light: '#33333333', hcDark: '#e3e4e229', hcLight: '#CCCCCC' }, nls.localize('editorWhitespaces', 'Color of whitespace characters in the editor.')); export const editorLineNumbers = registerColor('editorLineNumber.foreground', { dark: '#858585', light: '#237893', hcDark: Color.white, hcLight: '#292929' }, nls.localize('editorLineNumbers', 'Color of editor line numbers.')); -export const deprecatedEditorIndentGuides = registerColor('editorIndentGuide.background', { dark: editorWhitespaces, light: editorWhitespaces, hcDark: editorWhitespaces, hcLight: editorWhitespaces }, nls.localize('editorIndentGuides', 'Color of the editor indentation guides.'), false, nls.localize('deprecatedEditorIndentGuides', '\'editorIndentGuide.background\' is deprecated. Use \'editorIndentGuide.background1\' instead.')); -export const deprecatedEditorActiveIndentGuides = registerColor('editorIndentGuide.activeBackground', { dark: editorWhitespaces, light: editorWhitespaces, hcDark: editorWhitespaces, hcLight: editorWhitespaces }, nls.localize('editorActiveIndentGuide', 'Color of the active editor indentation guides.'), false, nls.localize('deprecatedEditorActiveIndentGuide', '\'editorIndentGuide.activeBackground\' is deprecated. Use \'editorIndentGuide.activeBackground1\' instead.')); +export const deprecatedEditorIndentGuides = registerColor('editorIndentGuide.background', editorWhitespaces, nls.localize('editorIndentGuides', 'Color of the editor indentation guides.'), false, nls.localize('deprecatedEditorIndentGuides', '\'editorIndentGuide.background\' is deprecated. Use \'editorIndentGuide.background1\' instead.')); +export const deprecatedEditorActiveIndentGuides = registerColor('editorIndentGuide.activeBackground', editorWhitespaces, nls.localize('editorActiveIndentGuide', 'Color of the active editor indentation guides.'), false, nls.localize('deprecatedEditorActiveIndentGuide', '\'editorIndentGuide.activeBackground\' is deprecated. Use \'editorIndentGuide.activeBackground1\' instead.')); -export const editorIndentGuide1 = registerColor('editorIndentGuide.background1', { dark: deprecatedEditorIndentGuides, light: deprecatedEditorIndentGuides, hcDark: deprecatedEditorIndentGuides, hcLight: deprecatedEditorIndentGuides }, nls.localize('editorIndentGuides1', 'Color of the editor indentation guides (1).')); -export const editorIndentGuide2 = registerColor('editorIndentGuide.background2', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorIndentGuides2', 'Color of the editor indentation guides (2).')); -export const editorIndentGuide3 = registerColor('editorIndentGuide.background3', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorIndentGuides3', 'Color of the editor indentation guides (3).')); -export const editorIndentGuide4 = registerColor('editorIndentGuide.background4', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorIndentGuides4', 'Color of the editor indentation guides (4).')); -export const editorIndentGuide5 = registerColor('editorIndentGuide.background5', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorIndentGuides5', 'Color of the editor indentation guides (5).')); -export const editorIndentGuide6 = registerColor('editorIndentGuide.background6', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorIndentGuides6', 'Color of the editor indentation guides (6).')); +export const editorIndentGuide1 = registerColor('editorIndentGuide.background1', deprecatedEditorIndentGuides, nls.localize('editorIndentGuides1', 'Color of the editor indentation guides (1).')); +export const editorIndentGuide2 = registerColor('editorIndentGuide.background2', '#00000000', nls.localize('editorIndentGuides2', 'Color of the editor indentation guides (2).')); +export const editorIndentGuide3 = registerColor('editorIndentGuide.background3', '#00000000', nls.localize('editorIndentGuides3', 'Color of the editor indentation guides (3).')); +export const editorIndentGuide4 = registerColor('editorIndentGuide.background4', '#00000000', nls.localize('editorIndentGuides4', 'Color of the editor indentation guides (4).')); +export const editorIndentGuide5 = registerColor('editorIndentGuide.background5', '#00000000', nls.localize('editorIndentGuides5', 'Color of the editor indentation guides (5).')); +export const editorIndentGuide6 = registerColor('editorIndentGuide.background6', '#00000000', nls.localize('editorIndentGuides6', 'Color of the editor indentation guides (6).')); -export const editorActiveIndentGuide1 = registerColor('editorIndentGuide.activeBackground1', { dark: deprecatedEditorActiveIndentGuides, light: deprecatedEditorActiveIndentGuides, hcDark: deprecatedEditorActiveIndentGuides, hcLight: deprecatedEditorActiveIndentGuides }, nls.localize('editorActiveIndentGuide1', 'Color of the active editor indentation guides (1).')); -export const editorActiveIndentGuide2 = registerColor('editorIndentGuide.activeBackground2', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorActiveIndentGuide2', 'Color of the active editor indentation guides (2).')); -export const editorActiveIndentGuide3 = registerColor('editorIndentGuide.activeBackground3', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorActiveIndentGuide3', 'Color of the active editor indentation guides (3).')); -export const editorActiveIndentGuide4 = registerColor('editorIndentGuide.activeBackground4', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorActiveIndentGuide4', 'Color of the active editor indentation guides (4).')); -export const editorActiveIndentGuide5 = registerColor('editorIndentGuide.activeBackground5', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorActiveIndentGuide5', 'Color of the active editor indentation guides (5).')); -export const editorActiveIndentGuide6 = registerColor('editorIndentGuide.activeBackground6', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorActiveIndentGuide6', 'Color of the active editor indentation guides (6).')); +export const editorActiveIndentGuide1 = registerColor('editorIndentGuide.activeBackground1', deprecatedEditorActiveIndentGuides, nls.localize('editorActiveIndentGuide1', 'Color of the active editor indentation guides (1).')); +export const editorActiveIndentGuide2 = registerColor('editorIndentGuide.activeBackground2', '#00000000', nls.localize('editorActiveIndentGuide2', 'Color of the active editor indentation guides (2).')); +export const editorActiveIndentGuide3 = registerColor('editorIndentGuide.activeBackground3', '#00000000', nls.localize('editorActiveIndentGuide3', 'Color of the active editor indentation guides (3).')); +export const editorActiveIndentGuide4 = registerColor('editorIndentGuide.activeBackground4', '#00000000', nls.localize('editorActiveIndentGuide4', 'Color of the active editor indentation guides (4).')); +export const editorActiveIndentGuide5 = registerColor('editorIndentGuide.activeBackground5', '#00000000', nls.localize('editorActiveIndentGuide5', 'Color of the active editor indentation guides (5).')); +export const editorActiveIndentGuide6 = registerColor('editorIndentGuide.activeBackground6', '#00000000', nls.localize('editorActiveIndentGuide6', 'Color of the active editor indentation guides (6).')); const deprecatedEditorActiveLineNumber = registerColor('editorActiveLineNumber.foreground', { dark: '#c6c6c6', light: '#0B216F', hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize('editorActiveLineNumber', 'Color of editor active line number'), false, nls.localize('deprecatedEditorActiveLineNumber', 'Id is deprecated. Use \'editorLineNumber.activeForeground\' instead.')); -export const editorActiveLineNumber = registerColor('editorLineNumber.activeForeground', { dark: deprecatedEditorActiveLineNumber, light: deprecatedEditorActiveLineNumber, hcDark: deprecatedEditorActiveLineNumber, hcLight: deprecatedEditorActiveLineNumber }, nls.localize('editorActiveLineNumber', 'Color of editor active line number')); -export const editorDimmedLineNumber = registerColor('editorLineNumber.dimmedForeground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('editorDimmedLineNumber', 'Color of the final editor line when editor.renderFinalNewline is set to dimmed.')); +export const editorActiveLineNumber = registerColor('editorLineNumber.activeForeground', deprecatedEditorActiveLineNumber, nls.localize('editorActiveLineNumber', 'Color of editor active line number')); +export const editorDimmedLineNumber = registerColor('editorLineNumber.dimmedForeground', null, nls.localize('editorDimmedLineNumber', 'Color of the final editor line when editor.renderFinalNewline is set to dimmed.')); export const editorRuler = registerColor('editorRuler.foreground', { dark: '#5A5A5A', light: Color.lightgrey, hcDark: Color.white, hcLight: '#292929' }, nls.localize('editorRuler', 'Color of the editor rulers.')); @@ -58,17 +58,17 @@ export const editorBracketMatchBorder = registerColor('editorBracketMatch.border export const editorOverviewRulerBorder = registerColor('editorOverviewRuler.border', { dark: '#7f7f7f4d', light: '#7f7f7f4d', hcDark: '#7f7f7f4d', hcLight: '#666666' }, nls.localize('editorOverviewRulerBorder', 'Color of the overview ruler border.')); export const editorOverviewRulerBackground = registerColor('editorOverviewRuler.background', null, nls.localize('editorOverviewRulerBackground', 'Background color of the editor overview ruler.')); -export const editorGutter = registerColor('editorGutter.background', { dark: editorBackground, light: editorBackground, hcDark: editorBackground, hcLight: editorBackground }, nls.localize('editorGutter', 'Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.')); +export const editorGutter = registerColor('editorGutter.background', editorBackground, nls.localize('editorGutter', 'Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.')); export const editorUnnecessaryCodeBorder = registerColor('editorUnnecessaryCode.border', { dark: null, light: null, hcDark: Color.fromHex('#fff').transparent(0.8), hcLight: contrastBorder }, nls.localize('unnecessaryCodeBorder', 'Border color of unnecessary (unused) source code in the editor.')); export const editorUnnecessaryCodeOpacity = registerColor('editorUnnecessaryCode.opacity', { dark: Color.fromHex('#000a'), light: Color.fromHex('#0007'), hcDark: null, hcLight: null }, nls.localize('unnecessaryCodeOpacity', 'Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the \'editorUnnecessaryCode.border\' theme color to underline unnecessary code instead of fading it out.')); export const ghostTextBorder = registerColor('editorGhostText.border', { dark: null, light: null, hcDark: Color.fromHex('#fff').transparent(0.8), hcLight: Color.fromHex('#292929').transparent(0.8) }, nls.localize('editorGhostTextBorder', 'Border color of ghost text in the editor.')); export const ghostTextForeground = registerColor('editorGhostText.foreground', { dark: Color.fromHex('#ffffff56'), light: Color.fromHex('#0007'), hcDark: null, hcLight: null }, nls.localize('editorGhostTextForeground', 'Foreground color of the ghost text in the editor.')); -export const ghostTextBackground = registerColor('editorGhostText.background', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('editorGhostTextBackground', 'Background color of the ghost text in the editor.')); +export const ghostTextBackground = registerColor('editorGhostText.background', null, nls.localize('editorGhostTextBackground', 'Background color of the ghost text in the editor.')); const rulerRangeDefault = new Color(new RGBA(0, 122, 204, 0.6)); -export const overviewRulerRangeHighlight = registerColor('editorOverviewRuler.rangeHighlightForeground', { dark: rulerRangeDefault, light: rulerRangeDefault, hcDark: rulerRangeDefault, hcLight: rulerRangeDefault }, nls.localize('overviewRulerRangeHighlight', 'Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.'), true); +export const overviewRulerRangeHighlight = registerColor('editorOverviewRuler.rangeHighlightForeground', rulerRangeDefault, nls.localize('overviewRulerRangeHighlight', 'Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.'), true); export const overviewRulerError = registerColor('editorOverviewRuler.errorForeground', { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hcDark: new Color(new RGBA(255, 50, 50, 1)), hcLight: '#B5200D' }, nls.localize('overviewRuleError', 'Overview ruler marker color for errors.')); export const overviewRulerWarning = registerColor('editorOverviewRuler.warningForeground', { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningBorder, hcLight: editorWarningBorder }, nls.localize('overviewRuleWarning', 'Overview ruler marker color for warnings.')); export const overviewRulerInfo = registerColor('editorOverviewRuler.infoForeground', { dark: editorInfoForeground, light: editorInfoForeground, hcDark: editorInfoBorder, hcLight: editorInfoBorder }, nls.localize('overviewRuleInfo', 'Overview ruler marker color for infos.')); @@ -76,28 +76,28 @@ export const overviewRulerInfo = registerColor('editorOverviewRuler.infoForegrou export const editorBracketHighlightingForeground1 = registerColor('editorBracketHighlight.foreground1', { dark: '#FFD700', light: '#0431FAFF', hcDark: '#FFD700', hcLight: '#0431FAFF' }, nls.localize('editorBracketHighlightForeground1', 'Foreground color of brackets (1). Requires enabling bracket pair colorization.')); export const editorBracketHighlightingForeground2 = registerColor('editorBracketHighlight.foreground2', { dark: '#DA70D6', light: '#319331FF', hcDark: '#DA70D6', hcLight: '#319331FF' }, nls.localize('editorBracketHighlightForeground2', 'Foreground color of brackets (2). Requires enabling bracket pair colorization.')); export const editorBracketHighlightingForeground3 = registerColor('editorBracketHighlight.foreground3', { dark: '#179FFF', light: '#7B3814FF', hcDark: '#87CEFA', hcLight: '#7B3814FF' }, nls.localize('editorBracketHighlightForeground3', 'Foreground color of brackets (3). Requires enabling bracket pair colorization.')); -export const editorBracketHighlightingForeground4 = registerColor('editorBracketHighlight.foreground4', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketHighlightForeground4', 'Foreground color of brackets (4). Requires enabling bracket pair colorization.')); -export const editorBracketHighlightingForeground5 = registerColor('editorBracketHighlight.foreground5', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketHighlightForeground5', 'Foreground color of brackets (5). Requires enabling bracket pair colorization.')); -export const editorBracketHighlightingForeground6 = registerColor('editorBracketHighlight.foreground6', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketHighlightForeground6', 'Foreground color of brackets (6). Requires enabling bracket pair colorization.')); - -export const editorBracketHighlightingUnexpectedBracketForeground = registerColor('editorBracketHighlight.unexpectedBracket.foreground', { dark: new Color(new RGBA(255, 18, 18, 0.8)), light: new Color(new RGBA(255, 18, 18, 0.8)), hcDark: new Color(new RGBA(255, 50, 50, 1)), hcLight: '' }, nls.localize('editorBracketHighlightUnexpectedBracketForeground', 'Foreground color of unexpected brackets.')); - -export const editorBracketPairGuideBackground1 = registerColor('editorBracketPairGuide.background1', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.background1', 'Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.')); -export const editorBracketPairGuideBackground2 = registerColor('editorBracketPairGuide.background2', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.background2', 'Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.')); -export const editorBracketPairGuideBackground3 = registerColor('editorBracketPairGuide.background3', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.background3', 'Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.')); -export const editorBracketPairGuideBackground4 = registerColor('editorBracketPairGuide.background4', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.background4', 'Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.')); -export const editorBracketPairGuideBackground5 = registerColor('editorBracketPairGuide.background5', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.background5', 'Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.')); -export const editorBracketPairGuideBackground6 = registerColor('editorBracketPairGuide.background6', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.background6', 'Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.')); - -export const editorBracketPairGuideActiveBackground1 = registerColor('editorBracketPairGuide.activeBackground1', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground1', 'Background color of active bracket pair guides (1). Requires enabling bracket pair guides.')); -export const editorBracketPairGuideActiveBackground2 = registerColor('editorBracketPairGuide.activeBackground2', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground2', 'Background color of active bracket pair guides (2). Requires enabling bracket pair guides.')); -export const editorBracketPairGuideActiveBackground3 = registerColor('editorBracketPairGuide.activeBackground3', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground3', 'Background color of active bracket pair guides (3). Requires enabling bracket pair guides.')); -export const editorBracketPairGuideActiveBackground4 = registerColor('editorBracketPairGuide.activeBackground4', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground4', 'Background color of active bracket pair guides (4). Requires enabling bracket pair guides.')); -export const editorBracketPairGuideActiveBackground5 = registerColor('editorBracketPairGuide.activeBackground5', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground5', 'Background color of active bracket pair guides (5). Requires enabling bracket pair guides.')); -export const editorBracketPairGuideActiveBackground6 = registerColor('editorBracketPairGuide.activeBackground6', { dark: '#00000000', light: '#00000000', hcDark: '#00000000', hcLight: '#00000000' }, nls.localize('editorBracketPairGuide.activeBackground6', 'Background color of active bracket pair guides (6). Requires enabling bracket pair guides.')); - -export const editorUnicodeHighlightBorder = registerColor('editorUnicodeHighlight.border', { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningForeground, hcLight: editorWarningForeground }, nls.localize('editorUnicodeHighlight.border', 'Border color used to highlight unicode characters.')); -export const editorUnicodeHighlightBackground = registerColor('editorUnicodeHighlight.background', { dark: editorWarningBackground, light: editorWarningBackground, hcDark: editorWarningBackground, hcLight: editorWarningBackground }, nls.localize('editorUnicodeHighlight.background', 'Background color used to highlight unicode characters.')); +export const editorBracketHighlightingForeground4 = registerColor('editorBracketHighlight.foreground4', '#00000000', nls.localize('editorBracketHighlightForeground4', 'Foreground color of brackets (4). Requires enabling bracket pair colorization.')); +export const editorBracketHighlightingForeground5 = registerColor('editorBracketHighlight.foreground5', '#00000000', nls.localize('editorBracketHighlightForeground5', 'Foreground color of brackets (5). Requires enabling bracket pair colorization.')); +export const editorBracketHighlightingForeground6 = registerColor('editorBracketHighlight.foreground6', '#00000000', nls.localize('editorBracketHighlightForeground6', 'Foreground color of brackets (6). Requires enabling bracket pair colorization.')); + +export const editorBracketHighlightingUnexpectedBracketForeground = registerColor('editorBracketHighlight.unexpectedBracket.foreground', { dark: new Color(new RGBA(255, 18, 18, 0.8)), light: new Color(new RGBA(255, 18, 18, 0.8)), hcDark: 'new Color(new RGBA(255, 50, 50, 1))', hcLight: '#B5200D' }, nls.localize('editorBracketHighlightUnexpectedBracketForeground', 'Foreground color of unexpected brackets.')); + +export const editorBracketPairGuideBackground1 = registerColor('editorBracketPairGuide.background1', '#00000000', nls.localize('editorBracketPairGuide.background1', 'Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.')); +export const editorBracketPairGuideBackground2 = registerColor('editorBracketPairGuide.background2', '#00000000', nls.localize('editorBracketPairGuide.background2', 'Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.')); +export const editorBracketPairGuideBackground3 = registerColor('editorBracketPairGuide.background3', '#00000000', nls.localize('editorBracketPairGuide.background3', 'Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.')); +export const editorBracketPairGuideBackground4 = registerColor('editorBracketPairGuide.background4', '#00000000', nls.localize('editorBracketPairGuide.background4', 'Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.')); +export const editorBracketPairGuideBackground5 = registerColor('editorBracketPairGuide.background5', '#00000000', nls.localize('editorBracketPairGuide.background5', 'Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.')); +export const editorBracketPairGuideBackground6 = registerColor('editorBracketPairGuide.background6', '#00000000', nls.localize('editorBracketPairGuide.background6', 'Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.')); + +export const editorBracketPairGuideActiveBackground1 = registerColor('editorBracketPairGuide.activeBackground1', '#00000000', nls.localize('editorBracketPairGuide.activeBackground1', 'Background color of active bracket pair guides (1). Requires enabling bracket pair guides.')); +export const editorBracketPairGuideActiveBackground2 = registerColor('editorBracketPairGuide.activeBackground2', '#00000000', nls.localize('editorBracketPairGuide.activeBackground2', 'Background color of active bracket pair guides (2). Requires enabling bracket pair guides.')); +export const editorBracketPairGuideActiveBackground3 = registerColor('editorBracketPairGuide.activeBackground3', '#00000000', nls.localize('editorBracketPairGuide.activeBackground3', 'Background color of active bracket pair guides (3). Requires enabling bracket pair guides.')); +export const editorBracketPairGuideActiveBackground4 = registerColor('editorBracketPairGuide.activeBackground4', '#00000000', nls.localize('editorBracketPairGuide.activeBackground4', 'Background color of active bracket pair guides (4). Requires enabling bracket pair guides.')); +export const editorBracketPairGuideActiveBackground5 = registerColor('editorBracketPairGuide.activeBackground5', '#00000000', nls.localize('editorBracketPairGuide.activeBackground5', 'Background color of active bracket pair guides (5). Requires enabling bracket pair guides.')); +export const editorBracketPairGuideActiveBackground6 = registerColor('editorBracketPairGuide.activeBackground6', '#00000000', nls.localize('editorBracketPairGuide.activeBackground6', 'Background color of active bracket pair guides (6). Requires enabling bracket pair guides.')); + +export const editorUnicodeHighlightBorder = registerColor('editorUnicodeHighlight.border', editorWarningForeground, nls.localize('editorUnicodeHighlight.border', 'Border color used to highlight unicode characters.')); +export const editorUnicodeHighlightBackground = registerColor('editorUnicodeHighlight.background', editorWarningBackground, nls.localize('editorUnicodeHighlight.background', 'Background color used to highlight unicode characters.')); // contains all color rules that used to defined in editor/browser/widget/editor.css diff --git a/src/vs/editor/common/core/eolCounter.ts b/src/vs/editor/common/core/eolCounter.ts index 702b562cbed..42175b1a3f8 100644 --- a/src/vs/editor/common/core/eolCounter.ts +++ b/src/vs/editor/common/core/eolCounter.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; +import { CharCode } from '../../../base/common/charCode.js'; export const enum StringEOL { Unknown = 0, diff --git a/src/vs/editor/common/core/indentation.ts b/src/vs/editor/common/core/indentation.ts index d4cd6d0e71a..03ce99442c8 100644 --- a/src/vs/editor/common/core/indentation.ts +++ b/src/vs/editor/common/core/indentation.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; +import * as strings from '../../../base/common/strings.js'; +import { CursorColumns } from './cursorColumns.js'; function _normalizeIndentationFromWhitespace(str: string, indentSize: number, insertSpaces: boolean): string { let spacesCnt = 0; diff --git a/src/vs/editor/common/core/lineRange.ts b/src/vs/editor/common/core/lineRange.ts index 1a7a0d6b527..007fa6b754b 100644 --- a/src/vs/editor/common/core/lineRange.ts +++ b/src/vs/editor/common/core/lineRange.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BugIndicatingError } from 'vs/base/common/errors'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { Range } from 'vs/editor/common/core/range'; -import { findFirstIdxMonotonousOrArrLen, findLastIdxMonotonous, findLastMonotonous } from 'vs/base/common/arraysFind'; +import { BugIndicatingError } from '../../../base/common/errors.js'; +import { OffsetRange } from './offsetRange.js'; +import { Range } from './range.js'; +import { findFirstIdxMonotonousOrArrLen, findLastIdxMonotonous, findLastMonotonous } from '../../../base/common/arraysFind.js'; /** * A range of lines (1-based). diff --git a/src/vs/editor/common/core/offsetEdit.ts b/src/vs/editor/common/core/offsetEdit.ts new file mode 100644 index 00000000000..7243a408a1f --- /dev/null +++ b/src/vs/editor/common/core/offsetEdit.ts @@ -0,0 +1,322 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { BugIndicatingError } from '../../../base/common/errors.js'; +import { OffsetRange } from './offsetRange.js'; + +/** + * Describes an edit to a (0-based) string. + * Use `TextEdit` to describe edits for a 1-based line/column text. +*/ +export class OffsetEdit { + public static readonly empty = new OffsetEdit([]); + + public static fromJson(data: IOffsetEdit): OffsetEdit { + return new OffsetEdit(data.map(SingleOffsetEdit.fromJson)); + } + + public static replace( + range: OffsetRange, + newText: string, + ): OffsetEdit { + return new OffsetEdit([new SingleOffsetEdit(range, newText)]); + } + + public static insert( + offset: number, + insertText: string, + ): OffsetEdit { + return OffsetEdit.replace(OffsetRange.emptyAt(offset), insertText); + } + + constructor( + public readonly edits: readonly SingleOffsetEdit[], + ) { + let lastEndEx = -1; + for (const edit of edits) { + if (!(edit.replaceRange.start >= lastEndEx)) { + throw new BugIndicatingError(`Edits must be disjoint and sorted. Found ${edit} after ${lastEndEx}`); + } + lastEndEx = edit.replaceRange.endExclusive; + } + } + + normalize(): OffsetEdit { + const edits: SingleOffsetEdit[] = []; + let lastEdit: SingleOffsetEdit | undefined; + for (const edit of this.edits) { + if (edit.newText.length === 0 && edit.replaceRange.length === 0) { + continue; + } + if (lastEdit && lastEdit.replaceRange.endExclusive === edit.replaceRange.start) { + lastEdit = new SingleOffsetEdit( + lastEdit.replaceRange.join(edit.replaceRange), + lastEdit.newText + edit.newText, + ); + } else { + if (lastEdit) { + edits.push(lastEdit); + } + lastEdit = edit; + } + } + if (lastEdit) { + edits.push(lastEdit); + } + return new OffsetEdit(edits); + } + + toString() { + const edits = this.edits.map(e => e.toString()).join(', '); + return `[${edits}]`; + } + + apply(str: string): string { + const resultText: string[] = []; + let pos = 0; + for (const edit of this.edits) { + resultText.push(str.substring(pos, edit.replaceRange.start)); + resultText.push(edit.newText); + pos = edit.replaceRange.endExclusive; + } + resultText.push(str.substring(pos)); + return resultText.join(''); + } + + compose(other: OffsetEdit): OffsetEdit { + return joinEdits(this, other); + } + + /** + * Creates an edit that reverts this edit. + */ + inverse(originalStr: string): OffsetEdit { + const edits: SingleOffsetEdit[] = []; + let offset = 0; + for (const e of this.edits) { + edits.push(new SingleOffsetEdit( + OffsetRange.ofStartAndLength(e.replaceRange.start + offset, e.newText.length), + originalStr.substring(e.replaceRange.start, e.replaceRange.endExclusive), + )); + offset += e.newText.length - e.replaceRange.length; + } + return new OffsetEdit(edits); + } + + getNewTextRanges(): OffsetRange[] { + const ranges: OffsetRange[] = []; + let offset = 0; + for (const e of this.edits) { + ranges.push(OffsetRange.ofStartAndLength(e.replaceRange.start + offset, e.newText.length),); + offset += e.newText.length - e.replaceRange.length; + } + return ranges; + } + + get isEmpty(): boolean { + return this.edits.length === 0; + } + + /** + * Consider `t1 := text o base` and `t2 := text o this`. + * We are interested in `tm := tryMerge(t1, t2, base: text)`. + * For that, we compute `tm' := t1 o base o this.rebase(base)` + * such that `tm' === tm`. + */ + tryRebase(base: OffsetEdit): OffsetEdit { + const newEdits: SingleOffsetEdit[] = []; + + let baseIdx = 0; + let ourIdx = 0; + let offset = 0; + + while (ourIdx < this.edits.length || baseIdx < base.edits.length) { + // take the edit that starts first + const baseEdit = base.edits[baseIdx]; + const ourEdit = this.edits[ourIdx]; + + if (!ourEdit) { + // We processed all our edits + break; + } else if (!baseEdit) { + // no more edits from base + newEdits.push(new SingleOffsetEdit( + ourEdit.replaceRange.delta(offset), + ourEdit.newText, + )); + ourIdx++; + } else if (ourEdit.replaceRange.intersects(baseEdit.replaceRange)) { + ourIdx++; // Don't take our edit, as it is conflicting -> skip + } else if (ourEdit.replaceRange.start < baseEdit.replaceRange.start) { + // Our edit starts first + newEdits.push(new SingleOffsetEdit( + ourEdit.replaceRange.delta(offset), + ourEdit.newText, + )); + ourIdx++; + } else { + baseIdx++; + offset += baseEdit.newText.length - baseEdit.replaceRange.length; + } + } + + return new OffsetEdit(newEdits); + } + + applyToOffset(originalOffset: number): number { + let accumulatedDelta = 0; + for (const edit of this.edits) { + if (edit.replaceRange.start <= originalOffset) { + if (originalOffset < edit.replaceRange.endExclusive) { + // the offset is in the replaced range + return edit.replaceRange.start + accumulatedDelta; + } + accumulatedDelta += edit.newText.length - edit.replaceRange.length; + } else { + break; + } + } + return originalOffset + accumulatedDelta; + } + + applyToOffsetRange(originalRange: OffsetRange): OffsetRange { + return new OffsetRange( + this.applyToOffset(originalRange.start), + this.applyToOffset(originalRange.endExclusive) + ); + } + + applyInverseToOffset(postEditsOffset: number): number { + let accumulatedDelta = 0; + for (const edit of this.edits) { + const editLength = edit.newText.length; + if (edit.replaceRange.start <= postEditsOffset - accumulatedDelta) { + if (postEditsOffset - accumulatedDelta < edit.replaceRange.start + editLength) { + // the offset is in the replaced range + return edit.replaceRange.start; + } + accumulatedDelta += editLength - edit.replaceRange.length; + } else { + break; + } + } + return postEditsOffset - accumulatedDelta; + } +} + +export type IOffsetEdit = ISingleOffsetEdit[]; + +export interface ISingleOffsetEdit { + txt: string; + pos: number; + len: number; +} + +export class SingleOffsetEdit { + public static fromJson(data: ISingleOffsetEdit): SingleOffsetEdit { + return new SingleOffsetEdit(OffsetRange.ofStartAndLength(data.pos, data.len), data.txt); + } + + public static insert(offset: number, text: string): SingleOffsetEdit { + return new SingleOffsetEdit(OffsetRange.emptyAt(offset), text); + } + + constructor( + public readonly replaceRange: OffsetRange, + public readonly newText: string, + ) { } + + toString(): string { + return `${this.replaceRange} -> "${this.newText}"`; + } + + get isEmpty() { + return this.newText.length === 0 && this.replaceRange.length === 0; + } +} + +/** + * Invariant: + * ``` + * edits2.apply(edits1.apply(str)) = join(edits1, edits2).apply(str) + * ``` + */ +function joinEdits(edits1: OffsetEdit, edits2: OffsetEdit): OffsetEdit { + edits1 = edits1.normalize(); + edits2 = edits2.normalize(); + + if (edits1.isEmpty) { return edits2; } + if (edits2.isEmpty) { return edits1; } + + const edit1Queue = [...edits1.edits]; + const result: SingleOffsetEdit[] = []; + + let edit1ToEdit2 = 0; + + for (const edit2 of edits2.edits) { + // Copy over edit1 unmodified until it touches edit2. + while (true) { + const edit1 = edit1Queue[0]!; + if (!edit1 || edit1.replaceRange.start + edit1ToEdit2 + edit1.newText.length >= edit2.replaceRange.start) { + break; + } + edit1Queue.shift(); + + result.push(edit1); + edit1ToEdit2 += edit1.newText.length - edit1.replaceRange.length; + } + + const firstEdit1ToEdit2 = edit1ToEdit2; + let firstIntersecting: SingleOffsetEdit | undefined; // or touching + let lastIntersecting: SingleOffsetEdit | undefined; // or touching + + while (true) { + const edit1 = edit1Queue[0]; + if (!edit1 || edit1.replaceRange.start + edit1ToEdit2 > edit2.replaceRange.endExclusive) { + break; + } + // else we intersect, because the new end of edit1 is after or equal to our start + + if (!firstIntersecting) { + firstIntersecting = edit1; + } + lastIntersecting = edit1; + edit1Queue.shift(); + + edit1ToEdit2 += edit1.newText.length - edit1.replaceRange.length; + } + + if (!firstIntersecting) { + result.push(new SingleOffsetEdit(edit2.replaceRange.delta(-edit1ToEdit2), edit2.newText)); + } else { + let prefix = ''; + const prefixLength = edit2.replaceRange.start - (firstIntersecting.replaceRange.start + firstEdit1ToEdit2); + if (prefixLength > 0) { + prefix = firstIntersecting.newText.slice(0, prefixLength); + } + const suffixLength = (lastIntersecting!.replaceRange.endExclusive + edit1ToEdit2) - edit2.replaceRange.endExclusive; + if (suffixLength > 0) { + const e = new SingleOffsetEdit(OffsetRange.ofStartAndLength(lastIntersecting!.replaceRange.endExclusive, 0), lastIntersecting!.newText.slice(-suffixLength)); + edit1Queue.unshift(e); + edit1ToEdit2 -= e.newText.length - e.replaceRange.length; + } + const newText = prefix + edit2.newText; + + const newReplaceRange = new OffsetRange( + Math.min(firstIntersecting.replaceRange.start, edit2.replaceRange.start - firstEdit1ToEdit2), + edit2.replaceRange.endExclusive - edit1ToEdit2 + ); + result.push(new SingleOffsetEdit(newReplaceRange, newText)); + } + } + + while (true) { + const item = edit1Queue.shift(); + if (!item) { break; } + result.push(item); + } + + return new OffsetEdit(result).normalize(); +} diff --git a/src/vs/editor/common/core/offsetRange.ts b/src/vs/editor/common/core/offsetRange.ts index 17857dd9488..5e2ef46d5a0 100644 --- a/src/vs/editor/common/core/offsetRange.ts +++ b/src/vs/editor/common/core/offsetRange.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BugIndicatingError } from 'vs/base/common/errors'; +import { BugIndicatingError } from '../../../base/common/errors.js'; export interface IOffsetRange { readonly start: number; @@ -47,6 +47,10 @@ export class OffsetRange implements IOffsetRange { return new OffsetRange(start, start + length); } + public static emptyAt(offset: number): OffsetRange { + return new OffsetRange(offset, offset); + } + constructor(public readonly start: number, public readonly endExclusive: number) { if (start > endExclusive) { throw new BugIndicatingError(`Invalid range: ${this.toString()}`); @@ -112,6 +116,12 @@ export class OffsetRange implements IOffsetRange { return undefined; } + public intersectionLength(range: OffsetRange): number { + const start = Math.max(this.start, range.start); + const end = Math.min(this.endExclusive, range.endExclusive); + return Math.max(0, end - start); + } + public intersects(other: OffsetRange): boolean { const start = Math.max(this.start, other.start); const end = Math.min(this.endExclusive, other.endExclusive); diff --git a/src/vs/editor/common/core/positionToOffset.ts b/src/vs/editor/common/core/positionToOffset.ts index 484c0a3265f..e4a13a076d4 100644 --- a/src/vs/editor/common/core/positionToOffset.ts +++ b/src/vs/editor/common/core/positionToOffset.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { findLastIdxMonotonous } from 'vs/base/common/arraysFind'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { TextLength } from 'vs/editor/common/core/textLength'; +import { findLastIdxMonotonous } from '../../../base/common/arraysFind.js'; +import { OffsetRange } from './offsetRange.js'; +import { Position } from './position.js'; +import { Range } from './range.js'; +import { TextLength } from './textLength.js'; export class PositionOffsetTransformer { private readonly lineStartOffsetByLineIdx: number[]; diff --git a/src/vs/editor/common/core/range.ts b/src/vs/editor/common/core/range.ts index 72396396d1b..954c18e137f 100644 --- a/src/vs/editor/common/core/range.ts +++ b/src/vs/editor/common/core/range.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IPosition, Position } from 'vs/editor/common/core/position'; +import { IPosition, Position } from './position.js'; /** * A range in the editor. This interface is suitable for serialization. diff --git a/src/vs/editor/common/core/rangeMapping.ts b/src/vs/editor/common/core/rangeMapping.ts index 379e046357d..8d838cc1f75 100644 --- a/src/vs/editor/common/core/rangeMapping.ts +++ b/src/vs/editor/common/core/rangeMapping.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { findLastMonotonous } from 'vs/base/common/arraysFind'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { TextLength } from 'vs/editor/common/core/textLength'; +import { findLastMonotonous } from '../../../base/common/arraysFind.js'; +import { Position } from './position.js'; +import { Range } from './range.js'; +import { TextLength } from './textLength.js'; /** * Represents a list of mappings of ranges from one document to another. diff --git a/src/vs/editor/common/core/selection.ts b/src/vs/editor/common/core/selection.ts index 1e0db95c8f2..c436bb61ef6 100644 --- a/src/vs/editor/common/core/selection.ts +++ b/src/vs/editor/common/core/selection.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; +import { IPosition, Position } from './position.js'; +import { Range } from './range.js'; /** * A selection in the editor. diff --git a/src/vs/editor/common/core/stringBuilder.ts b/src/vs/editor/common/core/stringBuilder.ts index d4b74be68d3..4231fba27fa 100644 --- a/src/vs/editor/common/core/stringBuilder.ts +++ b/src/vs/editor/common/core/stringBuilder.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import * as platform from 'vs/base/common/platform'; -import * as buffer from 'vs/base/common/buffer'; +import * as strings from '../../../base/common/strings.js'; +import * as platform from '../../../base/common/platform.js'; +import * as buffer from '../../../base/common/buffer.js'; let _utf16LE_TextDecoder: TextDecoder | null; function getUTF16LE_TextDecoder(): TextDecoder { diff --git a/src/vs/editor/common/core/textChange.ts b/src/vs/editor/common/core/textChange.ts index aad78ed4c89..43925f18126 100644 --- a/src/vs/editor/common/core/textChange.ts +++ b/src/vs/editor/common/core/textChange.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as buffer from 'vs/base/common/buffer'; -import { decodeUTF16LE } from 'vs/editor/common/core/stringBuilder'; +import * as buffer from '../../../base/common/buffer.js'; +import { decodeUTF16LE } from './stringBuilder.js'; function escapeNewLine(str: string): string { return ( diff --git a/src/vs/editor/common/core/textEdit.ts b/src/vs/editor/common/core/textEdit.ts index 3b0d6d2f70a..be6b9e65a5a 100644 --- a/src/vs/editor/common/core/textEdit.ts +++ b/src/vs/editor/common/core/textEdit.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { assert, assertFn, checkAdjacentItems } from 'vs/base/common/assert'; -import { BugIndicatingError } from 'vs/base/common/errors'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { PositionOffsetTransformer } from 'vs/editor/common/core/positionToOffset'; -import { Range } from 'vs/editor/common/core/range'; -import { TextLength } from 'vs/editor/common/core/textLength'; +import { assert, assertFn, checkAdjacentItems } from '../../../base/common/assert.js'; +import { BugIndicatingError } from '../../../base/common/errors.js'; +import { ISingleEditOperation } from './editOperation.js'; +import { Position } from './position.js'; +import { PositionOffsetTransformer } from './positionToOffset.js'; +import { Range } from './range.js'; +import { TextLength } from './textLength.js'; export class TextEdit { public static single(originalRange: Range, newText: string): TextEdit { @@ -225,6 +225,15 @@ export class LineBasedText extends AbstractText { } } +export class ArrayText extends LineBasedText { + constructor(lines: string[]) { + super( + lineNumber => lines[lineNumber - 1], + lines.length + ); + } +} + export class StringText extends AbstractText { private readonly _t = new PositionOffsetTransformer(this.value); diff --git a/src/vs/editor/common/core/textLength.ts b/src/vs/editor/common/core/textLength.ts index bee3897d5fd..f1635b93ebb 100644 --- a/src/vs/editor/common/core/textLength.ts +++ b/src/vs/editor/common/core/textLength.ts @@ -2,8 +2,8 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; +import { Position } from './position.js'; +import { Range } from './range.js'; /** * Represents a non-negative length of text in terms of line and column count. diff --git a/src/vs/editor/common/core/wordCharacterClassifier.ts b/src/vs/editor/common/core/wordCharacterClassifier.ts index b984c272657..649498c419e 100644 --- a/src/vs/editor/common/core/wordCharacterClassifier.ts +++ b/src/vs/editor/common/core/wordCharacterClassifier.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { LRUCache } from 'vs/base/common/map'; -import { CharacterClassifier } from 'vs/editor/common/core/characterClassifier'; +import { CharCode } from '../../../base/common/charCode.js'; +import { LRUCache } from '../../../base/common/map.js'; +import { CharacterClassifier } from './characterClassifier.js'; export const enum WordCharacterClass { Regular = 0, diff --git a/src/vs/editor/common/core/wordHelper.ts b/src/vs/editor/common/core/wordHelper.ts index 96e378d0eca..32838f92011 100644 --- a/src/vs/editor/common/core/wordHelper.ts +++ b/src/vs/editor/common/core/wordHelper.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Iterable } from 'vs/base/common/iterator'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import { LinkedList } from 'vs/base/common/linkedList'; +import { Iterable } from '../../../base/common/iterator.js'; +import { toDisposable } from '../../../base/common/lifecycle.js'; +import { LinkedList } from '../../../base/common/linkedList.js'; export const USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?'; diff --git a/src/vs/editor/common/cursor/cursor.ts b/src/vs/editor/common/cursor/cursor.ts index f84b5135d13..d68f60c56ed 100644 --- a/src/vs/editor/common/cursor/cursor.ts +++ b/src/vs/editor/common/cursor/cursor.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { onUnexpectedError } from 'vs/base/common/errors'; -import * as strings from 'vs/base/common/strings'; -import { CursorCollection } from 'vs/editor/common/cursor/cursorCollection'; -import { CursorConfiguration, CursorState, EditOperationResult, EditOperationType, IColumnSelectData, PartialCursorState, ICursorSimpleModel } from 'vs/editor/common/cursorCommon'; -import { CursorContext } from 'vs/editor/common/cursor/cursorContext'; -import { DeleteOperations } from 'vs/editor/common/cursor/cursorDeleteOperations'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { CompositionOutcome, TypeOperations } from 'vs/editor/common/cursor/cursorTypeOperations'; -import { BaseTypeWithAutoClosingCommand } from 'vs/editor/common/cursor/cursorTypeEditOperations'; -import { Position } from 'vs/editor/common/core/position'; -import { Range, IRange } from 'vs/editor/common/core/range'; -import { ISelection, Selection, SelectionDirection } from 'vs/editor/common/core/selection'; -import * as editorCommon from 'vs/editor/common/editorCommon'; -import { ITextModel, TrackedRangeStickiness, IModelDeltaDecoration, ICursorStateComputer, IIdentifiedSingleEditOperation, IValidEditOperation } from 'vs/editor/common/model'; -import { RawContentChangedType, ModelInjectedTextChangedEvent, InternalModelContentChangeEvent } from 'vs/editor/common/textModelEvents'; -import { VerticalRevealType, ViewCursorStateChangedEvent, ViewRevealRangeRequestEvent } from 'vs/editor/common/viewEvents'; -import { dispose, Disposable } from 'vs/base/common/lifecycle'; -import { ICoordinatesConverter } from 'vs/editor/common/viewModel'; -import { CursorStateChangedEvent, ViewModelEventsCollector } from 'vs/editor/common/viewModelEventDispatcher'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import * as strings from '../../../base/common/strings.js'; +import { CursorCollection } from './cursorCollection.js'; +import { CursorConfiguration, CursorState, EditOperationResult, EditOperationType, IColumnSelectData, PartialCursorState, ICursorSimpleModel } from '../cursorCommon.js'; +import { CursorContext } from './cursorContext.js'; +import { DeleteOperations } from './cursorDeleteOperations.js'; +import { CursorChangeReason } from '../cursorEvents.js'; +import { CompositionOutcome, TypeOperations } from './cursorTypeOperations.js'; +import { BaseTypeWithAutoClosingCommand } from './cursorTypeEditOperations.js'; +import { Position } from '../core/position.js'; +import { Range, IRange } from '../core/range.js'; +import { ISelection, Selection, SelectionDirection } from '../core/selection.js'; +import * as editorCommon from '../editorCommon.js'; +import { ITextModel, TrackedRangeStickiness, IModelDeltaDecoration, ICursorStateComputer, IIdentifiedSingleEditOperation, IValidEditOperation } from '../model.js'; +import { RawContentChangedType, ModelInjectedTextChangedEvent, InternalModelContentChangeEvent } from '../textModelEvents.js'; +import { VerticalRevealType, ViewCursorStateChangedEvent, ViewRevealRangeRequestEvent } from '../viewEvents.js'; +import { dispose, Disposable } from '../../../base/common/lifecycle.js'; +import { ICoordinatesConverter } from '../viewModel.js'; +import { CursorStateChangedEvent, ViewModelEventsCollector } from '../viewModelEventDispatcher.js'; export class CursorsController extends Disposable { @@ -740,7 +740,7 @@ interface ICommandsData { hadTrackedEditOperation: boolean; } -class CommandExecutor { +export class CommandExecutor { public static executeCommands(model: ITextModel, selectionsBefore: Selection[], commands: (editorCommon.ICommand | null)[]): Selection[] | null { diff --git a/src/vs/editor/common/cursor/cursorAtomicMoveOperations.ts b/src/vs/editor/common/cursor/cursorAtomicMoveOperations.ts index 5cd406c3f9d..6b2c9cd1f87 100644 --- a/src/vs/editor/common/cursor/cursorAtomicMoveOperations.ts +++ b/src/vs/editor/common/cursor/cursorAtomicMoveOperations.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; +import { CharCode } from '../../../base/common/charCode.js'; +import { CursorColumns } from '../core/cursorColumns.js'; export const enum Direction { Left, diff --git a/src/vs/editor/common/cursor/cursorCollection.ts b/src/vs/editor/common/cursor/cursorCollection.ts index 626c139cbb6..ae1f4b6ca15 100644 --- a/src/vs/editor/common/cursor/cursorCollection.ts +++ b/src/vs/editor/common/cursor/cursorCollection.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { compareBy } from 'vs/base/common/arrays'; -import { findLastMax, findFirstMin } from 'vs/base/common/arraysFind'; -import { CursorState, PartialCursorState } from 'vs/editor/common/cursorCommon'; -import { CursorContext } from 'vs/editor/common/cursor/cursorContext'; -import { Cursor } from 'vs/editor/common/cursor/oneCursor'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ISelection, Selection } from 'vs/editor/common/core/selection'; +import { compareBy } from '../../../base/common/arrays.js'; +import { findLastMax, findFirstMin } from '../../../base/common/arraysFind.js'; +import { CursorState, PartialCursorState } from '../cursorCommon.js'; +import { CursorContext } from './cursorContext.js'; +import { Cursor } from './oneCursor.js'; +import { Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { ISelection, Selection } from '../core/selection.js'; export class CursorCollection { diff --git a/src/vs/editor/common/cursor/cursorColumnSelection.ts b/src/vs/editor/common/cursor/cursorColumnSelection.ts index e87cf910950..eef55621902 100644 --- a/src/vs/editor/common/cursor/cursorColumnSelection.ts +++ b/src/vs/editor/common/cursor/cursorColumnSelection.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CursorConfiguration, ICursorSimpleModel, SingleCursorState, IColumnSelectData, SelectionStartKind } from 'vs/editor/common/cursorCommon'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; +import { CursorConfiguration, ICursorSimpleModel, SingleCursorState, IColumnSelectData, SelectionStartKind } from '../cursorCommon.js'; +import { Position } from '../core/position.js'; +import { Range } from '../core/range.js'; export class ColumnSelection { diff --git a/src/vs/editor/common/cursor/cursorContext.ts b/src/vs/editor/common/cursor/cursorContext.ts index 19c6877bf7c..30c25a6d626 100644 --- a/src/vs/editor/common/cursor/cursorContext.ts +++ b/src/vs/editor/common/cursor/cursorContext.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ITextModel } from 'vs/editor/common/model'; -import { ICoordinatesConverter } from 'vs/editor/common/viewModel'; -import { CursorConfiguration, ICursorSimpleModel } from 'vs/editor/common/cursorCommon'; +import { ITextModel } from '../model.js'; +import { ICoordinatesConverter } from '../viewModel.js'; +import { CursorConfiguration, ICursorSimpleModel } from '../cursorCommon.js'; export class CursorContext { _cursorContextBrand: void = undefined; diff --git a/src/vs/editor/common/cursor/cursorDeleteOperations.ts b/src/vs/editor/common/cursor/cursorDeleteOperations.ts index 13218ea71a6..acf11b2d3ba 100644 --- a/src/vs/editor/common/cursor/cursorDeleteOperations.ts +++ b/src/vs/editor/common/cursor/cursorDeleteOperations.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand'; -import { EditorAutoClosingEditStrategy, EditorAutoClosingStrategy } from 'vs/editor/common/config/editorOptions'; -import { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from 'vs/editor/common/cursorCommon'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; -import { MoveOperations } from 'vs/editor/common/cursor/cursorMoveOperations'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand } from 'vs/editor/common/editorCommon'; -import { StandardAutoClosingPairConditional } from 'vs/editor/common/languages/languageConfiguration'; -import { Position } from 'vs/editor/common/core/position'; +import * as strings from '../../../base/common/strings.js'; +import { ReplaceCommand } from '../commands/replaceCommand.js'; +import { EditorAutoClosingEditStrategy, EditorAutoClosingStrategy } from '../config/editorOptions.js'; +import { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from '../cursorCommon.js'; +import { CursorColumns } from '../core/cursorColumns.js'; +import { MoveOperations } from './cursorMoveOperations.js'; +import { Range } from '../core/range.js'; +import { Selection } from '../core/selection.js'; +import { ICommand } from '../editorCommon.js'; +import { StandardAutoClosingPairConditional } from '../languages/languageConfiguration.js'; +import { Position } from '../core/position.js'; export class DeleteOperations { diff --git a/src/vs/editor/common/cursor/cursorMoveCommands.ts b/src/vs/editor/common/cursor/cursorMoveCommands.ts index 78c553732a9..46e2192ff3e 100644 --- a/src/vs/editor/common/cursor/cursorMoveCommands.ts +++ b/src/vs/editor/common/cursor/cursorMoveCommands.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as types from 'vs/base/common/types'; -import { CursorState, ICursorSimpleModel, PartialCursorState, SelectionStartKind, SingleCursorState } from 'vs/editor/common/cursorCommon'; -import { MoveOperations } from 'vs/editor/common/cursor/cursorMoveOperations'; -import { WordOperations } from 'vs/editor/common/cursor/cursorWordOperations'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ICommandMetadata } from 'vs/platform/commands/common/commands'; -import { IViewModel } from 'vs/editor/common/viewModel'; +import * as types from '../../../base/common/types.js'; +import { CursorState, ICursorSimpleModel, PartialCursorState, SelectionStartKind, SingleCursorState } from '../cursorCommon.js'; +import { MoveOperations } from './cursorMoveOperations.js'; +import { WordOperations } from './cursorWordOperations.js'; +import { IPosition, Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { ICommandMetadata } from '../../../platform/commands/common/commands.js'; +import { IViewModel } from '../viewModel.js'; export class CursorMoveCommands { diff --git a/src/vs/editor/common/cursor/cursorMoveOperations.ts b/src/vs/editor/common/cursor/cursorMoveOperations.ts index 5699917a4f4..ebfde76738d 100644 --- a/src/vs/editor/common/cursor/cursorMoveOperations.ts +++ b/src/vs/editor/common/cursor/cursorMoveOperations.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import { Constants } from 'vs/base/common/uint'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { AtomicTabMoveOperations, Direction } from 'vs/editor/common/cursor/cursorAtomicMoveOperations'; -import { CursorConfiguration, ICursorSimpleModel, SelectionStartKind, SingleCursorState } from 'vs/editor/common/cursorCommon'; -import { PositionAffinity } from 'vs/editor/common/model'; +import * as strings from '../../../base/common/strings.js'; +import { Constants } from '../../../base/common/uint.js'; +import { CursorColumns } from '../core/cursorColumns.js'; +import { Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { AtomicTabMoveOperations, Direction } from './cursorAtomicMoveOperations.js'; +import { CursorConfiguration, ICursorSimpleModel, SelectionStartKind, SingleCursorState } from '../cursorCommon.js'; +import { PositionAffinity } from '../model.js'; export class CursorPosition { _cursorPositionBrand: void = undefined; diff --git a/src/vs/editor/common/cursor/cursorTypeEditOperations.ts b/src/vs/editor/common/cursor/cursorTypeEditOperations.ts index df17d2f3918..c20fcfad38a 100644 --- a/src/vs/editor/common/cursor/cursorTypeEditOperations.ts +++ b/src/vs/editor/common/cursor/cursorTypeEditOperations.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import * as strings from 'vs/base/common/strings'; -import { ReplaceCommand, ReplaceCommandWithOffsetCursorState, ReplaceCommandWithoutChangingPosition, ReplaceCommandThatPreservesSelection } from 'vs/editor/common/commands/replaceCommand'; -import { ShiftCommand } from 'vs/editor/common/commands/shiftCommand'; -import { SurroundSelectionCommand } from 'vs/editor/common/commands/surroundSelectionCommand'; -import { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from 'vs/editor/common/cursorCommon'; -import { WordCharacterClass, getMapForWordSeparators } from 'vs/editor/common/core/wordCharacterClassifier'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Position } from 'vs/editor/common/core/position'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { EnterAction, IndentAction, StandardAutoClosingPairConditional } from 'vs/editor/common/languages/languageConfiguration'; -import { getIndentationAtPosition } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IElectricAction } from 'vs/editor/common/languages/supports/electricCharacter'; -import { EditorAutoClosingStrategy, EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions'; -import { createScopedLineTokens } from 'vs/editor/common/languages/supports'; -import { getIndentActionForType, getIndentForEnter, getInheritIndentForLine } from 'vs/editor/common/languages/autoIndent'; -import { getEnterAction } from 'vs/editor/common/languages/enterAction'; +import { CharCode } from '../../../base/common/charCode.js'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import * as strings from '../../../base/common/strings.js'; +import { ReplaceCommand, ReplaceCommandWithOffsetCursorState, ReplaceCommandWithoutChangingPosition, ReplaceCommandThatPreservesSelection } from '../commands/replaceCommand.js'; +import { ShiftCommand } from '../commands/shiftCommand.js'; +import { SurroundSelectionCommand } from '../commands/surroundSelectionCommand.js'; +import { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from '../cursorCommon.js'; +import { WordCharacterClass, getMapForWordSeparators } from '../core/wordCharacterClassifier.js'; +import { Range } from '../core/range.js'; +import { Selection } from '../core/selection.js'; +import { Position } from '../core/position.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../editorCommon.js'; +import { ITextModel } from '../model.js'; +import { EnterAction, IndentAction, StandardAutoClosingPairConditional } from '../languages/languageConfiguration.js'; +import { getIndentationAtPosition } from '../languages/languageConfigurationRegistry.js'; +import { IElectricAction } from '../languages/supports/electricCharacter.js'; +import { EditorAutoClosingStrategy, EditorAutoIndentStrategy } from '../config/editorOptions.js'; +import { createScopedLineTokens } from '../languages/supports.js'; +import { getIndentActionForType, getIndentForEnter, getInheritIndentForLine } from '../languages/autoIndent.js'; +import { getEnterAction } from '../languages/enterAction.js'; export class AutoIndentOperation { diff --git a/src/vs/editor/common/cursor/cursorTypeOperations.ts b/src/vs/editor/common/cursor/cursorTypeOperations.ts index b4c65156f85..c518f3f97c4 100644 --- a/src/vs/editor/common/cursor/cursorTypeOperations.ts +++ b/src/vs/editor/common/cursor/cursorTypeOperations.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ShiftCommand } from 'vs/editor/common/commands/shiftCommand'; -import { CompositionSurroundSelectionCommand } from 'vs/editor/common/commands/surroundSelectionCommand'; -import { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from 'vs/editor/common/cursorCommon'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Position } from 'vs/editor/common/core/position'; -import { ICommand } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { AutoClosingOpenCharTypeOperation, AutoClosingOvertypeOperation, AutoClosingOvertypeWithInterceptorsOperation, AutoIndentOperation, CompositionOperation, EnterOperation, InterceptorElectricCharOperation, PasteOperation, shiftIndent, shouldSurroundChar, SimpleCharacterTypeOperation, SurroundSelectionOperation, TabOperation, TypeWithoutInterceptorsOperation, unshiftIndent } from 'vs/editor/common/cursor/cursorTypeEditOperations'; +import { ShiftCommand } from '../commands/shiftCommand.js'; +import { CompositionSurroundSelectionCommand } from '../commands/surroundSelectionCommand.js'; +import { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from '../cursorCommon.js'; +import { Range } from '../core/range.js'; +import { Selection } from '../core/selection.js'; +import { Position } from '../core/position.js'; +import { ICommand } from '../editorCommon.js'; +import { ITextModel } from '../model.js'; +import { AutoClosingOpenCharTypeOperation, AutoClosingOvertypeOperation, AutoClosingOvertypeWithInterceptorsOperation, AutoIndentOperation, CompositionOperation, EnterOperation, InterceptorElectricCharOperation, PasteOperation, shiftIndent, shouldSurroundChar, SimpleCharacterTypeOperation, SurroundSelectionOperation, TabOperation, TypeWithoutInterceptorsOperation, unshiftIndent } from './cursorTypeEditOperations.js'; export class TypeOperations { diff --git a/src/vs/editor/common/cursor/cursorWordOperations.ts b/src/vs/editor/common/cursor/cursorWordOperations.ts index a43538215b2..3e1d066587d 100644 --- a/src/vs/editor/common/cursor/cursorWordOperations.ts +++ b/src/vs/editor/common/cursor/cursorWordOperations.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import * as strings from 'vs/base/common/strings'; -import { EditorAutoClosingEditStrategy, EditorAutoClosingStrategy } from 'vs/editor/common/config/editorOptions'; -import { CursorConfiguration, ICursorSimpleModel, SelectionStartKind, SingleCursorState } from 'vs/editor/common/cursorCommon'; -import { DeleteOperations } from 'vs/editor/common/cursor/cursorDeleteOperations'; -import { WordCharacterClass, WordCharacterClassifier, IntlWordSegmentData, getMapForWordSeparators } from 'vs/editor/common/core/wordCharacterClassifier'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ITextModel } from 'vs/editor/common/model'; -import { IWordAtPosition } from 'vs/editor/common/core/wordHelper'; -import { AutoClosingPairs } from 'vs/editor/common/languages/languageConfiguration'; +import { CharCode } from '../../../base/common/charCode.js'; +import * as strings from '../../../base/common/strings.js'; +import { EditorAutoClosingEditStrategy, EditorAutoClosingStrategy } from '../config/editorOptions.js'; +import { CursorConfiguration, ICursorSimpleModel, SelectionStartKind, SingleCursorState } from '../cursorCommon.js'; +import { DeleteOperations } from './cursorDeleteOperations.js'; +import { WordCharacterClass, WordCharacterClassifier, IntlWordSegmentData, getMapForWordSeparators } from '../core/wordCharacterClassifier.js'; +import { Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { Selection } from '../core/selection.js'; +import { ITextModel } from '../model.js'; +import { IWordAtPosition } from '../core/wordHelper.js'; +import { AutoClosingPairs } from '../languages/languageConfiguration.js'; interface IFindWordResult { /** diff --git a/src/vs/editor/common/cursor/oneCursor.ts b/src/vs/editor/common/cursor/oneCursor.ts index a0dc0eafc43..17bdb4e69e0 100644 --- a/src/vs/editor/common/cursor/oneCursor.ts +++ b/src/vs/editor/common/cursor/oneCursor.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CursorState, ICursorSimpleModel, SelectionStartKind, SingleCursorState } from 'vs/editor/common/cursorCommon'; -import { CursorContext } from 'vs/editor/common/cursor/cursorContext'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { PositionAffinity, TrackedRangeStickiness } from 'vs/editor/common/model'; +import { CursorState, ICursorSimpleModel, SelectionStartKind, SingleCursorState } from '../cursorCommon.js'; +import { CursorContext } from './cursorContext.js'; +import { Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { Selection } from '../core/selection.js'; +import { PositionAffinity, TrackedRangeStickiness } from '../model.js'; /** * Represents a single cursor. diff --git a/src/vs/editor/common/cursorCommon.ts b/src/vs/editor/common/cursorCommon.ts index c5411aa8539..52f8673a327 100644 --- a/src/vs/editor/common/cursorCommon.ts +++ b/src/vs/editor/common/cursorCommon.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ConfigurationChangedEvent, EditorAutoClosingEditStrategy, EditorAutoClosingStrategy, EditorAutoIndentStrategy, EditorAutoSurroundStrategy, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ISelection, Selection } from 'vs/editor/common/core/selection'; -import { ICommand } from 'vs/editor/common/editorCommon'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { PositionAffinity, TextModelResolvedOptions } from 'vs/editor/common/model'; -import { AutoClosingPairs } from 'vs/editor/common/languages/languageConfiguration'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { createScopedLineTokens } from 'vs/editor/common/languages/supports'; -import { IElectricAction } from 'vs/editor/common/languages/supports/electricCharacter'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; -import { normalizeIndentation } from 'vs/editor/common/core/indentation'; +import { ConfigurationChangedEvent, EditorAutoClosingEditStrategy, EditorAutoClosingStrategy, EditorAutoIndentStrategy, EditorAutoSurroundStrategy, EditorOption } from './config/editorOptions.js'; +import { LineTokens } from './tokens/lineTokens.js'; +import { Position } from './core/position.js'; +import { Range } from './core/range.js'; +import { ISelection, Selection } from './core/selection.js'; +import { ICommand } from './editorCommon.js'; +import { IEditorConfiguration } from './config/editorConfiguration.js'; +import { PositionAffinity, TextModelResolvedOptions } from './model.js'; +import { AutoClosingPairs } from './languages/languageConfiguration.js'; +import { ILanguageConfigurationService } from './languages/languageConfigurationRegistry.js'; +import { createScopedLineTokens } from './languages/supports.js'; +import { IElectricAction } from './languages/supports/electricCharacter.js'; +import { CursorColumns } from './core/cursorColumns.js'; +import { normalizeIndentation } from './core/indentation.js'; export interface IColumnSelectData { isReal: boolean; diff --git a/src/vs/editor/common/cursorEvents.ts b/src/vs/editor/common/cursorEvents.ts index eb3418b993f..e3b58c3126f 100644 --- a/src/vs/editor/common/cursorEvents.ts +++ b/src/vs/editor/common/cursorEvents.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; +import { Position } from './core/position.js'; +import { Selection } from './core/selection.js'; /** * Describes the reason the cursor has changed its position. diff --git a/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts b/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts index 50fbf66deba..0d0eae6d7e1 100644 --- a/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts +++ b/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { forEachAdjacent } from 'vs/base/common/arrays'; -import { BugIndicatingError } from 'vs/base/common/errors'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; +import { forEachAdjacent } from '../../../../../base/common/arrays.js'; +import { BugIndicatingError } from '../../../../../base/common/errors.js'; +import { OffsetRange } from '../../../core/offsetRange.js'; /** * Represents a synchronous diff algorithm. Should be executed in a worker. @@ -52,6 +52,18 @@ export class SequenceDiff { ); } + public static assertSorted(sequenceDiffs: SequenceDiff[]): void { + let last: SequenceDiff | undefined = undefined; + for (const cur of sequenceDiffs) { + if (last) { + if (!(last.seq1Range.endExclusive <= cur.seq1Range.start && last.seq2Range.endExclusive <= cur.seq2Range.start)) { + throw new BugIndicatingError('Sequence diffs must be sorted'); + } + } + last = cur; + } + } + constructor( public readonly seq1Range: OffsetRange, public readonly seq2Range: OffsetRange, @@ -184,8 +196,6 @@ export class DateTimeout implements ITimeout { const valid = Date.now() - this.startTime < this.timeout; if (!valid && this.valid) { this.valid = false; // timeout reached - // eslint-disable-next-line no-debugger - debugger; // WARNING: Most likely debugging caused the timeout. Call `this.disable()` to continue without timing out. } return this.valid; } diff --git a/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.ts b/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.ts index f27644435b0..565560c5cf4 100644 --- a/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.ts +++ b/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { IDiffAlgorithm, SequenceDiff, ISequence, ITimeout, InfiniteTimeout, DiffAlgorithmResult } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm'; -import { Array2D } from 'vs/editor/common/diff/defaultLinesDiffComputer/utils'; +import { OffsetRange } from '../../../core/offsetRange.js'; +import { IDiffAlgorithm, SequenceDiff, ISequence, ITimeout, InfiniteTimeout, DiffAlgorithmResult } from './diffAlgorithm.js'; +import { Array2D } from '../utils.js'; /** * A O(MN) diffing algorithm that supports a score function. diff --git a/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.ts b/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.ts index c0843188927..b496d002de8 100644 --- a/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.ts +++ b/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { DiffAlgorithmResult, IDiffAlgorithm, ISequence, ITimeout, InfiniteTimeout, SequenceDiff } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm'; +import { OffsetRange } from '../../../core/offsetRange.js'; +import { DiffAlgorithmResult, IDiffAlgorithm, ISequence, ITimeout, InfiniteTimeout, SequenceDiff } from './diffAlgorithm.js'; /** * An O(ND) diff algorithm that has a quadratic space worst-case complexity. diff --git a/src/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.ts b/src/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.ts index 8f7183211d7..523486d84f1 100644 --- a/src/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.ts +++ b/src/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ITimeout, SequenceDiff } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm'; -import { DetailedLineRangeMapping, LineRangeMapping } from '../rangeMapping'; -import { pushMany, compareBy, numberComparator, reverseOrder } from 'vs/base/common/arrays'; -import { MonotonousArray, findLastMonotonous } from 'vs/base/common/arraysFind'; -import { SetMap } from 'vs/base/common/map'; -import { LineRange, LineRangeSet } from 'vs/editor/common/core/lineRange'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { LinesSliceCharSequence } from 'vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence'; -import { LineRangeFragment, isSpace } from 'vs/editor/common/diff/defaultLinesDiffComputer/utils'; -import { MyersDiffAlgorithm } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm'; +import { ITimeout, SequenceDiff } from './algorithms/diffAlgorithm.js'; +import { DetailedLineRangeMapping, LineRangeMapping } from '../rangeMapping.js'; +import { pushMany, compareBy, numberComparator, reverseOrder } from '../../../../base/common/arrays.js'; +import { MonotonousArray, findLastMonotonous } from '../../../../base/common/arraysFind.js'; +import { SetMap } from '../../../../base/common/map.js'; +import { LineRange, LineRangeSet } from '../../core/lineRange.js'; +import { LinesSliceCharSequence } from './linesSliceCharSequence.js'; +import { LineRangeFragment, isSpace } from './utils.js'; +import { MyersDiffAlgorithm } from './algorithms/myersDiffAlgorithm.js'; +import { Range } from '../../core/range.js'; export function computeMovedLines( changes: DetailedLineRangeMapping[], @@ -260,8 +260,8 @@ function areLinesSimilar(line1: string, line2: string, timeout: ITimeout): boole const myersDiffingAlgorithm = new MyersDiffAlgorithm(); const result = myersDiffingAlgorithm.compute( - new LinesSliceCharSequence([line1], new OffsetRange(0, 1), false), - new LinesSliceCharSequence([line2], new OffsetRange(0, 1), false), + new LinesSliceCharSequence([line1], new Range(1, 1, 1, line1.length), false), + new LinesSliceCharSequence([line2], new Range(1, 1, 1, line2.length), false), timeout ); let commonNonSpaceCharCount = 0; diff --git a/src/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.ts b/src/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.ts index 2c3ee2fe094..7b058590f0c 100644 --- a/src/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.ts +++ b/src/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { equals, groupAdjacentBy } from 'vs/base/common/arrays'; -import { assertFn, checkAdjacentItems } from 'vs/base/common/assert'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { DateTimeout, ITimeout, InfiniteTimeout, SequenceDiff } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm'; -import { DynamicProgrammingDiffing } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing'; -import { MyersDiffAlgorithm } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm'; -import { computeMovedLines } from 'vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines'; -import { extendDiffsToEntireWordIfAppropriate, optimizeSequenceDiffs, removeShortMatches, removeVeryShortMatchingLinesBetweenDiffs, removeVeryShortMatchingTextBetweenLongDiffs } from 'vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations'; -import { LineSequence } from 'vs/editor/common/diff/defaultLinesDiffComputer/lineSequence'; -import { LinesSliceCharSequence } from 'vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence'; -import { ILinesDiffComputer, ILinesDiffComputerOptions, LinesDiff, MovedText } from 'vs/editor/common/diff/linesDiffComputer'; -import { DetailedLineRangeMapping, RangeMapping } from '../rangeMapping'; +import { equals, groupAdjacentBy } from '../../../../base/common/arrays.js'; +import { assertFn, checkAdjacentItems } from '../../../../base/common/assert.js'; +import { LineRange } from '../../core/lineRange.js'; +import { OffsetRange } from '../../core/offsetRange.js'; +import { Position } from '../../core/position.js'; +import { Range } from '../../core/range.js'; +import { DateTimeout, ITimeout, InfiniteTimeout, SequenceDiff } from './algorithms/diffAlgorithm.js'; +import { DynamicProgrammingDiffing } from './algorithms/dynamicProgrammingDiffing.js'; +import { MyersDiffAlgorithm } from './algorithms/myersDiffAlgorithm.js'; +import { computeMovedLines } from './computeMovedLines.js'; +import { extendDiffsToEntireWordIfAppropriate, optimizeSequenceDiffs, removeShortMatches, removeVeryShortMatchingLinesBetweenDiffs, removeVeryShortMatchingTextBetweenLongDiffs } from './heuristicSequenceOptimizations.js'; +import { LineSequence } from './lineSequence.js'; +import { LinesSliceCharSequence } from './linesSliceCharSequence.js'; +import { ILinesDiffComputer, ILinesDiffComputerOptions, LinesDiff, MovedText } from '../linesDiffComputer.js'; +import { DetailedLineRangeMapping, LineRangeMapping, RangeMapping } from '../rangeMapping.js'; export class DefaultLinesDiffComputer implements ILinesDiffComputer { private readonly dynamicProgrammingDiffing = new DynamicProgrammingDiffing(); @@ -167,7 +167,9 @@ export class DefaultLinesDiffComputer implements ILinesDiffComputer { for (const ic of c.innerChanges) { const valid = validatePosition(ic.modifiedRange.getStartPosition(), modifiedLines) && validatePosition(ic.modifiedRange.getEndPosition(), modifiedLines) && validatePosition(ic.originalRange.getStartPosition(), originalLines) && validatePosition(ic.originalRange.getEndPosition(), originalLines); - if (!valid) { return false; } + if (!valid) { + return false; + } } if (!validateRange(c.modified, modifiedLines) || !validateRange(c.original, originalLines)) { return false; @@ -208,18 +210,28 @@ export class DefaultLinesDiffComputer implements ILinesDiffComputer { } private refineDiff(originalLines: string[], modifiedLines: string[], diff: SequenceDiff, timeout: ITimeout, considerWhitespaceChanges: boolean): { mappings: RangeMapping[]; hitTimeout: boolean } { - const slice1 = new LinesSliceCharSequence(originalLines, diff.seq1Range, considerWhitespaceChanges); - const slice2 = new LinesSliceCharSequence(modifiedLines, diff.seq2Range, considerWhitespaceChanges); + const lineRangeMapping = toLineRangeMapping(diff); + const rangeMapping = lineRangeMapping.toRangeMapping2(originalLines, modifiedLines); + + const slice1 = new LinesSliceCharSequence(originalLines, rangeMapping.originalRange, considerWhitespaceChanges); + const slice2 = new LinesSliceCharSequence(modifiedLines, rangeMapping.modifiedRange, considerWhitespaceChanges); const diffResult = slice1.length + slice2.length < 500 ? this.dynamicProgrammingDiffing.compute(slice1, slice2, timeout) : this.myersDiffingAlgorithm.compute(slice1, slice2, timeout); + const check = false; + let diffs = diffResult.diffs; + if (check) { SequenceDiff.assertSorted(diffs); } diffs = optimizeSequenceDiffs(slice1, slice2, diffs); + if (check) { SequenceDiff.assertSorted(diffs); } diffs = extendDiffsToEntireWordIfAppropriate(slice1, slice2, diffs); + if (check) { SequenceDiff.assertSorted(diffs); } diffs = removeShortMatches(slice1, slice2, diffs); + if (check) { SequenceDiff.assertSorted(diffs); } diffs = removeVeryShortMatchingTextBetweenLongDiffs(slice1, slice2, diffs); + if (check) { SequenceDiff.assertSorted(diffs); } const result = diffs.map( (d) => @@ -229,6 +241,8 @@ export class DefaultLinesDiffComputer implements ILinesDiffComputer { ) ); + if (check) { RangeMapping.assertSorted(result); } + // Assert: result applied on original should be the same as diff applied to original return { @@ -312,3 +326,10 @@ export function getLineRangeMapping(rangeMapping: RangeMapping, originalLines: s return new DetailedLineRangeMapping(originalLineRange, modifiedLineRange, [rangeMapping]); } + +function toLineRangeMapping(sequenceDiff: SequenceDiff) { + return new LineRangeMapping( + new LineRange(sequenceDiff.seq1Range.start + 1, sequenceDiff.seq1Range.endExclusive + 1), + new LineRange(sequenceDiff.seq2Range.start + 1, sequenceDiff.seq2Range.endExclusive + 1), + ); +} diff --git a/src/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.ts b/src/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.ts index fddfb1e0c61..c205457ac53 100644 --- a/src/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.ts +++ b/src/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { forEachWithNeighbors } from 'vs/base/common/arrays'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { ISequence, OffsetPair, SequenceDiff } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm'; -import { LineSequence } from 'vs/editor/common/diff/defaultLinesDiffComputer/lineSequence'; -import { LinesSliceCharSequence } from 'vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence'; +import { forEachWithNeighbors } from '../../../../base/common/arrays.js'; +import { OffsetRange } from '../../core/offsetRange.js'; +import { ISequence, OffsetPair, SequenceDiff } from './algorithms/diffAlgorithm.js'; +import { LineSequence } from './lineSequence.js'; +import { LinesSliceCharSequence } from './linesSliceCharSequence.js'; export function optimizeSequenceDiffs(sequence1: ISequence, sequence2: ISequence, sequenceDiffs: SequenceDiff[]): SequenceDiff[] { let result = sequenceDiffs; diff --git a/src/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.ts b/src/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.ts index fd48f598de0..998459b21e3 100644 --- a/src/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.ts +++ b/src/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { ISequence } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { OffsetRange } from '../../core/offsetRange.js'; +import { ISequence } from './algorithms/diffAlgorithm.js'; export class LineSequence implements ISequence { constructor( diff --git a/src/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.ts b/src/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.ts index 9edc63d335f..b56245bbc0f 100644 --- a/src/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.ts +++ b/src/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.ts @@ -3,62 +3,49 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { findLastIdxMonotonous, findLastMonotonous, findFirstMonotonous } from 'vs/base/common/arraysFind'; -import { CharCode } from 'vs/base/common/charCode'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ISequence } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm'; -import { isSpace } from 'vs/editor/common/diff/defaultLinesDiffComputer/utils'; +import { findLastIdxMonotonous, findLastMonotonous, findFirstMonotonous } from '../../../../base/common/arraysFind.js'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { OffsetRange } from '../../core/offsetRange.js'; +import { Position } from '../../core/position.js'; +import { Range } from '../../core/range.js'; +import { ISequence } from './algorithms/diffAlgorithm.js'; +import { isSpace } from './utils.js'; export class LinesSliceCharSequence implements ISequence { private readonly elements: number[] = []; - private readonly firstCharOffsetByLine: number[] = []; - public readonly lineRange: OffsetRange; - // To account for trimming - private readonly additionalOffsetByLine: number[] = []; - - constructor(public readonly lines: string[], lineRange: OffsetRange, public readonly considerWhitespaceChanges: boolean) { - // This slice has to have lineRange.length many \n! (otherwise diffing against an empty slice will be problematic) - // (Unless it covers the entire document, in that case the other slice also has to cover the entire document ands it's okay) - - // If the slice covers the end, but does not start at the beginning, we include just the \n of the previous line. - let trimFirstLineFully = false; - if (lineRange.start > 0 && lineRange.endExclusive >= lines.length) { - lineRange = new OffsetRange(lineRange.start - 1, lineRange.endExclusive); - trimFirstLineFully = true; - } + private readonly firstElementOffsetByLineIdx: number[] = []; + private readonly lineStartOffsets: number[] = []; + private readonly trimmedWsLengthsByLineIdx: number[] = []; + + constructor(public readonly lines: string[], private readonly range: Range, public readonly considerWhitespaceChanges: boolean) { + this.firstElementOffsetByLineIdx.push(0); + for (let lineNumber = this.range.startLineNumber; lineNumber <= this.range.endLineNumber; lineNumber++) { + let line = lines[lineNumber - 1]; + let lineStartOffset = 0; + if (lineNumber === this.range.startLineNumber && this.range.startColumn > 1) { + lineStartOffset = this.range.startColumn - 1; + line = line.substring(lineStartOffset); + } + this.lineStartOffsets.push(lineStartOffset); - this.lineRange = lineRange; - - this.firstCharOffsetByLine[0] = 0; - for (let i = this.lineRange.start; i < this.lineRange.endExclusive; i++) { - let line = lines[i]; - let offset = 0; - if (trimFirstLineFully) { - offset = line.length; - line = ''; - trimFirstLineFully = false; - } else if (!considerWhitespaceChanges) { + let trimmedWsLength = 0; + if (!considerWhitespaceChanges) { const trimmedStartLine = line.trimStart(); - offset = line.length - trimmedStartLine.length; + trimmedWsLength = line.length - trimmedStartLine.length; line = trimmedStartLine.trimEnd(); } + this.trimmedWsLengthsByLineIdx.push(trimmedWsLength); - this.additionalOffsetByLine.push(offset); - - for (let i = 0; i < line.length; i++) { + const lineLength = lineNumber === this.range.endLineNumber ? Math.min(this.range.endColumn - 1 - lineStartOffset - trimmedWsLength, line.length) : line.length; + for (let i = 0; i < lineLength; i++) { this.elements.push(line.charCodeAt(i)); } - // Don't add an \n that does not exist in the document. - if (i < lines.length - 1) { + if (lineNumber < this.range.endLineNumber) { this.elements.push('\n'.charCodeAt(0)); - this.firstCharOffsetByLine[i - this.lineRange.start + 1] = this.elements.length; + this.firstElementOffsetByLineIdx.push(this.elements.length); } } - // To account for the last line - this.additionalOffsetByLine.push(0); } toString() { @@ -111,18 +98,23 @@ export class LinesSliceCharSequence implements ISequence { return score; } - public translateOffset(offset: number): Position { + public translateOffset(offset: number, preference: 'left' | 'right' = 'right'): Position { // find smallest i, so that lineBreakOffsets[i] <= offset using binary search - if (this.lineRange.isEmpty) { - return new Position(this.lineRange.start + 1, 1); - } - - const i = findLastIdxMonotonous(this.firstCharOffsetByLine, (value) => value <= offset); - return new Position(this.lineRange.start + i + 1, offset - this.firstCharOffsetByLine[i] + this.additionalOffsetByLine[i] + 1); + const i = findLastIdxMonotonous(this.firstElementOffsetByLineIdx, (value) => value <= offset); + const lineOffset = offset - this.firstElementOffsetByLineIdx[i]; + return new Position( + this.range.startLineNumber + i, + 1 + this.lineStartOffsets[i] + lineOffset + ((lineOffset === 0 && preference === 'left') ? 0 : this.trimmedWsLengthsByLineIdx[i]) + ); } public translateRange(range: OffsetRange): Range { - return Range.fromPositions(this.translateOffset(range.start), this.translateOffset(range.endExclusive)); + const pos1 = this.translateOffset(range.start, 'right'); + const pos2 = this.translateOffset(range.endExclusive, 'left'); + if (pos2.isBefore(pos1)) { + return Range.fromPositions(pos2, pos2); + } + return Range.fromPositions(pos1, pos2); } /** @@ -161,8 +153,8 @@ export class LinesSliceCharSequence implements ISequence { } public extendToFullLines(range: OffsetRange): OffsetRange { - const start = findLastMonotonous(this.firstCharOffsetByLine, x => x <= range.start) ?? 0; - const end = findFirstMonotonous(this.firstCharOffsetByLine, x => range.endExclusive <= x) ?? this.elements.length; + const start = findLastMonotonous(this.firstElementOffsetByLineIdx, x => x <= range.start) ?? 0; + const end = findFirstMonotonous(this.firstElementOffsetByLineIdx, x => range.endExclusive <= x) ?? this.elements.length; return new OffsetRange(start, end); } } diff --git a/src/vs/editor/common/diff/defaultLinesDiffComputer/utils.ts b/src/vs/editor/common/diff/defaultLinesDiffComputer/utils.ts index 533b71e3740..cc5e19a2c93 100644 --- a/src/vs/editor/common/diff/defaultLinesDiffComputer/utils.ts +++ b/src/vs/editor/common/diff/defaultLinesDiffComputer/utils.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { LineRange } from '../../core/lineRange.js'; +import { DetailedLineRangeMapping } from '../rangeMapping.js'; export class Array2D { private readonly array: T[] = []; diff --git a/src/vs/editor/common/diff/documentDiffProvider.ts b/src/vs/editor/common/diff/documentDiffProvider.ts index 10dfca90888..161dde65da2 100644 --- a/src/vs/editor/common/diff/documentDiffProvider.ts +++ b/src/vs/editor/common/diff/documentDiffProvider.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { MovedText } from 'vs/editor/common/diff/linesDiffComputer'; -import { DetailedLineRangeMapping } from './rangeMapping'; -import { ITextModel } from 'vs/editor/common/model'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { MovedText } from './linesDiffComputer.js'; +import { DetailedLineRangeMapping } from './rangeMapping.js'; +import { ITextModel } from '../model.js'; /** * A document diff provider computes the diff between two text models. diff --git a/src/vs/editor/common/diff/legacyLinesDiffComputer.ts b/src/vs/editor/common/diff/legacyLinesDiffComputer.ts index 8d7e05e0308..f3129ac9a7f 100644 --- a/src/vs/editor/common/diff/legacyLinesDiffComputer.ts +++ b/src/vs/editor/common/diff/legacyLinesDiffComputer.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { IDiffChange, ISequence, LcsDiff, IDiffResult } from 'vs/base/common/diff/diff'; -import { ILinesDiffComputer, ILinesDiffComputerOptions, LinesDiff } from 'vs/editor/common/diff/linesDiffComputer'; -import { RangeMapping, DetailedLineRangeMapping } from './rangeMapping'; -import * as strings from 'vs/base/common/strings'; -import { Range } from 'vs/editor/common/core/range'; -import { assertFn, checkAdjacentItems } from 'vs/base/common/assert'; -import { LineRange } from 'vs/editor/common/core/lineRange'; +import { CharCode } from '../../../base/common/charCode.js'; +import { IDiffChange, ISequence, LcsDiff, IDiffResult } from '../../../base/common/diff/diff.js'; +import { ILinesDiffComputer, ILinesDiffComputerOptions, LinesDiff } from './linesDiffComputer.js'; +import { RangeMapping, DetailedLineRangeMapping } from './rangeMapping.js'; +import * as strings from '../../../base/common/strings.js'; +import { Range } from '../core/range.js'; +import { assertFn, checkAdjacentItems } from '../../../base/common/assert.js'; +import { LineRange } from '../core/lineRange.js'; const MINIMUM_MATCHING_CHARACTER_LENGTH = 3; diff --git a/src/vs/editor/common/diff/linesDiffComputer.ts b/src/vs/editor/common/diff/linesDiffComputer.ts index a11674f0127..054d1eebfdd 100644 --- a/src/vs/editor/common/diff/linesDiffComputer.ts +++ b/src/vs/editor/common/diff/linesDiffComputer.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DetailedLineRangeMapping, LineRangeMapping } from './rangeMapping'; +import { DetailedLineRangeMapping, LineRangeMapping } from './rangeMapping.js'; export interface ILinesDiffComputer { computeDiff(originalLines: string[], modifiedLines: string[], options: ILinesDiffComputerOptions): LinesDiff; diff --git a/src/vs/editor/common/diff/linesDiffComputers.ts b/src/vs/editor/common/diff/linesDiffComputers.ts index 75c63fe6552..a0a17e5a42c 100644 --- a/src/vs/editor/common/diff/linesDiffComputers.ts +++ b/src/vs/editor/common/diff/linesDiffComputers.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { LegacyLinesDiffComputer } from 'vs/editor/common/diff/legacyLinesDiffComputer'; -import { DefaultLinesDiffComputer } from 'vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer'; -import { ILinesDiffComputer } from 'vs/editor/common/diff/linesDiffComputer'; +import { LegacyLinesDiffComputer } from './legacyLinesDiffComputer.js'; +import { DefaultLinesDiffComputer } from './defaultLinesDiffComputer/defaultLinesDiffComputer.js'; +import { ILinesDiffComputer } from './linesDiffComputer.js'; export const linesDiffComputers = { getLegacy: () => new LegacyLinesDiffComputer(), diff --git a/src/vs/editor/common/diff/rangeMapping.ts b/src/vs/editor/common/diff/rangeMapping.ts index f15b2a05310..2e341b8aef2 100644 --- a/src/vs/editor/common/diff/rangeMapping.ts +++ b/src/vs/editor/common/diff/rangeMapping.ts @@ -3,10 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BugIndicatingError } from 'vs/base/common/errors'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { Range } from 'vs/editor/common/core/range'; -import { AbstractText, SingleTextEdit } from 'vs/editor/common/core/textEdit'; +import { BugIndicatingError } from '../../../base/common/errors.js'; +import { LineRange } from '../core/lineRange.js'; +import { Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { AbstractText, SingleTextEdit } from '../core/textEdit.js'; /** * Maps a line range in the original text model to a line range in the modified text model. @@ -118,6 +119,70 @@ export class LineRangeMapping { ); } } + + /** + * This method assumes that the LineRangeMapping describes a valid diff! + * I.e. if one range is empty, the other range cannot be the entire document. + * It avoids various problems when the line range points to non-existing line-numbers. + */ + public toRangeMapping2(original: string[], modified: string[]): RangeMapping { + if (isValidLineNumber(this.original.endLineNumberExclusive, original) + && isValidLineNumber(this.modified.endLineNumberExclusive, modified)) { + return new RangeMapping( + new Range(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), + new Range(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1), + ); + } + + if (!this.original.isEmpty && !this.modified.isEmpty) { + return new RangeMapping( + Range.fromPositions( + new Position(this.original.startLineNumber, 1), + normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original) + ), + Range.fromPositions( + new Position(this.modified.startLineNumber, 1), + normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified) + ), + ); + } + + if (this.original.startLineNumber > 1 && this.modified.startLineNumber > 1) { + return new RangeMapping( + Range.fromPositions( + normalizePosition(new Position(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER), original), + normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original) + ), + Range.fromPositions( + normalizePosition(new Position(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER), modified), + normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified) + ), + ); + } + + // Situation now: one range is empty and one range touches the last line and one range starts at line 1. + // I don't think this can happen. + + throw new BugIndicatingError(); + } +} + +function normalizePosition(position: Position, content: string[]): Position { + if (position.lineNumber < 1) { + return new Position(1, 1); + } + if (position.lineNumber > content.length) { + return new Position(content.length, content[content.length - 1].length + 1); + } + const line = content[position.lineNumber - 1]; + if (position.column > line.length + 1) { + return new Position(position.lineNumber, line.length + 1); + } + return position; +} + +function isValidLineNumber(lineNumber: number, lines: string[]): boolean { + return lineNumber >= 1 && lineNumber <= lines.length; } /** @@ -161,6 +226,19 @@ export class DetailedLineRangeMapping extends LineRangeMapping { * Maps a range in the original text model to a range in the modified text model. */ export class RangeMapping { + public static assertSorted(rangeMappings: RangeMapping[]): void { + for (let i = 1; i < rangeMappings.length; i++) { + const previous = rangeMappings[i - 1]; + const current = rangeMappings[i]; + if (!( + previous.originalRange.getEndPosition().isBeforeOrEqual(current.originalRange.getStartPosition()) + && previous.modifiedRange.getEndPosition().isBeforeOrEqual(current.modifiedRange.getStartPosition()) + )) { + throw new BugIndicatingError('Range mappings must be sorted'); + } + } + } + /** * The original range. */ diff --git a/src/vs/editor/common/editorAction.ts b/src/vs/editor/common/editorAction.ts index 90924e7895a..7d8224d018f 100644 --- a/src/vs/editor/common/editorAction.ts +++ b/src/vs/editor/common/editorAction.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IEditorAction } from 'vs/editor/common/editorCommon'; -import { ICommandMetadata } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpression, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { IEditorAction } from './editorCommon.js'; +import { ICommandMetadata } from '../../platform/commands/common/commands.js'; +import { ContextKeyExpression, IContextKeyService } from '../../platform/contextkey/common/contextkey.js'; export class InternalEditorAction implements IEditorAction { diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index 57b9cde6268..e25edb4fb50 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ThemeColor } from 'vs/base/common/themables'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { IDimension } from 'vs/editor/common/core/dimension'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ISelection, Selection } from 'vs/editor/common/core/selection'; -import { IModelDecoration, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel, IValidEditOperation, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { IModelDecorationsChangedEvent } from 'vs/editor/common/textModelEvents'; -import { ICommandMetadata } from 'vs/platform/commands/common/commands'; +import { Event } from '../../base/common/event.js'; +import { IMarkdownString } from '../../base/common/htmlContent.js'; +import { IDisposable } from '../../base/common/lifecycle.js'; +import { ThemeColor } from '../../base/common/themables.js'; +import { URI, UriComponents } from '../../base/common/uri.js'; +import { IEditorOptions } from './config/editorOptions.js'; +import { IDimension } from './core/dimension.js'; +import { IPosition, Position } from './core/position.js'; +import { IRange, Range } from './core/range.js'; +import { ISelection, Selection } from './core/selection.js'; +import { IModelDecoration, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel, IValidEditOperation, OverviewRulerLane, TrackedRangeStickiness } from './model.js'; +import { IModelDecorationsChangedEvent } from './textModelEvents.js'; +import { ICommandMetadata } from '../../platform/commands/common/commands.js'; /** * A builder and helper for edit operations for a command. @@ -147,6 +147,15 @@ export interface IContentSizeChangedEvent { readonly contentHeightChanged: boolean; } +/** + * @internal + */ +export interface ITriggerEditorOperationEvent { + source: string | null | undefined; + handlerId: string; + payload: any; +} + export interface INewScrollPosition { scrollLeft?: number; scrollTop?: number; @@ -770,4 +779,3 @@ export interface CompositionTypePayload { replaceNextCharCnt: number; positionDelta: number; } - diff --git a/src/vs/editor/common/editorContextKeys.ts b/src/vs/editor/common/editorContextKeys.ts index 2311fbd3a85..8c6952a2e75 100644 --- a/src/vs/editor/common/editorContextKeys.ts +++ b/src/vs/editor/common/editorContextKeys.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; +import * as nls from '../../nls.js'; +import { RawContextKey } from '../../platform/contextkey/common/contextkey.js'; export namespace EditorContextKeys { @@ -27,7 +27,6 @@ export namespace EditorContextKeys { export const readOnly = new RawContextKey('editorReadonly', false, nls.localize('editorReadonly', "Whether the editor is read-only")); export const inDiffEditor = new RawContextKey('inDiffEditor', false, nls.localize('inDiffEditor', "Whether the context is a diff editor")); export const isEmbeddedDiffEditor = new RawContextKey('isEmbeddedDiffEditor', false, nls.localize('isEmbeddedDiffEditor', "Whether the context is an embedded diff editor")); - export const inMultiDiffEditor = new RawContextKey('inMultiDiffEditor', false, nls.localize('inMultiDiffEditor', "Whether the context is a multi diff editor")); export const multiDiffEditorAllCollapsed = new RawContextKey('multiDiffEditorAllCollapsed', undefined, nls.localize('multiDiffEditorAllCollapsed', "Whether all files in multi diff editor are collapsed")); export const hasChanges = new RawContextKey('diffEditorHasChanges', false, nls.localize('diffEditorHasChanges', "Whether the diff editor has changes")); export const comparingMovedCode = new RawContextKey('comparingMovedCode', false, nls.localize('comparingMovedCode', "Whether a moved code block is selected for comparison")); diff --git a/src/vs/editor/common/editorFeatures.ts b/src/vs/editor/common/editorFeatures.ts index 99d29778303..b68e3fcf200 100644 --- a/src/vs/editor/common/editorFeatures.ts +++ b/src/vs/editor/common/editorFeatures.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BrandedService, IConstructorSignature } from 'vs/platform/instantiation/common/instantiation'; +import { BrandedService, IConstructorSignature } from '../../platform/instantiation/common/instantiation.js'; /** * A feature that will be loaded when the first code editor is constructed and disposed when the system shuts down. diff --git a/src/vs/editor/common/editorTheme.ts b/src/vs/editor/common/editorTheme.ts index 6b5944133bb..eb0ba38307a 100644 --- a/src/vs/editor/common/editorTheme.ts +++ b/src/vs/editor/common/editorTheme.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IColorTheme } from 'vs/platform/theme/common/themeService'; -import { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; -import { Color } from 'vs/base/common/color'; -import { ColorScheme } from 'vs/platform/theme/common/theme'; +import { IColorTheme } from '../../platform/theme/common/themeService.js'; +import { ColorIdentifier } from '../../platform/theme/common/colorRegistry.js'; +import { Color } from '../../base/common/color.js'; +import { ColorScheme } from '../../platform/theme/common/theme.js'; export class EditorTheme { diff --git a/src/vs/editor/common/encodedTokenAttributes.ts b/src/vs/editor/common/encodedTokenAttributes.ts index c0f2fad70f1..bf144bd8a17 100644 --- a/src/vs/editor/common/encodedTokenAttributes.ts +++ b/src/vs/editor/common/encodedTokenAttributes.ts @@ -65,26 +65,26 @@ export const enum StandardTokenType { * */ export const enum MetadataConsts { - LANGUAGEID_MASK = 0b00000000000000000000000011111111, - TOKEN_TYPE_MASK = 0b00000000000000000000001100000000, - BALANCED_BRACKETS_MASK = 0b00000000000000000000010000000000, - FONT_STYLE_MASK = 0b00000000000000000111100000000000, - FOREGROUND_MASK = 0b00000000111111111000000000000000, - BACKGROUND_MASK = 0b11111111000000000000000000000000, - - ITALIC_MASK = 0b00000000000000000000100000000000, - BOLD_MASK = 0b00000000000000000001000000000000, - UNDERLINE_MASK = 0b00000000000000000010000000000000, - STRIKETHROUGH_MASK = 0b00000000000000000100000000000000, + LANGUAGEID_MASK /* */ = 0b00000000000000000000000011111111, + TOKEN_TYPE_MASK /* */ = 0b00000000000000000000001100000000, + BALANCED_BRACKETS_MASK /* */ = 0b00000000000000000000010000000000, + FONT_STYLE_MASK /* */ = 0b00000000000000000111100000000000, + FOREGROUND_MASK /* */ = 0b00000000111111111000000000000000, + BACKGROUND_MASK /* */ = 0b11111111000000000000000000000000, + + ITALIC_MASK /* */ = 0b00000000000000000000100000000000, + BOLD_MASK /* */ = 0b00000000000000000001000000000000, + UNDERLINE_MASK /* */ = 0b00000000000000000010000000000000, + STRIKETHROUGH_MASK /* */ = 0b00000000000000000100000000000000, // Semantic tokens cannot set the language id, so we can // use the first 8 bits for control purposes - SEMANTIC_USE_ITALIC = 0b00000000000000000000000000000001, - SEMANTIC_USE_BOLD = 0b00000000000000000000000000000010, - SEMANTIC_USE_UNDERLINE = 0b00000000000000000000000000000100, - SEMANTIC_USE_STRIKETHROUGH = 0b00000000000000000000000000001000, - SEMANTIC_USE_FOREGROUND = 0b00000000000000000000000000010000, - SEMANTIC_USE_BACKGROUND = 0b00000000000000000000000000100000, + SEMANTIC_USE_ITALIC /* */ = 0b00000000000000000000000000000001, + SEMANTIC_USE_BOLD /* */ = 0b00000000000000000000000000000010, + SEMANTIC_USE_UNDERLINE /* */ = 0b00000000000000000000000000000100, + SEMANTIC_USE_STRIKETHROUGH /* */ = 0b00000000000000000000000000001000, + SEMANTIC_USE_FOREGROUND /* */ = 0b00000000000000000000000000010000, + SEMANTIC_USE_BACKGROUND /* */ = 0b00000000000000000000000000100000, LANGUAGEID_OFFSET = 0, TOKEN_TYPE_OFFSET = 8, diff --git a/src/vs/editor/common/languageFeatureRegistry.ts b/src/vs/editor/common/languageFeatureRegistry.ts index 58926317e53..a50803e23a6 100644 --- a/src/vs/editor/common/languageFeatureRegistry.ts +++ b/src/vs/editor/common/languageFeatureRegistry.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ITextModel, shouldSynchronizeModel } from 'vs/editor/common/model'; -import { LanguageFilter, LanguageSelector, score } from 'vs/editor/common/languageSelector'; -import { URI } from 'vs/base/common/uri'; +import { Emitter } from '../../base/common/event.js'; +import { IDisposable, toDisposable } from '../../base/common/lifecycle.js'; +import { ITextModel, shouldSynchronizeModel } from './model.js'; +import { LanguageFilter, LanguageSelector, score } from './languageSelector.js'; +import { URI } from '../../base/common/uri.js'; interface Entry { - selector: LanguageSelector; - provider: T; + readonly selector: LanguageSelector; + readonly provider: T; _score: number; - _time: number; + readonly _time: number; } function isExclusive(selector: LanguageSelector): boolean { @@ -40,14 +40,16 @@ class MatchCandidate { readonly uri: URI, readonly languageId: string, readonly notebookUri: URI | undefined, - readonly notebookType: string | undefined + readonly notebookType: string | undefined, + readonly recursive: boolean, ) { } equals(other: MatchCandidate): boolean { return this.notebookType === other.notebookType && this.languageId === other.languageId && this.uri.toString() === other.uri.toString() - && this.notebookUri?.toString() === other.notebookUri?.toString(); + && this.notebookUri?.toString() === other.notebookUri?.toString() + && this.recursive === other.recursive; } } @@ -132,7 +134,7 @@ export class LanguageFeatureRegistry { return []; } - this._updateScores(model); + this._updateScores(model, false); const result: T[] = []; // from registry @@ -145,9 +147,13 @@ export class LanguageFeatureRegistry { return result; } - ordered(model: ITextModel): T[] { + allNoModel(): T[] { + return this._entries.map(entry => entry.provider); + } + + ordered(model: ITextModel, recursive = false): T[] { const result: T[] = []; - this._orderedForEach(model, entry => result.push(entry.provider)); + this._orderedForEach(model, recursive, entry => result.push(entry.provider)); return result; } @@ -156,7 +162,7 @@ export class LanguageFeatureRegistry { let lastBucket: T[]; let lastBucketScore: number; - this._orderedForEach(model, entry => { + this._orderedForEach(model, false, entry => { if (lastBucket && lastBucketScore === entry._score) { lastBucket.push(entry.provider); } else { @@ -169,9 +175,9 @@ export class LanguageFeatureRegistry { return result; } - private _orderedForEach(model: ITextModel, callback: (provider: Entry) => any): void { + private _orderedForEach(model: ITextModel, recursive: boolean, callback: (provider: Entry) => any): void { - this._updateScores(model); + this._updateScores(model, recursive); for (const entry of this._entries) { if (entry._score > 0) { @@ -182,15 +188,15 @@ export class LanguageFeatureRegistry { private _lastCandidate: MatchCandidate | undefined; - private _updateScores(model: ITextModel): void { + private _updateScores(model: ITextModel, recursive: boolean): void { const notebookInfo = this._notebookInfoResolver?.(model.uri); // use the uri (scheme, pattern) of the notebook info iff we have one // otherwise it's the model's/document's uri const candidate = notebookInfo - ? new MatchCandidate(model.uri, model.getLanguageId(), notebookInfo.uri, notebookInfo.type) - : new MatchCandidate(model.uri, model.getLanguageId(), undefined, undefined); + ? new MatchCandidate(model.uri, model.getLanguageId(), notebookInfo.uri, notebookInfo.type, recursive) + : new MatchCandidate(model.uri, model.getLanguageId(), undefined, undefined, recursive); if (this._lastCandidate?.equals(candidate)) { // nothing has changed @@ -203,13 +209,17 @@ export class LanguageFeatureRegistry { entry._score = score(entry.selector, candidate.uri, candidate.languageId, shouldSynchronizeModel(model), candidate.notebookUri, candidate.notebookType); if (isExclusive(entry.selector) && entry._score > 0) { - // support for one exclusive selector that overwrites - // any other selector - for (const entry of this._entries) { + if (recursive) { entry._score = 0; + } else { + // support for one exclusive selector that overwrites + // any other selector + for (const entry of this._entries) { + entry._score = 0; + } + entry._score = 1000; + break; } - entry._score = 1000; - break; } } diff --git a/src/vs/editor/common/languageSelector.ts b/src/vs/editor/common/languageSelector.ts index db32360aa2e..6374d380f48 100644 --- a/src/vs/editor/common/languageSelector.ts +++ b/src/vs/editor/common/languageSelector.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IRelativePattern, match as matchGlobPattern } from 'vs/base/common/glob'; -import { URI } from 'vs/base/common/uri'; -import { normalize } from 'vs/base/common/path'; +import { IRelativePattern, match as matchGlobPattern } from '../../base/common/glob.js'; +import { URI } from '../../base/common/uri.js'; +import { normalize } from '../../base/common/path.js'; export interface LanguageFilter { readonly language?: string; diff --git a/src/vs/editor/common/languages.ts b/src/vs/editor/common/languages.ts index c1d6dd14546..4b1899ff470 100644 --- a/src/vs/editor/common/languages.ts +++ b/src/vs/editor/common/languages.ts @@ -3,29 +3,29 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Codicon } from 'vs/base/common/codicons'; -import { Color } from 'vs/base/common/color'; -import { IReadonlyVSDataTransfer } from 'vs/base/common/dataTransfer'; -import { Event } from 'vs/base/common/event'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { LanguageId } from 'vs/editor/common/encodedTokenAttributes'; -import { LanguageSelector } from 'vs/editor/common/languageSelector'; -import * as model from 'vs/editor/common/model'; -import { TokenizationRegistry as TokenizationRegistryImpl } from 'vs/editor/common/tokenizationRegistry'; -import { ContiguousMultilineTokens } from 'vs/editor/common/tokens/contiguousMultilineTokens'; -import { localize } from 'vs/nls'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { IMarkerData } from 'vs/platform/markers/common/markers'; +import { VSBuffer } from '../../base/common/buffer.js'; +import { CancellationToken } from '../../base/common/cancellation.js'; +import { Codicon } from '../../base/common/codicons.js'; +import { Color } from '../../base/common/color.js'; +import { IReadonlyVSDataTransfer } from '../../base/common/dataTransfer.js'; +import { Event } from '../../base/common/event.js'; +import { HierarchicalKind } from '../../base/common/hierarchicalKind.js'; +import { IMarkdownString } from '../../base/common/htmlContent.js'; +import { IDisposable } from '../../base/common/lifecycle.js'; +import { ThemeIcon } from '../../base/common/themables.js'; +import { URI, UriComponents } from '../../base/common/uri.js'; +import { EditOperation, ISingleEditOperation } from './core/editOperation.js'; +import { IPosition, Position } from './core/position.js'; +import { IRange, Range } from './core/range.js'; +import { Selection } from './core/selection.js'; +import { LanguageId } from './encodedTokenAttributes.js'; +import { LanguageSelector } from './languageSelector.js'; +import * as model from './model.js'; +import { TokenizationRegistry as TokenizationRegistryImpl } from './tokenizationRegistry.js'; +import { ContiguousMultilineTokens } from './tokens/contiguousMultilineTokens.js'; +import { localize } from '../../nls.js'; +import { ExtensionIdentifier } from '../../platform/extensions/common/extensions.js'; +import { IMarkerData } from '../../platform/markers/common/markers.js'; /** * @internal @@ -82,6 +82,15 @@ export class EncodedTokenizationResult { } } +/** + * An intermediate interface for scaffolding the new tree sitter tokenization support. Not final. + * @internal + */ +export interface ITreeSitterTokenizationSupport { + tokenizeEncoded(lineNumber: number, textModel: model.ITextModel): Uint32Array | undefined; + captureAtPosition(lineNumber: number, column: number, textModel: model.ITextModel): any; +} + /** * @internal */ @@ -784,7 +793,7 @@ export interface InlineCompletionsProvider; + provideInlineEditsForRange?(model: model.ITextModel, range: Range, context: InlineCompletionContext, token: CancellationToken): ProviderResult; /** * Will be called when an item is shown. @@ -1207,6 +1216,16 @@ export function isLocationLink(thing: any): thing is LocationLink { && (Range.isIRange((thing as LocationLink).originSelectionRange) || Range.isIRange((thing as LocationLink).targetSelectionRange)); } +/** + * @internal + */ +export function isLocation(thing: any): thing is Location { + return thing + && URI.isUri((thing as Location).uri) + && Range.isIRange((thing as Location).range); +} + + export type Definition = Location | Location[] | LocationLink[]; /** @@ -1886,7 +1905,7 @@ export interface CommentThread { range: T | undefined; label: string | undefined; contextValue: string | undefined; - comments: Comment[] | undefined; + comments: ReadonlyArray | undefined; onDidChangeComments: Event; collapsibleState?: CommentThreadCollapsibleState; initialCollapsibleState?: CommentThreadCollapsibleState; @@ -1896,7 +1915,6 @@ export interface CommentThread { canReply: boolean; input?: CommentInput; onDidChangeInput: Event; - onDidChangeRange: Event; onDidChangeLabel: Event; onDidChangeCollapsibleState: Event; onDidChangeState: Event; @@ -2116,17 +2134,17 @@ export interface ITokenizationSupportChangedEvent { /** * @internal */ -export interface ILazyTokenizationSupport { - get tokenizationSupport(): Promise; +export interface ILazyTokenizationSupport { + get tokenizationSupport(): Promise; } /** * @internal */ -export class LazyTokenizationSupport implements IDisposable, ILazyTokenizationSupport { - private _tokenizationSupport: Promise | null = null; +export class LazyTokenizationSupport implements IDisposable, ILazyTokenizationSupport { + private _tokenizationSupport: Promise | null = null; - constructor(private readonly createSupport: () => Promise) { + constructor(private readonly createSupport: () => Promise) { } dispose(): void { @@ -2139,7 +2157,7 @@ export class LazyTokenizationSupport implements IDisposable, ILazyTokenizationSu } } - get tokenizationSupport(): Promise { + get tokenizationSupport(): Promise { if (!this._tokenizationSupport) { this._tokenizationSupport = this.createSupport(); } @@ -2150,7 +2168,7 @@ export class LazyTokenizationSupport implements IDisposable, ILazyTokenizationSu /** * @internal */ -export interface ITokenizationRegistry { +export interface ITokenizationRegistry { /** * An event triggered when: @@ -2168,24 +2186,24 @@ export interface ITokenizationRegistry { /** * Register a tokenization support. */ - register(languageId: string, support: ITokenizationSupport): IDisposable; + register(languageId: string, support: TSupport): IDisposable; /** * Register a tokenization support factory. */ - registerFactory(languageId: string, factory: ILazyTokenizationSupport): IDisposable; + registerFactory(languageId: string, factory: ILazyTokenizationSupport): IDisposable; /** * Get or create the tokenization support for a language. * Returns `null` if not found. */ - getOrCreate(languageId: string): Promise; + getOrCreate(languageId: string): Promise; /** * Get the tokenization support for a language. * Returns `null` if not found. */ - get(languageId: string): ITokenizationSupport | null; + get(languageId: string): TSupport | null; /** * Returns false if a factory is still pending. @@ -2205,8 +2223,12 @@ export interface ITokenizationRegistry { /** * @internal */ -export const TokenizationRegistry: ITokenizationRegistry = new TokenizationRegistryImpl(); +export const TokenizationRegistry: ITokenizationRegistry = new TokenizationRegistryImpl(); +/** + * @internal + */ +export const TreeSitterTokenizationRegistry: ITokenizationRegistry = new TokenizationRegistryImpl(); /** * @internal @@ -2262,17 +2284,42 @@ export interface DocumentContextItem { export interface MappedEditsContext { /** The outer array is sorted by priority - from highest to lowest. The inner arrays contain elements of the same priority. */ - documents: DocumentContextItem[][]; + readonly documents: DocumentContextItem[][]; + /** + * @internal + */ + readonly conversation?: (ConversationRequest | ConversationResponse)[]; +} + +/** + * @internal + */ +export interface ConversationRequest { + readonly type: 'request'; + readonly message: string; +} + +/** + * @internal + */ +export interface ConversationResponse { + readonly type: 'response'; + readonly message: string; + readonly references?: DocumentContextItem[]; } export interface MappedEditsProvider { + /** + * @internal + */ + readonly displayName: string; // internal /** * Provider maps code blocks from the chat into a workspace edit. * * @param document The document to provide mapped edits for. * @param codeBlocks Code blocks that come from an LLM's reply. - * "Insert at cursor" in the panel chat only sends one edit that the user clicks on, but inline chat can send multiple blocks and let the lang server decide what to do with them. + * "Apply in Editor" in the panel chat only sends one edit that the user clicks on, but inline chat can send multiple blocks and let the lang server decide what to do with them. * @param context The context for providing mapped edits. * @param token A cancellation token. * @returns A provider result of text edits. diff --git a/src/vs/editor/common/languages/autoIndent.ts b/src/vs/editor/common/languages/autoIndent.ts index 5c643b4fa60..d2083853ead 100644 --- a/src/vs/editor/common/languages/autoIndent.ts +++ b/src/vs/editor/common/languages/autoIndent.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import { Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { IndentAction } from 'vs/editor/common/languages/languageConfiguration'; -import { IndentConsts } from 'vs/editor/common/languages/supports/indentRules'; -import { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { IndentationContextProcessor, isLanguageDifferentFromLineStart, ProcessedIndentRulesSupport } from 'vs/editor/common/languages/supports/indentationLineProcessor'; -import { CursorConfiguration } from 'vs/editor/common/cursorCommon'; +import * as strings from '../../../base/common/strings.js'; +import { Range } from '../core/range.js'; +import { ITextModel } from '../model.js'; +import { IndentAction } from './languageConfiguration.js'; +import { IndentConsts } from './supports/indentRules.js'; +import { EditorAutoIndentStrategy } from '../config/editorOptions.js'; +import { ILanguageConfigurationService } from './languageConfigurationRegistry.js'; +import { IViewLineTokens } from '../tokens/lineTokens.js'; +import { IndentationContextProcessor, isLanguageDifferentFromLineStart, ProcessedIndentRulesSupport } from './supports/indentationLineProcessor.js'; +import { CursorConfiguration } from '../cursorCommon.js'; export interface IVirtualModel { tokenization: { diff --git a/src/vs/editor/common/languages/defaultDocumentColorsComputer.ts b/src/vs/editor/common/languages/defaultDocumentColorsComputer.ts index 02e447145b7..c188113e8a2 100644 --- a/src/vs/editor/common/languages/defaultDocumentColorsComputer.ts +++ b/src/vs/editor/common/languages/defaultDocumentColorsComputer.ts @@ -2,10 +2,10 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Color, HSLA } from 'vs/base/common/color'; -import { IPosition } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { IColor, IColorInformation } from 'vs/editor/common/languages'; +import { Color, HSLA } from '../../../base/common/color.js'; +import { IPosition } from '../core/position.js'; +import { IRange } from '../core/range.js'; +import { IColor, IColorInformation } from '../languages.js'; export interface IDocumentColorComputerTarget { getValue(): string; diff --git a/src/vs/editor/common/languages/enterAction.ts b/src/vs/editor/common/languages/enterAction.ts index 27669db6ebe..454cc1e5b53 100644 --- a/src/vs/editor/common/languages/enterAction.ts +++ b/src/vs/editor/common/languages/enterAction.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { IndentAction, CompleteEnterAction } from 'vs/editor/common/languages/languageConfiguration'; -import { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions'; -import { getIndentationAtPosition, ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IndentationContextProcessor } from 'vs/editor/common/languages/supports/indentationLineProcessor'; +import { Range } from '../core/range.js'; +import { ITextModel } from '../model.js'; +import { IndentAction, CompleteEnterAction } from './languageConfiguration.js'; +import { EditorAutoIndentStrategy } from '../config/editorOptions.js'; +import { getIndentationAtPosition, ILanguageConfigurationService } from './languageConfigurationRegistry.js'; +import { IndentationContextProcessor } from './supports/indentationLineProcessor.js'; export function getEnterAction( autoIndent: EditorAutoIndentStrategy, diff --git a/src/vs/editor/common/languages/highlights/typescript.scm b/src/vs/editor/common/languages/highlights/typescript.scm new file mode 100644 index 00000000000..9352117da5f --- /dev/null +++ b/src/vs/editor/common/languages/highlights/typescript.scm @@ -0,0 +1,297 @@ +; Order matters! Place higher precedence first. +; Adapted from https://github.com/zed-industries/zed/blob/main/crates/languages/src/typescript/highlights.scm + +; Language constants + +[ + (true) + (false) + (null) + (undefined) +] @constant.language + +(namespace_import + "*" @constant.language) + +; Keywords + +("typeof") @keyword.operator.expression.typeof + +(binary_expression "instanceof" @keyword.operator.expression.instanceof) + +("of") @keyword.operator.expression.of + +[ + "delete" + "in" + "infer" + "keyof" +] @keyword.operator.expression + +[ + "as" + "await" + "break" + "case" + "catch" + "continue" + "default" + "do" + "else" + "export" + "finally" + "for" + "from" + "if" + "import" + "require" + "return" + "satisfies" + "switch" + "throw" + "try" + "type" + "while" + "yield" +] @keyword.control + +[ + "abstract" + "async" + "declare" + "extends" + "implements" + "override" + "private" + "protected" + "public" + "readonly" + "static" +] @storage.modifier + +[ + "=>" + "class" + "const" + "enum" + "function" + "get" + "interface" + "let" + "namespace" + "set" + "var" +] @storage.type + +[ + "debugger" + "target" + "with" +] @keyword + +; TODO: works in the playground but not here +(regex_flags) @keyword + +[ + "void" +] @support.type.primitive + +[ + "new" +] @keyword.operator.new + +; Tokens + +[ + ";" + "?." + "." + "," + ":" + "?" +] @punctuation.delimiter + +[ + "!" + "~" + "===" + "!==" + "&&" + "||" + "??" +] @keyword.operator.logical + +[ + "-" + "+" + "*" + "/" + "%" + "^" +] @keyword.operator.arithmetic + +(binary_expression ([ + "<" + "<=" + ">" + ">=" +]) @keyword.operator.relational) + +[ + "=" +] @keyword.operator.assignment + +(augmented_assignment_expression ([ + "-=" + "+=" + "*=" + "/=" + "%=" + "^=" + "&=" + "|=" + "&&=" + "||=" + "??=" +]) @keyword.operator.assignment.compound) + +[ + "++" +] @keyword.operator.increment + +[ + "--" +] @keyword.operator.decrement + +[ + "**" + "**=" + "<<" + "<<=" + "==" + "!=" + "=>" + ">>" + ">>=" + ">>>" + ">>>=" + "~" + "&" + "|" +] @keyword.operator + +; Special identifiers + +(type_identifier) @entity.name.type +(predefined_type (["string" "boolean" "number" "any"])) @support.type.primitive +(predefined_type) @support.type + +(("const") + (variable_declarator + name: (identifier) @variable.other.constant)) + +([ + (identifier) + (shorthand_property_identifier) + (shorthand_property_identifier_pattern)] @variable.other.constant + (#match? @variable.other.constant "^[A-Z][A-Z_]+$")) + +(extends_clause + value: (identifier) @entity.other.inherited-class) + +; Function and method calls + +(call_expression + function: (identifier) @entity.name.function) + +(call_expression + function: (member_expression + property: (property_identifier) @entity.name.function)) + +(new_expression + constructor: (identifier) @entity.name.function) + +; Function and method definitions + +(function_expression + name: (identifier) @entity.name.function) +(function_declaration + name: (identifier) @entity.name.function) +(method_definition + name: (property_identifier) @storage.type + (#eq? @storage.type "constructor")) +(method_definition + name: (property_identifier) @entity.name.function) +(method_signature + name: (property_identifier) @entity.name.function) + +(pair + key: (property_identifier) @entity.name.function + value: [(function_expression) (arrow_function)]) + +(assignment_expression + left: (member_expression + property: (property_identifier) @entity.name.function) + right: [(function_expression) (arrow_function)]) + +(variable_declarator + name: (identifier) @entity.name.function + value: [(function_expression) (arrow_function)]) + +(assignment_expression + left: (identifier) @entity.name.function + right: [(function_expression) (arrow_function)]) + +; Properties + +(member_expression + object: (this) + property: (property_identifier) @variable) + +(member_expression + property: (property_identifier) @variable.other.constant + (#match? @variable.other.constant "^[A-Z][A-Z_]+$")) + +[ + (property_identifier) + (shorthand_property_identifier) + (shorthand_property_identifier_pattern)] @variable + +; Variables + +(identifier) @variable + +; Template TODO: These don't seem to be working + +(template_substitution + "${" @punctuation.definition.template-expression.begin + "}" @punctuation.definition.template-expression.end) + +(template_type + "${" @punctuation.definition.template-expression.begin + "}" @punctuation.definition.template-expression.end) + +(type_arguments + "<" @punctuation.bracket + ">" @punctuation.bracket) + +; Literals + +(this) @variable.language +(super) @variable.language + +(comment) @comment + +; TODO: This doesn't seem to be working +(escape_sequence) @constant.character.escape + +[ + (string) + (template_string) + (template_literal_type) +] @string + +; NOTE: the typescript grammar doesn't break regex into nice parts so as to capture parts of it separately +(regex) @string.regexp +(number) @constant.numeric + diff --git a/src/vs/editor/common/languages/language.ts b/src/vs/editor/common/languages/language.ts index f0be928ea73..065ab092af2 100644 --- a/src/vs/editor/common/languages/language.ts +++ b/src/vs/editor/common/languages/language.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { ILanguageIdCodec } from 'vs/editor/common/languages'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { ILanguageIdCodec } from '../languages.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; export const ILanguageService = createDecorator('languageService'); diff --git a/src/vs/editor/common/languages/languageConfiguration.ts b/src/vs/editor/common/languages/languageConfiguration.ts index 69b852e407c..b6aa902f78a 100644 --- a/src/vs/editor/common/languages/languageConfiguration.ts +++ b/src/vs/editor/common/languages/languageConfiguration.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { ScopedLineTokens } from 'vs/editor/common/languages/supports'; +import { CharCode } from '../../../base/common/charCode.js'; +import { StandardTokenType } from '../encodedTokenAttributes.js'; +import { ScopedLineTokens } from './supports.js'; /** * Describes how comments for a language work. diff --git a/src/vs/editor/common/languages/languageConfigurationRegistry.ts b/src/vs/editor/common/languages/languageConfigurationRegistry.ts index 7ff5ddec8a6..bf0516d531b 100644 --- a/src/vs/editor/common/languages/languageConfigurationRegistry.ts +++ b/src/vs/editor/common/languages/languageConfigurationRegistry.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import * as strings from 'vs/base/common/strings'; -import { ITextModel } from 'vs/editor/common/model'; -import { DEFAULT_WORD_REGEXP, ensureValidWordDefinition } from 'vs/editor/common/core/wordHelper'; -import { EnterAction, FoldingRules, IAutoClosingPair, IndentationRule, LanguageConfiguration, AutoClosingPairs, CharacterPair, ExplicitLanguageConfiguration } from 'vs/editor/common/languages/languageConfiguration'; -import { CharacterPairSupport } from 'vs/editor/common/languages/supports/characterPair'; -import { BracketElectricCharacterSupport } from 'vs/editor/common/languages/supports/electricCharacter'; -import { IndentRulesSupport } from 'vs/editor/common/languages/supports/indentRules'; -import { OnEnterSupport } from 'vs/editor/common/languages/supports/onEnter'; -import { RichEditBrackets } from 'vs/editor/common/languages/supports/richEditBrackets'; -import { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { LanguageBracketsConfiguration } from 'vs/editor/common/languages/supports/languageBracketsConfiguration'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import * as strings from '../../../base/common/strings.js'; +import { ITextModel } from '../model.js'; +import { DEFAULT_WORD_REGEXP, ensureValidWordDefinition } from '../core/wordHelper.js'; +import { EnterAction, FoldingRules, IAutoClosingPair, IndentationRule, LanguageConfiguration, AutoClosingPairs, CharacterPair, ExplicitLanguageConfiguration } from './languageConfiguration.js'; +import { CharacterPairSupport } from './supports/characterPair.js'; +import { BracketElectricCharacterSupport } from './supports/electricCharacter.js'; +import { IndentRulesSupport } from './supports/indentRules.js'; +import { OnEnterSupport } from './supports/onEnter.js'; +import { RichEditBrackets } from './supports/richEditBrackets.js'; +import { EditorAutoIndentStrategy } from '../config/editorOptions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { ILanguageService } from './language.js'; +import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; +import { PLAINTEXT_LANGUAGE_ID } from './modesRegistry.js'; +import { LanguageBracketsConfiguration } from './supports/languageBracketsConfiguration.js'; /** * Interface used to support insertion of mode specific comments. diff --git a/src/vs/editor/common/languages/linkComputer.ts b/src/vs/editor/common/languages/linkComputer.ts index 52f4eaee2fb..2c954d7f374 100644 --- a/src/vs/editor/common/languages/linkComputer.ts +++ b/src/vs/editor/common/languages/linkComputer.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { CharacterClassifier } from 'vs/editor/common/core/characterClassifier'; -import { ILink } from 'vs/editor/common/languages'; +import { CharCode } from '../../../base/common/charCode.js'; +import { CharacterClassifier } from '../core/characterClassifier.js'; +import { ILink } from '../languages.js'; export interface ILinkComputerTarget { getLineCount(): number; diff --git a/src/vs/editor/common/languages/modesRegistry.ts b/src/vs/editor/common/languages/modesRegistry.ts index 7376d0c069b..871265804d2 100644 --- a/src/vs/editor/common/languages/modesRegistry.ts +++ b/src/vs/editor/common/languages/modesRegistry.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { Emitter, Event } from 'vs/base/common/event'; -import { ILanguageExtensionPoint } from 'vs/editor/common/languages/language'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { Mimes } from 'vs/base/common/mime'; -import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; +import * as nls from '../../../nls.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { ILanguageExtensionPoint } from './language.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { Mimes } from '../../../base/common/mime.js'; +import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from '../../../platform/configuration/common/configurationRegistry.js'; // Define extension point ids export const Extensions = { diff --git a/src/vs/editor/common/languages/nullTokenize.ts b/src/vs/editor/common/languages/nullTokenize.ts index 2bf77a6acd8..8966ab8b734 100644 --- a/src/vs/editor/common/languages/nullTokenize.ts +++ b/src/vs/editor/common/languages/nullTokenize.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Token, TokenizationResult, EncodedTokenizationResult, IState } from 'vs/editor/common/languages'; -import { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; +import { Token, TokenizationResult, EncodedTokenizationResult, IState } from '../languages.js'; +import { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts } from '../encodedTokenAttributes.js'; export const NullState: IState = new class implements IState { public clone(): IState { diff --git a/src/vs/editor/common/languages/supports.ts b/src/vs/editor/common/languages/supports.ts index 730fa2a1b73..10e352b96d2 100644 --- a/src/vs/editor/common/languages/supports.ts +++ b/src/vs/editor/common/languages/supports.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IViewLineTokens, LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { ILanguageIdCodec } from 'vs/editor/common/languages'; +import { IViewLineTokens, LineTokens } from '../tokens/lineTokens.js'; +import { StandardTokenType } from '../encodedTokenAttributes.js'; +import { ILanguageIdCodec } from '../languages.js'; export function createScopedLineTokens(context: LineTokens, offset: number): ScopedLineTokens { const tokenCount = context.getCount(); diff --git a/src/vs/editor/common/languages/supports/characterPair.ts b/src/vs/editor/common/languages/supports/characterPair.ts index 18eee773dd2..37fd6c968a9 100644 --- a/src/vs/editor/common/languages/supports/characterPair.ts +++ b/src/vs/editor/common/languages/supports/characterPair.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IAutoClosingPair, StandardAutoClosingPairConditional, LanguageConfiguration } from 'vs/editor/common/languages/languageConfiguration'; +import { IAutoClosingPair, StandardAutoClosingPairConditional, LanguageConfiguration } from '../languageConfiguration.js'; export class CharacterPairSupport { diff --git a/src/vs/editor/common/languages/supports/electricCharacter.ts b/src/vs/editor/common/languages/supports/electricCharacter.ts index 0aa80d23edb..23a78745a8c 100644 --- a/src/vs/editor/common/languages/supports/electricCharacter.ts +++ b/src/vs/editor/common/languages/supports/electricCharacter.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { distinct } from 'vs/base/common/arrays'; -import { ScopedLineTokens, ignoreBracketsInToken } from 'vs/editor/common/languages/supports'; -import { BracketsUtils, RichEditBrackets } from 'vs/editor/common/languages/supports/richEditBrackets'; +import { distinct } from '../../../../base/common/arrays.js'; +import { ScopedLineTokens, ignoreBracketsInToken } from '../supports.js'; +import { BracketsUtils, RichEditBrackets } from './richEditBrackets.js'; /** * Interface used to support electric characters diff --git a/src/vs/editor/common/languages/supports/indentRules.ts b/src/vs/editor/common/languages/supports/indentRules.ts index 6bb319dbd7e..09b70e31a0e 100644 --- a/src/vs/editor/common/languages/supports/indentRules.ts +++ b/src/vs/editor/common/languages/supports/indentRules.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IndentationRule } from 'vs/editor/common/languages/languageConfiguration'; +import { IndentationRule } from '../languageConfiguration.js'; export const enum IndentConsts { INCREASE_MASK = 0b00000001, diff --git a/src/vs/editor/common/languages/supports/indentationLineProcessor.ts b/src/vs/editor/common/languages/supports/indentationLineProcessor.ts index 919cb3cd4c8..762c13e4eb4 100644 --- a/src/vs/editor/common/languages/supports/indentationLineProcessor.ts +++ b/src/vs/editor/common/languages/supports/indentationLineProcessor.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import { Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { createScopedLineTokens, ScopedLineTokens } from 'vs/editor/common/languages/supports'; -import { IVirtualModel } from 'vs/editor/common/languages/autoIndent'; -import { IViewLineTokens, LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { IndentRulesSupport } from 'vs/editor/common/languages/supports/indentRules'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { Position } from 'vs/editor/common/core/position'; +import * as strings from '../../../../base/common/strings.js'; +import { Range } from '../../core/range.js'; +import { ITextModel } from '../../model.js'; +import { ILanguageConfigurationService } from '../languageConfigurationRegistry.js'; +import { createScopedLineTokens, ScopedLineTokens } from '../supports.js'; +import { IVirtualModel } from '../autoIndent.js'; +import { IViewLineTokens, LineTokens } from '../../tokens/lineTokens.js'; +import { IndentRulesSupport } from './indentRules.js'; +import { StandardTokenType } from '../../encodedTokenAttributes.js'; +import { Position } from '../../core/position.js'; /** * This class is a wrapper class around {@link IndentRulesSupport}. diff --git a/src/vs/editor/common/languages/supports/inplaceReplaceSupport.ts b/src/vs/editor/common/languages/supports/inplaceReplaceSupport.ts index 93f2e892f8d..f4443b24b94 100644 --- a/src/vs/editor/common/languages/supports/inplaceReplaceSupport.ts +++ b/src/vs/editor/common/languages/supports/inplaceReplaceSupport.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IRange } from 'vs/editor/common/core/range'; -import { IInplaceReplaceSupportResult } from 'vs/editor/common/languages'; +import { IRange } from '../../core/range.js'; +import { IInplaceReplaceSupportResult } from '../../languages.js'; export class BasicInplaceReplace { diff --git a/src/vs/editor/common/languages/supports/languageBracketsConfiguration.ts b/src/vs/editor/common/languages/supports/languageBracketsConfiguration.ts index 4989395b264..f3f1205f18e 100644 --- a/src/vs/editor/common/languages/supports/languageBracketsConfiguration.ts +++ b/src/vs/editor/common/languages/supports/languageBracketsConfiguration.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CachedFunction } from 'vs/base/common/cache'; -import { RegExpOptions } from 'vs/base/common/strings'; -import { LanguageConfiguration } from 'vs/editor/common/languages/languageConfiguration'; -import { createBracketOrRegExp } from 'vs/editor/common/languages/supports/richEditBrackets'; +import { CachedFunction } from '../../../../base/common/cache.js'; +import { RegExpOptions } from '../../../../base/common/strings.js'; +import { LanguageConfiguration } from '../languageConfiguration.js'; +import { createBracketOrRegExp } from './richEditBrackets.js'; /** * Captures all bracket related configurations for a single language. diff --git a/src/vs/editor/common/languages/supports/onEnter.ts b/src/vs/editor/common/languages/supports/onEnter.ts index 5952586199b..322ae2d2991 100644 --- a/src/vs/editor/common/languages/supports/onEnter.ts +++ b/src/vs/editor/common/languages/supports/onEnter.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { onUnexpectedError } from 'vs/base/common/errors'; -import * as strings from 'vs/base/common/strings'; -import { CharacterPair, EnterAction, IndentAction, OnEnterRule } from 'vs/editor/common/languages/languageConfiguration'; -import { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import * as strings from '../../../../base/common/strings.js'; +import { CharacterPair, EnterAction, IndentAction, OnEnterRule } from '../languageConfiguration.js'; +import { EditorAutoIndentStrategy } from '../../config/editorOptions.js'; export interface IOnEnterSupportOptions { brackets?: CharacterPair[]; diff --git a/src/vs/editor/common/languages/supports/richEditBrackets.ts b/src/vs/editor/common/languages/supports/richEditBrackets.ts index 7733719f049..c6436e60ef4 100644 --- a/src/vs/editor/common/languages/supports/richEditBrackets.ts +++ b/src/vs/editor/common/languages/supports/richEditBrackets.ts @@ -3,11 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import * as stringBuilder from 'vs/editor/common/core/stringBuilder'; -import { Range } from 'vs/editor/common/core/range'; -import { CharacterPair } from 'vs/editor/common/languages/languageConfiguration'; -import { RegExpOptions } from 'vs/base/common/strings'; +import * as strings from '../../../../base/common/strings.js'; +import * as stringBuilder from '../../core/stringBuilder.js'; +import { Range } from '../../core/range.js'; +import { CharacterPair } from '../languageConfiguration.js'; interface InternalBracket { open: string[]; @@ -409,7 +408,7 @@ function prepareBracketForRegExp(str: string): string { return (insertWordBoundaries ? `\\b${str}\\b` : str); } -export function createBracketOrRegExp(pieces: string[], options?: RegExpOptions): RegExp { +export function createBracketOrRegExp(pieces: string[], options?: strings.RegExpOptions): RegExp { const regexStr = `(${pieces.map(prepareBracketForRegExp).join(')|(')})`; return strings.createRegExp(regexStr, true, options); } diff --git a/src/vs/editor/common/languages/supports/tokenization.ts b/src/vs/editor/common/languages/supports/tokenization.ts index 7fa14b20a5c..f6322a09dda 100644 --- a/src/vs/editor/common/languages/supports/tokenization.ts +++ b/src/vs/editor/common/languages/supports/tokenization.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Color } from 'vs/base/common/color'; -import { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; +import { Color } from '../../../../base/common/color.js'; +import { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts } from '../../encodedTokenAttributes.js'; export interface ITokenThemeRule { token: string; diff --git a/src/vs/editor/common/languages/textToHtmlTokenizer.ts b/src/vs/editor/common/languages/textToHtmlTokenizer.ts index 66651f25410..b0745eda9f8 100644 --- a/src/vs/editor/common/languages/textToHtmlTokenizer.ts +++ b/src/vs/editor/common/languages/textToHtmlTokenizer.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import * as strings from 'vs/base/common/strings'; -import { IViewLineTokens, LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { ILanguageIdCodec, IState, ITokenizationSupport, TokenizationRegistry } from 'vs/editor/common/languages'; -import { LanguageId } from 'vs/editor/common/encodedTokenAttributes'; -import { NullState, nullTokenizeEncoded } from 'vs/editor/common/languages/nullTokenize'; -import { ILanguageService } from 'vs/editor/common/languages/language'; +import { CharCode } from '../../../base/common/charCode.js'; +import * as strings from '../../../base/common/strings.js'; +import { IViewLineTokens, LineTokens } from '../tokens/lineTokens.js'; +import { ILanguageIdCodec, IState, ITokenizationSupport, TokenizationRegistry } from '../languages.js'; +import { LanguageId } from '../encodedTokenAttributes.js'; +import { NullState, nullTokenizeEncoded } from './nullTokenize.js'; +import { ILanguageService } from './language.js'; export type IReducedTokenizationSupport = Omit; diff --git a/src/vs/editor/common/model.ts b/src/vs/editor/common/model.ts index 134234bbfe5..640d694083c 100644 --- a/src/vs/editor/common/model.ts +++ b/src/vs/editor/common/model.ts @@ -3,26 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { equals } from 'vs/base/common/objects'; -import { ThemeColor } from 'vs/base/common/themables'; -import { URI } from 'vs/base/common/uri'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { TextChange } from 'vs/editor/common/core/textChange'; -import { WordCharacterClassifier } from 'vs/editor/common/core/wordCharacterClassifier'; -import { IWordAtPosition } from 'vs/editor/common/core/wordHelper'; -import { FormattingOptions } from 'vs/editor/common/languages'; -import { ILanguageSelection } from 'vs/editor/common/languages/language'; -import { IBracketPairsTextModelPart } from 'vs/editor/common/textModelBracketPairs'; -import { IModelContentChange, IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent, InternalModelContentChangeEvent, ModelInjectedTextChangedEvent } from 'vs/editor/common/textModelEvents'; -import { IGuidesTextModelPart } from 'vs/editor/common/textModelGuides'; -import { ITokenizationTextModelPart } from 'vs/editor/common/tokenizationTextModelPart'; -import { UndoRedoGroup } from 'vs/platform/undoRedo/common/undoRedo'; +import { Event } from '../../base/common/event.js'; +import { IMarkdownString } from '../../base/common/htmlContent.js'; +import { IDisposable } from '../../base/common/lifecycle.js'; +import { equals } from '../../base/common/objects.js'; +import { ThemeColor } from '../../base/common/themables.js'; +import { URI } from '../../base/common/uri.js'; +import { ISingleEditOperation } from './core/editOperation.js'; +import { IPosition, Position } from './core/position.js'; +import { IRange, Range } from './core/range.js'; +import { Selection } from './core/selection.js'; +import { TextChange } from './core/textChange.js'; +import { WordCharacterClassifier } from './core/wordCharacterClassifier.js'; +import { IWordAtPosition } from './core/wordHelper.js'; +import { FormattingOptions } from './languages.js'; +import { ILanguageSelection } from './languages/language.js'; +import { IBracketPairsTextModelPart } from './textModelBracketPairs.js'; +import { IModelContentChange, IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent, InternalModelContentChangeEvent, ModelInjectedTextChangedEvent } from './textModelEvents.js'; +import { IGuidesTextModelPart } from './textModelGuides.js'; +import { ITokenizationTextModelPart } from './tokenizationTextModelPart.js'; +import { UndoRedoGroup } from '../../platform/undoRedo/common/undoRedo.js'; +import { TokenArray } from './tokens/tokenArray.js'; /** * Vertical Lane in the overview ruler of the editor. @@ -286,6 +287,11 @@ export interface InjectedTextOptions { */ readonly content: string; + /** + * @internal + */ + readonly tokens?: TokenArray | null; + /** * If set, the decoration will be rendered inline with the text with this CSS class name. */ @@ -1428,6 +1434,8 @@ export interface IReadonlyTextBuffer { getLineCharCode(lineNumber: number, index: number): number; getCharCode(offset: number): number; getLineLength(lineNumber: number): number; + getLineMinColumn(lineNumber: number): number; + getLineMaxColumn(lineNumber: number): number; getLineFirstNonWhitespaceColumn(lineNumber: number): number; getLineLastNonWhitespaceColumn(lineNumber: number): number; findMatchesLineByLine(searchRange: Range, searchData: SearchData, captureMatches: boolean, limitResultCount: number): FindMatch[]; diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.ts index 3d3fe2e3649..546daf83fdc 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CallbackIterable, compareBy } from 'vs/base/common/arrays'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, DisposableStore, IDisposable, IReference, MutableDisposable } from 'vs/base/common/lifecycle'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ILanguageConfigurationService, LanguageConfigurationServiceChangeEvent } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ignoreBracketsInToken } from 'vs/editor/common/languages/supports'; -import { LanguageBracketsConfiguration } from 'vs/editor/common/languages/supports/languageBracketsConfiguration'; -import { BracketsUtils, RichEditBracket, RichEditBrackets } from 'vs/editor/common/languages/supports/richEditBrackets'; -import { BracketPairsTree } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { BracketInfo, BracketPairInfo, BracketPairWithMinIndentationInfo, IBracketPairsTextModelPart, IFoundBracket } from 'vs/editor/common/textModelBracketPairs'; -import { IModelContentChangedEvent, IModelLanguageChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents'; -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; +import { CallbackIterable, compareBy } from '../../../../base/common/arrays.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { Disposable, DisposableStore, IDisposable, IReference, MutableDisposable } from '../../../../base/common/lifecycle.js'; +import { IPosition, Position } from '../../core/position.js'; +import { Range } from '../../core/range.js'; +import { ILanguageConfigurationService, LanguageConfigurationServiceChangeEvent } from '../../languages/languageConfigurationRegistry.js'; +import { ignoreBracketsInToken } from '../../languages/supports.js'; +import { LanguageBracketsConfiguration } from '../../languages/supports/languageBracketsConfiguration.js'; +import { BracketsUtils, RichEditBracket, RichEditBrackets } from '../../languages/supports/richEditBrackets.js'; +import { BracketPairsTree } from './bracketPairsTree/bracketPairsTree.js'; +import { TextModel } from '../textModel.js'; +import { BracketInfo, BracketPairInfo, BracketPairWithMinIndentationInfo, IBracketPairsTextModelPart, IFoundBracket } from '../../textModelBracketPairs.js'; +import { IModelContentChangedEvent, IModelLanguageChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent } from '../../textModelEvents.js'; +import { LineTokens } from '../../tokens/lineTokens.js'; export class BracketPairsTextModelPart extends Disposable implements IBracketPairsTextModelPart { private readonly bracketPairsTree = this._register(new MutableDisposable>()); diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast.ts index e304dd1faa9..a5141b51624 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BugIndicatingError } from 'vs/base/common/errors'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; -import { BracketKind } from 'vs/editor/common/languages/supports/languageBracketsConfiguration'; -import { ITextModel } from 'vs/editor/common/model'; -import { Length, lengthAdd, lengthGetLineCount, lengthToObj, lengthZero } from './length'; -import { SmallImmutableSet } from './smallImmutableSet'; -import { OpeningBracketId } from './tokenizer'; +import { BugIndicatingError } from '../../../../../base/common/errors.js'; +import { CursorColumns } from '../../../core/cursorColumns.js'; +import { BracketKind } from '../../../languages/supports/languageBracketsConfiguration.js'; +import { ITextModel } from '../../../model.js'; +import { Length, lengthAdd, lengthGetLineCount, lengthToObj, lengthZero } from './length.js'; +import { SmallImmutableSet } from './smallImmutableSet.js'; +import { OpeningBracketId } from './tokenizer.js'; export const enum AstNodeKind { Text = 0, diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.ts index 1f95f84df48..d5560fdd2ba 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { Length, lengthAdd, lengthDiffNonNegative, lengthLessThanEqual, lengthOfString, lengthToObj, positionToLength, toLength } from './length'; -import { TextLength } from 'vs/editor/common/core/textLength'; -import { IModelContentChange } from 'vs/editor/common/textModelEvents'; +import { Range } from '../../../core/range.js'; +import { Length, lengthAdd, lengthDiffNonNegative, lengthLessThanEqual, lengthOfString, lengthToObj, positionToLength, toLength } from './length.js'; +import { TextLength } from '../../../core/textLength.js'; +import { IModelContentChange } from '../../../textModelEvents.js'; export class TextEditInfo { public static fromModelContentChanges(changes: IModelContentChange[]): TextEditInfo[] { diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.ts index acb25d8bfeb..42a40e99797 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { BracketInfo, BracketPairWithMinIndentationInfo, IFoundBracket } from 'vs/editor/common/textModelBracketPairs'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { IModelContentChangedEvent, IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents'; -import { ResolvedLanguageConfiguration } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { AstNode, AstNodeKind } from './ast'; -import { TextEditInfo } from './beforeEditPositionMapper'; -import { LanguageAgnosticBracketTokens } from './brackets'; -import { Length, lengthAdd, lengthGreaterThanEqual, lengthLessThan, lengthLessThanEqual, lengthsToRange, lengthZero, positionToLength, toLength } from './length'; -import { parseDocument } from './parser'; -import { DenseKeyProvider } from './smallImmutableSet'; -import { FastTokenizer, TextBufferTokenizer } from './tokenizer'; -import { BackgroundTokenizationState } from 'vs/editor/common/tokenizationTextModelPart'; -import { Position } from 'vs/editor/common/core/position'; -import { CallbackIterable } from 'vs/base/common/arrays'; -import { combineTextEditInfos } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos'; -import { ClosingBracketKind, OpeningBracketKind } from 'vs/editor/common/languages/supports/languageBracketsConfiguration'; +import { Emitter } from '../../../../../base/common/event.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { Range } from '../../../core/range.js'; +import { ITextModel } from '../../../model.js'; +import { BracketInfo, BracketPairWithMinIndentationInfo, IFoundBracket } from '../../../textModelBracketPairs.js'; +import { TextModel } from '../../textModel.js'; +import { IModelContentChangedEvent, IModelTokensChangedEvent } from '../../../textModelEvents.js'; +import { ResolvedLanguageConfiguration } from '../../../languages/languageConfigurationRegistry.js'; +import { AstNode, AstNodeKind } from './ast.js'; +import { TextEditInfo } from './beforeEditPositionMapper.js'; +import { LanguageAgnosticBracketTokens } from './brackets.js'; +import { Length, lengthAdd, lengthGreaterThanEqual, lengthLessThan, lengthLessThanEqual, lengthsToRange, lengthZero, positionToLength, toLength } from './length.js'; +import { parseDocument } from './parser.js'; +import { DenseKeyProvider } from './smallImmutableSet.js'; +import { FastTokenizer, TextBufferTokenizer } from './tokenizer.js'; +import { BackgroundTokenizationState } from '../../../tokenizationTextModelPart.js'; +import { Position } from '../../../core/position.js'; +import { CallbackIterable } from '../../../../../base/common/arrays.js'; +import { combineTextEditInfos } from './combineTextEditInfos.js'; +import { ClosingBracketKind, OpeningBracketKind } from '../../../languages/supports/languageBracketsConfiguration.js'; export class BracketPairsTree extends Disposable { private readonly didChangeEmitter = new Emitter(); diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.ts index b4b31932e67..c0445ee917c 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.ts @@ -2,13 +2,13 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import { ResolvedLanguageConfiguration } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { BracketKind } from 'vs/editor/common/languages/supports/languageBracketsConfiguration'; -import { BracketAstNode } from './ast'; -import { toLength } from './length'; -import { DenseKeyProvider, identityKeyProvider, SmallImmutableSet } from './smallImmutableSet'; -import { OpeningBracketId, Token, TokenKind } from './tokenizer'; +import { escapeRegExpCharacters } from '../../../../../base/common/strings.js'; +import { ResolvedLanguageConfiguration } from '../../../languages/languageConfigurationRegistry.js'; +import { BracketKind } from '../../../languages/supports/languageBracketsConfiguration.js'; +import { BracketAstNode } from './ast.js'; +import { toLength } from './length.js'; +import { DenseKeyProvider, identityKeyProvider, SmallImmutableSet } from './smallImmutableSet.js'; +import { OpeningBracketId, Token, TokenKind } from './tokenizer.js'; export class BracketTokens { static createFromLanguage(configuration: ResolvedLanguageConfiguration, denseKeyProvider: DenseKeyProvider): BracketTokens { diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts index 29cf5a65271..d522d0916ac 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ArrayQueue } from 'vs/base/common/arrays'; -import { TextEditInfo } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper'; -import { Length, lengthAdd, lengthDiffNonNegative, lengthEquals, lengthIsZero, lengthToObj, lengthZero, sumLengths } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; +import { ArrayQueue } from '../../../../../base/common/arrays.js'; +import { TextEditInfo } from './beforeEditPositionMapper.js'; +import { Length, lengthAdd, lengthDiffNonNegative, lengthEquals, lengthIsZero, lengthToObj, lengthZero, sumLengths } from './length.js'; export function combineTextEditInfos(textEditInfoFirst: TextEditInfo[], textEditInfoSecond: TextEditInfo[]): TextEditInfo[] { if (textEditInfoFirst.length === 0) { diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.ts index aab40426436..eacd35a9a7b 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AstNode, AstNodeKind, ListAstNode } from './ast'; +import { AstNode, AstNodeKind, ListAstNode } from './ast.js'; /** * Concatenates a list of (2,3) AstNode's into a single (2,3) AstNode. diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.ts index d41a62233e5..b858a7d4d79 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { splitLines } from 'vs/base/common/strings'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { TextLength } from 'vs/editor/common/core/textLength'; +import { splitLines } from '../../../../../base/common/strings.js'; +import { Position } from '../../../core/position.js'; +import { Range } from '../../../core/range.js'; +import { TextLength } from '../../../core/textLength.js'; /** * The end must be greater than or equal to the start. diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/nodeReader.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/nodeReader.ts index 4d15eb51764..e71df26d592 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/nodeReader.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/nodeReader.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AstNode } from './ast'; -import { lengthAdd, lengthZero, Length, lengthLessThan } from './length'; +import { AstNode } from './ast.js'; +import { lengthAdd, lengthZero, Length, lengthLessThan } from './length.js'; /** * Allows to efficiently find a longest child at a given offset in a fixed node. diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/parser.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/parser.ts index cdf202699d3..5ae84a1068c 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/parser.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/parser.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AstNode, AstNodeKind, BracketAstNode, InvalidBracketAstNode, ListAstNode, PairAstNode, TextAstNode } from './ast'; -import { BeforeEditPositionMapper, TextEditInfo } from './beforeEditPositionMapper'; -import { SmallImmutableSet } from './smallImmutableSet'; -import { lengthIsZero, lengthLessThan } from './length'; -import { concat23Trees, concat23TreesOfSameHeight } from './concat23Trees'; -import { NodeReader } from './nodeReader'; -import { OpeningBracketId, Tokenizer, TokenKind } from './tokenizer'; +import { AstNode, AstNodeKind, BracketAstNode, InvalidBracketAstNode, ListAstNode, PairAstNode, TextAstNode } from './ast.js'; +import { BeforeEditPositionMapper, TextEditInfo } from './beforeEditPositionMapper.js'; +import { SmallImmutableSet } from './smallImmutableSet.js'; +import { lengthIsZero, lengthLessThan } from './length.js'; +import { concat23Trees, concat23TreesOfSameHeight } from './concat23Trees.js'; +import { NodeReader } from './nodeReader.js'; +import { OpeningBracketId, Tokenizer, TokenKind } from './tokenizer.js'; /** * Non incrementally built ASTs are immutable. diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.ts index 54c9daaa90d..ae8cce61d56 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { NotSupportedError } from 'vs/base/common/errors'; -import { StandardTokenType, TokenMetadata } from 'vs/editor/common/encodedTokenAttributes'; -import { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { BracketAstNode, TextAstNode } from './ast'; -import { BracketTokens, LanguageAgnosticBracketTokens } from './brackets'; -import { Length, lengthAdd, lengthDiff, lengthGetColumnCountIfZeroLineCount, lengthToObj, lengthZero, toLength } from './length'; -import { SmallImmutableSet } from './smallImmutableSet'; +import { NotSupportedError } from '../../../../../base/common/errors.js'; +import { StandardTokenType, TokenMetadata } from '../../../encodedTokenAttributes.js'; +import { IViewLineTokens } from '../../../tokens/lineTokens.js'; +import { BracketAstNode, TextAstNode } from './ast.js'; +import { BracketTokens, LanguageAgnosticBracketTokens } from './brackets.js'; +import { Length, lengthAdd, lengthDiff, lengthGetColumnCountIfZeroLineCount, lengthToObj, lengthZero, toLength } from './length.js'; +import { SmallImmutableSet } from './smallImmutableSet.js'; export interface Tokenizer { readonly offset: Length; diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.ts index 0f9c341a4f8..2b431cb64bd 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Color } from 'vs/base/common/color'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Range } from 'vs/editor/common/core/range'; -import { BracketPairColorizationOptions, IModelDecoration } from 'vs/editor/common/model'; -import { BracketInfo } from 'vs/editor/common/textModelBracketPairs'; -import { DecorationProvider } from 'vs/editor/common/model/decorationProvider'; -import { TextModel } from 'vs/editor/common/model/textModel'; +import { Color } from '../../../../base/common/color.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { Range } from '../../core/range.js'; +import { BracketPairColorizationOptions, IModelDecoration } from '../../model.js'; +import { BracketInfo } from '../../textModelBracketPairs.js'; +import { DecorationProvider } from '../decorationProvider.js'; +import { TextModel } from '../textModel.js'; import { editorBracketHighlightingForeground1, editorBracketHighlightingForeground2, editorBracketHighlightingForeground3, editorBracketHighlightingForeground4, editorBracketHighlightingForeground5, editorBracketHighlightingForeground6, editorBracketHighlightingUnexpectedBracketForeground -} from 'vs/editor/common/core/editorColorRegistry'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { IModelOptionsChangedEvent } from 'vs/editor/common/textModelEvents'; +} from '../../core/editorColorRegistry.js'; +import { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { IModelOptionsChangedEvent } from '../../textModelEvents.js'; export class ColorizedBracketPairsDecorationProvider extends Disposable implements DecorationProvider { private colorizationOptions: BracketPairColorizationOptions; diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/fixBrackets.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/fixBrackets.ts index d9db755673f..e35608b5bdf 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/fixBrackets.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/fixBrackets.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { AstNode, AstNodeKind } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast'; -import { LanguageAgnosticBracketTokens } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets'; -import { Length, lengthAdd, lengthGetColumnCountIfZeroLineCount, lengthZero } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; -import { parseDocument } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/parser'; -import { DenseKeyProvider } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet'; -import { ITokenizerSource, TextBufferTokenizer } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer'; -import { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens'; +import { ILanguageConfigurationService } from '../../languages/languageConfigurationRegistry.js'; +import { AstNode, AstNodeKind } from './bracketPairsTree/ast.js'; +import { LanguageAgnosticBracketTokens } from './bracketPairsTree/brackets.js'; +import { Length, lengthAdd, lengthGetColumnCountIfZeroLineCount, lengthZero } from './bracketPairsTree/length.js'; +import { parseDocument } from './bracketPairsTree/parser.js'; +import { DenseKeyProvider } from './bracketPairsTree/smallImmutableSet.js'; +import { ITokenizerSource, TextBufferTokenizer } from './bracketPairsTree/tokenizer.js'; +import { IViewLineTokens } from '../../tokens/lineTokens.js'; export function fixBracketsInLine(tokens: IViewLineTokens, languageConfigurationService: ILanguageConfigurationService): string { const denseKeyProvider = new DenseKeyProvider(); diff --git a/src/vs/editor/common/model/csEvents.ts b/src/vs/editor/common/model/csEvents.ts index 8a9dfd48456..b506524f79b 100644 --- a/src/vs/editor/common/model/csEvents.ts +++ b/src/vs/editor/common/model/csEvents.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Position } from 'vs/editor/common/core/position'; -import { URI } from 'vs/base/common/uri'; +import { URI } from '../../../base/common/uri.js'; +import { Position } from '../core/position.js'; export type SymbolNavigationEvent = { position: Position; diff --git a/src/vs/editor/common/model/decorationProvider.ts b/src/vs/editor/common/model/decorationProvider.ts index af8452a6101..0cb68740e2d 100644 --- a/src/vs/editor/common/model/decorationProvider.ts +++ b/src/vs/editor/common/model/decorationProvider.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { Range } from 'vs/editor/common/core/range'; -import { IModelDecoration } from 'vs/editor/common/model'; +import { Event } from '../../../base/common/event.js'; +import { Range } from '../core/range.js'; +import { IModelDecoration } from '../model.js'; export interface DecorationProvider { /** diff --git a/src/vs/editor/common/model/editStack.ts b/src/vs/editor/common/model/editStack.ts index 8c9f1c4d6e2..b7a5fe5378d 100644 --- a/src/vs/editor/common/model/editStack.ts +++ b/src/vs/editor/common/model/editStack.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Selection } from 'vs/editor/common/core/selection'; -import { EndOfLineSequence, ICursorStateComputer, IValidEditOperation, ITextModel } from 'vs/editor/common/model'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { IUndoRedoService, IResourceUndoRedoElement, UndoRedoElementType, IWorkspaceUndoRedoElement, UndoRedoGroup } from 'vs/platform/undoRedo/common/undoRedo'; -import { URI } from 'vs/base/common/uri'; -import { TextChange, compressConsecutiveTextChanges } from 'vs/editor/common/core/textChange'; -import * as buffer from 'vs/base/common/buffer'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { basename } from 'vs/base/common/resources'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; +import * as nls from '../../../nls.js'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import { Selection } from '../core/selection.js'; +import { EndOfLineSequence, ICursorStateComputer, IValidEditOperation, ITextModel } from '../model.js'; +import { TextModel } from './textModel.js'; +import { IUndoRedoService, IResourceUndoRedoElement, UndoRedoElementType, IWorkspaceUndoRedoElement, UndoRedoGroup } from '../../../platform/undoRedo/common/undoRedo.js'; +import { URI } from '../../../base/common/uri.js'; +import { TextChange, compressConsecutiveTextChanges } from '../core/textChange.js'; +import * as buffer from '../../../base/common/buffer.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { basename } from '../../../base/common/resources.js'; +import { ISingleEditOperation } from '../core/editOperation.js'; function uriGetComparisonKey(resource: URI): string { return resource.toString(); diff --git a/src/vs/editor/common/model/fixedArray.ts b/src/vs/editor/common/model/fixedArray.ts index 1d57ce2914b..1ebfe07cba7 100644 --- a/src/vs/editor/common/model/fixedArray.ts +++ b/src/vs/editor/common/model/fixedArray.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { arrayInsert } from 'vs/base/common/arrays'; +import { arrayInsert } from '../../../base/common/arrays.js'; /** * An array that avoids being sparse by always diff --git a/src/vs/editor/common/model/guidesTextModelPart.ts b/src/vs/editor/common/model/guidesTextModelPart.ts index 7963063d044..157717fa9c1 100644 --- a/src/vs/editor/common/model/guidesTextModelPart.ts +++ b/src/vs/editor/common/model/guidesTextModelPart.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { findLast } from 'vs/base/common/arraysFind'; -import * as strings from 'vs/base/common/strings'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import type { TextModel } from 'vs/editor/common/model/textModel'; -import { TextModelPart } from 'vs/editor/common/model/textModelPart'; -import { computeIndentLevel } from 'vs/editor/common/model/utils'; -import { ILanguageConfigurationService, ResolvedLanguageConfiguration } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { BracketGuideOptions, HorizontalGuidesState, IActiveIndentGuideInfo, IGuidesTextModelPart, IndentGuide, IndentGuideHorizontalLine } from 'vs/editor/common/textModelGuides'; -import { BugIndicatingError } from 'vs/base/common/errors'; +import { findLast } from '../../../base/common/arraysFind.js'; +import * as strings from '../../../base/common/strings.js'; +import { CursorColumns } from '../core/cursorColumns.js'; +import { IPosition, Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import type { TextModel } from './textModel.js'; +import { TextModelPart } from './textModelPart.js'; +import { computeIndentLevel } from './utils.js'; +import { ILanguageConfigurationService, ResolvedLanguageConfiguration } from '../languages/languageConfigurationRegistry.js'; +import { BracketGuideOptions, HorizontalGuidesState, IActiveIndentGuideInfo, IGuidesTextModelPart, IndentGuide, IndentGuideHorizontalLine } from '../textModelGuides.js'; +import { BugIndicatingError } from '../../../base/common/errors.js'; export class GuidesTextModelPart extends TextModelPart implements IGuidesTextModelPart { constructor( diff --git a/src/vs/editor/common/model/indentationGuesser.ts b/src/vs/editor/common/model/indentationGuesser.ts index bd32bfa2782..ba6a7f64089 100644 --- a/src/vs/editor/common/model/indentationGuesser.ts +++ b/src/vs/editor/common/model/indentationGuesser.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { ITextBuffer } from 'vs/editor/common/model'; +import { CharCode } from '../../../base/common/charCode.js'; +import { ITextBuffer } from '../model.js'; class SpacesDiffResult { public spacesDiff: number = 0; diff --git a/src/vs/editor/common/model/intervalTree.ts b/src/vs/editor/common/model/intervalTree.ts index ff5d9105dd2..99809d0f967 100644 --- a/src/vs/editor/common/model/intervalTree.ts +++ b/src/vs/editor/common/model/intervalTree.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { TrackedRangeStickiness, TrackedRangeStickiness as ActualTrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; +import { Range } from '../core/range.js'; +import { TrackedRangeStickiness, TrackedRangeStickiness as ActualTrackedRangeStickiness } from '../model.js'; +import { ModelDecorationOptions } from './textModel.js'; // // The red-black tree is based on the "Introduction to Algorithms" by Cormen, Leiserson and Rivest. diff --git a/src/vs/editor/common/model/mirrorTextModel.ts b/src/vs/editor/common/model/mirrorTextModel.ts index 19356007c3a..59482286e01 100644 --- a/src/vs/editor/common/model/mirrorTextModel.ts +++ b/src/vs/editor/common/model/mirrorTextModel.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { splitLines } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { IModelContentChange } from 'vs/editor/common/textModelEvents'; -import { PrefixSumComputer } from 'vs/editor/common/model/prefixSumComputer'; +import { splitLines } from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import { Position } from '../core/position.js'; +import { IRange } from '../core/range.js'; +import { IModelContentChange } from '../textModelEvents.js'; +import { PrefixSumComputer } from './prefixSumComputer.js'; export interface IModelChangedEvent { /** diff --git a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts index 24f90651f95..0d52df0cc51 100644 --- a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts +++ b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { FindMatch, ITextSnapshot, SearchData } from 'vs/editor/common/model'; -import { NodeColor, SENTINEL, TreeNode, fixInsert, leftest, rbDelete, righttest, updateTreeMetadata } from 'vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase'; -import { Searcher, createFindMatch, isValidMatch } from 'vs/editor/common/model/textModelSearch'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { Position } from '../../core/position.js'; +import { Range } from '../../core/range.js'; +import { FindMatch, ITextSnapshot, SearchData } from '../../model.js'; +import { NodeColor, SENTINEL, TreeNode, fixInsert, leftest, rbDelete, righttest, updateTreeMetadata } from './rbTreeBase.js'; +import { Searcher, createFindMatch, isValidMatch } from '../textModelSearch.js'; // const lfRegex = new RegExp(/\r\n|\r|\n/g); const AverageBufferSize = 65535; diff --git a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts index a369298c0c9..42d1995e367 100644 --- a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts +++ b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import * as strings from 'vs/base/common/strings'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ApplyEditsResult, EndOfLinePreference, FindMatch, IInternalModelContentChange, ISingleEditOperationIdentifier, ITextBuffer, ITextSnapshot, ValidAnnotatedEditOperation, IValidEditOperation, SearchData } from 'vs/editor/common/model'; -import { PieceTreeBase, StringBuffer } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase'; -import { countEOL, StringEOL } from 'vs/editor/common/core/eolCounter'; -import { TextChange } from 'vs/editor/common/core/textChange'; -import { Disposable } from 'vs/base/common/lifecycle'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import * as strings from '../../../../base/common/strings.js'; +import { Position } from '../../core/position.js'; +import { Range } from '../../core/range.js'; +import { ApplyEditsResult, EndOfLinePreference, FindMatch, IInternalModelContentChange, ISingleEditOperationIdentifier, ITextBuffer, ITextSnapshot, ValidAnnotatedEditOperation, IValidEditOperation, SearchData } from '../../model.js'; +import { PieceTreeBase, StringBuffer } from './pieceTreeBase.js'; +import { countEOL, StringEOL } from '../../core/eolCounter.js'; +import { TextChange } from '../../core/textChange.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; export interface IValidatedEditOperation { sortIndex: number; diff --git a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts index 824a5674a32..3ee4d87991a 100644 --- a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts +++ b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import * as strings from 'vs/base/common/strings'; -import { DefaultEndOfLine, ITextBuffer, ITextBufferBuilder, ITextBufferFactory } from 'vs/editor/common/model'; -import { StringBuffer, createLineStarts, createLineStartsFast } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase'; -import { PieceTreeTextBuffer } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import * as strings from '../../../../base/common/strings.js'; +import { DefaultEndOfLine, ITextBuffer, ITextBufferBuilder, ITextBufferFactory } from '../../model.js'; +import { StringBuffer, createLineStarts, createLineStartsFast } from './pieceTreeBase.js'; +import { PieceTreeTextBuffer } from './pieceTreeTextBuffer.js'; class PieceTreeTextBufferFactory implements ITextBufferFactory { diff --git a/src/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.ts b/src/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.ts index 1d6301b12c6..7dfd9d8373a 100644 --- a/src/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.ts +++ b/src/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Piece, PieceTreeBase } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase'; +import { Piece, PieceTreeBase } from './pieceTreeBase.js'; export class TreeNode { parent: TreeNode; diff --git a/src/vs/editor/common/model/prefixSumComputer.ts b/src/vs/editor/common/model/prefixSumComputer.ts index 0f3c184714f..08376d50d8e 100644 --- a/src/vs/editor/common/model/prefixSumComputer.ts +++ b/src/vs/editor/common/model/prefixSumComputer.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { arrayInsert } from 'vs/base/common/arrays'; -import { toUint32 } from 'vs/base/common/uint'; +import { arrayInsert } from '../../../base/common/arrays.js'; +import { toUint32 } from '../../../base/common/uint.js'; export class PrefixSumComputer { diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index 97b5a483fc3..0313e5c208a 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -3,48 +3,50 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ArrayQueue, pushMany } from 'vs/base/common/arrays'; -import { VSBuffer, VSBufferReadableStream } from 'vs/base/common/buffer'; -import { Color } from 'vs/base/common/color'; -import { BugIndicatingError, illegalArgument, onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { Disposable, IDisposable, MutableDisposable, combinedDisposable } from 'vs/base/common/lifecycle'; -import { listenStream } from 'vs/base/common/stream'; -import * as strings from 'vs/base/common/strings'; -import { ThemeColor } from 'vs/base/common/themables'; -import { Constants } from 'vs/base/common/uint'; -import { URI } from 'vs/base/common/uri'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { countEOL } from 'vs/editor/common/core/eolCounter'; -import { normalizeIndentation } from 'vs/editor/common/core/indentation'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { TextChange } from 'vs/editor/common/core/textChange'; -import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults'; -import { IWordAtPosition } from 'vs/editor/common/core/wordHelper'; -import { FormattingOptions } from 'vs/editor/common/languages'; -import { ILanguageSelection, ILanguageService } from 'vs/editor/common/languages/language'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import * as model from 'vs/editor/common/model'; -import { BracketPairsTextModelPart } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl'; -import { ColorizedBracketPairsDecorationProvider } from 'vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider'; -import { EditStack } from 'vs/editor/common/model/editStack'; -import { GuidesTextModelPart } from 'vs/editor/common/model/guidesTextModelPart'; -import { guessIndentation } from 'vs/editor/common/model/indentationGuesser'; -import { IntervalNode, IntervalTree, recomputeMaxEnd } from 'vs/editor/common/model/intervalTree'; -import { PieceTreeTextBuffer } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer'; -import { PieceTreeTextBufferBuilder } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder'; -import { SearchParams, TextModelSearch } from 'vs/editor/common/model/textModelSearch'; -import { TokenizationTextModelPart } from 'vs/editor/common/model/tokenizationTextModelPart'; -import { IBracketPairsTextModelPart } from 'vs/editor/common/textModelBracketPairs'; -import { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelOptionsChangedEvent, InternalModelContentChangeEvent, LineInjectedText, ModelInjectedTextChangedEvent, ModelRawChange, ModelRawContentChangedEvent, ModelRawEOLChanged, ModelRawFlush, ModelRawLineChanged, ModelRawLinesDeleted, ModelRawLinesInserted } from 'vs/editor/common/textModelEvents'; -import { IGuidesTextModelPart } from 'vs/editor/common/textModelGuides'; -import { ITokenizationTextModelPart } from 'vs/editor/common/tokenizationTextModelPart'; -import { IColorTheme } from 'vs/platform/theme/common/themeService'; -import { IUndoRedoService, ResourceEditStackSnapshot, UndoRedoGroup } from 'vs/platform/undoRedo/common/undoRedo'; +import { ArrayQueue, pushMany } from '../../../base/common/arrays.js'; +import { VSBuffer, VSBufferReadableStream } from '../../../base/common/buffer.js'; +import { Color } from '../../../base/common/color.js'; +import { BugIndicatingError, illegalArgument, onUnexpectedError } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { Disposable, IDisposable, MutableDisposable, combinedDisposable } from '../../../base/common/lifecycle.js'; +import { listenStream } from '../../../base/common/stream.js'; +import * as strings from '../../../base/common/strings.js'; +import { ThemeColor } from '../../../base/common/themables.js'; +import { Constants } from '../../../base/common/uint.js'; +import { URI } from '../../../base/common/uri.js'; +import { ISingleEditOperation } from '../core/editOperation.js'; +import { countEOL } from '../core/eolCounter.js'; +import { normalizeIndentation } from '../core/indentation.js'; +import { IPosition, Position } from '../core/position.js'; +import { IRange, Range } from '../core/range.js'; +import { Selection } from '../core/selection.js'; +import { TextChange } from '../core/textChange.js'; +import { EDITOR_MODEL_DEFAULTS } from '../core/textModelDefaults.js'; +import { IWordAtPosition } from '../core/wordHelper.js'; +import { FormattingOptions } from '../languages.js'; +import { ILanguageSelection, ILanguageService } from '../languages/language.js'; +import { ILanguageConfigurationService } from '../languages/languageConfigurationRegistry.js'; +import * as model from '../model.js'; +import { BracketPairsTextModelPart } from './bracketPairsTextModelPart/bracketPairsImpl.js'; +import { ColorizedBracketPairsDecorationProvider } from './bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js'; +import { EditStack } from './editStack.js'; +import { GuidesTextModelPart } from './guidesTextModelPart.js'; +import { guessIndentation } from './indentationGuesser.js'; +import { IntervalNode, IntervalTree, recomputeMaxEnd } from './intervalTree.js'; +import { PieceTreeTextBuffer } from './pieceTreeTextBuffer/pieceTreeTextBuffer.js'; +import { PieceTreeTextBufferBuilder } from './pieceTreeTextBuffer/pieceTreeTextBufferBuilder.js'; +import { SearchParams, TextModelSearch } from './textModelSearch.js'; +import { TokenizationTextModelPart } from './tokenizationTextModelPart.js'; +import { AttachedViews } from './tokens.js'; +import { IBracketPairsTextModelPart } from '../textModelBracketPairs.js'; +import { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelOptionsChangedEvent, InternalModelContentChangeEvent, LineInjectedText, ModelInjectedTextChangedEvent, ModelRawChange, ModelRawContentChangedEvent, ModelRawEOLChanged, ModelRawFlush, ModelRawLineChanged, ModelRawLinesDeleted, ModelRawLinesInserted } from '../textModelEvents.js'; +import { IGuidesTextModelPart } from '../textModelGuides.js'; +import { ITokenizationTextModelPart } from '../tokenizationTextModelPart.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { IColorTheme } from '../../../platform/theme/common/themeService.js'; +import { IUndoRedoService, ResourceEditStackSnapshot, UndoRedoGroup } from '../../../platform/undoRedo/common/undoRedo.js'; +import { TokenArray } from '../tokens/tokenArray.js'; export function createTextBufferFactory(text: string): model.ITextBufferFactory { const builder = new PieceTreeTextBufferBuilder(); @@ -299,6 +301,7 @@ export class TextModel extends Disposable implements model.ITextModel, IDecorati @IUndoRedoService private readonly _undoRedoService: IUndoRedoService, @ILanguageService private readonly _languageService: ILanguageService, @ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService, + @IInstantiationService private readonly instantiationService: IInstantiationService ) { super(); @@ -327,13 +330,11 @@ export class TextModel extends Disposable implements model.ITextModel, IDecorati this._bracketPairs = this._register(new BracketPairsTextModelPart(this, this._languageConfigurationService)); this._guidesTextModelPart = this._register(new GuidesTextModelPart(this, this._languageConfigurationService)); this._decorationProvider = this._register(new ColorizedBracketPairsDecorationProvider(this)); - this._tokenizationTextModelPart = new TokenizationTextModelPart( - this._languageService, - this._languageConfigurationService, + this._tokenizationTextModelPart = this.instantiationService.createInstance(TokenizationTextModelPart, this, this._bracketPairs, languageId, - this._attachedViews, + this._attachedViews ); const bufferLineCount = this._buffer.getLineCount(); @@ -1989,7 +1990,7 @@ export class TextModel extends Disposable implements model.ITextModel, IDecorati } } -function indentOfLine(line: string): number { +export function indentOfLine(line: string): number { let indent = 0; for (const c of line) { if (c === ' ' || c === '\t') { @@ -2268,6 +2269,7 @@ export class ModelDecorationInjectedTextOptions implements model.InjectedTextOpt } public readonly content: string; + public readonly tokens: TokenArray | null; readonly inlineClassName: string | null; readonly inlineClassNameAffectsLetterSpacing: boolean; readonly attachedData: unknown | null; @@ -2275,6 +2277,7 @@ export class ModelDecorationInjectedTextOptions implements model.InjectedTextOpt private constructor(options: model.InjectedTextOptions) { this.content = options.content || ''; + this.tokens = options.tokens ?? null; this.inlineClassName = options.inlineClassName || null; this.inlineClassNameAffectsLetterSpacing = options.inlineClassNameAffectsLetterSpacing || false; this.attachedData = options.attachedData || null; @@ -2528,43 +2531,3 @@ class DidChangeContentEmitter extends Disposable { this._slowEmitter.fire(e); } } - -/** - * @internal - */ -export class AttachedViews { - private readonly _onDidChangeVisibleRanges = new Emitter<{ view: model.IAttachedView; state: IAttachedViewState | undefined }>(); - public readonly onDidChangeVisibleRanges = this._onDidChangeVisibleRanges.event; - - private readonly _views = new Set(); - - public attachView(): model.IAttachedView { - const view = new AttachedViewImpl((state) => { - this._onDidChangeVisibleRanges.fire({ view, state }); - }); - this._views.add(view); - return view; - } - - public detachView(view: model.IAttachedView): void { - this._views.delete(view as AttachedViewImpl); - this._onDidChangeVisibleRanges.fire({ view, state: undefined }); - } -} - -/** - * @internal - */ -export interface IAttachedViewState { - readonly visibleLineRanges: readonly LineRange[]; - readonly stabilized: boolean; -} - -class AttachedViewImpl implements model.IAttachedView { - constructor(private readonly handleStateChange: (state: IAttachedViewState) => void) { } - - setVisibleLines(visibleLines: { startLineNumber: number; endLineNumber: number }[], stabilized: boolean): void { - const visibleLineRanges = visibleLines.map((line) => new LineRange(line.startLineNumber, line.endLineNumber + 1)); - this.handleStateChange({ visibleLineRanges, stabilized }); - } -} diff --git a/src/vs/editor/common/model/textModelPart.ts b/src/vs/editor/common/model/textModelPart.ts index ef061c2ba9c..d1b2bebc823 100644 --- a/src/vs/editor/common/model/textModelPart.ts +++ b/src/vs/editor/common/model/textModelPart.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; +import { Disposable } from '../../../base/common/lifecycle.js'; export class TextModelPart extends Disposable { private _isDisposed = false; diff --git a/src/vs/editor/common/model/textModelSearch.ts b/src/vs/editor/common/model/textModelSearch.ts index 81f6cbc5e20..ae259f035d5 100644 --- a/src/vs/editor/common/model/textModelSearch.ts +++ b/src/vs/editor/common/model/textModelSearch.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import * as strings from 'vs/base/common/strings'; -import { WordCharacterClass, WordCharacterClassifier, getMapForWordSeparators } from 'vs/editor/common/core/wordCharacterClassifier'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { EndOfLinePreference, FindMatch, SearchData } from 'vs/editor/common/model'; -import { TextModel } from 'vs/editor/common/model/textModel'; +import { CharCode } from '../../../base/common/charCode.js'; +import * as strings from '../../../base/common/strings.js'; +import { WordCharacterClass, WordCharacterClassifier, getMapForWordSeparators } from '../core/wordCharacterClassifier.js'; +import { Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { EndOfLinePreference, FindMatch, SearchData } from '../model.js'; +import { TextModel } from './textModel.js'; const LIMIT_FIND_COUNT = 999; diff --git a/src/vs/editor/common/model/textModelText.ts b/src/vs/editor/common/model/textModelText.ts index 0a603fa1ed2..0dad2b9b6b1 100644 --- a/src/vs/editor/common/model/textModelText.ts +++ b/src/vs/editor/common/model/textModelText.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { AbstractText } from 'vs/editor/common/core/textEdit'; -import { TextLength } from 'vs/editor/common/core/textLength'; -import { ITextModel } from 'vs/editor/common/model'; +import { Range } from '../core/range.js'; +import { AbstractText } from '../core/textEdit.js'; +import { TextLength } from '../core/textLength.js'; +import { ITextModel } from '../model.js'; export class TextModelText extends AbstractText { constructor(private readonly _textModel: ITextModel) { diff --git a/src/vs/editor/common/model/textModelTokens.ts b/src/vs/editor/common/model/textModelTokens.ts index fb1b7364d49..85068d38984 100644 --- a/src/vs/editor/common/model/textModelTokens.ts +++ b/src/vs/editor/common/model/textModelTokens.ts @@ -3,22 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IdleDeadline, runWhenGlobalIdle } from 'vs/base/common/async'; -import { BugIndicatingError, onUnexpectedError } from 'vs/base/common/errors'; -import { setTimeout0 } from 'vs/base/common/platform'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { countEOL } from 'vs/editor/common/core/eolCounter'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { Position } from 'vs/editor/common/core/position'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { EncodedTokenizationResult, IBackgroundTokenizationStore, IBackgroundTokenizer, ILanguageIdCodec, IState, ITokenizationSupport } from 'vs/editor/common/languages'; -import { nullTokenizeEncoded } from 'vs/editor/common/languages/nullTokenize'; -import { ITextModel } from 'vs/editor/common/model'; -import { FixedArray } from 'vs/editor/common/model/fixedArray'; -import { IModelContentChange } from 'vs/editor/common/textModelEvents'; -import { ContiguousMultilineTokensBuilder } from 'vs/editor/common/tokens/contiguousMultilineTokensBuilder'; -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; +import { IdleDeadline, runWhenGlobalIdle } from '../../../base/common/async.js'; +import { BugIndicatingError, onUnexpectedError } from '../../../base/common/errors.js'; +import { setTimeout0 } from '../../../base/common/platform.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { countEOL } from '../core/eolCounter.js'; +import { LineRange } from '../core/lineRange.js'; +import { OffsetRange } from '../core/offsetRange.js'; +import { Position } from '../core/position.js'; +import { StandardTokenType } from '../encodedTokenAttributes.js'; +import { EncodedTokenizationResult, IBackgroundTokenizationStore, IBackgroundTokenizer, ILanguageIdCodec, IState, ITokenizationSupport } from '../languages.js'; +import { nullTokenizeEncoded } from '../languages/nullTokenize.js'; +import { ITextModel } from '../model.js'; +import { FixedArray } from './fixedArray.js'; +import { IModelContentChange } from '../textModelEvents.js'; +import { ITokenizeLineWithEditResult, LineEditWithAdditionalLines } from '../tokenizationTextModelPart.js'; +import { ContiguousMultilineTokensBuilder } from '../tokens/contiguousMultilineTokensBuilder.js'; +import { LineTokens } from '../tokens/lineTokens.js'; const enum Constants { CHEAP_TOKENIZATION_LENGTH_LIMIT = 2048 @@ -101,18 +102,14 @@ export class TokenizerWithStateStoreAndTextModel } /** assumes state is up to date */ - public tokenizeLineWithEdit(position: Position, length: number, newText: string): LineTokens | null { - const lineNumber = position.lineNumber; - const column = position.column; - + public tokenizeLineWithEdit(lineNumber: number, edit: LineEditWithAdditionalLines): ITokenizeLineWithEditResult { const lineStartState = this.getStartState(lineNumber); if (!lineStartState) { - return null; + return { mainLineTokens: null, additionalLines: null }; } const curLineContent = this._textModel.getLineContent(lineNumber); - const newLineContent = curLineContent.substring(0, column - 1) - + newText + curLineContent.substring(column - 1 + length); + const newLineContent = edit.lineEdit.apply(curLineContent); const languageId = this._textModel.getLanguageIdAtPosition(lineNumber, 0); const result = safeTokenize( @@ -124,8 +121,19 @@ export class TokenizerWithStateStoreAndTextModel lineStartState ); - const lineTokens = new LineTokens(result.tokens, newLineContent, this._languageIdCodec); - return lineTokens; + let additionalLines: LineTokens[] | null = null; + if (edit.additionalLines) { + additionalLines = []; + let state = result.endState; + for (const line of edit.additionalLines) { + const r = safeTokenize(this._languageIdCodec, languageId, this.tokenizationSupport, line, true, state); + additionalLines.push(new LineTokens(r.tokens, line, this._languageIdCodec)); + state = r.endState; + } + } + + const mainLineTokens = new LineTokens(result.tokens, newLineContent, this._languageIdCodec); + return { mainLineTokens, additionalLines }; } public hasAccurateTokensForLine(lineNumber: number): boolean { diff --git a/src/vs/editor/common/model/tokenizationTextModelPart.ts b/src/vs/editor/common/model/tokenizationTextModelPart.ts index 40c6c921afc..ae4bc09c82e 100644 --- a/src/vs/editor/common/model/tokenizationTextModelPart.ts +++ b/src/vs/editor/common/model/tokenizationTextModelPart.ts @@ -3,34 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { equals } from 'vs/base/common/arrays'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { CharCode } from 'vs/base/common/charCode'; -import { BugIndicatingError, onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableMap, MutableDisposable } from 'vs/base/common/lifecycle'; -import { countEOL } from 'vs/editor/common/core/eolCounter'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IWordAtPosition, getWordAtText } from 'vs/editor/common/core/wordHelper'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { IBackgroundTokenizationStore, IBackgroundTokenizer, ILanguageIdCodec, IState, ITokenizationSupport, TokenizationRegistry } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ILanguageConfigurationService, LanguageConfigurationServiceChangeEvent, ResolvedLanguageConfiguration } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IAttachedView } from 'vs/editor/common/model'; -import { BracketPairsTextModelPart } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl'; -import { AttachedViews, IAttachedViewState, TextModel } from 'vs/editor/common/model/textModel'; -import { TextModelPart } from 'vs/editor/common/model/textModelPart'; -import { DefaultBackgroundTokenizer, TokenizerWithStateStoreAndTextModel, TrackingTokenizationStateStore } from 'vs/editor/common/model/textModelTokens'; -import { IModelContentChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents'; -import { BackgroundTokenizationState, ITokenizationTextModelPart } from 'vs/editor/common/tokenizationTextModelPart'; -import { ContiguousMultilineTokens } from 'vs/editor/common/tokens/contiguousMultilineTokens'; -import { ContiguousMultilineTokensBuilder } from 'vs/editor/common/tokens/contiguousMultilineTokensBuilder'; -import { ContiguousTokensStore } from 'vs/editor/common/tokens/contiguousTokensStore'; -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { SparseMultilineTokens } from 'vs/editor/common/tokens/sparseMultilineTokens'; -import { SparseTokensStore } from 'vs/editor/common/tokens/sparseTokensStore'; +import { CharCode } from '../../../base/common/charCode.js'; +import { BugIndicatingError, onUnexpectedError } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { DisposableMap, DisposableStore, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { countEOL } from '../core/eolCounter.js'; +import { LineRange } from '../core/lineRange.js'; +import { IPosition, Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { IWordAtPosition, getWordAtText } from '../core/wordHelper.js'; +import { StandardTokenType } from '../encodedTokenAttributes.js'; +import { IBackgroundTokenizationStore, IBackgroundTokenizer, ILanguageIdCodec, IState, ITokenizationSupport, TokenizationRegistry, TreeSitterTokenizationRegistry } from '../languages.js'; +import { ILanguageService } from '../languages/language.js'; +import { ILanguageConfigurationService, LanguageConfigurationServiceChangeEvent, ResolvedLanguageConfiguration } from '../languages/languageConfigurationRegistry.js'; +import { IAttachedView } from '../model.js'; +import { BracketPairsTextModelPart } from './bracketPairsTextModelPart/bracketPairsImpl.js'; +import { TextModel } from './textModel.js'; +import { TextModelPart } from './textModelPart.js'; +import { DefaultBackgroundTokenizer, TokenizerWithStateStoreAndTextModel, TrackingTokenizationStateStore } from './textModelTokens.js'; +import { AbstractTokens, AttachedViewHandler, AttachedViews } from './tokens.js'; +import { TreeSitterTokens } from './treeSitterTokens.js'; +import { ITreeSitterParserService } from '../services/treeSitterParserService.js'; +import { IModelContentChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelTokensChangedEvent } from '../textModelEvents.js'; +import { BackgroundTokenizationState, ITokenizationTextModelPart, ITokenizeLineWithEditResult, LineEditWithAdditionalLines } from '../tokenizationTextModelPart.js'; +import { ContiguousMultilineTokens } from '../tokens/contiguousMultilineTokens.js'; +import { ContiguousMultilineTokensBuilder } from '../tokens/contiguousMultilineTokensBuilder.js'; +import { ContiguousTokensStore } from '../tokens/contiguousTokensStore.js'; +import { LineTokens } from '../tokens/lineTokens.js'; +import { SparseMultilineTokens } from '../tokens/sparseMultilineTokens.js'; +import { SparseTokensStore } from '../tokens/sparseTokensStore.js'; export class TokenizationTextModelPart extends TextModelPart implements ITokenizationTextModelPart { private readonly _semanticTokens: SparseTokensStore = new SparseTokensStore(this._languageService.languageIdCodec); @@ -44,25 +45,71 @@ export class TokenizationTextModelPart extends TextModelPart implements ITokeniz private readonly _onDidChangeTokens: Emitter = this._register(new Emitter()); public readonly onDidChangeTokens: Event = this._onDidChangeTokens.event; - private readonly grammarTokens = this._register(new GrammarTokens(this._languageService.languageIdCodec, this._textModel, () => this._languageId, this._attachedViews)); + private _tokens!: AbstractTokens; + private readonly _tokensDisposables: DisposableStore = this._register(new DisposableStore()); constructor( - private readonly _languageService: ILanguageService, - private readonly _languageConfigurationService: ILanguageConfigurationService, private readonly _textModel: TextModel, private readonly _bracketPairsTextModelPart: BracketPairsTextModelPart, private _languageId: string, private readonly _attachedViews: AttachedViews, + @ILanguageService private readonly _languageService: ILanguageService, + @ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService, + @ITreeSitterParserService private readonly _treeSitterService: ITreeSitterParserService, ) { super(); - this._register(this.grammarTokens.onDidChangeTokens(e => { + this._register(this._languageConfigurationService.onDidChange(e => { + if (e.affects(this._languageId)) { + this._onDidChangeLanguageConfiguration.fire({}); + } + })); + + // We just look at registry changes to determine whether to use tree sitter. + // This means that removing a language from the setting will not cause a switch to textmate and will require a reload. + // Adding a language to the setting will not need a reload, however. + this._register(Event.filter(TreeSitterTokenizationRegistry.onDidChange, (e) => e.changedLanguages.includes(this._languageId))(() => { + this.createPreferredTokenProvider(); + })); + this.createPreferredTokenProvider(); + } + + private createGrammarTokens() { + return this._register(new GrammarTokens(this._languageService.languageIdCodec, this._textModel, () => this._languageId, this._attachedViews)); + } + + private createTreeSitterTokens(): AbstractTokens { + return this._register(new TreeSitterTokens(this._treeSitterService, this._languageService.languageIdCodec, this._textModel, () => this._languageId)); + } + + private createTokens(useTreeSitter: boolean): void { + const needsReset = this._tokens !== undefined; + this._tokens?.dispose(); + this._tokens = useTreeSitter ? this.createTreeSitterTokens() : this.createGrammarTokens(); + this._tokensDisposables.clear(); + this._tokensDisposables.add(this._tokens.onDidChangeTokens(e => { this._emitModelTokensChangedEvent(e); })); - this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(e => { + this._tokensDisposables.add(this._tokens.onDidChangeBackgroundTokenizationState(e => { this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState(); })); + if (needsReset) { + // We need to reset the tokenization, as the new token provider otherwise won't have a chance to provide tokens until some action happens in the editor. + this._tokens.resetTokenization(); + } + } + + private createPreferredTokenProvider() { + if (TreeSitterTokenizationRegistry.get(this._languageId)) { + if (!(this._tokens instanceof TreeSitterTokens)) { + this.createTokens(true); + } + } else { + if (!(this._tokens instanceof GrammarTokens)) { + this.createTokens(false); + } + } } _hasListeners(): boolean { @@ -94,11 +141,11 @@ export class TokenizationTextModelPart extends TextModelPart implements ITokeniz } } - this.grammarTokens.handleDidChangeContent(e); + this._tokens.handleDidChangeContent(e); } public handleDidChangeAttached(): void { - this.grammarTokens.handleDidChangeAttached(); + this._tokens.handleDidChangeAttached(); } /** @@ -106,7 +153,7 @@ export class TokenizationTextModelPart extends TextModelPart implements ITokeniz */ public getLineTokens(lineNumber: number): LineTokens { this.validateLineNumber(lineNumber); - const syntacticTokens = this.grammarTokens.getLineTokens(lineNumber); + const syntacticTokens = this._tokens.getLineTokens(lineNumber); return this._semanticTokens.addSparseTokens(lineNumber, syntacticTokens); } @@ -126,43 +173,43 @@ export class TokenizationTextModelPart extends TextModelPart implements ITokeniz } public get hasTokens(): boolean { - return this.grammarTokens.hasTokens; + return this._tokens.hasTokens; } public resetTokenization() { - this.grammarTokens.resetTokenization(); + this._tokens.resetTokenization(); } public get backgroundTokenizationState() { - return this.grammarTokens.backgroundTokenizationState; + return this._tokens.backgroundTokenizationState; } public forceTokenization(lineNumber: number): void { this.validateLineNumber(lineNumber); - this.grammarTokens.forceTokenization(lineNumber); + this._tokens.forceTokenization(lineNumber); } public hasAccurateTokensForLine(lineNumber: number): boolean { this.validateLineNumber(lineNumber); - return this.grammarTokens.hasAccurateTokensForLine(lineNumber); + return this._tokens.hasAccurateTokensForLine(lineNumber); } public isCheapToTokenize(lineNumber: number): boolean { this.validateLineNumber(lineNumber); - return this.grammarTokens.isCheapToTokenize(lineNumber); + return this._tokens.isCheapToTokenize(lineNumber); } public tokenizeIfCheap(lineNumber: number): void { this.validateLineNumber(lineNumber); - this.grammarTokens.tokenizeIfCheap(lineNumber); + this._tokens.tokenizeIfCheap(lineNumber); } public getTokenTypeIfInsertingCharacter(lineNumber: number, column: number, character: string): StandardTokenType { - return this.grammarTokens.getTokenTypeIfInsertingCharacter(lineNumber, column, character); + return this._tokens.getTokenTypeIfInsertingCharacter(lineNumber, column, character); } - public tokenizeLineWithEdit(position: IPosition, length: number, newText: string): LineTokens | null { - return this.grammarTokens.tokenizeLineWithEdit(position, length, newText); + public tokenizeLineWithEdit(lineNumber: number, edit: LineEditWithAdditionalLines): ITokenizeLineWithEditResult { + return this._tokens.tokenizeLineWithEdit(lineNumber, edit); } // #endregion @@ -327,7 +374,8 @@ export class TokenizationTextModelPart extends TextModelPart implements ITokeniz this._languageId = languageId; this._bracketPairsTextModelPart.handleDidChangeLanguage(e); - this.grammarTokens.resetTokenization(); + this._tokens.resetTokenization(); + this.createPreferredTokenProvider(); this._onDidChangeLanguage.fire(e); this._onDidChangeLanguageConfiguration.fire({}); } @@ -335,7 +383,7 @@ export class TokenizationTextModelPart extends TextModelPart implements ITokeniz // #endregion } -class GrammarTokens extends Disposable { +class GrammarTokens extends AbstractTokens { private _tokenizer: TokenizerWithStateStoreAndTextModel | null = null; private _defaultBackgroundTokenizer: DefaultBackgroundTokenizer | null = null; private readonly _backgroundTokenizer = this._register(new MutableDisposable()); @@ -346,28 +394,15 @@ class GrammarTokens extends Disposable { private readonly _debugBackgroundTokenizer = this._register(new MutableDisposable()); - private _backgroundTokenizationState = BackgroundTokenizationState.InProgress; - public get backgroundTokenizationState(): BackgroundTokenizationState { - return this._backgroundTokenizationState; - } - - private readonly _onDidChangeBackgroundTokenizationState = this._register(new Emitter()); - /** @internal, should not be exposed by the text model! */ - public readonly onDidChangeBackgroundTokenizationState: Event = this._onDidChangeBackgroundTokenizationState.event; - - private readonly _onDidChangeTokens = this._register(new Emitter()); - /** @internal, should not be exposed by the text model! */ - public readonly onDidChangeTokens: Event = this._onDidChangeTokens.event; - private readonly _attachedViewStates = this._register(new DisposableMap()); constructor( - private readonly _languageIdCodec: ILanguageIdCodec, - private readonly _textModel: TextModel, - private getLanguageId: () => string, + languageIdCodec: ILanguageIdCodec, + textModel: TextModel, + getLanguageId: () => string, attachedViews: AttachedViews, ) { - super(); + super(languageIdCodec, textModel, getLanguageId); this._register(TokenizationRegistry.onDidChange((e) => { const languageId = this.getLanguageId(); @@ -587,12 +622,6 @@ class GrammarTokens extends Disposable { return this._tokenizer.isCheapToTokenize(lineNumber); } - public tokenizeIfCheap(lineNumber: number): void { - if (this.isCheapToTokenize(lineNumber)) { - this.forceTokenization(lineNumber); - } - } - public getLineTokens(lineNumber: number): LineTokens { const lineText = this._textModel.getLineContent(lineNumber); const result = this._tokens.getTokens( @@ -625,47 +654,15 @@ class GrammarTokens extends Disposable { return this._tokenizer.getTokenTypeIfInsertingCharacter(position, character); } - public tokenizeLineWithEdit(position: IPosition, length: number, newText: string): LineTokens | null { + public tokenizeLineWithEdit(lineNumber: number, edit: LineEditWithAdditionalLines): ITokenizeLineWithEditResult { if (!this._tokenizer) { - return null; + return { mainLineTokens: null, additionalLines: null }; } - - const validatedPosition = this._textModel.validatePosition(position); - this.forceTokenization(validatedPosition.lineNumber); - return this._tokenizer.tokenizeLineWithEdit(validatedPosition, length, newText); + this.forceTokenization(lineNumber); + return this._tokenizer.tokenizeLineWithEdit(lineNumber, edit); } public get hasTokens(): boolean { return this._tokens.hasTokens; } } - -class AttachedViewHandler extends Disposable { - private readonly runner = this._register(new RunOnceScheduler(() => this.update(), 50)); - - private _computedLineRanges: readonly LineRange[] = []; - private _lineRanges: readonly LineRange[] = []; - public get lineRanges(): readonly LineRange[] { return this._lineRanges; } - - constructor(private readonly _refreshTokens: () => void) { - super(); - } - - private update(): void { - if (equals(this._computedLineRanges, this._lineRanges, (a, b) => a.equals(b))) { - return; - } - this._computedLineRanges = this._lineRanges; - this._refreshTokens(); - } - - public handleStateChange(state: IAttachedViewState): void { - this._lineRanges = state.visibleLineRanges; - if (state.stabilized) { - this.runner.cancel(); - this.update(); - } else { - this.runner.schedule(); - } - } -} diff --git a/src/vs/editor/common/model/tokens.ts b/src/vs/editor/common/model/tokens.ts new file mode 100644 index 00000000000..0e4ed56480c --- /dev/null +++ b/src/vs/editor/common/model/tokens.ts @@ -0,0 +1,137 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { equals } from '../../../base/common/arrays.js'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { LineRange } from '../core/lineRange.js'; +import { StandardTokenType } from '../encodedTokenAttributes.js'; +import { ILanguageIdCodec } from '../languages.js'; +import { IAttachedView } from '../model.js'; +import { TextModel } from './textModel.js'; +import { IModelContentChangedEvent, IModelTokensChangedEvent } from '../textModelEvents.js'; +import { BackgroundTokenizationState, ITokenizeLineWithEditResult, LineEditWithAdditionalLines } from '../tokenizationTextModelPart.js'; +import { LineTokens } from '../tokens/lineTokens.js'; + +/** + * @internal + */ +export class AttachedViews { + private readonly _onDidChangeVisibleRanges = new Emitter<{ view: IAttachedView; state: IAttachedViewState | undefined }>(); + public readonly onDidChangeVisibleRanges = this._onDidChangeVisibleRanges.event; + + private readonly _views = new Set(); + + public attachView(): IAttachedView { + const view = new AttachedViewImpl((state) => { + this._onDidChangeVisibleRanges.fire({ view, state }); + }); + this._views.add(view); + return view; + } + + public detachView(view: IAttachedView): void { + this._views.delete(view as AttachedViewImpl); + this._onDidChangeVisibleRanges.fire({ view, state: undefined }); + } +} + +/** + * @internal + */ +export interface IAttachedViewState { + readonly visibleLineRanges: readonly LineRange[]; + readonly stabilized: boolean; +} + +class AttachedViewImpl implements IAttachedView { + constructor(private readonly handleStateChange: (state: IAttachedViewState) => void) { } + + setVisibleLines(visibleLines: { startLineNumber: number; endLineNumber: number }[], stabilized: boolean): void { + const visibleLineRanges = visibleLines.map((line) => new LineRange(line.startLineNumber, line.endLineNumber + 1)); + this.handleStateChange({ visibleLineRanges, stabilized }); + } +} + + +export class AttachedViewHandler extends Disposable { + private readonly runner = this._register(new RunOnceScheduler(() => this.update(), 50)); + + private _computedLineRanges: readonly LineRange[] = []; + private _lineRanges: readonly LineRange[] = []; + public get lineRanges(): readonly LineRange[] { return this._lineRanges; } + + constructor(private readonly _refreshTokens: () => void) { + super(); + } + + private update(): void { + if (equals(this._computedLineRanges, this._lineRanges, (a, b) => a.equals(b))) { + return; + } + this._computedLineRanges = this._lineRanges; + this._refreshTokens(); + } + + public handleStateChange(state: IAttachedViewState): void { + this._lineRanges = state.visibleLineRanges; + if (state.stabilized) { + this.runner.cancel(); + this.update(); + } else { + this.runner.schedule(); + } + } +} + +export abstract class AbstractTokens extends Disposable { + protected _backgroundTokenizationState = BackgroundTokenizationState.InProgress; + public get backgroundTokenizationState(): BackgroundTokenizationState { + return this._backgroundTokenizationState; + } + + protected readonly _onDidChangeBackgroundTokenizationState = this._register(new Emitter()); + /** @internal, should not be exposed by the text model! */ + public readonly onDidChangeBackgroundTokenizationState: Event = this._onDidChangeBackgroundTokenizationState.event; + + protected readonly _onDidChangeTokens = this._register(new Emitter()); + /** @internal, should not be exposed by the text model! */ + public readonly onDidChangeTokens: Event = this._onDidChangeTokens.event; + + constructor( + protected readonly _languageIdCodec: ILanguageIdCodec, + protected readonly _textModel: TextModel, + protected getLanguageId: () => string, + ) { + super(); + } + + public abstract resetTokenization(fireTokenChangeEvent?: boolean): void; + + public abstract handleDidChangeAttached(): void; + + public abstract handleDidChangeContent(e: IModelContentChangedEvent): void; + + public abstract forceTokenization(lineNumber: number): void; + + public abstract hasAccurateTokensForLine(lineNumber: number): boolean; + + public abstract isCheapToTokenize(lineNumber: number): boolean; + + public tokenizeIfCheap(lineNumber: number): void { + if (this.isCheapToTokenize(lineNumber)) { + this.forceTokenization(lineNumber); + } + } + + public abstract getLineTokens(lineNumber: number): LineTokens; + + public abstract getTokenTypeIfInsertingCharacter(lineNumber: number, column: number, character: string): StandardTokenType; + + public abstract tokenizeLineWithEdit(lineNumber: number, edit: LineEditWithAdditionalLines): ITokenizeLineWithEditResult; + + public abstract get hasTokens(): boolean; +} diff --git a/src/vs/editor/common/model/treeSitterTokens.ts b/src/vs/editor/common/model/treeSitterTokens.ts new file mode 100644 index 00000000000..9ded03f56cd --- /dev/null +++ b/src/vs/editor/common/model/treeSitterTokens.ts @@ -0,0 +1,100 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { ILanguageIdCodec, ITreeSitterTokenizationSupport, TreeSitterTokenizationRegistry } from '../languages.js'; +import { LineTokens } from '../tokens/lineTokens.js'; +import { StandardTokenType } from '../encodedTokenAttributes.js'; +import { TextModel } from './textModel.js'; +import { ITreeSitterParserService } from '../services/treeSitterParserService.js'; +import { IModelContentChangedEvent } from '../textModelEvents.js'; +import { AbstractTokens } from './tokens.js'; +import { ITokenizeLineWithEditResult, LineEditWithAdditionalLines } from '../tokenizationTextModelPart.js'; + +export class TreeSitterTokens extends AbstractTokens { + private _tokenizationSupport: ITreeSitterTokenizationSupport | null = null; + private _lastLanguageId: string | undefined; + + constructor(private readonly _treeSitterService: ITreeSitterParserService, + languageIdCodec: ILanguageIdCodec, + textModel: TextModel, + languageId: () => string) { + super(languageIdCodec, textModel, languageId); + + this._initialize(); + } + + private _initialize() { + const newLanguage = this.getLanguageId(); + if (!this._tokenizationSupport || this._lastLanguageId !== newLanguage) { + this._lastLanguageId = newLanguage; + this._tokenizationSupport = TreeSitterTokenizationRegistry.get(newLanguage); + } + } + + public getLineTokens(lineNumber: number): LineTokens { + const content = this._textModel.getLineContent(lineNumber); + if (this._tokenizationSupport) { + const rawTokens = this._tokenizationSupport.tokenizeEncoded(lineNumber, this._textModel); + if (rawTokens) { + return new LineTokens(rawTokens, content, this._languageIdCodec); + } + } + return LineTokens.createEmpty(content, this._languageIdCodec); + } + + public resetTokenization(fireTokenChangeEvent: boolean = true): void { + if (fireTokenChangeEvent) { + this._onDidChangeTokens.fire({ + semanticTokensApplied: false, + ranges: [ + { + fromLineNumber: 1, + toLineNumber: this._textModel.getLineCount(), + }, + ], + }); + } + this._initialize(); + } + + public override handleDidChangeAttached(): void { + // TODO @alexr00 implement for background tokenization + } + + public override handleDidChangeContent(e: IModelContentChangedEvent): void { + if (e.isFlush) { + // Don't fire the event, as the view might not have got the text change event yet + this.resetTokenization(false); + } + } + + public override forceTokenization(lineNumber: number): void { + // TODO @alexr00 implement + } + + public override hasAccurateTokensForLine(lineNumber: number): boolean { + // TODO @alexr00 update for background tokenization + return true; + } + + public override isCheapToTokenize(lineNumber: number): boolean { + // TODO @alexr00 update for background tokenization + return true; + } + + public override getTokenTypeIfInsertingCharacter(lineNumber: number, column: number, character: string): StandardTokenType { + // TODO @alexr00 implement once we have custom parsing and don't just feed in the whole text model value + return StandardTokenType.Other; + } + public override tokenizeLineWithEdit(lineNumber: number, edit: LineEditWithAdditionalLines): ITokenizeLineWithEditResult { + // TODO @alexr00 understand what this is for and implement + return { mainLineTokens: null, additionalLines: null }; + } + public override get hasTokens(): boolean { + // TODO @alexr00 once we have a token store, implement properly + const hasTree = this._treeSitterService.getParseResult(this._textModel) !== undefined; + return hasTree; + } +} diff --git a/src/vs/editor/common/model/utils.ts b/src/vs/editor/common/model/utils.ts index 96148dfdeea..5fde2c377c1 100644 --- a/src/vs/editor/common/model/utils.ts +++ b/src/vs/editor/common/model/utils.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; +import { CharCode } from '../../../base/common/charCode.js'; /** * Returns: diff --git a/src/vs/editor/common/modelLineProjectionData.ts b/src/vs/editor/common/modelLineProjectionData.ts index 78d14ef17de..f35a4adc6e5 100644 --- a/src/vs/editor/common/modelLineProjectionData.ts +++ b/src/vs/editor/common/modelLineProjectionData.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { assertNever } from 'vs/base/common/assert'; -import { WrappingIndent } from 'vs/editor/common/config/editorOptions'; -import { FontInfo } from 'vs/editor/common/config/fontInfo'; -import { Position } from 'vs/editor/common/core/position'; -import { InjectedTextCursorStops, InjectedTextOptions, PositionAffinity } from 'vs/editor/common/model'; -import { LineInjectedText } from 'vs/editor/common/textModelEvents'; +import { assertNever } from '../../base/common/assert.js'; +import { WrappingIndent } from './config/editorOptions.js'; +import { FontInfo } from './config/fontInfo.js'; +import { Position } from './core/position.js'; +import { InjectedTextCursorStops, InjectedTextOptions, PositionAffinity } from './model.js'; +import { LineInjectedText } from './textModelEvents.js'; /** * *input*: diff --git a/src/vs/editor/common/services/csEvents.ts b/src/vs/editor/common/services/csEvents.ts index a2e21acf9a9..6bf97bc920f 100644 --- a/src/vs/editor/common/services/csEvents.ts +++ b/src/vs/editor/common/services/csEvents.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { SymbolNavigationEvent } from 'vs/editor/common/model/csEvents'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { SymbolNavigationEvent } from '../model/csEvents.js'; export interface ICSEventHandler { reportSymbolNavigation(event: SymbolNavigationEvent): void; diff --git a/src/vs/editor/common/services/csEventsService.ts b/src/vs/editor/common/services/csEventsService.ts index 9d5f602822d..3f428203f8b 100644 --- a/src/vs/editor/common/services/csEventsService.ts +++ b/src/vs/editor/common/services/csEventsService.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { SymbolNavigationEvent } from 'vs/editor/common/model/csEvents'; -import { ICSEventHandler, ICSEventsService } from 'vs/editor/common/services/csEvents'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; +import { SymbolNavigationEvent } from '../model/csEvents.js'; +import { ICSEventHandler, ICSEventsService } from './csEvents.js'; export class CSEventsService implements ICSEventsService { declare readonly _serviceBrand: undefined; diff --git a/src/vs/editor/common/services/editorBaseApi.ts b/src/vs/editor/common/services/editorBaseApi.ts index 3a27abbaf7a..6fbc1c4df93 100644 --- a/src/vs/editor/common/services/editorBaseApi.ts +++ b/src/vs/editor/common/services/editorBaseApi.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Emitter } from 'vs/base/common/event'; -import { KeyChord, KeyMod as ConstKeyMod } from 'vs/base/common/keyCodes'; -import { URI } from 'vs/base/common/uri'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Token } from 'vs/editor/common/languages'; -import * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums'; +import { CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { Emitter } from '../../../base/common/event.js'; +import { KeyChord, KeyMod as ConstKeyMod } from '../../../base/common/keyCodes.js'; +import { URI } from '../../../base/common/uri.js'; +import { Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { Selection } from '../core/selection.js'; +import { Token } from '../languages.js'; +import * as standaloneEnums from '../standalone/standaloneEnums.js'; export class KeyMod { public static readonly CtrlCmd: number = ConstKeyMod.CtrlCmd; diff --git a/src/vs/editor/common/services/editorSimpleWorker.esm.ts b/src/vs/editor/common/services/editorSimpleWorker.esm.ts new file mode 100644 index 00000000000..8d0e18738f4 --- /dev/null +++ b/src/vs/editor/common/services/editorSimpleWorker.esm.ts @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { create } from './editorSimpleWorker.js'; +import { bootstrapSimpleEditorWorker } from './editorWorkerBootstrap.js'; + +bootstrapSimpleEditorWorker(create); diff --git a/src/vs/editor/common/services/editorSimpleWorker.ts b/src/vs/editor/common/services/editorSimpleWorker.ts index 195a870b0af..ff8bbb85464 100644 --- a/src/vs/editor/common/services/editorSimpleWorker.ts +++ b/src/vs/editor/common/services/editorSimpleWorker.ts @@ -3,32 +3,41 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { stringDiff } from 'vs/base/common/diff/diff'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { IRequestHandler } from 'vs/base/common/worker/simpleWorker'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { EndOfLineSequence, ITextModel } from 'vs/editor/common/model'; -import { IMirrorTextModel, IModelChangedEvent, MirrorTextModel as BaseMirrorModel } from 'vs/editor/common/model/mirrorTextModel'; -import { ensureValidWordDefinition, getWordAtText, IWordAtPosition } from 'vs/editor/common/core/wordHelper'; -import { IColorInformation, IInplaceReplaceSupportResult, ILink, TextEdit } from 'vs/editor/common/languages'; -import { ILinkComputerTarget, computeLinks } from 'vs/editor/common/languages/linkComputer'; -import { BasicInplaceReplace } from 'vs/editor/common/languages/supports/inplaceReplaceSupport'; -import { DiffAlgorithmName, IDiffComputationResult, ILineChange, IUnicodeHighlightsResult } from 'vs/editor/common/services/editorWorker'; -import { createMonacoBaseAPI } from 'vs/editor/common/services/editorBaseApi'; -import { IEditorWorkerHost } from 'vs/editor/common/services/editorWorkerHost'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { UnicodeTextModelHighlighter, UnicodeHighlighterOptions } from 'vs/editor/common/services/unicodeTextModelHighlighter'; -import { DiffComputer, IChange } from 'vs/editor/common/diff/legacyLinesDiffComputer'; -import { ILinesDiffComputer, ILinesDiffComputerOptions } from 'vs/editor/common/diff/linesDiffComputer'; -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 { BugIndicatingError } from 'vs/base/common/errors'; -import { IDocumentColorComputerTarget, computeDefaultDocumentColors } from 'vs/editor/common/languages/defaultDocumentColorsComputer'; -import { FindSectionHeaderOptions, SectionHeader, findSectionHeaders } from 'vs/editor/common/services/findSectionHeaders'; +import { stringDiff } from '../../../base/common/diff/diff.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { IRequestHandler, IWorkerServer } from '../../../base/common/worker/simpleWorker.js'; +import { Position } from '../core/position.js'; +import { IRange, Range } from '../core/range.js'; +import { EndOfLineSequence, ITextModel } from '../model.js'; +import { IMirrorTextModel, IModelChangedEvent } from '../model/mirrorTextModel.js'; +import { IColorInformation, IInplaceReplaceSupportResult, ILink, TextEdit } from '../languages.js'; +import { computeLinks } from '../languages/linkComputer.js'; +import { BasicInplaceReplace } from '../languages/supports/inplaceReplaceSupport.js'; +import { DiffAlgorithmName, IDiffComputationResult, ILineChange, IUnicodeHighlightsResult } from './editorWorker.js'; +import { createMonacoBaseAPI } from './editorBaseApi.js'; +import { EditorWorkerHost } from './editorWorkerHost.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { UnicodeTextModelHighlighter, UnicodeHighlighterOptions } from './unicodeTextModelHighlighter.js'; +import { DiffComputer, IChange } from '../diff/legacyLinesDiffComputer.js'; +import { ILinesDiffComputer, ILinesDiffComputerOptions } from '../diff/linesDiffComputer.js'; +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; +// ESM-comment-end +// ESM-uncomment-begin +const isESM = true; +// ESM-uncomment-end export interface IMirrorModel extends IMirrorTextModel { readonly uri: URI; @@ -47,43 +56,11 @@ export interface IWorkerContext { getMirrorModels(): IMirrorModel[]; } -/** - * @internal - */ -export interface IRawModelData { - url: string; - versionId: number; - lines: string[]; - EOL: string; -} - -/** - * @internal - */ -export interface ICommonModel extends ILinkComputerTarget, IDocumentColorComputerTarget, IMirrorModel { - uri: URI; - version: number; - eol: string; - getValue(): string; - - getLinesContent(): string[]; - getLineCount(): number; - getLineContent(lineNumber: number): string; - getLineWords(lineNumber: number, wordDefinition: RegExp): IWordAtPosition[]; - words(wordDefinition: RegExp): Iterable; - getWordUntilPosition(position: IPosition, wordDefinition: RegExp): IWordAtPosition; - getValueInRange(range: IRange): string; - getWordAtPosition(position: IPosition, wordDefinition: RegExp): Range | null; - offsetAt(position: IPosition): number; - positionAt(offset: number): IPosition; - findMatches(regex: RegExp): RegExpMatchArray[]; -} - /** * Range of a word inside a model. * @internal */ -interface IWordRange { +export interface IWordRange { /** * The index where the word starts. */ @@ -94,246 +71,6 @@ interface IWordRange { readonly end: number; } -/** - * @internal - */ -class MirrorModel extends BaseMirrorModel implements ICommonModel { - - public get uri(): URI { - return this._uri; - } - - public get eol(): string { - return this._eol; - } - - public getValue(): string { - return this.getText(); - } - - public findMatches(regex: RegExp): RegExpMatchArray[] { - const matches = []; - for (let i = 0; i < this._lines.length; i++) { - const line = this._lines[i]; - const offsetToAdd = this.offsetAt(new Position(i + 1, 1)); - const iteratorOverMatches = line.matchAll(regex); - for (const match of iteratorOverMatches) { - if (match.index || match.index === 0) { - match.index = match.index + offsetToAdd; - } - matches.push(match); - } - } - return matches; - } - - public getLinesContent(): string[] { - return this._lines.slice(0); - } - - public getLineCount(): number { - return this._lines.length; - } - - public getLineContent(lineNumber: number): string { - return this._lines[lineNumber - 1]; - } - - public getWordAtPosition(position: IPosition, wordDefinition: RegExp): Range | null { - - const wordAtText = getWordAtText( - position.column, - ensureValidWordDefinition(wordDefinition), - this._lines[position.lineNumber - 1], - 0 - ); - - if (wordAtText) { - return new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); - } - - return null; - } - - public getWordUntilPosition(position: IPosition, wordDefinition: RegExp): IWordAtPosition { - const wordAtPosition = this.getWordAtPosition(position, wordDefinition); - if (!wordAtPosition) { - return { - word: '', - startColumn: position.column, - endColumn: position.column - }; - } - return { - word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), - startColumn: wordAtPosition.startColumn, - endColumn: position.column - }; - } - - - public words(wordDefinition: RegExp): Iterable { - - const lines = this._lines; - const wordenize = this._wordenize.bind(this); - - let lineNumber = 0; - let lineText = ''; - let wordRangesIdx = 0; - let wordRanges: IWordRange[] = []; - - return { - *[Symbol.iterator]() { - while (true) { - if (wordRangesIdx < wordRanges.length) { - const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); - wordRangesIdx += 1; - yield value; - } else { - if (lineNumber < lines.length) { - lineText = lines[lineNumber]; - wordRanges = wordenize(lineText, wordDefinition); - wordRangesIdx = 0; - lineNumber += 1; - } else { - break; - } - } - } - } - }; - } - - public getLineWords(lineNumber: number, wordDefinition: RegExp): IWordAtPosition[] { - const content = this._lines[lineNumber - 1]; - const ranges = this._wordenize(content, wordDefinition); - const words: IWordAtPosition[] = []; - for (const range of ranges) { - words.push({ - word: content.substring(range.start, range.end), - startColumn: range.start + 1, - endColumn: range.end + 1 - }); - } - return words; - } - - private _wordenize(content: string, wordDefinition: RegExp): IWordRange[] { - const result: IWordRange[] = []; - let match: RegExpExecArray | null; - - wordDefinition.lastIndex = 0; // reset lastIndex just to be sure - - while (match = wordDefinition.exec(content)) { - if (match[0].length === 0) { - // it did match the empty string - break; - } - result.push({ start: match.index, end: match.index + match[0].length }); - } - return result; - } - - public getValueInRange(range: IRange): string { - range = this._validateRange(range); - - if (range.startLineNumber === range.endLineNumber) { - return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); - } - - const lineEnding = this._eol; - const startLineIndex = range.startLineNumber - 1; - const endLineIndex = range.endLineNumber - 1; - const resultLines: string[] = []; - - resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); - for (let i = startLineIndex + 1; i < endLineIndex; i++) { - resultLines.push(this._lines[i]); - } - resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); - - return resultLines.join(lineEnding); - } - - public offsetAt(position: IPosition): number { - position = this._validatePosition(position); - this._ensureLineStarts(); - return this._lineStarts!.getPrefixSum(position.lineNumber - 2) + (position.column - 1); - } - - public positionAt(offset: number): IPosition { - offset = Math.floor(offset); - offset = Math.max(0, offset); - - this._ensureLineStarts(); - const out = this._lineStarts!.getIndexOf(offset); - const lineLength = this._lines[out.index].length; - - // Ensure we return a valid position - return { - lineNumber: 1 + out.index, - column: 1 + Math.min(out.remainder, lineLength) - }; - } - - private _validateRange(range: IRange): IRange { - - const start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); - const end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); - - if (start.lineNumber !== range.startLineNumber - || start.column !== range.startColumn - || end.lineNumber !== range.endLineNumber - || end.column !== range.endColumn) { - - return { - startLineNumber: start.lineNumber, - startColumn: start.column, - endLineNumber: end.lineNumber, - endColumn: end.column - }; - } - - return range; - } - - private _validatePosition(position: IPosition): IPosition { - if (!Position.isIPosition(position)) { - throw new Error('bad position'); - } - let { lineNumber, column } = position; - let hasChanged = false; - - if (lineNumber < 1) { - lineNumber = 1; - column = 1; - hasChanged = true; - - } else if (lineNumber > this._lines.length) { - lineNumber = this._lines.length; - column = this._lines[lineNumber - 1].length + 1; - hasChanged = true; - - } else { - const maxCharacter = this._lines[lineNumber - 1].length + 1; - if (column < 1) { - column = 1; - hasChanged = true; - } - else if (column > maxCharacter) { - column = maxCharacter; - hasChanged = true; - } - } - - if (!hasChanged) { - return position; - } else { - return { lineNumber, column }; - } - } -} - /** * @internal */ @@ -346,55 +83,38 @@ declare const require: any; /** * @internal */ -export class EditorSimpleWorker implements IRequestHandler, IDisposable { +export class BaseEditorSimpleWorker implements IDisposable, IWorkerTextModelSyncChannelServer, IRequestHandler { _requestHandlerBrand: any; - protected readonly _host: IEditorWorkerHost; - private _models: { [uri: string]: MirrorModel }; - private readonly _foreignModuleFactory: IForeignModuleFactory | null; - private _foreignModule: any; + private readonly _workerTextModelSyncServer = new WorkerTextModelSyncServer(); - constructor(host: IEditorWorkerHost, foreignModuleFactory: IForeignModuleFactory | null) { - this._host = host; - this._models = Object.create(null); - this._foreignModuleFactory = foreignModuleFactory; - this._foreignModule = null; + constructor() { } - public dispose(): void { - this._models = Object.create(null); + dispose(): void { } - protected _getModel(uri: string): ICommonModel { - return this._models[uri]; + protected _getModel(uri: string): ICommonModel | undefined { + return this._workerTextModelSyncServer.getModel(uri); } - private _getModels(): ICommonModel[] { - const all: MirrorModel[] = []; - Object.keys(this._models).forEach((key) => all.push(this._models[key])); - return all; + protected _getModels(): ICommonModel[] { + return this._workerTextModelSyncServer.getModels(); } - public acceptNewModel(data: IRawModelData): void { - this._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId); + public $acceptNewModel(data: IRawModelData): void { + this._workerTextModelSyncServer.$acceptNewModel(data); } - public acceptModelChanged(strURL: string, e: IModelChangedEvent): void { - if (!this._models[strURL]) { - return; - } - const model = this._models[strURL]; - model.onEvents(e); + public $acceptModelChanged(uri: string, e: IModelChangedEvent): void { + this._workerTextModelSyncServer.$acceptModelChanged(uri, e); } - public acceptRemovedModel(strURL: string): void { - if (!this._models[strURL]) { - return; - } - delete this._models[strURL]; + public $acceptRemovedModel(uri: string): void { + this._workerTextModelSyncServer.$acceptRemovedModel(uri); } - public async computeUnicodeHighlights(url: string, options: UnicodeHighlighterOptions, range?: IRange): Promise { + public async $computeUnicodeHighlights(url: string, options: UnicodeHighlighterOptions, range?: IRange): Promise { const model = this._getModel(url); if (!model) { return { ranges: [], hasMore: false, ambiguousCharacterCount: 0, invisibleCharacterCount: 0, nonBasicAsciiCharacterCount: 0 }; @@ -402,7 +122,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { return UnicodeTextModelHighlighter.computeUnicodeHighlights(model, options, range); } - public async findSectionHeaders(url: string, options: FindSectionHeaderOptions): Promise { + public async $findSectionHeaders(url: string, options: FindSectionHeaderOptions): Promise { const model = this._getModel(url); if (!model) { return []; @@ -412,7 +132,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { // ---- BEGIN diff -------------------------------------------------------------------------- - public async computeDiff(originalUrl: string, modifiedUrl: string, options: IDocumentDiffProviderOptions, algorithm: DiffAlgorithmName): Promise { + public async $computeDiff(originalUrl: string, modifiedUrl: string, options: IDocumentDiffProviderOptions, algorithm: DiffAlgorithmName): Promise { const original = this._getModel(originalUrl); const modified = this._getModel(modifiedUrl); if (!original || !modified) { @@ -476,7 +196,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { return true; } - public async computeDirtyDiff(originalUrl: string, modifiedUrl: string, ignoreTrimWhitespace: boolean): Promise { + public async $computeDirtyDiff(originalUrl: string, modifiedUrl: string, ignoreTrimWhitespace: boolean): Promise { const original = this._getModel(originalUrl); const modified = this._getModel(modifiedUrl); if (!original || !modified) { @@ -502,7 +222,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { private static readonly _diffLimit = 100000; - public async computeMoreMinimalEdits(modelUrl: string, edits: TextEdit[], pretty: boolean): Promise { + public async $computeMoreMinimalEdits(modelUrl: string, edits: TextEdit[], pretty: boolean): Promise { const model = this._getModel(modelUrl); if (!model) { return edits; @@ -584,7 +304,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { return result; } - public computeHumanReadableDiff(modelUrl: string, edits: TextEdit[], options: ILinesDiffComputerOptions): TextEdit[] { + public $computeHumanReadableDiff(modelUrl: string, edits: TextEdit[], options: ILinesDiffComputerOptions): TextEdit[] { const model = this._getModel(modelUrl); if (!model) { return edits; @@ -684,7 +404,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { // ---- END minimal edits --------------------------------------------------------------- - public async computeLinks(modelUrl: string): Promise { + public async $computeLinks(modelUrl: string): Promise { const model = this._getModel(modelUrl); if (!model) { return null; @@ -695,7 +415,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { // --- BEGIN default document colors ----------------------------------------------------------- - public async computeDefaultDocumentColors(modelUrl: string): Promise { + public async $computeDefaultDocumentColors(modelUrl: string): Promise { const model = this._getModel(modelUrl); if (!model) { return null; @@ -707,7 +427,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { private static readonly _suggestionsLimit = 10000; - public async textualSuggest(modelUrls: string[], leadingWord: string | undefined, wordDef: string, wordDefFlags: string): Promise<{ words: string[]; duration: number } | null> { + public async $textualSuggest(modelUrls: string[], leadingWord: string | undefined, wordDef: string, wordDefFlags: string): Promise<{ words: string[]; duration: number } | null> { const sw = new StopWatch(); const wordDefRegExp = new RegExp(wordDef, wordDefFlags); @@ -738,7 +458,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { //#region -- word ranges -- - public async computeWordRanges(modelUrl: string, range: IRange, wordDef: string, wordDefFlags: string): Promise<{ [word: string]: IRange[] }> { + public async $computeWordRanges(modelUrl: string, range: IRange, wordDef: string, wordDefFlags: string): Promise<{ [word: string]: IRange[] }> { const model = this._getModel(modelUrl); if (!model) { return Object.create(null); @@ -769,7 +489,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { //#endregion - public async navigateValueSet(modelUrl: string, range: IRange, up: boolean, wordDef: string, wordDefFlags: string): Promise { + public async $navigateValueSet(modelUrl: string, range: IRange, up: boolean, wordDef: string, wordDefFlags: string): Promise { const model = this._getModel(modelUrl); if (!model) { return null; @@ -796,12 +516,31 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { const result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); return result; } +} + +/** + * @internal + */ +export class EditorSimpleWorker extends BaseEditorSimpleWorker { + + private _foreignModule: any = null; + + constructor( + private readonly _host: EditorWorkerHost, + private readonly _foreignModuleFactory: IForeignModuleFactory | null + ) { + super(); + } + + public async $ping() { + return 'pong'; + } // ---- BEGIN foreign module support -------------------------------------------------------------------------- - public loadForeignModule(moduleId: string, createData: any, foreignHostMethods: string[]): Promise { + public $loadForeignModule(moduleId: string, createData: any, foreignHostMethods: string[]): Promise { const proxyMethodRequest = (method: string, args: any[]): Promise => { - return this._host.fhr(method, args); + return this._host.$fhr(method, args); }; const foreignHost = createProxyObject(foreignHostMethods, proxyMethodRequest); @@ -818,24 +557,25 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { // static foreing module return Promise.resolve(getAllMethodNames(this._foreignModule)); } - // ESM-comment-begin + return new Promise((resolve, reject) => { - require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { - this._foreignModule = foreignModule.create(ctx, createData); + const onModuleCallback = (foreignModule: { create: IForeignModuleFactory }) => { + this._foreignModule = foreignModule.create(ctx, createData); resolve(getAllMethodNames(this._foreignModule)); + }; - }, reject); + if (!isESM) { + require([`${moduleId}`], onModuleCallback, reject); + } else { + const url = FileAccess.asBrowserUri(`${moduleId}.js` as AppResourcePath).toString(true); + import(`${url}`).then(onModuleCallback).catch(reject); + } }); - // ESM-comment-end - - // ESM-uncomment-begin - // return Promise.reject(new Error(`Unexpected usage`)); - // ESM-uncomment-end } // foreign method request - public fmr(method: string, args: any[]): Promise { + public $fmr(method: string, args: any[]): Promise { if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { return Promise.reject(new Error('Missing requestHandler or method: ' + method)); } @@ -851,11 +591,12 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable { } /** - * Called on the worker side + * Defines the worker entry point. Must be exported and named `create`. + * @skipMangle * @internal */ -export function create(host: IEditorWorkerHost): IRequestHandler { - return new EditorSimpleWorker(host, null); +export function create(workerServer: IWorkerServer): IRequestHandler { + return new EditorSimpleWorker(EditorWorkerHost.getChannel(workerServer), null); } // This is only available in a Web Worker diff --git a/src/vs/editor/common/services/editorWorker.ts b/src/vs/editor/common/services/editorWorker.ts index 7e87024cafc..c7b03cd784c 100644 --- a/src/vs/editor/common/services/editorWorker.ts +++ b/src/vs/editor/common/services/editorWorker.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { IRange } from 'vs/editor/common/core/range'; -import { IDocumentDiff, IDocumentDiffProviderOptions } from 'vs/editor/common/diff/documentDiffProvider'; -import { IChange } from 'vs/editor/common/diff/legacyLinesDiffComputer'; -import { IInplaceReplaceSupportResult, TextEdit } from 'vs/editor/common/languages'; -import { UnicodeHighlighterOptions } from 'vs/editor/common/services/unicodeTextModelHighlighter'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import type { EditorSimpleWorker } from 'vs/editor/common/services/editorSimpleWorker'; -import { SectionHeader, FindSectionHeaderOptions } from 'vs/editor/common/services/findSectionHeaders'; +import { URI } from '../../../base/common/uri.js'; +import { IRange } from '../core/range.js'; +import { IDocumentDiff, IDocumentDiffProviderOptions } from '../diff/documentDiffProvider.js'; +import { IChange } from '../diff/legacyLinesDiffComputer.js'; +import { IColorInformation, IInplaceReplaceSupportResult, TextEdit } from '../languages.js'; +import { UnicodeHighlighterOptions } from './unicodeTextModelHighlighter.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import type { BaseEditorSimpleWorker } from './editorSimpleWorker.js'; +import { SectionHeader, FindSectionHeaderOptions } from './findSectionHeaders.js'; export const IEditorWorkerService = createDecorator('editorWorkerService'); @@ -23,7 +23,7 @@ export interface IEditorWorkerService { canComputeUnicodeHighlights(uri: URI): boolean; computedUnicodeHighlights(uri: URI, options: UnicodeHighlighterOptions, range?: IRange): Promise; - /** Implementation in {@link EditorSimpleWorker.computeDiff} */ + /** Implementation in {@link BaseEditorSimpleWorker.computeDiff} */ computeDiff(original: URI, modified: URI, options: IDocumentDiffProviderOptions, algorithm: DiffAlgorithmName): Promise; canComputeDirtyDiff(original: URI, modified: URI): boolean; @@ -39,6 +39,9 @@ export interface IEditorWorkerService { navigateValueSet(resource: URI, range: IRange, up: boolean): Promise; findSectionHeaders(uri: URI, options: FindSectionHeaderOptions): Promise; + + computeDefaultDocumentColors(uri: URI): Promise; + } export interface IDiffComputationResult { diff --git a/src/vs/editor/common/services/editorWorkerBootstrap.ts b/src/vs/editor/common/services/editorWorkerBootstrap.ts new file mode 100644 index 00000000000..f754fe8fd4a --- /dev/null +++ b/src/vs/editor/common/services/editorWorkerBootstrap.ts @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IWorkerServer, SimpleWorkerServer } from '../../../base/common/worker/simpleWorker.js'; +import { EditorSimpleWorker } from './editorSimpleWorker.js'; +import { EditorWorkerHost } from './editorWorkerHost.js'; + +type MessageEvent = { + data: any; +}; + +declare const globalThis: { + postMessage: (message: any) => void; + onmessage: (event: MessageEvent) => void; +}; + +let initialized = false; + +export function initialize(factory: any) { + if (initialized) { + return; + } + initialized = true; + + const simpleWorker = new SimpleWorkerServer((msg) => { + globalThis.postMessage(msg); + }, (workerServer: IWorkerServer) => new EditorSimpleWorker(EditorWorkerHost.getChannel(workerServer), null)); + + globalThis.onmessage = (e: MessageEvent) => { + simpleWorker.onmessage(e.data); + }; +} + +globalThis.onmessage = (e: MessageEvent) => { + // Ignore first message in this case and initialize if not yet initialized + if (!initialized) { + initialize(null); + } +}; + +type CreateFunction = (ctx: C, data: D) => R; + +export function bootstrapSimpleEditorWorker(createFn: CreateFunction) { + globalThis.onmessage = () => { + initialize((ctx: C, createData: D) => { + return createFn.call(self, ctx, createData); + }); + }; +} diff --git a/src/vs/editor/common/services/editorWorkerHost.ts b/src/vs/editor/common/services/editorWorkerHost.ts index df0a6aa1c35..54751e1cebf 100644 --- a/src/vs/editor/common/services/editorWorkerHost.ts +++ b/src/vs/editor/common/services/editorWorkerHost.ts @@ -3,7 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -export interface IEditorWorkerHost { +import { IWorkerServer, IWorkerClient } from '../../../base/common/worker/simpleWorker.js'; + +export abstract class EditorWorkerHost { + public static CHANNEL_NAME = 'editorWorkerHost'; + public static getChannel(workerServer: IWorkerServer): EditorWorkerHost { + return workerServer.getChannel(EditorWorkerHost.CHANNEL_NAME); + } + public static setChannel(workerClient: IWorkerClient, obj: EditorWorkerHost): void { + workerClient.setChannel(EditorWorkerHost.CHANNEL_NAME, obj); + } + // foreign host request - fhr(method: string, args: any[]): Promise; + abstract $fhr(method: string, args: any[]): Promise; } diff --git a/src/vs/editor/common/services/findSectionHeaders.ts b/src/vs/editor/common/services/findSectionHeaders.ts index 8e03723d0dd..9c80a3a22df 100644 --- a/src/vs/editor/common/services/findSectionHeaders.ts +++ b/src/vs/editor/common/services/findSectionHeaders.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IRange } from 'vs/editor/common/core/range'; -import { FoldingRules } from 'vs/editor/common/languages/languageConfiguration'; +import { IRange } from '../core/range.js'; +import { FoldingRules } from '../languages/languageConfiguration.js'; export interface ISectionHeaderFinderTarget { getLineCount(): number; diff --git a/src/vs/editor/common/services/getIconClasses.ts b/src/vs/editor/common/services/getIconClasses.ts index 52a1e2633e6..61fd63dc827 100644 --- a/src/vs/editor/common/services/getIconClasses.ts +++ b/src/vs/editor/common/services/getIconClasses.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Schemas } from 'vs/base/common/network'; -import { DataUri } from 'vs/base/common/resources'; -import { URI, URI as uri } from 'vs/base/common/uri'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IModelService } from 'vs/editor/common/services/model'; -import { FileKind } from 'vs/platform/files/common/files'; -import { ThemeIcon } from 'vs/base/common/themables'; +import { Schemas } from '../../../base/common/network.js'; +import { DataUri } from '../../../base/common/resources.js'; +import { URI, URI as uri } from '../../../base/common/uri.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../languages/modesRegistry.js'; +import { ILanguageService } from '../languages/language.js'; +import { IModelService } from './model.js'; +import { FileKind } from '../../../platform/files/common/files.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; const fileIconDirectoryRegex = /(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/; @@ -123,5 +123,5 @@ function detectLanguageId(modelService: IModelService, languageService: ILanguag } function cssEscape(str: string): string { - return str.replace(/[\x11\x12\x14\x15\x40]/g, '/'); // HTML class names can not contain certain whitespace characters, use / instead, which doesn't exist in file names. + return str.replace(/[\s]/g, '/'); // HTML class names can not contain certain whitespace characters (https://dom.spec.whatwg.org/#interface-domtokenlist), use / instead, which doesn't exist in file names. } diff --git a/src/vs/editor/common/services/languageFeatureDebounce.ts b/src/vs/editor/common/services/languageFeatureDebounce.ts index 5f82d301a61..f4a2b3b4d55 100644 --- a/src/vs/editor/common/services/languageFeatureDebounce.ts +++ b/src/vs/editor/common/services/languageFeatureDebounce.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { doHash } from 'vs/base/common/hash'; -import { LRUCache } from 'vs/base/common/map'; -import { clamp, MovingAverage, SlidingWindowAverage } from 'vs/base/common/numbers'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ITextModel } from 'vs/editor/common/model'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { matchesScheme } from 'vs/base/common/network'; +import { doHash } from '../../../base/common/hash.js'; +import { LRUCache } from '../../../base/common/map.js'; +import { clamp, MovingAverage, SlidingWindowAverage } from '../../../base/common/numbers.js'; +import { LanguageFeatureRegistry } from '../languageFeatureRegistry.js'; +import { ITextModel } from '../model.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; +import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { matchesScheme } from '../../../base/common/network.js'; export const ILanguageFeatureDebounceService = createDecorator('ILanguageFeatureDebounceService'); diff --git a/src/vs/editor/common/services/languageFeatures.ts b/src/vs/editor/common/services/languageFeatures.ts index 205d1b86f10..13977f1c1f6 100644 --- a/src/vs/editor/common/services/languageFeatures.ts +++ b/src/vs/editor/common/services/languageFeatures.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { LanguageFeatureRegistry, NotebookInfoResolver } from 'vs/editor/common/languageFeatureRegistry'; -import { CodeActionProvider, CodeLensProvider, CompletionItemProvider, DeclarationProvider, DefinitionProvider, DocumentColorProvider, DocumentFormattingEditProvider, DocumentHighlightProvider, DocumentDropEditProvider, DocumentPasteEditProvider, DocumentRangeFormattingEditProvider, DocumentRangeSemanticTokensProvider, DocumentSemanticTokensProvider, DocumentSymbolProvider, EvaluatableExpressionProvider, FoldingRangeProvider, HoverProvider, ImplementationProvider, InlayHintsProvider, InlineCompletionsProvider, InlineValuesProvider, LinkedEditingRangeProvider, LinkProvider, MappedEditsProvider, MultiDocumentHighlightProvider, NewSymbolNamesProvider, OnTypeFormattingEditProvider, ReferenceProvider, RenameProvider, SelectionRangeProvider, SignatureHelpProvider, TypeDefinitionProvider, InlineEditProvider } from 'vs/editor/common/languages'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { LanguageFeatureRegistry, NotebookInfoResolver } from '../languageFeatureRegistry.js'; +import { CodeActionProvider, CodeLensProvider, CompletionItemProvider, DeclarationProvider, DefinitionProvider, DocumentColorProvider, DocumentFormattingEditProvider, DocumentHighlightProvider, DocumentDropEditProvider, DocumentPasteEditProvider, DocumentRangeFormattingEditProvider, DocumentRangeSemanticTokensProvider, DocumentSemanticTokensProvider, DocumentSymbolProvider, EvaluatableExpressionProvider, FoldingRangeProvider, HoverProvider, ImplementationProvider, InlayHintsProvider, InlineCompletionsProvider, InlineValuesProvider, LinkedEditingRangeProvider, LinkProvider, MappedEditsProvider, MultiDocumentHighlightProvider, NewSymbolNamesProvider, OnTypeFormattingEditProvider, ReferenceProvider, RenameProvider, SelectionRangeProvider, SignatureHelpProvider, TypeDefinitionProvider, InlineEditProvider } from '../languages.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; export const ILanguageFeaturesService = createDecorator('ILanguageFeaturesService'); diff --git a/src/vs/editor/common/services/languageFeaturesService.ts b/src/vs/editor/common/services/languageFeaturesService.ts index 2b1384ba099..5c8d6de6919 100644 --- a/src/vs/editor/common/services/languageFeaturesService.ts +++ b/src/vs/editor/common/services/languageFeaturesService.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { LanguageFeatureRegistry, NotebookInfo, NotebookInfoResolver } from 'vs/editor/common/languageFeatureRegistry'; -import { CodeActionProvider, CodeLensProvider, CompletionItemProvider, DocumentPasteEditProvider, DeclarationProvider, DefinitionProvider, DocumentColorProvider, DocumentFormattingEditProvider, MultiDocumentHighlightProvider, DocumentHighlightProvider, DocumentDropEditProvider, DocumentRangeFormattingEditProvider, DocumentRangeSemanticTokensProvider, DocumentSemanticTokensProvider, DocumentSymbolProvider, EvaluatableExpressionProvider, FoldingRangeProvider, HoverProvider, ImplementationProvider, InlayHintsProvider, InlineCompletionsProvider, InlineValuesProvider, LinkedEditingRangeProvider, LinkProvider, OnTypeFormattingEditProvider, ReferenceProvider, RenameProvider, SelectionRangeProvider, SignatureHelpProvider, TypeDefinitionProvider, MappedEditsProvider, NewSymbolNamesProvider, InlineEditProvider } from 'vs/editor/common/languages'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { URI } from '../../../base/common/uri.js'; +import { LanguageFeatureRegistry, NotebookInfo, NotebookInfoResolver } from '../languageFeatureRegistry.js'; +import { CodeActionProvider, CodeLensProvider, CompletionItemProvider, DocumentPasteEditProvider, DeclarationProvider, DefinitionProvider, DocumentColorProvider, DocumentFormattingEditProvider, MultiDocumentHighlightProvider, DocumentHighlightProvider, DocumentDropEditProvider, DocumentRangeFormattingEditProvider, DocumentRangeSemanticTokensProvider, DocumentSemanticTokensProvider, DocumentSymbolProvider, EvaluatableExpressionProvider, FoldingRangeProvider, HoverProvider, ImplementationProvider, InlayHintsProvider, InlineCompletionsProvider, InlineValuesProvider, LinkedEditingRangeProvider, LinkProvider, OnTypeFormattingEditProvider, ReferenceProvider, RenameProvider, SelectionRangeProvider, SignatureHelpProvider, TypeDefinitionProvider, MappedEditsProvider, NewSymbolNamesProvider, InlineEditProvider } from '../languages.js'; +import { ILanguageFeaturesService } from './languageFeatures.js'; +import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; export class LanguageFeaturesService implements ILanguageFeaturesService { diff --git a/src/vs/editor/common/services/languageService.ts b/src/vs/editor/common/services/languageService.ts index 6d96f2a2502..dffe6ea3d2f 100644 --- a/src/vs/editor/common/services/languageService.ts +++ b/src/vs/editor/common/services/languageService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { LanguagesRegistry } from 'vs/editor/common/services/languagesRegistry'; -import { ILanguageNameIdPair, ILanguageSelection, ILanguageService, ILanguageIcon, ILanguageExtensionPoint } from 'vs/editor/common/languages/language'; -import { firstOrDefault } from 'vs/base/common/arrays'; -import { ILanguageIdCodec, TokenizationRegistry } from 'vs/editor/common/languages'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { LanguagesRegistry } from './languagesRegistry.js'; +import { ILanguageNameIdPair, ILanguageSelection, ILanguageService, ILanguageIcon, ILanguageExtensionPoint } from '../languages/language.js'; +import { ILanguageIdCodec, TokenizationRegistry } from '../languages.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../languages/modesRegistry.js'; +import { IObservable, observableFromEvent } from '../../../base/common/observable.js'; export class LanguageService extends Disposable implements ILanguageService { public _serviceBrand: undefined; @@ -95,7 +95,7 @@ export class LanguageService extends Disposable implements ILanguageService { public guessLanguageIdByFilepathOrFirstLine(resource: URI | null, firstLine?: string): string | null { const languageIds = this._registry.guessLanguageIdByFilepathOrFirstLine(resource, firstLine); - return firstOrDefault(languageIds, null); + return languageIds.at(0) ?? null; } public createById(languageId: string | null | undefined): ILanguageSelection { @@ -150,51 +150,15 @@ export class LanguageService extends Disposable implements ILanguageService { } class LanguageSelection implements ILanguageSelection { + private readonly _value: IObservable; + public readonly onDidChange: Event; - public languageId: string; - - private _listener: IDisposable | null = null; - private _emitter: Emitter | null = null; - - constructor( - private readonly _onDidChangeLanguages: Event, - private readonly _selector: () => string - ) { - this.languageId = this._selector(); - } - - private _dispose(): void { - if (this._listener) { - this._listener.dispose(); - this._listener = null; - } - if (this._emitter) { - this._emitter.dispose(); - this._emitter = null; - } + constructor(onDidChangeLanguages: Event, selector: () => string) { + this._value = observableFromEvent(this, onDidChangeLanguages, () => selector()); + this.onDidChange = Event.fromObservable(this._value); } - public get onDidChange(): Event { - if (!this._listener) { - this._listener = this._onDidChangeLanguages(() => this._evaluate()); - } - if (!this._emitter) { - this._emitter = new Emitter({ - onDidRemoveLastListener: () => { - this._dispose(); - } - }); - } - return this._emitter.event; - } - - private _evaluate(): void { - const languageId = this._selector(); - if (languageId === this.languageId) { - // no change - return; - } - this.languageId = languageId; - this._emitter?.fire(this.languageId); + public get languageId(): string { + return this._value.get(); } } diff --git a/src/vs/editor/common/services/languagesAssociations.ts b/src/vs/editor/common/services/languagesAssociations.ts index ac7eb2b567b..2bfe45a8746 100644 --- a/src/vs/editor/common/services/languagesAssociations.ts +++ b/src/vs/editor/common/services/languagesAssociations.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ParsedPattern, parse } from 'vs/base/common/glob'; -import { Mimes } from 'vs/base/common/mime'; -import { Schemas } from 'vs/base/common/network'; -import { basename, posix } from 'vs/base/common/path'; -import { DataUri } from 'vs/base/common/resources'; -import { startsWithUTF8BOM } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; +import { ParsedPattern, parse } from '../../../base/common/glob.js'; +import { Mimes } from '../../../base/common/mime.js'; +import { Schemas } from '../../../base/common/network.js'; +import { basename, posix } from '../../../base/common/path.js'; +import { DataUri } from '../../../base/common/resources.js'; +import { startsWithUTF8BOM } from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../languages/modesRegistry.js'; export interface ILanguageAssociation { readonly id: string; diff --git a/src/vs/editor/common/services/languagesRegistry.ts b/src/vs/editor/common/services/languagesRegistry.ts index 9216a625543..3ea71cff4ee 100644 --- a/src/vs/editor/common/services/languagesRegistry.ts +++ b/src/vs/editor/common/services/languagesRegistry.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { compareIgnoreCase, regExpLeadsToEndlessLoop } from 'vs/base/common/strings'; -import { clearPlatformLanguageAssociations, getLanguageIds, registerPlatformLanguageAssociation } from 'vs/editor/common/services/languagesAssociations'; -import { URI } from 'vs/base/common/uri'; -import { ILanguageIdCodec } from 'vs/editor/common/languages'; -import { LanguageId } from 'vs/editor/common/encodedTokenAttributes'; -import { ModesRegistry, PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { ILanguageExtensionPoint, ILanguageNameIdPair, ILanguageIcon } from 'vs/editor/common/languages/language'; -import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { compareIgnoreCase, regExpLeadsToEndlessLoop } from '../../../base/common/strings.js'; +import { clearPlatformLanguageAssociations, getLanguageIds, registerPlatformLanguageAssociation } from './languagesAssociations.js'; +import { URI } from '../../../base/common/uri.js'; +import { ILanguageIdCodec } from '../languages.js'; +import { LanguageId } from '../encodedTokenAttributes.js'; +import { ModesRegistry, PLAINTEXT_LANGUAGE_ID } from '../languages/modesRegistry.js'; +import { ILanguageExtensionPoint, ILanguageNameIdPair, ILanguageIcon } from '../languages/language.js'; +import { Extensions, IConfigurationRegistry } from '../../../platform/configuration/common/configurationRegistry.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; const hasOwnProperty = Object.prototype.hasOwnProperty; const NULL_LANGUAGE_ID = 'vs.editor.nullLanguage'; diff --git a/src/vs/editor/common/services/markerDecorations.ts b/src/vs/editor/common/services/markerDecorations.ts index 221f72379b3..8b315075c93 100644 --- a/src/vs/editor/common/services/markerDecorations.ts +++ b/src/vs/editor/common/services/markerDecorations.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ITextModel, IModelDecoration } from 'vs/editor/common/model'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IMarker } from 'vs/platform/markers/common/markers'; -import { Event } from 'vs/base/common/event'; -import { Range } from 'vs/editor/common/core/range'; -import { URI } from 'vs/base/common/uri'; +import { ITextModel, IModelDecoration } from '../model.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IMarker } from '../../../platform/markers/common/markers.js'; +import { Event } from '../../../base/common/event.js'; +import { Range } from '../core/range.js'; +import { URI } from '../../../base/common/uri.js'; export const IMarkerDecorationsService = createDecorator('markerDecorationsService'); diff --git a/src/vs/editor/common/services/markerDecorationsService.ts b/src/vs/editor/common/services/markerDecorationsService.ts index de2c54e9e01..7cbd80e89f8 100644 --- a/src/vs/editor/common/services/markerDecorationsService.ts +++ b/src/vs/editor/common/services/markerDecorationsService.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IMarkerService, IMarker, MarkerSeverity, MarkerTag } from 'vs/platform/markers/common/markers'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { IModelDeltaDecoration, ITextModel, IModelDecorationOptions, TrackedRangeStickiness, OverviewRulerLane, IModelDecoration, MinimapPosition, IModelDecorationMinimapOptions } from 'vs/editor/common/model'; -import { ClassName } from 'vs/editor/common/model/intervalTree'; -import { themeColorFromId } from 'vs/platform/theme/common/themeService'; -import { ThemeColor } from 'vs/base/common/themables'; -import { overviewRulerWarning, overviewRulerInfo, overviewRulerError } from 'vs/editor/common/core/editorColorRegistry'; -import { IModelService } from 'vs/editor/common/services/model'; -import { Range } from 'vs/editor/common/core/range'; -import { IMarkerDecorationsService } from 'vs/editor/common/services/markerDecorations'; -import { Schemas } from 'vs/base/common/network'; -import { Emitter, Event } from 'vs/base/common/event'; -import { minimapInfo, minimapWarning, minimapError } from 'vs/platform/theme/common/colorRegistry'; -import { BidirectionalMap, ResourceMap } from 'vs/base/common/map'; -import { diffSets } from 'vs/base/common/collections'; +import { IMarkerService, IMarker, MarkerSeverity, MarkerTag } from '../../../platform/markers/common/markers.js'; +import { Disposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { IModelDeltaDecoration, ITextModel, IModelDecorationOptions, TrackedRangeStickiness, OverviewRulerLane, IModelDecoration, MinimapPosition, IModelDecorationMinimapOptions } from '../model.js'; +import { ClassName } from '../model/intervalTree.js'; +import { themeColorFromId } from '../../../platform/theme/common/themeService.js'; +import { ThemeColor } from '../../../base/common/themables.js'; +import { overviewRulerWarning, overviewRulerInfo, overviewRulerError } from '../core/editorColorRegistry.js'; +import { IModelService } from './model.js'; +import { Range } from '../core/range.js'; +import { IMarkerDecorationsService } from './markerDecorations.js'; +import { Schemas } from '../../../base/common/network.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { minimapInfo, minimapWarning, minimapError } from '../../../platform/theme/common/colorRegistry.js'; +import { BidirectionalMap, ResourceMap } from '../../../base/common/map.js'; +import { diffSets } from '../../../base/common/collections.js'; export class MarkerDecorationsService extends Disposable implements IMarkerDecorationsService { diff --git a/src/vs/editor/common/services/model.ts b/src/vs/editor/common/services/model.ts index 17355399606..d7eda7d8987 100644 --- a/src/vs/editor/common/services/model.ts +++ b/src/vs/editor/common/services/model.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { ITextBufferFactory, ITextModel, ITextModelCreationOptions } from 'vs/editor/common/model'; -import { ILanguageSelection } from 'vs/editor/common/languages/language'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { DocumentSemanticTokensProvider, DocumentRangeSemanticTokensProvider } from 'vs/editor/common/languages'; +import { Event } from '../../../base/common/event.js'; +import { URI } from '../../../base/common/uri.js'; +import { ITextBufferFactory, ITextModel, ITextModelCreationOptions } from '../model.js'; +import { ILanguageSelection } from '../languages/language.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { DocumentSemanticTokensProvider, DocumentRangeSemanticTokensProvider } from '../languages.js'; export const IModelService = createDecorator('modelService'); diff --git a/src/vs/editor/common/services/modelService.ts b/src/vs/editor/common/services/modelService.ts index 2bbda14a026..c0293db8390 100644 --- a/src/vs/editor/common/services/modelService.ts +++ b/src/vs/editor/common/services/modelService.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; -import * as platform from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Range } from 'vs/editor/common/core/range'; -import { DefaultEndOfLine, EndOfLinePreference, EndOfLineSequence, ITextBuffer, ITextBufferFactory, ITextModel, ITextModelCreationOptions } from 'vs/editor/common/model'; -import { TextModel, createTextBuffer } from 'vs/editor/common/model/textModel'; -import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults'; -import { IModelLanguageChangedEvent } from 'vs/editor/common/textModelEvents'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { ILanguageSelection, ILanguageService } from 'vs/editor/common/languages/language'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration'; -import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IUndoRedoService, ResourceEditStackSnapshot } from 'vs/platform/undoRedo/common/undoRedo'; -import { StringSHA1 } from 'vs/base/common/hash'; -import { isEditStackElement } from 'vs/editor/common/model/editStack'; -import { Schemas } from 'vs/base/common/network'; -import { equals } from 'vs/base/common/objects'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import * as platform from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { EditOperation, ISingleEditOperation } from '../core/editOperation.js'; +import { Range } from '../core/range.js'; +import { DefaultEndOfLine, EndOfLinePreference, EndOfLineSequence, ITextBuffer, ITextBufferFactory, ITextModel, ITextModelCreationOptions } from '../model.js'; +import { TextModel, createTextBuffer } from '../model/textModel.js'; +import { EDITOR_MODEL_DEFAULTS } from '../core/textModelDefaults.js'; +import { IModelLanguageChangedEvent } from '../textModelEvents.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../languages/modesRegistry.js'; +import { ILanguageSelection } from '../languages/language.js'; +import { IModelService } from './model.js'; +import { ITextResourcePropertiesService } from './textResourceConfiguration.js'; +import { IConfigurationChangeEvent, IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { IUndoRedoService, ResourceEditStackSnapshot } from '../../../platform/undoRedo/common/undoRedo.js'; +import { StringSHA1 } from '../../../base/common/hash.js'; +import { isEditStackElement } from '../model/editStack.js'; +import { Schemas } from '../../../base/common/network.js'; +import { equals } from '../../../base/common/objects.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; function MODEL_ID(resource: URI): string { return resource.toString(); @@ -107,8 +107,7 @@ export class ModelService extends Disposable implements IModelService { @IConfigurationService private readonly _configurationService: IConfigurationService, @ITextResourcePropertiesService private readonly _resourcePropertiesService: ITextResourcePropertiesService, @IUndoRedoService private readonly _undoRedoService: IUndoRedoService, - @ILanguageService private readonly _languageService: ILanguageService, - @ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService, + @IInstantiationService private readonly _instantiationService: IInstantiationService ) { super(); this._modelCreationOptionsByLanguageAndResource = Object.create(null); @@ -314,14 +313,11 @@ export class ModelService extends Disposable implements IModelService { private _createModelData(value: string | ITextBufferFactory, languageIdOrSelection: string | ILanguageSelection, resource: URI | undefined, isForSimpleWidget: boolean): ModelData { // create & save the model const options = this.getCreationOptions(languageIdOrSelection, resource, isForSimpleWidget); - const model: TextModel = new TextModel( + const model: TextModel = this._instantiationService.createInstance(TextModel, value, languageIdOrSelection, options, - resource, - this._undoRedoService, - this._languageService, - this._languageConfigurationService, + resource ); if (resource && this._disposedModels.has(MODEL_ID(resource))) { const disposedModelData = this._removeDisposedModel(resource)!; diff --git a/src/vs/editor/common/services/modelUndoRedoParticipant.ts b/src/vs/editor/common/services/modelUndoRedoParticipant.ts index c199b6bb751..ffb0760eb26 100644 --- a/src/vs/editor/common/services/modelUndoRedoParticipant.ts +++ b/src/vs/editor/common/services/modelUndoRedoParticipant.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IModelService } from 'vs/editor/common/services/model'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo'; -import { IUndoRedoDelegate, MultiModelEditStackElement } from 'vs/editor/common/model/editStack'; +import { IModelService } from './model.js'; +import { ITextModelService } from './resolverService.js'; +import { Disposable, IDisposable, dispose } from '../../../base/common/lifecycle.js'; +import { IUndoRedoService } from '../../../platform/undoRedo/common/undoRedo.js'; +import { IUndoRedoDelegate, MultiModelEditStackElement } from '../model/editStack.js'; export class ModelUndoRedoParticipant extends Disposable implements IUndoRedoDelegate { constructor( diff --git a/src/vs/editor/common/services/resolverService.ts b/src/vs/editor/common/services/resolverService.ts index d8eac79e364..348f4b34121 100644 --- a/src/vs/editor/common/services/resolverService.ts +++ b/src/vs/editor/common/services/resolverService.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { IDisposable, IReference } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { ITextModel, ITextSnapshot } from 'vs/editor/common/model'; -import { IResolvableEditorModel } from 'vs/platform/editor/common/editor'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { IDisposable, IReference } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { ITextModel, ITextSnapshot } from '../model.js'; +import { IResolvableEditorModel } from '../../../platform/editor/common/editor.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; export const ITextModelService = createDecorator('textModelService'); diff --git a/src/vs/editor/common/services/semanticTokensDto.ts b/src/vs/editor/common/services/semanticTokensDto.ts index 652ae69b65a..4fd9cc88859 100644 --- a/src/vs/editor/common/services/semanticTokensDto.ts +++ b/src/vs/editor/common/services/semanticTokensDto.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import * as platform from 'vs/base/common/platform'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import * as platform from '../../../base/common/platform.js'; export interface IFullSemanticTokensDto { id: number; diff --git a/src/vs/editor/common/services/semanticTokensProviderStyling.ts b/src/vs/editor/common/services/semanticTokensProviderStyling.ts index 1bb2e0d6ed1..ca9026d66fe 100644 --- a/src/vs/editor/common/services/semanticTokensProviderStyling.ts +++ b/src/vs/editor/common/services/semanticTokensProviderStyling.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SemanticTokensLegend, SemanticTokens } from 'vs/editor/common/languages'; -import { FontStyle, MetadataConsts, TokenMetadata } from 'vs/editor/common/encodedTokenAttributes'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ILogService, LogLevel } from 'vs/platform/log/common/log'; -import { SparseMultilineTokens } from 'vs/editor/common/tokens/sparseMultilineTokens'; -import { ILanguageService } from 'vs/editor/common/languages/language'; +import { SemanticTokensLegend, SemanticTokens } from '../languages.js'; +import { FontStyle, MetadataConsts, TokenMetadata } from '../encodedTokenAttributes.js'; +import { IThemeService } from '../../../platform/theme/common/themeService.js'; +import { ILogService, LogLevel } from '../../../platform/log/common/log.js'; +import { SparseMultilineTokens } from '../tokens/sparseMultilineTokens.js'; +import { ILanguageService } from '../languages/language.js'; const enum SemanticTokensProviderStylingConstants { NO_STYLING = 0b01111111111111111111111111111111 diff --git a/src/vs/editor/common/services/semanticTokensStyling.ts b/src/vs/editor/common/services/semanticTokensStyling.ts index 935c9aed528..6ee050718c9 100644 --- a/src/vs/editor/common/services/semanticTokensStyling.ts +++ b/src/vs/editor/common/services/semanticTokensStyling.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { DocumentSemanticTokensProvider, DocumentRangeSemanticTokensProvider } from 'vs/editor/common/languages'; -import { SemanticTokensProviderStyling } from 'vs/editor/common/services/semanticTokensProviderStyling'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { DocumentSemanticTokensProvider, DocumentRangeSemanticTokensProvider } from '../languages.js'; +import { SemanticTokensProviderStyling } from './semanticTokensProviderStyling.js'; export const ISemanticTokensStylingService = createDecorator('semanticTokensStylingService'); diff --git a/src/vs/editor/common/services/semanticTokensStylingService.ts b/src/vs/editor/common/services/semanticTokensStylingService.ts index 8aba1f0a601..5479905c409 100644 --- a/src/vs/editor/common/services/semanticTokensStylingService.ts +++ b/src/vs/editor/common/services/semanticTokensStylingService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { DocumentTokensProvider } from 'vs/editor/common/services/model'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { SemanticTokensProviderStyling } from 'vs/editor/common/services/semanticTokensProviderStyling'; -import { ISemanticTokensStylingService } from 'vs/editor/common/services/semanticTokensStyling'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { ILanguageService } from '../languages/language.js'; +import { DocumentTokensProvider } from './model.js'; +import { IThemeService } from '../../../platform/theme/common/themeService.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { SemanticTokensProviderStyling } from './semanticTokensProviderStyling.js'; +import { ISemanticTokensStylingService } from './semanticTokensStyling.js'; +import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; export class SemanticTokensStylingService extends Disposable implements ISemanticTokensStylingService { diff --git a/src/vs/editor/common/services/textModelSync/textModelSync.impl.ts b/src/vs/editor/common/services/textModelSync/textModelSync.impl.ts new file mode 100644 index 00000000000..77bb17bec86 --- /dev/null +++ b/src/vs/editor/common/services/textModelSync/textModelSync.impl.ts @@ -0,0 +1,427 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IntervalTimer } from '../../../../base/common/async.js'; +import { Disposable, DisposableStore, dispose, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IWorkerClient, IWorkerServer } from '../../../../base/common/worker/simpleWorker.js'; +import { IPosition, Position } from '../../core/position.js'; +import { IRange, Range } from '../../core/range.js'; +import { ensureValidWordDefinition, getWordAtText, IWordAtPosition } from '../../core/wordHelper.js'; +import { IDocumentColorComputerTarget } from '../../languages/defaultDocumentColorsComputer.js'; +import { ILinkComputerTarget } from '../../languages/linkComputer.js'; +import { MirrorTextModel as BaseMirrorModel, IModelChangedEvent } from '../../model/mirrorTextModel.js'; +import { IMirrorModel, IWordRange } from '../editorSimpleWorker.js'; +import { IModelService } from '../model.js'; +import { IRawModelData, IWorkerTextModelSyncChannelServer } from './textModelSync.protocol.js'; + +/** + * Stop syncing a model to the worker if it was not needed for 1 min. + */ +export const STOP_SYNC_MODEL_DELTA_TIME_MS = 60 * 1000; + +export const WORKER_TEXT_MODEL_SYNC_CHANNEL = 'workerTextModelSync'; + +export class WorkerTextModelSyncClient extends Disposable { + + public static create(workerClient: IWorkerClient, modelService: IModelService): WorkerTextModelSyncClient { + return new WorkerTextModelSyncClient( + workerClient.getChannel(WORKER_TEXT_MODEL_SYNC_CHANNEL), + modelService + ); + } + + private readonly _proxy: IWorkerTextModelSyncChannelServer; + private readonly _modelService: IModelService; + private _syncedModels: { [modelUrl: string]: IDisposable } = Object.create(null); + private _syncedModelsLastUsedTime: { [modelUrl: string]: number } = Object.create(null); + + constructor(proxy: IWorkerTextModelSyncChannelServer, modelService: IModelService, keepIdleModels: boolean = false) { + super(); + this._proxy = proxy; + this._modelService = modelService; + + if (!keepIdleModels) { + const timer = new IntervalTimer(); + timer.cancelAndSet(() => this._checkStopModelSync(), Math.round(STOP_SYNC_MODEL_DELTA_TIME_MS / 2)); + this._register(timer); + } + } + + public override dispose(): void { + for (const modelUrl in this._syncedModels) { + dispose(this._syncedModels[modelUrl]); + } + this._syncedModels = Object.create(null); + this._syncedModelsLastUsedTime = Object.create(null); + super.dispose(); + } + + public ensureSyncedResources(resources: URI[], forceLargeModels: boolean = false): void { + for (const resource of resources) { + const resourceStr = resource.toString(); + + if (!this._syncedModels[resourceStr]) { + this._beginModelSync(resource, forceLargeModels); + } + if (this._syncedModels[resourceStr]) { + this._syncedModelsLastUsedTime[resourceStr] = (new Date()).getTime(); + } + } + } + + private _checkStopModelSync(): void { + const currentTime = (new Date()).getTime(); + + const toRemove: string[] = []; + for (const modelUrl in this._syncedModelsLastUsedTime) { + const elapsedTime = currentTime - this._syncedModelsLastUsedTime[modelUrl]; + if (elapsedTime > STOP_SYNC_MODEL_DELTA_TIME_MS) { + toRemove.push(modelUrl); + } + } + + for (const e of toRemove) { + this._stopModelSync(e); + } + } + + private _beginModelSync(resource: URI, forceLargeModels: boolean): void { + const model = this._modelService.getModel(resource); + if (!model) { + return; + } + if (!forceLargeModels && model.isTooLargeForSyncing()) { + return; + } + + const modelUrl = resource.toString(); + + this._proxy.$acceptNewModel({ + url: model.uri.toString(), + lines: model.getLinesContent(), + EOL: model.getEOL(), + versionId: model.getVersionId() + }); + + const toDispose = new DisposableStore(); + toDispose.add(model.onDidChangeContent((e) => { + this._proxy.$acceptModelChanged(modelUrl.toString(), e); + })); + toDispose.add(model.onWillDispose(() => { + this._stopModelSync(modelUrl); + })); + toDispose.add(toDisposable(() => { + this._proxy.$acceptRemovedModel(modelUrl); + })); + + this._syncedModels[modelUrl] = toDispose; + } + + private _stopModelSync(modelUrl: string): void { + const toDispose = this._syncedModels[modelUrl]; + delete this._syncedModels[modelUrl]; + delete this._syncedModelsLastUsedTime[modelUrl]; + dispose(toDispose); + } +} + +export class WorkerTextModelSyncServer implements IWorkerTextModelSyncChannelServer { + + private readonly _models: { [uri: string]: MirrorModel }; + + constructor() { + this._models = Object.create(null); + } + + public bindToServer(workerServer: IWorkerServer): void { + workerServer.setChannel(WORKER_TEXT_MODEL_SYNC_CHANNEL, this); + } + + public getModel(uri: string): ICommonModel | undefined { + return this._models[uri]; + } + + public getModels(): ICommonModel[] { + const all: MirrorModel[] = []; + Object.keys(this._models).forEach((key) => all.push(this._models[key])); + return all; + } + + $acceptNewModel(data: IRawModelData): void { + this._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId); + } + + $acceptModelChanged(uri: string, e: IModelChangedEvent): void { + if (!this._models[uri]) { + return; + } + const model = this._models[uri]; + model.onEvents(e); + } + + $acceptRemovedModel(uri: string): void { + if (!this._models[uri]) { + return; + } + delete this._models[uri]; + } +} + +export class MirrorModel extends BaseMirrorModel implements ICommonModel { + + public get uri(): URI { + return this._uri; + } + + public get eol(): string { + return this._eol; + } + + public getValue(): string { + return this.getText(); + } + + public findMatches(regex: RegExp): RegExpMatchArray[] { + const matches = []; + for (let i = 0; i < this._lines.length; i++) { + const line = this._lines[i]; + const offsetToAdd = this.offsetAt(new Position(i + 1, 1)); + const iteratorOverMatches = line.matchAll(regex); + for (const match of iteratorOverMatches) { + if (match.index || match.index === 0) { + match.index = match.index + offsetToAdd; + } + matches.push(match); + } + } + return matches; + } + + public getLinesContent(): string[] { + return this._lines.slice(0); + } + + public getLineCount(): number { + return this._lines.length; + } + + public getLineContent(lineNumber: number): string { + return this._lines[lineNumber - 1]; + } + + public getWordAtPosition(position: IPosition, wordDefinition: RegExp): Range | null { + + const wordAtText = getWordAtText( + position.column, + ensureValidWordDefinition(wordDefinition), + this._lines[position.lineNumber - 1], + 0 + ); + + if (wordAtText) { + return new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); + } + + return null; + } + + public getWordUntilPosition(position: IPosition, wordDefinition: RegExp): IWordAtPosition { + const wordAtPosition = this.getWordAtPosition(position, wordDefinition); + if (!wordAtPosition) { + return { + word: '', + startColumn: position.column, + endColumn: position.column + }; + } + return { + word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), + startColumn: wordAtPosition.startColumn, + endColumn: position.column + }; + } + + + public words(wordDefinition: RegExp): Iterable { + + const lines = this._lines; + const wordenize = this._wordenize.bind(this); + + let lineNumber = 0; + let lineText = ''; + let wordRangesIdx = 0; + let wordRanges: IWordRange[] = []; + + return { + *[Symbol.iterator]() { + while (true) { + if (wordRangesIdx < wordRanges.length) { + const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); + wordRangesIdx += 1; + yield value; + } else { + if (lineNumber < lines.length) { + lineText = lines[lineNumber]; + wordRanges = wordenize(lineText, wordDefinition); + wordRangesIdx = 0; + lineNumber += 1; + } else { + break; + } + } + } + } + }; + } + + public getLineWords(lineNumber: number, wordDefinition: RegExp): IWordAtPosition[] { + const content = this._lines[lineNumber - 1]; + const ranges = this._wordenize(content, wordDefinition); + const words: IWordAtPosition[] = []; + for (const range of ranges) { + words.push({ + word: content.substring(range.start, range.end), + startColumn: range.start + 1, + endColumn: range.end + 1 + }); + } + return words; + } + + private _wordenize(content: string, wordDefinition: RegExp): IWordRange[] { + const result: IWordRange[] = []; + let match: RegExpExecArray | null; + + wordDefinition.lastIndex = 0; // reset lastIndex just to be sure + + while (match = wordDefinition.exec(content)) { + if (match[0].length === 0) { + // it did match the empty string + break; + } + result.push({ start: match.index, end: match.index + match[0].length }); + } + return result; + } + + public getValueInRange(range: IRange): string { + range = this._validateRange(range); + + if (range.startLineNumber === range.endLineNumber) { + return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); + } + + const lineEnding = this._eol; + const startLineIndex = range.startLineNumber - 1; + const endLineIndex = range.endLineNumber - 1; + const resultLines: string[] = []; + + resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); + for (let i = startLineIndex + 1; i < endLineIndex; i++) { + resultLines.push(this._lines[i]); + } + resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); + + return resultLines.join(lineEnding); + } + + public offsetAt(position: IPosition): number { + position = this._validatePosition(position); + this._ensureLineStarts(); + return this._lineStarts!.getPrefixSum(position.lineNumber - 2) + (position.column - 1); + } + + public positionAt(offset: number): IPosition { + offset = Math.floor(offset); + offset = Math.max(0, offset); + + this._ensureLineStarts(); + const out = this._lineStarts!.getIndexOf(offset); + const lineLength = this._lines[out.index].length; + + // Ensure we return a valid position + return { + lineNumber: 1 + out.index, + column: 1 + Math.min(out.remainder, lineLength) + }; + } + + private _validateRange(range: IRange): IRange { + + const start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); + const end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); + + if (start.lineNumber !== range.startLineNumber + || start.column !== range.startColumn + || end.lineNumber !== range.endLineNumber + || end.column !== range.endColumn) { + + return { + startLineNumber: start.lineNumber, + startColumn: start.column, + endLineNumber: end.lineNumber, + endColumn: end.column + }; + } + + return range; + } + + private _validatePosition(position: IPosition): IPosition { + if (!Position.isIPosition(position)) { + throw new Error('bad position'); + } + let { lineNumber, column } = position; + let hasChanged = false; + + if (lineNumber < 1) { + lineNumber = 1; + column = 1; + hasChanged = true; + + } else if (lineNumber > this._lines.length) { + lineNumber = this._lines.length; + column = this._lines[lineNumber - 1].length + 1; + hasChanged = true; + + } else { + const maxCharacter = this._lines[lineNumber - 1].length + 1; + if (column < 1) { + column = 1; + hasChanged = true; + } + else if (column > maxCharacter) { + column = maxCharacter; + hasChanged = true; + } + } + + if (!hasChanged) { + return position; + } else { + return { lineNumber, column }; + } + } +} + +export interface ICommonModel extends ILinkComputerTarget, IDocumentColorComputerTarget, IMirrorModel { + uri: URI; + version: number; + eol: string; + getValue(): string; + + getLinesContent(): string[]; + getLineCount(): number; + getLineContent(lineNumber: number): string; + getLineWords(lineNumber: number, wordDefinition: RegExp): IWordAtPosition[]; + words(wordDefinition: RegExp): Iterable; + getWordUntilPosition(position: IPosition, wordDefinition: RegExp): IWordAtPosition; + getValueInRange(range: IRange): string; + getWordAtPosition(position: IPosition, wordDefinition: RegExp): Range | null; + offsetAt(position: IPosition): number; + positionAt(offset: number): IPosition; + findMatches(regex: RegExp): RegExpMatchArray[]; +} diff --git a/src/vs/editor/common/services/textModelSync/textModelSync.protocol.ts b/src/vs/editor/common/services/textModelSync/textModelSync.protocol.ts new file mode 100644 index 00000000000..a9100cd5042 --- /dev/null +++ b/src/vs/editor/common/services/textModelSync/textModelSync.protocol.ts @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IModelChangedEvent } from '../../model/mirrorTextModel.js'; + +export interface IWorkerTextModelSyncChannelServer { + $acceptNewModel(data: IRawModelData): void; + + $acceptModelChanged(strURL: string, e: IModelChangedEvent): void; + + $acceptRemovedModel(strURL: string): void; +} + +export interface IRawModelData { + url: string; + versionId: number; + lines: string[]; + EOL: string; +} diff --git a/src/vs/editor/common/services/textResourceConfiguration.ts b/src/vs/editor/common/services/textResourceConfiguration.ts index 0921cba713d..f2edf685f2b 100644 --- a/src/vs/editor/common/services/textResourceConfiguration.ts +++ b/src/vs/editor/common/services/textResourceConfiguration.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { IPosition } from 'vs/editor/common/core/position'; -import { ConfigurationTarget, IConfigurationValue } from 'vs/platform/configuration/common/configuration'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { URI } from '../../../base/common/uri.js'; +import { IPosition } from '../core/position.js'; +import { ConfigurationTarget, IConfigurationValue } from '../../../platform/configuration/common/configuration.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; export const ITextResourceConfigurationService = createDecorator('textResourceConfigurationService'); diff --git a/src/vs/editor/common/services/textResourceConfigurationService.ts b/src/vs/editor/common/services/textResourceConfigurationService.ts index 39390cbd033..567eac5b8b8 100644 --- a/src/vs/editor/common/services/textResourceConfigurationService.ts +++ b/src/vs/editor/common/services/textResourceConfigurationService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ITextResourceConfigurationService, ITextResourceConfigurationChangeEvent } from 'vs/editor/common/services/textResourceConfiguration'; -import { IConfigurationService, ConfigurationTarget, IConfigurationValue, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { IPosition, Position } from '../core/position.js'; +import { ILanguageService } from '../languages/language.js'; +import { IModelService } from './model.js'; +import { ITextResourceConfigurationService, ITextResourceConfigurationChangeEvent } from './textResourceConfiguration.js'; +import { IConfigurationService, ConfigurationTarget, IConfigurationValue, IConfigurationChangeEvent } from '../../../platform/configuration/common/configuration.js'; export class TextResourceConfigurationService extends Disposable implements ITextResourceConfigurationService { diff --git a/src/vs/editor/common/services/treeSitterParserService.ts b/src/vs/editor/common/services/treeSitterParserService.ts new file mode 100644 index 00000000000..27fda58bfa5 --- /dev/null +++ b/src/vs/editor/common/services/treeSitterParserService.ts @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type { Parser } from '@vscode/tree-sitter-wasm'; +import { Event } from '../../../base/common/event.js'; +import { ITextModel } from '../model.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; + +export const EDITOR_EXPERIMENTAL_PREFER_TREESITTER = 'editor.experimental.preferTreeSitter'; + +export const ITreeSitterParserService = createDecorator('treeSitterParserService'); + +export interface ITreeSitterParserService { + readonly _serviceBrand: undefined; + onDidAddLanguage: Event<{ id: string; language: Parser.Language }>; + getOrInitLanguage(languageId: string): Parser.Language | undefined; + getParseResult(textModel: ITextModel): ITreeSitterParseResult | undefined; +} + +export interface ITreeSitterParseResult { + readonly tree: Parser.Tree | undefined; + readonly language: Parser.Language; +} diff --git a/src/vs/editor/common/services/treeViewsDndService.ts b/src/vs/editor/common/services/treeViewsDndService.ts index 6130072bfb0..e7b3ebb9d07 100644 --- a/src/vs/editor/common/services/treeViewsDndService.ts +++ b/src/vs/editor/common/services/treeViewsDndService.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { VSDataTransfer } from 'vs/base/common/dataTransfer'; -import { ITreeViewsDnDService as ITreeViewsDnDServiceCommon, TreeViewsDnDService } from 'vs/editor/common/services/treeViewsDnd'; +import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { VSDataTransfer } from '../../../base/common/dataTransfer.js'; +import { ITreeViewsDnDService as ITreeViewsDnDServiceCommon, TreeViewsDnDService } from './treeViewsDnd.js'; export interface ITreeViewsDnDService extends ITreeViewsDnDServiceCommon { } export const ITreeViewsDnDService = createDecorator('treeViewsDndService'); diff --git a/src/vs/editor/common/services/unicodeTextModelHighlighter.ts b/src/vs/editor/common/services/unicodeTextModelHighlighter.ts index 86103738c48..d9e86c3e68b 100644 --- a/src/vs/editor/common/services/unicodeTextModelHighlighter.ts +++ b/src/vs/editor/common/services/unicodeTextModelHighlighter.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IRange, Range } from 'vs/editor/common/core/range'; -import { Searcher } from 'vs/editor/common/model/textModelSearch'; -import * as strings from 'vs/base/common/strings'; -import { IUnicodeHighlightsResult } from 'vs/editor/common/services/editorWorker'; -import { assertNever } from 'vs/base/common/assert'; -import { DEFAULT_WORD_REGEXP, getWordAtText } from 'vs/editor/common/core/wordHelper'; +import { IRange, Range } from '../core/range.js'; +import { Searcher } from '../model/textModelSearch.js'; +import * as strings from '../../../base/common/strings.js'; +import { IUnicodeHighlightsResult } from './editorWorker.js'; +import { assertNever } from '../../../base/common/assert.js'; +import { DEFAULT_WORD_REGEXP, getWordAtText } from '../core/wordHelper.js'; export class UnicodeTextModelHighlighter { public static computeUnicodeHighlights(model: IUnicodeCharacterSearcherTarget, options: UnicodeHighlighterOptions, range?: IRange): IUnicodeHighlightsResult { diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index 7cd16daae8b..600112188c3 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -210,120 +210,122 @@ export enum EditorOption { domReadOnly = 34, dragAndDrop = 35, dropIntoEditor = 36, - emptySelectionClipboard = 37, - experimentalWhitespaceRendering = 38, - extraEditorClassName = 39, - fastScrollSensitivity = 40, - find = 41, - fixedOverflowWidgets = 42, - folding = 43, - foldingStrategy = 44, - foldingHighlight = 45, - foldingImportsByDefault = 46, - foldingMaximumRegions = 47, - unfoldOnClickAfterEndOfLine = 48, - fontFamily = 49, - fontInfo = 50, - fontLigatures = 51, - fontSize = 52, - fontWeight = 53, - fontVariations = 54, - formatOnPaste = 55, - formatOnType = 56, - glyphMargin = 57, - gotoLocation = 58, - hideCursorInOverviewRuler = 59, - hover = 60, - inDiffEditor = 61, - inlineSuggest = 62, - inlineEdit = 63, - letterSpacing = 64, - lightbulb = 65, - lineDecorationsWidth = 66, - lineHeight = 67, - lineNumbers = 68, - lineNumbersMinChars = 69, - linkedEditing = 70, - links = 71, - matchBrackets = 72, - minimap = 73, - mouseStyle = 74, - mouseWheelScrollSensitivity = 75, - mouseWheelZoom = 76, - multiCursorMergeOverlapping = 77, - multiCursorModifier = 78, - multiCursorPaste = 79, - multiCursorLimit = 80, - occurrencesHighlight = 81, - overviewRulerBorder = 82, - overviewRulerLanes = 83, - padding = 84, - pasteAs = 85, - parameterHints = 86, - peekWidgetDefaultFocus = 87, - placeholder = 88, - definitionLinkOpensInPeek = 89, - quickSuggestions = 90, - quickSuggestionsDelay = 91, - readOnly = 92, - readOnlyMessage = 93, - renameOnType = 94, - renderControlCharacters = 95, - renderFinalNewline = 96, - renderLineHighlight = 97, - renderLineHighlightOnlyWhenFocus = 98, - renderValidationDecorations = 99, - renderWhitespace = 100, - revealHorizontalRightPadding = 101, - roundedSelection = 102, - rulers = 103, - scrollbar = 104, - scrollBeyondLastColumn = 105, - scrollBeyondLastLine = 106, - scrollPredominantAxis = 107, - selectionClipboard = 108, - selectionHighlight = 109, - selectOnLineNumbers = 110, - showFoldingControls = 111, - showUnused = 112, - snippetSuggestions = 113, - smartSelect = 114, - smoothScrolling = 115, - stickyScroll = 116, - stickyTabStops = 117, - stopRenderingLineAfter = 118, - suggest = 119, - suggestFontSize = 120, - suggestLineHeight = 121, - suggestOnTriggerCharacters = 122, - suggestSelection = 123, - tabCompletion = 124, - tabIndex = 125, - unicodeHighlighting = 126, - unusualLineTerminators = 127, - useShadowDOM = 128, - useTabStops = 129, - wordBreak = 130, - wordSegmenterLocales = 131, - wordSeparators = 132, - wordWrap = 133, - wordWrapBreakAfterCharacters = 134, - wordWrapBreakBeforeCharacters = 135, - wordWrapColumn = 136, - wordWrapOverride1 = 137, - wordWrapOverride2 = 138, - wrappingIndent = 139, - wrappingStrategy = 140, - showDeprecated = 141, - inlayHints = 142, - editorClassName = 143, - pixelRatio = 144, - tabFocusMode = 145, - layoutInfo = 146, - wrappingInfo = 147, - defaultColorDecorators = 148, - colorDecoratorsActivatedOn = 149, - inlineCompletionsAccessibilityVerbose = 150 + experimentalEditContextEnabled = 37, + emptySelectionClipboard = 38, + experimentalGpuAcceleration = 39, + experimentalWhitespaceRendering = 40, + extraEditorClassName = 41, + fastScrollSensitivity = 42, + find = 43, + fixedOverflowWidgets = 44, + folding = 45, + foldingStrategy = 46, + foldingHighlight = 47, + foldingImportsByDefault = 48, + foldingMaximumRegions = 49, + unfoldOnClickAfterEndOfLine = 50, + fontFamily = 51, + fontInfo = 52, + fontLigatures = 53, + fontSize = 54, + fontWeight = 55, + fontVariations = 56, + formatOnPaste = 57, + formatOnType = 58, + glyphMargin = 59, + gotoLocation = 60, + hideCursorInOverviewRuler = 61, + hover = 62, + inDiffEditor = 63, + inlineSuggest = 64, + inlineEdit = 65, + letterSpacing = 66, + lightbulb = 67, + lineDecorationsWidth = 68, + lineHeight = 69, + lineNumbers = 70, + lineNumbersMinChars = 71, + linkedEditing = 72, + links = 73, + matchBrackets = 74, + minimap = 75, + mouseStyle = 76, + mouseWheelScrollSensitivity = 77, + mouseWheelZoom = 78, + multiCursorMergeOverlapping = 79, + multiCursorModifier = 80, + multiCursorPaste = 81, + multiCursorLimit = 82, + occurrencesHighlight = 83, + overviewRulerBorder = 84, + overviewRulerLanes = 85, + padding = 86, + pasteAs = 87, + parameterHints = 88, + peekWidgetDefaultFocus = 89, + placeholder = 90, + definitionLinkOpensInPeek = 91, + quickSuggestions = 92, + quickSuggestionsDelay = 93, + readOnly = 94, + readOnlyMessage = 95, + renameOnType = 96, + renderControlCharacters = 97, + renderFinalNewline = 98, + renderLineHighlight = 99, + renderLineHighlightOnlyWhenFocus = 100, + renderValidationDecorations = 101, + renderWhitespace = 102, + revealHorizontalRightPadding = 103, + roundedSelection = 104, + rulers = 105, + scrollbar = 106, + scrollBeyondLastColumn = 107, + scrollBeyondLastLine = 108, + scrollPredominantAxis = 109, + selectionClipboard = 110, + selectionHighlight = 111, + selectOnLineNumbers = 112, + showFoldingControls = 113, + showUnused = 114, + snippetSuggestions = 115, + smartSelect = 116, + smoothScrolling = 117, + stickyScroll = 118, + stickyTabStops = 119, + stopRenderingLineAfter = 120, + suggest = 121, + suggestFontSize = 122, + suggestLineHeight = 123, + suggestOnTriggerCharacters = 124, + suggestSelection = 125, + tabCompletion = 126, + tabIndex = 127, + unicodeHighlighting = 128, + unusualLineTerminators = 129, + useShadowDOM = 130, + useTabStops = 131, + wordBreak = 132, + wordSegmenterLocales = 133, + wordSeparators = 134, + wordWrap = 135, + wordWrapBreakAfterCharacters = 136, + wordWrapBreakBeforeCharacters = 137, + wordWrapColumn = 138, + wordWrapOverride1 = 139, + wordWrapOverride2 = 140, + wrappingIndent = 141, + wrappingStrategy = 142, + showDeprecated = 143, + inlayHints = 144, + editorClassName = 145, + pixelRatio = 146, + tabFocusMode = 147, + layoutInfo = 148, + wrappingInfo = 149, + defaultColorDecorators = 150, + colorDecoratorsActivatedOn = 151, + inlineCompletionsAccessibilityVerbose = 152 } /** diff --git a/src/vs/editor/common/standaloneStrings.ts b/src/vs/editor/common/standaloneStrings.ts index 81ffaa07895..a90add96865 100644 --- a/src/vs/editor/common/standaloneStrings.ts +++ b/src/vs/editor/common/standaloneStrings.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../nls.js'; export namespace AccessibilityHelpNLS { export const accessibilityHelpTitle = nls.localize('accessibilityHelpTitle', "Accessibility Help"); @@ -18,14 +18,22 @@ export namespace AccessibilityHelpNLS { export const auto_off = nls.localize("auto_off", "The application is configured to never be optimized for usage with a Screen Reader."); export const screenReaderModeEnabled = nls.localize("screenReaderModeEnabled", "Screen Reader Optimized Mode enabled."); export const screenReaderModeDisabled = nls.localize("screenReaderModeDisabled", "Screen Reader Optimized Mode disabled."); - export const tabFocusModeOnMsg = nls.localize("tabFocusModeOnMsg", "Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior"); - export const tabFocusModeOffMsg = nls.localize("tabFocusModeOffMsg", "Pressing Tab in the current editor will insert the tab character. Toggle this behavior"); - export const stickScroll = nls.localize("stickScrollKb", "Focus Sticky Scroll to focus the currently nested scopes."); + export const tabFocusModeOnMsg = nls.localize("tabFocusModeOnMsg", "Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior{0}.", ''); + export const tabFocusModeOffMsg = nls.localize("tabFocusModeOffMsg", "Pressing Tab in the current editor will insert the tab character. Toggle this behavior{0}.", ''); + export const stickScroll = nls.localize("stickScrollKb", "Focus Sticky Scroll{0} to focus the currently nested scopes.", ''); + export const codeFolding = nls.localize("codeFolding", "Use code folding to collapse blocks of code and focus on the code you're interested in via the Toggle Folding Command{0}.", ''); + export const intellisense = nls.localize("intellisense", "Use Intellisense to improve coding efficiency and reduce errors. Trigger suggestions{0}.", ''); + export const showOrFocusHover = nls.localize("showOrFocusHover", "Show or focus the hover{0} to read information about the current symbol.", ''); + export const goToSymbol = nls.localize("goToSymbol", "Go to Symbol{0} to quickly navigate between symbols in the current file.", ''); export const showAccessibilityHelpAction = nls.localize("showAccessibilityHelpAction", "Show Accessibility Help"); export const listSignalSounds = nls.localize("listSignalSoundsCommand", "Run the command: List Signal Sounds for an overview of all sounds and their current status."); export const listAlerts = nls.localize("listAnnouncementsCommand", "Run the command: List Signal Announcements for an overview of announcements and their current status."); - export const quickChat = nls.localize("quickChatCommand", "Toggle quick chat to open or close a chat session.",); - export const startInlineChat = nls.localize("startInlineChatCommand", "Start inline chat to create an in editor chat session."); + export const quickChat = nls.localize("quickChatCommand", "Toggle quick chat{0} to open or close a chat session.", ''); + export const startInlineChat = nls.localize("startInlineChatCommand", "Start inline chat{0} to create an in editor chat session.", ''); + export const startDebugging = nls.localize('debug.startDebugging', "The Debug: Start Debugging command{0} will start a debug session.", ''); + export const setBreakpoint = nls.localize('debugConsole.setBreakpoint', "The Debug: Inline Breakpoint command{0} will set or unset a breakpoint at the current cursor position in the active editor.", ''); + export const addToWatch = nls.localize('debugConsole.addToWatch', "The Debug: Add to Watch command{0} will add the selected text to the watch view.", ''); + export const debugExecuteSelection = nls.localize('debugConsole.executeSelection', "The Debug: Execute Selection command{0} will execute the selected text in the debug console.", ''); } export namespace InspectTokensNLS { @@ -52,7 +60,6 @@ export namespace QuickOutlineNLS { export namespace StandaloneCodeEditorNLS { export const editorViewAccessibleLabel = nls.localize('editorViewAccessibleLabel', "Editor content"); - export const accessibilityHelpMessage = nls.localize('accessibilityHelpMessage', "Press Alt+F1 for Accessibility Options."); } export namespace ToggleHighContrastNLS { diff --git a/src/vs/editor/common/textModelBracketPairs.ts b/src/vs/editor/common/textModelBracketPairs.ts index 8d916800b2c..03fc83cff1f 100644 --- a/src/vs/editor/common/textModelBracketPairs.ts +++ b/src/vs/editor/common/textModelBracketPairs.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CallbackIterable } from 'vs/base/common/arrays'; -import { Event } from 'vs/base/common/event'; -import { IPosition } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ClosingBracketKind, OpeningBracketKind } from 'vs/editor/common/languages/supports/languageBracketsConfiguration'; -import { PairAstNode } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast'; +import { CallbackIterable } from '../../base/common/arrays.js'; +import { Event } from '../../base/common/event.js'; +import { IPosition } from './core/position.js'; +import { IRange, Range } from './core/range.js'; +import { ClosingBracketKind, OpeningBracketKind } from './languages/supports/languageBracketsConfiguration.js'; +import { PairAstNode } from './model/bracketPairsTextModelPart/bracketPairsTree/ast.js'; export interface IBracketPairsTextModelPart { /** diff --git a/src/vs/editor/common/textModelEvents.ts b/src/vs/editor/common/textModelEvents.ts index 58c720ac87c..768563c4be6 100644 --- a/src/vs/editor/common/textModelEvents.ts +++ b/src/vs/editor/common/textModelEvents.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IRange } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IModelDecoration, InjectedTextOptions } from 'vs/editor/common/model'; +import { IRange } from './core/range.js'; +import { Selection } from './core/selection.js'; +import { IModelDecoration, InjectedTextOptions } from './model.js'; /** * An event describing that the current language associated with a model has changed. @@ -55,6 +55,9 @@ export interface IModelContentChange { * An event describing a change in the text of a model. */ export interface IModelContentChangedEvent { + /** + * The changes are ordered from the end of the document to the beginning, so they should be safe to apply in sequence. + */ readonly changes: IModelContentChange[]; /** * The (new) end-of-line character. diff --git a/src/vs/editor/common/textModelGuides.ts b/src/vs/editor/common/textModelGuides.ts index 01789ed6b0c..a109109e430 100644 --- a/src/vs/editor/common/textModelGuides.ts +++ b/src/vs/editor/common/textModelGuides.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IPosition } from 'vs/editor/common/core/position'; +import { IPosition } from './core/position.js'; export interface IGuidesTextModelPart { /** diff --git a/src/vs/editor/common/tokenizationRegistry.ts b/src/vs/editor/common/tokenizationRegistry.ts index d9fb1bba82f..d6c0c2f39bf 100644 --- a/src/vs/editor/common/tokenizationRegistry.ts +++ b/src/vs/editor/common/tokenizationRegistry.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Color } from 'vs/base/common/color'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ITokenizationRegistry, ITokenizationSupport, ITokenizationSupportChangedEvent, ILazyTokenizationSupport } from 'vs/editor/common/languages'; -import { ColorId } from 'vs/editor/common/encodedTokenAttributes'; +import { Color } from '../../base/common/color.js'; +import { Emitter, Event } from '../../base/common/event.js'; +import { Disposable, IDisposable, toDisposable } from '../../base/common/lifecycle.js'; +import { ITokenizationRegistry, ITokenizationSupportChangedEvent, ILazyTokenizationSupport } from './languages.js'; +import { ColorId } from './encodedTokenAttributes.js'; -export class TokenizationRegistry implements ITokenizationRegistry { +export class TokenizationRegistry implements ITokenizationRegistry { - private readonly _tokenizationSupports = new Map(); - private readonly _factories = new Map(); + private readonly _tokenizationSupports = new Map(); + private readonly _factories = new Map>(); private readonly _onDidChange = new Emitter(); public readonly onDidChange: Event = this._onDidChange.event; @@ -30,7 +30,7 @@ export class TokenizationRegistry implements ITokenizationRegistry { }); } - public register(languageId: string, support: ITokenizationSupport): IDisposable { + public register(languageId: string, support: TSupport): IDisposable { this._tokenizationSupports.set(languageId, support); this.handleChange([languageId]); return toDisposable(() => { @@ -42,11 +42,11 @@ export class TokenizationRegistry implements ITokenizationRegistry { }); } - public get(languageId: string): ITokenizationSupport | null { + public get(languageId: string): TSupport | null { return this._tokenizationSupports.get(languageId) || null; } - public registerFactory(languageId: string, factory: ILazyTokenizationSupport): IDisposable { + public registerFactory(languageId: string, factory: ILazyTokenizationSupport): IDisposable { this._factories.get(languageId)?.dispose(); const myData = new TokenizationSupportFactoryData(this, languageId, factory); this._factories.set(languageId, myData); @@ -60,7 +60,7 @@ export class TokenizationRegistry implements ITokenizationRegistry { }); } - public async getOrCreate(languageId: string): Promise { + public async getOrCreate(languageId: string): Promise { // check first if the support is already set const tokenizationSupport = this.get(languageId); if (tokenizationSupport) { @@ -112,7 +112,7 @@ export class TokenizationRegistry implements ITokenizationRegistry { } } -class TokenizationSupportFactoryData extends Disposable { +class TokenizationSupportFactoryData extends Disposable { private _isDisposed: boolean = false; private _resolvePromise: Promise | null = null; @@ -123,9 +123,9 @@ class TokenizationSupportFactoryData extends Disposable { } constructor( - private readonly _registry: TokenizationRegistry, + private readonly _registry: TokenizationRegistry, private readonly _languageId: string, - private readonly _factory: ILazyTokenizationSupport, + private readonly _factory: ILazyTokenizationSupport, ) { super(); } diff --git a/src/vs/editor/common/tokenizationTextModelPart.ts b/src/vs/editor/common/tokenizationTextModelPart.ts index 07eb06f9fdc..25e7569b2f9 100644 --- a/src/vs/editor/common/tokenizationTextModelPart.ts +++ b/src/vs/editor/common/tokenizationTextModelPart.ts @@ -3,11 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IPosition } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { SparseMultilineTokens } from 'vs/editor/common/tokens/sparseMultilineTokens'; +import { OffsetEdit } from './core/offsetEdit.js'; +import { OffsetRange } from './core/offsetRange.js'; +import { Range } from './core/range.js'; +import { StandardTokenType } from './encodedTokenAttributes.js'; +import { LineTokens } from './tokens/lineTokens.js'; +import { SparseMultilineTokens } from './tokens/sparseMultilineTokens.js'; /** * Provides tokenization related functionality of the text model. @@ -86,7 +87,7 @@ export interface ITokenizationTextModelPart { /** * @internal */ - tokenizeLineWithEdit(position: IPosition, length: number, newText: string): LineTokens | null; + tokenizeLineWithEdit(lineNumber: number, edit: LineEditWithAdditionalLines): ITokenizeLineWithEditResult; getLanguageId(): string; getLanguageIdAtPosition(lineNumber: number, column: number): string; @@ -96,6 +97,32 @@ export interface ITokenizationTextModelPart { readonly backgroundTokenizationState: BackgroundTokenizationState; } +export class LineEditWithAdditionalLines { + public static replace(range: OffsetRange, text: string): LineEditWithAdditionalLines { + return new LineEditWithAdditionalLines( + OffsetEdit.replace(range, text), + null, + ); + } + + constructor( + /** + * The edit for the main line. + */ + readonly lineEdit: OffsetEdit, + + /** + * Full lines appended after the main line. + */ + readonly additionalLines: string[] | null, + ) { } +} + +export interface ITokenizeLineWithEditResult { + readonly mainLineTokens: LineTokens | null; + readonly additionalLines: LineTokens[] | null; +} + export const enum BackgroundTokenizationState { InProgress = 1, Completed = 2, diff --git a/src/vs/editor/common/tokens/contiguousMultilineTokens.ts b/src/vs/editor/common/tokens/contiguousMultilineTokens.ts index f4d267fba0a..3e3e8886f1b 100644 --- a/src/vs/editor/common/tokens/contiguousMultilineTokens.ts +++ b/src/vs/editor/common/tokens/contiguousMultilineTokens.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as arrays from 'vs/base/common/arrays'; -import { readUInt32BE, writeUInt32BE } from 'vs/base/common/buffer'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { countEOL } from 'vs/editor/common/core/eolCounter'; -import { ContiguousTokensEditing } from 'vs/editor/common/tokens/contiguousTokensEditing'; -import { LineRange } from 'vs/editor/common/core/lineRange'; +import * as arrays from '../../../base/common/arrays.js'; +import { readUInt32BE, writeUInt32BE } from '../../../base/common/buffer.js'; +import { Position } from '../core/position.js'; +import { IRange } from '../core/range.js'; +import { countEOL } from '../core/eolCounter.js'; +import { ContiguousTokensEditing } from './contiguousTokensEditing.js'; +import { LineRange } from '../core/lineRange.js'; /** * Represents contiguous tokens over a contiguous range of lines. diff --git a/src/vs/editor/common/tokens/contiguousMultilineTokensBuilder.ts b/src/vs/editor/common/tokens/contiguousMultilineTokensBuilder.ts index 0c46da70b0a..f2b34cc9cd1 100644 --- a/src/vs/editor/common/tokens/contiguousMultilineTokensBuilder.ts +++ b/src/vs/editor/common/tokens/contiguousMultilineTokensBuilder.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { readUInt32BE, writeUInt32BE } from 'vs/base/common/buffer'; -import { ContiguousMultilineTokens } from 'vs/editor/common/tokens/contiguousMultilineTokens'; +import { readUInt32BE, writeUInt32BE } from '../../../base/common/buffer.js'; +import { ContiguousMultilineTokens } from './contiguousMultilineTokens.js'; export class ContiguousMultilineTokensBuilder { diff --git a/src/vs/editor/common/tokens/contiguousTokensEditing.ts b/src/vs/editor/common/tokens/contiguousTokensEditing.ts index 1ccb5b5ba72..28d444a2df0 100644 --- a/src/vs/editor/common/tokens/contiguousTokensEditing.ts +++ b/src/vs/editor/common/tokens/contiguousTokensEditing.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; +import { LineTokens } from './lineTokens.js'; export const EMPTY_LINE_TOKENS = (new Uint32Array(0)).buffer; diff --git a/src/vs/editor/common/tokens/contiguousTokensStore.ts b/src/vs/editor/common/tokens/contiguousTokensStore.ts index 02b47bfd4f0..4134eee8507 100644 --- a/src/vs/editor/common/tokens/contiguousTokensStore.ts +++ b/src/vs/editor/common/tokens/contiguousTokensStore.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as arrays from 'vs/base/common/arrays'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { ContiguousTokensEditing, EMPTY_LINE_TOKENS, toUint32Array } from 'vs/editor/common/tokens/contiguousTokensEditing'; -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { ILanguageIdCodec } from 'vs/editor/common/languages'; -import { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts, TokenMetadata } from 'vs/editor/common/encodedTokenAttributes'; -import { ITextModel } from 'vs/editor/common/model'; -import { ContiguousMultilineTokens } from 'vs/editor/common/tokens/contiguousMultilineTokens'; +import * as arrays from '../../../base/common/arrays.js'; +import { Position } from '../core/position.js'; +import { IRange } from '../core/range.js'; +import { ContiguousTokensEditing, EMPTY_LINE_TOKENS, toUint32Array } from './contiguousTokensEditing.js'; +import { LineTokens } from './lineTokens.js'; +import { ILanguageIdCodec } from '../languages.js'; +import { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts, TokenMetadata } from '../encodedTokenAttributes.js'; +import { ITextModel } from '../model.js'; +import { ContiguousMultilineTokens } from './contiguousMultilineTokens.js'; /** * Represents contiguous tokens in a text model. diff --git a/src/vs/editor/common/tokens/lineTokens.ts b/src/vs/editor/common/tokens/lineTokens.ts index 67cdf815001..6409d662db5 100644 --- a/src/vs/editor/common/tokens/lineTokens.ts +++ b/src/vs/editor/common/tokens/lineTokens.ts @@ -3,10 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ILanguageIdCodec } from 'vs/editor/common/languages'; -import { FontStyle, ColorId, StandardTokenType, MetadataConsts, TokenMetadata, ITokenPresentation } from 'vs/editor/common/encodedTokenAttributes'; -import { IPosition } from 'vs/editor/common/core/position'; -import { ITextModel } from 'vs/editor/common/model'; +import { ILanguageIdCodec } from '../languages.js'; +import { FontStyle, ColorId, StandardTokenType, MetadataConsts, TokenMetadata, ITokenPresentation } from '../encodedTokenAttributes.js'; +import { IPosition } from '../core/position.js'; +import { ITextModel } from '../model.js'; +import { OffsetRange } from '../core/offsetRange.js'; +import { TokenArray, TokenArrayBuilder } from './tokenArray.js'; + export interface IViewLineTokens { languageIdCodec: ILanguageIdCodec; @@ -27,20 +30,6 @@ export interface IViewLineTokens { } export class LineTokens implements IViewLineTokens { - _lineTokensBrand: void = undefined; - - private readonly _tokens: Uint32Array; - private readonly _tokensCount: number; - private readonly _text: string; - - public readonly languageIdCodec: ILanguageIdCodec; - - public static defaultTokenMetadata = ( - (FontStyle.None << MetadataConsts.FONT_STYLE_OFFSET) - | (ColorId.DefaultForeground << MetadataConsts.FOREGROUND_OFFSET) - | (ColorId.DefaultBackground << MetadataConsts.BACKGROUND_OFFSET) - ) >>> 0; - public static createEmpty(lineContent: string, decoder: ILanguageIdCodec): LineTokens { const defaultMetadata = LineTokens.defaultTokenMetadata; @@ -63,6 +52,54 @@ export class LineTokens implements IViewLineTokens { return new LineTokens(new Uint32Array(tokens), fullText, decoder); } + public static convertToEndOffset(tokens: Uint32Array, lineTextLength: number): void { + const tokenCount = (tokens.length >>> 1); + const lastTokenIndex = tokenCount - 1; + for (let tokenIndex = 0; tokenIndex < lastTokenIndex; tokenIndex++) { + tokens[tokenIndex << 1] = tokens[(tokenIndex + 1) << 1]; + } + tokens[lastTokenIndex << 1] = lineTextLength; + } + + public static findIndexInTokensArray(tokens: Uint32Array, desiredIndex: number): number { + if (tokens.length <= 2) { + return 0; + } + + let low = 0; + let high = (tokens.length >>> 1) - 1; + + while (low < high) { + + const mid = low + Math.floor((high - low) / 2); + const endOffset = tokens[(mid << 1)]; + + if (endOffset === desiredIndex) { + return mid + 1; + } else if (endOffset < desiredIndex) { + low = mid + 1; + } else if (endOffset > desiredIndex) { + high = mid; + } + } + + return low; + } + + _lineTokensBrand: void = undefined; + + private readonly _tokens: Uint32Array; + private readonly _tokensCount: number; + private readonly _text: string; + + public readonly languageIdCodec: ILanguageIdCodec; + + public static defaultTokenMetadata = ( + (FontStyle.None << MetadataConsts.FONT_STYLE_OFFSET) + | (ColorId.DefaultForeground << MetadataConsts.FOREGROUND_OFFSET) + | (ColorId.DefaultBackground << MetadataConsts.BACKGROUND_OFFSET) + ) >>> 0; + constructor(tokens: Uint32Array, text: string, decoder: ILanguageIdCodec) { this._tokens = tokens; this._tokensCount = (this._tokens.length >>> 1); @@ -166,40 +203,6 @@ export class LineTokens implements IViewLineTokens { return new SliceLineTokens(this, startOffset, endOffset, deltaOffset); } - public static convertToEndOffset(tokens: Uint32Array, lineTextLength: number): void { - const tokenCount = (tokens.length >>> 1); - const lastTokenIndex = tokenCount - 1; - for (let tokenIndex = 0; tokenIndex < lastTokenIndex; tokenIndex++) { - tokens[tokenIndex << 1] = tokens[(tokenIndex + 1) << 1]; - } - tokens[lastTokenIndex << 1] = lineTextLength; - } - - public static findIndexInTokensArray(tokens: Uint32Array, desiredIndex: number): number { - if (tokens.length <= 2) { - return 0; - } - - let low = 0; - let high = (tokens.length >>> 1) - 1; - - while (low < high) { - - const mid = low + Math.floor((high - low) / 2); - const endOffset = tokens[(mid << 1)]; - - if (endOffset === desiredIndex) { - return mid + 1; - } else if (endOffset < desiredIndex) { - low = mid + 1; - } else if (endOffset > desiredIndex) { - high = mid; - } - } - - return low; - } - /** * @pure * @param insertTokens Must be sorted by offset. @@ -247,6 +250,23 @@ export class LineTokens implements IViewLineTokens { return new LineTokens(new Uint32Array(newTokens), text, this.languageIdCodec); } + public getTokensInRange(range: OffsetRange): TokenArray { + const builder = new TokenArrayBuilder(); + + const startTokenIndex = this.findTokenIndexAtOffset(range.start); + const endTokenIndex = this.findTokenIndexAtOffset(range.endExclusive); + + for (let tokenIndex = startTokenIndex; tokenIndex <= endTokenIndex; tokenIndex++) { + const tokenRange = new OffsetRange(this.getStartOffset(tokenIndex), this.getEndOffset(tokenIndex)); + const length = tokenRange.intersectionLength(range); + if (length > 0) { + builder.add(length, this.getMetadata(tokenIndex)); + } + } + + return builder.build(); + } + public getTokenText(tokenIndex: number): string { const startOffset = this.getStartOffset(tokenIndex); const endOffset = this.getEndOffset(tokenIndex); diff --git a/src/vs/editor/common/tokens/sparseMultilineTokens.ts b/src/vs/editor/common/tokens/sparseMultilineTokens.ts index e46f9aeca36..50887a06af6 100644 --- a/src/vs/editor/common/tokens/sparseMultilineTokens.ts +++ b/src/vs/editor/common/tokens/sparseMultilineTokens.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { countEOL } from 'vs/editor/common/core/eolCounter'; +import { CharCode } from '../../../base/common/charCode.js'; +import { Position } from '../core/position.js'; +import { IRange, Range } from '../core/range.js'; +import { countEOL } from '../core/eolCounter.js'; /** * Represents sparse tokens over a contiguous range of lines. diff --git a/src/vs/editor/common/tokens/sparseTokensStore.ts b/src/vs/editor/common/tokens/sparseTokensStore.ts index 90a1f3ab818..dd89936c989 100644 --- a/src/vs/editor/common/tokens/sparseTokensStore.ts +++ b/src/vs/editor/common/tokens/sparseTokensStore.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as arrays from 'vs/base/common/arrays'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { SparseMultilineTokens } from 'vs/editor/common/tokens/sparseMultilineTokens'; -import { ILanguageIdCodec } from 'vs/editor/common/languages'; -import { MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; +import * as arrays from '../../../base/common/arrays.js'; +import { IRange, Range } from '../core/range.js'; +import { LineTokens } from './lineTokens.js'; +import { SparseMultilineTokens } from './sparseMultilineTokens.js'; +import { ILanguageIdCodec } from '../languages.js'; +import { MetadataConsts } from '../encodedTokenAttributes.js'; /** * Represents sparse tokens in a text model. diff --git a/src/vs/editor/common/tokens/tokenArray.ts b/src/vs/editor/common/tokens/tokenArray.ts new file mode 100644 index 00000000000..1b6891f223d --- /dev/null +++ b/src/vs/editor/common/tokens/tokenArray.ts @@ -0,0 +1,79 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { OffsetRange } from '../core/offsetRange.js'; + +/** + * This class represents a sequence of tokens. + * Conceptually, each token has a length and a metadata number. + * A token array might be used to annotate a string with metadata. + * Use {@link TokenArrayBuilder} to efficiently create a token array. + * + * TODO: Make this class more efficient (e.g. by using a Int32Array). +*/ +export class TokenArray { + public static create(tokenInfo: TokenInfo[]): TokenArray { + return new TokenArray(tokenInfo); + } + + private constructor( + private readonly _tokenInfo: TokenInfo[], + ) { } + + public forEach(cb: (range: OffsetRange, tokenInfo: TokenInfo) => void): void { + let lengthSum = 0; + for (const tokenInfo of this._tokenInfo) { + const range = new OffsetRange(lengthSum, lengthSum + tokenInfo.length); + cb(range, tokenInfo); + lengthSum += tokenInfo.length; + } + } + + public slice(range: OffsetRange): TokenArray { + const result: TokenInfo[] = []; + let lengthSum = 0; + for (const tokenInfo of this._tokenInfo) { + const tokenStart = lengthSum; + const tokenEndEx = tokenStart + tokenInfo.length; + if (tokenEndEx > range.start) { + if (tokenStart >= range.endExclusive) { + break; + } + + const deltaBefore = Math.max(0, range.start - tokenStart); + const deltaAfter = Math.max(0, tokenEndEx - range.endExclusive); + + result.push(new TokenInfo(tokenInfo.length - deltaBefore - deltaAfter, tokenInfo.metadata)); + } + + lengthSum += tokenInfo.length; + } + return TokenArray.create(result); + } +} + +export type TokenMetadata = number; + +export class TokenInfo { + constructor( + public readonly length: number, + public readonly metadata: TokenMetadata, + ) { } +} + +/** + * TODO: Make this class more efficient (e.g. by using a Int32Array). +*/ +export class TokenArrayBuilder { + private readonly _tokens: TokenInfo[] = []; + + public add(length: number, metadata: TokenMetadata): void { + this._tokens.push(new TokenInfo(length, metadata)); + } + + public build(): TokenArray { + return TokenArray.create(this._tokens); + } +} diff --git a/src/vs/editor/common/viewEventHandler.ts b/src/vs/editor/common/viewEventHandler.ts index a80b59c50ea..952bfdd1d8f 100644 --- a/src/vs/editor/common/viewEventHandler.ts +++ b/src/vs/editor/common/viewEventHandler.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import * as viewEvents from 'vs/editor/common/viewEvents'; +import { Disposable } from '../../base/common/lifecycle.js'; +import * as viewEvents from './viewEvents.js'; export class ViewEventHandler extends Disposable { diff --git a/src/vs/editor/common/viewEvents.ts b/src/vs/editor/common/viewEvents.ts index f607afe73e9..ce107651bac 100644 --- a/src/vs/editor/common/viewEvents.ts +++ b/src/vs/editor/common/viewEvents.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ScrollEvent } from 'vs/base/common/scrollable'; -import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { IModelDecorationsChangedEvent } from 'vs/editor/common/textModelEvents'; -import { IColorTheme } from 'vs/platform/theme/common/themeService'; +import { ScrollEvent } from '../../base/common/scrollable.js'; +import { ConfigurationChangedEvent, EditorOption } from './config/editorOptions.js'; +import { Range } from './core/range.js'; +import { Selection } from './core/selection.js'; +import { CursorChangeReason } from './cursorEvents.js'; +import { ScrollType } from './editorCommon.js'; +import { IModelDecorationsChangedEvent } from './textModelEvents.js'; +import { IColorTheme } from '../../platform/theme/common/themeService.js'; export const enum ViewEventType { ViewCompositionStart, diff --git a/src/vs/editor/common/viewLayout/lineDecorations.ts b/src/vs/editor/common/viewLayout/lineDecorations.ts index 381e8cfb4b1..c607968187d 100644 --- a/src/vs/editor/common/viewLayout/lineDecorations.ts +++ b/src/vs/editor/common/viewLayout/lineDecorations.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import { Constants } from 'vs/base/common/uint'; -import { LinePartMetadata } from 'vs/editor/common/viewLayout/linePart'; -import { InlineDecoration, InlineDecorationType } from 'vs/editor/common/viewModel'; +import * as strings from '../../../base/common/strings.js'; +import { Constants } from '../../../base/common/uint.js'; +import { LinePartMetadata } from './linePart.js'; +import { InlineDecoration, InlineDecorationType } from '../viewModel.js'; export class LineDecoration { _lineDecorationBrand: void = undefined; diff --git a/src/vs/editor/common/viewLayout/linesLayout.ts b/src/vs/editor/common/viewLayout/linesLayout.ts index 71bf9d5b956..f7988abddce 100644 --- a/src/vs/editor/common/viewLayout/linesLayout.ts +++ b/src/vs/editor/common/viewLayout/linesLayout.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IEditorWhitespace, IPartialViewLinesViewportData, IViewWhitespaceViewportData, IWhitespaceChangeAccessor } from 'vs/editor/common/viewModel'; -import * as strings from 'vs/base/common/strings'; +import { IEditorWhitespace, IPartialViewLinesViewportData, IViewWhitespaceViewportData, IWhitespaceChangeAccessor } from '../viewModel.js'; +import * as strings from '../../../base/common/strings.js'; interface IPendingChange { id: string; newAfterLineNumber: number; newHeight: number } interface IPendingRemove { id: string } diff --git a/src/vs/editor/common/viewLayout/viewLayout.ts b/src/vs/editor/common/viewLayout/viewLayout.ts index e6209088e75..767a308db9a 100644 --- a/src/vs/editor/common/viewLayout/viewLayout.ts +++ b/src/vs/editor/common/viewLayout/viewLayout.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event, Emitter } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { IScrollPosition, ScrollEvent, Scrollable, ScrollbarVisibility, INewScrollPosition } from 'vs/base/common/scrollable'; -import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { LinesLayout } from 'vs/editor/common/viewLayout/linesLayout'; -import { IEditorWhitespace, IPartialViewLinesViewportData, IViewLayout, IViewWhitespaceViewportData, IWhitespaceChangeAccessor, Viewport } from 'vs/editor/common/viewModel'; -import { ContentSizeChangedEvent } from 'vs/editor/common/viewModelEventDispatcher'; +import { Event, Emitter } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { IScrollPosition, ScrollEvent, Scrollable, ScrollbarVisibility, INewScrollPosition } from '../../../base/common/scrollable.js'; +import { ConfigurationChangedEvent, EditorOption } from '../config/editorOptions.js'; +import { ScrollType } from '../editorCommon.js'; +import { IEditorConfiguration } from '../config/editorConfiguration.js'; +import { LinesLayout } from './linesLayout.js'; +import { IEditorWhitespace, IPartialViewLinesViewportData, IViewLayout, IViewWhitespaceViewportData, IWhitespaceChangeAccessor, Viewport } from '../viewModel.js'; +import { ContentSizeChangedEvent } from '../viewModelEventDispatcher.js'; const SMOOTH_SCROLLING_TIME = 125; diff --git a/src/vs/editor/common/viewLayout/viewLineRenderer.ts b/src/vs/editor/common/viewLayout/viewLineRenderer.ts index 0e94382f9a8..b19b34e040c 100644 --- a/src/vs/editor/common/viewLayout/viewLineRenderer.ts +++ b/src/vs/editor/common/viewLayout/viewLineRenderer.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { CharCode } from 'vs/base/common/charCode'; -import * as strings from 'vs/base/common/strings'; -import { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { StringBuilder } from 'vs/editor/common/core/stringBuilder'; -import { LineDecoration, LineDecorationsNormalizer } from 'vs/editor/common/viewLayout/lineDecorations'; -import { InlineDecorationType } from 'vs/editor/common/viewModel'; -import { LinePart, LinePartMetadata } from 'vs/editor/common/viewLayout/linePart'; +import * as nls from '../../../nls.js'; +import { CharCode } from '../../../base/common/charCode.js'; +import * as strings from '../../../base/common/strings.js'; +import { IViewLineTokens } from '../tokens/lineTokens.js'; +import { StringBuilder } from '../core/stringBuilder.js'; +import { LineDecoration, LineDecorationsNormalizer } from './lineDecorations.js'; +import { InlineDecorationType } from '../viewModel.js'; +import { LinePart, LinePartMetadata } from './linePart.js'; export const enum RenderWhitespace { None = 0, diff --git a/src/vs/editor/common/viewLayout/viewLinesViewportData.ts b/src/vs/editor/common/viewLayout/viewLinesViewportData.ts index 6e072c52648..91eaceca811 100644 --- a/src/vs/editor/common/viewLayout/viewLinesViewportData.ts +++ b/src/vs/editor/common/viewLayout/viewLinesViewportData.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IPartialViewLinesViewportData, IViewModel, IViewWhitespaceViewportData, ViewLineRenderingData, ViewModelDecoration } from 'vs/editor/common/viewModel'; +import { Range } from '../core/range.js'; +import { Selection } from '../core/selection.js'; +import { IPartialViewLinesViewportData, IViewModel, IViewWhitespaceViewportData, ViewLineRenderingData, ViewModelDecoration } from '../viewModel.js'; /** * Contains all data needed to render at a specific viewport. diff --git a/src/vs/editor/common/viewModel.ts b/src/vs/editor/common/viewModel.ts index 3ff0d5f0917..444bac5d610 100644 --- a/src/vs/editor/common/viewModel.ts +++ b/src/vs/editor/common/viewModel.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as arrays from 'vs/base/common/arrays'; -import { IScrollPosition, Scrollable } from 'vs/base/common/scrollable'; -import * as strings from 'vs/base/common/strings'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { CursorConfiguration, CursorState, EditOperationType, IColumnSelectData, ICursorSimpleModel, PartialCursorState } from 'vs/editor/common/cursorCommon'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { INewScrollPosition, ScrollType } from 'vs/editor/common/editorCommon'; -import { EditorTheme } from 'vs/editor/common/editorTheme'; -import { EndOfLinePreference, IGlyphMarginLanesModel, IModelDecorationOptions, ITextModel, PositionAffinity } from 'vs/editor/common/model'; -import { ILineBreaksComputer, InjectedText } from 'vs/editor/common/modelLineProjectionData'; -import { BracketGuideOptions, IActiveIndentGuideInfo, IndentGuide } from 'vs/editor/common/textModelGuides'; -import { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { ViewEventHandler } from 'vs/editor/common/viewEventHandler'; -import { VerticalRevealType } from 'vs/editor/common/viewEvents'; +import * as arrays from '../../base/common/arrays.js'; +import { IScrollPosition, Scrollable } from '../../base/common/scrollable.js'; +import * as strings from '../../base/common/strings.js'; +import { IPosition, Position } from './core/position.js'; +import { Range } from './core/range.js'; +import { CursorConfiguration, CursorState, EditOperationType, IColumnSelectData, ICursorSimpleModel, PartialCursorState } from './cursorCommon.js'; +import { CursorChangeReason } from './cursorEvents.js'; +import { INewScrollPosition, ScrollType } from './editorCommon.js'; +import { EditorTheme } from './editorTheme.js'; +import { EndOfLinePreference, IGlyphMarginLanesModel, IModelDecorationOptions, ITextModel, PositionAffinity } from './model.js'; +import { ILineBreaksComputer, InjectedText } from './modelLineProjectionData.js'; +import { BracketGuideOptions, IActiveIndentGuideInfo, IndentGuide } from './textModelGuides.js'; +import { IViewLineTokens } from './tokens/lineTokens.js'; +import { ViewEventHandler } from './viewEventHandler.js'; +import { VerticalRevealType } from './viewEvents.js'; export interface IViewModel extends ICursorSimpleModel { diff --git a/src/vs/editor/common/viewModel/glyphLanesModel.ts b/src/vs/editor/common/viewModel/glyphLanesModel.ts index c63c9b24f8d..3efbb9e7cb2 100644 --- a/src/vs/editor/common/viewModel/glyphLanesModel.ts +++ b/src/vs/editor/common/viewModel/glyphLanesModel.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { GlyphMarginLane, IGlyphMarginLanesModel } from 'vs/editor/common/model'; +import { Range } from '../core/range.js'; +import { GlyphMarginLane, IGlyphMarginLanesModel } from '../model.js'; const MAX_LANE = GlyphMarginLane.Right; diff --git a/src/vs/editor/common/viewModel/minimapTokensColorTracker.ts b/src/vs/editor/common/viewModel/minimapTokensColorTracker.ts index a063d37a0ce..a0f36078c5b 100644 --- a/src/vs/editor/common/viewModel/minimapTokensColorTracker.ts +++ b/src/vs/editor/common/viewModel/minimapTokensColorTracker.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, markAsSingleton } from 'vs/base/common/lifecycle'; -import { RGBA8 } from 'vs/editor/common/core/rgba'; -import { TokenizationRegistry } from 'vs/editor/common/languages'; -import { ColorId } from 'vs/editor/common/encodedTokenAttributes'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, markAsSingleton } from '../../../base/common/lifecycle.js'; +import { RGBA8 } from '../core/rgba.js'; +import { TokenizationRegistry } from '../languages.js'; +import { ColorId } from '../encodedTokenAttributes.js'; export class MinimapTokensColorTracker extends Disposable { private static _INSTANCE: MinimapTokensColorTracker | null = null; diff --git a/src/vs/editor/common/viewModel/modelLineProjection.ts b/src/vs/editor/common/viewModel/modelLineProjection.ts index e66499cd98e..b01a1de2898 100644 --- a/src/vs/editor/common/viewModel/modelLineProjection.ts +++ b/src/vs/editor/common/viewModel/modelLineProjection.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { EndOfLinePreference, ITextModel, PositionAffinity } from 'vs/editor/common/model'; -import { LineInjectedText } from 'vs/editor/common/textModelEvents'; -import { InjectedText, ModelLineProjectionData } from 'vs/editor/common/modelLineProjectionData'; -import { SingleLineInlineDecoration, ViewLineData } from 'vs/editor/common/viewModel'; +import { LineTokens } from '../tokens/lineTokens.js'; +import { Position } from '../core/position.js'; +import { IRange } from '../core/range.js'; +import { EndOfLinePreference, ITextModel, PositionAffinity } from '../model.js'; +import { LineInjectedText } from '../textModelEvents.js'; +import { InjectedText, ModelLineProjectionData } from '../modelLineProjectionData.js'; +import { SingleLineInlineDecoration, ViewLineData } from '../viewModel.js'; export interface IModelLineProjection { isVisible(): boolean; @@ -213,11 +213,29 @@ class ModelLineProjection implements IModelLineProjection { let lineWithInjections: LineTokens; if (injectionOffsets) { - lineWithInjections = model.tokenization.getLineTokens(modelLineNumber).withInserted(injectionOffsets.map((offset, idx) => ({ - offset, - text: injectionOptions![idx].content, - tokenMetadata: LineTokens.defaultTokenMetadata - }))); + const tokensToInsert: { offset: number; text: string; tokenMetadata: number }[] = []; + + for (let idx = 0; idx < injectionOffsets.length; idx++) { + const offset = injectionOffsets[idx]; + const tokens = injectionOptions![idx].tokens; + if (tokens) { + tokens.forEach((range, info) => { + tokensToInsert.push({ + offset, + text: range.substring(injectionOptions![idx].content), + tokenMetadata: info.metadata, + }); + }); + } else { + tokensToInsert.push({ + offset, + text: injectionOptions![idx].content, + tokenMetadata: LineTokens.defaultTokenMetadata, + }); + } + } + + lineWithInjections = model.tokenization.getLineTokens(modelLineNumber).withInserted(tokensToInsert); } else { lineWithInjections = model.tokenization.getLineTokens(modelLineNumber); } diff --git a/src/vs/editor/common/viewModel/monospaceLineBreaksComputer.ts b/src/vs/editor/common/viewModel/monospaceLineBreaksComputer.ts index 05a54a8ab29..434e322b6f0 100644 --- a/src/vs/editor/common/viewModel/monospaceLineBreaksComputer.ts +++ b/src/vs/editor/common/viewModel/monospaceLineBreaksComputer.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import * as strings from 'vs/base/common/strings'; -import { WrappingIndent, IComputedEditorOptions, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { CharacterClassifier } from 'vs/editor/common/core/characterClassifier'; -import { FontInfo } from 'vs/editor/common/config/fontInfo'; -import { LineInjectedText } from 'vs/editor/common/textModelEvents'; -import { InjectedTextOptions } from 'vs/editor/common/model'; -import { ILineBreaksComputerFactory, ILineBreaksComputer, ModelLineProjectionData } from 'vs/editor/common/modelLineProjectionData'; +import { CharCode } from '../../../base/common/charCode.js'; +import * as strings from '../../../base/common/strings.js'; +import { WrappingIndent, IComputedEditorOptions, EditorOption } from '../config/editorOptions.js'; +import { CharacterClassifier } from '../core/characterClassifier.js'; +import { FontInfo } from '../config/fontInfo.js'; +import { LineInjectedText } from '../textModelEvents.js'; +import { InjectedTextOptions } from '../model.js'; +import { ILineBreaksComputerFactory, ILineBreaksComputer, ModelLineProjectionData } from '../modelLineProjectionData.js'; export class MonospaceLineBreaksComputerFactory implements ILineBreaksComputerFactory { public static create(options: IComputedEditorOptions): MonospaceLineBreaksComputerFactory { diff --git a/src/vs/editor/common/viewModel/viewContext.ts b/src/vs/editor/common/viewModel/viewContext.ts index 1b401b18f76..3669ff7e6f4 100644 --- a/src/vs/editor/common/viewModel/viewContext.ts +++ b/src/vs/editor/common/viewModel/viewContext.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { ViewEventHandler } from 'vs/editor/common/viewEventHandler'; -import { IViewLayout, IViewModel } from 'vs/editor/common/viewModel'; -import { IColorTheme } from 'vs/platform/theme/common/themeService'; -import { EditorTheme } from 'vs/editor/common/editorTheme'; +import { IEditorConfiguration } from '../config/editorConfiguration.js'; +import { ViewEventHandler } from '../viewEventHandler.js'; +import { IViewLayout, IViewModel } from '../viewModel.js'; +import { IColorTheme } from '../../../platform/theme/common/themeService.js'; +import { EditorTheme } from '../editorTheme.js'; export class ViewContext { diff --git a/src/vs/editor/common/viewModel/viewModelDecorations.ts b/src/vs/editor/common/viewModel/viewModelDecorations.ts index 4725c903073..553cc7d3389 100644 --- a/src/vs/editor/common/viewModel/viewModelDecorations.ts +++ b/src/vs/editor/common/viewModel/viewModelDecorations.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { IModelDecoration, ITextModel, PositionAffinity } from 'vs/editor/common/model'; -import { IViewModelLines } from 'vs/editor/common/viewModel/viewModelLines'; -import { ICoordinatesConverter, InlineDecoration, InlineDecorationType, ViewModelDecoration } from 'vs/editor/common/viewModel'; -import { filterValidationDecorations } from 'vs/editor/common/config/editorOptions'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { IEditorConfiguration } from '../config/editorConfiguration.js'; +import { IModelDecoration, ITextModel, PositionAffinity } from '../model.js'; +import { IViewModelLines } from './viewModelLines.js'; +import { ICoordinatesConverter, InlineDecoration, InlineDecorationType, ViewModelDecoration } from '../viewModel.js'; +import { filterValidationDecorations } from '../config/editorOptions.js'; +import { StandardTokenType } from '../encodedTokenAttributes.js'; export interface IDecorationsViewportData { /** diff --git a/src/vs/editor/common/viewModel/viewModelImpl.ts b/src/vs/editor/common/viewModel/viewModelImpl.ts index 50366d54958..bbdd92aab93 100644 --- a/src/vs/editor/common/viewModel/viewModelImpl.ts +++ b/src/vs/editor/common/viewModel/viewModelImpl.ts @@ -3,43 +3,43 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ArrayQueue } from 'vs/base/common/arrays'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { Color } from 'vs/base/common/color'; -import { Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import * as platform from 'vs/base/common/platform'; -import * as strings from 'vs/base/common/strings'; -import { ConfigurationChangedEvent, EditorOption, EDITOR_FONT_DEFAULTS, filterValidationDecorations } from 'vs/editor/common/config/editorOptions'; -import { CursorsController } from 'vs/editor/common/cursor/cursor'; -import { CursorConfiguration, CursorState, EditOperationType, IColumnSelectData, PartialCursorState } from 'vs/editor/common/cursorCommon'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ISelection, Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorState, IViewState, ScrollType } from 'vs/editor/common/editorCommon'; -import { IEditorConfiguration } from 'vs/editor/common/config/editorConfiguration'; -import { EndOfLinePreference, IAttachedView, ICursorStateComputer, IGlyphMarginLanesModel, IIdentifiedSingleEditOperation, ITextModel, PositionAffinity, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { IActiveIndentGuideInfo, BracketGuideOptions, IndentGuide } from 'vs/editor/common/textModelGuides'; -import { ModelDecorationMinimapOptions, ModelDecorationOptions, ModelDecorationOverviewRulerOptions } from 'vs/editor/common/model/textModel'; -import * as textModelEvents from 'vs/editor/common/textModelEvents'; -import { TokenizationRegistry } from 'vs/editor/common/languages'; -import { ColorId } from 'vs/editor/common/encodedTokenAttributes'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { tokenizeLineToHTML } from 'vs/editor/common/languages/textToHtmlTokenizer'; -import { EditorTheme } from 'vs/editor/common/editorTheme'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { ViewLayout } from 'vs/editor/common/viewLayout/viewLayout'; -import { MinimapTokensColorTracker } from 'vs/editor/common/viewModel/minimapTokensColorTracker'; -import { ILineBreaksComputer, ILineBreaksComputerFactory, InjectedText } from 'vs/editor/common/modelLineProjectionData'; -import { ViewEventHandler } from 'vs/editor/common/viewEventHandler'; -import { ICoordinatesConverter, InlineDecoration, IViewModel, IWhitespaceChangeAccessor, MinimapLinesRenderingData, OverviewRulerDecorationsGroup, ViewLineData, ViewLineRenderingData, ViewModelDecoration } from 'vs/editor/common/viewModel'; -import { ViewModelDecorations } from 'vs/editor/common/viewModel/viewModelDecorations'; -import { FocusChangedEvent, HiddenAreasChangedEvent, ModelContentChangedEvent, ModelDecorationsChangedEvent, ModelLanguageChangedEvent, ModelLanguageConfigurationChangedEvent, ModelOptionsChangedEvent, ModelTokensChangedEvent, OutgoingViewModelEvent, ReadOnlyEditAttemptEvent, ScrollChangedEvent, ViewModelEventDispatcher, ViewModelEventsCollector, ViewZonesChangedEvent } from 'vs/editor/common/viewModelEventDispatcher'; -import { IViewModelLines, ViewModelLinesFromModelAsIs, ViewModelLinesFromProjectedModel } from 'vs/editor/common/viewModel/viewModelLines'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { GlyphMarginLanesModel } from 'vs/editor/common/viewModel/glyphLanesModel'; +import { ArrayQueue } from '../../../base/common/arrays.js'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { Color } from '../../../base/common/color.js'; +import { Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import * as platform from '../../../base/common/platform.js'; +import * as strings from '../../../base/common/strings.js'; +import { ConfigurationChangedEvent, EditorOption, EDITOR_FONT_DEFAULTS, filterValidationDecorations } from '../config/editorOptions.js'; +import { CursorsController } from '../cursor/cursor.js'; +import { CursorConfiguration, CursorState, EditOperationType, IColumnSelectData, PartialCursorState } from '../cursorCommon.js'; +import { CursorChangeReason } from '../cursorEvents.js'; +import { IPosition, Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { ISelection, Selection } from '../core/selection.js'; +import { ICommand, ICursorState, IViewState, ScrollType } from '../editorCommon.js'; +import { IEditorConfiguration } from '../config/editorConfiguration.js'; +import { EndOfLinePreference, IAttachedView, ICursorStateComputer, IGlyphMarginLanesModel, IIdentifiedSingleEditOperation, ITextModel, PositionAffinity, TrackedRangeStickiness } from '../model.js'; +import { IActiveIndentGuideInfo, BracketGuideOptions, IndentGuide } from '../textModelGuides.js'; +import { ModelDecorationMinimapOptions, ModelDecorationOptions, ModelDecorationOverviewRulerOptions } from '../model/textModel.js'; +import * as textModelEvents from '../textModelEvents.js'; +import { TokenizationRegistry } from '../languages.js'; +import { ColorId } from '../encodedTokenAttributes.js'; +import { ILanguageConfigurationService } from '../languages/languageConfigurationRegistry.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../languages/modesRegistry.js'; +import { tokenizeLineToHTML } from '../languages/textToHtmlTokenizer.js'; +import { EditorTheme } from '../editorTheme.js'; +import * as viewEvents from '../viewEvents.js'; +import { ViewLayout } from '../viewLayout/viewLayout.js'; +import { MinimapTokensColorTracker } from './minimapTokensColorTracker.js'; +import { ILineBreaksComputer, ILineBreaksComputerFactory, InjectedText } from '../modelLineProjectionData.js'; +import { ViewEventHandler } from '../viewEventHandler.js'; +import { ICoordinatesConverter, InlineDecoration, IViewModel, IWhitespaceChangeAccessor, MinimapLinesRenderingData, OverviewRulerDecorationsGroup, ViewLineData, ViewLineRenderingData, ViewModelDecoration } from '../viewModel.js'; +import { ViewModelDecorations } from './viewModelDecorations.js'; +import { FocusChangedEvent, HiddenAreasChangedEvent, ModelContentChangedEvent, ModelDecorationsChangedEvent, ModelLanguageChangedEvent, ModelLanguageConfigurationChangedEvent, ModelOptionsChangedEvent, ModelTokensChangedEvent, OutgoingViewModelEvent, ReadOnlyEditAttemptEvent, ScrollChangedEvent, ViewModelEventDispatcher, ViewModelEventsCollector, ViewZonesChangedEvent } from '../viewModelEventDispatcher.js'; +import { IViewModelLines, ViewModelLinesFromModelAsIs, ViewModelLinesFromProjectedModel } from './viewModelLines.js'; +import { IThemeService } from '../../../platform/theme/common/themeService.js'; +import { GlyphMarginLanesModel } from './glyphLanesModel.js'; const USE_IDENTITY_LINES_COLLECTION = true; diff --git a/src/vs/editor/common/viewModel/viewModelLines.ts b/src/vs/editor/common/viewModel/viewModelLines.ts index bcabeffed2b..8c1142270c5 100644 --- a/src/vs/editor/common/viewModel/viewModelLines.ts +++ b/src/vs/editor/common/viewModel/viewModelLines.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as arrays from 'vs/base/common/arrays'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { WrappingIndent } from 'vs/editor/common/config/editorOptions'; -import { FontInfo } from 'vs/editor/common/config/fontInfo'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IModelDecoration, IModelDeltaDecoration, ITextModel, PositionAffinity } from 'vs/editor/common/model'; -import { IActiveIndentGuideInfo, BracketGuideOptions, IndentGuide, IndentGuideHorizontalLine } from 'vs/editor/common/textModelGuides'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { LineInjectedText } from 'vs/editor/common/textModelEvents'; -import * as viewEvents from 'vs/editor/common/viewEvents'; -import { createModelLineProjection, IModelLineProjection } from 'vs/editor/common/viewModel/modelLineProjection'; -import { ILineBreaksComputer, ModelLineProjectionData, InjectedText, ILineBreaksComputerFactory } from 'vs/editor/common/modelLineProjectionData'; -import { ConstantTimePrefixSumComputer } from 'vs/editor/common/model/prefixSumComputer'; -import { ICoordinatesConverter, ViewLineData } from 'vs/editor/common/viewModel'; +import * as arrays from '../../../base/common/arrays.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { WrappingIndent } from '../config/editorOptions.js'; +import { FontInfo } from '../config/fontInfo.js'; +import { IPosition, Position } from '../core/position.js'; +import { Range } from '../core/range.js'; +import { IModelDecoration, IModelDeltaDecoration, ITextModel, PositionAffinity } from '../model.js'; +import { IActiveIndentGuideInfo, BracketGuideOptions, IndentGuide, IndentGuideHorizontalLine } from '../textModelGuides.js'; +import { ModelDecorationOptions } from '../model/textModel.js'; +import { LineInjectedText } from '../textModelEvents.js'; +import * as viewEvents from '../viewEvents.js'; +import { createModelLineProjection, IModelLineProjection } from './modelLineProjection.js'; +import { ILineBreaksComputer, ModelLineProjectionData, InjectedText, ILineBreaksComputerFactory } from '../modelLineProjectionData.js'; +import { ConstantTimePrefixSumComputer } from '../model/prefixSumComputer.js'; +import { ICoordinatesConverter, ViewLineData } from '../viewModel.js'; export interface IViewModelLines extends IDisposable { createCoordinatesConverter(): ICoordinatesConverter; diff --git a/src/vs/editor/common/viewModelEventDispatcher.ts b/src/vs/editor/common/viewModelEventDispatcher.ts index 49d467a7afe..7fddb80251f 100644 --- a/src/vs/editor/common/viewModelEventDispatcher.ts +++ b/src/vs/editor/common/viewModelEventDispatcher.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ViewEventHandler } from 'vs/editor/common/viewEventHandler'; -import { ViewEvent } from 'vs/editor/common/viewEvents'; -import { IContentSizeChangedEvent } from 'vs/editor/common/editorCommon'; -import { Emitter } from 'vs/base/common/event'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents'; +import { ViewEventHandler } from './viewEventHandler.js'; +import { ViewEvent } from './viewEvents.js'; +import { IContentSizeChangedEvent } from './editorCommon.js'; +import { Emitter } from '../../base/common/event.js'; +import { Selection } from './core/selection.js'; +import { Disposable } from '../../base/common/lifecycle.js'; +import { CursorChangeReason } from './cursorEvents.js'; +import { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent } from './textModelEvents.js'; export class ViewModelEventDispatcher extends Disposable { diff --git a/src/vs/editor/contrib/anchorSelect/browser/anchorSelect.ts b/src/vs/editor/contrib/anchorSelect/browser/anchorSelect.ts index ab93153c7e8..9de6d473500 100644 --- a/src/vs/editor/contrib/anchorSelect/browser/anchorSelect.ts +++ b/src/vs/editor/contrib/anchorSelect/browser/anchorSelect.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { alert } from 'vs/base/browser/ui/aria/aria'; -import { MarkdownString } from 'vs/base/common/htmlContent'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import 'vs/css!./anchorSelect'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { TrackedRangeStickiness } from 'vs/editor/common/model'; -import { localize } from 'vs/nls'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { alert } from '../../../../base/browser/ui/aria/aria.js'; +import { MarkdownString } from '../../../../base/common/htmlContent.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import './anchorSelect.css'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { TrackedRangeStickiness } from '../../../common/model.js'; +import { localize } from '../../../../nls.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; export const SelectionAnchorSet = new RawContextKey('selectionAnchorSet', false); diff --git a/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.ts b/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.ts index ffd9e3240dd..01ba78eefb2 100644 --- a/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.ts +++ b/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Disposable } from 'vs/base/common/lifecycle'; -import 'vs/css!./bracketMatching'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IEditorContribution, IEditorDecorationsCollection } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { IModelDeltaDecoration, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import * as nls from 'vs/nls'; -import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { registerColor } from 'vs/platform/theme/common/colorRegistry'; -import { themeColorFromId } from 'vs/platform/theme/common/themeService'; - -const overviewRulerBracketMatchForeground = registerColor('editorOverviewRuler.bracketMatchForeground', { dark: '#A0A0A0', light: '#A0A0A0', hcDark: '#A0A0A0', hcLight: '#A0A0A0' }, nls.localize('overviewRulerBracketMatchForeground', 'Overview ruler marker color for matching brackets.')); +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import './bracketMatching.css'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { IModelDeltaDecoration, OverviewRulerLane, TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import * as nls from '../../../../nls.js'; +import { MenuId, MenuRegistry } from '../../../../platform/actions/common/actions.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { registerColor } from '../../../../platform/theme/common/colorRegistry.js'; +import { themeColorFromId } from '../../../../platform/theme/common/themeService.js'; + +const overviewRulerBracketMatchForeground = registerColor('editorOverviewRuler.bracketMatchForeground', '#A0A0A0', nls.localize('overviewRulerBracketMatchForeground', 'Overview ruler marker color for matching brackets.')); class JumpToBracketAction extends EditorAction { constructor() { diff --git a/src/vs/editor/contrib/bracketMatching/test/browser/bracketMatching.test.ts b/src/vs/editor/contrib/bracketMatching/test/browser/bracketMatching.test.ts index 7a5f7e106e7..e9d26789cf3 100644 --- a/src/vs/editor/contrib/bracketMatching/test/browser/bracketMatching.test.ts +++ b/src/vs/editor/contrib/bracketMatching/test/browser/bracketMatching.test.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { BracketMatchingController } from 'vs/editor/contrib/bracketMatching/browser/bracketMatching'; -import { createCodeEditorServices, instantiateTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { instantiateTextModel } from 'vs/editor/test/common/testTextModel'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { Position } from '../../../../common/core/position.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { BracketMatchingController } from '../../browser/bracketMatching.js'; +import { createCodeEditorServices, instantiateTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { instantiateTextModel } from '../../../../test/common/testTextModel.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { TestInstantiationService } from '../../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; suite('bracket matching', () => { let disposables: DisposableStore; diff --git a/src/vs/editor/contrib/caretOperations/browser/caretOperations.ts b/src/vs/editor/contrib/caretOperations/browser/caretOperations.ts index 9279dedf100..95843f60410 100644 --- a/src/vs/editor/contrib/caretOperations/browser/caretOperations.ts +++ b/src/vs/editor/contrib/caretOperations/browser/caretOperations.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, IActionOptions, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ICommand } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { MoveCaretCommand } from 'vs/editor/contrib/caretOperations/browser/moveCaretCommand'; -import * as nls from 'vs/nls'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, IActionOptions, registerEditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { ICommand } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { MoveCaretCommand } from './moveCaretCommand.js'; +import * as nls from '../../../../nls.js'; class MoveCaretAction extends EditorAction { diff --git a/src/vs/editor/contrib/caretOperations/browser/moveCaretCommand.ts b/src/vs/editor/contrib/caretOperations/browser/moveCaretCommand.ts index 81db0fd6217..e3dabdc3318 100644 --- a/src/vs/editor/contrib/caretOperations/browser/moveCaretCommand.ts +++ b/src/vs/editor/contrib/caretOperations/browser/moveCaretCommand.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; export class MoveCaretCommand implements ICommand { diff --git a/src/vs/editor/contrib/caretOperations/browser/transpose.ts b/src/vs/editor/contrib/caretOperations/browser/transpose.ts index 50733bd6ba9..e0fff82551e 100644 --- a/src/vs/editor/contrib/caretOperations/browser/transpose.ts +++ b/src/vs/editor/contrib/caretOperations/browser/transpose.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand'; -import { MoveOperations } from 'vs/editor/common/cursor/cursorMoveOperations'; -import { Range } from 'vs/editor/common/core/range'; -import { ICommand } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import * as nls from 'vs/nls'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, registerEditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { ReplaceCommand } from '../../../common/commands/replaceCommand.js'; +import { MoveOperations } from '../../../common/cursor/cursorMoveOperations.js'; +import { Range } from '../../../common/core/range.js'; +import { ICommand } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import * as nls from '../../../../nls.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; class TransposeLettersAction extends EditorAction { diff --git a/src/vs/editor/contrib/caretOperations/test/browser/moveCarretCommand.test.ts b/src/vs/editor/contrib/caretOperations/test/browser/moveCarretCommand.test.ts index dc1d3133000..254f228ede5 100644 --- a/src/vs/editor/contrib/caretOperations/test/browser/moveCarretCommand.test.ts +++ b/src/vs/editor/contrib/caretOperations/test/browser/moveCarretCommand.test.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Selection } from 'vs/editor/common/core/selection'; -import { MoveCaretCommand } from 'vs/editor/contrib/caretOperations/browser/moveCaretCommand'; -import { testCommand } from 'vs/editor/test/browser/testCommand'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { MoveCaretCommand } from '../../browser/moveCaretCommand.js'; +import { testCommand } from '../../../../test/browser/testCommand.js'; function testMoveCaretLeftCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { diff --git a/src/vs/editor/contrib/clipboard/browser/clipboard.ts b/src/vs/editor/contrib/clipboard/browser/clipboard.ts index e10b43e1f37..de4c9a35407 100644 --- a/src/vs/editor/contrib/clipboard/browser/clipboard.ts +++ b/src/vs/editor/contrib/clipboard/browser/clipboard.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as browser from 'vs/base/browser/browser'; -import { getActiveDocument } from 'vs/base/browser/dom'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import * as platform from 'vs/base/common/platform'; -import { CopyOptions, InMemoryClipboardMetadataManager } from 'vs/editor/browser/controller/textAreaInput'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Command, EditorAction, MultiCommand, registerEditorAction } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Handler } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { CopyPasteController } from 'vs/editor/contrib/dropOrPasteInto/browser/copyPasteController'; -import * as nls from 'vs/nls'; -import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import * as browser from '../../../../base/browser/browser.js'; +import { getActiveDocument } from '../../../../base/browser/dom.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import * as platform from '../../../../base/common/platform.js'; +import * as nls from '../../../../nls.js'; +import { MenuId, MenuRegistry } from '../../../../platform/actions/common/actions.js'; +import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { CopyOptions, InMemoryClipboardMetadataManager } from '../../../browser/controller/editContext/clipboardUtils.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { Command, EditorAction, MultiCommand, registerEditorAction } from '../../../browser/editorExtensions.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Handler } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { CopyPasteController } from '../../dropOrPasteInto/browser/copyPasteController.js'; const CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste'; @@ -201,7 +201,14 @@ function registerExecCommandImpl(target: MultiCommand | undefined, browserComman if (selection && selection.isEmpty() && !emptySelectionClipboard) { return true; } - focusedEditor.getContainerDomNode().ownerDocument.execCommand(browserCommand); + // TODO this is very ugly. The entire copy/paste/cut system needs a complete refactoring. + if (focusedEditor.getOption(EditorOption.experimentalEditContextEnabled) && browserCommand === 'cut') { + // execCommand(copy) works for edit context, but not execCommand(cut). + focusedEditor.getContainerDomNode().ownerDocument.execCommand('copy'); + focusedEditor.trigger(undefined, Handler.Cut, undefined); + } else { + focusedEditor.getContainerDomNode().ownerDocument.execCommand(browserCommand); + } return true; } return false; @@ -226,10 +233,12 @@ if (PasteAction) { // Only if editor text focus (i.e. not if editor has widget focus). const focusedEditor = codeEditorService.getFocusedCodeEditor(); if (focusedEditor && focusedEditor.hasTextFocus()) { - const result = focusedEditor.getContainerDomNode().ownerDocument.execCommand('paste'); + // execCommand(paste) does not work with edit context + const canDoDocumentExecCommand = !focusedEditor.getOption(EditorOption.experimentalEditContextEnabled); + const result = canDoDocumentExecCommand && focusedEditor.getContainerDomNode().ownerDocument.execCommand('paste'); if (result) { return CopyPasteController.get(focusedEditor)?.finishedPaste() ?? Promise.resolve(); - } else if (platform.isWeb) { + } else if (platform.isWeb || !canDoDocumentExecCommand) { // Use the clipboard service if document.execCommand('paste') was not successful return (async () => { const clipboardText = await clipboardService.readText(); diff --git a/src/vs/editor/contrib/codeAction/browser/codeAction.ts b/src/vs/editor/contrib/codeAction/browser/codeAction.ts index 32767aa9ca8..c32c43744fb 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeAction.ts +++ b/src/vs/editor/contrib/codeAction/browser/codeAction.ts @@ -3,29 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce, equals, isNonEmptyArray } from 'vs/base/common/arrays'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { illegalArgument, isCancellationError, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import * as languages from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { IModelService } from 'vs/editor/common/services/model'; -import { TextModelCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/editorState'; -import * as nls from 'vs/nls'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IProgress, Progress } from 'vs/platform/progress/common/progress'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { CodeActionFilter, CodeActionItem, CodeActionKind, CodeActionSet, CodeActionTrigger, CodeActionTriggerSource, filtersAction, mayIncludeActionsOfKind } from '../common/types'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; +import { coalesce, equals, isNonEmptyArray } from '../../../../base/common/arrays.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { illegalArgument, isCancellationError, onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { IBulkEditService } from '../../../browser/services/bulkEditService.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import * as languages from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { IModelService } from '../../../common/services/model.js'; +import { TextModelCancellationTokenSource } from '../../editorState/browser/editorState.js'; +import * as nls from '../../../../nls.js'; +import { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js'; +import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { IProgress, Progress } from '../../../../platform/progress/common/progress.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { CodeActionFilter, CodeActionItem, CodeActionKind, CodeActionSet, CodeActionTrigger, CodeActionTriggerSource, filtersAction, mayIncludeActionsOfKind } from '../common/types.js'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; + + export const codeActionCommandId = 'editor.action.codeAction'; export const quickFixCommandId = 'editor.action.quickFix'; diff --git a/src/vs/editor/contrib/codeAction/browser/codeActionCommands.ts b/src/vs/editor/contrib/codeAction/browser/codeActionCommands.ts index 87fb94a2de4..df4a764f45d 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeActionCommands.ts +++ b/src/vs/editor/contrib/codeAction/browser/codeActionCommands.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { aideFixCommandId, autoFixCommandId, codeActionCommandId, fixAllCommandId, organizeImportsCommandId, quickFixCommandId, refactorCommandId, sourceActionCommandId } from 'vs/editor/contrib/codeAction/browser/codeAction'; -import * as nls from 'vs/nls'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { CodeActionAutoApply, CodeActionCommandArgs, CodeActionFilter, CodeActionKind, CodeActionTriggerSource } from '../common/types'; -import { CodeActionController } from './codeActionController'; -import { SUPPORTED_CODE_ACTIONS } from './codeActionModel'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; +import { IJSONSchema } from '../../../../base/common/jsonSchema.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { escapeRegExpCharacters } from '../../../../base/common/strings.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorCommand, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { aideFixCommandId, autoFixCommandId, codeActionCommandId, fixAllCommandId, organizeImportsCommandId, quickFixCommandId, refactorCommandId, sourceActionCommandId } from './codeAction.js'; +import * as nls from '../../../../nls.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { CodeActionAutoApply, CodeActionCommandArgs, CodeActionFilter, CodeActionKind, CodeActionTriggerSource } from '../common/types.js'; +import { CodeActionController } from './codeActionController.js'; +import { SUPPORTED_CODE_ACTIONS } from './codeActionModel.js'; function contextKeyForSupportedActions(kind: HierarchicalKind) { return ContextKeyExpr.regex( diff --git a/src/vs/editor/contrib/codeAction/browser/codeActionContributions.ts b/src/vs/editor/contrib/codeAction/browser/codeActionContributions.ts index ffda28e0d3f..55d2e10db4d 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeActionContributions.ts +++ b/src/vs/editor/contrib/codeAction/browser/codeActionContributions.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EditorContributionInstantiation, registerEditorAction, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { editorConfigurationBaseNode } from 'vs/editor/common/config/editorConfigurationSchema'; -import { AideFixAction, AutoFixAction, CodeActionCommand, FixAllAction, OrganizeImportsAction, QuickFixAction, RefactorAction, SourceAction } from 'vs/editor/contrib/codeAction/browser/codeActionCommands'; -import { CodeActionController } from 'vs/editor/contrib/codeAction/browser/codeActionController'; -import { LightBulbWidget } from 'vs/editor/contrib/codeAction/browser/lightBulbWidget'; -import * as nls from 'vs/nls'; -import { ConfigurationScope, Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { EditorContributionInstantiation, registerEditorAction, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { editorConfigurationBaseNode } from '../../../common/config/editorConfigurationSchema.js'; +import { AideFixAction, AutoFixAction, CodeActionCommand, FixAllAction, OrganizeImportsAction, QuickFixAction, RefactorAction, SourceAction } from './codeActionCommands.js'; +import { CodeActionController } from './codeActionController.js'; +import { LightBulbWidget } from './lightBulbWidget.js'; +import * as nls from '../../../../nls.js'; +import { ConfigurationScope, Extensions, IConfigurationRegistry } from '../../../../platform/configuration/common/configurationRegistry.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; registerEditorContribution(CodeActionController.ID, CodeActionController, EditorContributionInstantiation.Eventually); registerEditorContribution(LightBulbWidget.ID, LightBulbWidget, EditorContributionInstantiation.Lazy); @@ -46,3 +46,15 @@ Registry.as(Extensions.Configuration).registerConfigurat }, } }); + +Registry.as(Extensions.Configuration).registerConfiguration({ + ...editorConfigurationBaseNode, + properties: { + 'editor.codeActions.triggerOnFocusChange': { + type: 'boolean', + scope: ConfigurationScope.LANGUAGE_OVERRIDABLE, + markdownDescription: nls.localize('triggerOnFocusChange', 'Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.', '`#editor.codeActionsOnSave#`', '`#files.autoSave#`', '`afterDelay`', '`always`'), + default: false, + }, + } +}); diff --git a/src/vs/editor/contrib/codeAction/browser/codeActionController.ts b/src/vs/editor/contrib/codeAction/browser/codeActionController.ts index 65dc839da2c..3485e0a18a8 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeActionController.ts +++ b/src/vs/editor/contrib/codeAction/browser/codeActionController.ts @@ -3,44 +3,43 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getDomNodePagePosition } from 'vs/base/browser/dom'; -import * as aria from 'vs/base/browser/ui/aria/aria'; -import { IAnchor } from 'vs/base/browser/ui/contextview/contextview'; -import { IAction } from 'vs/base/common/actions'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Color } from 'vs/base/common/color'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Lazy } from 'vs/base/common/lazy'; -import { Disposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon'; -import { CodeActionTriggerType } from 'vs/editor/common/languages'; -import { IModelDeltaDecoration } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { ApplyCodeActionReason, applyCodeAction } from 'vs/editor/contrib/codeAction/browser/codeAction'; -import { CodeActionKeybindingResolver } from 'vs/editor/contrib/codeAction/browser/codeActionKeybindingResolver'; -import { toMenuItems } from 'vs/editor/contrib/codeAction/browser/codeActionMenu'; -import { LightBulbWidget } from 'vs/editor/contrib/codeAction/browser/lightBulbWidget'; -import { MessageController } from 'vs/editor/contrib/message/browser/messageController'; -import { localize } from 'vs/nls'; -import { IActionListDelegate } from 'vs/platform/actionWidget/browser/actionList'; -import { IActionWidgetService } from 'vs/platform/actionWidget/browser/actionWidget'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IMarkerService } from 'vs/platform/markers/common/markers'; -import { IEditorProgressService } from 'vs/platform/progress/common/progress'; -import { editorFindMatchHighlight, editorFindMatchHighlightBorder } from 'vs/platform/theme/common/colorRegistry'; -import { isHighContrast } from 'vs/platform/theme/common/theme'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { CodeActionAutoApply, CodeActionFilter, CodeActionItem, CodeActionKind, CodeActionSet, CodeActionTrigger, CodeActionTriggerSource } from 'vs/editor/contrib/codeAction/common/types'; -import { CodeActionModel, CodeActionsState } from 'vs/editor/contrib/codeAction/browser/codeActionModel'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; - +import { getDomNodePagePosition } from '../../../../base/browser/dom.js'; +import * as aria from '../../../../base/browser/ui/aria/aria.js'; +import { IAnchor } from '../../../../base/browser/ui/contextview/contextview.js'; +import { IAction } from '../../../../base/common/actions.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Color } from '../../../../base/common/color.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Lazy } from '../../../../base/common/lazy.js'; +import { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { IEditorContribution, ScrollType } from '../../../common/editorCommon.js'; +import { CodeActionTriggerType } from '../../../common/languages.js'; +import { IModelDeltaDecoration } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { ApplyCodeActionReason, applyCodeAction } from './codeAction.js'; +import { CodeActionKeybindingResolver } from './codeActionKeybindingResolver.js'; +import { toMenuItems } from './codeActionMenu.js'; +import { LightBulbWidget } from './lightBulbWidget.js'; +import { MessageController } from '../../message/browser/messageController.js'; +import { localize } from '../../../../nls.js'; +import { IActionListDelegate } from '../../../../platform/actionWidget/browser/actionList.js'; +import { IActionWidgetService } from '../../../../platform/actionWidget/browser/actionWidget.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IMarkerService } from '../../../../platform/markers/common/markers.js'; +import { IEditorProgressService } from '../../../../platform/progress/common/progress.js'; +import { editorFindMatchHighlight, editorFindMatchHighlightBorder } from '../../../../platform/theme/common/colorRegistry.js'; +import { isHighContrast } from '../../../../platform/theme/common/theme.js'; +import { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { CodeActionAutoApply, CodeActionFilter, CodeActionItem, CodeActionKind, CodeActionSet, CodeActionTrigger, CodeActionTriggerSource } from '../common/types.js'; +import { CodeActionModel, CodeActionsState } from './codeActionModel.js'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; interface IActionShowOptions { readonly includeDisabledActions?: boolean; @@ -85,7 +84,7 @@ export class CodeActionController extends Disposable implements IEditorContribut super(); this._editor = editor; - this._model = this._register(new CodeActionModel(this._editor, languageFeaturesService.codeActionProvider, markerService, contextKeyService, progressService, _configurationService)); + this._model = this._register(new CodeActionModel(this._editor, languageFeaturesService.codeActionProvider, markerService, contextKeyService, progressService, _configurationService, this._telemetryService)); this._register(this._model.onDidChangeState(newState => this.update(newState))); this._lightBulbWidget = new Lazy(() => { @@ -107,29 +106,6 @@ export class CodeActionController extends Disposable implements IEditorContribut } private async showCodeActionsFromLightbulb(actions: CodeActionSet, at: IAnchor | IPosition): Promise { - - // Telemetry for showing code actions from lightbulb. Shows us how often it was clicked. - type ShowCodeActionListEvent = { - codeActionListLength: number; - codeActions: string[]; - codeActionProviders: string[]; - }; - - type ShowListEventClassification = { - codeActionListLength: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The length of the code action list from the lightbulb widget.' }; - codeActions: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The title of code actions in this menu.' }; - codeActionProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The provider of code actions in this menu.' }; - owner: 'justschen'; - comment: 'Event used to gain insights into what code actions are being shown'; - }; - - this._telemetryService.publicLog2('codeAction.showCodeActionsFromLightbulb', { - codeActionListLength: actions.validActions.length, - codeActions: actions.validActions.map(action => action.action.title), - codeActionProviders: actions.validActions.map(action => action.provider?.displayName ?? ''), - }); - - if (actions.allAIFixes && actions.validActions.length === 1) { const actionItem = actions.validActions[0]; const command = actionItem.action.command; @@ -183,11 +159,12 @@ export class CodeActionController extends Disposable implements IEditorContribut public hideLightBulbWidget(): void { this._lightBulbWidget.rawValue?.hide(); + this._lightBulbWidget.rawValue?.gutterHide(); } private async update(newState: CodeActionsState.State): Promise { if (newState.type !== CodeActionsState.Type.Triggered) { - this._lightBulbWidget.rawValue?.hide(); + this.hideLightBulbWidget(); return; } @@ -203,6 +180,12 @@ export class CodeActionController extends Disposable implements IEditorContribut return; } + + const selection = this._editor.getSelection(); + if (selection?.startLineNumber !== newState.position.lineNumber) { + return; + } + this._lightBulbWidget.value?.update(actions, newState.trigger, newState.position); if (newState.trigger.type === CodeActionTriggerType.Invoke) { @@ -212,7 +195,7 @@ export class CodeActionController extends Disposable implements IEditorContribut const validActionToApply = this.tryGetValidActionToApply(newState.trigger, actions); if (validActionToApply) { try { - this._lightBulbWidget.value?.hide(); + this.hideLightBulbWidget(); await this._applyCodeAction(validActionToApply, false, false, ApplyCodeActionReason.FromCodeActions); } finally { actions.dispose(); @@ -312,28 +295,6 @@ export class CodeActionController extends Disposable implements IEditorContribut onHide: (didCancel?) => { this._editor?.focus(); currentDecorations.clear(); - // Telemetry for showing code actions here. only log on `showLightbulb`. Logs when code action list is quit out. - if (options.fromLightbulb && didCancel !== undefined) { - type ShowCodeActionListEvent = { - codeActionListLength: number; - didCancel: boolean; - codeActions: string[]; - }; - - type ShowListEventClassification = { - codeActionListLength: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The length of the code action list when quit out. Can be from any code action menu.' }; - didCancel: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the code action was cancelled or selected.' }; - codeActions: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'What code actions were available when cancelled.' }; - owner: 'justschen'; - comment: 'Event used to gain insights into how many valid code actions are being shown'; - }; - - this._telemetryService.publicLog2('codeAction.showCodeActionList.onHide', { - codeActionListLength: actions.validActions.length, - didCancel: didCancel, - codeActions: actions.validActions.map(action => action.action.title), - }); - } }, onHover: async (action: CodeActionItem, token: CancellationToken) => { if (token.isCancellationRequested) { diff --git a/src/vs/editor/contrib/codeAction/browser/codeActionKeybindingResolver.ts b/src/vs/editor/contrib/codeAction/browser/codeActionKeybindingResolver.ts index 088fcfc9558..faae3562de2 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeActionKeybindingResolver.ts +++ b/src/vs/editor/contrib/codeAction/browser/codeActionKeybindingResolver.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { ResolvedKeybinding } from 'vs/base/common/keybindings'; -import { Lazy } from 'vs/base/common/lazy'; -import { CodeAction } from 'vs/editor/common/languages'; -import { codeActionCommandId, fixAllCommandId, organizeImportsCommandId, refactorCommandId, sourceActionCommandId } from 'vs/editor/contrib/codeAction/browser/codeAction'; -import { CodeActionAutoApply, CodeActionCommandArgs, CodeActionKind } from 'vs/editor/contrib/codeAction/common/types'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; +import { ResolvedKeybinding } from '../../../../base/common/keybindings.js'; +import { Lazy } from '../../../../base/common/lazy.js'; +import { CodeAction } from '../../../common/languages.js'; +import { codeActionCommandId, fixAllCommandId, organizeImportsCommandId, refactorCommandId, sourceActionCommandId } from './codeAction.js'; +import { CodeActionAutoApply, CodeActionCommandArgs, CodeActionKind } from '../common/types.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; interface ResolveCodeActionKeybinding { readonly kind: HierarchicalKind; diff --git a/src/vs/editor/contrib/codeAction/browser/codeActionMenu.ts b/src/vs/editor/contrib/codeAction/browser/codeActionMenu.ts index 8763487cb1d..5384b7a5b15 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeActionMenu.ts +++ b/src/vs/editor/contrib/codeAction/browser/codeActionMenu.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/base/browser/ui/codicons/codiconStyles'; // The codicon symbol styles are defined here and must be loaded -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { ResolvedKeybinding } from 'vs/base/common/keybindings'; -import { CodeAction } from 'vs/editor/common/languages'; -import { CodeActionItem, CodeActionKind } from 'vs/editor/contrib/codeAction/common/types'; -import 'vs/editor/contrib/symbolIcons/browser/symbolIcons'; // The codicon symbol colors are defined here and must be loaded to get colors -import { localize } from 'vs/nls'; -import { ActionListItemKind, IActionListItem } from 'vs/platform/actionWidget/browser/actionList'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; +import '../../../../base/browser/ui/codicons/codiconStyles.js'; // The codicon symbol styles are defined here and must be loaded +import { Codicon } from '../../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { ResolvedKeybinding } from '../../../../base/common/keybindings.js'; +import { CodeAction } from '../../../common/languages.js'; +import { CodeActionItem, CodeActionKind } from '../common/types.js'; +import '../../symbolIcons/browser/symbolIcons.js'; // The codicon symbol colors are defined here and must be loaded to get colors +import { localize } from '../../../../nls.js'; +import { ActionListItemKind, IActionListItem } from '../../../../platform/actionWidget/browser/actionList.js'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; interface ActionGroup { readonly kind: HierarchicalKind; diff --git a/src/vs/editor/contrib/codeAction/browser/codeActionModel.ts b/src/vs/editor/contrib/codeAction/browser/codeActionModel.ts index 0e11fef86ab..a909d559ed8 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeActionModel.ts +++ b/src/vs/editor/contrib/codeAction/browser/codeActionModel.ts @@ -3,25 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise, TimeoutTimer } from 'vs/base/common/async'; -import { isCancellationError } from 'vs/base/common/errors'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { isEqual } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption, ShowLightbulbIconMode } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { CodeActionProvider, CodeActionTriggerType } from 'vs/editor/common/languages'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IMarkerService } from 'vs/platform/markers/common/markers'; -import { IEditorProgressService, Progress } from 'vs/platform/progress/common/progress'; -import { CodeActionKind, CodeActionSet, CodeActionTrigger, CodeActionTriggerSource } from '../common/types'; -import { getCodeActions } from './codeAction'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; +import { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js'; +import { isCancellationError } from '../../../../base/common/errors.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js'; +import { isEqual } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption, ShowLightbulbIconMode } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { Selection } from '../../../common/core/selection.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { CodeActionProvider, CodeActionTriggerType } from '../../../common/languages.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { IMarkerService } from '../../../../platform/markers/common/markers.js'; +import { IEditorProgressService, Progress } from '../../../../platform/progress/common/progress.js'; +import { CodeActionKind, CodeActionSet, CodeActionTrigger, CodeActionTriggerSource } from '../common/types.js'; +import { getCodeActions } from './codeAction.js'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; export const SUPPORTED_CODE_ACTIONS = new RawContextKey('supportedCodeAction', ''); @@ -172,6 +174,7 @@ export class CodeActionModel extends Disposable { contextKeyService: IContextKeyService, private readonly _progressService?: IEditorProgressService, private readonly _configurationService?: IConfigurationService, + private readonly _telemetryService?: ITelemetryService ) { super(); this._supportedCodeActions = SUPPORTED_CODE_ACTIONS.bindTo(contextKeyService); @@ -315,7 +318,35 @@ export class CodeActionModel extends Disposable { } } } - // temporarilly hiding here as this is enabled/disabled behind a setting. + + // Case for manual triggers - specifically Source Actions and Refactors + if (trigger.trigger.type === CodeActionTriggerType.Invoke) { + const sw = new StopWatch(); + const codeActions = await getCodeActions(this._registry, model, trigger.selection, trigger.trigger, Progress.None, token); + + // Telemetry for duration of each code action on save. + if (this._telemetryService) { + type RenderActionMenu = { + codeActions: number; + duration: number; + }; + + type RenderActionMenuClassification = { + owner: 'justschen'; + comment: 'Information about how long it took for code actions to be received from the provider and shown in the UI.'; + codeActions: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Number of valid code actions received from TS.' }; + duration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Duration it took for TS to return the action to run for each kind. ' }; + }; + + this._telemetryService.publicLog2('codeAction.invokedDurations', { + codeActions: codeActions.validActions.length, + duration: sw.elapsed() + }); + } + + return codeActions; + } + return getCodeActions(this._registry, model, trigger.selection, trigger.trigger, Progress.None, token); }); if (trigger.trigger.type === CodeActionTriggerType.Invoke) { diff --git a/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.css b/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.css index cbadb2348ef..4961d4c92cb 100644 --- a/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.css +++ b/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.css @@ -43,3 +43,23 @@ opacity: 0.3; z-index: 1; } + +/* gutter decoration */ +.monaco-editor .glyph-margin-widgets .cgmr[class*="codicon-gutter-lightbulb"] { + display: block; + cursor: pointer; +} + +.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb, +.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle { + color: var(--vscode-editorLightBulb-foreground); +} + +.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-auto-fix, +.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-aifix-auto-fix { + color: var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground)); +} + +.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle-filled { + color: var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground)); +} diff --git a/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.ts b/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.ts index bd391744ab3..39dd29629f5 100644 --- a/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.ts +++ b/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.ts @@ -3,22 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { Gesture } from 'vs/base/browser/touch'; -import { Codicon } from 'vs/base/common/codicons'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ThemeIcon } from 'vs/base/common/themables'; -import 'vs/css!./lightBulbWidget'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IPosition } from 'vs/editor/common/core/position'; -import { computeIndentLevel } from 'vs/editor/common/model/utils'; -import { autoFixCommandId, quickFixCommandId } from 'vs/editor/contrib/codeAction/browser/codeAction'; -import { CodeActionSet, CodeActionTrigger } from 'vs/editor/contrib/codeAction/common/types'; -import * as nls from 'vs/nls'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import * as dom from '../../../../base/browser/dom.js'; +import { Gesture } from '../../../../base/browser/touch.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import './lightBulbWidget.css'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition, IEditorMouseEvent } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IPosition } from '../../../common/core/position.js'; +import { GlyphMarginLane, IModelDecorationsChangeAccessor, TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { computeIndentLevel } from '../../../common/model/utils.js'; +import { autoFixCommandId, quickFixCommandId } from './codeAction.js'; +import { CodeActionSet, CodeActionTrigger } from '../common/types.js'; +import * as nls from '../../../../nls.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; +import { Range } from '../../../common/core/range.js'; + +const GUTTER_LIGHTBULB_ICON = registerIcon('gutter-lightbulb', Codicon.lightBulb, nls.localize('gutterLightbulbWidget', 'Icon which spawns code actions menu from the gutter when there is no space in the editor.')); +const GUTTER_LIGHTBULB_AUTO_FIX_ICON = registerIcon('gutter-lightbulb-auto-fix', Codicon.lightbulbAutofix, nls.localize('gutterLightbulbAutoFixWidget', 'Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.')); +const GUTTER_LIGHTBULB_AIFIX_ICON = registerIcon('gutter-lightbulb-sparkle', Codicon.lightbulbSparkle, nls.localize('gutterLightbulbAIFixWidget', 'Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.')); +const GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON = registerIcon('gutter-lightbulb-aifix-auto-fix', Codicon.lightbulbSparkleAutofix, nls.localize('gutterLightbulbAIFixAutoFixWidget', 'Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.')); +const GUTTER_SPARKLE_FILLED_ICON = registerIcon('gutter-lightbulb-sparkle-filled', Codicon.sparkleFilled, nls.localize('gutterLightbulbSparkleFilledWidget', 'Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.')); namespace LightBulbState { @@ -44,6 +53,14 @@ namespace LightBulbState { } export class LightBulbWidget extends Disposable implements IContentWidget { + private _gutterDecorationID: string | undefined; + + private static readonly GUTTER_DECORATION = ModelDecorationOptions.register({ + description: 'codicon-gutter-lightbulb-decoration', + glyphMarginClassName: ThemeIcon.asClassName(Codicon.lightBulb), + glyphMargin: { position: GlyphMarginLane.Left }, + stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + }); public static readonly ID = 'editor.contrib.lightbulbWidget'; @@ -55,15 +72,25 @@ export class LightBulbWidget extends Disposable implements IContentWidget { public readonly onClick = this._onClick.event; private _state: LightBulbState.State = LightBulbState.Hidden; + private _gutterState: LightBulbState.State = LightBulbState.Hidden; private _iconClasses: string[] = []; + private readonly lightbulbClasses = [ + 'codicon-' + GUTTER_LIGHTBULB_ICON.id, + 'codicon-' + GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON.id, + 'codicon-' + GUTTER_LIGHTBULB_AUTO_FIX_ICON.id, + 'codicon-' + GUTTER_LIGHTBULB_AIFIX_ICON.id, + 'codicon-' + GUTTER_SPARKLE_FILLED_ICON.id + ]; + private _preferredKbLabel?: string; private _quickFixKbLabel?: string; + private gutterDecoration: ModelDecorationOptions = LightBulbWidget.GUTTER_DECORATION; + constructor( private readonly _editor: ICodeEditor, - @IKeybindingService private readonly _keybindingService: IKeybindingService, - @ICommandService commandService: ICommandService + @IKeybindingService private readonly _keybindingService: IKeybindingService ) { super(); @@ -79,6 +106,10 @@ export class LightBulbWidget extends Disposable implements IContentWidget { if (this.state.type !== LightBulbState.Type.Showing || !editorModel || this.state.editorPosition.lineNumber >= editorModel.getLineCount()) { this.hide(); } + + if (this.gutterState.type !== LightBulbState.Type.Showing || !editorModel || this.gutterState.editorPosition.lineNumber >= editorModel.getLineCount()) { + this.gutterHide(); + } })); this._register(dom.addStandardDisposableGenericMouseDownListener(this._domNode, e => { @@ -121,14 +152,47 @@ export class LightBulbWidget extends Disposable implements IContentWidget { this._register(Event.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings, () => { this._preferredKbLabel = this._keybindingService.lookupKeybinding(autoFixCommandId)?.getLabel() ?? undefined; this._quickFixKbLabel = this._keybindingService.lookupKeybinding(quickFixCommandId)?.getLabel() ?? undefined; - this._updateLightBulbTitleAndIcon(); })); + + this._register(this._editor.onMouseDown(async (e: IEditorMouseEvent) => { + + if (!e.target.element || !this.lightbulbClasses.some(cls => e.target.element && e.target.element.classList.contains(cls))) { + return; + } + + if (this.gutterState.type !== LightBulbState.Type.Showing) { + return; + } + + // Make sure that focus / cursor location is not lost when clicking widget icon + this._editor.focus(); + + // a bit of extra work to make sure the menu + // doesn't cover the line-text + const { top, height } = dom.getDomNodePagePosition(e.target.element); + const lineHeight = this._editor.getOption(EditorOption.lineHeight); + + let pad = Math.floor(lineHeight / 3); + if (this.gutterState.widgetPosition.position !== null && this.gutterState.widgetPosition.position.lineNumber < this.gutterState.editorPosition.lineNumber) { + pad += lineHeight; + } + + this._onClick.fire({ + x: e.event.posx, + y: top + height + pad, + actions: this.gutterState.actions, + trigger: this.gutterState.trigger, + }); + })); } override dispose(): void { super.dispose(); this._editor.removeContentWidget(this); + if (this._gutterDecorationID) { + this._removeGutterDecoration(this._gutterDecorationID); + } } getId(): string { @@ -145,17 +209,26 @@ export class LightBulbWidget extends Disposable implements IContentWidget { public update(actions: CodeActionSet, trigger: CodeActionTrigger, atPosition: IPosition) { if (actions.validActions.length <= 0) { + this.gutterHide(); + return this.hide(); + } + + const hasTextFocus = this._editor.hasTextFocus(); + if (!hasTextFocus) { + this.gutterHide(); return this.hide(); } const options = this._editor.getOptions(); if (!options.get(EditorOption.lightbulb).enabled) { + this.gutterHide(); return this.hide(); } const model = this._editor.getModel(); if (!model) { + this.gutterHide(); return this.hide(); } @@ -170,10 +243,23 @@ export class LightBulbWidget extends Disposable implements IContentWidget { return lineNumber > 2 && this._editor.getTopForLineNumber(lineNumber) === this._editor.getTopForLineNumber(lineNumber - 1); }; + // Check for glyph margin decorations of any kind + const currLineDecorations = this._editor.getLineDecorations(lineNumber); + let hasDecoration = false; + if (currLineDecorations) { + for (const decoration of currLineDecorations) { + const glyphClass = decoration.options.glyphMarginClassName; + + if (glyphClass && !this.lightbulbClasses.some(className => glyphClass.includes(className))) { + hasDecoration = true; + break; + } + } + } + let effectiveLineNumber = lineNumber; let effectiveColumnNumber = 1; if (!lineHasSpace) { - // Checks if line is empty or starts with any amount of whitespace const isLineEmptyOrIndented = (lineNumber: number): boolean => { const lineContent = model.getLineContent(lineNumber); @@ -188,12 +274,32 @@ export class LightBulbWidget extends Disposable implements IContentWidget { const currLineEmptyOrIndented = isLineEmptyOrIndented(lineNumber); const notEmpty = !nextLineEmptyOrIndented && !prevLineEmptyOrIndented; - // check above and below. if both are blocked, display lightbulb below. - if (prevLineEmptyOrIndented || endLine || (notEmpty && !currLineEmptyOrIndented)) { + // check above and below. if both are blocked, display lightbulb in the gutter. + if (!nextLineEmptyOrIndented && !prevLineEmptyOrIndented && !hasDecoration) { + this.gutterState = new LightBulbState.Showing(actions, trigger, atPosition, { + position: { lineNumber: effectiveLineNumber, column: effectiveColumnNumber }, + preference: LightBulbWidget._posPref + }); + this.renderGutterLightbub(); + return this.hide(); + } else if (prevLineEmptyOrIndented || endLine || (prevLineEmptyOrIndented && !currLineEmptyOrIndented)) { effectiveLineNumber -= 1; } else if (nextLineEmptyOrIndented || (notEmpty && currLineEmptyOrIndented)) { effectiveLineNumber += 1; } + } else if (lineNumber === 1 && (lineNumber === model.getLineCount() || !isLineEmptyOrIndented(lineNumber + 1) && !isLineEmptyOrIndented(lineNumber))) { + // special checks for first line blocked vs. not blocked. + this.gutterState = new LightBulbState.Showing(actions, trigger, atPosition, { + position: { lineNumber: effectiveLineNumber, column: effectiveColumnNumber }, + preference: LightBulbWidget._posPref + }); + + if (hasDecoration) { + this.gutterHide(); + } else { + this.renderGutterLightbub(); + return this.hide(); + } } else if ((lineNumber < model.getLineCount()) && !isFolded(lineNumber + 1)) { effectiveLineNumber += 1; } else if (column * fontInfo.spaceWidth < 22) { @@ -209,6 +315,11 @@ export class LightBulbWidget extends Disposable implements IContentWidget { preference: LightBulbWidget._posPref }); + if (this._gutterDecorationID) { + this._removeGutterDecoration(this._gutterDecorationID); + this.gutterHide(); + } + const validActions = actions.validActions; const actionKind = actions.validActions[0].action.kind; if (validActions.length !== 1 || !actionKind) { @@ -216,7 +327,6 @@ export class LightBulbWidget extends Disposable implements IContentWidget { return; } - this._editor.layoutContentWidget(this); } @@ -229,6 +339,18 @@ export class LightBulbWidget extends Disposable implements IContentWidget { this._editor.layoutContentWidget(this); } + public gutterHide(): void { + if (this.gutterState === LightBulbState.Hidden) { + return; + } + + if (this._gutterDecorationID) { + this._removeGutterDecoration(this._gutterDecorationID); + } + + this.gutterState = LightBulbState.Hidden; + } + private get state(): LightBulbState.State { return this._state; } private set state(value) { @@ -236,6 +358,13 @@ export class LightBulbWidget extends Disposable implements IContentWidget { this._updateLightBulbTitleAndIcon(); } + private get gutterState(): LightBulbState.State { return this._gutterState; } + + private set gutterState(value) { + this._gutterState = value; + this._updateGutterLightBulbTitleAndIcon(); + } + private _updateLightBulbTitleAndIcon(): void { this._domNode.classList.remove(...this._iconClasses); this._iconClasses = []; @@ -265,6 +394,74 @@ export class LightBulbWidget extends Disposable implements IContentWidget { this._domNode.classList.add(...this._iconClasses); } + private _updateGutterLightBulbTitleAndIcon(): void { + if (this.gutterState.type !== LightBulbState.Type.Showing) { + return; + } + let icon: ThemeIcon; + let autoRun = false; + if (this.gutterState.actions.allAIFixes) { + icon = GUTTER_SPARKLE_FILLED_ICON; + if (this.gutterState.actions.validActions.length === 1) { + autoRun = true; + } + } else if (this.gutterState.actions.hasAutoFix) { + if (this.gutterState.actions.hasAIFix) { + icon = GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON; + } else { + icon = GUTTER_LIGHTBULB_AUTO_FIX_ICON; + } + } else if (this.gutterState.actions.hasAIFix) { + icon = GUTTER_LIGHTBULB_AIFIX_ICON; + } else { + icon = GUTTER_LIGHTBULB_ICON; + } + this._updateLightbulbTitle(this.gutterState.actions.hasAutoFix, autoRun); + + const GUTTER_DECORATION = ModelDecorationOptions.register({ + description: 'codicon-gutter-lightbulb-decoration', + glyphMarginClassName: ThemeIcon.asClassName(icon), + glyphMargin: { position: GlyphMarginLane.Left }, + stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, + }); + + this.gutterDecoration = GUTTER_DECORATION; + } + + /* Gutter Helper Functions */ + private renderGutterLightbub(): void { + const selection = this._editor.getSelection(); + if (!selection) { + return; + } + + if (this._gutterDecorationID === undefined) { + this._addGutterDecoration(selection.startLineNumber); + } else { + this._updateGutterDecoration(this._gutterDecorationID, selection.startLineNumber); + } + } + + private _addGutterDecoration(lineNumber: number) { + this._editor.changeDecorations((accessor: IModelDecorationsChangeAccessor) => { + this._gutterDecorationID = accessor.addDecoration(new Range(lineNumber, 0, lineNumber, 0), this.gutterDecoration); + }); + } + + private _removeGutterDecoration(decorationId: string) { + this._editor.changeDecorations((accessor: IModelDecorationsChangeAccessor) => { + accessor.removeDecoration(decorationId); + this._gutterDecorationID = undefined; + }); + } + + private _updateGutterDecoration(decorationId: string, lineNumber: number) { + this._editor.changeDecorations((accessor: IModelDecorationsChangeAccessor) => { + accessor.changeDecoration(decorationId, new Range(lineNumber, 0, lineNumber, 0)); + accessor.changeDecorationOptions(decorationId, this.gutterDecoration); + }); + } + private _updateLightbulbTitle(autoFix: boolean, autoRun: boolean): void { if (this.state.type !== LightBulbState.Type.Showing) { return; diff --git a/src/vs/editor/contrib/codeAction/common/types.ts b/src/vs/editor/contrib/codeAction/common/types.ts index 14e0870e15d..e646e820d3e 100644 --- a/src/vs/editor/contrib/codeAction/common/types.ts +++ b/src/vs/editor/contrib/codeAction/common/types.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { Position } from 'vs/editor/common/core/position'; -import * as languages from 'vs/editor/common/languages'; -import { ActionSet } from 'vs/platform/actionWidget/common/actionWidget'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; +import { Position } from '../../../common/core/position.js'; +import * as languages from '../../../common/languages.js'; +import { ActionSet } from '../../../../platform/actionWidget/common/actionWidget.js'; export const CodeActionKind = new class { public readonly QuickFix = new HierarchicalKind('quickfix'); diff --git a/src/vs/editor/contrib/codeAction/test/browser/codeAction.test.ts b/src/vs/editor/contrib/codeAction/test/browser/codeAction.test.ts index a98da2b0e0d..d3265cf48c9 100644 --- a/src/vs/editor/contrib/codeAction/test/browser/codeAction.test.ts +++ b/src/vs/editor/contrib/codeAction/test/browser/codeAction.test.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import * as languages from 'vs/editor/common/languages'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { getCodeActions } from 'vs/editor/contrib/codeAction/browser/codeAction'; -import { CodeActionItem, CodeActionKind, CodeActionTriggerSource } from 'vs/editor/contrib/codeAction/common/types'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; -import { Progress } from 'vs/platform/progress/common/progress'; +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { HierarchicalKind } from '../../../../../base/common/hierarchicalKind.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Range } from '../../../../common/core/range.js'; +import { LanguageFeatureRegistry } from '../../../../common/languageFeatureRegistry.js'; +import * as languages from '../../../../common/languages.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { getCodeActions } from '../../browser/codeAction.js'; +import { CodeActionItem, CodeActionKind, CodeActionTriggerSource } from '../../common/types.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { IMarkerData, MarkerSeverity } from '../../../../../platform/markers/common/markers.js'; +import { Progress } from '../../../../../platform/progress/common/progress.js'; function staticCodeActionProvider(...actions: languages.CodeAction[]): languages.CodeActionProvider { return new class implements languages.CodeActionProvider { diff --git a/src/vs/editor/contrib/codeAction/test/browser/codeActionKeybindingResolver.test.ts b/src/vs/editor/contrib/codeAction/test/browser/codeActionKeybindingResolver.test.ts index 664a36b2dca..0172318d9dd 100644 --- a/src/vs/editor/contrib/codeAction/test/browser/codeActionKeybindingResolver.test.ts +++ b/src/vs/editor/contrib/codeAction/test/browser/codeActionKeybindingResolver.test.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { KeyCodeChord } from 'vs/base/common/keybindings'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { OperatingSystem } from 'vs/base/common/platform'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { organizeImportsCommandId, refactorCommandId } from 'vs/editor/contrib/codeAction/browser/codeAction'; -import { CodeActionKeybindingResolver } from 'vs/editor/contrib/codeAction/browser/codeActionKeybindingResolver'; -import { CodeActionKind } from 'vs/editor/contrib/codeAction/common/types'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; +import { KeyCodeChord } from '../../../../../base/common/keybindings.js'; +import { KeyCode } from '../../../../../base/common/keyCodes.js'; +import { OperatingSystem } from '../../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { organizeImportsCommandId, refactorCommandId } from '../../browser/codeAction.js'; +import { CodeActionKeybindingResolver } from '../../browser/codeActionKeybindingResolver.js'; +import { CodeActionKind } from '../../common/types.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { ResolvedKeybindingItem } from '../../../../../platform/keybinding/common/resolvedKeybindingItem.js'; +import { USLayoutResolvedKeybinding } from '../../../../../platform/keybinding/common/usLayoutResolvedKeybinding.js'; suite('CodeActionKeybindingResolver', () => { diff --git a/src/vs/editor/contrib/codeAction/test/browser/codeActionModel.test.ts b/src/vs/editor/contrib/codeAction/test/browser/codeActionModel.test.ts index 5946fb24f50..666b185bda5 100644 --- a/src/vs/editor/contrib/codeAction/test/browser/codeActionModel.test.ts +++ b/src/vs/editor/contrib/codeAction/test/browser/codeActionModel.test.ts @@ -4,20 +4,20 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { promiseWithResolvers } from 'vs/base/common/async'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import * as languages from 'vs/editor/common/languages'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { CodeActionModel, CodeActionsState } from 'vs/editor/contrib/codeAction/browser/codeActionModel'; -import { createTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; -import { MarkerService } from 'vs/platform/markers/common/markerService'; +import { promiseWithResolvers } from '../../../../../base/common/async.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { assertType } from '../../../../../base/common/types.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { runWithFakedTimers } from '../../../../../base/test/common/timeTravelScheduler.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { LanguageFeatureRegistry } from '../../../../common/languageFeatureRegistry.js'; +import * as languages from '../../../../common/languages.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { CodeActionModel, CodeActionsState } from '../../browser/codeActionModel.js'; +import { createTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { MockContextKeyService } from '../../../../../platform/keybinding/test/common/mockKeybindingService.js'; +import { MarkerService } from '../../../../../platform/markers/common/markerService.js'; const testProvider = { provideCodeActions(): languages.CodeActionList { diff --git a/src/vs/editor/contrib/codelens/browser/codeLensCache.ts b/src/vs/editor/contrib/codelens/browser/codeLensCache.ts index 67fa3b8009c..5f479695091 100644 --- a/src/vs/editor/contrib/codelens/browser/codeLensCache.ts +++ b/src/vs/editor/contrib/codelens/browser/codeLensCache.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { LRUCache } from 'vs/base/common/map'; -import { Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { CodeLens, CodeLensList, CodeLensProvider } from 'vs/editor/common/languages'; -import { CodeLensModel } from 'vs/editor/contrib/codelens/browser/codelens'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from 'vs/platform/storage/common/storage'; -import { mainWindow } from 'vs/base/browser/window'; -import { runWhenWindowIdle } from 'vs/base/browser/dom'; +import { Event } from '../../../../base/common/event.js'; +import { LRUCache } from '../../../../base/common/map.js'; +import { Range } from '../../../common/core/range.js'; +import { ITextModel } from '../../../common/model.js'; +import { CodeLens, CodeLensList, CodeLensProvider } from '../../../common/languages.js'; +import { CodeLensModel } from './codelens.js'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js'; +import { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from '../../../../platform/storage/common/storage.js'; +import { mainWindow } from '../../../../base/browser/window.js'; +import { runWhenWindowIdle } from '../../../../base/browser/dom.js'; export const ICodeLensCache = createDecorator('ICodeLensCache'); @@ -61,18 +61,17 @@ export class CodeLensCache implements ICodeLensCache { this._deserialize(raw); // store lens data on shutdown - Event.once(storageService.onWillSaveState)(e => { - if (e.reason === WillSaveStateReason.SHUTDOWN) { - storageService.store(key, this._serialize(), StorageScope.WORKSPACE, StorageTarget.MACHINE); - } + const onWillSaveStateBecauseOfShutdown = Event.filter(storageService.onWillSaveState, e => e.reason === WillSaveStateReason.SHUTDOWN); + Event.once(onWillSaveStateBecauseOfShutdown)(e => { + storageService.store(key, this._serialize(), StorageScope.WORKSPACE, StorageTarget.MACHINE); }); } put(model: ITextModel, data: CodeLensModel): void { // create a copy of the model that is without command-ids // but with comand-labels - const copyItems = data.lenses.map(item => { - return { + const copyItems = data.lenses.map((item): CodeLens => { + return { range: item.symbol.range, command: item.symbol.command && { id: '', title: item.symbol.command?.title }, }; diff --git a/src/vs/editor/contrib/codelens/browser/codelens.ts b/src/vs/editor/contrib/codelens/browser/codelens.ts index 682531509b6..0a777339b04 100644 --- a/src/vs/editor/contrib/codelens/browser/codelens.ts +++ b/src/vs/editor/contrib/codelens/browser/codelens.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { ITextModel } from 'vs/editor/common/model'; -import { CodeLens, CodeLensList, CodeLensProvider } from 'vs/editor/common/languages'; -import { IModelService } from 'vs/editor/common/services/model'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { illegalArgument, onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { assertType } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ITextModel } from '../../../common/model.js'; +import { CodeLens, CodeLensList, CodeLensProvider } from '../../../common/languages.js'; +import { IModelService } from '../../../common/services/model.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; export interface CodeLensItem { symbol: CodeLens; diff --git a/src/vs/editor/contrib/codelens/browser/codelensController.ts b/src/vs/editor/contrib/codelens/browser/codelensController.ts index 494336475f3..6eca903fd57 100644 --- a/src/vs/editor/contrib/codelens/browser/codelensController.ts +++ b/src/vs/editor/contrib/codelens/browser/codelensController.ts @@ -4,26 +4,26 @@ *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise, disposableTimeout, RunOnceScheduler } from 'vs/base/common/async'; -import { onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { StableEditorScrollState } from 'vs/editor/browser/stableEditorScroll'; -import { IActiveCodeEditor, ICodeEditor, IViewZoneChangeAccessor, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorOption, EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { IModelDecorationsChangeAccessor } from 'vs/editor/common/model'; -import { CodeLens, Command } from 'vs/editor/common/languages'; -import { CodeLensItem, CodeLensModel, getCodeLensModel } from 'vs/editor/contrib/codelens/browser/codelens'; -import { ICodeLensCache } from 'vs/editor/contrib/codelens/browser/codeLensCache'; -import { CodeLensHelper, CodeLensWidget } from 'vs/editor/contrib/codelens/browser/codelensWidget'; -import { localize } from 'vs/nls'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; +import { CancelablePromise, createCancelablePromise, disposableTimeout, RunOnceScheduler } from '../../../../base/common/async.js'; +import { onUnexpectedError, onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js'; +import { StableEditorScrollState } from '../../../browser/stableEditorScroll.js'; +import { IActiveCodeEditor, ICodeEditor, IViewZoneChangeAccessor, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorOption, EDITOR_FONT_DEFAULTS } from '../../../common/config/editorOptions.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { IModelDecorationsChangeAccessor } from '../../../common/model.js'; +import { CodeLens, Command } from '../../../common/languages.js'; +import { CodeLensItem, CodeLensModel, getCodeLensModel } from './codelens.js'; +import { ICodeLensCache } from './codeLensCache.js'; +import { CodeLensHelper, CodeLensWidget } from './codelensWidget.js'; +import { localize } from '../../../../nls.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; +import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; export class CodeLensContribution implements IEditorContribution { diff --git a/src/vs/editor/contrib/codelens/browser/codelensWidget.ts b/src/vs/editor/contrib/codelens/browser/codelensWidget.ts index c89fc7fdf19..394c333b2e5 100644 --- a/src/vs/editor/contrib/codelens/browser/codelensWidget.ts +++ b/src/vs/editor/contrib/codelens/browser/codelensWidget.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels'; -import { Constants } from 'vs/base/common/uint'; -import 'vs/css!./codelensWidget'; -import { ContentWidgetPositionPreference, IActiveCodeEditor, IContentWidget, IContentWidgetPosition, IViewZone, IViewZoneChangeAccessor } from 'vs/editor/browser/editorBrowser'; -import { Range } from 'vs/editor/common/core/range'; -import { IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { CodeLens, Command } from 'vs/editor/common/languages'; -import { CodeLensItem } from 'vs/editor/contrib/codelens/browser/codelens'; +import * as dom from '../../../../base/browser/dom.js'; +import { renderLabelWithIcons } from '../../../../base/browser/ui/iconLabel/iconLabels.js'; +import { Constants } from '../../../../base/common/uint.js'; +import './codelensWidget.css'; +import { ContentWidgetPositionPreference, IActiveCodeEditor, IContentWidget, IContentWidgetPosition, IViewZone, IViewZoneChangeAccessor } from '../../../browser/editorBrowser.js'; +import { Range } from '../../../common/core/range.js'; +import { IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { CodeLens, Command } from '../../../common/languages.js'; +import { CodeLensItem } from './codelens.js'; class CodeLensViewZone implements IViewZone { diff --git a/src/vs/editor/contrib/colorPicker/browser/color.ts b/src/vs/editor/contrib/colorPicker/browser/color.ts index 9cf73f794fa..e6766ffb70b 100644 --- a/src/vs/editor/contrib/colorPicker/browser/color.ts +++ b/src/vs/editor/contrib/colorPicker/browser/color.ts @@ -3,19 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { URI } from 'vs/base/common/uri'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { DocumentColorProvider, IColorInformation, IColorPresentation } from 'vs/editor/common/languages'; -import { IModelService } from 'vs/editor/common/services/model'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { DefaultDocumentColorProvider } from 'vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ServicesAccessor } from 'vs/editor/browser/editorExtensions'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { illegalArgument, onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IRange } from '../../../common/core/range.js'; +import { ITextModel } from '../../../common/model.js'; +import { DocumentColorProvider, IColorInformation, IColorPresentation } from '../../../common/languages.js'; +import { IModelService } from '../../../common/services/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { DefaultDocumentColorProvider } from './defaultDocumentColorProvider.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { ServicesAccessor } from '../../../browser/editorExtensions.js'; export async function getColors(colorProviderRegistry: LanguageFeatureRegistry, model: ITextModel, token: CancellationToken, isDefaultColorDecoratorsEnabled: boolean = true): Promise { return _findColorData(new ColorDataCollector(), colorProviderRegistry, model, token, isDefaultColorDecoratorsEnabled); @@ -30,7 +29,7 @@ export interface IColorData { provider: DocumentColorProvider; } -interface IExtColorData { range: IRange; color: [number, number, number, number] } +export interface IExtColorData { range: IRange; color: [number, number, number, number] } interface DataCollector { compute(provider: DocumentColorProvider, model: ITextModel, token: CancellationToken, result: T[]): Promise; @@ -49,7 +48,7 @@ class ColorDataCollector implements DataCollector { } } -class ExtColorDataCollector implements DataCollector { +export class ExtColorDataCollector implements DataCollector { constructor() { } async compute(provider: DocumentColorProvider, model: ITextModel, token: CancellationToken, colors: IExtColorData[]): Promise { const documentColors = await provider.provideDocumentColors(model, token); @@ -63,7 +62,7 @@ class ExtColorDataCollector implements DataCollector { } -class ColorPresentationsCollector implements DataCollector { +export class ColorPresentationsCollector implements DataCollector { constructor(private colorInfo: IColorInformation) { } async compute(provider: DocumentColorProvider, model: ITextModel, _token: CancellationToken, colors: IColorPresentation[]): Promise { const documentColors = await provider.provideColorPresentations(model, this.colorInfo, CancellationToken.None); @@ -74,7 +73,7 @@ class ColorPresentationsCollector implements DataCollector { } } -async function _findColorData(collector: DataCollector, colorProviderRegistry: LanguageFeatureRegistry, model: ITextModel, token: CancellationToken, isDefaultColorDecoratorsEnabled: boolean): Promise { +export async function _findColorData(collector: DataCollector, colorProviderRegistry: LanguageFeatureRegistry, model: ITextModel, token: CancellationToken, isDefaultColorDecoratorsEnabled: boolean): Promise { let validDocumentColorProviderFound = false; let defaultProvider: DefaultDocumentColorProvider | undefined; const colorData: T[] = []; @@ -103,7 +102,7 @@ async function _findColorData; isDefaultColorDecoratorsEnabled: boolean } { +export function _setupColorCommand(accessor: ServicesAccessor, resource: URI): { model: ITextModel; colorProviderRegistry: LanguageFeatureRegistry; isDefaultColorDecoratorsEnabled: boolean } { const { colorProvider: colorProviderRegistry } = accessor.get(ILanguageFeaturesService); const model = accessor.get(IModelService).getModel(resource); if (!model) { @@ -113,22 +112,3 @@ function _setupColorCommand(accessor: ServicesAccessor, resource: URI): { model: return { model, colorProviderRegistry, isDefaultColorDecoratorsEnabled }; } -CommandsRegistry.registerCommand('_executeDocumentColorProvider', function (accessor, ...args) { - const [resource] = args; - if (!(resource instanceof URI)) { - throw illegalArgument(); - } - const { model, colorProviderRegistry, isDefaultColorDecoratorsEnabled } = _setupColorCommand(accessor, resource); - return _findColorData(new ExtColorDataCollector(), colorProviderRegistry, model, CancellationToken.None, isDefaultColorDecoratorsEnabled); -}); - -CommandsRegistry.registerCommand('_executeColorPresentationProvider', function (accessor, ...args) { - const [color, context] = args; - const { uri, range } = context; - if (!(uri instanceof URI) || !Array.isArray(color) || color.length !== 4 || !Range.isIRange(range)) { - throw illegalArgument(); - } - const { model, colorProviderRegistry, isDefaultColorDecoratorsEnabled } = _setupColorCommand(accessor, uri); - const [red, green, blue, alpha] = color; - return _findColorData(new ColorPresentationsCollector({ range: range, color: { red, green, blue, alpha } }), colorProviderRegistry, model, CancellationToken.None, isDefaultColorDecoratorsEnabled); -}); diff --git a/src/vs/editor/contrib/colorPicker/browser/colorDetector.ts b/src/vs/editor/contrib/colorPicker/browser/colorDetector.ts index 150f23daa07..19d9d9d5737 100644 --- a/src/vs/editor/contrib/colorPicker/browser/colorDetector.ts +++ b/src/vs/editor/contrib/colorPicker/browser/colorDetector.ts @@ -3,26 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise, TimeoutTimer } from 'vs/base/common/async'; -import { RGBA } from 'vs/base/common/color'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { noBreakWhitespace } from 'vs/base/common/strings'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { DynamicCssRules } from 'vs/editor/browser/editorDom'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { IModelDecoration, IModelDeltaDecoration } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { getColors, IColorData } from 'vs/editor/contrib/colorPicker/browser/color'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { CancelablePromise, createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js'; +import { RGBA } from '../../../../base/common/color.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { noBreakWhitespace } from '../../../../base/common/strings.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { DynamicCssRules } from '../../../browser/editorDom.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { IModelDecoration, IModelDeltaDecoration } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { getColors, IColorData } from './color.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; export const ColorDecorationInjectedTextMarker = Object.create({}); @@ -288,5 +287,3 @@ export class DecoratorLimitReporter { } } } - -registerEditorContribution(ColorDetector.ID, ColorDetector, EditorContributionInstantiation.AfterFirstRender); diff --git a/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.ts b/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.ts deleted file mode 100644 index 1bbdde4c746..00000000000 --- a/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.ts +++ /dev/null @@ -1,264 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { AsyncIterableObject } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Color, RGBA } from 'vs/base/common/color'; -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { IModelDecoration, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { DocumentColorProvider, IColorInformation } from 'vs/editor/common/languages'; -import { getColorPresentations, getColors } from 'vs/editor/contrib/colorPicker/browser/color'; -import { ColorDetector } from 'vs/editor/contrib/colorPicker/browser/colorDetector'; -import { ColorPickerModel } from 'vs/editor/contrib/colorPicker/browser/colorPickerModel'; -import { ColorPickerWidget } from 'vs/editor/contrib/colorPicker/browser/colorPickerWidget'; -import { HoverAnchor, HoverAnchorType, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { Dimension } from 'vs/base/browser/dom'; - -export class ColorHover implements IHoverPart { - - /** - * Force the hover to always be rendered at this specific range, - * even in the case of multiple hover parts. - */ - public readonly forceShowAtRange: boolean = true; - - constructor( - public readonly owner: IEditorHoverParticipant, - public readonly range: Range, - public readonly model: ColorPickerModel, - public readonly provider: DocumentColorProvider - ) { } - - public isValidForHoverAnchor(anchor: HoverAnchor): boolean { - return ( - anchor.type === HoverAnchorType.Range - && this.range.startColumn <= anchor.range.startColumn - && this.range.endColumn >= anchor.range.endColumn - ); - } -} - -export class ColorHoverParticipant implements IEditorHoverParticipant { - - public readonly hoverOrdinal: number = 2; - - private _colorPicker: ColorPickerWidget | undefined; - - constructor( - private readonly _editor: ICodeEditor, - @IThemeService private readonly _themeService: IThemeService, - ) { } - - public computeSync(_anchor: HoverAnchor, _lineDecorations: IModelDecoration[]): ColorHover[] { - return []; - } - - public computeAsync(anchor: HoverAnchor, lineDecorations: IModelDecoration[], token: CancellationToken): AsyncIterableObject { - return AsyncIterableObject.fromPromise(this._computeAsync(anchor, lineDecorations, token)); - } - - private async _computeAsync(_anchor: HoverAnchor, lineDecorations: IModelDecoration[], _token: CancellationToken): Promise { - if (!this._editor.hasModel()) { - return []; - } - const colorDetector = ColorDetector.get(this._editor); - if (!colorDetector) { - return []; - } - for (const d of lineDecorations) { - if (!colorDetector.isColorDecoration(d)) { - continue; - } - - const colorData = colorDetector.getColorData(d.range.getStartPosition()); - if (colorData) { - const colorHover = await _createColorHover(this, this._editor.getModel(), colorData.colorInfo, colorData.provider); - return [colorHover]; - } - - } - return []; - } - - public renderHoverParts(context: IEditorHoverRenderContext, hoverParts: ColorHover[]): IDisposable { - const { disposables, colorPicker } = renderHoverParts(this, this._editor, this._themeService, hoverParts, context); - this._colorPicker = colorPicker; - return disposables; - } - - public handleResize(): void { - this._colorPicker?.layout(); - } - - public isColorPickerVisible(): boolean { - return !!this._colorPicker; - } -} - -export class StandaloneColorPickerHover { - constructor( - public readonly owner: StandaloneColorPickerParticipant, - public readonly range: Range, - public readonly model: ColorPickerModel, - public readonly provider: DocumentColorProvider - ) { } -} - -export class StandaloneColorPickerParticipant { - - public readonly hoverOrdinal: number = 2; - private _color: Color | null = null; - - constructor( - private readonly _editor: ICodeEditor, - @IThemeService private readonly _themeService: IThemeService, - ) { } - - public async createColorHover(defaultColorInfo: IColorInformation, defaultColorProvider: DocumentColorProvider, colorProviderRegistry: LanguageFeatureRegistry): Promise<{ colorHover: StandaloneColorPickerHover; foundInEditor: boolean } | null> { - if (!this._editor.hasModel()) { - return null; - } - const colorDetector = ColorDetector.get(this._editor); - if (!colorDetector) { - return null; - } - const colors = await getColors(colorProviderRegistry, this._editor.getModel(), CancellationToken.None); - let foundColorInfo: IColorInformation | null = null; - let foundColorProvider: DocumentColorProvider | null = null; - for (const colorData of colors) { - const colorInfo = colorData.colorInfo; - if (Range.containsRange(colorInfo.range, defaultColorInfo.range)) { - foundColorInfo = colorInfo; - foundColorProvider = colorData.provider; - } - } - const colorInfo = foundColorInfo ?? defaultColorInfo; - const colorProvider = foundColorProvider ?? defaultColorProvider; - const foundInEditor = !!foundColorInfo; - return { colorHover: await _createColorHover(this, this._editor.getModel(), colorInfo, colorProvider), foundInEditor: foundInEditor }; - } - - public async updateEditorModel(colorHoverData: StandaloneColorPickerHover): Promise { - if (!this._editor.hasModel()) { - return; - } - const colorPickerModel = colorHoverData.model; - let range = new Range(colorHoverData.range.startLineNumber, colorHoverData.range.startColumn, colorHoverData.range.endLineNumber, colorHoverData.range.endColumn); - if (this._color) { - await _updateColorPresentations(this._editor.getModel(), colorPickerModel, this._color, range, colorHoverData); - range = _updateEditorModel(this._editor, range, colorPickerModel); - } - } - - public renderHoverParts(context: IEditorHoverRenderContext, hoverParts: ColorHover[] | StandaloneColorPickerHover[]): { disposables: IDisposable; colorPicker: ColorPickerWidget | undefined } { - return renderHoverParts(this, this._editor, this._themeService, hoverParts, context); - } - - public set color(color: Color | null) { - this._color = color; - } - - public get color(): Color | null { - return this._color; - } -} - -async function _createColorHover(participant: T, editorModel: ITextModel, colorInfo: IColorInformation, provider: DocumentColorProvider): Promise; -async function _createColorHover(participant: ColorHoverParticipant | StandaloneColorPickerParticipant, editorModel: ITextModel, colorInfo: IColorInformation, provider: DocumentColorProvider): Promise { - const originalText = editorModel.getValueInRange(colorInfo.range); - const { red, green, blue, alpha } = colorInfo.color; - const rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha); - const color = new Color(rgba); - - const colorPresentations = await getColorPresentations(editorModel, colorInfo, provider, CancellationToken.None); - const model = new ColorPickerModel(color, [], 0); - model.colorPresentations = colorPresentations || []; - model.guessColorPresentation(color, originalText); - - if (participant instanceof ColorHoverParticipant) { - return new ColorHover(participant, Range.lift(colorInfo.range), model, provider); - } else { - return new StandaloneColorPickerHover(participant, Range.lift(colorInfo.range), model, provider); - } -} - -function renderHoverParts(participant: ColorHoverParticipant | StandaloneColorPickerParticipant, editor: ICodeEditor, themeService: IThemeService, hoverParts: ColorHover[] | StandaloneColorPickerHover[], context: IEditorHoverRenderContext): { disposables: IDisposable; colorPicker: ColorPickerWidget | undefined } { - if (hoverParts.length === 0 || !editor.hasModel()) { - return { disposables: Disposable.None, colorPicker: undefined }; - } - if (context.setMinimumDimensions) { - const minimumHeight = editor.getOption(EditorOption.lineHeight) + 8; - context.setMinimumDimensions(new Dimension(302, minimumHeight)); - } - - const disposables = new DisposableStore(); - const colorHover = hoverParts[0]; - const editorModel = editor.getModel(); - const model = colorHover.model; - const colorPicker = disposables.add(new ColorPickerWidget(context.fragment, model, editor.getOption(EditorOption.pixelRatio), themeService, participant instanceof StandaloneColorPickerParticipant)); - - let editorUpdatedByColorPicker = false; - let range = new Range(colorHover.range.startLineNumber, colorHover.range.startColumn, colorHover.range.endLineNumber, colorHover.range.endColumn); - if (participant instanceof StandaloneColorPickerParticipant) { - const color = hoverParts[0].model.color; - participant.color = color; - _updateColorPresentations(editorModel, model, color, range, colorHover); - disposables.add(model.onColorFlushed((color: Color) => { - participant.color = color; - })); - } else { - disposables.add(model.onColorFlushed(async (color: Color) => { - await _updateColorPresentations(editorModel, model, color, range, colorHover); - editorUpdatedByColorPicker = true; - range = _updateEditorModel(editor, range, model); - })); - } - disposables.add(model.onDidChangeColor((color: Color) => { - _updateColorPresentations(editorModel, model, color, range, colorHover); - })); - disposables.add(editor.onDidChangeModelContent((e) => { - if (editorUpdatedByColorPicker) { - editorUpdatedByColorPicker = false; - } else { - context.hide(); - editor.focus(); - } - })); - return { disposables, colorPicker }; -} - -function _updateEditorModel(editor: IActiveCodeEditor, range: Range, model: ColorPickerModel): Range { - const textEdits: ISingleEditOperation[] = []; - const edit = model.presentation.textEdit ?? { range, text: model.presentation.label, forceMoveMarkers: false }; - textEdits.push(edit); - - if (model.presentation.additionalTextEdits) { - textEdits.push(...model.presentation.additionalTextEdits); - } - const replaceRange = Range.lift(edit.range); - const trackedRange = editor.getModel()._setTrackedRange(null, replaceRange, TrackedRangeStickiness.GrowsOnlyWhenTypingAfter); - editor.executeEdits('colorpicker', textEdits); - editor.pushUndoStop(); - return editor.getModel()._getTrackedRange(trackedRange) ?? replaceRange; -} - -async function _updateColorPresentations(editorModel: ITextModel, colorPickerModel: ColorPickerModel, color: Color, range: Range, colorHover: ColorHover | StandaloneColorPickerHover) { - const colorPresentations = await getColorPresentations(editorModel, { - range: range, - color: { - red: color.rgba.r / 255, - green: color.rgba.g / 255, - blue: color.rgba.b / 255, - alpha: color.rgba.a - } - }, colorHover.provider, CancellationToken.None); - colorPickerModel.colorPresentations = colorPresentations || []; -} diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerContribution.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerContribution.ts new file mode 100644 index 00000000000..9bdfa72e65b --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/colorPickerContribution.ts @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { illegalArgument } from '../../../../base/common/errors.js'; +import { URI } from '../../../../base/common/uri.js'; +import { registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { registerEditorFeature } from '../../../common/editorFeatures.js'; +import { IColorPresentation } from '../../../common/languages.js'; +import { HoverParticipantRegistry } from '../../hover/browser/hoverTypes.js'; +import { _findColorData, _setupColorCommand, ColorPresentationsCollector, ExtColorDataCollector, IExtColorData } from './color.js'; +import { ColorDetector } from './colorDetector.js'; +import { DefaultDocumentColorProviderFeature } from './defaultDocumentColorProvider.js'; +import { HoverColorPickerContribution } from './hoverColorPicker/hoverColorPickerContribution.js'; +import { HoverColorPickerParticipant } from './hoverColorPicker/hoverColorPickerParticipant.js'; +import { HideStandaloneColorPicker, InsertColorWithStandaloneColorPicker, ShowOrFocusStandaloneColorPicker } from './standaloneColorPicker/standaloneColorPickerActions.js'; +import { StandaloneColorPickerController } from './standaloneColorPicker/standaloneColorPickerController.js'; +import { Range } from '../../../common/core/range.js'; + +registerEditorAction(HideStandaloneColorPicker); +registerEditorAction(InsertColorWithStandaloneColorPicker); +registerAction2(ShowOrFocusStandaloneColorPicker); + +registerEditorContribution(HoverColorPickerContribution.ID, HoverColorPickerContribution, EditorContributionInstantiation.BeforeFirstInteraction); +registerEditorContribution(StandaloneColorPickerController.ID, StandaloneColorPickerController, EditorContributionInstantiation.AfterFirstRender); +registerEditorContribution(ColorDetector.ID, ColorDetector, EditorContributionInstantiation.AfterFirstRender); +registerEditorFeature(DefaultDocumentColorProviderFeature); + +HoverParticipantRegistry.register(HoverColorPickerParticipant); + +CommandsRegistry.registerCommand('_executeDocumentColorProvider', function (accessor, ...args) { + const [resource] = args; + if (!(resource instanceof URI)) { + throw illegalArgument(); + } + const { model, colorProviderRegistry, isDefaultColorDecoratorsEnabled } = _setupColorCommand(accessor, resource); + return _findColorData(new ExtColorDataCollector(), colorProviderRegistry, model, CancellationToken.None, isDefaultColorDecoratorsEnabled); +}); + +CommandsRegistry.registerCommand('_executeColorPresentationProvider', function (accessor, ...args) { + const [color, context] = args; + const { uri, range } = context; + if (!(uri instanceof URI) || !Array.isArray(color) || color.length !== 4 || !Range.isIRange(range)) { + throw illegalArgument(); + } + const { model, colorProviderRegistry, isDefaultColorDecoratorsEnabled } = _setupColorCommand(accessor, uri); + const [red, green, blue, alpha] = color; + return _findColorData(new ColorPresentationsCollector({ range: range, color: { red, green, blue, alpha } }), colorProviderRegistry, model, CancellationToken.None, isDefaultColorDecoratorsEnabled); +}); diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerModel.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerModel.ts index 0bd8ff1c171..06a0c278e27 100644 --- a/src/vs/editor/contrib/colorPicker/browser/colorPickerModel.ts +++ b/src/vs/editor/contrib/colorPicker/browser/colorPickerModel.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Color } from 'vs/base/common/color'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IColorPresentation } from 'vs/editor/common/languages'; +import { Color } from '../../../../base/common/color.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { IColorPresentation } from '../../../common/languages.js'; export class ColorPickerModel { diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerParticipantUtils.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerParticipantUtils.ts new file mode 100644 index 00000000000..0975790a57a --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/colorPickerParticipantUtils.ts @@ -0,0 +1,66 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Color, RGBA } from '../../../../base/common/color.js'; +import { IActiveCodeEditor } from '../../../browser/editorBrowser.js'; +import { ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { DocumentColorProvider, IColorInformation } from '../../../common/languages.js'; +import { ITextModel, TrackedRangeStickiness } from '../../../common/model.js'; +import { getColorPresentations } from './color.js'; +import { ColorPickerModel } from './colorPickerModel.js'; +import { Range } from '../../../common/core/range.js'; + +export interface BaseColor { + readonly range: Range; + readonly model: ColorPickerModel; + readonly provider: DocumentColorProvider; +} + +export async function createColorHover(editorModel: ITextModel, colorInfo: IColorInformation, provider: DocumentColorProvider): Promise { + const originalText = editorModel.getValueInRange(colorInfo.range); + const { red, green, blue, alpha } = colorInfo.color; + const rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha); + const color = new Color(rgba); + + const colorPresentations = await getColorPresentations(editorModel, colorInfo, provider, CancellationToken.None); + const model = new ColorPickerModel(color, [], 0); + model.colorPresentations = colorPresentations || []; + model.guessColorPresentation(color, originalText); + + return { + range: Range.lift(colorInfo.range), + model, + provider + }; +} + +export function updateEditorModel(editor: IActiveCodeEditor, range: Range, model: ColorPickerModel): Range { + const textEdits: ISingleEditOperation[] = []; + const edit = model.presentation.textEdit ?? { range, text: model.presentation.label, forceMoveMarkers: false }; + textEdits.push(edit); + + if (model.presentation.additionalTextEdits) { + textEdits.push(...model.presentation.additionalTextEdits); + } + const replaceRange = Range.lift(edit.range); + const trackedRange = editor.getModel()._setTrackedRange(null, replaceRange, TrackedRangeStickiness.GrowsOnlyWhenTypingAfter); + editor.executeEdits('colorpicker', textEdits); + editor.pushUndoStop(); + return editor.getModel()._getTrackedRange(trackedRange) ?? replaceRange; +} + +export async function updateColorPresentations(editorModel: ITextModel, colorPickerModel: ColorPickerModel, color: Color, range: Range, colorHover: BaseColor): Promise { + const colorPresentations = await getColorPresentations(editorModel, { + range: range, + color: { + red: color.rgba.r / 255, + green: color.rgba.g / 255, + blue: color.rgba.b / 255, + alpha: color.rgba.a + } + }, colorHover.provider, CancellationToken.None); + colorPickerModel.colorPresentations = colorPresentations || []; +} diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerBody.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerBody.ts new file mode 100644 index 00000000000..aa8c5428826 --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerBody.ts @@ -0,0 +1,97 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import '../colorPicker.css'; +import * as dom from '../../../../../base/browser/dom.js'; +import { Color, HSVA } from '../../../../../base/common/color.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { ColorPickerModel } from '../colorPickerModel.js'; +import { SaturationBox } from './colorPickerSaturationBox.js'; +import { InsertButton } from './colorPickerInsertButton.js'; +import { HueStrip, OpacityStrip, Strip } from './colorPickerStrip.js'; + +const $ = dom.$; + +export class ColorPickerBody extends Disposable { + + private readonly _domNode: HTMLElement; + private readonly _saturationBox: SaturationBox; + private readonly _hueStrip: Strip; + private readonly _opacityStrip: Strip; + private readonly _insertButton: InsertButton | null = null; + + constructor(container: HTMLElement, private readonly model: ColorPickerModel, private pixelRatio: number, isStandaloneColorPicker: boolean = false) { + super(); + + this._domNode = $('.colorpicker-body'); + dom.append(container, this._domNode); + + this._saturationBox = new SaturationBox(this._domNode, this.model, this.pixelRatio); + this._register(this._saturationBox); + this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange, this)); + this._register(this._saturationBox.onColorFlushed(this.flushColor, this)); + + this._opacityStrip = new OpacityStrip(this._domNode, this.model, isStandaloneColorPicker); + this._register(this._opacityStrip); + this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange, this)); + this._register(this._opacityStrip.onColorFlushed(this.flushColor, this)); + + this._hueStrip = new HueStrip(this._domNode, this.model, isStandaloneColorPicker); + this._register(this._hueStrip); + this._register(this._hueStrip.onDidChange(this.onDidHueChange, this)); + this._register(this._hueStrip.onColorFlushed(this.flushColor, this)); + + if (isStandaloneColorPicker) { + this._insertButton = this._register(new InsertButton(this._domNode)); + this._domNode.classList.add('standalone-colorpicker'); + } + } + + private flushColor(): void { + this.model.flushColor(); + } + + private onDidSaturationValueChange({ s, v }: { s: number; v: number }): void { + const hsva = this.model.color.hsva; + this.model.color = new Color(new HSVA(hsva.h, s, v, hsva.a)); + } + + private onDidOpacityChange(a: number): void { + const hsva = this.model.color.hsva; + this.model.color = new Color(new HSVA(hsva.h, hsva.s, hsva.v, a)); + } + + private onDidHueChange(value: number): void { + const hsva = this.model.color.hsva; + const h = (1 - value) * 360; + + this.model.color = new Color(new HSVA(h === 360 ? 0 : h, hsva.s, hsva.v, hsva.a)); + } + + get domNode() { + return this._domNode; + } + + get saturationBox() { + return this._saturationBox; + } + + get opacityStrip() { + return this._opacityStrip; + } + + get hueStrip() { + return this._hueStrip; + } + + get enterButton() { + return this._insertButton; + } + + layout(): void { + this._saturationBox.layout(); + this._opacityStrip.layout(); + this._hueStrip.layout(); + } +} diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.ts new file mode 100644 index 00000000000..4b8bc2b45f6 --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.ts @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import '../colorPicker.css'; +import * as dom from '../../../../../base/browser/dom.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { localize } from '../../../../../nls.js'; +import { Emitter } from '../../../../../base/common/event.js'; +import { registerIcon } from '../../../../../platform/theme/common/iconRegistry.js'; +import { ThemeIcon } from '../../../../../base/common/themables.js'; +import { Codicon } from '../../../../../base/common/codicons.js'; + +const $ = dom.$; + +export class CloseButton extends Disposable { + + private _button: HTMLElement; + private readonly _onClicked = this._register(new Emitter()); + public readonly onClicked = this._onClicked.event; + + constructor(container: HTMLElement) { + super(); + this._button = document.createElement('div'); + this._button.classList.add('close-button'); + dom.append(container, this._button); + + const innerDiv = document.createElement('div'); + innerDiv.classList.add('close-button-inner-div'); + dom.append(this._button, innerDiv); + + const closeButton = dom.append(innerDiv, $('.button' + ThemeIcon.asCSSSelector(registerIcon('color-picker-close', Codicon.close, localize('closeIcon', 'Icon to close the color picker'))))); + closeButton.classList.add('close-icon'); + this._register(dom.addDisposableListener(this._button, dom.EventType.CLICK, () => { + this._onClicked.fire(); + })); + } +} diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.ts new file mode 100644 index 00000000000..92cd6c65e68 --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.ts @@ -0,0 +1,93 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import '../colorPicker.css'; +import * as dom from '../../../../../base/browser/dom.js'; +import { Color } from '../../../../../base/common/color.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { ColorPickerModel } from '../colorPickerModel.js'; +import { localize } from '../../../../../nls.js'; +import { editorHoverBackground } from '../../../../../platform/theme/common/colorRegistry.js'; +import { IThemeService } from '../../../../../platform/theme/common/themeService.js'; +import { CloseButton } from './colorPickerCloseButton.js'; + +const $ = dom.$; + +export class ColorPickerHeader extends Disposable { + + private readonly _domNode: HTMLElement; + private readonly _pickedColorNode: HTMLElement; + private readonly _pickedColorPresentation: HTMLElement; + private readonly _originalColorNode: HTMLElement; + private readonly _closeButton: CloseButton | null = null; + private backgroundColor: Color; + + constructor(container: HTMLElement, private readonly model: ColorPickerModel, themeService: IThemeService, private showingStandaloneColorPicker: boolean = false) { + super(); + + this._domNode = $('.colorpicker-header'); + dom.append(container, this._domNode); + + this._pickedColorNode = dom.append(this._domNode, $('.picked-color')); + dom.append(this._pickedColorNode, $('span.codicon.codicon-color-mode')); + this._pickedColorPresentation = dom.append(this._pickedColorNode, document.createElement('span')); + this._pickedColorPresentation.classList.add('picked-color-presentation'); + + const tooltip = localize('clickToToggleColorOptions', "Click to toggle color options (rgb/hsl/hex)"); + this._pickedColorNode.setAttribute('title', tooltip); + + this._originalColorNode = dom.append(this._domNode, $('.original-color')); + this._originalColorNode.style.backgroundColor = Color.Format.CSS.format(this.model.originalColor) || ''; + + this.backgroundColor = themeService.getColorTheme().getColor(editorHoverBackground) || Color.white; + this._register(themeService.onDidColorThemeChange(theme => { + this.backgroundColor = theme.getColor(editorHoverBackground) || Color.white; + })); + + this._register(dom.addDisposableListener(this._pickedColorNode, dom.EventType.CLICK, () => this.model.selectNextColorPresentation())); + this._register(dom.addDisposableListener(this._originalColorNode, dom.EventType.CLICK, () => { + this.model.color = this.model.originalColor; + this.model.flushColor(); + })); + this._register(model.onDidChangeColor(this.onDidChangeColor, this)); + this._register(model.onDidChangePresentation(this.onDidChangePresentation, this)); + this._pickedColorNode.style.backgroundColor = Color.Format.CSS.format(model.color) || ''; + this._pickedColorNode.classList.toggle('light', model.color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : model.color.isLighter()); + + this.onDidChangeColor(this.model.color); + + // When the color picker widget is a standalone color picker widget, then add a close button + if (this.showingStandaloneColorPicker) { + this._domNode.classList.add('standalone-colorpicker'); + this._closeButton = this._register(new CloseButton(this._domNode)); + } + } + + public get domNode(): HTMLElement { + return this._domNode; + } + + public get closeButton(): CloseButton | null { + return this._closeButton; + } + + public get pickedColorNode(): HTMLElement { + return this._pickedColorNode; + } + + public get originalColorNode(): HTMLElement { + return this._originalColorNode; + } + + private onDidChangeColor(color: Color): void { + this._pickedColorNode.style.backgroundColor = Color.Format.CSS.format(color) || ''; + this._pickedColorNode.classList.toggle('light', color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : color.isLighter()); + this.onDidChangePresentation(); + } + + private onDidChangePresentation(): void { + this._pickedColorPresentation.textContent = this.model.presentation ? this.model.presentation.label : ''; + } +} diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerInsertButton.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerInsertButton.ts new file mode 100644 index 00000000000..83c7ec84f1b --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerInsertButton.ts @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import '../colorPicker.css'; +import * as dom from '../../../../../base/browser/dom.js'; +import { Emitter } from '../../../../../base/common/event.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; + +export class InsertButton extends Disposable { + + private _button: HTMLElement; + private readonly _onClicked = this._register(new Emitter()); + public readonly onClicked = this._onClicked.event; + + constructor(container: HTMLElement) { + super(); + this._button = dom.append(container, document.createElement('button')); + this._button.classList.add('insert-button'); + this._button.textContent = 'Insert'; + this._register(dom.addDisposableListener(this._button, dom.EventType.CLICK, () => { + this._onClicked.fire(); + })); + } + + public get button(): HTMLElement { + return this._button; + } +} diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerSaturationBox.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerSaturationBox.ts new file mode 100644 index 00000000000..feb65929064 --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerSaturationBox.ts @@ -0,0 +1,138 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import '../colorPicker.css'; +import * as dom from '../../../../../base/browser/dom.js'; +import { GlobalPointerMoveMonitor } from '../../../../../base/browser/globalPointerMoveMonitor.js'; +import { Color, HSVA } from '../../../../../base/common/color.js'; +import { Emitter, Event } from '../../../../../base/common/event.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { ColorPickerModel } from '../colorPickerModel.js'; + +const $ = dom.$; + +export class SaturationBox extends Disposable { + + private readonly _domNode: HTMLElement; + private readonly selection: HTMLElement; + private readonly _canvas: HTMLCanvasElement; + private width!: number; + private height!: number; + + private monitor: GlobalPointerMoveMonitor | null; + private readonly _onDidChange = new Emitter<{ s: number; v: number }>(); + readonly onDidChange: Event<{ s: number; v: number }> = this._onDidChange.event; + + private readonly _onColorFlushed = new Emitter(); + readonly onColorFlushed: Event = this._onColorFlushed.event; + + constructor(container: HTMLElement, private readonly model: ColorPickerModel, private pixelRatio: number) { + super(); + + this._domNode = $('.saturation-wrap'); + dom.append(container, this._domNode); + + // Create canvas, draw selected color + this._canvas = document.createElement('canvas'); + this._canvas.className = 'saturation-box'; + dom.append(this._domNode, this._canvas); + + // Add selection circle + this.selection = $('.saturation-selection'); + dom.append(this._domNode, this.selection); + + this.layout(); + + this._register(dom.addDisposableListener(this._domNode, dom.EventType.POINTER_DOWN, e => this.onPointerDown(e))); + this._register(this.model.onDidChangeColor(this.onDidChangeColor, this)); + this.monitor = null; + } + + public get domNode() { + return this._domNode; + } + + public get canvas() { + return this._canvas; + } + + private onPointerDown(e: PointerEvent): void { + if (!e.target || !(e.target instanceof Element)) { + return; + } + this.monitor = this._register(new GlobalPointerMoveMonitor()); + const origin = dom.getDomNodePagePosition(this._domNode); + + if (e.target !== this.selection) { + this.onDidChangePosition(e.offsetX, e.offsetY); + } + + this.monitor.startMonitoring(e.target, e.pointerId, e.buttons, event => this.onDidChangePosition(event.pageX - origin.left, event.pageY - origin.top), () => null); + + const pointerUpListener = dom.addDisposableListener(e.target.ownerDocument, dom.EventType.POINTER_UP, () => { + this._onColorFlushed.fire(); + pointerUpListener.dispose(); + if (this.monitor) { + this.monitor.stopMonitoring(true); + this.monitor = null; + } + }, true); + } + + private onDidChangePosition(left: number, top: number): void { + const s = Math.max(0, Math.min(1, left / this.width)); + const v = Math.max(0, Math.min(1, 1 - (top / this.height))); + + this.paintSelection(s, v); + this._onDidChange.fire({ s, v }); + } + + layout(): void { + this.width = this._domNode.offsetWidth; + this.height = this._domNode.offsetHeight; + this._canvas.width = this.width * this.pixelRatio; + this._canvas.height = this.height * this.pixelRatio; + this.paint(); + + const hsva = this.model.color.hsva; + this.paintSelection(hsva.s, hsva.v); + } + + private paint(): void { + const hsva = this.model.color.hsva; + const saturatedColor = new Color(new HSVA(hsva.h, 1, 1, 1)); + const ctx = this._canvas.getContext('2d')!; + + const whiteGradient = ctx.createLinearGradient(0, 0, this._canvas.width, 0); + whiteGradient.addColorStop(0, 'rgba(255, 255, 255, 1)'); + whiteGradient.addColorStop(0.5, 'rgba(255, 255, 255, 0.5)'); + whiteGradient.addColorStop(1, 'rgba(255, 255, 255, 0)'); + + const blackGradient = ctx.createLinearGradient(0, 0, 0, this._canvas.height); + blackGradient.addColorStop(0, 'rgba(0, 0, 0, 0)'); + blackGradient.addColorStop(1, 'rgba(0, 0, 0, 1)'); + + ctx.rect(0, 0, this._canvas.width, this._canvas.height); + ctx.fillStyle = Color.Format.CSS.format(saturatedColor)!; + ctx.fill(); + ctx.fillStyle = whiteGradient; + ctx.fill(); + ctx.fillStyle = blackGradient; + ctx.fill(); + } + + private paintSelection(s: number, v: number): void { + this.selection.style.left = `${s * this.width}px`; + this.selection.style.top = `${this.height - v * this.height}px`; + } + + private onDidChangeColor(color: Color): void { + if (this.monitor && this.monitor.isMonitoring()) { + return; + } + this.paint(); + const hsva = color.hsva; + this.paintSelection(hsva.s, hsva.v); + } +} diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerStrip.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerStrip.ts new file mode 100644 index 00000000000..ff72ddf8732 --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerStrip.ts @@ -0,0 +1,126 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import '../colorPicker.css'; +import * as dom from '../../../../../base/browser/dom.js'; +import { GlobalPointerMoveMonitor } from '../../../../../base/browser/globalPointerMoveMonitor.js'; +import { Color, RGBA } from '../../../../../base/common/color.js'; +import { Emitter, Event } from '../../../../../base/common/event.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { ColorPickerModel } from '../colorPickerModel.js'; + +const $ = dom.$; + +export abstract class Strip extends Disposable { + + protected domNode: HTMLElement; + protected overlay: HTMLElement; + protected slider: HTMLElement; + private height!: number; + + private readonly _onDidChange = new Emitter(); + readonly onDidChange: Event = this._onDidChange.event; + + private readonly _onColorFlushed = new Emitter(); + readonly onColorFlushed: Event = this._onColorFlushed.event; + + constructor(container: HTMLElement, protected model: ColorPickerModel, showingStandaloneColorPicker: boolean = false) { + super(); + if (showingStandaloneColorPicker) { + this.domNode = dom.append(container, $('.standalone-strip')); + this.overlay = dom.append(this.domNode, $('.standalone-overlay')); + } else { + this.domNode = dom.append(container, $('.strip')); + this.overlay = dom.append(this.domNode, $('.overlay')); + } + this.slider = dom.append(this.domNode, $('.slider')); + this.slider.style.top = `0px`; + + this._register(dom.addDisposableListener(this.domNode, dom.EventType.POINTER_DOWN, e => this.onPointerDown(e))); + this._register(model.onDidChangeColor(this.onDidChangeColor, this)); + this.layout(); + } + + layout(): void { + this.height = this.domNode.offsetHeight - this.slider.offsetHeight; + + const value = this.getValue(this.model.color); + this.updateSliderPosition(value); + } + + protected onDidChangeColor(color: Color) { + const value = this.getValue(color); + this.updateSliderPosition(value); + } + + private onPointerDown(e: PointerEvent): void { + if (!e.target || !(e.target instanceof Element)) { + return; + } + const monitor = this._register(new GlobalPointerMoveMonitor()); + const origin = dom.getDomNodePagePosition(this.domNode); + this.domNode.classList.add('grabbing'); + + if (e.target !== this.slider) { + this.onDidChangeTop(e.offsetY); + } + + monitor.startMonitoring(e.target, e.pointerId, e.buttons, event => this.onDidChangeTop(event.pageY - origin.top), () => null); + + const pointerUpListener = dom.addDisposableListener(e.target.ownerDocument, dom.EventType.POINTER_UP, () => { + this._onColorFlushed.fire(); + pointerUpListener.dispose(); + monitor.stopMonitoring(true); + this.domNode.classList.remove('grabbing'); + }, true); + } + + private onDidChangeTop(top: number): void { + const value = Math.max(0, Math.min(1, 1 - (top / this.height))); + + this.updateSliderPosition(value); + this._onDidChange.fire(value); + } + + private updateSliderPosition(value: number): void { + this.slider.style.top = `${(1 - value) * this.height}px`; + } + + protected abstract getValue(color: Color): number; +} + +export class OpacityStrip extends Strip { + + constructor(container: HTMLElement, model: ColorPickerModel, showingStandaloneColorPicker: boolean = false) { + super(container, model, showingStandaloneColorPicker); + this.domNode.classList.add('opacity-strip'); + + this.onDidChangeColor(this.model.color); + } + + protected override onDidChangeColor(color: Color): void { + super.onDidChangeColor(color); + const { r, g, b } = color.rgba; + const opaque = new Color(new RGBA(r, g, b, 1)); + const transparent = new Color(new RGBA(r, g, b, 0)); + + this.overlay.style.background = `linear-gradient(to bottom, ${opaque} 0%, ${transparent} 100%)`; + } + + protected getValue(color: Color): number { + return color.hsva.a; + } +} + +export class HueStrip extends Strip { + + constructor(container: HTMLElement, model: ColorPickerModel, showingStandaloneColorPicker: boolean = false) { + super(container, model, showingStandaloneColorPicker); + this.domNode.classList.add('hue-strip'); + } + + protected getValue(color: Color): number { + return 1 - (color.hsva.h / 360); + } +} diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts deleted file mode 100644 index 7688defca5f..00000000000 --- a/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts +++ /dev/null @@ -1,494 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { PixelRatio } from 'vs/base/browser/pixelRatio'; -import * as dom from 'vs/base/browser/dom'; -import { GlobalPointerMoveMonitor } from 'vs/base/browser/globalPointerMoveMonitor'; -import { Widget } from 'vs/base/browser/ui/widget'; -import { Codicon } from 'vs/base/common/codicons'; -import { Color, HSVA, RGBA } from 'vs/base/common/color'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ThemeIcon } from 'vs/base/common/themables'; -import 'vs/css!./colorPicker'; -import { ColorPickerModel } from 'vs/editor/contrib/colorPicker/browser/colorPickerModel'; -import { IEditorHoverColorPickerWidget } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { localize } from 'vs/nls'; -import { editorHoverBackground } from 'vs/platform/theme/common/colorRegistry'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; - -const $ = dom.$; - -export class ColorPickerHeader extends Disposable { - - private readonly _domNode: HTMLElement; - private readonly _pickedColorNode: HTMLElement; - private readonly _pickedColorPresentation: HTMLElement; - private readonly _originalColorNode: HTMLElement; - private readonly _closeButton: CloseButton | null = null; - private backgroundColor: Color; - - constructor(container: HTMLElement, private readonly model: ColorPickerModel, themeService: IThemeService, private showingStandaloneColorPicker: boolean = false) { - super(); - - this._domNode = $('.colorpicker-header'); - dom.append(container, this._domNode); - - this._pickedColorNode = dom.append(this._domNode, $('.picked-color')); - dom.append(this._pickedColorNode, $('span.codicon.codicon-color-mode')); - this._pickedColorPresentation = dom.append(this._pickedColorNode, document.createElement('span')); - this._pickedColorPresentation.classList.add('picked-color-presentation'); - - const tooltip = localize('clickToToggleColorOptions', "Click to toggle color options (rgb/hsl/hex)"); - this._pickedColorNode.setAttribute('title', tooltip); - - this._originalColorNode = dom.append(this._domNode, $('.original-color')); - this._originalColorNode.style.backgroundColor = Color.Format.CSS.format(this.model.originalColor) || ''; - - this.backgroundColor = themeService.getColorTheme().getColor(editorHoverBackground) || Color.white; - this._register(themeService.onDidColorThemeChange(theme => { - this.backgroundColor = theme.getColor(editorHoverBackground) || Color.white; - })); - - this._register(dom.addDisposableListener(this._pickedColorNode, dom.EventType.CLICK, () => this.model.selectNextColorPresentation())); - this._register(dom.addDisposableListener(this._originalColorNode, dom.EventType.CLICK, () => { - this.model.color = this.model.originalColor; - this.model.flushColor(); - })); - this._register(model.onDidChangeColor(this.onDidChangeColor, this)); - this._register(model.onDidChangePresentation(this.onDidChangePresentation, this)); - this._pickedColorNode.style.backgroundColor = Color.Format.CSS.format(model.color) || ''; - this._pickedColorNode.classList.toggle('light', model.color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : model.color.isLighter()); - - this.onDidChangeColor(this.model.color); - - // When the color picker widget is a standalone color picker widget, then add a close button - if (this.showingStandaloneColorPicker) { - this._domNode.classList.add('standalone-colorpicker'); - this._closeButton = this._register(new CloseButton(this._domNode)); - } - } - - public get domNode(): HTMLElement { - return this._domNode; - } - - public get closeButton(): CloseButton | null { - return this._closeButton; - } - - public get pickedColorNode(): HTMLElement { - return this._pickedColorNode; - } - - public get originalColorNode(): HTMLElement { - return this._originalColorNode; - } - - private onDidChangeColor(color: Color): void { - this._pickedColorNode.style.backgroundColor = Color.Format.CSS.format(color) || ''; - this._pickedColorNode.classList.toggle('light', color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : color.isLighter()); - this.onDidChangePresentation(); - } - - private onDidChangePresentation(): void { - this._pickedColorPresentation.textContent = this.model.presentation ? this.model.presentation.label : ''; - } -} - -class CloseButton extends Disposable { - - private _button: HTMLElement; - private readonly _onClicked = this._register(new Emitter()); - public readonly onClicked = this._onClicked.event; - - constructor(container: HTMLElement) { - super(); - this._button = document.createElement('div'); - this._button.classList.add('close-button'); - dom.append(container, this._button); - - const innerDiv = document.createElement('div'); - innerDiv.classList.add('close-button-inner-div'); - dom.append(this._button, innerDiv); - - const closeButton = dom.append(innerDiv, $('.button' + ThemeIcon.asCSSSelector(registerIcon('color-picker-close', Codicon.close, localize('closeIcon', 'Icon to close the color picker'))))); - closeButton.classList.add('close-icon'); - this._register(dom.addDisposableListener(this._button, dom.EventType.CLICK, () => { - this._onClicked.fire(); - })); - } -} - -export class ColorPickerBody extends Disposable { - - private readonly _domNode: HTMLElement; - private readonly _saturationBox: SaturationBox; - private readonly _hueStrip: Strip; - private readonly _opacityStrip: Strip; - private readonly _insertButton: InsertButton | null = null; - - constructor(container: HTMLElement, private readonly model: ColorPickerModel, private pixelRatio: number, isStandaloneColorPicker: boolean = false) { - super(); - - this._domNode = $('.colorpicker-body'); - dom.append(container, this._domNode); - - this._saturationBox = new SaturationBox(this._domNode, this.model, this.pixelRatio); - this._register(this._saturationBox); - this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange, this)); - this._register(this._saturationBox.onColorFlushed(this.flushColor, this)); - - this._opacityStrip = new OpacityStrip(this._domNode, this.model, isStandaloneColorPicker); - this._register(this._opacityStrip); - this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange, this)); - this._register(this._opacityStrip.onColorFlushed(this.flushColor, this)); - - this._hueStrip = new HueStrip(this._domNode, this.model, isStandaloneColorPicker); - this._register(this._hueStrip); - this._register(this._hueStrip.onDidChange(this.onDidHueChange, this)); - this._register(this._hueStrip.onColorFlushed(this.flushColor, this)); - - if (isStandaloneColorPicker) { - this._insertButton = this._register(new InsertButton(this._domNode)); - this._domNode.classList.add('standalone-colorpicker'); - } - } - - private flushColor(): void { - this.model.flushColor(); - } - - private onDidSaturationValueChange({ s, v }: { s: number; v: number }): void { - const hsva = this.model.color.hsva; - this.model.color = new Color(new HSVA(hsva.h, s, v, hsva.a)); - } - - private onDidOpacityChange(a: number): void { - const hsva = this.model.color.hsva; - this.model.color = new Color(new HSVA(hsva.h, hsva.s, hsva.v, a)); - } - - private onDidHueChange(value: number): void { - const hsva = this.model.color.hsva; - const h = (1 - value) * 360; - - this.model.color = new Color(new HSVA(h === 360 ? 0 : h, hsva.s, hsva.v, hsva.a)); - } - - get domNode() { - return this._domNode; - } - - get saturationBox() { - return this._saturationBox; - } - - get opacityStrip() { - return this._opacityStrip; - } - - get hueStrip() { - return this._hueStrip; - } - - get enterButton() { - return this._insertButton; - } - - layout(): void { - this._saturationBox.layout(); - this._opacityStrip.layout(); - this._hueStrip.layout(); - } -} - -class SaturationBox extends Disposable { - - private readonly _domNode: HTMLElement; - private readonly selection: HTMLElement; - private readonly _canvas: HTMLCanvasElement; - private width!: number; - private height!: number; - - private monitor: GlobalPointerMoveMonitor | null; - private readonly _onDidChange = new Emitter<{ s: number; v: number }>(); - readonly onDidChange: Event<{ s: number; v: number }> = this._onDidChange.event; - - private readonly _onColorFlushed = new Emitter(); - readonly onColorFlushed: Event = this._onColorFlushed.event; - - constructor(container: HTMLElement, private readonly model: ColorPickerModel, private pixelRatio: number) { - super(); - - this._domNode = $('.saturation-wrap'); - dom.append(container, this._domNode); - - // Create canvas, draw selected color - this._canvas = document.createElement('canvas'); - this._canvas.className = 'saturation-box'; - dom.append(this._domNode, this._canvas); - - // Add selection circle - this.selection = $('.saturation-selection'); - dom.append(this._domNode, this.selection); - - this.layout(); - - this._register(dom.addDisposableListener(this._domNode, dom.EventType.POINTER_DOWN, e => this.onPointerDown(e))); - this._register(this.model.onDidChangeColor(this.onDidChangeColor, this)); - this.monitor = null; - } - - public get domNode() { - return this._domNode; - } - - public get canvas() { - return this._canvas; - } - - private onPointerDown(e: PointerEvent): void { - if (!e.target || !(e.target instanceof Element)) { - return; - } - this.monitor = this._register(new GlobalPointerMoveMonitor()); - const origin = dom.getDomNodePagePosition(this._domNode); - - if (e.target !== this.selection) { - this.onDidChangePosition(e.offsetX, e.offsetY); - } - - this.monitor.startMonitoring(e.target, e.pointerId, e.buttons, event => this.onDidChangePosition(event.pageX - origin.left, event.pageY - origin.top), () => null); - - const pointerUpListener = dom.addDisposableListener(e.target.ownerDocument, dom.EventType.POINTER_UP, () => { - this._onColorFlushed.fire(); - pointerUpListener.dispose(); - if (this.monitor) { - this.monitor.stopMonitoring(true); - this.monitor = null; - } - }, true); - } - - private onDidChangePosition(left: number, top: number): void { - const s = Math.max(0, Math.min(1, left / this.width)); - const v = Math.max(0, Math.min(1, 1 - (top / this.height))); - - this.paintSelection(s, v); - this._onDidChange.fire({ s, v }); - } - - layout(): void { - this.width = this._domNode.offsetWidth; - this.height = this._domNode.offsetHeight; - this._canvas.width = this.width * this.pixelRatio; - this._canvas.height = this.height * this.pixelRatio; - this.paint(); - - const hsva = this.model.color.hsva; - this.paintSelection(hsva.s, hsva.v); - } - - private paint(): void { - const hsva = this.model.color.hsva; - const saturatedColor = new Color(new HSVA(hsva.h, 1, 1, 1)); - const ctx = this._canvas.getContext('2d')!; - - const whiteGradient = ctx.createLinearGradient(0, 0, this._canvas.width, 0); - whiteGradient.addColorStop(0, 'rgba(255, 255, 255, 1)'); - whiteGradient.addColorStop(0.5, 'rgba(255, 255, 255, 0.5)'); - whiteGradient.addColorStop(1, 'rgba(255, 255, 255, 0)'); - - const blackGradient = ctx.createLinearGradient(0, 0, 0, this._canvas.height); - blackGradient.addColorStop(0, 'rgba(0, 0, 0, 0)'); - blackGradient.addColorStop(1, 'rgba(0, 0, 0, 1)'); - - ctx.rect(0, 0, this._canvas.width, this._canvas.height); - ctx.fillStyle = Color.Format.CSS.format(saturatedColor)!; - ctx.fill(); - ctx.fillStyle = whiteGradient; - ctx.fill(); - ctx.fillStyle = blackGradient; - ctx.fill(); - } - - private paintSelection(s: number, v: number): void { - this.selection.style.left = `${s * this.width}px`; - this.selection.style.top = `${this.height - v * this.height}px`; - } - - private onDidChangeColor(color: Color): void { - if (this.monitor && this.monitor.isMonitoring()) { - return; - } - this.paint(); - const hsva = color.hsva; - this.paintSelection(hsva.s, hsva.v); - } -} - -abstract class Strip extends Disposable { - - protected domNode: HTMLElement; - protected overlay: HTMLElement; - protected slider: HTMLElement; - private height!: number; - - private readonly _onDidChange = new Emitter(); - readonly onDidChange: Event = this._onDidChange.event; - - private readonly _onColorFlushed = new Emitter(); - readonly onColorFlushed: Event = this._onColorFlushed.event; - - constructor(container: HTMLElement, protected model: ColorPickerModel, showingStandaloneColorPicker: boolean = false) { - super(); - if (showingStandaloneColorPicker) { - this.domNode = dom.append(container, $('.standalone-strip')); - this.overlay = dom.append(this.domNode, $('.standalone-overlay')); - } else { - this.domNode = dom.append(container, $('.strip')); - this.overlay = dom.append(this.domNode, $('.overlay')); - } - this.slider = dom.append(this.domNode, $('.slider')); - this.slider.style.top = `0px`; - - this._register(dom.addDisposableListener(this.domNode, dom.EventType.POINTER_DOWN, e => this.onPointerDown(e))); - this._register(model.onDidChangeColor(this.onDidChangeColor, this)); - this.layout(); - } - - layout(): void { - this.height = this.domNode.offsetHeight - this.slider.offsetHeight; - - const value = this.getValue(this.model.color); - this.updateSliderPosition(value); - } - - protected onDidChangeColor(color: Color) { - const value = this.getValue(color); - this.updateSliderPosition(value); - } - - private onPointerDown(e: PointerEvent): void { - if (!e.target || !(e.target instanceof Element)) { - return; - } - const monitor = this._register(new GlobalPointerMoveMonitor()); - const origin = dom.getDomNodePagePosition(this.domNode); - this.domNode.classList.add('grabbing'); - - if (e.target !== this.slider) { - this.onDidChangeTop(e.offsetY); - } - - monitor.startMonitoring(e.target, e.pointerId, e.buttons, event => this.onDidChangeTop(event.pageY - origin.top), () => null); - - const pointerUpListener = dom.addDisposableListener(e.target.ownerDocument, dom.EventType.POINTER_UP, () => { - this._onColorFlushed.fire(); - pointerUpListener.dispose(); - monitor.stopMonitoring(true); - this.domNode.classList.remove('grabbing'); - }, true); - } - - private onDidChangeTop(top: number): void { - const value = Math.max(0, Math.min(1, 1 - (top / this.height))); - - this.updateSliderPosition(value); - this._onDidChange.fire(value); - } - - private updateSliderPosition(value: number): void { - this.slider.style.top = `${(1 - value) * this.height}px`; - } - - protected abstract getValue(color: Color): number; -} - -class OpacityStrip extends Strip { - - constructor(container: HTMLElement, model: ColorPickerModel, showingStandaloneColorPicker: boolean = false) { - super(container, model, showingStandaloneColorPicker); - this.domNode.classList.add('opacity-strip'); - - this.onDidChangeColor(this.model.color); - } - - protected override onDidChangeColor(color: Color): void { - super.onDidChangeColor(color); - const { r, g, b } = color.rgba; - const opaque = new Color(new RGBA(r, g, b, 1)); - const transparent = new Color(new RGBA(r, g, b, 0)); - - this.overlay.style.background = `linear-gradient(to bottom, ${opaque} 0%, ${transparent} 100%)`; - } - - protected getValue(color: Color): number { - return color.hsva.a; - } -} - -class HueStrip extends Strip { - - constructor(container: HTMLElement, model: ColorPickerModel, showingStandaloneColorPicker: boolean = false) { - super(container, model, showingStandaloneColorPicker); - this.domNode.classList.add('hue-strip'); - } - - protected getValue(color: Color): number { - return 1 - (color.hsva.h / 360); - } -} - -export class InsertButton extends Disposable { - - private _button: HTMLElement; - private readonly _onClicked = this._register(new Emitter()); - public readonly onClicked = this._onClicked.event; - - constructor(container: HTMLElement) { - super(); - this._button = dom.append(container, document.createElement('button')); - this._button.classList.add('insert-button'); - this._button.textContent = 'Insert'; - this._register(dom.addDisposableListener(this._button, dom.EventType.CLICK, () => { - this._onClicked.fire(); - })); - } - - public get button(): HTMLElement { - return this._button; - } -} - -export class ColorPickerWidget extends Widget implements IEditorHoverColorPickerWidget { - - private static readonly ID = 'editor.contrib.colorPickerWidget'; - - body: ColorPickerBody; - header: ColorPickerHeader; - - constructor(container: Node, readonly model: ColorPickerModel, private pixelRatio: number, themeService: IThemeService, standaloneColorPicker: boolean = false) { - super(); - - this._register(PixelRatio.getInstance(dom.getWindow(container)).onDidChange(() => this.layout())); - - const element = $('.colorpicker-widget'); - container.appendChild(element); - - this.header = this._register(new ColorPickerHeader(element, this.model, themeService, standaloneColorPicker)); - this.body = this._register(new ColorPickerBody(element, this.model, this.pixelRatio, standaloneColorPicker)); - } - - getId(): string { - return ColorPickerWidget.ID; - } - - layout(): void { - this.body.layout(); - } -} diff --git a/src/vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.ts b/src/vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.ts index 8bb5e3ad56a..63a231f23ea 100644 --- a/src/vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.ts +++ b/src/vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.ts @@ -3,30 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Color, RGBA } from 'vs/base/common/color'; -import { ITextModel } from 'vs/editor/common/model'; -import { DocumentColorProvider, IColor, IColorInformation, IColorPresentation } from 'vs/editor/common/languages'; -import { EditorWorkerClient } from 'vs/editor/browser/services/editorWorkerService'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { registerEditorFeature } from 'vs/editor/common/editorFeatures'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Color, RGBA } from '../../../../base/common/color.js'; +import { ITextModel } from '../../../common/model.js'; +import { DocumentColorProvider, IColor, IColorInformation, IColorPresentation } from '../../../common/languages.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { IEditorWorkerService } from '../../../common/services/editorWorker.js'; export class DefaultDocumentColorProvider implements DocumentColorProvider { - private _editorWorkerClient: EditorWorkerClient; - constructor( - modelService: IModelService, - languageConfigurationService: ILanguageConfigurationService, - ) { - this._editorWorkerClient = new EditorWorkerClient(modelService, false, 'editorWorkerService', languageConfigurationService); - } + @IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService, + ) { } async provideDocumentColors(model: ITextModel, _token: CancellationToken): Promise { - return this._editorWorkerClient.computeDefaultDocumentColors(model.uri); + return this._editorWorkerService.computeDefaultDocumentColors(model.uri); } provideColorPresentations(_model: ITextModel, colorInfo: IColorInformation, _token: CancellationToken): IColorPresentation[] { @@ -47,15 +39,13 @@ export class DefaultDocumentColorProvider implements DocumentColorProvider { } } -class DefaultDocumentColorProviderFeature extends Disposable { +export class DefaultDocumentColorProviderFeature extends Disposable { constructor( - @IModelService _modelService: IModelService, - @ILanguageConfigurationService _languageConfigurationService: ILanguageConfigurationService, @ILanguageFeaturesService _languageFeaturesService: ILanguageFeaturesService, + @IEditorWorkerService editorWorkerService: IEditorWorkerService, ) { super(); - this._register(_languageFeaturesService.colorProvider.register('*', new DefaultDocumentColorProvider(_modelService, _languageConfigurationService))); + this._register(_languageFeaturesService.colorProvider.register('*', new DefaultDocumentColorProvider(editorWorkerService))); } } -registerEditorFeature(DefaultDocumentColorProviderFeature); diff --git a/src/vs/editor/contrib/colorPicker/browser/colorContributions.ts b/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.ts similarity index 57% rename from src/vs/editor/contrib/colorPicker/browser/colorContributions.ts rename to src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.ts index e7642a17e7d..46f7660dd2e 100644 --- a/src/vs/editor/contrib/colorPicker/browser/colorContributions.ts +++ b/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.ts @@ -3,19 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { ColorDecorationInjectedTextMarker } from 'vs/editor/contrib/colorPicker/browser/colorDetector'; -import { ColorHoverParticipant } from 'vs/editor/contrib/colorPicker/browser/colorHoverParticipant'; -import { HoverController } from 'vs/editor/contrib/hover/browser/hoverController'; -import { HoverStartMode, HoverStartSource } from 'vs/editor/contrib/hover/browser/hoverOperation'; -import { HoverParticipantRegistry } from 'vs/editor/contrib/hover/browser/hoverTypes'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { Range } from '../../../../common/core/range.js'; +import { IEditorContribution } from '../../../../common/editorCommon.js'; +import { ColorDecorationInjectedTextMarker } from '../colorDetector.js'; +import { ContentHoverController } from '../../../hover/browser/contentHoverController.js'; +import { HoverStartMode, HoverStartSource } from '../../../hover/browser/hoverOperation.js'; -export class ColorContribution extends Disposable implements IEditorContribution { +export class HoverColorPickerContribution extends Disposable implements IEditorContribution { public static readonly ID: string = 'editor.contrib.colorContribution'; @@ -56,7 +53,7 @@ export class ColorContribution extends Disposable implements IEditorContribution return; } - const hoverController = this._editor.getContribution(HoverController.ID); + const hoverController = this._editor.getContribution(ContentHoverController.ID); if (!hoverController) { return; } @@ -66,6 +63,3 @@ export class ColorContribution extends Disposable implements IEditorContribution } } } - -registerEditorContribution(ColorContribution.ID, ColorContribution, EditorContributionInstantiation.BeforeFirstInteraction); -HoverParticipantRegistry.register(ColorHoverParticipant); diff --git a/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.ts b/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.ts new file mode 100644 index 00000000000..7c7d4afeb06 --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.ts @@ -0,0 +1,148 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { AsyncIterableObject } from '../../../../../base/common/async.js'; +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { Range } from '../../../../common/core/range.js'; +import { IModelDecoration } from '../../../../common/model.js'; +import { DocumentColorProvider } from '../../../../common/languages.js'; +import { ColorDetector } from '../colorDetector.js'; +import { ColorPickerModel } from '../colorPickerModel.js'; +import { ColorPickerWidget } from './hoverColorPickerWidget.js'; +import { HoverAnchor, HoverAnchorType, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverPart, IRenderedHoverParts, RenderedHoverParts } from '../../../hover/browser/hoverTypes.js'; +import { IThemeService } from '../../../../../platform/theme/common/themeService.js'; +import * as nls from '../../../../../nls.js'; +import { BaseColor, createColorHover, updateColorPresentations, updateEditorModel } from '../colorPickerParticipantUtils.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { Dimension } from '../../../../../base/browser/dom.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { Color } from '../../../../../base/common/color.js'; + +export class ColorHover implements IHoverPart, BaseColor { + + /** + * Force the hover to always be rendered at this specific range, + * even in the case of multiple hover parts. + */ + public readonly forceShowAtRange: boolean = true; + + constructor( + public readonly owner: IEditorHoverParticipant, + public readonly range: Range, + public readonly model: ColorPickerModel, + public readonly provider: DocumentColorProvider + ) { } + + public isValidForHoverAnchor(anchor: HoverAnchor): boolean { + return ( + anchor.type === HoverAnchorType.Range + && this.range.startColumn <= anchor.range.startColumn + && this.range.endColumn >= anchor.range.endColumn + ); + } + + public static fromBaseColor(owner: IEditorHoverParticipant, color: BaseColor): ColorHover { + return new ColorHover(owner, color.range, color.model, color.provider); + } +} + +export class HoverColorPickerParticipant implements IEditorHoverParticipant { + + public readonly hoverOrdinal: number = 2; + + private _colorPicker: ColorPickerWidget | undefined; + + constructor( + private readonly _editor: ICodeEditor, + @IThemeService private readonly _themeService: IThemeService, + ) { } + + public computeSync(_anchor: HoverAnchor, _lineDecorations: IModelDecoration[]): ColorHover[] { + return []; + } + + public computeAsync(anchor: HoverAnchor, lineDecorations: IModelDecoration[], token: CancellationToken): AsyncIterableObject { + return AsyncIterableObject.fromPromise(this._computeAsync(anchor, lineDecorations, token)); + } + + private async _computeAsync(_anchor: HoverAnchor, lineDecorations: IModelDecoration[], _token: CancellationToken): Promise { + if (!this._editor.hasModel()) { + return []; + } + const colorDetector = ColorDetector.get(this._editor); + if (!colorDetector) { + return []; + } + for (const d of lineDecorations) { + if (!colorDetector.isColorDecoration(d)) { + continue; + } + + const colorData = colorDetector.getColorData(d.range.getStartPosition()); + if (colorData) { + const colorHover = ColorHover.fromBaseColor(this, await createColorHover(this._editor.getModel(), colorData.colorInfo, colorData.provider)); + return [colorHover]; + } + + } + return []; + } + + public renderHoverParts(context: IEditorHoverRenderContext, hoverParts: ColorHover[]): IRenderedHoverParts { + const editor = this._editor; + if (hoverParts.length === 0 || !editor.hasModel()) { + return new RenderedHoverParts([]); + } + if (context.setMinimumDimensions) { + const minimumHeight = editor.getOption(EditorOption.lineHeight) + 8; + context.setMinimumDimensions(new Dimension(302, minimumHeight)); + } + + const disposables = new DisposableStore(); + const colorHover = hoverParts[0]; + const editorModel = editor.getModel(); + const model = colorHover.model; + this._colorPicker = disposables.add(new ColorPickerWidget(context.fragment, model, editor.getOption(EditorOption.pixelRatio), this._themeService, false)); + + let editorUpdatedByColorPicker = false; + let range = new Range(colorHover.range.startLineNumber, colorHover.range.startColumn, colorHover.range.endLineNumber, colorHover.range.endColumn); + + disposables.add(model.onColorFlushed(async (color: Color) => { + await updateColorPresentations(editorModel, model, color, range, colorHover); + editorUpdatedByColorPicker = true; + range = updateEditorModel(editor, range, model); + })); + disposables.add(model.onDidChangeColor((color: Color) => { + updateColorPresentations(editorModel, model, color, range, colorHover); + })); + disposables.add(editor.onDidChangeModelContent((e) => { + if (editorUpdatedByColorPicker) { + editorUpdatedByColorPicker = false; + } else { + context.hide(); + editor.focus(); + } + })); + const renderedHoverPart: IRenderedHoverPart = { + hoverPart: ColorHover.fromBaseColor(this, colorHover), + hoverElement: this._colorPicker.domNode, + dispose() { disposables.dispose(); } + }; + return new RenderedHoverParts([renderedHoverPart]); + } + + public getAccessibleContent(hoverPart: ColorHover): string { + return nls.localize('hoverAccessibilityColorParticipant', 'There is a color picker here.'); + } + + public handleResize(): void { + this._colorPicker?.layout(); + } + + public isColorPickerVisible(): boolean { + return !!this._colorPicker; + } +} diff --git a/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerWidget.ts b/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerWidget.ts new file mode 100644 index 00000000000..9ba946953f9 --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerWidget.ts @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import '../colorPicker.css'; +import { PixelRatio } from '../../../../../base/browser/pixelRatio.js'; +import * as dom from '../../../../../base/browser/dom.js'; +import { Widget } from '../../../../../base/browser/ui/widget.js'; +import { ColorPickerModel } from '../colorPickerModel.js'; +import { IEditorHoverColorPickerWidget } from '../../../hover/browser/hoverTypes.js'; +import { IThemeService } from '../../../../../platform/theme/common/themeService.js'; +import { ColorPickerBody } from '../colorPickerParts/colorPickerBody.js'; +import { ColorPickerHeader } from '../colorPickerParts/colorPickerHeader.js'; + +const $ = dom.$; + +export class ColorPickerWidget extends Widget implements IEditorHoverColorPickerWidget { + + private static readonly ID = 'editor.contrib.colorPickerWidget'; + private readonly _domNode: HTMLElement; + + body: ColorPickerBody; + header: ColorPickerHeader; + + constructor(container: Node, readonly model: ColorPickerModel, private pixelRatio: number, themeService: IThemeService, standaloneColorPicker: boolean = false) { + super(); + + this._register(PixelRatio.getInstance(dom.getWindow(container)).onDidChange(() => this.layout())); + + this._domNode = $('.colorpicker-widget'); + container.appendChild(this._domNode); + + this.header = this._register(new ColorPickerHeader(this._domNode, this.model, themeService, standaloneColorPicker)); + this.body = this._register(new ColorPickerBody(this._domNode, this.model, this.pixelRatio, standaloneColorPicker)); + } + + getId(): string { + return ColorPickerWidget.ID; + } + + layout(): void { + this.body.layout(); + } + + get domNode(): HTMLElement { + return this._domNode; + } +} diff --git a/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions.ts b/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.ts similarity index 74% rename from src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions.ts rename to src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.ts index 9d531552008..6ac80b945f6 100644 --- a/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions.ts +++ b/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.ts @@ -3,15 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorAction2, ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { localize, localize2 } from 'vs/nls'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { StandaloneColorPickerController } from 'vs/editor/contrib/colorPicker/browser/standaloneColorPickerWidget'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { MenuId, registerAction2 } from 'vs/platform/actions/common/actions'; -import 'vs/css!./colorPicker'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { EditorAction, EditorAction2, ServicesAccessor } from '../../../../browser/editorExtensions.js'; +import { KeyCode } from '../../../../../base/common/keyCodes.js'; +import { localize, localize2 } from '../../../../../nls.js'; +import { KeybindingWeight } from '../../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { EditorContextKeys } from '../../../../common/editorContextKeys.js'; +import { MenuId } from '../../../../../platform/actions/common/actions.js'; +import { StandaloneColorPickerController } from './standaloneColorPickerController.js'; export class ShowOrFocusStandaloneColorPicker extends EditorAction2 { constructor() { @@ -35,7 +34,7 @@ export class ShowOrFocusStandaloneColorPicker extends EditorAction2 { } } -class HideStandaloneColorPicker extends EditorAction { +export class HideStandaloneColorPicker extends EditorAction { constructor() { super({ id: 'editor.action.hideColorPicker', @@ -61,7 +60,7 @@ class HideStandaloneColorPicker extends EditorAction { } } -class InsertColorWithStandaloneColorPicker extends EditorAction { +export class InsertColorWithStandaloneColorPicker extends EditorAction { constructor() { super({ id: 'editor.action.insertColorWithStandaloneColorPicker', @@ -86,7 +85,3 @@ class InsertColorWithStandaloneColorPicker extends EditorAction { StandaloneColorPickerController.get(editor)?.insertColor(); } } - -registerEditorAction(HideStandaloneColorPicker); -registerEditorAction(InsertColorWithStandaloneColorPicker); -registerAction2(ShowOrFocusStandaloneColorPicker); diff --git a/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerController.ts b/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerController.ts new file mode 100644 index 00000000000..8cbeedd4dac --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerController.ts @@ -0,0 +1,63 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IContextKey, IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { IEditorContribution } from '../../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../../common/editorContextKeys.js'; +import { StandaloneColorPickerWidget } from './standaloneColorPickerWidget.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; + +export class StandaloneColorPickerController extends Disposable implements IEditorContribution { + + public static ID = 'editor.contrib.standaloneColorPickerController'; + private _standaloneColorPickerWidget: StandaloneColorPickerWidget | null = null; + private _standaloneColorPickerVisible: IContextKey; + private _standaloneColorPickerFocused: IContextKey; + + constructor( + private readonly _editor: ICodeEditor, + @IContextKeyService _contextKeyService: IContextKeyService, + @IInstantiationService private readonly _instantiationService: IInstantiationService, + ) { + super(); + this._standaloneColorPickerVisible = EditorContextKeys.standaloneColorPickerVisible.bindTo(_contextKeyService); + this._standaloneColorPickerFocused = EditorContextKeys.standaloneColorPickerFocused.bindTo(_contextKeyService); + } + + public showOrFocus() { + if (!this._editor.hasModel()) { + return; + } + if (!this._standaloneColorPickerVisible.get()) { + this._standaloneColorPickerWidget = this._instantiationService.createInstance( + StandaloneColorPickerWidget, + this._editor, + this._standaloneColorPickerVisible, + this._standaloneColorPickerFocused + ); + } else if (!this._standaloneColorPickerFocused.get()) { + this._standaloneColorPickerWidget?.focus(); + } + } + + public hide() { + this._standaloneColorPickerFocused.set(false); + this._standaloneColorPickerVisible.set(false); + this._standaloneColorPickerWidget?.hide(); + this._editor.focus(); + } + + public insertColor() { + this._standaloneColorPickerWidget?.updateEditor(); + this.hide(); + } + + public static get(editor: ICodeEditor) { + return editor.getContribution(StandaloneColorPickerController.ID); + } +} + diff --git a/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.ts b/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.ts new file mode 100644 index 00000000000..bbd3f287a2e --- /dev/null +++ b/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.ts @@ -0,0 +1,119 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { Color } from '../../../../../base/common/color.js'; +import { DisposableStore, IDisposable } from '../../../../../base/common/lifecycle.js'; +import { IThemeService } from '../../../../../platform/theme/common/themeService.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { LanguageFeatureRegistry } from '../../../../common/languageFeatureRegistry.js'; +import { DocumentColorProvider, IColorInformation } from '../../../../common/languages.js'; +import { IEditorHoverRenderContext } from '../../../hover/browser/hoverTypes.js'; +import { getColors } from '../color.js'; +import { ColorDetector } from '../colorDetector.js'; +import { ColorPickerModel } from '../colorPickerModel.js'; +import { BaseColor, createColorHover, updateColorPresentations, updateEditorModel } from '../colorPickerParticipantUtils.js'; +import { ColorPickerWidget } from '../hoverColorPicker/hoverColorPickerWidget.js'; +import { Range } from '../../../../common/core/range.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { Dimension } from '../../../../../base/browser/dom.js'; + +export class StandaloneColorPickerHover implements BaseColor { + constructor( + public readonly owner: StandaloneColorPickerParticipant, + public readonly range: Range, + public readonly model: ColorPickerModel, + public readonly provider: DocumentColorProvider + ) { } + + public static fromBaseColor(owner: StandaloneColorPickerParticipant, color: BaseColor) { + return new StandaloneColorPickerHover(owner, color.range, color.model, color.provider); + } +} + +export class StandaloneColorPickerParticipant { + + public readonly hoverOrdinal: number = 2; + private _color: Color | null = null; + + constructor( + private readonly _editor: ICodeEditor, + @IThemeService private readonly _themeService: IThemeService, + ) { } + + public async createColorHover(defaultColorInfo: IColorInformation, defaultColorProvider: DocumentColorProvider, colorProviderRegistry: LanguageFeatureRegistry): Promise<{ colorHover: StandaloneColorPickerHover; foundInEditor: boolean } | null> { + if (!this._editor.hasModel()) { + return null; + } + const colorDetector = ColorDetector.get(this._editor); + if (!colorDetector) { + return null; + } + const colors = await getColors(colorProviderRegistry, this._editor.getModel(), CancellationToken.None); + let foundColorInfo: IColorInformation | null = null; + let foundColorProvider: DocumentColorProvider | null = null; + for (const colorData of colors) { + const colorInfo = colorData.colorInfo; + if (Range.containsRange(colorInfo.range, defaultColorInfo.range)) { + foundColorInfo = colorInfo; + foundColorProvider = colorData.provider; + } + } + const colorInfo = foundColorInfo ?? defaultColorInfo; + const colorProvider = foundColorProvider ?? defaultColorProvider; + const foundInEditor = !!foundColorInfo; + const colorHover = StandaloneColorPickerHover.fromBaseColor(this, await createColorHover(this._editor.getModel(), colorInfo, colorProvider)); + return { colorHover, foundInEditor }; + } + + public async updateEditorModel(colorHoverData: StandaloneColorPickerHover): Promise { + if (!this._editor.hasModel()) { + return; + } + const colorPickerModel = colorHoverData.model; + let range = new Range(colorHoverData.range.startLineNumber, colorHoverData.range.startColumn, colorHoverData.range.endLineNumber, colorHoverData.range.endColumn); + if (this._color) { + await updateColorPresentations(this._editor.getModel(), colorPickerModel, this._color, range, colorHoverData); + range = updateEditorModel(this._editor, range, colorPickerModel); + } + } + + public renderHoverParts(context: IEditorHoverRenderContext, hoverParts: StandaloneColorPickerHover[]): { disposables: IDisposable; hoverPart: StandaloneColorPickerHover; colorPicker: ColorPickerWidget } | undefined { + if (hoverParts.length === 0 || !this._editor.hasModel()) { + return undefined; + } + if (context.setMinimumDimensions) { + const minimumHeight = this._editor.getOption(EditorOption.lineHeight) + 8; + context.setMinimumDimensions(new Dimension(302, minimumHeight)); + } + + const disposables = new DisposableStore(); + const colorHover = hoverParts[0]; + const editorModel = this._editor.getModel(); + const model = colorHover.model; + const colorPicker = disposables.add(new ColorPickerWidget(context.fragment, model, this._editor.getOption(EditorOption.pixelRatio), this._themeService, true)); + + let editorUpdatedByColorPicker = false; + const range = new Range(colorHover.range.startLineNumber, colorHover.range.startColumn, colorHover.range.endLineNumber, colorHover.range.endColumn); + const color = colorHover.model.color; + this._color = color; + updateColorPresentations(editorModel, model, color, range, colorHover); + disposables.add(model.onColorFlushed((color: Color) => { + this._color = color; + })); + disposables.add(model.onDidChangeColor((color: Color) => { + updateColorPresentations(editorModel, model, color, range, colorHover); + })); + disposables.add(this._editor.onDidChangeModelContent((e) => { + if (editorUpdatedByColorPicker) { + editorUpdatedByColorPicker = false; + } else { + context.hide(); + this._editor.focus(); + } + })); + return { hoverPart: colorHover, colorPicker, disposables }; + } +} diff --git a/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerWidget.ts b/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerWidget.ts similarity index 61% rename from src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerWidget.ts rename to src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerWidget.ts index 7f9cad0d757..1a007476876 100644 --- a/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerWidget.ts +++ b/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerWidget.ts @@ -3,82 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { IEditorHoverRenderContext } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { PositionAffinity } from 'vs/editor/common/model'; -import { Position } from 'vs/editor/common/core/position'; -import { StandaloneColorPickerHover, StandaloneColorPickerParticipant } from 'vs/editor/contrib/colorPicker/browser/colorHoverParticipant'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { EditorHoverStatusBar } from 'vs/editor/contrib/hover/browser/contentHoverStatusBar'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { InsertButton } from 'vs/editor/contrib/colorPicker/browser/colorPickerWidget'; -import { Emitter } from 'vs/base/common/event'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IColorInformation } from 'vs/editor/common/languages'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IRange } from 'vs/editor/common/core/range'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { DefaultDocumentColorProvider } from 'vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider'; -import * as dom from 'vs/base/browser/dom'; -import 'vs/css!./colorPicker'; - -export class StandaloneColorPickerController extends Disposable implements IEditorContribution { - - public static ID = 'editor.contrib.standaloneColorPickerController'; - private _standaloneColorPickerWidget: StandaloneColorPickerWidget | null = null; - private _standaloneColorPickerVisible: IContextKey; - private _standaloneColorPickerFocused: IContextKey; +import '../colorPicker.css'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { IEditorHoverRenderContext } from '../../../hover/browser/hoverTypes.js'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../../browser/editorBrowser.js'; +import { PositionAffinity } from '../../../../common/model.js'; +import { Position } from '../../../../common/core/position.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { EditorHoverStatusBar } from '../../../hover/browser/contentHoverStatusBar.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { Emitter } from '../../../../../base/common/event.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { IColorInformation } from '../../../../common/languages.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { IContextKey } from '../../../../../platform/contextkey/common/contextkey.js'; +import { IRange } from '../../../../common/core/range.js'; +import { DefaultDocumentColorProvider } from '../defaultDocumentColorProvider.js'; +import { IEditorWorkerService } from '../../../../common/services/editorWorker.js'; +import { StandaloneColorPickerHover, StandaloneColorPickerParticipant } from './standaloneColorPickerParticipant.js'; +import * as dom from '../../../../../base/browser/dom.js'; +import { InsertButton } from '../colorPickerParts/colorPickerInsertButton.js'; +class StandaloneColorPickerResult { + // The color picker result consists of: an array of color results and a boolean indicating if the color was found in the editor constructor( - private readonly _editor: ICodeEditor, - @IContextKeyService _contextKeyService: IContextKeyService, - @IModelService private readonly _modelService: IModelService, - @IKeybindingService private readonly _keybindingService: IKeybindingService, - @IInstantiationService private readonly _instantiationService: IInstantiationService, - @ILanguageFeaturesService private readonly _languageFeatureService: ILanguageFeaturesService, - @ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService - ) { - super(); - this._standaloneColorPickerVisible = EditorContextKeys.standaloneColorPickerVisible.bindTo(_contextKeyService); - this._standaloneColorPickerFocused = EditorContextKeys.standaloneColorPickerFocused.bindTo(_contextKeyService); - } - - public showOrFocus() { - if (!this._editor.hasModel()) { - return; - } - if (!this._standaloneColorPickerVisible.get()) { - this._standaloneColorPickerWidget = new StandaloneColorPickerWidget(this._editor, this._standaloneColorPickerVisible, this._standaloneColorPickerFocused, this._instantiationService, this._modelService, this._keybindingService, this._languageFeatureService, this._languageConfigurationService); - } else if (!this._standaloneColorPickerFocused.get()) { - this._standaloneColorPickerWidget?.focus(); - } - } - - public hide() { - this._standaloneColorPickerFocused.set(false); - this._standaloneColorPickerVisible.set(false); - this._standaloneColorPickerWidget?.hide(); - this._editor.focus(); - } - - public insertColor() { - this._standaloneColorPickerWidget?.updateEditor(); - this.hide(); - } - - public static get(editor: ICodeEditor) { - return editor.getContribution(StandaloneColorPickerController.ID); - } + public readonly value: StandaloneColorPickerHover, + public readonly foundInEditor: boolean + ) { } } -registerEditorContribution(StandaloneColorPickerController.ID, StandaloneColorPickerController, EditorContributionInstantiation.AfterFirstRender); - const PADDING = 8; const CLOSE_BUTTON_WIDTH = 22; @@ -102,10 +55,9 @@ export class StandaloneColorPickerWidget extends Disposable implements IContentW private readonly _standaloneColorPickerVisible: IContextKey, private readonly _standaloneColorPickerFocused: IContextKey, @IInstantiationService _instantiationService: IInstantiationService, - @IModelService private readonly _modelService: IModelService, @IKeybindingService private readonly _keybindingService: IKeybindingService, @ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService, - @ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService + @IEditorWorkerService private readonly _editorWorkerService: IEditorWorkerService, ) { super(); this._standaloneColorPickerVisible.set(true); @@ -205,7 +157,7 @@ export class StandaloneColorPickerWidget extends Disposable implements IContentW range: range, color: { red: 0, green: 0, blue: 0, alpha: 1 } }; - const colorHoverResult: { colorHover: StandaloneColorPickerHover; foundInEditor: boolean } | null = await this._standaloneColorPickerParticipant.createColorHover(colorInfo, new DefaultDocumentColorProvider(this._modelService, this._languageConfigurationService), this._languageFeaturesService.colorProvider); + const colorHoverResult: { colorHover: StandaloneColorPickerHover; foundInEditor: boolean } | null = await this._standaloneColorPickerParticipant.createColorHover(colorInfo, new DefaultDocumentColorProvider(this._editorWorkerService), this._languageFeaturesService.colorProvider); if (!colorHoverResult) { return null; } @@ -224,11 +176,12 @@ export class StandaloneColorPickerWidget extends Disposable implements IContentW }; this._colorHover = colorHover; - const { disposables, colorPicker } = this._standaloneColorPickerParticipant.renderHoverParts(context, [colorHover]); - this._register(disposables); - if (colorPicker === undefined) { + const renderedHoverPart = this._standaloneColorPickerParticipant.renderHoverParts(context, [colorHover]); + if (!renderedHoverPart) { return; } + this._register(renderedHoverPart.disposables); + const colorPicker = renderedHoverPart.colorPicker; this._body.classList.add('standalone-colorpicker-body'); this._body.style.maxHeight = Math.max(this._editor.getLayoutInfo().height / 4, 250) + 'px'; this._body.style.maxWidth = Math.max(this._editor.getLayoutInfo().width * 0.66, 500) + 'px'; @@ -264,11 +217,3 @@ export class StandaloneColorPickerWidget extends Disposable implements IContentW this._editor.layoutContentWidget(this); } } - -class StandaloneColorPickerResult { - // The color picker result consists of: an array of color results and a boolean indicating if the color was found in the editor - constructor( - public readonly value: StandaloneColorPickerHover, - public readonly foundInEditor: boolean - ) { } -} diff --git a/src/vs/editor/contrib/comment/browser/blockCommentCommand.ts b/src/vs/editor/contrib/comment/browser/blockCommentCommand.ts index fdf01f17058..79c543e14f6 100644 --- a/src/vs/editor/contrib/comment/browser/blockCommentCommand.ts +++ b/src/vs/editor/contrib/comment/browser/blockCommentCommand.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { EditOperation, ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; export class BlockCommentCommand implements ICommand { diff --git a/src/vs/editor/contrib/comment/browser/comment.ts b/src/vs/editor/contrib/comment/browser/comment.ts index 2a2a4c28360..eafaa331b00 100644 --- a/src/vs/editor/contrib/comment/browser/comment.ts +++ b/src/vs/editor/contrib/comment/browser/comment.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, IActionOptions, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { ICommand } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { BlockCommentCommand } from 'vs/editor/contrib/comment/browser/blockCommentCommand'; -import { LineCommentCommand, Type } from 'vs/editor/contrib/comment/browser/lineCommentCommand'; -import * as nls from 'vs/nls'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, IActionOptions, registerEditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { ICommand } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { BlockCommentCommand } from './blockCommentCommand.js'; +import { LineCommentCommand, Type } from './lineCommentCommand.js'; +import * as nls from '../../../../nls.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; abstract class CommentLineAction extends EditorAction { diff --git a/src/vs/editor/contrib/comment/browser/lineCommentCommand.ts b/src/vs/editor/contrib/comment/browser/lineCommentCommand.ts index a5e19fd79e1..53875399585 100644 --- a/src/vs/editor/contrib/comment/browser/lineCommentCommand.ts +++ b/src/vs/editor/contrib/comment/browser/lineCommentCommand.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import * as strings from 'vs/base/common/strings'; -import { Constants } from 'vs/base/common/uint'; -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { BlockCommentCommand } from 'vs/editor/contrib/comment/browser/blockCommentCommand'; +import { CharCode } from '../../../../base/common/charCode.js'; +import * as strings from '../../../../base/common/strings.js'; +import { Constants } from '../../../../base/common/uint.js'; +import { EditOperation, ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { BlockCommentCommand } from './blockCommentCommand.js'; export interface IInsertionPoint { ignore: boolean; diff --git a/src/vs/editor/contrib/comment/test/browser/blockCommentCommand.test.ts b/src/vs/editor/contrib/comment/test/browser/blockCommentCommand.test.ts index 1888af3a963..2b5e6eeff3d 100644 --- a/src/vs/editor/contrib/comment/test/browser/blockCommentCommand.test.ts +++ b/src/vs/editor/contrib/comment/test/browser/blockCommentCommand.test.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand } from 'vs/editor/common/editorCommon'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { BlockCommentCommand } from 'vs/editor/contrib/comment/browser/blockCommentCommand'; -import { testCommand } from 'vs/editor/test/browser/testCommand'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { ICommand } from '../../../../common/editorCommon.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { BlockCommentCommand } from '../../browser/blockCommentCommand.js'; +import { testCommand } from '../../../../test/browser/testCommand.js'; +import { ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js'; function _testCommentCommand(lines: string[], selection: Selection, commandFactory: (accessor: ServicesAccessor, selection: Selection) => ICommand, expectedLines: string[], expectedSelection: Selection): void { const languageId = 'commentMode'; diff --git a/src/vs/editor/contrib/comment/test/browser/lineCommentCommand.test.ts b/src/vs/editor/contrib/comment/test/browser/lineCommentCommand.test.ts index f40f7b1e252..e738c1d865d 100644 --- a/src/vs/editor/contrib/comment/test/browser/lineCommentCommand.test.ts +++ b/src/vs/editor/contrib/comment/test/browser/lineCommentCommand.test.ts @@ -4,20 +4,20 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand } from 'vs/editor/common/editorCommon'; -import { ColorId, MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { EncodedTokenizationResult, IState, TokenizationRegistry } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { CommentRule } from 'vs/editor/common/languages/languageConfiguration'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { NullState } from 'vs/editor/common/languages/nullTokenize'; -import { ILinePreflightData, IPreflightData, ISimpleModel, LineCommentCommand, Type } from 'vs/editor/contrib/comment/browser/lineCommentCommand'; -import { testCommand } from 'vs/editor/test/browser/testCommand'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { ICommand } from '../../../../common/editorCommon.js'; +import { ColorId, MetadataConsts } from '../../../../common/encodedTokenAttributes.js'; +import { EncodedTokenizationResult, IState, TokenizationRegistry } from '../../../../common/languages.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { CommentRule } from '../../../../common/languages/languageConfiguration.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { NullState } from '../../../../common/languages/nullTokenize.js'; +import { ILinePreflightData, IPreflightData, ISimpleModel, LineCommentCommand, Type } from '../../browser/lineCommentCommand.js'; +import { testCommand } from '../../../../test/browser/testCommand.js'; +import { TestLanguageConfigurationService } from '../../../../test/common/modes/testLanguageConfigurationService.js'; +import { IInstantiationService, ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js'; function createTestCommandHelper(commentsConfig: CommentRule, commandFactory: (accessor: ServicesAccessor, selection: Selection) => ICommand): (lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection) => void { return (lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection) => { diff --git a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts index ddfaabbf496..74a6f26192e 100644 --- a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts +++ b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts @@ -3,30 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { IMouseEvent, IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; -import { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems'; -import { IAnchor } from 'vs/base/browser/ui/contextview/contextview'; -import { IAction, Separator, SubmenuAction } from 'vs/base/common/actions'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ResolvedKeybinding } from 'vs/base/common/keybindings'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { isIOS } from 'vs/base/common/platform'; -import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ITextModel } from 'vs/editor/common/model'; -import * as nls from 'vs/nls'; -import { IMenuService, MenuId, SubmenuItemAction } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWorkspaceContextService, isStandaloneEditorWorkspace } from 'vs/platform/workspace/common/workspace'; +import * as dom from '../../../../base/browser/dom.js'; +import { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import { IMouseEvent, IMouseWheelEvent } from '../../../../base/browser/mouseEvent.js'; +import { ActionViewItem } from '../../../../base/browser/ui/actionbar/actionViewItems.js'; +import { IAnchor } from '../../../../base/browser/ui/contextview/contextview.js'; +import { IAction, Separator, SubmenuAction } from '../../../../base/common/actions.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { ResolvedKeybinding } from '../../../../base/common/keybindings.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { isIOS } from '../../../../base/common/platform.js'; +import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IEditorContribution, ScrollType } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ITextModel } from '../../../common/model.js'; +import * as nls from '../../../../nls.js'; +import { IMenuService, MenuId, SubmenuItemAction } from '../../../../platform/actions/common/actions.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IContextMenuService, IContextViewService } from '../../../../platform/contextview/browser/contextView.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IWorkspaceContextService, isStandaloneEditorWorkspace } from '../../../../platform/workspace/common/workspace.js'; export class ContextMenuController implements IEditorContribution { @@ -160,9 +160,7 @@ export class ContextMenuController implements IEditorContribution { const result: IAction[] = []; // get menu groups - const menu = this._menuService.createMenu(menuId, this._contextKeyService); - const groups = menu.getActions({ arg: model.uri }); - menu.dispose(); + const groups = this._menuService.getMenuActions(menuId, this._contextKeyService, { arg: model.uri }); // translate them into other actions for (const group of groups) { diff --git a/src/vs/editor/contrib/cursorUndo/browser/cursorUndo.ts b/src/vs/editor/contrib/cursorUndo/browser/cursorUndo.ts index bd4c56bc1b1..09146e0410f 100644 --- a/src/vs/editor/contrib/cursorUndo/browser/cursorUndo.ts +++ b/src/vs/editor/contrib/cursorUndo/browser/cursorUndo.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import * as nls from 'vs/nls'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import * as nls from '../../../../nls.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; class CursorState { readonly selections: readonly Selection[]; diff --git a/src/vs/editor/contrib/cursorUndo/test/browser/cursorUndo.test.ts b/src/vs/editor/contrib/cursorUndo/test/browser/cursorUndo.test.ts index d0e3423a47b..786fccbad25 100644 --- a/src/vs/editor/contrib/cursorUndo/test/browser/cursorUndo.test.ts +++ b/src/vs/editor/contrib/cursorUndo/test/browser/cursorUndo.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { CoreEditingCommands, CoreNavigationCommands } from 'vs/editor/browser/coreCommands'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Handler } from 'vs/editor/common/editorCommon'; -import { CursorUndo, CursorUndoRedoController } from 'vs/editor/contrib/cursorUndo/browser/cursorUndo'; -import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { CoreEditingCommands, CoreNavigationCommands } from '../../../../browser/coreCommands.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { Handler } from '../../../../common/editorCommon.js'; +import { CursorUndo, CursorUndoRedoController } from '../../browser/cursorUndo.js'; +import { withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; suite('FindController', () => { diff --git a/src/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.ts b/src/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.ts index 2a99c7ff329..0eb179dc3b0 100644 --- a/src/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.ts +++ b/src/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { reverseOrder, compareBy, numberComparator } from 'vs/base/common/arrays'; -import { observableValue, observableSignalFromEvent, autorunWithStore, IReader } from 'vs/base/common/observable'; -import { HideUnchangedRegionsFeature, IDiffEditorBreadcrumbsSource } from 'vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature'; -import { DisposableCancellationTokenSource } from 'vs/editor/browser/widget/diffEditor/utils'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { IOutlineModelService, OutlineModel } from 'vs/editor/contrib/documentSymbols/browser/outlineModel'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Event } from 'vs/base/common/event'; -import { SymbolKind } from 'vs/editor/common/languages'; +import { reverseOrder, compareBy, numberComparator } from '../../../../base/common/arrays.js'; +import { observableValue, observableSignalFromEvent, autorunWithStore, IReader } from '../../../../base/common/observable.js'; +import { HideUnchangedRegionsFeature, IDiffEditorBreadcrumbsSource } from '../../../browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js'; +import { DisposableCancellationTokenSource } from '../../../browser/widget/diffEditor/utils.js'; +import { LineRange } from '../../../common/core/lineRange.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { IOutlineModelService, OutlineModel } from '../../documentSymbols/browser/outlineModel.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { Event } from '../../../../base/common/event.js'; +import { SymbolKind } from '../../../common/languages.js'; class DiffEditorBreadcrumbsSource extends Disposable implements IDiffEditorBreadcrumbsSource { private readonly _currentModel = observableValue(this, undefined); diff --git a/src/vs/editor/contrib/dnd/browser/dnd.ts b/src/vs/editor/contrib/dnd/browser/dnd.ts index 9e355410d48..8ca7e29f781 100644 --- a/src/vs/editor/contrib/dnd/browser/dnd.ts +++ b/src/vs/editor/contrib/dnd/browser/dnd.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { IMouseEvent } from 'vs/base/browser/mouseEvent'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { isMacintosh } from 'vs/base/common/platform'; -import 'vs/css!./dnd'; -import { ICodeEditor, IEditorMouseEvent, IMouseTarget, IPartialEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IEditorContribution, IEditorDecorationsCollection, ScrollType } from 'vs/editor/common/editorCommon'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { DragAndDropCommand } from 'vs/editor/contrib/dnd/browser/dragAndDropCommand'; +import { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import { IMouseEvent } from '../../../../base/browser/mouseEvent.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { isMacintosh } from '../../../../base/common/platform.js'; +import './dnd.css'; +import { ICodeEditor, IEditorMouseEvent, IMouseTarget, IPartialEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { CodeEditorWidget } from '../../../browser/widget/codeEditor/codeEditorWidget.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { CursorChangeReason } from '../../../common/cursorEvents.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IEditorContribution, IEditorDecorationsCollection, ScrollType } from '../../../common/editorCommon.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { DragAndDropCommand } from './dragAndDropCommand.js'; function hasTriggerModifier(e: IKeyboardEvent | IMouseEvent): boolean { if (isMacintosh) { diff --git a/src/vs/editor/contrib/dnd/browser/dragAndDropCommand.ts b/src/vs/editor/contrib/dnd/browser/dragAndDropCommand.ts index 28043b18462..7dd03062c6f 100644 --- a/src/vs/editor/contrib/dnd/browser/dragAndDropCommand.ts +++ b/src/vs/editor/contrib/dnd/browser/dragAndDropCommand.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; export class DragAndDropCommand implements ICommand { diff --git a/src/vs/editor/contrib/documentSymbols/browser/documentSymbols.ts b/src/vs/editor/contrib/documentSymbols/browser/documentSymbols.ts index cda0a4df066..949af74822a 100644 --- a/src/vs/editor/contrib/documentSymbols/browser/documentSymbols.ts +++ b/src/vs/editor/contrib/documentSymbols/browser/documentSymbols.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { IOutlineModelService } from 'vs/editor/contrib/documentSymbols/browser/outlineModel'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { assertType } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ITextModelService } from '../../../common/services/resolverService.js'; +import { IOutlineModelService } from './outlineModel.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; CommandsRegistry.registerCommand('_executeDocumentSymbolProvider', async function (accessor, ...args) { const [resource] = args; diff --git a/src/vs/editor/contrib/documentSymbols/browser/outlineModel.ts b/src/vs/editor/contrib/documentSymbols/browser/outlineModel.ts index e7f72b1a2a0..dfe95eccddd 100644 --- a/src/vs/editor/contrib/documentSymbols/browser/outlineModel.ts +++ b/src/vs/editor/contrib/documentSymbols/browser/outlineModel.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { binarySearch, coalesceInPlace, equals } from 'vs/base/common/arrays'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { Iterable } from 'vs/base/common/iterator'; -import { LRUCache } from 'vs/base/common/map'; -import { commonPrefixLength } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { DocumentSymbol, DocumentSymbolProvider } from 'vs/editor/common/languages'; -import { MarkerSeverity } from 'vs/platform/markers/common/markers'; -import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IModelService } from 'vs/editor/common/services/model'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; +import { binarySearch, coalesceInPlace, equals } from '../../../../base/common/arrays.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { Iterable } from '../../../../base/common/iterator.js'; +import { LRUCache } from '../../../../base/common/map.js'; +import { commonPrefixLength } from '../../../../base/common/strings.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { ITextModel } from '../../../common/model.js'; +import { DocumentSymbol, DocumentSymbolProvider } from '../../../common/languages.js'; +import { MarkerSeverity } from '../../../../platform/markers/common/markers.js'; +import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js'; +import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { IModelService } from '../../../common/services/model.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; export abstract class TreeElement { diff --git a/src/vs/editor/contrib/documentSymbols/test/browser/outlineModel.test.ts b/src/vs/editor/contrib/documentSymbols/test/browser/outlineModel.test.ts index 185d30db3e6..a59d3a904dc 100644 --- a/src/vs/editor/contrib/documentSymbols/test/browser/outlineModel.test.ts +++ b/src/vs/editor/contrib/documentSymbols/test/browser/outlineModel.test.ts @@ -4,21 +4,21 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { Range } from 'vs/editor/common/core/range'; -import { DocumentSymbol, SymbolKind } from 'vs/editor/common/languages'; -import { LanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { IModelService } from 'vs/editor/common/services/model'; -import { createModelServices, createTextModel } from 'vs/editor/test/common/testTextModel'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { IMarker, MarkerSeverity } from 'vs/platform/markers/common/markers'; -import { OutlineElement, OutlineGroup, OutlineModel, OutlineModelService } from '../../browser/outlineModel'; -import { mock } from 'vs/base/test/common/mock'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { CancellationToken, CancellationTokenSource } from '../../../../../base/common/cancellation.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { Range } from '../../../../common/core/range.js'; +import { DocumentSymbol, SymbolKind } from '../../../../common/languages.js'; +import { LanguageFeatureDebounceService } from '../../../../common/services/languageFeatureDebounce.js'; +import { LanguageFeaturesService } from '../../../../common/services/languageFeaturesService.js'; +import { IModelService } from '../../../../common/services/model.js'; +import { createModelServices, createTextModel } from '../../../../test/common/testTextModel.js'; +import { NullLogService } from '../../../../../platform/log/common/log.js'; +import { IMarker, MarkerSeverity } from '../../../../../platform/markers/common/markers.js'; +import { OutlineElement, OutlineGroup, OutlineModel, OutlineModelService } from '../../browser/outlineModel.js'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { IEnvironmentService } from '../../../../../platform/environment/common/environment.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; suite('OutlineModel', function () { diff --git a/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.ts b/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.ts index 20ed163b4b2..f4f13d510a8 100644 --- a/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.ts +++ b/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { IJSONSchema, SchemaToType } from 'vs/base/common/jsonSchema'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorCommand, EditorContributionInstantiation, ServicesAccessor, registerEditorAction, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { registerEditorFeature } from 'vs/editor/common/editorFeatures'; -import { CopyPasteController, changePasteTypeCommandId, pasteWidgetVisibleCtx } from 'vs/editor/contrib/dropOrPasteInto/browser/copyPasteController'; -import { DefaultPasteProvidersFeature, DefaultTextPasteOrDropEditProvider } from 'vs/editor/contrib/dropOrPasteInto/browser/defaultProviders'; -import * as nls from 'vs/nls'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; +import { IJSONSchema, SchemaToType } from '../../../../base/common/jsonSchema.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorCommand, EditorContributionInstantiation, ServicesAccessor, registerEditorAction, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { registerEditorFeature } from '../../../common/editorFeatures.js'; +import { CopyPasteController, changePasteTypeCommandId, pasteWidgetVisibleCtx } from './copyPasteController.js'; +import { DefaultPasteProvidersFeature, DefaultTextPasteOrDropEditProvider } from './defaultProviders.js'; +import * as nls from '../../../../nls.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; registerEditorContribution(CopyPasteController.ID, CopyPasteController, EditorContributionInstantiation.Eager); // eager because it listens to events on the container dom node of the editor registerEditorFeature(DefaultPasteProvidersFeature); diff --git a/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts b/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts index ad79eb6a01f..f117af22d6c 100644 --- a/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts +++ b/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts @@ -3,40 +3,40 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { addDisposableListener, getActiveDocument } from 'vs/base/browser/dom'; -import { coalesce } from 'vs/base/common/arrays'; -import { CancelablePromise, createCancelablePromise, DeferredPromise, raceCancellation } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { UriList, VSDataTransfer, createStringDataTransferItem, matchesMimeType } from 'vs/base/common/dataTransfer'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { Mimes } from 'vs/base/common/mime'; -import * as platform from 'vs/base/common/platform'; -import { generateUuid } from 'vs/base/common/uuid'; -import { ClipboardEventUtils } from 'vs/editor/browser/controller/textAreaInput'; -import { toExternalVSDataTransfer, toVSDataTransfer } from 'vs/editor/browser/dnd'; -import { ICodeEditor, PastePayload } from 'vs/editor/browser/editorBrowser'; -import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Handler, IEditorContribution } from 'vs/editor/common/editorCommon'; -import { DocumentPasteContext, DocumentPasteEdit, DocumentPasteEditProvider, DocumentPasteTriggerKind } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { DefaultTextPasteOrDropEditProvider } from 'vs/editor/contrib/dropOrPasteInto/browser/defaultProviders'; -import { createCombinedWorkspaceEdit, sortEditsByYieldTo } from 'vs/editor/contrib/dropOrPasteInto/browser/edit'; -import { CodeEditorStateFlag, EditorStateCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/editorState'; -import { InlineProgressManager } from 'vs/editor/contrib/inlineProgress/browser/inlineProgress'; -import { MessageController } from 'vs/editor/contrib/message/browser/messageController'; -import { localize } from 'vs/nls'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; -import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { PostEditWidgetManager } from './postEditWidget'; -import { CancellationError, isCancellationError } from 'vs/base/common/errors'; +import { addDisposableListener, getActiveDocument } from '../../../../base/browser/dom.js'; +import { coalesce } from '../../../../base/common/arrays.js'; +import { CancelablePromise, createCancelablePromise, DeferredPromise, raceCancellation } from '../../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { UriList, VSDataTransfer, createStringDataTransferItem, matchesMimeType } from '../../../../base/common/dataTransfer.js'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { Mimes } from '../../../../base/common/mime.js'; +import * as platform from '../../../../base/common/platform.js'; +import { generateUuid } from '../../../../base/common/uuid.js'; +import { toExternalVSDataTransfer, toVSDataTransfer } from '../../../browser/dnd.js'; +import { ICodeEditor, PastePayload } from '../../../browser/editorBrowser.js'; +import { IBulkEditService } from '../../../browser/services/bulkEditService.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { Handler, IEditorContribution } from '../../../common/editorCommon.js'; +import { DocumentPasteContext, DocumentPasteEdit, DocumentPasteEditProvider, DocumentPasteTriggerKind } from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { DefaultTextPasteOrDropEditProvider } from './defaultProviders.js'; +import { createCombinedWorkspaceEdit, sortEditsByYieldTo } from './edit.js'; +import { CodeEditorStateFlag, EditorStateCancellationTokenSource } from '../../editorState/browser/editorState.js'; +import { InlineProgressManager } from '../../inlineProgress/browser/inlineProgress.js'; +import { MessageController } from '../../message/browser/messageController.js'; +import { localize } from '../../../../nls.js'; +import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js'; +import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IProgressService, ProgressLocation } from '../../../../platform/progress/common/progress.js'; +import { IQuickInputService, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js'; +import { PostEditWidgetManager } from './postEditWidget.js'; +import { CancellationError, isCancellationError } from '../../../../base/common/errors.js'; +import { ClipboardEventUtils } from '../../../browser/controller/editContext/textArea/textAreaEditContextInput.js'; export const changePasteTypeCommandId = 'editor.changePasteType'; @@ -135,8 +135,7 @@ export class CopyPasteController extends Disposable implements IEditorContributi } private isPasteAsEnabled(): boolean { - return this._editor.getOption(EditorOption.pasteAs).enabled - && !this._editor.getOption(EditorOption.readOnly); + return this._editor.getOption(EditorOption.pasteAs).enabled; } public async finishedPaste(): Promise { @@ -148,12 +147,10 @@ export class CopyPasteController extends Disposable implements IEditorContributi return; } - if (platform.isWeb) { - // Explicitly clear the web resources clipboard. - // This is needed because on web, the browser clipboard is faked out using an in-memory store. - // This means the resources clipboard is not properly updated when copying from the editor. - this._clipboardService.writeResources([]); - } + // Explicitly clear the clipboard internal state. + // This is needed because on web, the browser clipboard is faked out using an in-memory store. + // This means the resources clipboard is not properly updated when copying from the editor. + this._clipboardService.clearInternalState?.(); if (!e.clipboardData || !this.isPasteAsEnabled()) { return; @@ -248,8 +245,8 @@ export class CopyPasteController extends Disposable implements IEditorContributi } if ( - !this.isPasteAsEnabled() - && !this._pasteAsActionContext // Still enable if paste as was explicitly requested + this._editor.getOption(EditorOption.readOnly) // Never enabled if editor is readonly. + || (!this.isPasteAsEnabled() && !this._pasteAsActionContext) // Or feature disabled (but still enable if paste was explicitly requested) ) { return; } diff --git a/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.ts b/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.ts index e44d9341c9b..f3beb9c518c 100644 --- a/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.ts +++ b/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce } from 'vs/base/common/arrays'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IReadonlyVSDataTransfer, UriList } from 'vs/base/common/dataTransfer'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Mimes } from 'vs/base/common/mime'; -import { Schemas } from 'vs/base/common/network'; -import { relativePath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { IPosition } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { DocumentDropEditProvider, DocumentDropEditsSession, DocumentPasteContext, DocumentPasteEdit, DocumentPasteEditProvider, DocumentPasteEditsSession, DocumentPasteTriggerKind } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { localize } from 'vs/nls'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { coalesce } from '../../../../base/common/arrays.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { IReadonlyVSDataTransfer, UriList } from '../../../../base/common/dataTransfer.js'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { Mimes } from '../../../../base/common/mime.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { relativePath } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IPosition } from '../../../common/core/position.js'; +import { IRange } from '../../../common/core/range.js'; +import { DocumentDropEditProvider, DocumentDropEditsSession, DocumentPasteContext, DocumentPasteEdit, DocumentPasteEditProvider, DocumentPasteEditsSession, DocumentPasteTriggerKind } from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { localize } from '../../../../nls.js'; +import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js'; abstract class SimplePasteAndDropProvider implements DocumentDropEditProvider, DocumentPasteEditProvider { diff --git a/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.ts b/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.ts index 52dc73b8ce2..7af24cf81e8 100644 --- a/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.ts +++ b/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorCommand, EditorContributionInstantiation, ServicesAccessor, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { editorConfigurationBaseNode } from 'vs/editor/common/config/editorConfigurationSchema'; -import { registerEditorFeature } from 'vs/editor/common/editorFeatures'; -import { DefaultDropProvidersFeature } from 'vs/editor/contrib/dropOrPasteInto/browser/defaultProviders'; -import * as nls from 'vs/nls'; -import { Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { DropIntoEditorController, changeDropTypeCommandId, defaultProviderConfig, dropWidgetVisibleCtx } from './dropIntoEditorController'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorCommand, EditorContributionInstantiation, ServicesAccessor, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { editorConfigurationBaseNode } from '../../../common/config/editorConfigurationSchema.js'; +import { registerEditorFeature } from '../../../common/editorFeatures.js'; +import { DefaultDropProvidersFeature } from './defaultProviders.js'; +import * as nls from '../../../../nls.js'; +import { Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationRegistry } from '../../../../platform/configuration/common/configurationRegistry.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { DropIntoEditorController, changeDropTypeCommandId, defaultProviderConfig, dropWidgetVisibleCtx } from './dropIntoEditorController.js'; registerEditorContribution(DropIntoEditorController.ID, DropIntoEditorController, EditorContributionInstantiation.BeforeFirstInteraction); registerEditorFeature(DefaultDropProvidersFeature); diff --git a/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.ts b/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.ts index 082b7447881..da8ef9147c7 100644 --- a/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.ts +++ b/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.ts @@ -3,31 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce } from 'vs/base/common/arrays'; -import { CancelablePromise, createCancelablePromise, raceCancellation } from 'vs/base/common/async'; -import { VSDataTransfer, matchesMimeType } from 'vs/base/common/dataTransfer'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { toExternalVSDataTransfer } from 'vs/editor/browser/dnd'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IPosition } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { DocumentDropEdit, DocumentDropEditProvider } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { DraggedTreeItemsIdentifier } from 'vs/editor/common/services/treeViewsDnd'; -import { ITreeViewsDnDService } from 'vs/editor/common/services/treeViewsDndService'; -import { CodeEditorStateFlag, EditorStateCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/editorState'; -import { InlineProgressManager } from 'vs/editor/contrib/inlineProgress/browser/inlineProgress'; -import { localize } from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { LocalSelectionTransfer } from 'vs/platform/dnd/browser/dnd'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { sortEditsByYieldTo } from './edit'; -import { PostEditWidgetManager } from './postEditWidget'; +import { coalesce } from '../../../../base/common/arrays.js'; +import { CancelablePromise, createCancelablePromise, raceCancellation } from '../../../../base/common/async.js'; +import { VSDataTransfer, matchesMimeType } from '../../../../base/common/dataTransfer.js'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { toExternalVSDataTransfer } from '../../../browser/dnd.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IPosition } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { DocumentDropEdit, DocumentDropEditProvider } from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { DraggedTreeItemsIdentifier } from '../../../common/services/treeViewsDnd.js'; +import { ITreeViewsDnDService } from '../../../common/services/treeViewsDndService.js'; +import { CodeEditorStateFlag, EditorStateCancellationTokenSource } from '../../editorState/browser/editorState.js'; +import { InlineProgressManager } from '../../inlineProgress/browser/inlineProgress.js'; +import { localize } from '../../../../nls.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { LocalSelectionTransfer } from '../../../../platform/dnd/browser/dnd.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { sortEditsByYieldTo } from './edit.js'; +import { PostEditWidgetManager } from './postEditWidget.js'; export const defaultProviderConfig = 'editor.experimental.dropIntoEditor.defaultProvider'; diff --git a/src/vs/editor/contrib/dropOrPasteInto/browser/edit.ts b/src/vs/editor/contrib/dropOrPasteInto/browser/edit.ts index e612cfc0bfc..0b47ad3d3e5 100644 --- a/src/vs/editor/contrib/dropOrPasteInto/browser/edit.ts +++ b/src/vs/editor/contrib/dropOrPasteInto/browser/edit.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { ResourceTextEdit } from 'vs/editor/browser/services/bulkEditService'; -import { DocumentDropEdit, DocumentPasteEdit, DropYieldTo, WorkspaceEdit } from 'vs/editor/common/languages'; -import { Range } from 'vs/editor/common/core/range'; -import { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; +import { URI } from '../../../../base/common/uri.js'; +import { ResourceTextEdit } from '../../../browser/services/bulkEditService.js'; +import { DocumentDropEdit, DocumentPasteEdit, DropYieldTo, WorkspaceEdit } from '../../../common/languages.js'; +import { Range } from '../../../common/core/range.js'; +import { SnippetParser } from '../../snippet/browser/snippetParser.js'; +import { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js'; /** * Given a {@link DropOrPasteEdit} and set of ranges, creates a {@link WorkspaceEdit} that applies the insert text from diff --git a/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.ts b/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.ts index 9443f52cc05..6be92c50daa 100644 --- a/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.ts +++ b/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { Button } from 'vs/base/browser/ui/button/button'; -import { toAction } from 'vs/base/common/actions'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { isCancellationError } from 'vs/base/common/errors'; -import { Event } from 'vs/base/common/event'; -import { Disposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import 'vs/css!./postEditWidget'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { IBulkEditResult, IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; -import { Range } from 'vs/editor/common/core/range'; -import { DocumentDropEdit, DocumentPasteEdit } from 'vs/editor/common/languages'; -import { TrackedRangeStickiness } from 'vs/editor/common/model'; -import { createCombinedWorkspaceEdit } from 'vs/editor/contrib/dropOrPasteInto/browser/edit'; -import { localize } from 'vs/nls'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { INotificationService } from 'vs/platform/notification/common/notification'; +import * as dom from '../../../../base/browser/dom.js'; +import { Button } from '../../../../base/browser/ui/button/button.js'; +import { toAction } from '../../../../base/common/actions.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { toErrorMessage } from '../../../../base/common/errorMessage.js'; +import { isCancellationError } from '../../../../base/common/errors.js'; +import { Event } from '../../../../base/common/event.js'; +import { Disposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import './postEditWidget.css'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js'; +import { IBulkEditResult, IBulkEditService } from '../../../browser/services/bulkEditService.js'; +import { Range } from '../../../common/core/range.js'; +import { DocumentDropEdit, DocumentPasteEdit } from '../../../common/languages.js'; +import { TrackedRangeStickiness } from '../../../common/model.js'; +import { createCombinedWorkspaceEdit } from './edit.js'; +import { localize } from '../../../../nls.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; interface EditSet { diff --git a/src/vs/editor/contrib/dropOrPasteInto/test/browser/editSort.test.ts b/src/vs/editor/contrib/dropOrPasteInto/test/browser/editSort.test.ts index ec61f04a463..c989e4ec338 100644 --- a/src/vs/editor/contrib/dropOrPasteInto/test/browser/editSort.test.ts +++ b/src/vs/editor/contrib/dropOrPasteInto/test/browser/editSort.test.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { DocumentDropEdit } from 'vs/editor/common/languages'; -import { sortEditsByYieldTo } from 'vs/editor/contrib/dropOrPasteInto/browser/edit'; +import { HierarchicalKind } from '../../../../../base/common/hierarchicalKind.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { DocumentDropEdit } from '../../../../common/languages.js'; +import { sortEditsByYieldTo } from '../../browser/edit.js'; function createTestEdit(kind: string, args?: Partial): DocumentDropEdit { diff --git a/src/vs/editor/contrib/editorState/browser/editorState.ts b/src/vs/editor/contrib/editorState/browser/editorState.ts index 3bfadf65dae..fdb296ee7f7 100644 --- a/src/vs/editor/contrib/editorState/browser/editorState.ts +++ b/src/vs/editor/contrib/editorState/browser/editorState.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import { ICodeEditor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { Range, IRange } from 'vs/editor/common/core/range'; -import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation'; -import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { ITextModel } from 'vs/editor/common/model'; -import { EditorKeybindingCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/keybindingCancellation'; +import * as strings from '../../../../base/common/strings.js'; +import { ICodeEditor, IActiveCodeEditor } from '../../../browser/editorBrowser.js'; +import { Position } from '../../../common/core/position.js'; +import { Range, IRange } from '../../../common/core/range.js'; +import { CancellationTokenSource, CancellationToken } from '../../../../base/common/cancellation.js'; +import { IDisposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ITextModel } from '../../../common/model.js'; +import { EditorKeybindingCancellationTokenSource } from './keybindingCancellation.js'; export const enum CodeEditorStateFlag { Value = 1, diff --git a/src/vs/editor/contrib/editorState/browser/keybindingCancellation.ts b/src/vs/editor/contrib/editorState/browser/keybindingCancellation.ts index 76de62975c5..94020ce96b9 100644 --- a/src/vs/editor/contrib/editorState/browser/keybindingCancellation.ts +++ b/src/vs/editor/contrib/editorState/browser/keybindingCancellation.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode } from 'vs/base/common/keyCodes'; -import { EditorCommand, registerEditorCommand } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation'; -import { LinkedList } from 'vs/base/common/linkedList'; -import { createDecorator, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { localize } from 'vs/nls'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { EditorCommand, registerEditorCommand } from '../../../browser/editorExtensions.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { IContextKeyService, RawContextKey, IContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { CancellationTokenSource, CancellationToken } from '../../../../base/common/cancellation.js'; +import { LinkedList } from '../../../../base/common/linkedList.js'; +import { createDecorator, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { localize } from '../../../../nls.js'; const IEditorCancellationTokens = createDecorator('IEditorCancelService'); diff --git a/src/vs/editor/contrib/editorState/test/browser/editorState.test.ts b/src/vs/editor/contrib/editorState/test/browser/editorState.test.ts index 239da13d225..c72c5a7b7e6 100644 --- a/src/vs/editor/contrib/editorState/test/browser/editorState.test.ts +++ b/src/vs/editor/contrib/editorState/test/browser/editorState.test.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ITextModel } from 'vs/editor/common/model'; -import { CodeEditorStateFlag, EditorState } from 'vs/editor/contrib/editorState/browser/editorState'; +import { URI } from '../../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { Position } from '../../../../common/core/position.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { ITextModel } from '../../../../common/model.js'; +import { CodeEditorStateFlag, EditorState } from '../../browser/editorState.js'; interface IStubEditorState { model?: { uri?: URI; version?: number }; diff --git a/src/vs/editor/contrib/find/browser/findController.ts b/src/vs/editor/contrib/find/browser/findController.ts index bbcc79d0750..5033c2565d9 100644 --- a/src/vs/editor/contrib/find/browser/findController.ts +++ b/src/vs/editor/contrib/find/browser/findController.ts @@ -3,35 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Delayer } from 'vs/base/common/async'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Disposable } from 'vs/base/common/lifecycle'; -import * as strings from 'vs/base/common/strings'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorCommand, EditorContributionInstantiation, MultiEditorAction, registerEditorAction, registerEditorCommand, registerEditorContribution, registerMultiEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { overviewRulerRangeHighlight } from 'vs/editor/common/core/editorColorRegistry'; -import { IRange } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { OverviewRulerLane } from 'vs/editor/common/model'; -import { CONTEXT_FIND_INPUT_FOCUSED, CONTEXT_FIND_WIDGET_VISIBLE, CONTEXT_REPLACE_INPUT_FOCUSED, FindModelBoundToEditorModel, FIND_IDS, ToggleCaseSensitiveKeybinding, TogglePreserveCaseKeybinding, ToggleRegexKeybinding, ToggleSearchScopeKeybinding, ToggleWholeWordKeybinding } from 'vs/editor/contrib/find/browser/findModel'; -import { FindOptionsWidget } from 'vs/editor/contrib/find/browser/findOptionsWidget'; -import { FindReplaceState, FindReplaceStateChangedEvent, INewFindReplaceState } from 'vs/editor/contrib/find/browser/findState'; -import { FindWidget, IFindController } from 'vs/editor/contrib/find/browser/findWidget'; -import * as nls from 'vs/nls'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IThemeService, themeColorFromId } from 'vs/platform/theme/common/themeService'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; +import { Delayer } from '../../../../base/common/async.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import * as strings from '../../../../base/common/strings.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorCommand, EditorContributionInstantiation, MultiEditorAction, registerEditorAction, registerEditorCommand, registerEditorContribution, registerMultiEditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { overviewRulerRangeHighlight } from '../../../common/core/editorColorRegistry.js'; +import { IRange } from '../../../common/core/range.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { OverviewRulerLane } from '../../../common/model.js'; +import { CONTEXT_FIND_INPUT_FOCUSED, CONTEXT_FIND_WIDGET_VISIBLE, CONTEXT_REPLACE_INPUT_FOCUSED, FindModelBoundToEditorModel, FIND_IDS, ToggleCaseSensitiveKeybinding, TogglePreserveCaseKeybinding, ToggleRegexKeybinding, ToggleSearchScopeKeybinding, ToggleWholeWordKeybinding } from './findModel.js'; +import { FindOptionsWidget } from './findOptionsWidget.js'; +import { FindReplaceState, FindReplaceStateChangedEvent, INewFindReplaceState } from './findState.js'; +import { FindWidget, IFindController } from './findWidget.js'; +import * as nls from '../../../../nls.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js'; +import { ContextKeyExpr, IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IContextViewService } from '../../../../platform/contextview/browser/contextView.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { INotificationService, Severity } from '../../../../platform/notification/common/notification.js'; +import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js'; +import { IThemeService, themeColorFromId } from '../../../../platform/theme/common/themeService.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IHoverService } from '../../../../platform/hover/browser/hover.js'; const SEARCH_STRING_MAX_LENGTH = 524288; @@ -771,7 +771,8 @@ export class MoveToMatchFindAction extends EditorAction { } const quickInputService = accessor.get(IQuickInputService); - const inputBox = quickInputService.createInputBox(); + const disposables = new DisposableStore(); + const inputBox = disposables.add(quickInputService.createInputBox()); inputBox.placeholder = nls.localize('findMatchAction.inputPlaceHolder', "Type a number to go to a specific match (between 1 and {0})", matchesCount); const toFindMatchIndex = (value: string): number | undefined => { @@ -805,11 +806,11 @@ export class MoveToMatchFindAction extends EditorAction { this.clearDecorations(editor); } }; - inputBox.onDidChangeValue(value => { + disposables.add(inputBox.onDidChangeValue(value => { updatePickerAndEditor(value); - }); + })); - inputBox.onDidAccept(() => { + disposables.add(inputBox.onDidAccept(() => { const index = toFindMatchIndex(inputBox.value); if (typeof index === 'number') { controller.goToMatch(index); @@ -817,12 +818,12 @@ export class MoveToMatchFindAction extends EditorAction { } else { inputBox.validationMessage = nls.localize('findMatchAction.inputValidationMessage', "Please type a number between 1 and {0}", controller.getState().matchesCount); } - }); + })); - inputBox.onDidHide(() => { + disposables.add(inputBox.onDidHide(() => { this.clearDecorations(editor); - inputBox.dispose(); - }); + disposables.dispose(); + })); inputBox.show(); } diff --git a/src/vs/editor/contrib/find/browser/findDecorations.ts b/src/vs/editor/contrib/find/browser/findDecorations.ts index e5e9018464a..cfa856aaa32 100644 --- a/src/vs/editor/contrib/find/browser/findDecorations.ts +++ b/src/vs/editor/contrib/find/browser/findDecorations.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { FindMatch, IModelDecorationsChangeAccessor, IModelDeltaDecoration, MinimapPosition, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { minimapFindMatch, overviewRulerFindMatchForeground } from 'vs/platform/theme/common/colorRegistry'; -import { themeColorFromId } from 'vs/platform/theme/common/themeService'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { IActiveCodeEditor } from '../../../browser/editorBrowser.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { FindMatch, IModelDecorationsChangeAccessor, IModelDeltaDecoration, MinimapPosition, OverviewRulerLane, TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { minimapFindMatch, overviewRulerFindMatchForeground } from '../../../../platform/theme/common/colorRegistry.js'; +import { themeColorFromId } from '../../../../platform/theme/common/themeService.js'; export class FindDecorations implements IDisposable { diff --git a/src/vs/editor/contrib/find/browser/findModel.ts b/src/vs/editor/contrib/find/browser/findModel.ts index 6bbf21c7718..6e742b70951 100644 --- a/src/vs/editor/contrib/find/browser/findModel.ts +++ b/src/vs/editor/contrib/find/browser/findModel.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { findFirstIdxMonotonousOrArrLen } from 'vs/base/common/arraysFind'; -import { RunOnceScheduler, TimeoutTimer } from 'vs/base/common/async'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { DisposableStore, dispose } from 'vs/base/common/lifecycle'; -import { Constants } from 'vs/base/common/uint'; -import { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { ReplaceCommand, ReplaceCommandThatPreservesSelection } from 'vs/editor/common/commands/replaceCommand'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ScrollType } from 'vs/editor/common/editorCommon'; -import { EndOfLinePreference, FindMatch, ITextModel } from 'vs/editor/common/model'; -import { SearchParams } from 'vs/editor/common/model/textModelSearch'; -import { FindDecorations } from 'vs/editor/contrib/find/browser/findDecorations'; -import { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/browser/findState'; -import { ReplaceAllCommand } from 'vs/editor/contrib/find/browser/replaceAllCommand'; -import { parseReplaceString, ReplacePattern } from 'vs/editor/contrib/find/browser/replacePattern'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { findFirstIdxMonotonousOrArrLen } from '../../../../base/common/arraysFind.js'; +import { RunOnceScheduler, TimeoutTimer } from '../../../../base/common/async.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { DisposableStore, dispose } from '../../../../base/common/lifecycle.js'; +import { Constants } from '../../../../base/common/uint.js'; +import { IActiveCodeEditor } from '../../../browser/editorBrowser.js'; +import { ReplaceCommand, ReplaceCommandThatPreservesSelection } from '../../../common/commands/replaceCommand.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { CursorChangeReason, ICursorPositionChangedEvent } from '../../../common/cursorEvents.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICommand, ScrollType } from '../../../common/editorCommon.js'; +import { EndOfLinePreference, FindMatch, ITextModel } from '../../../common/model.js'; +import { SearchParams } from '../../../common/model/textModelSearch.js'; +import { FindDecorations } from './findDecorations.js'; +import { FindReplaceState, FindReplaceStateChangedEvent } from './findState.js'; +import { ReplaceAllCommand } from './replaceAllCommand.js'; +import { parseReplaceString, ReplacePattern } from './replacePattern.js'; +import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { IKeybindings } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; export const CONTEXT_FIND_WIDGET_VISIBLE = new RawContextKey('findWidgetVisible', false); export const CONTEXT_FIND_WIDGET_NOT_VISIBLE = CONTEXT_FIND_WIDGET_VISIBLE.toNegated(); @@ -101,7 +101,12 @@ export class FindModelBoundToEditorModel { this._decorations = new FindDecorations(editor); this._toDispose.add(this._decorations); - this._updateDecorationsScheduler = new RunOnceScheduler(() => this.research(false), 100); + this._updateDecorationsScheduler = new RunOnceScheduler(() => { + if (!this._editor.hasModel()) { + return; + } + return this.research(false); + }, 100); this._toDispose.add(this._updateDecorationsScheduler); this._toDispose.add(this._editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => { diff --git a/src/vs/editor/contrib/find/browser/findOptionsWidget.ts b/src/vs/editor/contrib/find/browser/findOptionsWidget.ts index 007723f6986..137f792ff50 100644 --- a/src/vs/editor/contrib/find/browser/findOptionsWidget.ts +++ b/src/vs/editor/contrib/find/browser/findOptionsWidget.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import 'vs/css!./findOptionsWidget'; -import { CaseSensitiveToggle, RegexToggle, WholeWordsToggle } from 'vs/base/browser/ui/findinput/findInputToggles'; -import { Widget } from 'vs/base/browser/ui/widget'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; -import { FIND_IDS } from 'vs/editor/contrib/find/browser/findModel'; -import { FindReplaceState } from 'vs/editor/contrib/find/browser/findState'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { asCssVariable, inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground } from 'vs/platform/theme/common/colorRegistry'; -import { createInstantHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; +import * as dom from '../../../../base/browser/dom.js'; +import './findOptionsWidget.css'; +import { CaseSensitiveToggle, RegexToggle, WholeWordsToggle } from '../../../../base/browser/ui/findinput/findInputToggles.js'; +import { Widget } from '../../../../base/browser/ui/widget.js'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from '../../../browser/editorBrowser.js'; +import { FIND_IDS } from './findModel.js'; +import { FindReplaceState } from './findState.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { asCssVariable, inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground } from '../../../../platform/theme/common/colorRegistry.js'; +import { createInstantHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js'; export class FindOptionsWidget extends Widget implements IOverlayWidget { diff --git a/src/vs/editor/contrib/find/browser/findState.ts b/src/vs/editor/contrib/find/browser/findState.ts index 9dec252361a..f48d60c1763 100644 --- a/src/vs/editor/contrib/find/browser/findState.ts +++ b/src/vs/editor/contrib/find/browser/findState.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Range } from 'vs/editor/common/core/range'; -import { MATCHES_LIMIT } from './findModel'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { Range } from '../../../common/core/range.js'; +import { MATCHES_LIMIT } from './findModel.js'; export interface FindReplaceStateChangedEvent { moveCursor: boolean; diff --git a/src/vs/editor/contrib/find/browser/findWidget.ts b/src/vs/editor/contrib/find/browser/findWidget.ts index 9645d4b54ba..bb3054e0db1 100644 --- a/src/vs/editor/contrib/find/browser/findWidget.ts +++ b/src/vs/editor/contrib/find/browser/findWidget.ts @@ -3,49 +3,49 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { IMouseEvent } from 'vs/base/browser/mouseEvent'; -import { alert as alertFn } from 'vs/base/browser/ui/aria/aria'; -import { Toggle } from 'vs/base/browser/ui/toggle/toggle'; -import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview'; -import { FindInput } from 'vs/base/browser/ui/findinput/findInput'; -import { ReplaceInput } from 'vs/base/browser/ui/findinput/replaceInput'; -import { IMessage as InputBoxMessage } from 'vs/base/browser/ui/inputbox/inputBox'; -import { ISashEvent, IVerticalSashLayoutProvider, Orientation, Sash } from 'vs/base/browser/ui/sash/sash'; -import { Widget } from 'vs/base/browser/ui/widget'; -import { Delayer } from 'vs/base/common/async'; -import { Codicon } from 'vs/base/common/codicons'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import * as platform from 'vs/base/common/platform'; -import * as strings from 'vs/base/common/strings'; -import 'vs/css!./findWidget'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; -import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { CONTEXT_FIND_INPUT_FOCUSED, CONTEXT_REPLACE_INPUT_FOCUSED, FIND_IDS, MATCHES_LIMIT } from 'vs/editor/contrib/find/browser/findModel'; -import { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/browser/findState'; -import * as nls from 'vs/nls'; -import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; -import { ContextScopedFindInput, ContextScopedReplaceInput } from 'vs/platform/history/browser/contextScopedHistoryWidget'; -import { showHistoryKeybindingHint } from 'vs/platform/history/browser/historyWidgetKeybindingHint'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { asCssVariable, contrastBorder, editorFindMatchForeground, editorFindMatchHighlightBorder, editorFindMatchHighlightForeground, editorFindRangeHighlightBorder, inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground } from 'vs/platform/theme/common/colorRegistry'; -import { registerIcon, widgetClose } from 'vs/platform/theme/common/iconRegistry'; -import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { isHighContrast } from 'vs/platform/theme/common/theme'; -import { assertIsDefined } from 'vs/base/common/types'; -import { defaultInputBoxStyles, defaultToggleStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { Selection } from 'vs/editor/common/core/selection'; -import { createInstantHoverDelegate, getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; -import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; +import * as dom from '../../../../base/browser/dom.js'; +import { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import { IMouseEvent } from '../../../../base/browser/mouseEvent.js'; +import { alert as alertFn } from '../../../../base/browser/ui/aria/aria.js'; +import { Toggle } from '../../../../base/browser/ui/toggle/toggle.js'; +import { IContextViewProvider } from '../../../../base/browser/ui/contextview/contextview.js'; +import { FindInput } from '../../../../base/browser/ui/findinput/findInput.js'; +import { ReplaceInput } from '../../../../base/browser/ui/findinput/replaceInput.js'; +import { IMessage as InputBoxMessage } from '../../../../base/browser/ui/inputbox/inputBox.js'; +import { ISashEvent, IVerticalSashLayoutProvider, Orientation, Sash } from '../../../../base/browser/ui/sash/sash.js'; +import { Widget } from '../../../../base/browser/ui/widget.js'; +import { Delayer } from '../../../../base/common/async.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { toDisposable } from '../../../../base/common/lifecycle.js'; +import * as platform from '../../../../base/common/platform.js'; +import * as strings from '../../../../base/common/strings.js'; +import './findWidget.css'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, OverlayWidgetPositionPreference } from '../../../browser/editorBrowser.js'; +import { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { CONTEXT_FIND_INPUT_FOCUSED, CONTEXT_REPLACE_INPUT_FOCUSED, FIND_IDS, MATCHES_LIMIT } from './findModel.js'; +import { FindReplaceState, FindReplaceStateChangedEvent } from './findState.js'; +import * as nls from '../../../../nls.js'; +import { AccessibilitySupport } from '../../../../platform/accessibility/common/accessibility.js'; +import { ContextScopedFindInput, ContextScopedReplaceInput } from '../../../../platform/history/browser/contextScopedHistoryWidget.js'; +import { showHistoryKeybindingHint } from '../../../../platform/history/browser/historyWidgetKeybindingHint.js'; +import { IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js'; +import { asCssVariable, contrastBorder, editorFindMatchForeground, editorFindMatchHighlightBorder, editorFindMatchHighlightForeground, editorFindRangeHighlightBorder, inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground } from '../../../../platform/theme/common/colorRegistry.js'; +import { registerIcon, widgetClose } from '../../../../platform/theme/common/iconRegistry.js'; +import { IThemeService, registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { isHighContrast } from '../../../../platform/theme/common/theme.js'; +import { assertIsDefined } from '../../../../base/common/types.js'; +import { defaultInputBoxStyles, defaultToggleStyles } from '../../../../platform/theme/browser/defaultStyles.js'; +import { Selection } from '../../../common/core/selection.js'; +import { createInstantHoverDelegate, getDefaultHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js'; +import { IHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegate.js'; +import { IHoverService } from '../../../../platform/hover/browser/hover.js'; const findCollapsedIcon = registerIcon('find-collapsed', Codicon.chevronRight, nls.localize('findCollapsedIcon', 'Icon to indicate that the editor find widget is collapsed.')); const findExpandedIcon = registerIcon('find-expanded', Codicon.chevronDown, nls.localize('findExpandedIcon', 'Icon to indicate that the editor find widget is expanded.')); diff --git a/src/vs/editor/contrib/find/browser/replaceAllCommand.ts b/src/vs/editor/contrib/find/browser/replaceAllCommand.ts index 8f5773aa434..0926711fb3d 100644 --- a/src/vs/editor/contrib/find/browser/replaceAllCommand.ts +++ b/src/vs/editor/contrib/find/browser/replaceAllCommand.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; interface IEditOperation { range: Range; diff --git a/src/vs/editor/contrib/find/browser/replacePattern.ts b/src/vs/editor/contrib/find/browser/replacePattern.ts index bc0d3b9b8c9..70c0f5bbad6 100644 --- a/src/vs/editor/contrib/find/browser/replacePattern.ts +++ b/src/vs/editor/contrib/find/browser/replacePattern.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { buildReplaceStringWithCasePreserved } from 'vs/base/common/search'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { buildReplaceStringWithCasePreserved } from '../../../../base/common/search.js'; const enum ReplacePatternKind { StaticValue = 0, diff --git a/src/vs/editor/contrib/find/test/browser/find.test.ts b/src/vs/editor/contrib/find/test/browser/find.test.ts index 580ea739b76..8b0cd2a87a5 100644 --- a/src/vs/editor/contrib/find/test/browser/find.test.ts +++ b/src/vs/editor/contrib/find/test/browser/find.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { getSelectionSearchString } from 'vs/editor/contrib/find/browser/findController'; -import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { getSelectionSearchString } from '../../browser/findController.js'; +import { withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; suite('Find', () => { diff --git a/src/vs/editor/contrib/find/test/browser/findController.test.ts b/src/vs/editor/contrib/find/test/browser/findController.test.ts index 49fef95baf8..bab641242e1 100644 --- a/src/vs/editor/contrib/find/test/browser/findController.test.ts +++ b/src/vs/editor/contrib/find/test/browser/findController.test.ts @@ -4,25 +4,25 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Delayer } from 'vs/base/common/async'; -import * as platform from 'vs/base/common/platform'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction } from 'vs/editor/browser/editorExtensions'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { CommonFindController, FindStartFocusAction, IFindStartOptions, NextMatchFindAction, NextSelectionMatchFindAction, StartFindAction, StartFindReplaceAction, StartFindWithSelectionAction } from 'vs/editor/contrib/find/browser/findController'; -import { CONTEXT_FIND_INPUT_FOCUSED } from 'vs/editor/contrib/find/browser/findModel'; -import { withAsyncTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IStorageService, InMemoryStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; +import { Delayer } from '../../../../../base/common/async.js'; +import * as platform from '../../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { EditorAction } from '../../../../browser/editorExtensions.js'; +import { EditOperation } from '../../../../common/core/editOperation.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { CommonFindController, FindStartFocusAction, IFindStartOptions, NextMatchFindAction, NextSelectionMatchFindAction, StartFindAction, StartFindReplaceAction, StartFindWithSelectionAction } from '../../browser/findController.js'; +import { CONTEXT_FIND_INPUT_FOCUSED } from '../../browser/findModel.js'; +import { withAsyncTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { IClipboardService } from '../../../../../platform/clipboard/common/clipboardService.js'; +import { IContextKey, IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; +import { IHoverService } from '../../../../../platform/hover/browser/hover.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { INotificationService } from '../../../../../platform/notification/common/notification.js'; +import { IStorageService, InMemoryStorageService, StorageScope, StorageTarget } from '../../../../../platform/storage/common/storage.js'; class TestFindController extends CommonFindController { diff --git a/src/vs/editor/contrib/find/test/browser/findModel.test.ts b/src/vs/editor/contrib/find/test/browser/findModel.test.ts index 8cc753388b9..09a0de5a7ae 100644 --- a/src/vs/editor/contrib/find/test/browser/findModel.test.ts +++ b/src/vs/editor/contrib/find/test/browser/findModel.test.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { CoreNavigationCommands } from 'vs/editor/browser/coreCommands'; -import { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { PieceTreeTextBufferBuilder } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder'; -import { FindModelBoundToEditorModel } from 'vs/editor/contrib/find/browser/findModel'; -import { FindReplaceState } from 'vs/editor/contrib/find/browser/findState'; -import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { CoreNavigationCommands } from '../../../../browser/coreCommands.js'; +import { IActiveCodeEditor, ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { PieceTreeTextBufferBuilder } from '../../../../common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.js'; +import { FindModelBoundToEditorModel } from '../../browser/findModel.js'; +import { FindReplaceState } from '../../browser/findState.js'; +import { withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; suite('FindModel', () => { diff --git a/src/vs/editor/contrib/find/test/browser/replacePattern.test.ts b/src/vs/editor/contrib/find/test/browser/replacePattern.test.ts index 1f534bbdae3..26c65b3d8be 100644 --- a/src/vs/editor/contrib/find/test/browser/replacePattern.test.ts +++ b/src/vs/editor/contrib/find/test/browser/replacePattern.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { buildReplaceStringWithCasePreserved } from 'vs/base/common/search'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { parseReplaceString, ReplacePattern, ReplacePiece } from 'vs/editor/contrib/find/browser/replacePattern'; +import { buildReplaceStringWithCasePreserved } from '../../../../../base/common/search.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { parseReplaceString, ReplacePattern, ReplacePiece } from '../../browser/replacePattern.js'; suite('Replace Pattern test', () => { diff --git a/src/vs/editor/contrib/folding/browser/folding.css b/src/vs/editor/contrib/folding/browser/folding.css index f973d5f7a30..5f7ab05db78 100644 --- a/src/vs/editor/contrib/folding/browser/folding.css +++ b/src/vs/editor/contrib/folding/browser/folding.css @@ -31,7 +31,7 @@ } .monaco-editor .inline-folded:after { - color: grey; + color: var(--vscode-editor-foldPlaceholderForeground); margin: 0.1em 0.2em 0 0.2em; content: "\22EF"; /* ellipses unicode character */ display: inline; @@ -49,4 +49,3 @@ .monaco-editor .cldr.codicon.codicon-folding-manual-collapsed { color: var(--vscode-editorGutter-foldingControlForeground) !important; } - diff --git a/src/vs/editor/contrib/folding/browser/folding.ts b/src/vs/editor/contrib/folding/browser/folding.ts index 25988ac7370..ee657d44e14 100644 --- a/src/vs/editor/contrib/folding/browser/folding.ts +++ b/src/vs/editor/contrib/folding/browser/folding.ts @@ -3,44 +3,45 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise, Delayer, RunOnceScheduler } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { illegalArgument, onUnexpectedError } from 'vs/base/common/errors'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import * as types from 'vs/base/common/types'; -import 'vs/css!./folding'; -import { StableEditorScrollState } from 'vs/editor/browser/stableEditorScroll'; -import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, registerInstantiatedEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IPosition } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ITextModel } from 'vs/editor/common/model'; -import { IModelContentChangedEvent } from 'vs/editor/common/textModelEvents'; -import { FoldingRange, FoldingRangeKind, FoldingRangeProvider } from 'vs/editor/common/languages'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { CollapseMemento, FoldingModel, getNextFoldLine, getParentFoldLine as getParentFoldLine, getPreviousFoldLine, setCollapseStateAtLevel, setCollapseStateForMatchingLines, setCollapseStateForRest, setCollapseStateForType, setCollapseStateLevelsDown, setCollapseStateLevelsUp, setCollapseStateUp, toggleCollapseState } from 'vs/editor/contrib/folding/browser/foldingModel'; -import { HiddenRangeModel } from 'vs/editor/contrib/folding/browser/hiddenRangeModel'; -import { IndentRangeProvider } from 'vs/editor/contrib/folding/browser/indentRangeProvider'; -import * as nls from 'vs/nls'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { FoldingDecorationProvider } from './foldingDecorations'; -import { FoldingRegion, FoldingRegions, FoldRange, FoldSource, ILineRange } from './foldingRanges'; -import { SyntaxRangeProvider } from './syntaxRangeProvider'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { Emitter, Event } from 'vs/base/common/event'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { URI } from 'vs/base/common/uri'; -import { IModelService } from 'vs/editor/common/services/model'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { CancelablePromise, createCancelablePromise, Delayer, RunOnceScheduler } from '../../../../base/common/async.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { illegalArgument, onUnexpectedError } from '../../../../base/common/errors.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { Disposable, DisposableStore, IDisposable } from '../../../../base/common/lifecycle.js'; +import { escapeRegExpCharacters } from '../../../../base/common/strings.js'; +import * as types from '../../../../base/common/types.js'; +import './folding.css'; +import { StableEditorScrollState } from '../../../browser/stableEditorScroll.js'; +import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, registerInstantiatedEditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js'; +import { IPosition } from '../../../common/core/position.js'; +import { IRange } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IEditorContribution, ScrollType } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ITextModel } from '../../../common/model.js'; +import { IModelContentChangedEvent } from '../../../common/textModelEvents.js'; +import { FoldingRange, FoldingRangeKind, FoldingRangeProvider } from '../../../common/languages.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { CollapseMemento, FoldingModel, getNextFoldLine, getParentFoldLine as getParentFoldLine, getPreviousFoldLine, setCollapseStateAtLevel, setCollapseStateForMatchingLines, setCollapseStateForRest, setCollapseStateForType, setCollapseStateLevelsDown, setCollapseStateLevelsUp, setCollapseStateUp, toggleCollapseState } from './foldingModel.js'; +import { HiddenRangeModel } from './hiddenRangeModel.js'; +import { IndentRangeProvider } from './indentRangeProvider.js'; +import * as nls from '../../../../nls.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { FoldingDecorationProvider } from './foldingDecorations.js'; +import { FoldingRegion, FoldingRegions, FoldRange, FoldSource, ILineRange } from './foldingRanges.js'; +import { SyntaxRangeProvider } from './syntaxRangeProvider.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IModelService } from '../../../common/services/model.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; const CONTEXT_FOLDING_ENABLED = new RawContextKey('foldingEnabled', false); @@ -328,8 +329,7 @@ export class FoldingController extends Disposable implements IEditorContribution // some cursors might have moved into hidden regions, make sure they are in expanded regions const selections = this.editor.getSelections(); - const selectionLineNumbers = selections ? selections.map(s => s.startLineNumber) : []; - foldingModel.update(foldingRanges, selectionLineNumbers); + foldingModel.update(foldingRanges, toSelectedLines(selections)); scrollState?.restore(this.editor); @@ -582,6 +582,29 @@ abstract class FoldingAction extends EditorAction { } } +export interface SelectedLines { + startsInside(startLine: number, endLine: number): boolean; +} + +export function toSelectedLines(selections: Selection[] | null): SelectedLines { + if (!selections || selections.length === 0) { + return { + startsInside: () => false + }; + } + return { + startsInside(startLine: number, endLine: number): boolean { + for (const s of selections) { + const line = s.startLineNumber; + if (line >= startLine && line <= endLine) { + return true; + } + } + return false; + } + }; +} + interface FoldingArguments { levels?: number; direction?: 'up' | 'down'; @@ -1208,6 +1231,35 @@ class RemoveFoldRangeFromSelectionAction extends FoldingAction { } +class ToggleImportFoldAction extends FoldingAction { + + constructor() { + super({ + id: 'editor.toggleImportFold', + label: nls.localize('toggleImportFold.label', "Toggle Import Fold"), + alias: 'Toggle Import Fold', + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + weight: KeybindingWeight.EditorContrib + } + }); + } + + async invoke(foldingController: FoldingController, foldingModel: FoldingModel): Promise { + const regionsToToggle: FoldingRegion[] = []; + const regions = foldingModel.regions; + for (let i = regions.length - 1; i >= 0; i--) { + if (regions.getType(i) === FoldingRangeKind.Imports.value) { + regionsToToggle.push(regions.toRegion(i)); + } + } + foldingModel.toggleCollapseState(regionsToToggle); + foldingController.triggerFoldingModelChanged(); + } +} + + registerEditorContribution(FoldingController.ID, FoldingController, EditorContributionInstantiation.Eager); // eager because it uses `saveViewState`/`restoreViewState` registerEditorAction(UnfoldAction); registerEditorAction(UnFoldRecursivelyAction); @@ -1227,6 +1279,7 @@ registerEditorAction(GotoPreviousFoldAction); registerEditorAction(GotoNextFoldAction); registerEditorAction(FoldRangeFromSelectionAction); registerEditorAction(RemoveFoldRangeFromSelectionAction); +registerEditorAction(ToggleImportFoldAction); for (let i = 1; i <= 7; i++) { registerInstantiatedEditorAction( diff --git a/src/vs/editor/contrib/folding/browser/foldingDecorations.ts b/src/vs/editor/contrib/folding/browser/foldingDecorations.ts index 03a9b4a402c..821badb88af 100644 --- a/src/vs/editor/contrib/folding/browser/foldingDecorations.ts +++ b/src/vs/editor/contrib/folding/browser/foldingDecorations.ts @@ -3,19 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Codicon } from 'vs/base/common/codicons'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IModelDecorationOptions, IModelDecorationsChangeAccessor, MinimapPosition, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { IDecorationProvider } from 'vs/editor/contrib/folding/browser/foldingModel'; -import { localize } from 'vs/nls'; -import { editorSelectionBackground, iconForeground, registerColor, transparent } from 'vs/platform/theme/common/colorRegistry'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { themeColorFromId } from 'vs/platform/theme/common/themeService'; -import { ThemeIcon } from 'vs/base/common/themables'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { IModelDecorationOptions, IModelDecorationsChangeAccessor, MinimapPosition, TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { IDecorationProvider } from './foldingModel.js'; +import { localize } from '../../../../nls.js'; +import { editorSelectionBackground, iconForeground, registerColor, transparent } from '../../../../platform/theme/common/colorRegistry.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; +import { themeColorFromId } from '../../../../platform/theme/common/themeService.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; const foldBackground = registerColor('editor.foldBackground', { light: transparent(editorSelectionBackground, 0.3), dark: transparent(editorSelectionBackground, 0.3), hcDark: null, hcLight: null }, localize('foldBackgroundBackground', "Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."), true); -registerColor('editorGutter.foldingControlForeground', { dark: iconForeground, light: iconForeground, hcDark: iconForeground, hcLight: iconForeground }, localize('editorGutter.foldingControlForeground', 'Color of the folding control in the editor gutter.')); +registerColor('editor.foldPlaceholderForeground', { light: '#808080', dark: '#808080', hcDark: null, hcLight: null }, localize('collapsedTextColor', "Color of the collapsed text after the first line of a folded range.")); +registerColor('editorGutter.foldingControlForeground', iconForeground, localize('editorGutter.foldingControlForeground', 'Color of the folding control in the editor gutter.')); export const foldingExpandedIcon = registerIcon('folding-expanded', Codicon.chevronDown, localize('foldingExpandedIcon', 'Icon for expanded ranges in the editor glyph margin.')); export const foldingCollapsedIcon = registerIcon('folding-collapsed', Codicon.chevronRight, localize('foldingCollapsedIcon', 'Icon for collapsed ranges in the editor glyph margin.')); diff --git a/src/vs/editor/contrib/folding/browser/foldingModel.ts b/src/vs/editor/contrib/folding/browser/foldingModel.ts index b031a05abcc..c7721163695 100644 --- a/src/vs/editor/contrib/folding/browser/foldingModel.ts +++ b/src/vs/editor/contrib/folding/browser/foldingModel.ts @@ -3,10 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { IModelDecorationOptions, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model'; -import { FoldingRegion, FoldingRegions, ILineRange, FoldRange, FoldSource } from './foldingRanges'; -import { hash } from 'vs/base/common/hash'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { IModelDecorationOptions, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from '../../../common/model.js'; +import { FoldingRegion, FoldingRegions, ILineRange, FoldRange, FoldSource } from './foldingRanges.js'; +import { hash } from '../../../../base/common/hash.js'; +import { SelectedLines } from './folding.js'; export interface IDecorationProvider { getDecorationOption(isCollapsed: boolean, isHidden: boolean, isManual: boolean): IModelDecorationOptions; @@ -111,9 +112,9 @@ export class FoldingModel { this.updatePost(FoldingRegions.fromFoldRanges(newFoldingRanges)); } - public update(newRegions: FoldingRegions, blockedLineNumers: number[] = []): void { - const foldedOrManualRanges = this._currentFoldedOrManualRanges(blockedLineNumers); - const newRanges = FoldingRegions.sanitizeAndMerge(newRegions, foldedOrManualRanges, this._textModel.getLineCount()); + public update(newRegions: FoldingRegions, selection?: SelectedLines): void { + const foldedOrManualRanges = this._currentFoldedOrManualRanges(selection); + const newRanges = FoldingRegions.sanitizeAndMerge(newRegions, foldedOrManualRanges, this._textModel.getLineCount(), selection); this.updatePost(FoldingRegions.fromFoldRanges(newRanges)); } @@ -141,17 +142,7 @@ export class FoldingModel { this._updateEventEmitter.fire({ model: this }); } - private _currentFoldedOrManualRanges(blockedLineNumers: number[] = []): FoldRange[] { - - const isBlocked = (startLineNumber: number, endLineNumber: number) => { - for (const blockedLineNumber of blockedLineNumers) { - if (startLineNumber < blockedLineNumber && blockedLineNumber <= endLineNumber) { // first line is visible - return true; - } - } - return false; - }; - + private _currentFoldedOrManualRanges(selection?: SelectedLines): FoldRange[] { const foldedRanges: FoldRange[] = []; for (let i = 0, limit = this._regions.length; i < limit; i++) { let isCollapsed = this.regions.isCollapsed(i); @@ -160,7 +151,7 @@ export class FoldingModel { const foldRange = this._regions.toFoldRange(i); const decRange = this._textModel.getDecorationRange(this._editorDecorationIds[i]); if (decRange) { - if (isCollapsed && isBlocked(decRange.startLineNumber, decRange.endLineNumber)) { + if (isCollapsed && selection?.startsInside(decRange.startLineNumber + 1, decRange.endLineNumber)) { isCollapsed = false; // uncollapse is the range is blocked } foldedRanges.push({ diff --git a/src/vs/editor/contrib/folding/browser/foldingRanges.ts b/src/vs/editor/contrib/folding/browser/foldingRanges.ts index ee23abbfc74..45291a36e5f 100644 --- a/src/vs/editor/contrib/folding/browser/foldingRanges.ts +++ b/src/vs/editor/contrib/folding/browser/foldingRanges.ts @@ -3,6 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { SelectedLines } from './folding.js'; + export interface ILineRange { startLineNumber: number; endLineNumber: number; @@ -299,7 +301,10 @@ export class FoldingRegions { public static sanitizeAndMerge( rangesA: FoldingRegions | FoldRange[], rangesB: FoldingRegions | FoldRange[], - maxLineNumber: number | undefined): FoldRange[] { + maxLineNumber: number | undefined, + selection?: SelectedLines + ): FoldRange[] { + maxLineNumber = maxLineNumber ?? Number.MAX_VALUE; const getIndexedFunction = (r: FoldingRegions | FoldRange[], limit: number) => { @@ -330,7 +335,8 @@ export class FoldingRegions { } else { // a previously folded range or a (possibly unfolded) recovered range useRange = nextA; - useRange.isCollapsed = nextB.isCollapsed && nextA.endLineNumber === nextB.endLineNumber; + // stays collapsed if the range still has the same number of lines or the selection is not in the range or after it + useRange.isCollapsed = nextB.isCollapsed && (nextA.endLineNumber === nextB.endLineNumber || !selection?.startsInside(nextA.startLineNumber + 1, nextA.endLineNumber + 1)); useRange.source = FoldSource.provider; } nextA = getA(++indexA); // not necessary, just for speed diff --git a/src/vs/editor/contrib/folding/browser/hiddenRangeModel.ts b/src/vs/editor/contrib/folding/browser/hiddenRangeModel.ts index 6d72da79026..9994afcb847 100644 --- a/src/vs/editor/contrib/folding/browser/hiddenRangeModel.ts +++ b/src/vs/editor/contrib/folding/browser/hiddenRangeModel.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { findFirstIdxMonotonousOrArrLen } from 'vs/base/common/arraysFind'; - -import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IModelContentChangedEvent } from 'vs/editor/common/textModelEvents'; -import { countEOL } from 'vs/editor/common/core/eolCounter'; -import { FoldingModel } from 'vs/editor/contrib/folding/browser/foldingModel'; +import { findFirstIdxMonotonousOrArrLen } from '../../../../base/common/arraysFind.js'; + +import { Emitter, Event } from '../../../../base/common/event.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IModelContentChangedEvent } from '../../../common/textModelEvents.js'; +import { countEOL } from '../../../common/core/eolCounter.js'; +import { FoldingModel } from './foldingModel.js'; export class HiddenRangeModel { diff --git a/src/vs/editor/contrib/folding/browser/indentRangeProvider.ts b/src/vs/editor/contrib/folding/browser/indentRangeProvider.ts index de53762d48f..e1bbe8a949c 100644 --- a/src/vs/editor/contrib/folding/browser/indentRangeProvider.ts +++ b/src/vs/editor/contrib/folding/browser/indentRangeProvider.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { ITextModel } from 'vs/editor/common/model'; -import { computeIndentLevel } from 'vs/editor/common/model/utils'; -import { FoldingMarkers } from 'vs/editor/common/languages/languageConfiguration'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { FoldingRegions, MAX_LINE_NUMBER } from 'vs/editor/contrib/folding/browser/foldingRanges'; -import { FoldingLimitReporter, RangeProvider } from './folding'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { ITextModel } from '../../../common/model.js'; +import { computeIndentLevel } from '../../../common/model/utils.js'; +import { FoldingMarkers } from '../../../common/languages/languageConfiguration.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { FoldingRegions, MAX_LINE_NUMBER } from './foldingRanges.js'; +import { FoldingLimitReporter, RangeProvider } from './folding.js'; const MAX_FOLDING_REGIONS_FOR_INDENT_DEFAULT = 5000; diff --git a/src/vs/editor/contrib/folding/browser/syntaxRangeProvider.ts b/src/vs/editor/contrib/folding/browser/syntaxRangeProvider.ts index 49e03d708fe..97fa12bb6ca 100644 --- a/src/vs/editor/contrib/folding/browser/syntaxRangeProvider.ts +++ b/src/vs/editor/contrib/folding/browser/syntaxRangeProvider.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ITextModel } from 'vs/editor/common/model'; -import { FoldingContext, FoldingRange, FoldingRangeProvider } from 'vs/editor/common/languages'; -import { FoldingLimitReporter, RangeProvider } from './folding'; -import { FoldingRegions, MAX_LINE_NUMBER } from './foldingRanges'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ITextModel } from '../../../common/model.js'; +import { FoldingContext, FoldingRange, FoldingRangeProvider } from '../../../common/languages.js'; +import { FoldingLimitReporter, RangeProvider } from './folding.js'; +import { FoldingRegions, MAX_LINE_NUMBER } from './foldingRanges.js'; export interface IFoldingRangeData extends FoldingRange { rank: number; diff --git a/src/vs/editor/contrib/folding/test/browser/foldingModel.test.ts b/src/vs/editor/contrib/folding/test/browser/foldingModel.test.ts index 1ea615a5bd9..0a498e74f38 100644 --- a/src/vs/editor/contrib/folding/test/browser/foldingModel.test.ts +++ b/src/vs/editor/contrib/folding/test/browser/foldingModel.test.ts @@ -3,17 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IModelDecorationsChangeAccessor, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { FoldingModel, getNextFoldLine, getParentFoldLine, getPreviousFoldLine, setCollapseStateAtLevel, setCollapseStateForMatchingLines, setCollapseStateForRest, setCollapseStateLevelsDown, setCollapseStateLevelsUp, setCollapseStateUp } from 'vs/editor/contrib/folding/browser/foldingModel'; -import { FoldingRegion } from 'vs/editor/contrib/folding/browser/foldingRanges'; -import { computeRanges } from 'vs/editor/contrib/folding/browser/indentRangeProvider'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { escapeRegExpCharacters } from '../../../../../base/common/strings.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { EditOperation } from '../../../../common/core/editOperation.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { IModelDecorationsChangeAccessor, ITextModel, TrackedRangeStickiness } from '../../../../common/model.js'; +import { ModelDecorationOptions } from '../../../../common/model/textModel.js'; +import { toSelectedLines } from '../../browser/folding.js'; +import { FoldingModel, getNextFoldLine, getParentFoldLine, getPreviousFoldLine, setCollapseStateAtLevel, setCollapseStateForMatchingLines, setCollapseStateForRest, setCollapseStateLevelsDown, setCollapseStateLevelsUp, setCollapseStateUp } from '../../browser/foldingModel.js'; +import { FoldingRegion } from '../../browser/foldingRanges.js'; +import { computeRanges } from '../../browser/indentRangeProvider.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; interface ExpectedRegion { @@ -288,7 +290,7 @@ suite('Folding Model', () => { textModel.applyEdits([EditOperation.delete(new Range(6, 11, 9, 0))]); - foldingModel.update(computeRanges(textModel, false, undefined)); + foldingModel.update(computeRanges(textModel, true, undefined), toSelectedLines([new Selection(7, 1, 7, 1)])); assertRanges(foldingModel, [r(1, 9, false), r(2, 8, false), r(3, 5, false), r(6, 8, false)]); } finally { diff --git a/src/vs/editor/contrib/folding/test/browser/foldingRanges.test.ts b/src/vs/editor/contrib/folding/test/browser/foldingRanges.test.ts index a1a6dbe1dc1..02876c26aa2 100644 --- a/src/vs/editor/contrib/folding/test/browser/foldingRanges.test.ts +++ b/src/vs/editor/contrib/folding/test/browser/foldingRanges.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { FoldingMarkers } from 'vs/editor/common/languages/languageConfiguration'; -import { MAX_FOLDING_REGIONS, FoldRange, FoldingRegions, FoldSource } from 'vs/editor/contrib/folding/browser/foldingRanges'; -import { RangesCollector, computeRanges } from 'vs/editor/contrib/folding/browser/indentRangeProvider'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { FoldingMarkers } from '../../../../common/languages/languageConfiguration.js'; +import { MAX_FOLDING_REGIONS, FoldRange, FoldingRegions, FoldSource } from '../../browser/foldingRanges.js'; +import { RangesCollector, computeRanges } from '../../browser/indentRangeProvider.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; const markers: FoldingMarkers = { start: /^#region$/, diff --git a/src/vs/editor/contrib/folding/test/browser/hiddenRangeModel.test.ts b/src/vs/editor/contrib/folding/test/browser/hiddenRangeModel.test.ts index 6d57dec4e78..6570dfe84ce 100644 --- a/src/vs/editor/contrib/folding/test/browser/hiddenRangeModel.test.ts +++ b/src/vs/editor/contrib/folding/test/browser/hiddenRangeModel.test.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { IRange } from 'vs/editor/common/core/range'; -import { FoldingModel } from 'vs/editor/contrib/folding/browser/foldingModel'; -import { HiddenRangeModel } from 'vs/editor/contrib/folding/browser/hiddenRangeModel'; -import { computeRanges } from 'vs/editor/contrib/folding/browser/indentRangeProvider'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { TestDecorationProvider } from './foldingModel.test'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { IRange } from '../../../../common/core/range.js'; +import { FoldingModel } from '../../browser/foldingModel.js'; +import { HiddenRangeModel } from '../../browser/hiddenRangeModel.js'; +import { computeRanges } from '../../browser/indentRangeProvider.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { TestDecorationProvider } from './foldingModel.test.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; interface ExpectedRange { diff --git a/src/vs/editor/contrib/folding/test/browser/indentFold.test.ts b/src/vs/editor/contrib/folding/test/browser/indentFold.test.ts index 25db0e6d15d..ebbe9842003 100644 --- a/src/vs/editor/contrib/folding/test/browser/indentFold.test.ts +++ b/src/vs/editor/contrib/folding/test/browser/indentFold.test.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { computeRanges } from 'vs/editor/contrib/folding/browser/indentRangeProvider'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { computeRanges } from '../../browser/indentRangeProvider.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; interface IndentRange { start: number; diff --git a/src/vs/editor/contrib/folding/test/browser/indentRangeProvider.test.ts b/src/vs/editor/contrib/folding/test/browser/indentRangeProvider.test.ts index 837dd6c0bc4..70d3c589741 100644 --- a/src/vs/editor/contrib/folding/test/browser/indentRangeProvider.test.ts +++ b/src/vs/editor/contrib/folding/test/browser/indentRangeProvider.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { FoldingMarkers } from 'vs/editor/common/languages/languageConfiguration'; -import { computeRanges } from 'vs/editor/contrib/folding/browser/indentRangeProvider'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { FoldingMarkers } from '../../../../common/languages/languageConfiguration.js'; +import { computeRanges } from '../../browser/indentRangeProvider.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; interface ExpectedIndentRange { startLineNumber: number; diff --git a/src/vs/editor/contrib/folding/test/browser/syntaxFold.test.ts b/src/vs/editor/contrib/folding/test/browser/syntaxFold.test.ts index 3b2bdb0648e..22387ee2fc9 100644 --- a/src/vs/editor/contrib/folding/test/browser/syntaxFold.test.ts +++ b/src/vs/editor/contrib/folding/test/browser/syntaxFold.test.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { ITextModel } from 'vs/editor/common/model'; -import { FoldingContext, FoldingRange, FoldingRangeProvider, ProviderResult } from 'vs/editor/common/languages'; -import { SyntaxRangeProvider } from 'vs/editor/contrib/folding/browser/syntaxRangeProvider'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { FoldingLimitReporter } from 'vs/editor/contrib/folding/browser/folding'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { ITextModel } from '../../../../common/model.js'; +import { FoldingContext, FoldingRange, FoldingRangeProvider, ProviderResult } from '../../../../common/languages.js'; +import { SyntaxRangeProvider } from '../../browser/syntaxRangeProvider.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { FoldingLimitReporter } from '../../browser/folding.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; interface IndentRange { start: number; diff --git a/src/vs/editor/contrib/fontZoom/browser/fontZoom.ts b/src/vs/editor/contrib/fontZoom/browser/fontZoom.ts index bdbf9804563..8093cfb91af 100644 --- a/src/vs/editor/contrib/fontZoom/browser/fontZoom.ts +++ b/src/vs/editor/contrib/fontZoom/browser/fontZoom.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorZoom } from 'vs/editor/common/config/editorZoom'; -import * as nls from 'vs/nls'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, registerEditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorZoom } from '../../../common/config/editorZoom.js'; +import * as nls from '../../../../nls.js'; class EditorFontZoomIn extends EditorAction { diff --git a/src/vs/editor/contrib/format/browser/format.ts b/src/vs/editor/contrib/format/browser/format.ts index bb449bb7934..586663691d1 100644 --- a/src/vs/editor/contrib/format/browser/format.ts +++ b/src/vs/editor/contrib/format/browser/format.ts @@ -3,34 +3,34 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { asArray, isNonEmptyArray } from 'vs/base/common/arrays'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { Iterable } from 'vs/base/common/iterator'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { LinkedList } from 'vs/base/common/linkedList'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { CodeEditorStateFlag, EditorStateCancellationTokenSource, TextModelCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/editorState'; -import { IActiveCodeEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, FormattingOptions, TextEdit } from 'vs/editor/common/languages'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { FormattingEdit } from 'vs/editor/contrib/format/browser/formattingEdit'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ExtensionIdentifierSet } from 'vs/platform/extensions/common/extensions'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IProgress } from 'vs/platform/progress/common/progress'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ILogService } from 'vs/platform/log/common/log'; -import { AccessibilitySignal, IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; +import { asArray, isNonEmptyArray } from '../../../../base/common/arrays.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { Iterable } from '../../../../base/common/iterator.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { LinkedList } from '../../../../base/common/linkedList.js'; +import { assertType } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { CodeEditorStateFlag, EditorStateCancellationTokenSource, TextModelCancellationTokenSource } from '../../editorState/browser/editorState.js'; +import { IActiveCodeEditor, isCodeEditor } from '../../../browser/editorBrowser.js'; +import { ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ScrollType } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; +import { DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, FormattingOptions, TextEdit } from '../../../common/languages.js'; +import { IEditorWorkerService } from '../../../common/services/editorWorker.js'; +import { ITextModelService } from '../../../common/services/resolverService.js'; +import { FormattingEdit } from './formattingEdit.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { ExtensionIdentifierSet } from '../../../../platform/extensions/common/extensions.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IProgress } from '../../../../platform/progress/common/progress.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { AccessibilitySignal, IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; export function getRealAndSyntheticDocumentFormattersOrdered( documentFormattingEditProvider: LanguageFeatureRegistry, diff --git a/src/vs/editor/contrib/format/browser/formatActions.ts b/src/vs/editor/contrib/format/browser/formatActions.ts index 1f345ac5329..6f43b2ddc5c 100644 --- a/src/vs/editor/contrib/format/browser/formatActions.ts +++ b/src/vs/editor/contrib/format/browser/formatActions.ts @@ -3,30 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { CharacterSet } from 'vs/editor/common/core/characterClassifier'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { formatDocumentRangesWithSelectedProvider, formatDocumentWithSelectedProvider, FormattingMode, getOnTypeFormattingEdits } from 'vs/editor/contrib/format/browser/format'; -import { FormattingEdit } from 'vs/editor/contrib/format/browser/formattingEdit'; -import * as nls from 'vs/nls'; -import { AccessibilitySignal, IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IEditorProgressService, Progress } from 'vs/platform/progress/common/progress'; +import { isNonEmptyArray } from '../../../../base/common/arrays.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { CharacterSet } from '../../../common/core/characterClassifier.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { IEditorWorkerService } from '../../../common/services/editorWorker.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { formatDocumentRangesWithSelectedProvider, formatDocumentWithSelectedProvider, FormattingMode, getOnTypeFormattingEdits } from './format.js'; +import { FormattingEdit } from './formattingEdit.js'; +import * as nls from '../../../../nls.js'; +import { AccessibilitySignal, IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; +import { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IEditorProgressService, Progress } from '../../../../platform/progress/common/progress.js'; export class FormatOnType implements IEditorContribution { diff --git a/src/vs/editor/contrib/format/browser/formattingEdit.ts b/src/vs/editor/contrib/format/browser/formattingEdit.ts index 2f4a830a5cf..e2d0dacda38 100644 --- a/src/vs/editor/contrib/format/browser/formattingEdit.ts +++ b/src/vs/editor/contrib/format/browser/formattingEdit.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Range } from 'vs/editor/common/core/range'; -import { EndOfLineSequence } from 'vs/editor/common/model'; -import { TextEdit } from 'vs/editor/common/languages'; -import { StableEditorScrollState } from 'vs/editor/browser/stableEditorScroll'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditOperation, ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Range } from '../../../common/core/range.js'; +import { EndOfLineSequence } from '../../../common/model.js'; +import { TextEdit } from '../../../common/languages.js'; +import { StableEditorScrollState } from '../../../browser/stableEditorScroll.js'; export class FormattingEdit { diff --git a/src/vs/editor/contrib/glimpseChange/glimpseChange.ts b/src/vs/editor/contrib/glimpseChange/browser/glimpseChange.ts similarity index 92% rename from src/vs/editor/contrib/glimpseChange/glimpseChange.ts rename to src/vs/editor/contrib/glimpseChange/browser/glimpseChange.ts index a07fd911b4f..da0fc0878f2 100644 --- a/src/vs/editor/contrib/glimpseChange/glimpseChange.ts +++ b/src/vs/editor/contrib/glimpseChange/browser/glimpseChange.ts @@ -3,15 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { Disposable, DisposableStore, dispose } from 'vs/base/common/lifecycle'; -import 'vs/css!./referencesWidget'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget'; -import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import * as dom from '../../../../base/browser/dom.js'; +import { Disposable, DisposableStore, dispose } from '../../../../base/common/lifecycle.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from '../../../browser/editorBrowser.js'; +import { EmbeddedCodeEditorWidget } from '../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js'; +import { IEditorOptions } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { ScrollType } from '../../../common/editorCommon.js'; /* class DecorationsManager implements IDisposable { diff --git a/src/vs/editor/contrib/gotoError/browser/gotoError.ts b/src/vs/editor/contrib/gotoError/browser/gotoError.ts index ae9c8eceb23..1dc7c5833ea 100644 --- a/src/vs/editor/contrib/gotoError/browser/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/browser/gotoError.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Codicon } from 'vs/base/common/codicons'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorCommand, EditorContributionInstantiation, IActionOptions, registerEditorAction, registerEditorCommand, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { IMarkerNavigationService, MarkerList } from 'vs/editor/contrib/gotoError/browser/markerNavigationService'; -import * as nls from 'vs/nls'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IMarker } from 'vs/platform/markers/common/markers'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { MarkerNavigationWidget } from './gotoErrorWidget'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorCommand, EditorContributionInstantiation, IActionOptions, registerEditorAction, registerEditorCommand, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { IMarkerNavigationService, MarkerList } from './markerNavigationService.js'; +import * as nls from '../../../../nls.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { TextEditorSelectionRevealType } from '../../../../platform/editor/common/editor.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IMarker } from '../../../../platform/markers/common/markers.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; +import { MarkerNavigationWidget } from './gotoErrorWidget.js'; export class MarkerController implements IEditorContribution { diff --git a/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts b/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts index 24ffac212bd..b757cfd5de1 100644 --- a/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts +++ b/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts @@ -3,33 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; -import { IAction } from 'vs/base/common/actions'; -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { Color } from 'vs/base/common/color'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore, dispose } from 'vs/base/common/lifecycle'; -import { basename } from 'vs/base/common/resources'; -import { ScrollbarVisibility } from 'vs/base/common/scrollable'; -import { splitLines } from 'vs/base/common/strings'; -import 'vs/css!./media/gotoErrorWidget'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { peekViewTitleForeground, peekViewTitleInfoForeground, PeekViewWidget } from 'vs/editor/contrib/peekView/browser/peekView'; -import * as nls from 'vs/nls'; -import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { IMarker, IRelatedInformation, MarkerSeverity } from 'vs/platform/markers/common/markers'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { SeverityIcon } from 'vs/platform/severityIcon/browser/severityIcon'; -import { contrastBorder, editorBackground, editorErrorBorder, editorErrorForeground, editorInfoBorder, editorInfoForeground, editorWarningBorder, editorWarningForeground, oneOf, registerColor, transparent } from 'vs/platform/theme/common/colorRegistry'; -import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService'; +import * as dom from '../../../../base/browser/dom.js'; +import { ScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js'; +import { IAction } from '../../../../base/common/actions.js'; +import { isNonEmptyArray } from '../../../../base/common/arrays.js'; +import { Color } from '../../../../base/common/color.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { DisposableStore, dispose } from '../../../../base/common/lifecycle.js'; +import { basename } from '../../../../base/common/resources.js'; +import { ScrollbarVisibility } from '../../../../base/common/scrollable.js'; +import { splitLines } from '../../../../base/common/strings.js'; +import './media/gotoErrorWidget.css'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { ScrollType } from '../../../common/editorCommon.js'; +import { peekViewTitleForeground, peekViewTitleInfoForeground, PeekViewWidget } from '../../peekView/browser/peekView.js'; +import * as nls from '../../../../nls.js'; +import { createAndFillInActionBarActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { IMenuService, MenuId } from '../../../../platform/actions/common/actions.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ILabelService } from '../../../../platform/label/common/label.js'; +import { IMarker, IRelatedInformation, MarkerSeverity } from '../../../../platform/markers/common/markers.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import { SeverityIcon } from '../../../../platform/severityIcon/browser/severityIcon.js'; +import { contrastBorder, editorBackground, editorErrorBorder, editorErrorForeground, editorInfoBorder, editorInfoForeground, editorWarningBorder, editorWarningForeground, oneOf, registerColor, transparent } from '../../../../platform/theme/common/colorRegistry.js'; +import { IColorTheme, IThemeService } from '../../../../platform/theme/common/themeService.js'; class MessageWidget { @@ -308,10 +308,9 @@ export class MarkerNavigationWidget extends PeekViewWidget { this._disposables.add(this._actionbarWidget!.actionRunner.onWillRun(e => this.editor.focus())); const actions: IAction[] = []; - const menu = this._menuService.createMenu(MarkerNavigationWidget.TitleMenu, this._contextKeyService); - createAndFillInActionBarActions(menu, undefined, actions); + const menu = this._menuService.getMenuActions(MarkerNavigationWidget.TitleMenu, this._contextKeyService); + createAndFillInActionBarActions(menu, actions); this._actionbarWidget!.push(actions, { label: false, icon: true, index: 0 }); - menu.dispose(); } protected override _fillTitleIcon(container: HTMLElement): void { @@ -410,4 +409,4 @@ const editorMarkerNavigationWarningHeader = registerColor('editorMarkerNavigatio const editorMarkerNavigationInfo = registerColor('editorMarkerNavigationInfo.background', { dark: infoDefault, light: infoDefault, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('editorMarkerNavigationInfo', 'Editor marker navigation widget info color.')); const editorMarkerNavigationInfoHeader = registerColor('editorMarkerNavigationInfo.headerBackground', { dark: transparent(editorMarkerNavigationInfo, .1), light: transparent(editorMarkerNavigationInfo, .1), hcDark: null, hcLight: null }, nls.localize('editorMarkerNavigationInfoHeaderBackground', 'Editor marker navigation widget info heading background.')); -const editorMarkerNavigationBackground = registerColor('editorMarkerNavigation.background', { dark: editorBackground, light: editorBackground, hcDark: editorBackground, hcLight: editorBackground }, nls.localize('editorMarkerNavigationBackground', 'Editor marker navigation widget background.')); +const editorMarkerNavigationBackground = registerColor('editorMarkerNavigation.background', editorBackground, nls.localize('editorMarkerNavigationBackground', 'Editor marker navigation widget background.')); diff --git a/src/vs/editor/contrib/gotoError/browser/markerNavigationService.ts b/src/vs/editor/contrib/gotoError/browser/markerNavigationService.ts index 1162ef145ea..61b92a3e865 100644 --- a/src/vs/editor/contrib/gotoError/browser/markerNavigationService.ts +++ b/src/vs/editor/contrib/gotoError/browser/markerNavigationService.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { binarySearch } from 'vs/base/common/arrays'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { LinkedList } from 'vs/base/common/linkedList'; -import { compare } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IMarker, IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/markers'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { binarySearch } from '../../../../base/common/arrays.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { LinkedList } from '../../../../base/common/linkedList.js'; +import { compare } from '../../../../base/common/strings.js'; +import { URI } from '../../../../base/common/uri.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { ITextModel } from '../../../common/model.js'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js'; +import { IMarker, IMarkerService, MarkerSeverity } from '../../../../platform/markers/common/markers.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; export class MarkerCoordinate { constructor( diff --git a/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.ts b/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.ts index cf1ae295e3c..22e8901bc09 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.ts @@ -3,44 +3,44 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { alert } from 'vs/base/browser/ui/aria/aria'; -import { createCancelablePromise, raceCancellation } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { CodeEditorStateFlag, EditorStateCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/editorState'; -import { IActiveCodeEditor, ICodeEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction2, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget'; -import { EditorOption, GoToLocationValues } from 'vs/editor/common/config/editorOptions'; -import * as corePosition from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ITextModel } from 'vs/editor/common/model'; -import { isLocationLink, Location, LocationLink } from 'vs/editor/common/languages'; -import { ICSEventsService } from 'vs/editor/common/services/csEvents'; -import { ReferencesController } from 'vs/editor/contrib/gotoSymbol/browser/peek/referencesController'; -import { ReferencesModel } from 'vs/editor/contrib/gotoSymbol/browser/referencesModel'; -import { ISymbolNavigationService } from 'vs/editor/contrib/gotoSymbol/browser/symbolNavigation'; -import { MessageController } from 'vs/editor/contrib/message/browser/messageController'; -import { PeekContext } from 'vs/editor/contrib/peekView/browser/peekView'; -import * as nls from 'vs/nls'; -import { IAction2F1RequiredOptions, IAction2Options, ISubmenuItem, MenuId, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { TextEditorSelectionRevealType, TextEditorSelectionSource } from 'vs/platform/editor/common/editor'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IEditorProgressService } from 'vs/platform/progress/common/progress'; -import { getDeclarationsAtPosition, getDefinitionsAtPosition, getImplementationsAtPosition, getReferencesAtPosition, getTypeDefinitionsAtPosition } from './goToSymbol'; -import { IWordAtPosition } from 'vs/editor/common/core/wordHelper'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { Iterable } from 'vs/base/common/iterator'; -import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys'; +import { alert } from '../../../../base/browser/ui/aria/aria.js'; +import { createCancelablePromise, raceCancellation } from '../../../../base/common/async.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { assertType } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { CodeEditorStateFlag, EditorStateCancellationTokenSource } from '../../editorState/browser/editorState.js'; +import { IActiveCodeEditor, ICodeEditor, isCodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction2, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { EmbeddedCodeEditorWidget } from '../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js'; +import { EditorOption, GoToLocationValues } from '../../../common/config/editorOptions.js'; +import * as corePosition from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { ScrollType } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ITextModel } from '../../../common/model.js'; +import { isLocationLink, Location, LocationLink } from '../../../common/languages.js'; +import { ReferencesController } from './peek/referencesController.js'; +import { ReferencesModel } from './referencesModel.js'; +import { ISymbolNavigationService } from './symbolNavigation.js'; +import { MessageController } from '../../message/browser/messageController.js'; +import { PeekContext } from '../../peekView/browser/peekView.js'; +import * as nls from '../../../../nls.js'; +import { IAction2F1RequiredOptions, IAction2Options, ISubmenuItem, MenuId, MenuRegistry, registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { TextEditorSelectionRevealType, TextEditorSelectionSource } from '../../../../platform/editor/common/editor.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { IEditorProgressService } from '../../../../platform/progress/common/progress.js'; +import { getDeclarationsAtPosition, getDefinitionsAtPosition, getImplementationsAtPosition, getReferencesAtPosition, getTypeDefinitionsAtPosition } from './goToSymbol.js'; +import { IWordAtPosition } from '../../../common/core/wordHelper.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { Iterable } from '../../../../base/common/iterator.js'; +import { IsWebContext } from '../../../../platform/contextkey/common/contextkeys.js'; +import { ICSEventsService } from '../../../common/services/csEvents.js'; MenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextPeek, @@ -256,7 +256,7 @@ export abstract class SymbolNavigationAction extends EditorAction2 { export class DefinitionAction extends SymbolNavigationAction { protected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise { - return new ReferencesModel(await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, position, token), nls.localize('def.title', 'Definitions')); + return new ReferencesModel(await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, position, false, token), nls.localize('def.title', 'Definitions')); } protected _getNoResultFoundMessage(info: IWordAtPosition | null): string { @@ -383,7 +383,7 @@ registerAction2(class PeekDefinitionAction extends DefinitionAction { class DeclarationAction extends SymbolNavigationAction { protected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise { - return new ReferencesModel(await getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, position, token), nls.localize('decl.title', 'Declarations')); + return new ReferencesModel(await getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, position, false, token), nls.localize('decl.title', 'Declarations')); } protected _getNoResultFoundMessage(info: IWordAtPosition | null): string { @@ -470,7 +470,7 @@ registerAction2(class PeekDeclarationAction extends DeclarationAction { class TypeDefinitionAction extends SymbolNavigationAction { protected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise { - return new ReferencesModel(await getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, position, token), nls.localize('typedef.title', 'Type Definitions')); + return new ReferencesModel(await getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, position, false, token), nls.localize('typedef.title', 'Type Definitions')); } protected _getNoResultFoundMessage(info: IWordAtPosition | null): string { @@ -556,7 +556,7 @@ registerAction2(class PeekTypeDefinitionAction extends TypeDefinitionAction { class ImplementationAction extends SymbolNavigationAction { protected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise { - return new ReferencesModel(await getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, position, token), nls.localize('impl.title', 'Implementations')); + return new ReferencesModel(await getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, position, false, token), nls.localize('impl.title', 'Implementations')); } protected _getNoResultFoundMessage(info: IWordAtPosition | null): string { @@ -698,7 +698,7 @@ registerAction2(class GoToReferencesAction extends ReferencesAction { } protected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise { - return new ReferencesModel(await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, true, token), nls.localize('ref.title', 'References')); + return new ReferencesModel(await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, true, false, token), nls.localize('ref.title', 'References')); } }); @@ -726,7 +726,7 @@ registerAction2(class PeekReferencesAction extends ReferencesAction { } protected async _getLocationModel(languageFeaturesService: ILanguageFeaturesService, model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise { - return new ReferencesModel(await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, false, token), nls.localize('ref.title', 'References')); + return new ReferencesModel(await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, false, false, token), nls.localize('ref.title', 'References')); } }); @@ -849,7 +849,7 @@ CommandsRegistry.registerCommand({ return undefined; } - const references = createCancelablePromise(token => getReferencesAtPosition(languageFeaturesService.referenceProvider, control.getModel(), corePosition.Position.lift(position), false, token).then(references => new ReferencesModel(references, nls.localize('ref.title', 'References')))); + const references = createCancelablePromise(token => getReferencesAtPosition(languageFeaturesService.referenceProvider, control.getModel(), corePosition.Position.lift(position), false, false, token).then(references => new ReferencesModel(references, nls.localize('ref.title', 'References')))); const range = new Range(position.lineNumber, position.column, position.lineNumber, position.column); return Promise.resolve(controller.toggleWidget(range, references, false)); }); diff --git a/src/vs/editor/contrib/gotoSymbol/browser/goToSymbol.ts b/src/vs/editor/contrib/gotoSymbol/browser/goToSymbol.ts index 738af806684..c76e80dbda7 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/goToSymbol.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/goToSymbol.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce } from 'vs/base/common/arrays'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { matchesSomeScheme, Schemas } from 'vs/base/common/network'; -import { registerModelAndPositionCommand } from 'vs/editor/browser/editorExtensions'; -import { Position } from 'vs/editor/common/core/position'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { DeclarationProvider, DefinitionProvider, ImplementationProvider, LocationLink, ProviderResult, ReferenceProvider, TypeDefinitionProvider } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { ReferencesModel } from 'vs/editor/contrib/gotoSymbol/browser/referencesModel'; +import { coalesce } from '../../../../base/common/arrays.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { matchesSomeScheme, Schemas } from '../../../../base/common/network.js'; +import { registerModelAndPositionCommand } from '../../../browser/editorExtensions.js'; +import { Position } from '../../../common/core/position.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { DeclarationProvider, DefinitionProvider, ImplementationProvider, LocationLink, ProviderResult, ReferenceProvider, TypeDefinitionProvider } from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { ReferencesModel } from './referencesModel.js'; function shouldIncludeLocationLink(sourceModel: ITextModel, loc: LocationLink): boolean { // Always allow the location if the request comes from a document with the same scheme. @@ -22,7 +22,7 @@ function shouldIncludeLocationLink(sourceModel: ITextModel, loc: LocationLink): } // Otherwise filter out locations from internal schemes - if (matchesSomeScheme(loc.uri, Schemas.walkThroughSnippet, Schemas.vscodeChatCodeBlock, Schemas.vscodeChatCodeCompareBlock, Schemas.vscodeCopilotBackingChatCodeBlock)) { + if (matchesSomeScheme(loc.uri, Schemas.walkThroughSnippet, Schemas.vscodeChatCodeBlock, Schemas.vscodeChatCodeCompareBlock)) { return false; } @@ -33,9 +33,10 @@ async function getLocationLinks( model: ITextModel, position: Position, registry: LanguageFeatureRegistry, + recursive: boolean, provide: (provider: T, model: ITextModel, position: Position) => ProviderResult ): Promise { - const provider = registry.ordered(model); + const provider = registry.ordered(model, recursive); // get results const promises = provider.map((provider): Promise => { @@ -49,32 +50,32 @@ async function getLocationLinks( return coalesce(values.flat()).filter(loc => shouldIncludeLocationLink(model, loc)); } -export function getDefinitionsAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, token: CancellationToken): Promise { - return getLocationLinks(model, position, registry, (provider, model, position) => { +export function getDefinitionsAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, recursive: boolean, token: CancellationToken): Promise { + return getLocationLinks(model, position, registry, recursive, (provider, model, position) => { return provider.provideDefinition(model, position, token); }); } -export function getDeclarationsAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, token: CancellationToken): Promise { - return getLocationLinks(model, position, registry, (provider, model, position) => { +export function getDeclarationsAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, recursive: boolean, token: CancellationToken): Promise { + return getLocationLinks(model, position, registry, recursive, (provider, model, position) => { return provider.provideDeclaration(model, position, token); }); } -export function getImplementationsAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, token: CancellationToken): Promise { - return getLocationLinks(model, position, registry, (provider, model, position) => { +export function getImplementationsAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, recursive: boolean, token: CancellationToken): Promise { + return getLocationLinks(model, position, registry, recursive, (provider, model, position) => { return provider.provideImplementation(model, position, token); }); } -export function getTypeDefinitionsAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, token: CancellationToken): Promise { - return getLocationLinks(model, position, registry, (provider, model, position) => { +export function getTypeDefinitionsAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, recursive: boolean, token: CancellationToken): Promise { + return getLocationLinks(model, position, registry, recursive, (provider, model, position) => { return provider.provideTypeDefinition(model, position, token); }); } -export function getReferencesAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, compact: boolean, token: CancellationToken): Promise { - return getLocationLinks(model, position, registry, async (provider, model, position) => { +export function getReferencesAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, compact: boolean, recursive: boolean, token: CancellationToken): Promise { + return getLocationLinks(model, position, registry, recursive, async (provider, model, position) => { const result = (await provider.provideReferences(model, position, { includeDeclaration: true }, token))?.filter(ref => shouldIncludeLocationLink(model, ref)); if (!compact || !result || result.length !== 2) { return result; @@ -99,30 +100,59 @@ async function _sortedAndDeduped(callback: () => Promise): Promi registerModelAndPositionCommand('_executeDefinitionProvider', (accessor, model, position) => { const languageFeaturesService = accessor.get(ILanguageFeaturesService); - const promise = getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, position, CancellationToken.None); + const promise = getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, position, false, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); + +registerModelAndPositionCommand('_executeDefinitionProvider_recursive', (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, position, true, CancellationToken.None); return _sortedAndDeduped(() => promise); }); registerModelAndPositionCommand('_executeTypeDefinitionProvider', (accessor, model, position) => { const languageFeaturesService = accessor.get(ILanguageFeaturesService); - const promise = getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, position, CancellationToken.None); + const promise = getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, position, false, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); + +registerModelAndPositionCommand('_executeTypeDefinitionProvider_recursive', (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, position, true, CancellationToken.None); return _sortedAndDeduped(() => promise); }); registerModelAndPositionCommand('_executeDeclarationProvider', (accessor, model, position) => { const languageFeaturesService = accessor.get(ILanguageFeaturesService); - const promise = getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, position, CancellationToken.None); + const promise = getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, position, false, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); +registerModelAndPositionCommand('_executeDeclarationProvider_recursive', (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, position, true, CancellationToken.None); return _sortedAndDeduped(() => promise); }); registerModelAndPositionCommand('_executeReferenceProvider', (accessor, model, position) => { const languageFeaturesService = accessor.get(ILanguageFeaturesService); - const promise = getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, false, CancellationToken.None); + const promise = getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, false, false, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); + +registerModelAndPositionCommand('_executeReferenceProvider_recursive', (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, false, true, CancellationToken.None); return _sortedAndDeduped(() => promise); }); registerModelAndPositionCommand('_executeImplementationProvider', (accessor, model, position) => { const languageFeaturesService = accessor.get(ILanguageFeaturesService); - const promise = getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, position, CancellationToken.None); + const promise = getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, position, false, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); + +registerModelAndPositionCommand('_executeImplementationProvider_recursive', (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, position, true, CancellationToken.None); return _sortedAndDeduped(() => promise); }); diff --git a/src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.ts b/src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.ts index 2e74af467a9..fb7ab9003ef 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { Emitter, Event } from 'vs/base/common/event'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { Disposable } from 'vs/base/common/lifecycle'; -import * as platform from 'vs/base/common/platform'; -import { ICodeEditor, IEditorMouseEvent, IMouseTarget } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents'; +import { IKeyboardEvent } from '../../../../../base/browser/keyboardEvent.js'; +import { Emitter, Event } from '../../../../../base/common/event.js'; +import { KeyCode } from '../../../../../base/common/keyCodes.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import * as platform from '../../../../../base/common/platform.js'; +import { ICodeEditor, IEditorMouseEvent, IMouseTarget } from '../../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { ICursorSelectionChangedEvent } from '../../../../common/cursorEvents.js'; function hasModifier(e: { ctrlKey: boolean; shiftKey: boolean; altKey: boolean; metaKey: boolean }, modifier: 'ctrlKey' | 'shiftKey' | 'altKey' | 'metaKey'): boolean { return !!e[modifier]; diff --git a/src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.ts b/src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.ts index f5a08f94c1e..6f6f8323e02 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.ts @@ -3,34 +3,34 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { MarkdownString } from 'vs/base/common/htmlContent'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import 'vs/css!./goToDefinitionAtPosition'; -import { CodeEditorStateFlag, EditorState } from 'vs/editor/contrib/editorState/browser/editorState'; -import { ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { IEditorContribution, IEditorDecorationsCollection } from 'vs/editor/common/editorCommon'; -import { IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model'; -import { LocationLink } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { ClickLinkGesture, ClickLinkKeyboardEvent, ClickLinkMouseEvent } from 'vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture'; -import { PeekContext } from 'vs/editor/contrib/peekView/browser/peekView'; -import * as nls from 'vs/nls'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { DefinitionAction } from '../goToCommands'; -import { getDefinitionsAtPosition } from '../goToSymbol'; -import { IWordAtPosition } from 'vs/editor/common/core/wordHelper'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { ModelDecorationInjectedTextOptions } from 'vs/editor/common/model/textModel'; +import { IKeyboardEvent } from '../../../../../base/browser/keyboardEvent.js'; +import { CancelablePromise, createCancelablePromise } from '../../../../../base/common/async.js'; +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { onUnexpectedError } from '../../../../../base/common/errors.js'; +import { MarkdownString } from '../../../../../base/common/htmlContent.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import './goToDefinitionAtPosition.css'; +import { CodeEditorStateFlag, EditorState } from '../../../editorState/browser/editorState.js'; +import { ICodeEditor, MouseTargetType } from '../../../../browser/editorBrowser.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { Position } from '../../../../common/core/position.js'; +import { IRange, Range } from '../../../../common/core/range.js'; +import { IEditorContribution, IEditorDecorationsCollection } from '../../../../common/editorCommon.js'; +import { IModelDeltaDecoration, ITextModel } from '../../../../common/model.js'; +import { LocationLink } from '../../../../common/languages.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { ITextModelService } from '../../../../common/services/resolverService.js'; +import { ClickLinkGesture, ClickLinkKeyboardEvent, ClickLinkMouseEvent } from './clickLinkGesture.js'; +import { PeekContext } from '../../../peekView/browser/peekView.js'; +import * as nls from '../../../../../nls.js'; +import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; +import { ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js'; +import { DefinitionAction } from '../goToCommands.js'; +import { getDefinitionsAtPosition } from '../goToSymbol.js'; +import { IWordAtPosition } from '../../../../common/core/wordHelper.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { ModelDecorationInjectedTextOptions } from '../../../../common/model/textModel.js'; export class GotoDefinitionAtPositionEditorContribution implements IEditorContribution { @@ -297,7 +297,7 @@ export class GotoDefinitionAtPositionEditorContribution implements IEditorContri return Promise.resolve(null); } - return getDefinitionsAtPosition(this.languageFeaturesService.definitionProvider, model, position, token); + return getDefinitionsAtPosition(this.languageFeaturesService.definitionProvider, model, position, false, token); } private gotoDefinition(position: Position, openToSide: boolean): Promise { diff --git a/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.ts b/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.ts index 40d344f3e3a..175e4c8b49c 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.ts @@ -3,32 +3,32 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { Location } from 'vs/editor/common/languages'; -import { getOuterEditor, PeekContext } from 'vs/editor/contrib/peekView/browser/peekView'; -import * as nls from 'vs/nls'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { TextEditorSelectionSource } from 'vs/platform/editor/common/editor'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IListService, WorkbenchListFocusContextKey, WorkbenchTreeElementCanCollapse, WorkbenchTreeElementCanExpand } from 'vs/platform/list/browser/listService'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { OneReference, ReferencesModel } from '../referencesModel'; -import { LayoutData, ReferenceWidget } from './referencesWidget'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { InputFocusedContext } from 'vs/platform/contextkey/common/contextkeys'; +import { CancelablePromise, createCancelablePromise } from '../../../../../base/common/async.js'; +import { onUnexpectedError } from '../../../../../base/common/errors.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../../base/common/keyCodes.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { ICodeEditorService } from '../../../../browser/services/codeEditorService.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { IEditorContribution } from '../../../../common/editorCommon.js'; +import { Location } from '../../../../common/languages.js'; +import { getOuterEditor, PeekContext } from '../../../peekView/browser/peekView.js'; +import * as nls from '../../../../../nls.js'; +import { CommandsRegistry } from '../../../../../platform/commands/common/commands.js'; +import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js'; +import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from '../../../../../platform/contextkey/common/contextkey.js'; +import { TextEditorSelectionSource } from '../../../../../platform/editor/common/editor.js'; +import { IInstantiationService, ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingsRegistry, KeybindingWeight } from '../../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IListService, WorkbenchListFocusContextKey, WorkbenchTreeElementCanCollapse, WorkbenchTreeElementCanExpand } from '../../../../../platform/list/browser/listService.js'; +import { INotificationService } from '../../../../../platform/notification/common/notification.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../../../../platform/storage/common/storage.js'; +import { OneReference, ReferencesModel } from '../referencesModel.js'; +import { LayoutData, ReferenceWidget } from './referencesWidget.js'; +import { EditorContextKeys } from '../../../../common/editorContextKeys.js'; +import { InputFocusedContext } from '../../../../../platform/contextkey/common/contextkeys.js'; export const ctxReferenceSearchVisible = new RawContextKey('referenceSearchVisible', false, nls.localize('referenceSearchVisible', "Whether reference peek is visible, like 'Peek References' or 'Peek Definition'")); @@ -105,9 +105,14 @@ export abstract class ReferencesController implements IEditorContribution { modelPromise.cancel(); if (this._widget) { this._storageService.store(storageKey, JSON.stringify(this._widget.layoutData), StorageScope.PROFILE, StorageTarget.MACHINE); + if (!this._widget.isClosing) { + // to prevent calling this too many times, check whether it was already closing. + this.closeWidget(); + } this._widget = undefined; + } else { + this.closeWidget(); } - this.closeWidget(); })); this._disposables.add(this._widget.onDidSelectReference(event => { diff --git a/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.ts b/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.ts index bb76dd67d6c..15e550cfcfc 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; -import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; -import { IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel'; -import { IIdentityProvider, IKeyboardNavigationLabelProvider, IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; -import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; -import { IAsyncDataSource, ITreeNode, ITreeRenderer } from 'vs/base/browser/ui/tree/tree'; -import { createMatches, FuzzyScore, IMatch } from 'vs/base/common/filters'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { basename, dirname } from 'vs/base/common/resources'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { localize } from 'vs/nls'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { defaultCountBadgeStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { FileReferences, OneReference, ReferencesModel } from '../referencesModel'; +import * as dom from '../../../../../base/browser/dom.js'; +import { IKeyboardEvent } from '../../../../../base/browser/keyboardEvent.js'; +import { CountBadge } from '../../../../../base/browser/ui/countBadge/countBadge.js'; +import { HighlightedLabel } from '../../../../../base/browser/ui/highlightedlabel/highlightedLabel.js'; +import { IconLabel } from '../../../../../base/browser/ui/iconLabel/iconLabel.js'; +import { IIdentityProvider, IKeyboardNavigationLabelProvider, IListVirtualDelegate } from '../../../../../base/browser/ui/list/list.js'; +import { IListAccessibilityProvider } from '../../../../../base/browser/ui/list/listWidget.js'; +import { IAsyncDataSource, ITreeNode, ITreeRenderer } from '../../../../../base/browser/ui/tree/tree.js'; +import { createMatches, FuzzyScore, IMatch } from '../../../../../base/common/filters.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { basename, dirname } from '../../../../../base/common/resources.js'; +import { ITextModelService } from '../../../../common/services/resolverService.js'; +import { localize } from '../../../../../nls.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { ILabelService } from '../../../../../platform/label/common/label.js'; +import { defaultCountBadgeStyles } from '../../../../../platform/theme/browser/defaultStyles.js'; +import { FileReferences, OneReference, ReferencesModel } from '../referencesModel.js'; //#region data source diff --git a/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.ts b/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.ts index 0941671756d..fce167fb08f 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.ts @@ -3,40 +3,37 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { IMouseEvent } from 'vs/base/browser/mouseEvent'; -import { Orientation } from 'vs/base/browser/ui/sash/sash'; -import { Sizing, SplitView } from 'vs/base/browser/ui/splitview/splitview'; -import { Color } from 'vs/base/common/color'; -import { Emitter, Event } from 'vs/base/common/event'; -import { FuzzyScore } from 'vs/base/common/filters'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { DisposableStore, dispose, IDisposable, IReference } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { basenameOrAuthority, dirname } from 'vs/base/common/resources'; -import 'vs/css!./referencesWidget'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget'; -import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions, TextModel } from 'vs/editor/common/model/textModel'; -import { Location } from 'vs/editor/common/languages'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ITextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService'; -import { AccessibilityProvider, DataSource, Delegate, FileReferencesRenderer, IdentityProvider, OneReferenceRenderer, StringRepresentationProvider, TreeElement } from 'vs/editor/contrib/gotoSymbol/browser/peek/referencesTree'; -import * as peekView from 'vs/editor/contrib/peekView/browser/peekView'; -import * as nls from 'vs/nls'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { IWorkbenchAsyncDataTreeOptions, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService'; -import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService'; -import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo'; -import { FileReferences, OneReference, ReferencesModel } from '../referencesModel'; +import * as dom from '../../../../../base/browser/dom.js'; +import { IMouseEvent } from '../../../../../base/browser/mouseEvent.js'; +import { Orientation } from '../../../../../base/browser/ui/sash/sash.js'; +import { Sizing, SplitView } from '../../../../../base/browser/ui/splitview/splitview.js'; +import { Color } from '../../../../../base/common/color.js'; +import { Emitter, Event } from '../../../../../base/common/event.js'; +import { FuzzyScore } from '../../../../../base/common/filters.js'; +import { KeyCode } from '../../../../../base/common/keyCodes.js'; +import { DisposableStore, dispose, IDisposable, IReference } from '../../../../../base/common/lifecycle.js'; +import { Schemas } from '../../../../../base/common/network.js'; +import { basenameOrAuthority, dirname } from '../../../../../base/common/resources.js'; +import './referencesWidget.css'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { EmbeddedCodeEditorWidget } from '../../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js'; +import { IEditorOptions } from '../../../../common/config/editorOptions.js'; +import { IRange, Range } from '../../../../common/core/range.js'; +import { ScrollType } from '../../../../common/editorCommon.js'; +import { IModelDeltaDecoration, TrackedRangeStickiness } from '../../../../common/model.js'; +import { ModelDecorationOptions, TextModel } from '../../../../common/model/textModel.js'; +import { Location } from '../../../../common/languages.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../../../../common/languages/modesRegistry.js'; +import { ITextEditorModel, ITextModelService } from '../../../../common/services/resolverService.js'; +import { AccessibilityProvider, DataSource, Delegate, FileReferencesRenderer, IdentityProvider, OneReferenceRenderer, StringRepresentationProvider, TreeElement } from './referencesTree.js'; +import * as peekView from '../../../peekView/browser/peekView.js'; +import * as nls from '../../../../../nls.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { ILabelService } from '../../../../../platform/label/common/label.js'; +import { IWorkbenchAsyncDataTreeOptions, WorkbenchAsyncDataTree } from '../../../../../platform/list/browser/listService.js'; +import { IColorTheme, IThemeService } from '../../../../../platform/theme/common/themeService.js'; +import { FileReferences, OneReference, ReferencesModel } from '../referencesModel.js'; class DecorationsManager implements IDisposable { @@ -214,6 +211,7 @@ export class ReferenceWidget extends peekView.PeekViewWidget { private _previewContainer!: HTMLElement; private _messageContainer!: HTMLElement; private _dim = new dom.Dimension(0, 0); + private _isClosing = false; // whether or not a dispose is already in progress constructor( editor: ICodeEditor, @@ -224,10 +222,7 @@ export class ReferenceWidget extends peekView.PeekViewWidget { @IInstantiationService private readonly _instantiationService: IInstantiationService, @peekView.IPeekViewService private readonly _peekViewService: peekView.IPeekViewService, @ILabelService private readonly _uriLabel: ILabelService, - @IUndoRedoService private readonly _undoRedoService: IUndoRedoService, @IKeybindingService private readonly _keybindingService: IKeybindingService, - @ILanguageService private readonly _languageService: ILanguageService, - @ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService, ) { super(editor, { showFrame: false, showArrow: true, isResizeable: true, isAccessible: true, supportOnTitleClick: true }, _instantiationService); @@ -237,7 +232,12 @@ export class ReferenceWidget extends peekView.PeekViewWidget { this.create(); } + get isClosing() { + return this._isClosing; + } + override dispose(): void { + this._isClosing = true; this.setModel(undefined); this._callOnDispose.dispose(); this._disposeOnNewModel.dispose(); @@ -315,7 +315,7 @@ export class ReferenceWidget extends peekView.PeekViewWidget { }; this._preview = this._instantiationService.createInstance(EmbeddedCodeEditorWidget, this._previewContainer, options, {}, this.editor); dom.hide(this._previewContainer); - this._previewNotAvailableMessage = new TextModel(nls.localize('missingPreviewMessage', "no preview available"), PLAINTEXT_LANGUAGE_ID, TextModel.DEFAULT_CREATION_OPTIONS, null, this._undoRedoService, this._languageService, this._languageConfigurationService); + this._previewNotAvailableMessage = this._instantiationService.createInstance(TextModel, nls.localize('missingPreviewMessage', "no preview available"), PLAINTEXT_LANGUAGE_ID, TextModel.DEFAULT_CREATION_OPTIONS, null); // tree this._treeContainer = dom.append(containerElement, dom.$('div.ref-tree.inline')); diff --git a/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.ts b/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.ts index 9b52c88aeb8..6248ead0979 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IMatch } from 'vs/base/common/filters'; -import { defaultGenerator } from 'vs/base/common/idGenerator'; -import { dispose, IDisposable, IReference } from 'vs/base/common/lifecycle'; -import { ResourceMap } from 'vs/base/common/map'; -import { basename, extUri } from 'vs/base/common/resources'; -import * as strings from 'vs/base/common/strings'; -import { Constants } from 'vs/base/common/uint'; -import { URI } from 'vs/base/common/uri'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { Location, LocationLink } from 'vs/editor/common/languages'; -import { ITextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService'; -import { localize } from 'vs/nls'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { IMatch } from '../../../../base/common/filters.js'; +import { defaultGenerator } from '../../../../base/common/idGenerator.js'; +import { dispose, IDisposable, IReference } from '../../../../base/common/lifecycle.js'; +import { ResourceMap } from '../../../../base/common/map.js'; +import { basename, extUri } from '../../../../base/common/resources.js'; +import * as strings from '../../../../base/common/strings.js'; +import { Constants } from '../../../../base/common/uint.js'; +import { URI } from '../../../../base/common/uri.js'; +import { Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { Location, LocationLink } from '../../../common/languages.js'; +import { ITextEditorModel, ITextModelService } from '../../../common/services/resolverService.js'; +import { localize } from '../../../../nls.js'; export class OneReference { diff --git a/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.ts b/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.ts index 2c7046f3d31..e02392bdad9 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { combinedDisposable, DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { isEqual } from 'vs/base/common/resources'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorCommand, registerEditorCommand } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { Range } from 'vs/editor/common/core/range'; -import { OneReference, ReferencesModel } from 'vs/editor/contrib/gotoSymbol/browser/referencesModel'; -import { localize } from 'vs/nls'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { INotificationService } from 'vs/platform/notification/common/notification'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { combinedDisposable, DisposableStore, dispose, IDisposable } from '../../../../base/common/lifecycle.js'; +import { isEqual } from '../../../../base/common/resources.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorCommand, registerEditorCommand } from '../../../browser/editorExtensions.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { Range } from '../../../common/core/range.js'; +import { OneReference, ReferencesModel } from './referencesModel.js'; +import { localize } from '../../../../nls.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { TextEditorSelectionRevealType } from '../../../../platform/editor/common/editor.js'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { createDecorator, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { KeybindingsRegistry, KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; export const ctxHasSymbols = new RawContextKey('hasSymbols', false, localize('hasSymbols', "Whether there are symbol locations that can be navigated via keyboard-only.")); diff --git a/src/vs/editor/contrib/gotoSymbol/test/browser/referencesModel.test.ts b/src/vs/editor/contrib/gotoSymbol/test/browser/referencesModel.test.ts index a547f9450e1..58e29282327 100644 --- a/src/vs/editor/contrib/gotoSymbol/test/browser/referencesModel.test.ts +++ b/src/vs/editor/contrib/gotoSymbol/test/browser/referencesModel.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ReferencesModel } from 'vs/editor/contrib/gotoSymbol/browser/referencesModel'; +import { URI } from '../../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { ReferencesModel } from '../../browser/referencesModel.js'; suite('references', function () { diff --git a/src/vs/editor/contrib/gpu/browser/gpuActions.ts b/src/vs/editor/contrib/gpu/browser/gpuActions.ts new file mode 100644 index 00000000000..e029dd3632c --- /dev/null +++ b/src/vs/editor/contrib/gpu/browser/gpuActions.ts @@ -0,0 +1,145 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { URI } from '../../../../base/common/uri.js'; +import { localize } from '../../../../nls.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { IFileService } from '../../../../platform/files/common/files.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; +import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js'; +import type { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, registerEditorAction, type ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { ensureNonNullable } from '../../../browser/gpu/gpuUtils.js'; +import { GlyphRasterizer } from '../../../browser/gpu/raster/glyphRasterizer.js'; +import { ViewGpuContext } from '../../../browser/gpu/viewGpuContext.js'; + +class DebugEditorGpuRendererAction extends EditorAction { + + constructor() { + super({ + id: 'editor.action.debugEditorGpuRenderer', + label: localize('gpuDebug.label', "Developer: Debug Editor GPU Renderer"), + alias: 'Developer: Debug Editor GPU Renderer', + // TODO: Why doesn't `ContextKeyExpr.equals('config:editor.experimentalGpuAcceleration', 'on')` work? + precondition: ContextKeyExpr.true(), + }); + } + + async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise { + const instantiationService = accessor.get(IInstantiationService); + const quickInputService = accessor.get(IQuickInputService); + const choice = await quickInputService.pick([ + { + label: localize('logTextureAtlasStats.label', "Log Texture Atlas Stats"), + id: 'logTextureAtlasStats', + }, + { + label: localize('saveTextureAtlas.label', "Save Texture Atlas"), + id: 'saveTextureAtlas', + }, + { + label: localize('drawGlyph.label', "Draw Glyph"), + id: 'drawGlyph', + }, + ], { canPickMany: false }); + if (!choice) { + return; + } + switch (choice.id) { + case 'logTextureAtlasStats': + instantiationService.invokeFunction(accessor => { + const logService = accessor.get(ILogService); + + const atlas = ViewGpuContext.atlas; + if (!ViewGpuContext.atlas) { + logService.error('No texture atlas found'); + return; + } + + const stats = atlas.getStats(); + logService.info(['Texture atlas stats', ...stats].join('\n\n')); + }); + break; + case 'saveTextureAtlas': + instantiationService.invokeFunction(async accessor => { + const workspaceContextService = accessor.get(IWorkspaceContextService); + const fileService = accessor.get(IFileService); + const folders = workspaceContextService.getWorkspace().folders; + if (folders.length > 0) { + const atlas = ViewGpuContext.atlas; + const promises = []; + for (const [layerIndex, page] of atlas.pages.entries()) { + promises.push(...[ + fileService.writeFile( + URI.joinPath(folders[0].uri, `textureAtlasPage${layerIndex}_actual.png`), + VSBuffer.wrap(new Uint8Array(await (await page.source.convertToBlob()).arrayBuffer())) + ), + fileService.writeFile( + URI.joinPath(folders[0].uri, `textureAtlasPage${layerIndex}_usage.png`), + VSBuffer.wrap(new Uint8Array(await (await page.getUsagePreview()).arrayBuffer())) + ), + ]); + } + await Promise.all(promises); + } + }); + break; + case 'drawGlyph': + instantiationService.invokeFunction(async accessor => { + const configurationService = accessor.get(IConfigurationService); + const fileService = accessor.get(IFileService); + const quickInputService = accessor.get(IQuickInputService); + const workspaceContextService = accessor.get(IWorkspaceContextService); + + const folders = workspaceContextService.getWorkspace().folders; + if (folders.length === 0) { + return; + } + + const atlas = ViewGpuContext.atlas; + const fontFamily = configurationService.getValue('editor.fontFamily'); + const fontSize = configurationService.getValue('editor.fontSize'); + const rasterizer = new GlyphRasterizer(fontSize, fontFamily); + let chars = await quickInputService.input({ + prompt: 'Enter a character to draw (prefix with 0x for code point))' + }); + if (!chars) { + return; + } + const codePoint = chars.match(/0x(?[0-9a-f]+)/i)?.groups?.codePoint; + if (codePoint !== undefined) { + chars = String.fromCodePoint(parseInt(codePoint, 16)); + } + const metadata = 0; + const rasterizedGlyph = atlas.getGlyph(rasterizer, chars, metadata); + if (!rasterizedGlyph) { + return; + } + const imageData = atlas.pages[rasterizedGlyph.pageIndex].source.getContext('2d')?.getImageData( + rasterizedGlyph.x, + rasterizedGlyph.y, + rasterizedGlyph.w, + rasterizedGlyph.h + ); + if (!imageData) { + return; + } + const canvas = new OffscreenCanvas(imageData.width, imageData.height); + const ctx = ensureNonNullable(canvas.getContext('2d')); + ctx.putImageData(imageData, 0, 0); + const blob = await canvas.convertToBlob({ type: 'image/png' }); + const resource = URI.joinPath(folders[0].uri, `glyph_${chars}_${metadata}_${fontSize}px_${fontFamily.replaceAll(/[,\\\/\.'\s]/g, '_')}.png`); + await fileService.writeFile(resource, VSBuffer.wrap(new Uint8Array(await blob.arrayBuffer()))); + }); + break; + } + } +} + +registerEditorAction(DebugEditorGpuRendererAction); diff --git a/src/vs/editor/contrib/hover/browser/contentHoverComputer.ts b/src/vs/editor/contrib/hover/browser/contentHoverComputer.ts index d5d0e6c85fd..c24cc160749 100644 --- a/src/vs/editor/contrib/hover/browser/contentHoverComputer.ts +++ b/src/vs/editor/contrib/hover/browser/contentHoverComputer.ts @@ -3,31 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce } from 'vs/base/common/arrays'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IModelDecoration } from 'vs/editor/common/model'; -import { HoverStartSource, IHoverComputer } from 'vs/editor/contrib/hover/browser/hoverOperation'; -import { HoverAnchor, HoverAnchorType, IEditorHoverParticipant, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { AsyncIterableObject } from 'vs/base/common/async'; - -export class ContentHoverComputer implements IHoverComputer { - - private _anchor: HoverAnchor | null = null; - public get anchor(): HoverAnchor | null { return this._anchor; } - public set anchor(value: HoverAnchor | null) { this._anchor = value; } - - private _shouldFocus: boolean = false; - public get shouldFocus(): boolean { return this._shouldFocus; } - public set shouldFocus(value: boolean) { this._shouldFocus = value; } - - private _source: HoverStartSource = HoverStartSource.Mouse; - public get source(): HoverStartSource { return this._source; } - public set source(value: HoverStartSource) { this._source = value; } +import { coalesce } from '../../../../base/common/arrays.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { IActiveCodeEditor, ICodeEditor } from '../../../browser/editorBrowser.js'; +import { IModelDecoration } from '../../../common/model.js'; +import { HoverStartSource, IHoverComputer } from './hoverOperation.js'; +import { HoverAnchor, HoverAnchorType, IEditorHoverParticipant, IHoverPart } from './hoverTypes.js'; +import { AsyncIterableObject } from '../../../../base/common/async.js'; + +export interface ContentHoverComputerOptions { + shouldFocus: boolean; + anchor: HoverAnchor; + source: HoverStartSource; + insistOnKeepingHoverVisible: boolean; +} - private _insistOnKeepingHoverVisible: boolean = false; - public get insistOnKeepingHoverVisible(): boolean { return this._insistOnKeepingHoverVisible; } - public set insistOnKeepingHoverVisible(value: boolean) { this._insistOnKeepingHoverVisible = value; } +export class ContentHoverComputer implements IHoverComputer { constructor( private readonly _editor: ICodeEditor, @@ -73,8 +64,8 @@ export class ContentHoverComputer implements IHoverComputer { }); } - public computeAsync(token: CancellationToken): AsyncIterableObject { - const anchor = this._anchor; + public computeAsync(options: ContentHoverComputerOptions, token: CancellationToken): AsyncIterableObject { + const anchor = options.anchor; if (!this._editor.hasModel() || !anchor) { return AsyncIterableObject.EMPTY; @@ -92,16 +83,17 @@ export class ContentHoverComputer implements IHoverComputer { ); } - public computeSync(): IHoverPart[] { - if (!this._editor.hasModel() || !this._anchor) { + public computeSync(options: ContentHoverComputerOptions): IHoverPart[] { + if (!this._editor.hasModel()) { return []; } - const lineDecorations = ContentHoverComputer._getLineDecorations(this._editor, this._anchor); + const anchor = options.anchor; + const lineDecorations = ContentHoverComputer._getLineDecorations(this._editor, anchor); let result: IHoverPart[] = []; for (const participant of this._participants) { - result = result.concat(participant.computeSync(this._anchor, lineDecorations)); + result = result.concat(participant.computeSync(anchor, lineDecorations)); } return coalesce(result); diff --git a/src/vs/editor/contrib/hover/browser/contentHoverController.ts b/src/vs/editor/contrib/hover/browser/contentHoverController.ts index 7f49ad50a41..ba56f278b99 100644 --- a/src/vs/editor/contrib/hover/browser/contentHoverController.ts +++ b/src/vs/editor/contrib/hover/browser/contentHoverController.ts @@ -3,395 +3,432 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { TokenizationRegistry } from 'vs/editor/common/languages'; -import { HoverOperation, HoverStartMode, HoverStartSource } from 'vs/editor/contrib/hover/browser/hoverOperation'; -import { HoverAnchor, HoverParticipantRegistry, HoverRangeAnchor, IEditorHoverContext, IEditorHoverParticipant, IHoverPart, IHoverWidget } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { MarkdownHoverParticipant } from 'vs/editor/contrib/hover/browser/markdownHoverParticipant'; -import { InlayHintsHover } from 'vs/editor/contrib/inlayHints/browser/inlayHintsHover'; -import { HoverVerbosityAction } from 'vs/editor/common/standalone/standaloneEnums'; -import { ContentHoverWidget } from 'vs/editor/contrib/hover/browser/contentHoverWidget'; -import { ContentHoverComputer } from 'vs/editor/contrib/hover/browser/contentHoverComputer'; -import { HoverResult } from 'vs/editor/contrib/hover/browser/contentHoverTypes'; -import { Emitter } from 'vs/base/common/event'; -import { ColorHoverParticipant } from 'vs/editor/contrib/colorPicker/browser/colorHoverParticipant'; -import { RenderedContentHover } from 'vs/editor/contrib/hover/browser/contentHoverRendered'; - -export class ContentHoverController extends Disposable implements IHoverWidget { - - private _currentResult: HoverResult | null = null; - - private readonly _computer: ContentHoverComputer; - private readonly _contentHoverWidget: ContentHoverWidget; - private readonly _participants: IEditorHoverParticipant[]; - // TODO@aiday-mar make array of participants, dispatch between them - private readonly _markdownHoverParticipant: MarkdownHoverParticipant | undefined; - private readonly _colorHoverParticipant: ColorHoverParticipant | undefined; - private readonly _hoverOperation: HoverOperation; - - private readonly _onContentsChanged = this._register(new Emitter()); - public readonly onContentsChanged = this._onContentsChanged.event; +import { DECREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID, SHOW_OR_FOCUS_HOVER_ACTION_ID } from './hoverActionIds.js'; +import { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor, IEditorMouseEvent, IPartialEditorMouseEvent } from '../../../browser/editorBrowser.js'; +import { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution, IScrollEvent } from '../../../common/editorCommon.js'; +import { HoverStartMode, HoverStartSource } from './hoverOperation.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IHoverWidget } from './hoverTypes.js'; +import { InlineSuggestionHintsContentWidget } from '../../inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { ResultKind } from '../../../../platform/keybinding/common/keybindingResolver.js'; +import { HoverVerbosityAction } from '../../../common/languages.js'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { isMousePositionWithinElement } from './hoverUtils.js'; +import { ContentHoverWidgetWrapper } from './contentHoverWidgetWrapper.js'; +import './hover.css'; +import { Emitter } from '../../../../base/common/event.js'; + +// sticky hover widget which doesn't disappear on focus out and such +const _sticky = false + // || Boolean("true") // done "weirdly" so that a lint warning prevents you from pushing this + ; + +interface IHoverSettings { + readonly enabled: boolean; + readonly sticky: boolean; + readonly hidingDelay: number; +} + +interface IHoverState { + mouseDown: boolean; + activatedByDecoratorClick: boolean; +} + +export class ContentHoverController extends Disposable implements IEditorContribution { + + private readonly _onHoverContentsChanged = this._register(new Emitter()); + public readonly onHoverContentsChanged = this._onHoverContentsChanged.event; + + public static readonly ID = 'editor.contrib.contentHover'; + + public shouldKeepOpenOnEditorMouseMoveOrLeave: boolean = false; + + private readonly _listenersStore = new DisposableStore(); + + private _contentWidget: ContentHoverWidgetWrapper | undefined; + + private _mouseMoveEvent: IEditorMouseEvent | undefined; + private _reactToEditorMouseMoveRunner: RunOnceScheduler; + + private _hoverSettings!: IHoverSettings; + private _hoverState: IHoverState = { + mouseDown: false, + activatedByDecoratorClick: false + }; constructor( private readonly _editor: ICodeEditor, @IInstantiationService private readonly _instantiationService: IInstantiationService, - @IKeybindingService private readonly _keybindingService: IKeybindingService, + @IKeybindingService private readonly _keybindingService: IKeybindingService ) { super(); - this._contentHoverWidget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor)); - const initializedParticipants = this._initializeHoverParticipants(); - this._participants = initializedParticipants.participants; - this._markdownHoverParticipant = initializedParticipants.markdownHoverParticipant; - this._colorHoverParticipant = initializedParticipants.colorHoverParticipant; - this._computer = new ContentHoverComputer(this._editor, this._participants); - this._hoverOperation = this._register(new HoverOperation(this._editor, this._computer)); - this._registerListeners(); - } - - private _initializeHoverParticipants(): { participants: IEditorHoverParticipant[]; markdownHoverParticipant: MarkdownHoverParticipant | undefined; colorHoverParticipant: ColorHoverParticipant | undefined } { - const participants: IEditorHoverParticipant[] = []; - let markdownHoverParticipant: MarkdownHoverParticipant | undefined; - let colorHoverParticipant: ColorHoverParticipant | undefined; - for (const participant of HoverParticipantRegistry.getAll()) { - const participantInstance = this._instantiationService.createInstance(participant, this._editor); - if (participantInstance instanceof MarkdownHoverParticipant && !(participantInstance instanceof InlayHintsHover)) { - markdownHoverParticipant = participantInstance; + this._reactToEditorMouseMoveRunner = this._register( + new RunOnceScheduler( + () => this._reactToEditorMouseMove(this._mouseMoveEvent), 0 + ) + ); + this._hookListeners(); + this._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { + if (e.hasChanged(EditorOption.hover)) { + this._unhookListeners(); + this._hookListeners(); } - if (participantInstance instanceof ColorHoverParticipant) { - colorHoverParticipant = participantInstance; - } - participants.push(participantInstance); - } - participants.sort((p1, p2) => p1.hoverOrdinal - p2.hoverOrdinal); - this._register(this._contentHoverWidget.onDidResize(() => { - this._participants.forEach(participant => participant.handleResize?.()); })); - return { participants, markdownHoverParticipant, colorHoverParticipant }; } - private _registerListeners(): void { - this._register(this._hoverOperation.onResult((result) => { - if (!this._computer.anchor) { - // invalid state, ignore result - return; - } - const messages = (result.hasLoadingMessage ? this._addLoadingMessage(result.value) : result.value); - this._withResult(new HoverResult(this._computer.anchor, messages, result.isComplete)); - })); - this._register(dom.addStandardDisposableListener(this._contentHoverWidget.getDomNode(), 'keydown', (e) => { - if (e.equals(KeyCode.Escape)) { - this.hide(); - } - })); - this._register(TokenizationRegistry.onDidChange(() => { - if (this._contentHoverWidget.position && this._currentResult) { - this._setCurrentResult(this._currentResult); // render again - } + static get(editor: ICodeEditor): ContentHoverController | null { + return editor.getContribution(ContentHoverController.ID); + } + + private _hookListeners(): void { + + const hoverOpts = this._editor.getOption(EditorOption.hover); + this._hoverSettings = { + enabled: hoverOpts.enabled, + sticky: hoverOpts.sticky, + hidingDelay: hoverOpts.hidingDelay + }; + + if (hoverOpts.enabled) { + this._listenersStore.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e))); + this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())); + this._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e))); + this._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e))); + } else { + this._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e))); + this._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e))); + } + + this._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e))); + this._listenersStore.add(this._editor.onDidChangeModel(() => { + this._cancelScheduler(); + this._hideWidgets(); })); + this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())); + this._listenersStore.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e))); } - /** - * Returns true if the hover shows now or will show. - */ - private _startShowingOrUpdateHover( - anchor: HoverAnchor | null, - mode: HoverStartMode, - source: HoverStartSource, - focus: boolean, - mouseEvent: IEditorMouseEvent | null - ): boolean { - const contentHoverIsVisible = this._contentHoverWidget.position && this._currentResult; - if (!contentHoverIsVisible) { - if (anchor) { - this._startHoverOperationIfNecessary(anchor, mode, source, focus, false); - return true; - } - return false; + private _unhookListeners(): void { + this._listenersStore.clear(); + } + + private _cancelScheduler() { + this._mouseMoveEvent = undefined; + this._reactToEditorMouseMoveRunner.cancel(); + } + + private _onEditorScrollChanged(e: IScrollEvent): void { + if (e.scrollTopChanged || e.scrollLeftChanged) { + this._hideWidgets(); } - const isHoverSticky = this._editor.getOption(EditorOption.hover).sticky; - const isMouseGettingCloser = mouseEvent && this._contentHoverWidget.isMouseGettingCloser(mouseEvent.event.posx, mouseEvent.event.posy); - const isHoverStickyAndIsMouseGettingCloser = isHoverSticky && isMouseGettingCloser; - // The mouse is getting closer to the hover, so we will keep the hover untouched - // But we will kick off a hover update at the new anchor, insisting on keeping the hover visible. - if (isHoverStickyAndIsMouseGettingCloser) { - if (anchor) { - this._startHoverOperationIfNecessary(anchor, mode, source, focus, true); - } - return true; + } + + private _onEditorMouseDown(mouseEvent: IEditorMouseEvent): void { + + this._hoverState.mouseDown = true; + + const shouldNotHideCurrentHoverWidget = this._shouldNotHideCurrentHoverWidget(mouseEvent); + if (shouldNotHideCurrentHoverWidget) { + return; } - // If mouse is not getting closer and anchor not defined, hide the hover - if (!anchor) { - this._setCurrentResult(null); - return false; + + this._hideWidgets(); + } + + private _shouldNotHideCurrentHoverWidget(mouseEvent: IPartialEditorMouseEvent): boolean { + return this._isMouseOnContentHoverWidget(mouseEvent) || this._isContentWidgetResizing(); + } + + private _isMouseOnContentHoverWidget(mouseEvent: IPartialEditorMouseEvent): boolean { + const contentWidgetNode = this._contentWidget?.getDomNode(); + if (contentWidgetNode) { + return isMousePositionWithinElement(contentWidgetNode, mouseEvent.event.posx, mouseEvent.event.posy); } - // If mouse if not getting closer and anchor is defined, and the new anchor is the same as the previous anchor - const currentAnchorEqualsPreviousAnchor = this._currentResult!.anchor.equals(anchor); - if (currentAnchorEqualsPreviousAnchor) { - return true; + return false; + } + + private _onEditorMouseUp(): void { + this._hoverState.mouseDown = false; + } + + private _onEditorMouseLeave(mouseEvent: IPartialEditorMouseEvent): void { + if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) { + return; + } + + this._cancelScheduler(); + + const shouldNotHideCurrentHoverWidget = this._shouldNotHideCurrentHoverWidget(mouseEvent); + if (shouldNotHideCurrentHoverWidget) { + return; } - // If mouse if not getting closer and anchor is defined, and the new anchor is not compatible with the previous anchor - const currentAnchorCompatibleWithPreviousAnchor = anchor.canAdoptVisibleHover(this._currentResult!.anchor, this._contentHoverWidget.position); - if (!currentAnchorCompatibleWithPreviousAnchor) { - this._setCurrentResult(null); - this._startHoverOperationIfNecessary(anchor, mode, source, focus, false); - return true; + if (_sticky) { + return; } - // We aren't getting any closer to the hover, so we will filter existing results - // and keep those which also apply to the new anchor. - this._setCurrentResult(this._currentResult!.filter(anchor)); - this._startHoverOperationIfNecessary(anchor, mode, source, focus, false); - return true; + this._hideWidgets(); } - private _startHoverOperationIfNecessary(anchor: HoverAnchor, mode: HoverStartMode, source: HoverStartSource, focus: boolean, insistOnKeepingHoverVisible: boolean): void { - const currentAnchorEqualToPreviousHover = this._computer.anchor && this._computer.anchor.equals(anchor); - if (currentAnchorEqualToPreviousHover) { + private _shouldNotRecomputeCurrentHoverWidget(mouseEvent: IEditorMouseEvent): boolean { + + const isHoverSticky = this._hoverSettings.sticky; + + const isMouseOnStickyContentHoverWidget = (mouseEvent: IEditorMouseEvent, isHoverSticky: boolean): boolean => { + const isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent); + return isHoverSticky && isMouseOnContentHoverWidget; + }; + const isMouseOnColorPicker = (mouseEvent: IEditorMouseEvent): boolean => { + const isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent); + const isColorPickerVisible = this._contentWidget?.isColorPickerVisible ?? false; + return isMouseOnContentHoverWidget && isColorPickerVisible; + }; + // TODO@aiday-mar verify if the following is necessary code + const isTextSelectedWithinContentHoverWidget = (mouseEvent: IEditorMouseEvent, sticky: boolean): boolean => { + return (sticky + && this._contentWidget?.containsNode(mouseEvent.event.browserEvent.view?.document.activeElement) + && !mouseEvent.event.browserEvent.view?.getSelection()?.isCollapsed) ?? false; + }; + + return isMouseOnStickyContentHoverWidget(mouseEvent, isHoverSticky) + || isMouseOnColorPicker(mouseEvent) + || isTextSelectedWithinContentHoverWidget(mouseEvent, isHoverSticky); + } + + private _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { + if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) { return; } - this._hoverOperation.cancel(); - this._computer.anchor = anchor; - this._computer.shouldFocus = focus; - this._computer.source = source; - this._computer.insistOnKeepingHoverVisible = insistOnKeepingHoverVisible; - this._hoverOperation.start(mode); - } - - private _setCurrentResult(hoverResult: HoverResult | null): void { - let currentHoverResult = hoverResult; - const currentResultEqualToPreviousResult = this._currentResult === currentHoverResult; - if (currentResultEqualToPreviousResult) { + + this._mouseMoveEvent = mouseEvent; + if (this._contentWidget?.isFocused || this._contentWidget?.isResizing) { return; } - const currentHoverResultIsEmpty = currentHoverResult && currentHoverResult.hoverParts.length === 0; - if (currentHoverResultIsEmpty) { - currentHoverResult = null; - } - this._currentResult = currentHoverResult; - if (this._currentResult) { - this._showHover(this._currentResult); - } else { - this._hideHover(); + const sticky = this._hoverSettings.sticky; + if (sticky && this._contentWidget?.isVisibleFromKeyboard) { + // Sticky mode is on and the hover has been shown via keyboard + // so moving the mouse has no effect + return; } - } - private _addLoadingMessage(result: IHoverPart[]): IHoverPart[] { - if (!this._computer.anchor) { - return result; + const shouldNotRecomputeCurrentHoverWidget = this._shouldNotRecomputeCurrentHoverWidget(mouseEvent); + if (shouldNotRecomputeCurrentHoverWidget) { + this._reactToEditorMouseMoveRunner.cancel(); + return; } - for (const participant of this._participants) { - if (!participant.createLoadingMessage) { - continue; - } - const loadingMessage = participant.createLoadingMessage(this._computer.anchor); - if (!loadingMessage) { - continue; + + const hidingDelay = this._hoverSettings.hidingDelay; + const isContentHoverWidgetVisible = this._contentWidget?.isVisible; + // If the mouse is not over the widget, and if sticky is on, + // then give it a grace period before reacting to the mouse event + const shouldRescheduleHoverComputation = isContentHoverWidgetVisible && sticky && hidingDelay > 0; + + if (shouldRescheduleHoverComputation) { + if (!this._reactToEditorMouseMoveRunner.isScheduled()) { + this._reactToEditorMouseMoveRunner.schedule(hidingDelay); } - return result.slice(0).concat([loadingMessage]); + return; } - return result; + this._reactToEditorMouseMove(mouseEvent); } - private _withResult(hoverResult: HoverResult): void { - const previousHoverIsVisibleWithCompleteResult = this._contentHoverWidget.position && this._currentResult && this._currentResult.isComplete; - if (!previousHoverIsVisibleWithCompleteResult) { - this._setCurrentResult(hoverResult); - } - // The hover is visible with a previous complete result. - const isCurrentHoverResultComplete = hoverResult.isComplete; - if (!isCurrentHoverResultComplete) { - // Instead of rendering the new partial result, we wait for the result to be complete. + private _reactToEditorMouseMove(mouseEvent: IEditorMouseEvent | undefined): void { + + if (!mouseEvent) { return; } - const currentHoverResultIsEmpty = hoverResult.hoverParts.length === 0; - const insistOnKeepingPreviousHoverVisible = this._computer.insistOnKeepingHoverVisible; - const shouldKeepPreviousHoverVisible = currentHoverResultIsEmpty && insistOnKeepingPreviousHoverVisible; - if (shouldKeepPreviousHoverVisible) { - // The hover would now hide normally, so we'll keep the previous messages + + const target = mouseEvent.target; + const mouseOnDecorator = target.element?.classList.contains('colorpicker-color-decoration'); + const decoratorActivatedOn = this._editor.getOption(EditorOption.colorDecoratorsActivatedOn); + + const enabled = this._hoverSettings.enabled; + const activatedByDecoratorClick = this._hoverState.activatedByDecoratorClick; + if ( + ( + mouseOnDecorator && ( + (decoratorActivatedOn === 'click' && !activatedByDecoratorClick) || + (decoratorActivatedOn === 'hover' && !enabled && !_sticky) || + (decoratorActivatedOn === 'clickAndHover' && !enabled && !activatedByDecoratorClick)) + ) || ( + !mouseOnDecorator && !enabled && !activatedByDecoratorClick + ) + ) { + this._hideWidgets(); return; } - this._setCurrentResult(hoverResult); - } - private _showHover(hoverResult: HoverResult): void { - const context = this._getHoverContext(); - const renderedHover = new RenderedContentHover(this._editor, hoverResult, this._participants, this._computer, context, this._keybindingService); - if (renderedHover.domNodeHasChildren) { - this._contentHoverWidget.show(renderedHover); - } else { - renderedHover.dispose(); + const contentHoverShowsOrWillShow = this._tryShowHoverWidget(mouseEvent); + if (contentHoverShowsOrWillShow) { + return; } - } - private _hideHover(): void { - this._contentHoverWidget.hide(); + if (_sticky) { + return; + } + this._hideWidgets(); } - private _getHoverContext(): IEditorHoverContext { - const hide = () => { - this.hide(); - }; - const onContentsChanged = () => { - this._onContentsChanged.fire(); - this._contentHoverWidget.onContentsChanged(); - }; - const setMinimumDimensions = (dimensions: dom.Dimension) => { - this._contentHoverWidget.setMinimumDimensions(dimensions); - }; - return { hide, onContentsChanged, setMinimumDimensions }; + private _tryShowHoverWidget(mouseEvent: IEditorMouseEvent): boolean { + const contentWidget: IHoverWidget = this._getOrCreateContentWidget(); + return contentWidget.showsOrWillShow(mouseEvent); } - - public showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean { - const isContentWidgetResizing = this._contentHoverWidget.isResizing; - if (isContentWidgetResizing) { - return true; + private _onKeyDown(e: IKeyboardEvent): void { + if (!this._editor.hasModel()) { + return; } - const anchorCandidates: HoverAnchor[] = this._findHoverAnchorCandidates(mouseEvent); - const anchorCandidatesExist = anchorCandidates.length > 0; - if (!anchorCandidatesExist) { - return this._startShowingOrUpdateHover(null, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent); + + const resolvedKeyboardEvent = this._keybindingService.softDispatch(e, this._editor.getDomNode()); + + // If the beginning of a multi-chord keybinding is pressed, + // or the command aims to focus the hover, + // set the variable to true, otherwise false + const shouldKeepHoverVisible = ( + resolvedKeyboardEvent.kind === ResultKind.MoreChordsNeeded || + (resolvedKeyboardEvent.kind === ResultKind.KbFound + && (resolvedKeyboardEvent.commandId === SHOW_OR_FOCUS_HOVER_ACTION_ID + || resolvedKeyboardEvent.commandId === INCREASE_HOVER_VERBOSITY_ACTION_ID + || resolvedKeyboardEvent.commandId === DECREASE_HOVER_VERBOSITY_ACTION_ID) + && this._contentWidget?.isVisible + ) + ); + + if ( + e.keyCode === KeyCode.Ctrl + || e.keyCode === KeyCode.Alt + || e.keyCode === KeyCode.Meta + || e.keyCode === KeyCode.Shift + || shouldKeepHoverVisible + ) { + // Do not hide hover when a modifier key is pressed + return; } - const anchor = anchorCandidates[0]; - return this._startShowingOrUpdateHover(anchor, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent); + + this._hideWidgets(); } - private _findHoverAnchorCandidates(mouseEvent: IEditorMouseEvent): HoverAnchor[] { - const anchorCandidates: HoverAnchor[] = []; - for (const participant of this._participants) { - if (!participant.suggestHoverAnchor) { - continue; - } - const anchor = participant.suggestHoverAnchor(mouseEvent); - if (!anchor) { - continue; - } - anchorCandidates.push(anchor); + private _hideWidgets(): void { + if (_sticky) { + return; } - const target = mouseEvent.target; - switch (target.type) { - case MouseTargetType.CONTENT_TEXT: { - anchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy)); - break; - } - case MouseTargetType.CONTENT_EMPTY: { - const epsilon = this._editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth / 2; - // Let hover kick in even when the mouse is technically in the empty area after a line, given the distance is small enough - const mouseIsWithinLinesAndCloseToHover = !target.detail.isAfterLines - && typeof target.detail.horizontalDistanceToText === 'number' - && target.detail.horizontalDistanceToText < epsilon; - if (!mouseIsWithinLinesAndCloseToHover) { - break; - } - anchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy)); - break; - } + if (( + this._hoverState.mouseDown + && this._contentWidget?.isColorPickerVisible + ) || InlineSuggestionHintsContentWidget.dropDownVisible) { + return; } - anchorCandidates.sort((a, b) => b.priority - a.priority); - return anchorCandidates; + this._hoverState.activatedByDecoratorClick = false; + this._contentWidget?.hide(); } - public startShowingAtRange(range: Range, mode: HoverStartMode, source: HoverStartSource, focus: boolean): void { - this._startShowingOrUpdateHover(new HoverRangeAnchor(0, range, undefined, undefined), mode, source, focus, null); + private _getOrCreateContentWidget(): ContentHoverWidgetWrapper { + if (!this._contentWidget) { + this._contentWidget = this._instantiationService.createInstance(ContentHoverWidgetWrapper, this._editor); + this._listenersStore.add(this._contentWidget.onContentsChanged(() => this._onHoverContentsChanged.fire())); + } + return this._contentWidget; } - public async updateMarkdownHoverVerbosityLevel(action: HoverVerbosityAction, index?: number, focus?: boolean): Promise { - this._markdownHoverParticipant?.updateMarkdownHoverVerbosityLevel(action, index, focus); + public hideContentHover(): void { + this._hideWidgets(); } - public focusedMarkdownHoverIndex(): number { - return this._markdownHoverParticipant?.focusedMarkdownHoverIndex() ?? -1; + public showContentHover( + range: Range, + mode: HoverStartMode, + source: HoverStartSource, + focus: boolean, + activatedByColorDecoratorClick: boolean = false + ): void { + this._hoverState.activatedByDecoratorClick = activatedByColorDecoratorClick; + this._getOrCreateContentWidget().startShowingAtRange(range, mode, source, focus); } - public markdownHoverContentAtIndex(index: number): string { - return this._markdownHoverParticipant?.markdownHoverContentAtIndex(index) ?? ''; + private _isContentWidgetResizing(): boolean { + return this._contentWidget?.widget.isResizing || false; } - public doesMarkdownHoverAtIndexSupportVerbosityAction(index: number, action: HoverVerbosityAction): boolean { - return this._markdownHoverParticipant?.doesMarkdownHoverAtIndexSupportVerbosityAction(index, action) ?? false; + public focusedHoverPartIndex(): number { + return this._getOrCreateContentWidget().focusedHoverPartIndex(); } - public getWidgetContent(): string | undefined { - const node = this._contentHoverWidget.getDomNode(); - if (!node.textContent) { - return undefined; - } - return node.textContent; + public doesHoverAtIndexSupportVerbosityAction(index: number, action: HoverVerbosityAction): boolean { + return this._getOrCreateContentWidget().doesHoverAtIndexSupportVerbosityAction(index, action); } - public containsNode(node: Node | null | undefined): boolean { - return (node ? this._contentHoverWidget.getDomNode().contains(node) : false); + public updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): void { + this._getOrCreateContentWidget().updateHoverVerbosityLevel(action, index, focus); } public focus(): void { - this._contentHoverWidget.focus(); + this._contentWidget?.focus(); + } + + public focusHoverPartWithIndex(index: number): void { + this._contentWidget?.focusHoverPartWithIndex(index); } public scrollUp(): void { - this._contentHoverWidget.scrollUp(); + this._contentWidget?.scrollUp(); } public scrollDown(): void { - this._contentHoverWidget.scrollDown(); + this._contentWidget?.scrollDown(); } public scrollLeft(): void { - this._contentHoverWidget.scrollLeft(); + this._contentWidget?.scrollLeft(); } public scrollRight(): void { - this._contentHoverWidget.scrollRight(); + this._contentWidget?.scrollRight(); } public pageUp(): void { - this._contentHoverWidget.pageUp(); + this._contentWidget?.pageUp(); } public pageDown(): void { - this._contentHoverWidget.pageDown(); + this._contentWidget?.pageDown(); } public goToTop(): void { - this._contentHoverWidget.goToTop(); + this._contentWidget?.goToTop(); } public goToBottom(): void { - this._contentHoverWidget.goToBottom(); + this._contentWidget?.goToBottom(); } - public hide(): void { - this._computer.anchor = null; - this._hoverOperation.cancel(); - this._setCurrentResult(null); - } - - public get isColorPickerVisible(): boolean { - return this._colorHoverParticipant?.isColorPickerVisible() ?? false; + public getWidgetContent(): string | undefined { + return this._contentWidget?.getWidgetContent(); } - public get isVisibleFromKeyboard(): boolean { - return this._contentHoverWidget.isVisibleFromKeyboard; + public getAccessibleWidgetContent(): string | undefined { + return this._contentWidget?.getAccessibleWidgetContent(); } - public get isVisible(): boolean { - return this._contentHoverWidget.isVisible; + public getAccessibleWidgetContentAtIndex(index: number): string | undefined { + return this._contentWidget?.getAccessibleWidgetContentAtIndex(index); } - public get isFocused(): boolean { - return this._contentHoverWidget.isFocused; + public get isColorPickerVisible(): boolean | undefined { + return this._contentWidget?.isColorPickerVisible; } - public get isResizing(): boolean { - return this._contentHoverWidget.isResizing; + public get isHoverVisible(): boolean | undefined { + return this._contentWidget?.isVisible; } - public get widget() { - return this._contentHoverWidget; + public override dispose(): void { + super.dispose(); + this._unhookListeners(); + this._listenersStore.dispose(); + this._contentWidget?.dispose(); } } diff --git a/src/vs/editor/contrib/hover/browser/contentHoverRendered.ts b/src/vs/editor/contrib/hover/browser/contentHoverRendered.ts index 5d9c6f52c8c..af9f9f7397b 100644 --- a/src/vs/editor/contrib/hover/browser/contentHoverRendered.ts +++ b/src/vs/editor/contrib/hover/browser/contentHoverRendered.ts @@ -3,17 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ContentHoverComputer } from 'vs/editor/contrib/hover/browser/contentHoverComputer'; -import { EditorHoverStatusBar } from 'vs/editor/contrib/hover/browser/contentHoverStatusBar'; -import { HoverStartSource } from 'vs/editor/contrib/hover/browser/hoverOperation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { HoverResult } from 'vs/editor/contrib/hover/browser/contentHoverTypes'; +import { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { EditorHoverStatusBar } from './contentHoverStatusBar.js'; +import { HoverStartSource } from './hoverOperation.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { ContentHoverResult } from './contentHoverTypes.js'; +import * as dom from '../../../../base/browser/dom.js'; +import { HoverVerbosityAction } from '../../../common/languages.js'; +import { MarkdownHoverParticipant } from './markdownHoverParticipant.js'; +import { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js'; +import { localize } from '../../../../nls.js'; +import { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js'; +import { BugIndicatingError } from '../../../../base/common/errors.js'; +import { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js'; export class RenderedContentHover extends Disposable { @@ -31,30 +38,30 @@ export class RenderedContentHover extends Disposable { constructor( editor: ICodeEditor, - hoverResult: HoverResult, + hoverResult: ContentHoverResult, participants: IEditorHoverParticipant[], - computer: ContentHoverComputer, context: IEditorHoverContext, keybindingService: IKeybindingService ) { super(); - const anchor = hoverResult.anchor; const parts = hoverResult.hoverParts; this._renderedHoverParts = this._register(new RenderedContentHoverParts( editor, participants, parts, - context, - keybindingService + keybindingService, + context )); + const contentHoverComputerOptions = hoverResult.options; + const anchor = contentHoverComputerOptions.anchor; const { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts); this.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent); this.showAtPosition = showAtPosition; this.showAtSecondaryPosition = showAtSecondaryPosition; this.initialMousePosX = anchor.initialMousePosX; this.initialMousePosY = anchor.initialMousePosY; - this.shouldFocus = computer.shouldFocus; - this.source = computer.source; + this.shouldFocus = contentHoverComputerOptions.shouldFocus; + this.source = contentHoverComputerOptions.source; } public get domNode(): DocumentFragment { @@ -65,6 +72,34 @@ export class RenderedContentHover extends Disposable { return this._renderedHoverParts.domNodeHasChildren; } + public get focusedHoverPartIndex(): number { + return this._renderedHoverParts.focusedHoverPartIndex; + } + + public focusHoverPartWithIndex(index: number): void { + this._renderedHoverParts.focusHoverPartWithIndex(index); + } + + public getAccessibleWidgetContent(): string { + return this._renderedHoverParts.getAccessibleContent(); + } + + public getAccessibleWidgetContentAtIndex(index: number): string { + return this._renderedHoverParts.getAccessibleHoverContentAtIndex(index); + } + + public async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise { + this._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus); + } + + public doesHoverAtIndexSupportVerbosityAction(index: number, action: HoverVerbosityAction): boolean { + return this._renderedHoverParts.doesHoverAtIndexSupportVerbosityAction(index, action); + } + + public isColorPickerVisible(): boolean { + return this._renderedHoverParts.isColorPickerVisible(); + } + public static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } { let startColumnBoundary = 1; @@ -116,6 +151,61 @@ export class RenderedContentHover extends Disposable { } } +interface IRenderedContentHoverPart { + /** + * Type of rendered part + */ + type: 'hoverPart'; + /** + * Participant of the rendered hover part + */ + participant: IEditorHoverParticipant; + /** + * The rendered hover part + */ + hoverPart: IHoverPart; + /** + * The HTML element containing the hover status bar. + */ + hoverElement: HTMLElement; +} + +interface IRenderedContentStatusBar { + /** + * Type of rendered part + */ + type: 'statusBar'; + /** + * The HTML element containing the hover status bar. + */ + hoverElement: HTMLElement; + /** + * The actions of the hover status bar. + */ + actions: HoverAction[]; +} + +type IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar; + +class RenderedStatusBar implements IDisposable { + + constructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) { + fragment.appendChild(this._statusBar.hoverElement); + } + + get hoverElement(): HTMLElement { + return this._statusBar.hoverElement; + } + + get actions(): HoverAction[] { + return this._statusBar.actions; + } + + dispose() { + this._statusBar.dispose(); + } +} + class RenderedContentHoverParts extends Disposable { private static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({ @@ -123,27 +213,31 @@ class RenderedContentHoverParts extends Disposable { className: 'hoverHighlight' }); - private readonly _participants: IEditorHoverParticipant[]; + private readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = []; private readonly _fragment: DocumentFragment; + private readonly _context: IEditorHoverContext; + + private _markdownHoverParticipant: MarkdownHoverParticipant | undefined; + private _colorHoverParticipant: HoverColorPickerParticipant | undefined; + private _focusedHoverPartIndex: number = -1; constructor( editor: ICodeEditor, participants: IEditorHoverParticipant[], hoverParts: IHoverPart[], - context: IEditorHoverContext, - keybindingService: IKeybindingService + keybindingService: IKeybindingService, + context: IEditorHoverContext ) { super(); - this._participants = participants; + this._context = context; this._fragment = document.createDocumentFragment(); - const statusBar = new EditorHoverStatusBar(keybindingService); - const hoverContext: IEditorHoverRenderContext = { fragment: this._fragment, statusBar, ...context }; - this._register(this._renderHoverParts(hoverContext, hoverParts)); - this._register(this._renderStatusBar(this._fragment, statusBar)); - this._register(this._addEditorDecorations(editor, hoverParts)); + this._register(this._renderParts(participants, hoverParts, context, keybindingService)); + this._register(this._registerListenersOnRenderedParts()); + this._register(this._createEditorDecorations(editor, hoverParts)); + this._updateMarkdownAndColorParticipantInfo(participants); } - private _addEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable { + private _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable { if (hoverParts.length === 0) { return Disposable.None; } @@ -162,25 +256,169 @@ class RenderedContentHoverParts extends Disposable { }); } - private _renderHoverParts(context: IEditorHoverRenderContext, hoverParts: IHoverPart[]): IDisposable { + private _renderParts(participants: IEditorHoverParticipant[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService): IDisposable { + const statusBar = new EditorHoverStatusBar(keybindingService); + const hoverRenderingContext: IEditorHoverRenderContext = { + fragment: this._fragment, + statusBar, + ...hoverContext + }; const disposables = new DisposableStore(); - for (const participant of this._participants) { - const hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant); - const hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0; - if (!hasHoverPartsForParticipant) { - continue; + for (const participant of participants) { + const renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext); + disposables.add(renderedHoverParts); + for (const renderedHoverPart of renderedHoverParts.renderedHoverParts) { + this._renderedParts.push({ + type: 'hoverPart', + participant, + hoverPart: renderedHoverPart.hoverPart, + hoverElement: renderedHoverPart.hoverElement, + }); } - disposables.add(participant.renderHoverParts(context, hoverPartsForParticipant)); } - return disposables; + const renderedStatusBar = this._renderStatusBar(this._fragment, statusBar); + if (renderedStatusBar) { + disposables.add(renderedStatusBar); + this._renderedParts.push({ + type: 'statusBar', + hoverElement: renderedStatusBar.hoverElement, + actions: renderedStatusBar.actions, + }); + } + return toDisposable(() => { disposables.dispose(); }); + } + + private _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts { + const hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant); + const hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0; + if (!hasHoverPartsForParticipant) { + return new RenderedHoverParts([]); + } + return participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant); } - private _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): IDisposable { + private _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined { if (!statusBar.hasContent) { - return Disposable.None; + return undefined; + } + return new RenderedStatusBar(fragment, statusBar); + } + + private _registerListenersOnRenderedParts(): IDisposable { + const disposables = new DisposableStore(); + this._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => { + const element = renderedPart.hoverElement; + element.tabIndex = 0; + disposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => { + event.stopPropagation(); + this._focusedHoverPartIndex = index; + })); + disposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => { + event.stopPropagation(); + this._focusedHoverPartIndex = -1; + })); + }); + return disposables; + } + + private _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant[]) { + const markdownHoverParticipant = participants.find(p => { + return (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover); + }); + if (markdownHoverParticipant) { + this._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant; + } + this._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant); + } + + public focusHoverPartWithIndex(index: number): void { + if (index < 0 || index >= this._renderedParts.length) { + return; + } + this._renderedParts[index].hoverElement.focus(); + } + + public getAccessibleContent(): string { + const content: string[] = []; + for (let i = 0; i < this._renderedParts.length; i++) { + content.push(this.getAccessibleHoverContentAtIndex(i)); + } + return content.join('\n\n'); + } + + public getAccessibleHoverContentAtIndex(index: number): string { + const renderedPart = this._renderedParts[index]; + if (!renderedPart) { + return ''; + } + if (renderedPart.type === 'statusBar') { + const statusBarDescription = [localize('hoverAccessibilityStatusBar', "This is a hover status bar.")]; + for (const action of renderedPart.actions) { + const keybinding = action.actionKeybindingLabel; + if (keybinding) { + statusBarDescription.push(localize('hoverAccessibilityStatusBarActionWithKeybinding', "It has an action with label {0} and keybinding {1}.", action.actionLabel, keybinding)); + } else { + statusBarDescription.push(localize('hoverAccessibilityStatusBarActionWithoutKeybinding', "It has an action with label {0}.", action.actionLabel)); + } + } + return statusBarDescription.join('\n'); + } + return renderedPart.participant.getAccessibleContent(renderedPart.hoverPart); + } + + public async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise { + if (!this._markdownHoverParticipant) { + return; + } + const normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, index); + if (normalizedMarkdownHoverIndex === undefined) { + return; + } + const renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex, focus); + if (!renderedPart) { + return; + } + this._renderedParts[index] = { + type: 'hoverPart', + participant: this._markdownHoverParticipant, + hoverPart: renderedPart.hoverPart, + hoverElement: renderedPart.hoverElement, + }; + this._context.onContentsChanged(); + } + + public doesHoverAtIndexSupportVerbosityAction(index: number, action: HoverVerbosityAction): boolean { + if (!this._markdownHoverParticipant) { + return false; } - fragment.appendChild(statusBar.hoverElement); - return statusBar; + const normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, index); + if (normalizedMarkdownHoverIndex === undefined) { + return false; + } + return this._markdownHoverParticipant.doesMarkdownHoverAtIndexSupportVerbosityAction(normalizedMarkdownHoverIndex, action); + } + + public isColorPickerVisible(): boolean { + return this._colorHoverParticipant?.isColorPickerVisible() ?? false; + } + + private _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined { + const renderedPart = this._renderedParts[index]; + if (!renderedPart || renderedPart.type !== 'hoverPart') { + return undefined; + } + const isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant; + if (!isHoverPartMarkdownHover) { + return undefined; + } + const firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart => + renderedPart.type === 'hoverPart' + && renderedPart.participant === markdownHoverParticipant + ); + if (firstIndexOfMarkdownHovers === -1) { + throw new BugIndicatingError(); + } + return index - firstIndexOfMarkdownHovers; } public get domNode(): DocumentFragment { @@ -190,4 +428,8 @@ class RenderedContentHoverParts extends Disposable { public get domNodeHasChildren(): boolean { return this._fragment.hasChildNodes(); } + + public get focusedHoverPartIndex(): number { + return this._focusedHoverPartIndex; + } } diff --git a/src/vs/editor/contrib/hover/browser/contentHoverStatusBar.ts b/src/vs/editor/contrib/hover/browser/contentHoverStatusBar.ts index 04d84593d06..220b7597603 100644 --- a/src/vs/editor/contrib/hover/browser/contentHoverStatusBar.ts +++ b/src/vs/editor/contrib/hover/browser/contentHoverStatusBar.ts @@ -2,17 +2,19 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { HoverAction } from 'vs/base/browser/ui/hover/hoverWidget'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IEditorHoverAction, IEditorHoverStatusBar } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import * as dom from '../../../../base/browser/dom.js'; +import { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { IEditorHoverAction, IEditorHoverStatusBar } from './hoverTypes.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; const $ = dom.$; export class EditorHoverStatusBar extends Disposable implements IEditorHoverStatusBar { public readonly hoverElement: HTMLElement; + public readonly actions: HoverAction[] = []; + private readonly actionsElement: HTMLElement; private _hasContent: boolean = false; @@ -39,7 +41,9 @@ export class EditorHoverStatusBar extends Disposable implements IEditorHoverStat const keybinding = this._keybindingService.lookupKeybinding(actionOptions.commandId); const keybindingLabel = keybinding ? keybinding.getLabel() : null; this._hasContent = true; - return this._register(HoverAction.render(this.actionsElement, actionOptions, keybindingLabel)); + const action = this._register(HoverAction.render(this.actionsElement, actionOptions, keybindingLabel)); + this.actions.push(action); + return action; } public append(element: HTMLElement): HTMLElement { diff --git a/src/vs/editor/contrib/hover/browser/contentHoverTypes.ts b/src/vs/editor/contrib/hover/browser/contentHoverTypes.ts index a52d758baa7..81bc25d3597 100644 --- a/src/vs/editor/contrib/hover/browser/contentHoverTypes.ts +++ b/src/vs/editor/contrib/hover/browser/contentHoverTypes.ts @@ -3,37 +3,38 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { HoverAnchor, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes'; +import { ContentHoverComputerOptions } from './contentHoverComputer.js'; +import { HoverAnchor, IHoverPart } from './hoverTypes.js'; -export class HoverResult { +export class ContentHoverResult { constructor( - public readonly anchor: HoverAnchor, public readonly hoverParts: IHoverPart[], - public readonly isComplete: boolean + public readonly isComplete: boolean, + public readonly options: ContentHoverComputerOptions ) { } - public filter(anchor: HoverAnchor): HoverResult { + public filter(anchor: HoverAnchor): ContentHoverResult { const filteredHoverParts = this.hoverParts.filter((m) => m.isValidForHoverAnchor(anchor)); if (filteredHoverParts.length === this.hoverParts.length) { return this; } - return new FilteredHoverResult(this, this.anchor, filteredHoverParts, this.isComplete); + return new FilteredContentHoverResult(this, filteredHoverParts, this.isComplete, this.options); } } -export class FilteredHoverResult extends HoverResult { +export class FilteredContentHoverResult extends ContentHoverResult { constructor( - private readonly original: HoverResult, - anchor: HoverAnchor, + private readonly original: ContentHoverResult, messages: IHoverPart[], - isComplete: boolean + isComplete: boolean, + options: ContentHoverComputerOptions ) { - super(anchor, messages, isComplete); + super(messages, isComplete, options); } - public override filter(anchor: HoverAnchor): HoverResult { + public override filter(anchor: HoverAnchor): ContentHoverResult { return this.original.filter(anchor); } } diff --git a/src/vs/editor/contrib/hover/browser/contentHoverWidget.ts b/src/vs/editor/contrib/hover/browser/contentHoverWidget.ts index 37cf8740e37..5dc30190980 100644 --- a/src/vs/editor/contrib/hover/browser/contentHoverWidget.ts +++ b/src/vs/editor/contrib/hover/browser/contentHoverWidget.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { HoverStartSource } from 'vs/editor/contrib/hover/browser/hoverOperation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ResizableContentWidget } from 'vs/editor/contrib/hover/browser/resizableContentWidget'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { getHoverAccessibleViewHint, HoverWidget } from 'vs/base/browser/ui/hover/hoverWidget'; -import { PositionAffinity } from 'vs/editor/common/model'; -import { Emitter } from 'vs/base/common/event'; -import { RenderedContentHover } from 'vs/editor/contrib/hover/browser/contentHoverRendered'; +import * as dom from '../../../../base/browser/dom.js'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition } from '../../../browser/editorBrowser.js'; +import { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js'; +import { HoverStartSource } from './hoverOperation.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { ResizableContentWidget } from './resizableContentWidget.js'; +import { IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { getHoverAccessibleViewHint, HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js'; +import { PositionAffinity } from '../../../common/model.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { RenderedContentHover } from './contentHoverRendered.js'; const HORIZONTAL_SCROLLING_BY = 30; const CONTAINER_HEIGHT_PADDING = 6; @@ -291,7 +291,7 @@ export class ContentHoverWidget extends ResizableContentWidget { private _updateMaxDimensions() { const height = Math.max(this._editor.getLayoutInfo().height / 4, 250, ContentHoverWidget._lastDimensions.height); - const width = Math.max(this._editor.getLayoutInfo().width * 0.66, 500, ContentHoverWidget._lastDimensions.width); + const width = Math.max(this._editor.getLayoutInfo().width * 0.66, 750, ContentHoverWidget._lastDimensions.width); this._setHoverWidgetMaxDimensions(width, height); } diff --git a/src/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.ts b/src/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.ts new file mode 100644 index 00000000000..61c2be8e63e --- /dev/null +++ b/src/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.ts @@ -0,0 +1,400 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as dom from '../../../../base/browser/dom.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { TokenizationRegistry } from '../../../common/languages.js'; +import { HoverOperation, HoverResult, HoverStartMode, HoverStartSource } from './hoverOperation.js'; +import { HoverAnchor, HoverParticipantRegistry, HoverRangeAnchor, IEditorHoverContext, IEditorHoverParticipant, IHoverPart, IHoverWidget } from './hoverTypes.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { HoverVerbosityAction } from '../../../common/standalone/standaloneEnums.js'; +import { ContentHoverWidget } from './contentHoverWidget.js'; +import { ContentHoverComputer, ContentHoverComputerOptions } from './contentHoverComputer.js'; +import { ContentHoverResult } from './contentHoverTypes.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { RenderedContentHover } from './contentHoverRendered.js'; +import { isMousePositionWithinElement } from './hoverUtils.js'; + +export class ContentHoverWidgetWrapper extends Disposable implements IHoverWidget { + + private _currentResult: ContentHoverResult | null = null; + private _renderedContentHover: RenderedContentHover | undefined; + + private readonly _contentHoverWidget: ContentHoverWidget; + private readonly _participants: IEditorHoverParticipant[]; + private readonly _hoverOperation: HoverOperation; + + private readonly _onContentsChanged = this._register(new Emitter()); + public readonly onContentsChanged = this._onContentsChanged.event; + + constructor( + private readonly _editor: ICodeEditor, + @IInstantiationService private readonly _instantiationService: IInstantiationService, + @IKeybindingService private readonly _keybindingService: IKeybindingService, + ) { + super(); + this._contentHoverWidget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor)); + this._participants = this._initializeHoverParticipants(); + this._hoverOperation = this._register(new HoverOperation(this._editor, new ContentHoverComputer(this._editor, this._participants))); + this._registerListeners(); + } + + private _initializeHoverParticipants(): IEditorHoverParticipant[] { + const participants: IEditorHoverParticipant[] = []; + for (const participant of HoverParticipantRegistry.getAll()) { + const participantInstance = this._instantiationService.createInstance(participant, this._editor); + participants.push(participantInstance); + } + participants.sort((p1, p2) => p1.hoverOrdinal - p2.hoverOrdinal); + this._register(this._contentHoverWidget.onDidResize(() => { + this._participants.forEach(participant => participant.handleResize?.()); + })); + return participants; + } + + private _registerListeners(): void { + this._register(this._hoverOperation.onResult((result) => { + const messages = (result.hasLoadingMessage ? this._addLoadingMessage(result) : result.value); + this._withResult(new ContentHoverResult(messages, result.isComplete, result.options)); + })); + const contentHoverWidgetNode = this._contentHoverWidget.getDomNode(); + this._register(dom.addStandardDisposableListener(contentHoverWidgetNode, 'keydown', (e) => { + if (e.equals(KeyCode.Escape)) { + this.hide(); + } + })); + this._register(dom.addStandardDisposableListener(contentHoverWidgetNode, 'mouseleave', (e) => { + this._onMouseLeave(e); + })); + this._register(TokenizationRegistry.onDidChange(() => { + if (this._contentHoverWidget.position && this._currentResult) { + this._setCurrentResult(this._currentResult); // render again + } + })); + } + + /** + * Returns true if the hover shows now or will show. + */ + private _startShowingOrUpdateHover( + anchor: HoverAnchor | null, + mode: HoverStartMode, + source: HoverStartSource, + focus: boolean, + mouseEvent: IEditorMouseEvent | null + ): boolean { + const contentHoverIsVisible = this._contentHoverWidget.position && this._currentResult; + if (!contentHoverIsVisible) { + if (anchor) { + this._startHoverOperationIfNecessary(anchor, mode, source, focus, false); + return true; + } + return false; + } + const isHoverSticky = this._editor.getOption(EditorOption.hover).sticky; + const isMouseGettingCloser = mouseEvent && this._contentHoverWidget.isMouseGettingCloser(mouseEvent.event.posx, mouseEvent.event.posy); + const isHoverStickyAndIsMouseGettingCloser = isHoverSticky && isMouseGettingCloser; + // The mouse is getting closer to the hover, so we will keep the hover untouched + // But we will kick off a hover update at the new anchor, insisting on keeping the hover visible. + if (isHoverStickyAndIsMouseGettingCloser) { + if (anchor) { + this._startHoverOperationIfNecessary(anchor, mode, source, focus, true); + } + return true; + } + // If mouse is not getting closer and anchor not defined, hide the hover + if (!anchor) { + this._setCurrentResult(null); + return false; + } + // If mouse if not getting closer and anchor is defined, and the new anchor is the same as the previous anchor + const currentAnchorEqualsPreviousAnchor = this._currentResult && this._currentResult.options.anchor.equals(anchor); + if (currentAnchorEqualsPreviousAnchor) { + return true; + } + // If mouse if not getting closer and anchor is defined, and the new anchor is not compatible with the previous anchor + const currentAnchorCompatibleWithPreviousAnchor = this._currentResult && anchor.canAdoptVisibleHover(this._currentResult.options.anchor, this._contentHoverWidget.position); + if (!currentAnchorCompatibleWithPreviousAnchor) { + this._setCurrentResult(null); + this._startHoverOperationIfNecessary(anchor, mode, source, focus, false); + return true; + } + // We aren't getting any closer to the hover, so we will filter existing results + // and keep those which also apply to the new anchor. + if (this._currentResult) { + this._setCurrentResult(this._currentResult.filter(anchor)); + } + this._startHoverOperationIfNecessary(anchor, mode, source, focus, false); + return true; + } + + private _startHoverOperationIfNecessary(anchor: HoverAnchor, mode: HoverStartMode, source: HoverStartSource, shouldFocus: boolean, insistOnKeepingHoverVisible: boolean): void { + const currentAnchorEqualToPreviousHover = this._hoverOperation.options && this._hoverOperation.options.anchor.equals(anchor); + if (currentAnchorEqualToPreviousHover) { + return; + } + this._hoverOperation.cancel(); + const contentHoverComputerOptions: ContentHoverComputerOptions = { + anchor, + source, + shouldFocus, + insistOnKeepingHoverVisible + }; + this._hoverOperation.start(mode, contentHoverComputerOptions); + } + + private _setCurrentResult(hoverResult: ContentHoverResult | null): void { + let currentHoverResult = hoverResult; + const currentResultEqualToPreviousResult = this._currentResult === currentHoverResult; + if (currentResultEqualToPreviousResult) { + return; + } + const currentHoverResultIsEmpty = currentHoverResult && currentHoverResult.hoverParts.length === 0; + if (currentHoverResultIsEmpty) { + currentHoverResult = null; + } + this._currentResult = currentHoverResult; + if (this._currentResult) { + this._showHover(this._currentResult); + } else { + this._hideHover(); + } + } + + private _addLoadingMessage(hoverResult: HoverResult): IHoverPart[] { + for (const participant of this._participants) { + if (!participant.createLoadingMessage) { + continue; + } + const loadingMessage = participant.createLoadingMessage(hoverResult.options.anchor); + if (!loadingMessage) { + continue; + } + return hoverResult.value.slice(0).concat([loadingMessage]); + } + return hoverResult.value; + } + + private _withResult(hoverResult: ContentHoverResult): void { + const previousHoverIsVisibleWithCompleteResult = this._contentHoverWidget.position && this._currentResult && this._currentResult.isComplete; + if (!previousHoverIsVisibleWithCompleteResult) { + this._setCurrentResult(hoverResult); + } + // The hover is visible with a previous complete result. + const isCurrentHoverResultComplete = hoverResult.isComplete; + if (!isCurrentHoverResultComplete) { + // Instead of rendering the new partial result, we wait for the result to be complete. + return; + } + const currentHoverResultIsEmpty = hoverResult.hoverParts.length === 0; + const insistOnKeepingPreviousHoverVisible = hoverResult.options.insistOnKeepingHoverVisible; + const shouldKeepPreviousHoverVisible = currentHoverResultIsEmpty && insistOnKeepingPreviousHoverVisible; + if (shouldKeepPreviousHoverVisible) { + // The hover would now hide normally, so we'll keep the previous messages + return; + } + this._setCurrentResult(hoverResult); + } + + private _showHover(hoverResult: ContentHoverResult): void { + const context = this._getHoverContext(); + this._renderedContentHover = new RenderedContentHover(this._editor, hoverResult, this._participants, context, this._keybindingService); + if (this._renderedContentHover.domNodeHasChildren) { + this._contentHoverWidget.show(this._renderedContentHover); + } else { + this._renderedContentHover.dispose(); + } + } + + private _hideHover(): void { + this._contentHoverWidget.hide(); + } + + private _getHoverContext(): IEditorHoverContext { + const hide = () => { + this.hide(); + }; + const onContentsChanged = () => { + this._onContentsChanged.fire(); + this._contentHoverWidget.onContentsChanged(); + }; + const setMinimumDimensions = (dimensions: dom.Dimension) => { + this._contentHoverWidget.setMinimumDimensions(dimensions); + }; + return { hide, onContentsChanged, setMinimumDimensions }; + } + + + public showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean { + const isContentWidgetResizing = this._contentHoverWidget.isResizing; + if (isContentWidgetResizing) { + return true; + } + const anchorCandidates: HoverAnchor[] = this._findHoverAnchorCandidates(mouseEvent); + const anchorCandidatesExist = anchorCandidates.length > 0; + if (!anchorCandidatesExist) { + return this._startShowingOrUpdateHover(null, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent); + } + const anchor = anchorCandidates[0]; + return this._startShowingOrUpdateHover(anchor, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent); + } + + private _findHoverAnchorCandidates(mouseEvent: IEditorMouseEvent): HoverAnchor[] { + const anchorCandidates: HoverAnchor[] = []; + for (const participant of this._participants) { + if (!participant.suggestHoverAnchor) { + continue; + } + const anchor = participant.suggestHoverAnchor(mouseEvent); + if (!anchor) { + continue; + } + anchorCandidates.push(anchor); + } + const target = mouseEvent.target; + switch (target.type) { + case MouseTargetType.CONTENT_TEXT: { + anchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy)); + break; + } + case MouseTargetType.CONTENT_EMPTY: { + const epsilon = this._editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth / 2; + // Let hover kick in even when the mouse is technically in the empty area after a line, given the distance is small enough + const mouseIsWithinLinesAndCloseToHover = !target.detail.isAfterLines + && typeof target.detail.horizontalDistanceToText === 'number' + && target.detail.horizontalDistanceToText < epsilon; + if (!mouseIsWithinLinesAndCloseToHover) { + break; + } + anchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy)); + break; + } + } + anchorCandidates.sort((a, b) => b.priority - a.priority); + return anchorCandidates; + } + + private _onMouseLeave(e: MouseEvent): void { + const editorDomNode = this._editor.getDomNode(); + const isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y); + if (isMousePositionOutsideOfEditor) { + this.hide(); + } + } + + public startShowingAtRange(range: Range, mode: HoverStartMode, source: HoverStartSource, focus: boolean): void { + this._startShowingOrUpdateHover(new HoverRangeAnchor(0, range, undefined, undefined), mode, source, focus, null); + } + + public getWidgetContent(): string | undefined { + const node = this._contentHoverWidget.getDomNode(); + if (!node.textContent) { + return undefined; + } + return node.textContent; + } + + public async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise { + this._renderedContentHover?.updateHoverVerbosityLevel(action, index, focus); + } + + public doesHoverAtIndexSupportVerbosityAction(index: number, action: HoverVerbosityAction): boolean { + return this._renderedContentHover?.doesHoverAtIndexSupportVerbosityAction(index, action) ?? false; + } + + public getAccessibleWidgetContent(): string | undefined { + return this._renderedContentHover?.getAccessibleWidgetContent(); + } + + public getAccessibleWidgetContentAtIndex(index: number): string | undefined { + return this._renderedContentHover?.getAccessibleWidgetContentAtIndex(index); + } + + public focusedHoverPartIndex(): number { + return this._renderedContentHover?.focusedHoverPartIndex ?? -1; + } + + public containsNode(node: Node | null | undefined): boolean { + return (node ? this._contentHoverWidget.getDomNode().contains(node) : false); + } + + public focus(): void { + this._contentHoverWidget.focus(); + } + + public focusHoverPartWithIndex(index: number): void { + this._renderedContentHover?.focusHoverPartWithIndex(index); + } + + public scrollUp(): void { + this._contentHoverWidget.scrollUp(); + } + + public scrollDown(): void { + this._contentHoverWidget.scrollDown(); + } + + public scrollLeft(): void { + this._contentHoverWidget.scrollLeft(); + } + + public scrollRight(): void { + this._contentHoverWidget.scrollRight(); + } + + public pageUp(): void { + this._contentHoverWidget.pageUp(); + } + + public pageDown(): void { + this._contentHoverWidget.pageDown(); + } + + public goToTop(): void { + this._contentHoverWidget.goToTop(); + } + + public goToBottom(): void { + this._contentHoverWidget.goToBottom(); + } + + public hide(): void { + this._hoverOperation.cancel(); + this._setCurrentResult(null); + } + + public getDomNode(): HTMLElement { + return this._contentHoverWidget.getDomNode(); + } + + public get isColorPickerVisible(): boolean { + return this._renderedContentHover?.isColorPickerVisible() ?? false; + } + + public get isVisibleFromKeyboard(): boolean { + return this._contentHoverWidget.isVisibleFromKeyboard; + } + + public get isVisible(): boolean { + return this._contentHoverWidget.isVisible; + } + + public get isFocused(): boolean { + return this._contentHoverWidget.isFocused; + } + + public get isResizing(): boolean { + return this._contentHoverWidget.isResizing; + } + + public get widget() { + return this._contentHoverWidget; + } +} diff --git a/src/vs/editor/contrib/hover/browser/getHover.ts b/src/vs/editor/contrib/hover/browser/getHover.ts index 608f8a1dc96..7c000ed2aa8 100644 --- a/src/vs/editor/contrib/hover/browser/getHover.ts +++ b/src/vs/editor/contrib/hover/browser/getHover.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AsyncIterableObject } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { registerModelAndPositionCommand } from 'vs/editor/browser/editorExtensions'; -import { Position } from 'vs/editor/common/core/position'; -import { ITextModel } from 'vs/editor/common/model'; -import { Hover, HoverProvider } from 'vs/editor/common/languages'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; +import { AsyncIterableObject } from '../../../../base/common/async.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { registerModelAndPositionCommand } from '../../../browser/editorExtensions.js'; +import { Position } from '../../../common/core/position.js'; +import { ITextModel } from '../../../common/model.js'; +import { Hover, HoverProvider } from '../../../common/languages.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; export class HoverProviderResult { constructor( @@ -34,14 +34,14 @@ async function executeProvider(provider: HoverProvider, ordinal: number, model: return new HoverProviderResult(provider, result, ordinal); } -export function getHoverProviderResultsAsAsyncIterable(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, token: CancellationToken): AsyncIterableObject { - const providers = registry.ordered(model); +export function getHoverProviderResultsAsAsyncIterable(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, token: CancellationToken, recursive = false): AsyncIterableObject { + const providers = registry.ordered(model, recursive); const promises = providers.map((provider, index) => executeProvider(provider, index, model, position, token)); return AsyncIterableObject.fromPromises(promises).coalesce(); } -export function getHoversPromise(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, token: CancellationToken): Promise { - return getHoverProviderResultsAsAsyncIterable(registry, model, position, token).map(item => item.hover).toPromise(); +export function getHoversPromise(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, token: CancellationToken, recursive = false): Promise { + return getHoverProviderResultsAsAsyncIterable(registry, model, position, token, recursive).map(item => item.hover).toPromise(); } registerModelAndPositionCommand('_executeHoverProvider', (accessor, model, position): Promise => { @@ -49,6 +49,11 @@ registerModelAndPositionCommand('_executeHoverProvider', (accessor, model, posit return getHoversPromise(languageFeaturesService.hoverProvider, model, position, CancellationToken.None); }); +registerModelAndPositionCommand('_executeHoverProvider_recursive', (accessor, model, position): Promise => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + return getHoversPromise(languageFeaturesService.hoverProvider, model, position, CancellationToken.None, true); +}); + function isValid(result: Hover) { const hasRange = (typeof result.range !== 'undefined'); const hasHtmlContent = typeof result.contents !== 'undefined' && result.contents && result.contents.length > 0; diff --git a/src/vs/editor/contrib/hover/browser/marginHoverComputer.ts b/src/vs/editor/contrib/hover/browser/glyphHoverComputer.ts similarity index 53% rename from src/vs/editor/contrib/hover/browser/marginHoverComputer.ts rename to src/vs/editor/contrib/hover/browser/glyphHoverComputer.ts index 0bc61948152..760d00fb644 100644 --- a/src/vs/editor/contrib/hover/browser/marginHoverComputer.ts +++ b/src/vs/editor/contrib/hover/browser/glyphHoverComputer.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { asArray } from 'vs/base/common/arrays'; -import { IMarkdownString, isEmptyMarkdownString } from 'vs/base/common/htmlContent'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IHoverComputer } from 'vs/editor/contrib/hover/browser/hoverOperation'; -import { GlyphMarginLane } from 'vs/editor/common/model'; +import { asArray } from '../../../../base/common/arrays.js'; +import { IMarkdownString, isEmptyMarkdownString } from '../../../../base/common/htmlContent.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { IHoverComputer } from './hoverOperation.js'; +import { GlyphMarginLane } from '../../../common/model.js'; export type LaneOrLineNumber = GlyphMarginLane | 'lineNo'; @@ -15,33 +15,19 @@ export interface IHoverMessage { value: IMarkdownString; } -export class MarginHoverComputer implements IHoverComputer { - - private _lineNumber: number = -1; - private _laneOrLine: LaneOrLineNumber = GlyphMarginLane.Center; - - public get lineNumber(): number { - return this._lineNumber; - } - - public set lineNumber(value: number) { - this._lineNumber = value; - } - - public get lane(): LaneOrLineNumber { - return this._laneOrLine; - } +export interface GlyphHoverComputerOptions { + lineNumber: number; + laneOrLine: LaneOrLineNumber; +} - public set lane(value: LaneOrLineNumber) { - this._laneOrLine = value; - } +export class GlyphHoverComputer implements IHoverComputer { constructor( private readonly _editor: ICodeEditor ) { } - public computeSync(): IHoverMessage[] { + public computeSync(opts: GlyphHoverComputerOptions): IHoverMessage[] { const toHoverMessage = (contents: IMarkdownString): IHoverMessage => { return { @@ -49,17 +35,17 @@ export class MarginHoverComputer implements IHoverComputer { }; }; - const lineDecorations = this._editor.getLineDecorations(this._lineNumber); + const lineDecorations = this._editor.getLineDecorations(opts.lineNumber); const result: IHoverMessage[] = []; - const isLineHover = this._laneOrLine === 'lineNo'; + const isLineHover = opts.laneOrLine === 'lineNo'; if (!lineDecorations) { return result; } for (const d of lineDecorations) { const lane = d.options.glyphMargin?.position ?? GlyphMarginLane.Center; - if (!isLineHover && lane !== this._laneOrLine) { + if (!isLineHover && lane !== opts.laneOrLine) { continue; } diff --git a/src/vs/editor/contrib/hover/browser/glyphHoverController.ts b/src/vs/editor/contrib/hover/browser/glyphHoverController.ts new file mode 100644 index 00000000000..c0d37ae82e0 --- /dev/null +++ b/src/vs/editor/contrib/hover/browser/glyphHoverController.ts @@ -0,0 +1,232 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor, IEditorMouseEvent, IPartialEditorMouseEvent } from '../../../browser/editorBrowser.js'; +import { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js'; +import { IEditorContribution, IScrollEvent } from '../../../common/editorCommon.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IHoverWidget } from './hoverTypes.js'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { isMousePositionWithinElement } from './hoverUtils.js'; +import './hover.css'; +import { GlyphHoverWidget } from './glyphHoverWidget.js'; + +// sticky hover widget which doesn't disappear on focus out and such +const _sticky = false + // || Boolean("true") // done "weirdly" so that a lint warning prevents you from pushing this + ; + +interface IHoverSettings { + readonly enabled: boolean; + readonly sticky: boolean; + readonly hidingDelay: number; +} + +interface IHoverState { + mouseDown: boolean; +} + +export class GlyphHoverController extends Disposable implements IEditorContribution { + + public static readonly ID = 'editor.contrib.marginHover'; + + public shouldKeepOpenOnEditorMouseMoveOrLeave: boolean = false; + + private readonly _listenersStore = new DisposableStore(); + + private _glyphWidget: GlyphHoverWidget | undefined; + private _mouseMoveEvent: IEditorMouseEvent | undefined; + private _reactToEditorMouseMoveRunner: RunOnceScheduler; + + private _hoverSettings!: IHoverSettings; + private _hoverState: IHoverState = { + mouseDown: false + }; + + constructor( + private readonly _editor: ICodeEditor, + @IInstantiationService private readonly _instantiationService: IInstantiationService + ) { + super(); + this._reactToEditorMouseMoveRunner = this._register( + new RunOnceScheduler( + () => this._reactToEditorMouseMove(this._mouseMoveEvent), 0 + ) + ); + this._hookListeners(); + this._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { + if (e.hasChanged(EditorOption.hover)) { + this._unhookListeners(); + this._hookListeners(); + } + })); + } + + static get(editor: ICodeEditor): GlyphHoverController | null { + return editor.getContribution(GlyphHoverController.ID); + } + + private _hookListeners(): void { + + const hoverOpts = this._editor.getOption(EditorOption.hover); + this._hoverSettings = { + enabled: hoverOpts.enabled, + sticky: hoverOpts.sticky, + hidingDelay: hoverOpts.hidingDelay + }; + + if (hoverOpts.enabled) { + this._listenersStore.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e))); + this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())); + this._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e))); + this._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e))); + } else { + this._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e))); + this._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e))); + } + + this._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e))); + this._listenersStore.add(this._editor.onDidChangeModel(() => { + this._cancelScheduler(); + this._hideWidgets(); + })); + this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())); + this._listenersStore.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e))); + } + + private _unhookListeners(): void { + this._listenersStore.clear(); + } + + private _cancelScheduler() { + this._mouseMoveEvent = undefined; + this._reactToEditorMouseMoveRunner.cancel(); + } + + private _onEditorScrollChanged(e: IScrollEvent): void { + if (e.scrollTopChanged || e.scrollLeftChanged) { + this._hideWidgets(); + } + } + + private _onEditorMouseDown(mouseEvent: IEditorMouseEvent): void { + this._hoverState.mouseDown = true; + const shouldNotHideCurrentHoverWidget = this._isMouseOnGlyphHoverWidget(mouseEvent); + if (shouldNotHideCurrentHoverWidget) { + return; + } + this._hideWidgets(); + } + + private _isMouseOnGlyphHoverWidget(mouseEvent: IPartialEditorMouseEvent): boolean { + const glyphHoverWidgetNode = this._glyphWidget?.getDomNode(); + if (glyphHoverWidgetNode) { + return isMousePositionWithinElement(glyphHoverWidgetNode, mouseEvent.event.posx, mouseEvent.event.posy); + } + return false; + } + + private _onEditorMouseUp(): void { + this._hoverState.mouseDown = false; + } + + private _onEditorMouseLeave(mouseEvent: IPartialEditorMouseEvent): void { + if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) { + return; + } + + this._cancelScheduler(); + const shouldNotHideCurrentHoverWidget = this._isMouseOnGlyphHoverWidget(mouseEvent); + if (shouldNotHideCurrentHoverWidget) { + return; + } + if (_sticky) { + return; + } + this._hideWidgets(); + } + + private _shouldNotRecomputeCurrentHoverWidget(mouseEvent: IEditorMouseEvent): boolean { + const isHoverSticky = this._hoverSettings.sticky; + const isMouseOnGlyphHoverWidget = this._isMouseOnGlyphHoverWidget(mouseEvent); + return isHoverSticky && isMouseOnGlyphHoverWidget; + } + + private _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { + if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) { + return; + } + + this._mouseMoveEvent = mouseEvent; + const shouldNotRecomputeCurrentHoverWidget = this._shouldNotRecomputeCurrentHoverWidget(mouseEvent); + if (shouldNotRecomputeCurrentHoverWidget) { + this._reactToEditorMouseMoveRunner.cancel(); + return; + } + this._reactToEditorMouseMove(mouseEvent); + } + + private _reactToEditorMouseMove(mouseEvent: IEditorMouseEvent | undefined): void { + + if (!mouseEvent) { + return; + } + const glyphWidgetShowsOrWillShow = this._tryShowHoverWidget(mouseEvent); + if (glyphWidgetShowsOrWillShow) { + return; + } + if (_sticky) { + return; + } + this._hideWidgets(); + } + + private _tryShowHoverWidget(mouseEvent: IEditorMouseEvent): boolean { + const glyphWidget: IHoverWidget = this._getOrCreateGlyphWidget(); + return glyphWidget.showsOrWillShow(mouseEvent); + } + + private _onKeyDown(e: IKeyboardEvent): void { + if (!this._editor.hasModel()) { + return; + } + if (e.keyCode === KeyCode.Ctrl + || e.keyCode === KeyCode.Alt + || e.keyCode === KeyCode.Meta + || e.keyCode === KeyCode.Shift) { + // Do not hide hover when a modifier key is pressed + return; + } + this._hideWidgets(); + } + + private _hideWidgets(): void { + if (_sticky) { + return; + } + this._glyphWidget?.hide(); + } + + private _getOrCreateGlyphWidget(): GlyphHoverWidget { + if (!this._glyphWidget) { + this._glyphWidget = this._instantiationService.createInstance(GlyphHoverWidget, this._editor); + } + return this._glyphWidget; + } + + public hideContentHover(): void { + this._hideWidgets(); + } + + public override dispose(): void { + super.dispose(); + this._unhookListeners(); + this._listenersStore.dispose(); + this._glyphWidget?.dispose(); + } +} diff --git a/src/vs/editor/contrib/hover/browser/marginHoverWidget.ts b/src/vs/editor/contrib/hover/browser/glyphHoverWidget.ts similarity index 61% rename from src/vs/editor/contrib/hover/browser/marginHoverWidget.ts rename to src/vs/editor/contrib/hover/browser/glyphHoverWidget.ts index e909575d66e..8432aa39f3a 100644 --- a/src/vs/editor/contrib/hover/browser/marginHoverWidget.ts +++ b/src/vs/editor/contrib/hover/browser/glyphHoverWidget.ts @@ -3,21 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { MarkdownRenderer } from 'vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; -import { ICodeEditor, IEditorMouseEvent, IOverlayWidget, IOverlayWidgetPosition, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { HoverOperation, HoverStartMode } from 'vs/editor/contrib/hover/browser/hoverOperation'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { HoverWidget } from 'vs/base/browser/ui/hover/hoverWidget'; -import { IHoverWidget } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { IHoverMessage, LaneOrLineNumber, MarginHoverComputer } from 'vs/editor/contrib/hover/browser/marginHoverComputer'; +import * as dom from '../../../../base/browser/dom.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { MarkdownRenderer } from '../../../browser/widget/markdownRenderer/browser/markdownRenderer.js'; +import { ICodeEditor, IEditorMouseEvent, IOverlayWidget, IOverlayWidgetPosition, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { HoverOperation, HoverResult, HoverStartMode } from './hoverOperation.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import { HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js'; +import { IHoverWidget } from './hoverTypes.js'; +import { IHoverMessage, LaneOrLineNumber, GlyphHoverComputer, GlyphHoverComputerOptions } from './glyphHoverComputer.js'; +import { isMousePositionWithinElement } from './hoverUtils.js'; const $ = dom.$; -export class MarginHoverWidget extends Disposable implements IOverlayWidget, IHoverWidget { +export class GlyphHoverWidget extends Disposable implements IOverlayWidget, IHoverWidget { public static readonly ID = 'editor.contrib.modesGlyphHoverWidget'; @@ -28,14 +29,15 @@ export class MarginHoverWidget extends Disposable implements IOverlayWidget, IHo private _messages: IHoverMessage[]; private readonly _markdownRenderer: MarkdownRenderer; - private readonly _computer: MarginHoverComputer; - private readonly _hoverOperation: HoverOperation; + private readonly _hoverOperation: HoverOperation; private readonly _renderDisposeables = this._register(new DisposableStore()); + private _hoverComputerOptions: GlyphHoverComputerOptions | undefined; + constructor( editor: ICodeEditor, - languageService: ILanguageService, - openerService: IOpenerService, + @ILanguageService languageService: ILanguageService, + @IOpenerService openerService: IOpenerService, ) { super(); this._editor = editor; @@ -47,11 +49,8 @@ export class MarginHoverWidget extends Disposable implements IOverlayWidget, IHo this._hover.containerDomNode.classList.toggle('hidden', !this._isVisible); this._markdownRenderer = this._register(new MarkdownRenderer({ editor: this._editor }, languageService, openerService)); - this._computer = new MarginHoverComputer(this._editor); - this._hoverOperation = this._register(new HoverOperation(this._editor, this._computer)); - this._register(this._hoverOperation.onResult((result) => { - this._withResult(result.value); - })); + this._hoverOperation = this._register(new HoverOperation(this._editor, new GlyphHoverComputer(this._editor))); + this._register(this._hoverOperation.onResult((result) => this._withResult(result))); this._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged())); this._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { @@ -59,17 +58,20 @@ export class MarginHoverWidget extends Disposable implements IOverlayWidget, IHo this._updateFont(); } })); - + this._register(dom.addStandardDisposableListener(this._hover.containerDomNode, 'mouseleave', (e) => { + this._onMouseLeave(e); + })); this._editor.addOverlayWidget(this); } public override dispose(): void { + this._hoverComputerOptions = undefined; this._editor.removeOverlayWidget(this); super.dispose(); } public getId(): string { - return MarginHoverWidget.ID; + return GlyphHoverWidget.ID; } public getDomNode(): HTMLElement { @@ -86,11 +88,11 @@ export class MarginHoverWidget extends Disposable implements IOverlayWidget, IHo } private _onModelDecorationsChanged(): void { - if (this._isVisible) { + if (this._isVisible && this._hoverComputerOptions) { // The decorations have changed and the hover is visible, // we need to recompute the displayed text this._hoverOperation.cancel(); - this._hoverOperation.start(HoverStartMode.Delayed); + this._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions); } } @@ -108,22 +110,20 @@ export class MarginHoverWidget extends Disposable implements IOverlayWidget, IHo } private _startShowingAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void { - if (this._computer.lineNumber === lineNumber && this._computer.lane === laneOrLine) { + if (this._hoverComputerOptions + && this._hoverComputerOptions.lineNumber === lineNumber + && this._hoverComputerOptions.laneOrLine === laneOrLine) { // We have to show the widget at the exact same line number as before, so no work is needed return; } - this._hoverOperation.cancel(); - this.hide(); - - this._computer.lineNumber = lineNumber; - this._computer.lane = laneOrLine; - this._hoverOperation.start(HoverStartMode.Delayed); + this._hoverComputerOptions = { lineNumber, laneOrLine }; + this._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions); } public hide(): void { - this._computer.lineNumber = -1; + this._hoverComputerOptions = undefined; this._hoverOperation.cancel(); if (!this._isVisible) { return; @@ -132,17 +132,17 @@ export class MarginHoverWidget extends Disposable implements IOverlayWidget, IHo this._hover.containerDomNode.classList.toggle('hidden', !this._isVisible); } - private _withResult(result: IHoverMessage[]): void { - this._messages = result; + private _withResult(result: HoverResult): void { + this._messages = result.value; if (this._messages.length > 0) { - this._renderMessages(this._computer.lineNumber, this._messages); + this._renderMessages(result.options.lineNumber, result.options.laneOrLine, this._messages); } else { this.hide(); } } - private _renderMessages(lineNumber: number, messages: IHoverMessage[]): void { + private _renderMessages(lineNumber: number, laneOrLine: LaneOrLineNumber, messages: IHoverMessage[]): void { this._renderDisposeables.clear(); const fragment = document.createDocumentFragment(); @@ -156,7 +156,7 @@ export class MarginHoverWidget extends Disposable implements IOverlayWidget, IHo } this._updateContents(fragment); - this._showAt(lineNumber); + this._showAt(lineNumber, laneOrLine); } private _updateContents(node: Node): void { @@ -165,7 +165,7 @@ export class MarginHoverWidget extends Disposable implements IOverlayWidget, IHo this._updateFont(); } - private _showAt(lineNumber: number): void { + private _showAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void { if (!this._isVisible) { this._isVisible = true; this._hover.containerDomNode.classList.toggle('hidden', !this._isVisible); @@ -177,8 +177,16 @@ export class MarginHoverWidget extends Disposable implements IOverlayWidget, IHo const lineHeight = this._editor.getOption(EditorOption.lineHeight); const nodeHeight = this._hover.containerDomNode.clientHeight; const top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2); - const left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (this._computer.lane === 'lineNo' ? editorLayout.lineNumbersWidth : 0); + const left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (laneOrLine === 'lineNo' ? editorLayout.lineNumbersWidth : 0); this._hover.containerDomNode.style.left = `${left}px`; this._hover.containerDomNode.style.top = `${Math.max(Math.round(top), 0)}px`; } + + private _onMouseLeave(e: MouseEvent): void { + const editorDomNode = this._editor.getDomNode(); + const isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y); + if (isMousePositionOutsideOfEditor) { + this.hide(); + } + } } diff --git a/src/vs/editor/contrib/hover/browser/hover.css b/src/vs/editor/contrib/hover/browser/hover.css index 2520856e59d..958f1ee9cf4 100644 --- a/src/vs/editor/contrib/hover/browser/hover.css +++ b/src/vs/editor/contrib/hover/browser/hover.css @@ -43,7 +43,7 @@ flex-direction: column; padding-left: 5px; padding-right: 5px; - justify-content: end; + justify-content: flex-end; border-right: 1px solid var(--vscode-editorHoverWidget-border); } diff --git a/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.ts b/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.ts index 2998c0e3e30..ffce8901c85 100644 --- a/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.ts +++ b/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.ts @@ -2,31 +2,29 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { HoverController } from 'vs/editor/contrib/hover/browser/hoverController'; -import { AccessibleViewType, AccessibleViewProviderId, AdvancedContentProvider, IAccessibleViewContentProvider, IAccessibleViewOptions } from 'vs/platform/accessibility/browser/accessibleView'; -import { IAccessibleViewImplentation } from 'vs/platform/accessibility/browser/accessibleViewRegistry'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { HoverVerbosityAction } from 'vs/editor/common/languages'; -import { DECREASE_HOVER_VERBOSITY_ACCESSIBLE_ACTION_ID, DECREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACCESSIBLE_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID } from 'vs/editor/contrib/hover/browser/hoverActionIds'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { Action, IAction } from 'vs/base/common/actions'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { Codicon } from 'vs/base/common/codicons'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { labelForHoverVerbosityAction } from 'vs/editor/contrib/hover/browser/markdownHoverParticipant'; +import { localize } from '../../../../nls.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ContentHoverController } from './contentHoverController.js'; +import { AccessibleViewType, AccessibleViewProviderId, AccessibleContentProvider, IAccessibleViewContentProvider, IAccessibleViewOptions } from '../../../../platform/accessibility/browser/accessibleView.js'; +import { IAccessibleViewImplentation } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js'; +import { IContextViewService } from '../../../../platform/contextview/browser/contextView.js'; +import { IHoverService } from '../../../../platform/hover/browser/hover.js'; +import { IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { HoverVerbosityAction } from '../../../common/languages.js'; +import { DECREASE_HOVER_VERBOSITY_ACCESSIBLE_ACTION_ID, DECREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACCESSIBLE_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID } from './hoverActionIds.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { Action, IAction } from '../../../../base/common/actions.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { labelForHoverVerbosityAction } from './markdownHoverParticipant.js'; namespace HoverAccessibilityHelpNLS { - export const intro = localize('intro', "Focus on the hover widget to cycle through the hover parts with the Tab key."); - export const increaseVerbosity = localize('increaseVerbosity', "- The focused hover part verbosity level can be increased with the Increase Hover Verbosity command.", INCREASE_HOVER_VERBOSITY_ACTION_ID); - export const decreaseVerbosity = localize('decreaseVerbosity', "- The focused hover part verbosity level can be decreased with the Decrease Hover Verbosity command.", DECREASE_HOVER_VERBOSITY_ACTION_ID); - export const hoverContent = localize('contentHover', "The last focused hover content is the following."); + export const increaseVerbosity = localize('increaseVerbosity', '- The focused hover part verbosity level can be increased with the Increase Hover Verbosity command.', ``); + export const decreaseVerbosity = localize('decreaseVerbosity', '- The focused hover part verbosity level can be decreased with the Decrease Hover Verbosity command.', ``); } export class HoverAccessibleView implements IAccessibleViewImplentation { @@ -36,25 +34,18 @@ export class HoverAccessibleView implements IAccessibleViewImplentation { public readonly name = 'hover'; public readonly when = EditorContextKeys.hoverFocused; - private _provider: HoverAccessibleViewProvider | undefined; - - getProvider(accessor: ServicesAccessor): AdvancedContentProvider | undefined { + getProvider(accessor: ServicesAccessor): AccessibleContentProvider | undefined { const codeEditorService = accessor.get(ICodeEditorService); const codeEditor = codeEditorService.getActiveCodeEditor() || codeEditorService.getFocusedCodeEditor(); if (!codeEditor) { throw new Error('No active or focused code editor'); } - const hoverController = HoverController.get(codeEditor); + const hoverController = ContentHoverController.get(codeEditor); if (!hoverController) { return; } const keybindingService = accessor.get(IKeybindingService); - this._provider = accessor.get(IInstantiationService).createInstance(HoverAccessibleViewProvider, keybindingService, codeEditor, hoverController); - return this._provider; - } - - dispose(): void { - this._provider?.dispose(); + return accessor.get(IInstantiationService).createInstance(HoverAccessibleViewProvider, keybindingService, codeEditor, hoverController); } } @@ -65,27 +56,20 @@ export class HoverAccessibilityHelp implements IAccessibleViewImplentation { public readonly type = AccessibleViewType.Help; public readonly when = EditorContextKeys.hoverVisible; - private _provider: HoverAccessibleViewProvider | undefined; - - getProvider(accessor: ServicesAccessor): AdvancedContentProvider | undefined { + getProvider(accessor: ServicesAccessor): AccessibleContentProvider | undefined { const codeEditorService = accessor.get(ICodeEditorService); const codeEditor = codeEditorService.getActiveCodeEditor() || codeEditorService.getFocusedCodeEditor(); if (!codeEditor) { throw new Error('No active or focused code editor'); } - const hoverController = HoverController.get(codeEditor); + const hoverController = ContentHoverController.get(codeEditor); if (!hoverController) { return; } return accessor.get(IInstantiationService).createInstance(HoverAccessibilityHelpProvider, hoverController); } - - dispose(): void { - this._provider?.dispose(); - } } - abstract class BaseHoverAccessibleViewProvider extends Disposable implements IAccessibleViewContentProvider { abstract provideContent(): string; @@ -97,12 +81,9 @@ abstract class BaseHoverAccessibleViewProvider extends Disposable implements IAc private readonly _onDidChangeContent: Emitter = this._register(new Emitter()); public readonly onDidChangeContent: Event = this._onDidChangeContent.event; - protected _markdownHoverFocusedIndex: number = -1; - private _onHoverContentsChanged: IDisposable | undefined; + protected _focusedHoverPartIndex: number = -1; - constructor( - protected readonly _hoverController: HoverController, - ) { + constructor(protected readonly _hoverController: ContentHoverController) { super(); } @@ -111,8 +92,8 @@ abstract class BaseHoverAccessibleViewProvider extends Disposable implements IAc return; } this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave = true; - this._markdownHoverFocusedIndex = this._hoverController.focusedMarkdownHoverIndex(); - this._onHoverContentsChanged = this._register(this._hoverController.onHoverContentsChanged(() => { + this._focusedHoverPartIndex = this._hoverController.focusedHoverPartIndex(); + this._register(this._hoverController.onHoverContentsChanged(() => { this._onDidChangeContent.fire(); })); } @@ -121,33 +102,36 @@ abstract class BaseHoverAccessibleViewProvider extends Disposable implements IAc if (!this._hoverController) { return; } - this._markdownHoverFocusedIndex = -1; - this._hoverController.focus(); + if (this._focusedHoverPartIndex === -1) { + this._hoverController.focus(); + } else { + this._hoverController.focusHoverPartWithIndex(this._focusedHoverPartIndex); + } + this._focusedHoverPartIndex = -1; this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave = false; - this._onHoverContentsChanged?.dispose(); - } -} - -export class HoverAccessibilityHelpProvider extends BaseHoverAccessibleViewProvider implements IAccessibleViewContentProvider { - - public readonly options: IAccessibleViewOptions = { type: AccessibleViewType.Help }; - - constructor( - hoverController: HoverController, - ) { - super(hoverController); } - provideContent(): string { - return this.provideContentAtIndex(this._markdownHoverFocusedIndex); - } - - provideContentAtIndex(index: number): string { - const content: string[] = []; - content.push(HoverAccessibilityHelpNLS.intro); - content.push(...this._descriptionsOfVerbosityActionsForIndex(index)); - content.push(...this._descriptionOfFocusedMarkdownHoverAtIndex(index)); - return content.join('\n'); + provideContentAtIndex(focusedHoverIndex: number, includeVerbosityActions: boolean): string { + if (focusedHoverIndex !== -1) { + const accessibleContent = this._hoverController.getAccessibleWidgetContentAtIndex(focusedHoverIndex); + if (accessibleContent === undefined) { + return ''; + } + const contents: string[] = []; + if (includeVerbosityActions) { + contents.push(...this._descriptionsOfVerbosityActionsForIndex(focusedHoverIndex)); + } + contents.push(accessibleContent); + return contents.join('\n'); + } else { + const accessibleContent = this._hoverController.getAccessibleWidgetContent(); + if (accessibleContent === undefined) { + return ''; + } + const contents: string[] = []; + contents.push(accessibleContent); + return contents.join('\n'); + } } private _descriptionsOfVerbosityActionsForIndex(index: number): string[] { @@ -164,7 +148,7 @@ export class HoverAccessibilityHelpProvider extends BaseHoverAccessibleViewProvi } private _descriptionOfVerbosityActionForIndex(action: HoverVerbosityAction, index: number): string | undefined { - const isActionSupported = this._hoverController.doesMarkdownHoverAtIndexSupportVerbosityAction(index, action); + const isActionSupported = this._hoverController.doesHoverAtIndexSupportVerbosityAction(index, action); if (!isActionSupported) { return; } @@ -175,15 +159,18 @@ export class HoverAccessibilityHelpProvider extends BaseHoverAccessibleViewProvi return HoverAccessibilityHelpNLS.decreaseVerbosity; } } +} - protected _descriptionOfFocusedMarkdownHoverAtIndex(index: number): string[] { - const content: string[] = []; - const hoverContent = this._hoverController.markdownHoverContentAtIndex(index); - if (hoverContent) { - content.push('\n' + HoverAccessibilityHelpNLS.hoverContent); - content.push('\n' + hoverContent); - } - return content; +export class HoverAccessibilityHelpProvider extends BaseHoverAccessibleViewProvider implements IAccessibleViewContentProvider { + + public readonly options: IAccessibleViewOptions = { type: AccessibleViewType.Help }; + + constructor(hoverController: ContentHoverController) { + super(hoverController); + } + + provideContent(): string { + return this.provideContentAtIndex(this._focusedHoverPartIndex, true); } } @@ -194,15 +181,14 @@ export class HoverAccessibleViewProvider extends BaseHoverAccessibleViewProvider constructor( private readonly _keybindingService: IKeybindingService, private readonly _editor: ICodeEditor, - hoverController: HoverController, + hoverController: ContentHoverController, ) { super(hoverController); this._initializeOptions(this._editor, hoverController); } public provideContent(): string { - const hoverContent = this._hoverController.markdownHoverContentAtIndex(this._markdownHoverFocusedIndex); - return hoverContent.length > 0 ? hoverContent : this._hoverController.getWidgetContent() || HoverAccessibilityHelpNLS.intro; + return this.provideContentAtIndex(this._focusedHoverPartIndex, false); } public get actions(): IAction[] { @@ -229,26 +215,25 @@ export class HoverAccessibleViewProvider extends BaseHoverAccessibleViewProvider break; } const actionLabel = labelForHoverVerbosityAction(this._keybindingService, action); - const actionEnabled = this._hoverController.doesMarkdownHoverAtIndexSupportVerbosityAction(this._markdownHoverFocusedIndex, action); + const actionEnabled = this._hoverController.doesHoverAtIndexSupportVerbosityAction(this._focusedHoverPartIndex, action); return new Action(accessibleActionId, actionLabel, ThemeIcon.asClassName(actionCodicon), actionEnabled, () => { - editor.getAction(actionId)?.run({ index: this._markdownHoverFocusedIndex, focus: false }); + editor.getAction(actionId)?.run({ index: this._focusedHoverPartIndex, focus: false }); }); } - private _initializeOptions(editor: ICodeEditor, hoverController: HoverController): void { + private _initializeOptions(editor: ICodeEditor, hoverController: ContentHoverController): void { const helpProvider = this._register(new HoverAccessibilityHelpProvider(hoverController)); this.options.language = editor.getModel()?.getLanguageId(); - this.options.customHelp = () => { return helpProvider.provideContentAtIndex(this._markdownHoverFocusedIndex); }; + this.options.customHelp = () => { return helpProvider.provideContentAtIndex(this._focusedHoverPartIndex, true); }; } } export class ExtHoverAccessibleView implements IAccessibleViewImplentation { - public readonly type = AccessibleViewType.View; public readonly priority = 90; public readonly name = 'extension-hover'; - getProvider(accessor: ServicesAccessor): AdvancedContentProvider | undefined { + getProvider(accessor: ServicesAccessor): AccessibleContentProvider | undefined { const contextViewService = accessor.get(IContextViewService); const contextViewElement = contextViewService.getContextViewElement(); const extensionHoverContent = contextViewElement?.textContent ?? undefined; @@ -258,16 +243,14 @@ export class ExtHoverAccessibleView implements IAccessibleViewImplentation { // The accessible view, itself, uses the context view service to display the text. We don't want to read that. return; } - return { - id: AccessibleViewProviderId.Hover, - verbositySettingKey: 'accessibility.verbosity.hover', - provideContent() { return extensionHoverContent; }, - onClose() { + return new AccessibleContentProvider( + AccessibleViewProviderId.Hover, + { language: 'typescript', type: AccessibleViewType.View }, + () => { return extensionHoverContent; }, + () => { hoverService.showAndFocusLastHover(); }, - options: { language: 'typescript', type: AccessibleViewType.View } - }; + 'accessibility.verbosity.hover', + ); } - - dispose() { } } diff --git a/src/vs/editor/contrib/hover/browser/hoverActionIds.ts b/src/vs/editor/contrib/hover/browser/hoverActionIds.ts index 2ade6360ac1..95cd48dda49 100644 --- a/src/vs/editor/contrib/hover/browser/hoverActionIds.ts +++ b/src/vs/editor/contrib/hover/browser/hoverActionIds.ts @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../../nls.js'; export const SHOW_OR_FOCUS_HOVER_ACTION_ID = 'editor.action.showHover'; export const SHOW_DEFINITION_PREVIEW_HOVER_ACTION_ID = 'editor.action.showDefinitionPreviewHover'; diff --git a/src/vs/editor/contrib/hover/browser/hoverActions.ts b/src/vs/editor/contrib/hover/browser/hoverActions.ts index 20a5148fd74..7a4fbfe6228 100644 --- a/src/vs/editor/contrib/hover/browser/hoverActions.ts +++ b/src/vs/editor/contrib/hover/browser/hoverActions.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DECREASE_HOVER_VERBOSITY_ACTION_ID, DECREASE_HOVER_VERBOSITY_ACTION_LABEL, GO_TO_BOTTOM_HOVER_ACTION_ID, GO_TO_TOP_HOVER_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_LABEL, PAGE_DOWN_HOVER_ACTION_ID, PAGE_UP_HOVER_ACTION_ID, SCROLL_DOWN_HOVER_ACTION_ID, SCROLL_LEFT_HOVER_ACTION_ID, SCROLL_RIGHT_HOVER_ACTION_ID, SCROLL_UP_HOVER_ACTION_ID, SHOW_DEFINITION_PREVIEW_HOVER_ACTION_ID, SHOW_OR_FOCUS_HOVER_ACTION_ID } from 'vs/editor/contrib/hover/browser/hoverActionIds'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { GotoDefinitionAtPositionEditorContribution } from 'vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition'; -import { HoverStartMode, HoverStartSource } from 'vs/editor/contrib/hover/browser/hoverOperation'; -import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { HoverController } from 'vs/editor/contrib/hover/browser/hoverController'; -import { HoverVerbosityAction } from 'vs/editor/common/languages'; -import * as nls from 'vs/nls'; -import 'vs/css!./hover'; +import { DECREASE_HOVER_VERBOSITY_ACTION_ID, DECREASE_HOVER_VERBOSITY_ACTION_LABEL, GO_TO_BOTTOM_HOVER_ACTION_ID, GO_TO_TOP_HOVER_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_LABEL, PAGE_DOWN_HOVER_ACTION_ID, PAGE_UP_HOVER_ACTION_ID, SCROLL_DOWN_HOVER_ACTION_ID, SCROLL_LEFT_HOVER_ACTION_ID, SCROLL_RIGHT_HOVER_ACTION_ID, SCROLL_UP_HOVER_ACTION_ID, SHOW_DEFINITION_PREVIEW_HOVER_ACTION_ID, SHOW_OR_FOCUS_HOVER_ACTION_ID } from './hoverActionIds.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { GotoDefinitionAtPositionEditorContribution } from '../../gotoSymbol/browser/link/goToDefinitionAtPosition.js'; +import { HoverStartMode, HoverStartSource } from './hoverOperation.js'; +import { AccessibilitySupport } from '../../../../platform/accessibility/common/accessibility.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ContentHoverController } from './contentHoverController.js'; +import { HoverVerbosityAction } from '../../../common/languages.js'; +import * as nls from '../../../../nls.js'; +import './hover.css'; enum HoverFocusBehavior { NoAutoFocus = 'noAutoFocus', @@ -74,7 +74,7 @@ export class ShowOrFocusHoverAction extends EditorAction { return; } - const controller = HoverController.get(editor); + const controller = ContentHoverController.get(editor); if (!controller) { return; } @@ -128,7 +128,7 @@ export class ShowDefinitionPreviewHoverAction extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor): void { - const controller = HoverController.get(editor); + const controller = ContentHoverController.get(editor); if (!controller) { return; } @@ -176,7 +176,7 @@ export class ScrollUpHoverAction extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor): void { - const controller = HoverController.get(editor); + const controller = ContentHoverController.get(editor); if (!controller) { return; } @@ -209,7 +209,7 @@ export class ScrollDownHoverAction extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor): void { - const controller = HoverController.get(editor); + const controller = ContentHoverController.get(editor); if (!controller) { return; } @@ -242,7 +242,7 @@ export class ScrollLeftHoverAction extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor): void { - const controller = HoverController.get(editor); + const controller = ContentHoverController.get(editor); if (!controller) { return; } @@ -275,7 +275,7 @@ export class ScrollRightHoverAction extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor): void { - const controller = HoverController.get(editor); + const controller = ContentHoverController.get(editor); if (!controller) { return; } @@ -309,7 +309,7 @@ export class PageUpHoverAction extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor): void { - const controller = HoverController.get(editor); + const controller = ContentHoverController.get(editor); if (!controller) { return; } @@ -343,7 +343,7 @@ export class PageDownHoverAction extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor): void { - const controller = HoverController.get(editor); + const controller = ContentHoverController.get(editor); if (!controller) { return; } @@ -377,7 +377,7 @@ export class GoToTopHoverAction extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor): void { - const controller = HoverController.get(editor); + const controller = ContentHoverController.get(editor); if (!controller) { return; } @@ -412,7 +412,7 @@ export class GoToBottomHoverAction extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor): void { - const controller = HoverController.get(editor); + const controller = ContentHoverController.get(editor); if (!controller) { return; } @@ -432,7 +432,12 @@ export class IncreaseHoverVerbosityLevel extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor, args?: { index: number; focus: boolean }): void { - HoverController.get(editor)?.updateMarkdownHoverVerbosityLevel(HoverVerbosityAction.Increase, args?.index, args?.focus); + const hoverController = ContentHoverController.get(editor); + if (!hoverController) { + return; + } + const index = args?.index !== undefined ? args.index : hoverController.focusedHoverPartIndex(); + hoverController.updateHoverVerbosityLevel(HoverVerbosityAction.Increase, index, args?.focus); } } @@ -448,6 +453,11 @@ export class DecreaseHoverVerbosityLevel extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor, args?: { index: number; focus: boolean }): void { - HoverController.get(editor)?.updateMarkdownHoverVerbosityLevel(HoverVerbosityAction.Decrease, args?.index, args?.focus); + const hoverController = ContentHoverController.get(editor); + if (!hoverController) { + return; + } + const index = args?.index !== undefined ? args.index : hoverController.focusedHoverPartIndex(); + ContentHoverController.get(editor)?.updateHoverVerbosityLevel(HoverVerbosityAction.Decrease, index, args?.focus); } } diff --git a/src/vs/editor/contrib/hover/browser/hoverContribution.ts b/src/vs/editor/contrib/hover/browser/hoverContribution.ts index bf24cdc1c69..0143aa6ac24 100644 --- a/src/vs/editor/contrib/hover/browser/hoverContribution.ts +++ b/src/vs/editor/contrib/hover/browser/hoverContribution.ts @@ -3,19 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DecreaseHoverVerbosityLevel, GoToBottomHoverAction, GoToTopHoverAction, IncreaseHoverVerbosityLevel, PageDownHoverAction, PageUpHoverAction, ScrollDownHoverAction, ScrollLeftHoverAction, ScrollRightHoverAction, ScrollUpHoverAction, ShowDefinitionPreviewHoverAction, ShowOrFocusHoverAction } from 'vs/editor/contrib/hover/browser/hoverActions'; -import { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { editorHoverBorder } from 'vs/platform/theme/common/colorRegistry'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { HoverParticipantRegistry } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { MarkdownHoverParticipant } from 'vs/editor/contrib/hover/browser/markdownHoverParticipant'; -import { MarkerHoverParticipant } from 'vs/editor/contrib/hover/browser/markerHoverParticipant'; -import { HoverController } from 'vs/editor/contrib/hover/browser/hoverController'; -import 'vs/css!./hover'; -import { AccessibleViewRegistry } from 'vs/platform/accessibility/browser/accessibleViewRegistry'; -import { ExtHoverAccessibleView, HoverAccessibilityHelp, HoverAccessibleView } from 'vs/editor/contrib/hover/browser/hoverAccessibleViews'; +import { DecreaseHoverVerbosityLevel, GoToBottomHoverAction, GoToTopHoverAction, IncreaseHoverVerbosityLevel, PageDownHoverAction, PageUpHoverAction, ScrollDownHoverAction, ScrollLeftHoverAction, ScrollRightHoverAction, ScrollUpHoverAction, ShowDefinitionPreviewHoverAction, ShowOrFocusHoverAction } from './hoverActions.js'; +import { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { editorHoverBorder } from '../../../../platform/theme/common/colorRegistry.js'; +import { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { HoverParticipantRegistry } from './hoverTypes.js'; +import { MarkdownHoverParticipant } from './markdownHoverParticipant.js'; +import { MarkerHoverParticipant } from './markerHoverParticipant.js'; +import { ContentHoverController } from './contentHoverController.js'; +import { GlyphHoverController } from './glyphHoverController.js'; +import './hover.css'; +import { AccessibleViewRegistry } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js'; +import { ExtHoverAccessibleView, HoverAccessibilityHelp, HoverAccessibleView } from './hoverAccessibleViews.js'; -registerEditorContribution(HoverController.ID, HoverController, EditorContributionInstantiation.BeforeFirstInteraction); +registerEditorContribution(ContentHoverController.ID, ContentHoverController, EditorContributionInstantiation.BeforeFirstInteraction); +registerEditorContribution(GlyphHoverController.ID, GlyphHoverController, EditorContributionInstantiation.BeforeFirstInteraction); registerEditorAction(ShowOrFocusHoverAction); registerEditorAction(ShowDefinitionPreviewHoverAction); registerEditorAction(ScrollUpHoverAction); diff --git a/src/vs/editor/contrib/hover/browser/hoverController.ts b/src/vs/editor/contrib/hover/browser/hoverController.ts deleted file mode 100644 index 293902db46d..00000000000 --- a/src/vs/editor/contrib/hover/browser/hoverController.ts +++ /dev/null @@ -1,491 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { DECREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID, SHOW_OR_FOCUS_HOVER_ACTION_ID } from 'vs/editor/contrib/hover/browser/hoverActionIds'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { ICodeEditor, IEditorMouseEvent, IPartialEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution, IScrollEvent } from 'vs/editor/common/editorCommon'; -import { HoverStartMode, HoverStartSource } from 'vs/editor/contrib/hover/browser/hoverOperation'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IHoverWidget } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { InlineSuggestionHintsContentWidget } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver'; -import { HoverVerbosityAction } from 'vs/editor/common/languages'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { ContentHoverWidget } from 'vs/editor/contrib/hover/browser/contentHoverWidget'; -import { ContentHoverController } from 'vs/editor/contrib/hover/browser/contentHoverController'; -import 'vs/css!./hover'; -import { MarginHoverWidget } from 'vs/editor/contrib/hover/browser/marginHoverWidget'; -import { Emitter } from 'vs/base/common/event'; - -// sticky hover widget which doesn't disappear on focus out and such -const _sticky = false - // || Boolean("true") // done "weirdly" so that a lint warning prevents you from pushing this - ; - -interface IHoverSettings { - readonly enabled: boolean; - readonly sticky: boolean; - readonly hidingDelay: number; -} - -interface IHoverState { - mouseDown: boolean; - activatedByDecoratorClick: boolean; -} - -const enum HoverWidgetType { - Content, - Glyph, -} - -export class HoverController extends Disposable implements IEditorContribution { - - private readonly _onHoverContentsChanged = this._register(new Emitter()); - public readonly onHoverContentsChanged = this._onHoverContentsChanged.event; - - public static readonly ID = 'editor.contrib.hover'; - - public shouldKeepOpenOnEditorMouseMoveOrLeave: boolean = false; - - private readonly _listenersStore = new DisposableStore(); - - private _glyphWidget: MarginHoverWidget | undefined; - private _contentWidget: ContentHoverController | undefined; - - private _mouseMoveEvent: IEditorMouseEvent | undefined; - private _reactToEditorMouseMoveRunner: RunOnceScheduler; - - private _hoverSettings!: IHoverSettings; - private _hoverState: IHoverState = { - mouseDown: false, - activatedByDecoratorClick: false - }; - - constructor( - private readonly _editor: ICodeEditor, - @IInstantiationService private readonly _instantiationService: IInstantiationService, - @IKeybindingService private readonly _keybindingService: IKeybindingService - ) { - super(); - this._reactToEditorMouseMoveRunner = this._register( - new RunOnceScheduler( - () => this._reactToEditorMouseMove(this._mouseMoveEvent), 0 - ) - ); - this._hookListeners(); - this._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => { - if (e.hasChanged(EditorOption.hover)) { - this._unhookListeners(); - this._hookListeners(); - } - })); - } - - static get(editor: ICodeEditor): HoverController | null { - return editor.getContribution(HoverController.ID); - } - - private _hookListeners(): void { - - const hoverOpts = this._editor.getOption(EditorOption.hover); - this._hoverSettings = { - enabled: hoverOpts.enabled, - sticky: hoverOpts.sticky, - hidingDelay: hoverOpts.delay - }; - - if (hoverOpts.enabled) { - this._listenersStore.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e))); - this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())); - this._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e))); - this._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e))); - } else { - this._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e))); - this._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e))); - } - - this._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e))); - this._listenersStore.add(this._editor.onDidChangeModel(() => { - this._cancelScheduler(); - this._hideWidgets(); - })); - this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())); - this._listenersStore.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e))); - } - - private _unhookListeners(): void { - this._listenersStore.clear(); - } - - private _cancelScheduler() { - this._mouseMoveEvent = undefined; - this._reactToEditorMouseMoveRunner.cancel(); - } - - private _onEditorScrollChanged(e: IScrollEvent): void { - if (e.scrollTopChanged || e.scrollLeftChanged) { - this._hideWidgets(); - } - } - - private _onEditorMouseDown(mouseEvent: IEditorMouseEvent): void { - - this._hoverState.mouseDown = true; - - const shouldNotHideCurrentHoverWidget = this._shouldNotHideCurrentHoverWidget(mouseEvent); - if (shouldNotHideCurrentHoverWidget) { - return; - } - - this._hideWidgets(); - } - - private _shouldNotHideCurrentHoverWidget(mouseEvent: IPartialEditorMouseEvent): boolean { - if ( - this._isMouseOnContentHoverWidget(mouseEvent) - || this._isMouseOnMarginHoverWidget(mouseEvent) - || this._isContentWidgetResizing() - ) { - return true; - } - return false; - } - - private _isMouseOnMarginHoverWidget(mouseEvent: IPartialEditorMouseEvent): boolean { - const target = mouseEvent.target; - if (!target) { - return false; - } - return target.type === MouseTargetType.OVERLAY_WIDGET && target.detail === MarginHoverWidget.ID; - } - - private _isMouseOnContentHoverWidget(mouseEvent: IPartialEditorMouseEvent): boolean { - const target = mouseEvent.target; - if (!target) { - return false; - } - return target.type === MouseTargetType.CONTENT_WIDGET && target.detail === ContentHoverWidget.ID; - } - - private _onEditorMouseUp(): void { - this._hoverState.mouseDown = false; - } - - private _onEditorMouseLeave(mouseEvent: IPartialEditorMouseEvent): void { - if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) { - return; - } - - this._cancelScheduler(); - - const shouldNotHideCurrentHoverWidget = this._shouldNotHideCurrentHoverWidget(mouseEvent); - if (shouldNotHideCurrentHoverWidget) { - return; - } - if (_sticky) { - return; - } - this._hideWidgets(); - } - - private _shouldNotRecomputeCurrentHoverWidget(mouseEvent: IEditorMouseEvent): boolean { - - const isHoverSticky = this._hoverSettings.sticky; - - const isMouseOnStickyMarginHoverWidget = (mouseEvent: IEditorMouseEvent, isHoverSticky: boolean) => { - const isMouseOnMarginHoverWidget = this._isMouseOnMarginHoverWidget(mouseEvent); - return isHoverSticky && isMouseOnMarginHoverWidget; - }; - const isMouseOnStickyContentHoverWidget = (mouseEvent: IEditorMouseEvent, isHoverSticky: boolean) => { - const isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent); - return isHoverSticky && isMouseOnContentHoverWidget; - }; - const isMouseOnColorPicker = (mouseEvent: IEditorMouseEvent) => { - const isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent); - const isColorPickerVisible = this._contentWidget?.isColorPickerVisible; - return isMouseOnContentHoverWidget && isColorPickerVisible; - }; - // TODO@aiday-mar verify if the following is necessary code - const isTextSelectedWithinContentHoverWidget = (mouseEvent: IEditorMouseEvent, sticky: boolean) => { - return sticky - && this._contentWidget?.containsNode(mouseEvent.event.browserEvent.view?.document.activeElement) - && !mouseEvent.event.browserEvent.view?.getSelection()?.isCollapsed; - }; - - if ( - isMouseOnStickyMarginHoverWidget(mouseEvent, isHoverSticky) - || isMouseOnStickyContentHoverWidget(mouseEvent, isHoverSticky) - || isMouseOnColorPicker(mouseEvent) - || isTextSelectedWithinContentHoverWidget(mouseEvent, isHoverSticky) - ) { - return true; - } - return false; - } - - private _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void { - if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) { - return; - } - - this._mouseMoveEvent = mouseEvent; - if (this._contentWidget?.isFocused || this._contentWidget?.isResizing) { - return; - } - const sticky = this._hoverSettings.sticky; - if (sticky && this._contentWidget?.isVisibleFromKeyboard) { - // Sticky mode is on and the hover has been shown via keyboard - // so moving the mouse has no effect - return; - } - - const shouldNotRecomputeCurrentHoverWidget = this._shouldNotRecomputeCurrentHoverWidget(mouseEvent); - if (shouldNotRecomputeCurrentHoverWidget) { - this._reactToEditorMouseMoveRunner.cancel(); - return; - } - - const hidingDelay = this._hoverSettings.hidingDelay; - const isContentHoverWidgetVisible = this._contentWidget?.isVisible; - // If the mouse is not over the widget, and if sticky is on, - // then give it a grace period before reacting to the mouse event - const shouldRescheduleHoverComputation = isContentHoverWidgetVisible && sticky && hidingDelay > 0; - - if (shouldRescheduleHoverComputation) { - if (!this._reactToEditorMouseMoveRunner.isScheduled()) { - this._reactToEditorMouseMoveRunner.schedule(hidingDelay); - } - return; - } - this._reactToEditorMouseMove(mouseEvent); - } - - private _reactToEditorMouseMove(mouseEvent: IEditorMouseEvent | undefined): void { - - if (!mouseEvent) { - return; - } - - const target = mouseEvent.target; - const mouseOnDecorator = target.element?.classList.contains('colorpicker-color-decoration'); - const decoratorActivatedOn = this._editor.getOption(EditorOption.colorDecoratorsActivatedOn); - - const enabled = this._hoverSettings.enabled; - const activatedByDecoratorClick = this._hoverState.activatedByDecoratorClick; - if ( - ( - mouseOnDecorator && ( - (decoratorActivatedOn === 'click' && !activatedByDecoratorClick) || - (decoratorActivatedOn === 'hover' && !enabled && !_sticky) || - (decoratorActivatedOn === 'clickAndHover' && !enabled && !activatedByDecoratorClick)) - ) || ( - !mouseOnDecorator && !enabled && !activatedByDecoratorClick - ) - ) { - this._hideWidgets(); - return; - } - - const contentHoverShowsOrWillShow = this._tryShowHoverWidget(mouseEvent, HoverWidgetType.Content); - if (contentHoverShowsOrWillShow) { - return; - } - - const glyphWidgetShowsOrWillShow = this._tryShowHoverWidget(mouseEvent, HoverWidgetType.Glyph); - if (glyphWidgetShowsOrWillShow) { - return; - } - if (_sticky) { - return; - } - this._hideWidgets(); - } - - private _tryShowHoverWidget(mouseEvent: IEditorMouseEvent, hoverWidgetType: HoverWidgetType): boolean { - const contentWidget: IHoverWidget = this._getOrCreateContentWidget(); - const glyphWidget: IHoverWidget = this._getOrCreateGlyphWidget(); - let currentWidget: IHoverWidget; - let otherWidget: IHoverWidget; - switch (hoverWidgetType) { - case HoverWidgetType.Content: - currentWidget = contentWidget; - otherWidget = glyphWidget; - break; - case HoverWidgetType.Glyph: - currentWidget = glyphWidget; - otherWidget = contentWidget; - break; - default: - throw new Error(`HoverWidgetType ${hoverWidgetType} is unrecognized`); - } - - const showsOrWillShow = currentWidget.showsOrWillShow(mouseEvent); - if (showsOrWillShow) { - otherWidget.hide(); - } - return showsOrWillShow; - } - - private _onKeyDown(e: IKeyboardEvent): void { - if (!this._editor.hasModel()) { - return; - } - - const resolvedKeyboardEvent = this._keybindingService.softDispatch(e, this._editor.getDomNode()); - - // If the beginning of a multi-chord keybinding is pressed, - // or the command aims to focus the hover, - // set the variable to true, otherwise false - const shouldKeepHoverVisible = ( - resolvedKeyboardEvent.kind === ResultKind.MoreChordsNeeded || - (resolvedKeyboardEvent.kind === ResultKind.KbFound - && (resolvedKeyboardEvent.commandId === SHOW_OR_FOCUS_HOVER_ACTION_ID - || resolvedKeyboardEvent.commandId === INCREASE_HOVER_VERBOSITY_ACTION_ID - || resolvedKeyboardEvent.commandId === DECREASE_HOVER_VERBOSITY_ACTION_ID) - && this._contentWidget?.isVisible - ) - ); - - if ( - e.keyCode === KeyCode.Ctrl - || e.keyCode === KeyCode.Alt - || e.keyCode === KeyCode.Meta - || e.keyCode === KeyCode.Shift - || shouldKeepHoverVisible - ) { - // Do not hide hover when a modifier key is pressed - return; - } - - this._hideWidgets(); - } - - private _hideWidgets(): void { - if (_sticky) { - return; - } - if (( - this._hoverState.mouseDown - && this._contentWidget?.isColorPickerVisible - ) || InlineSuggestionHintsContentWidget.dropDownVisible) { - return; - } - this._hoverState.activatedByDecoratorClick = false; - this._glyphWidget?.hide(); - this._contentWidget?.hide(); - } - - private _getOrCreateContentWidget(): ContentHoverController { - if (!this._contentWidget) { - this._contentWidget = this._instantiationService.createInstance(ContentHoverController, this._editor); - this._listenersStore.add(this._contentWidget.onContentsChanged(() => this._onHoverContentsChanged.fire())); - } - return this._contentWidget; - } - - private _getOrCreateGlyphWidget(): MarginHoverWidget { - if (!this._glyphWidget) { - this._glyphWidget = this._instantiationService.createInstance(MarginHoverWidget, this._editor); - } - return this._glyphWidget; - } - - public hideContentHover(): void { - this._hideWidgets(); - } - - public showContentHover( - range: Range, - mode: HoverStartMode, - source: HoverStartSource, - focus: boolean, - activatedByColorDecoratorClick: boolean = false - ): void { - this._hoverState.activatedByDecoratorClick = activatedByColorDecoratorClick; - this._getOrCreateContentWidget().startShowingAtRange(range, mode, source, focus); - } - - private _isContentWidgetResizing(): boolean { - return this._contentWidget?.widget.isResizing || false; - } - - public focusedMarkdownHoverIndex(): number { - return this._getOrCreateContentWidget().focusedMarkdownHoverIndex(); - } - - public markdownHoverContentAtIndex(index: number): string { - return this._getOrCreateContentWidget().markdownHoverContentAtIndex(index); - } - - public doesMarkdownHoverAtIndexSupportVerbosityAction(index: number, action: HoverVerbosityAction): boolean { - return this._getOrCreateContentWidget().doesMarkdownHoverAtIndexSupportVerbosityAction(index, action); - } - - public updateMarkdownHoverVerbosityLevel(action: HoverVerbosityAction, index?: number, focus?: boolean): void { - this._getOrCreateContentWidget().updateMarkdownHoverVerbosityLevel(action, index, focus); - } - - public focus(): void { - this._contentWidget?.focus(); - } - - public scrollUp(): void { - this._contentWidget?.scrollUp(); - } - - public scrollDown(): void { - this._contentWidget?.scrollDown(); - } - - public scrollLeft(): void { - this._contentWidget?.scrollLeft(); - } - - public scrollRight(): void { - this._contentWidget?.scrollRight(); - } - - public pageUp(): void { - this._contentWidget?.pageUp(); - } - - public pageDown(): void { - this._contentWidget?.pageDown(); - } - - public goToTop(): void { - this._contentWidget?.goToTop(); - } - - public goToBottom(): void { - this._contentWidget?.goToBottom(); - } - - public getWidgetContent(): string | undefined { - return this._contentWidget?.getWidgetContent(); - } - - public get isColorPickerVisible(): boolean | undefined { - return this._contentWidget?.isColorPickerVisible; - } - - public get isHoverVisible(): boolean | undefined { - return this._contentWidget?.isVisible; - } - - public override dispose(): void { - super.dispose(); - this._unhookListeners(); - this._listenersStore.dispose(); - this._glyphWidget?.dispose(); - this._contentWidget?.dispose(); - } -} diff --git a/src/vs/editor/contrib/hover/browser/hoverOperation.ts b/src/vs/editor/contrib/hover/browser/hoverOperation.ts index 79c56ade663..cb73dddfb5c 100644 --- a/src/vs/editor/contrib/hover/browser/hoverOperation.ts +++ b/src/vs/editor/contrib/hover/browser/hoverOperation.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AsyncIterableObject, CancelableAsyncIterableObject, createCancelableAsyncIterable, RunOnceScheduler } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; - -export interface IHoverComputer { +import { AsyncIterableObject, CancelableAsyncIterableObject, createCancelableAsyncIterable, RunOnceScheduler } from '../../../../base/common/async.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; + +export interface IHoverComputer { /** * This is called after half the hover time */ - computeAsync?: (token: CancellationToken) => AsyncIterableObject; + computeAsync?: (args: TArgs, token: CancellationToken) => AsyncIterableObject; /** * This is called after all the hover time */ - computeSync?: () => T[]; + computeSync?: (args: TArgs) => TResult[]; } const enum HoverOperationState { @@ -40,11 +40,12 @@ export const enum HoverStartSource { Keyboard = 1 } -export class HoverResult { +export class HoverResult { constructor( - public readonly value: T[], + public readonly value: TResult[], public readonly isComplete: boolean, public readonly hasLoadingMessage: boolean, + public readonly options: TArgs ) { } } @@ -58,23 +59,24 @@ export class HoverResult { * - if there are sync or async results, they are rendered. * - at 900ms, if the async computation hasn't finished, a "Loading..." result is added. */ -export class HoverOperation extends Disposable { +export class HoverOperation extends Disposable { - private readonly _onResult = this._register(new Emitter>()); + private readonly _onResult = this._register(new Emitter>()); public readonly onResult = this._onResult.event; - private readonly _firstWaitScheduler = this._register(new RunOnceScheduler(() => this._triggerAsyncComputation(), 0)); - private readonly _secondWaitScheduler = this._register(new RunOnceScheduler(() => this._triggerSyncComputation(), 0)); - private readonly _loadingMessageScheduler = this._register(new RunOnceScheduler(() => this._triggerLoadingMessage(), 0)); + private readonly _asyncComputationScheduler = this._register(new Debouncer((options: TArgs) => this._triggerAsyncComputation(options), 0)); + private readonly _syncComputationScheduler = this._register(new Debouncer((options: TArgs) => this._triggerSyncComputation(options), 0)); + private readonly _loadingMessageScheduler = this._register(new Debouncer((options: TArgs) => this._triggerLoadingMessage(options), 0)); private _state = HoverOperationState.Idle; - private _asyncIterable: CancelableAsyncIterableObject | null = null; + private _asyncIterable: CancelableAsyncIterableObject | null = null; private _asyncIterableDone: boolean = false; - private _result: T[] = []; + private _result: TResult[] = []; + private _options: TArgs | undefined; constructor( private readonly _editor: ICodeEditor, - private readonly _computer: IHoverComputer + private readonly _computer: IHoverComputer ) { super(); } @@ -84,6 +86,7 @@ export class HoverOperation extends Disposable { this._asyncIterable.cancel(); this._asyncIterable = null; } + this._options = undefined; super.dispose(); } @@ -103,33 +106,31 @@ export class HoverOperation extends Disposable { return 3 * this._hoverTime; } - private _setState(state: HoverOperationState, fireResult: boolean = true): void { + private _setState(state: HoverOperationState, options: TArgs): void { this._state = state; - if (fireResult) { - this._fireResult(); - } + this._fireResult(options); } - private _triggerAsyncComputation(): void { - this._setState(HoverOperationState.SecondWait); - this._secondWaitScheduler.schedule(this._secondWaitTime); + private _triggerAsyncComputation(options: TArgs): void { + this._setState(HoverOperationState.SecondWait, options); + this._syncComputationScheduler.schedule(options, this._secondWaitTime); if (this._computer.computeAsync) { this._asyncIterableDone = false; - this._asyncIterable = createCancelableAsyncIterable(token => this._computer.computeAsync!(token)); + this._asyncIterable = createCancelableAsyncIterable(token => this._computer.computeAsync!(options, token)); (async () => { try { for await (const item of this._asyncIterable!) { if (item) { this._result.push(item); - this._fireResult(); + this._fireResult(options); } } this._asyncIterableDone = true; if (this._state === HoverOperationState.WaitingForAsync || this._state === HoverOperationState.WaitingForAsyncShowingLoading) { - this._setState(HoverOperationState.Idle); + this._setState(HoverOperationState.Idle, options); } } catch (e) { @@ -142,61 +143,86 @@ export class HoverOperation extends Disposable { } } - private _triggerSyncComputation(): void { + private _triggerSyncComputation(options: TArgs): void { if (this._computer.computeSync) { - this._result = this._result.concat(this._computer.computeSync()); + this._result = this._result.concat(this._computer.computeSync(options)); } - this._setState(this._asyncIterableDone ? HoverOperationState.Idle : HoverOperationState.WaitingForAsync); + this._setState(this._asyncIterableDone ? HoverOperationState.Idle : HoverOperationState.WaitingForAsync, options); } - private _triggerLoadingMessage(): void { + private _triggerLoadingMessage(options: TArgs): void { if (this._state === HoverOperationState.WaitingForAsync) { - this._setState(HoverOperationState.WaitingForAsyncShowingLoading); + this._setState(HoverOperationState.WaitingForAsyncShowingLoading, options); } } - private _fireResult(): void { + private _fireResult(options: TArgs): void { if (this._state === HoverOperationState.FirstWait || this._state === HoverOperationState.SecondWait) { // Do not send out results before the hover time return; } const isComplete = (this._state === HoverOperationState.Idle); const hasLoadingMessage = (this._state === HoverOperationState.WaitingForAsyncShowingLoading); - this._onResult.fire(new HoverResult(this._result.slice(0), isComplete, hasLoadingMessage)); + this._onResult.fire(new HoverResult(this._result.slice(0), isComplete, hasLoadingMessage, options)); } - public start(mode: HoverStartMode): void { + public start(mode: HoverStartMode, options: TArgs): void { if (mode === HoverStartMode.Delayed) { if (this._state === HoverOperationState.Idle) { - this._setState(HoverOperationState.FirstWait); - this._firstWaitScheduler.schedule(this._firstWaitTime); - this._loadingMessageScheduler.schedule(this._loadingMessageTime); + this._setState(HoverOperationState.FirstWait, options); + this._asyncComputationScheduler.schedule(options, this._firstWaitTime); + this._loadingMessageScheduler.schedule(options, this._loadingMessageTime); } } else { switch (this._state) { case HoverOperationState.Idle: - this._triggerAsyncComputation(); - this._secondWaitScheduler.cancel(); - this._triggerSyncComputation(); + this._triggerAsyncComputation(options); + this._syncComputationScheduler.cancel(); + this._triggerSyncComputation(options); break; case HoverOperationState.SecondWait: - this._secondWaitScheduler.cancel(); - this._triggerSyncComputation(); + this._syncComputationScheduler.cancel(); + this._triggerSyncComputation(options); break; } } } public cancel(): void { - this._firstWaitScheduler.cancel(); - this._secondWaitScheduler.cancel(); + this._asyncComputationScheduler.cancel(); + this._syncComputationScheduler.cancel(); this._loadingMessageScheduler.cancel(); if (this._asyncIterable) { this._asyncIterable.cancel(); this._asyncIterable = null; } this._result = []; - this._setState(HoverOperationState.Idle, false); + this._options = undefined; + this._state = HoverOperationState.Idle; + } + + public get options(): TArgs | undefined { + return this._options; } +} + +class Debouncer extends Disposable { + + private readonly _scheduler: RunOnceScheduler; + + private _options: TArgs | undefined; + constructor(runner: (options: TArgs) => void, debounceTimeMs: number) { + super(); + this._scheduler = this._register(new RunOnceScheduler(() => runner(this._options!), debounceTimeMs)); + } + + schedule(options: TArgs, debounceTimeMs: number): void { + this._options = options; + this._scheduler.schedule(debounceTimeMs); + } + + cancel(): void { + this._scheduler.cancel(); + } } diff --git a/src/vs/editor/contrib/hover/browser/hoverTypes.ts b/src/vs/editor/contrib/hover/browser/hoverTypes.ts index 0caaba7f030..b557fce3ba3 100644 --- a/src/vs/editor/contrib/hover/browser/hoverTypes.ts +++ b/src/vs/editor/contrib/hover/browser/hoverTypes.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Dimension } from 'vs/base/browser/dom'; -import { AsyncIterableObject } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor, IEditorMouseEvent } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IModelDecoration } from 'vs/editor/common/model'; -import { BrandedService, IConstructorSignature } from 'vs/platform/instantiation/common/instantiation'; +import { Dimension } from '../../../../base/browser/dom.js'; +import { AsyncIterableObject } from '../../../../base/common/async.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor, IEditorMouseEvent } from '../../../browser/editorBrowser.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IModelDecoration } from '../../../common/model.js'; +import { BrandedService, IConstructorSignature } from '../../../../platform/instantiation/common/instantiation.js'; export interface IHoverPart { /** @@ -120,13 +120,46 @@ export interface IEditorHoverRenderContext extends IEditorHoverContext { readonly statusBar: IEditorHoverStatusBar; } +export interface IRenderedHoverPart extends IDisposable { + /** + * The rendered hover part. + */ + hoverPart: T; + /** + * The HTML element containing the hover part. + */ + hoverElement: HTMLElement; +} + +export interface IRenderedHoverParts extends IDisposable { + /** + * Array of rendered hover parts. + */ + renderedHoverParts: IRenderedHoverPart[]; +} + +/** + * Default implementation of IRenderedHoverParts. + */ +export class RenderedHoverParts implements IRenderedHoverParts { + + constructor(public readonly renderedHoverParts: IRenderedHoverPart[]) { } + + dispose() { + for (const part of this.renderedHoverParts) { + part.dispose(); + } + } +} + export interface IEditorHoverParticipant { readonly hoverOrdinal: number; suggestHoverAnchor?(mouseEvent: IEditorMouseEvent): HoverAnchor | null; computeSync(anchor: HoverAnchor, lineDecorations: IModelDecoration[]): T[]; computeAsync?(anchor: HoverAnchor, lineDecorations: IModelDecoration[], token: CancellationToken): AsyncIterableObject; createLoadingMessage?(anchor: HoverAnchor): T | null; - renderHoverParts(context: IEditorHoverRenderContext, hoverParts: T[]): IDisposable; + renderHoverParts(context: IEditorHoverRenderContext, hoverParts: T[]): IRenderedHoverParts; + getAccessibleContent(hoverPart: T): string; handleResize?(): void; } diff --git a/src/vs/editor/contrib/hover/browser/hoverUtils.ts b/src/vs/editor/contrib/hover/browser/hoverUtils.ts new file mode 100644 index 00000000000..7f4a74956b6 --- /dev/null +++ b/src/vs/editor/contrib/hover/browser/hoverUtils.ts @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as dom from '../../../../base/browser/dom.js'; + +export function isMousePositionWithinElement(element: HTMLElement, posx: number, posy: number): boolean { + const elementRect = dom.getDomNodePagePosition(element); + if (posx < elementRect.left + || posx > elementRect.left + elementRect.width + || posy < elementRect.top + || posy > elementRect.top + elementRect.height) { + return false; + } + return true; +} diff --git a/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts b/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts index 7bc9ae9985e..db9528985a7 100644 --- a/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts +++ b/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts @@ -3,36 +3,37 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { asArray, compareBy, numberComparator } from 'vs/base/common/arrays'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { IMarkdownString, isEmptyMarkdownString, MarkdownString } from 'vs/base/common/htmlContent'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { MarkdownRenderer } from 'vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; -import { DECREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID } from 'vs/editor/contrib/hover/browser/hoverActionIds'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IModelDecoration, ITextModel } from 'vs/editor/common/model'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { HoverAnchor, HoverAnchorType, HoverRangeAnchor, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import * as nls from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Hover, HoverContext, HoverProvider, HoverVerbosityAction } from 'vs/editor/common/languages'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ClickAction, HoverPosition, KeyDownAction } from 'vs/base/browser/ui/hover/hoverWidget'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { IHoverService, WorkbenchHoverDelegate } from 'vs/platform/hover/browser/hover'; -import { AsyncIterableObject } from 'vs/base/common/async'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { getHoverProviderResultsAsAsyncIterable } from 'vs/editor/contrib/hover/browser/getHover'; +import * as dom from '../../../../base/browser/dom.js'; +import { asArray, compareBy, numberComparator } from '../../../../base/common/arrays.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { IMarkdownString, isEmptyMarkdownString, MarkdownString } from '../../../../base/common/htmlContent.js'; +import { DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js'; +import { MarkdownRenderer } from '../../../browser/widget/markdownRenderer/browser/markdownRenderer.js'; +import { DECREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID } from './hoverActionIds.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IModelDecoration, ITextModel } from '../../../common/model.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { HoverAnchor, HoverAnchorType, HoverRangeAnchor, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js'; +import * as nls from '../../../../nls.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Hover, HoverContext, HoverProvider, HoverVerbosityAction } from '../../../common/languages.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { ClickAction, HoverPosition, KeyDownAction } from '../../../../base/browser/ui/hover/hoverWidget.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { IHoverService, WorkbenchHoverDelegate } from '../../../../platform/hover/browser/hover.js'; +import { AsyncIterableObject } from '../../../../base/common/async.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { getHoverProviderResultsAsAsyncIterable } from './getHover.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; const $ = dom.$; const increaseHoverVerbosityIcon = registerIcon('hover-increase-verbosity', Codicon.add, nls.localize('increaseHoverVerbosity', 'Icon for increaseing hover verbosity.')); @@ -90,6 +91,7 @@ export class MarkdownHoverParticipant implements IEditorHoverParticipant { this._renderedHoverParts = new MarkdownRenderedHoverParts( hoverParts, context.fragment, + this, this._editor, this._languageService, this._openerService, + this._commandService, this._keybindingService, this._hoverService, this._configurationService, @@ -191,55 +195,65 @@ export class MarkdownHoverParticipant implements IEditorHoverParticipant { + return Promise.resolve(this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(action, index, focus)); } } -interface RenderedHoverPart { - renderedMarkdown: HTMLElement; - disposables: DisposableStore; - hoverSource?: HoverSource; +class RenderedMarkdownHoverPart implements IRenderedHoverPart { + + constructor( + public readonly hoverPart: MarkdownHover, + public readonly hoverElement: HTMLElement, + public readonly disposables: DisposableStore, + ) { } + + get hoverAccessibleContent(): string { + return this.hoverElement.innerText.trim(); + } + + dispose(): void { + this.disposables.dispose(); + } } -class MarkdownRenderedHoverParts extends Disposable { +class MarkdownRenderedHoverParts implements IRenderedHoverParts { + + public renderedHoverParts: RenderedMarkdownHoverPart[]; - private _renderedHoverParts: RenderedHoverPart[]; - private _focusedHoverPartIndex: number = -1; private _ongoingHoverOperations: Map = new Map(); + private readonly _disposables = new DisposableStore(); + constructor( - hoverParts: MarkdownHover[], // we own! + hoverParts: MarkdownHover[], hoverPartsContainer: DocumentFragment, + private readonly _hoverParticipant: MarkdownHoverParticipant, private readonly _editor: ICodeEditor, private readonly _languageService: ILanguageService, private readonly _openerService: IOpenerService, + private readonly _commandService: ICommandService, private readonly _keybindingService: IKeybindingService, private readonly _hoverService: IHoverService, private readonly _configurationService: IConfigurationService, private readonly _onFinishedRendering: () => void, ) { - super(); - this._renderedHoverParts = this._renderHoverParts(hoverParts, hoverPartsContainer, this._onFinishedRendering); - this._register(toDisposable(() => { - this._renderedHoverParts.forEach(renderedHoverPart => { - renderedHoverPart.disposables.dispose(); + this.renderedHoverParts = this._renderHoverParts(hoverParts, hoverPartsContainer, this._onFinishedRendering); + this._disposables.add(toDisposable(() => { + this.renderedHoverParts.forEach(renderedHoverPart => { + renderedHoverPart.dispose(); + }); + this._ongoingHoverOperations.forEach(operation => { + operation.tokenSource.dispose(true); }); - })); - this._register(toDisposable(() => { - this._ongoingHoverOperations.forEach(operation => { operation.tokenSource.dispose(true); }); })); } @@ -247,75 +261,57 @@ class MarkdownRenderedHoverParts extends Disposable { hoverParts: MarkdownHover[], hoverPartsContainer: DocumentFragment, onFinishedRendering: () => void, - ): RenderedHoverPart[] { + ): RenderedMarkdownHoverPart[] { hoverParts.sort(compareBy(hover => hover.ordinal, numberComparator)); - return hoverParts.map((hoverPart, hoverIndex) => { - const renderedHoverPart = this._renderHoverPart( - hoverIndex, - hoverPart.contents, - hoverPart.source, - onFinishedRendering - ); - hoverPartsContainer.appendChild(renderedHoverPart.renderedMarkdown); + return hoverParts.map(hoverPart => { + const renderedHoverPart = this._renderHoverPart(hoverPart, onFinishedRendering); + hoverPartsContainer.appendChild(renderedHoverPart.hoverElement); return renderedHoverPart; }); } private _renderHoverPart( - hoverPartIndex: number, - hoverContents: IMarkdownString[], - hoverSource: HoverSource | undefined, + hoverPart: MarkdownHover, onFinishedRendering: () => void - ): RenderedHoverPart { + ): RenderedMarkdownHoverPart { - const { renderedMarkdown, disposables } = this._renderMarkdownContent(hoverContents, onFinishedRendering); + const renderedMarkdownPart = this._renderMarkdownHover(hoverPart, onFinishedRendering); + const renderedMarkdownElement = renderedMarkdownPart.hoverElement; + const hoverSource = hoverPart.source; + const disposables = new DisposableStore(); + disposables.add(renderedMarkdownPart); if (!hoverSource) { - return { renderedMarkdown, disposables }; + return new RenderedMarkdownHoverPart(hoverPart, renderedMarkdownElement, disposables); } const canIncreaseVerbosity = hoverSource.supportsVerbosityAction(HoverVerbosityAction.Increase); const canDecreaseVerbosity = hoverSource.supportsVerbosityAction(HoverVerbosityAction.Decrease); if (!canIncreaseVerbosity && !canDecreaseVerbosity) { - return { renderedMarkdown, disposables, hoverSource }; + return new RenderedMarkdownHoverPart(hoverPart, renderedMarkdownElement, disposables); } const actionsContainer = $('div.verbosity-actions'); - renderedMarkdown.prepend(actionsContainer); + renderedMarkdownElement.prepend(actionsContainer); disposables.add(this._renderHoverExpansionAction(actionsContainer, HoverVerbosityAction.Increase, canIncreaseVerbosity)); disposables.add(this._renderHoverExpansionAction(actionsContainer, HoverVerbosityAction.Decrease, canDecreaseVerbosity)); - - this._register(dom.addDisposableListener(renderedMarkdown, dom.EventType.FOCUS_IN, (event: Event) => { - event.stopPropagation(); - this._focusedHoverPartIndex = hoverPartIndex; - })); - this._register(dom.addDisposableListener(renderedMarkdown, dom.EventType.FOCUS_OUT, (event: Event) => { - event.stopPropagation(); - this._focusedHoverPartIndex = -1; - })); - return { renderedMarkdown, disposables, hoverSource }; + return new RenderedMarkdownHoverPart(hoverPart, renderedMarkdownElement, disposables); } - private _renderMarkdownContent( - markdownContent: IMarkdownString[], + private _renderMarkdownHover( + markdownHover: MarkdownHover, onFinishedRendering: () => void - ): RenderedHoverPart { - const renderedMarkdown = $('div.hover-row'); - renderedMarkdown.tabIndex = 0; - const renderedMarkdownContents = $('div.hover-row-contents'); - renderedMarkdown.appendChild(renderedMarkdownContents); - const disposables = new DisposableStore(); - disposables.add(renderMarkdownInContainer( + ): IRenderedHoverPart { + const renderedMarkdownHover = renderMarkdownInContainer( this._editor, - renderedMarkdownContents, - markdownContent, + markdownHover, this._languageService, this._openerService, onFinishedRendering, - )); - return { renderedMarkdown, disposables }; + ); + return renderedMarkdownHover; } private _renderHoverExpansionAction(container: HTMLElement, action: HoverVerbosityAction, actionEnabled: boolean): DisposableStore { @@ -330,53 +326,68 @@ class MarkdownRenderedHoverParts extends Disposable { return store; } actionElement.classList.add('enabled'); - const actionFunction = () => this.updateMarkdownHoverPartVerbosityLevel(action); + const actionFunction = () => this._commandService.executeCommand(action === HoverVerbosityAction.Increase ? INCREASE_HOVER_VERBOSITY_ACTION_ID : DECREASE_HOVER_VERBOSITY_ACTION_ID); store.add(new ClickAction(actionElement, actionFunction)); store.add(new KeyDownAction(actionElement, actionFunction, [KeyCode.Enter, KeyCode.Space])); return store; } - public async updateMarkdownHoverPartVerbosityLevel(action: HoverVerbosityAction, index: number = -1, focus: boolean = true): Promise { + public async updateMarkdownHoverPartVerbosityLevel(action: HoverVerbosityAction, index: number, focus: boolean = true): Promise<{ hoverPart: MarkdownHover; hoverElement: HTMLElement } | undefined> { const model = this._editor.getModel(); if (!model) { - return; + return undefined; } - const indexOfInterest = index !== -1 ? index : this._focusedHoverPartIndex; - const hoverRenderedPart = this._getRenderedHoverPartAtIndex(indexOfInterest); - if (!hoverRenderedPart || !hoverRenderedPart.hoverSource?.supportsVerbosityAction(action)) { - return; + const hoverRenderedPart = this._getRenderedHoverPartAtIndex(index); + const hoverSource = hoverRenderedPart?.hoverPart.source; + if (!hoverRenderedPart || !hoverSource?.supportsVerbosityAction(action)) { + return undefined; } - const hoverSource = hoverRenderedPart.hoverSource; const newHover = await this._fetchHover(hoverSource, model, action); if (!newHover) { - return; + return undefined; } const newHoverSource = new HoverSource(newHover, hoverSource.hoverProvider, hoverSource.hoverPosition); - const newHoverRenderedPart = this._renderHoverPart( - indexOfInterest, + const initialHoverPart = hoverRenderedPart.hoverPart; + const newHoverPart = new MarkdownHover( + this._hoverParticipant, + initialHoverPart.range, newHover.contents, - newHoverSource, + initialHoverPart.isBeforeContent, + initialHoverPart.ordinal, + newHoverSource + ); + const newHoverRenderedPart = this._renderHoverPart( + newHoverPart, this._onFinishedRendering ); - this._replaceRenderedHoverPartAtIndex(indexOfInterest, newHoverRenderedPart); + this._replaceRenderedHoverPartAtIndex(index, newHoverRenderedPart, newHoverPart); if (focus) { - this._focusOnHoverPartWithIndex(indexOfInterest); + this._focusOnHoverPartWithIndex(index); } - this._onFinishedRendering(); - } - - public markdownHoverContentAtIndex(index: number): string { - const hoverRenderedPart = this._getRenderedHoverPartAtIndex(index); - return hoverRenderedPart?.renderedMarkdown.innerText ?? ''; + return { + hoverPart: newHoverPart, + hoverElement: newHoverRenderedPart.hoverElement + }; } - public focusedMarkdownHoverIndex(): number { - return this._focusedHoverPartIndex; + public getAccessibleContent(hoverPart: MarkdownHover): string | undefined { + const renderedHoverPartIndex = this.renderedHoverParts.findIndex(renderedHoverPart => renderedHoverPart.hoverPart === hoverPart); + if (renderedHoverPartIndex === -1) { + return undefined; + } + const renderedHoverPart = this._getRenderedHoverPartAtIndex(renderedHoverPartIndex); + if (!renderedHoverPart) { + return undefined; + } + const hoverElementInnerText = renderedHoverPart.hoverElement.innerText; + const accessibleContent = hoverElementInnerText.replace(/[^\S\n\r]+/gu, ' '); + return accessibleContent; } public doesMarkdownHoverAtIndexSupportVerbosityAction(index: number, action: HoverVerbosityAction): boolean { const hoverRenderedPart = this._getRenderedHoverPartAtIndex(index); - if (!hoverRenderedPart || !hoverRenderedPart.hoverSource?.supportsVerbosityAction(action)) { + const hoverSource = hoverRenderedPart?.hoverPart.source; + if (!hoverRenderedPart || !hoverSource?.supportsVerbosityAction(action)) { return false; } return true; @@ -404,76 +415,94 @@ class MarkdownRenderedHoverParts extends Disposable { return hover; } - private _replaceRenderedHoverPartAtIndex(index: number, renderedHoverPart: RenderedHoverPart): void { - if (index >= this._renderHoverParts.length || index < 0) { + private _replaceRenderedHoverPartAtIndex(index: number, renderedHoverPart: RenderedMarkdownHoverPart, hoverPart: MarkdownHover): void { + if (index >= this.renderedHoverParts.length || index < 0) { return; } - const currentRenderedHoverPart = this._renderedHoverParts[index]; - const currentRenderedMarkdown = currentRenderedHoverPart.renderedMarkdown; - currentRenderedMarkdown.replaceWith(renderedHoverPart.renderedMarkdown); - currentRenderedHoverPart.disposables.dispose(); - this._renderedHoverParts[index] = renderedHoverPart; + const currentRenderedHoverPart = this.renderedHoverParts[index]; + const currentRenderedMarkdown = currentRenderedHoverPart.hoverElement; + const renderedMarkdown = renderedHoverPart.hoverElement; + const renderedChildrenElements = Array.from(renderedMarkdown.children); + currentRenderedMarkdown.replaceChildren(...renderedChildrenElements); + const newRenderedHoverPart = new RenderedMarkdownHoverPart( + hoverPart, + currentRenderedMarkdown, + renderedHoverPart.disposables + ); + currentRenderedMarkdown.focus(); + currentRenderedHoverPart.dispose(); + this.renderedHoverParts[index] = newRenderedHoverPart; } private _focusOnHoverPartWithIndex(index: number): void { - this._renderedHoverParts[index].renderedMarkdown.focus(); + this.renderedHoverParts[index].hoverElement.focus(); + } + + private _getRenderedHoverPartAtIndex(index: number): RenderedMarkdownHoverPart | undefined { + return this.renderedHoverParts[index]; } - private _getRenderedHoverPartAtIndex(index: number): RenderedHoverPart | undefined { - return this._renderedHoverParts[index]; + public dispose(): void { + this._disposables.dispose(); } } export function renderMarkdownHovers( context: IEditorHoverRenderContext, - hoverParts: MarkdownHover[], + markdownHovers: MarkdownHover[], editor: ICodeEditor, languageService: ILanguageService, openerService: IOpenerService, -): IDisposable { +): IRenderedHoverParts { // Sort hover parts to keep them stable since they might come in async, out-of-order - hoverParts.sort(compareBy(hover => hover.ordinal, numberComparator)); - - const disposables = new DisposableStore(); - for (const hoverPart of hoverParts) { - disposables.add(renderMarkdownInContainer( + markdownHovers.sort(compareBy(hover => hover.ordinal, numberComparator)); + const renderedHoverParts: IRenderedHoverPart[] = []; + for (const markdownHover of markdownHovers) { + renderedHoverParts.push(renderMarkdownInContainer( editor, - context.fragment, - hoverPart.contents, + markdownHover, languageService, openerService, context.onContentsChanged, )); } - return disposables; + return new RenderedHoverParts(renderedHoverParts); } function renderMarkdownInContainer( editor: ICodeEditor, - container: DocumentFragment | HTMLElement, - markdownStrings: IMarkdownString[], + markdownHover: MarkdownHover, languageService: ILanguageService, openerService: IOpenerService, onFinishedRendering: () => void, -): IDisposable { - const store = new DisposableStore(); - for (const contents of markdownStrings) { - if (isEmptyMarkdownString(contents)) { +): IRenderedHoverPart { + const disposables = new DisposableStore(); + const renderedMarkdown = $('div.hover-row'); + const renderedMarkdownContents = $('div.hover-row-contents'); + renderedMarkdown.appendChild(renderedMarkdownContents); + const markdownStrings = markdownHover.contents; + for (const markdownString of markdownStrings) { + if (isEmptyMarkdownString(markdownString)) { continue; } const markdownHoverElement = $('div.markdown-hover'); const hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents')); - const renderer = store.add(new MarkdownRenderer({ editor }, languageService, openerService)); - store.add(renderer.onDidRenderAsync(() => { + const renderer = disposables.add(new MarkdownRenderer({ editor }, languageService, openerService)); + disposables.add(renderer.onDidRenderAsync(() => { hoverContentsElement.className = 'hover-contents code-hover-contents'; onFinishedRendering(); })); - const renderedContents = store.add(renderer.render(contents)); + const renderedContents = disposables.add(renderer.render(markdownString)); hoverContentsElement.appendChild(renderedContents.element); - container.appendChild(markdownHoverElement); + renderedMarkdownContents.appendChild(markdownHoverElement); } - return store; + const renderedHoverPart: IRenderedHoverPart = { + hoverPart: markdownHover, + hoverElement: renderedMarkdown, + dispose() { disposables.dispose(); } + }; + return renderedHoverPart; } export function labelForHoverVerbosityAction(keybindingService: IKeybindingService, action: HoverVerbosityAction): string { diff --git a/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts b/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts index 3ed0b3fab14..1a8c3709b1a 100644 --- a/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts +++ b/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts @@ -3,29 +3,29 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { CancelablePromise, createCancelablePromise, disposableTimeout } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { basename } from 'vs/base/common/resources'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { CodeActionTriggerType } from 'vs/editor/common/languages'; -import { IModelDecoration } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { IMarkerDecorationsService } from 'vs/editor/common/services/markerDecorations'; -import { getCodeActions, quickFixCommandId } from 'vs/editor/contrib/codeAction/browser/codeAction'; -import { CodeActionController } from 'vs/editor/contrib/codeAction/browser/codeActionController'; -import { CodeActionKind, CodeActionSet, CodeActionTrigger, CodeActionTriggerSource } from 'vs/editor/contrib/codeAction/common/types'; -import { MarkerController, NextMarkerAction } from 'vs/editor/contrib/gotoError/browser/gotoError'; -import { HoverAnchor, HoverAnchorType, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import * as nls from 'vs/nls'; -import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; -import { IMarker, IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { Progress } from 'vs/platform/progress/common/progress'; +import * as dom from '../../../../base/browser/dom.js'; +import { isNonEmptyArray } from '../../../../base/common/arrays.js'; +import { CancelablePromise, createCancelablePromise, disposableTimeout } from '../../../../base/common/async.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js'; +import { basename } from '../../../../base/common/resources.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { CodeActionTriggerType } from '../../../common/languages.js'; +import { IModelDecoration } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { IMarkerDecorationsService } from '../../../common/services/markerDecorations.js'; +import { getCodeActions, quickFixCommandId } from '../../codeAction/browser/codeAction.js'; +import { CodeActionController } from '../../codeAction/browser/codeActionController.js'; +import { CodeActionKind, CodeActionSet, CodeActionTrigger, CodeActionTriggerSource } from '../../codeAction/common/types.js'; +import { MarkerController, NextMarkerAction } from '../../gotoError/browser/gotoError.js'; +import { HoverAnchor, HoverAnchorType, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js'; +import * as nls from '../../../../nls.js'; +import { ITextEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { IMarker, IMarkerData, MarkerSeverity } from '../../../../platform/markers/common/markers.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import { Progress } from '../../../../platform/progress/common/progress.js'; const $ = dom.$; @@ -90,20 +90,29 @@ export class MarkerHoverParticipant implements IEditorHoverParticipant { if (!hoverParts.length) { - return Disposable.None; + return new RenderedHoverParts([]); } const disposables = new DisposableStore(); - hoverParts.forEach(msg => context.fragment.appendChild(this.renderMarkerHover(msg, disposables))); + const renderedHoverParts: IRenderedHoverPart[] = []; + hoverParts.forEach(hoverPart => { + const renderedMarkerHover = this._renderMarkerHover(hoverPart); + context.fragment.appendChild(renderedMarkerHover.hoverElement); + renderedHoverParts.push(renderedMarkerHover); + }); const markerHoverForStatusbar = hoverParts.length === 1 ? hoverParts[0] : hoverParts.sort((a, b) => MarkerSeverity.compare(a.marker.severity, b.marker.severity))[0]; this.renderMarkerStatusbar(context, markerHoverForStatusbar, disposables); - return disposables; + return new RenderedHoverParts(renderedHoverParts); + } + + public getAccessibleContent(hoverPart: MarkerHover): string { + return hoverPart.marker.message; } - private renderMarkerHover(markerHover: MarkerHover, disposables: DisposableStore): HTMLElement { + private _renderMarkerHover(markerHover: MarkerHover): IRenderedHoverPart { + const disposables: DisposableStore = new DisposableStore(); const hoverElement = $('div.hover-row'); - hoverElement.tabIndex = 0; const markerElement = dom.append(hoverElement, $('div.marker.hover-contents')); const { source, message, code, relatedInformation } = markerHover.marker; @@ -121,7 +130,7 @@ export class MarkerHoverParticipant implements IEditorHoverParticipant { this._openerService.open(code.target, { allowCommands: true }); @@ -154,9 +163,10 @@ export class MarkerHoverParticipant implements IEditorHoverParticipant{ selection: { startLineNumber, startColumn } } + editorOptions }).catch(onUnexpectedError); } })); @@ -166,7 +176,12 @@ export class MarkerHoverParticipant implements IEditorHoverParticipant = { + hoverPart: markerHover, + hoverElement, + dispose: () => disposables.dispose() + }; + return renderedHoverPart; } private renderMarkerStatusbar(context: IEditorHoverRenderContext, markerHover: MarkerHover, disposables: DisposableStore): void { diff --git a/src/vs/editor/contrib/hover/browser/resizableContentWidget.ts b/src/vs/editor/contrib/hover/browser/resizableContentWidget.ts index 72736b8ab6e..7ff606a1e15 100644 --- a/src/vs/editor/contrib/hover/browser/resizableContentWidget.ts +++ b/src/vs/editor/contrib/hover/browser/resizableContentWidget.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ResizableHTMLElement } from 'vs/base/browser/ui/resizable/resizable'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import * as dom from 'vs/base/browser/dom'; +import { ResizableHTMLElement } from '../../../../base/browser/ui/resizable/resizable.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import * as dom from '../../../../base/browser/dom.js'; const TOP_HEIGHT = 30; const BOTTOM_HEIGHT = 24; diff --git a/src/vs/editor/contrib/hover/test/browser/contentHover.test.ts b/src/vs/editor/contrib/hover/test/browser/contentHover.test.ts index 65762f5905b..65337368f9c 100644 --- a/src/vs/editor/contrib/hover/test/browser/contentHover.test.ts +++ b/src/vs/editor/contrib/hover/test/browser/contentHover.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { RenderedContentHover } from 'vs/editor/contrib/hover/browser/contentHoverRendered'; -import { IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { TestCodeEditorInstantiationOptions, withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { RenderedContentHover } from '../../browser/contentHoverRendered.js'; +import { IHoverPart } from '../../browser/hoverTypes.js'; +import { TestCodeEditorInstantiationOptions, withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; suite('Content Hover', () => { diff --git a/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.ts b/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.ts index 6b207f2785a..248747f56a7 100644 --- a/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.ts +++ b/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise, timeout } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { CodeEditorStateFlag, EditorState } from 'vs/editor/contrib/editorState/browser/editorState'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IEditorContribution, IEditorDecorationsCollection } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { IInplaceReplaceSupportResult } from 'vs/editor/common/languages'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import * as nls from 'vs/nls'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { InPlaceReplaceCommand } from './inPlaceReplaceCommand'; -import 'vs/css!./inPlaceReplace'; +import { CancelablePromise, createCancelablePromise, timeout } from '../../../../base/common/async.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { CodeEditorStateFlag, EditorState } from '../../editorState/browser/editorState.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { IInplaceReplaceSupportResult } from '../../../common/languages.js'; +import { IEditorWorkerService } from '../../../common/services/editorWorker.js'; +import * as nls from '../../../../nls.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { InPlaceReplaceCommand } from './inPlaceReplaceCommand.js'; +import './inPlaceReplace.css'; class InPlaceReplaceController implements IEditorContribution { diff --git a/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplaceCommand.ts b/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplaceCommand.ts index 83c220946fc..4bd38f64ef4 100644 --- a/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplaceCommand.ts +++ b/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplaceCommand.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; export class InPlaceReplaceCommand implements ICommand { diff --git a/src/vs/editor/contrib/indentation/browser/indentation.ts b/src/vs/editor/contrib/indentation/browser/indentation.ts index 84760fdb6f4..2773edebf9b 100644 --- a/src/vs/editor/contrib/indentation/browser/indentation.ts +++ b/src/vs/editor/contrib/indentation/browser/indentation.ts @@ -3,30 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore } from 'vs/base/common/lifecycle'; -import * as strings from 'vs/base/common/strings'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, IActionOptions, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ShiftCommand } from 'vs/editor/common/commands/shiftCommand'; -import { EditorAutoIndentStrategy, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder, IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { EndOfLineSequence, ITextModel } from 'vs/editor/common/model'; -import { TextEdit } from 'vs/editor/common/languages'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IndentConsts } from 'vs/editor/common/languages/supports/indentRules'; -import { IModelService } from 'vs/editor/common/services/model'; -import * as indentUtils from 'vs/editor/contrib/indentation/common/indentUtils'; -import * as nls from 'vs/nls'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { getGoodIndentForLine, getIndentMetadata } from 'vs/editor/common/languages/autoIndent'; -import { getReindentEditOperations } from '../common/indentation'; -import { getStandardTokenTypeAtPosition } from 'vs/editor/common/tokens/lineTokens'; -import { Position } from 'vs/editor/common/core/position'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import * as strings from '../../../../base/common/strings.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, IActionOptions, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { ShiftCommand } from '../../../common/commands/shiftCommand.js'; +import { EditorAutoIndentStrategy, EditorOption } from '../../../common/config/editorOptions.js'; +import { ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder, IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { EndOfLineSequence, ITextModel } from '../../../common/model.js'; +import { TextEdit } from '../../../common/languages.js'; +import { StandardTokenType } from '../../../common/encodedTokenAttributes.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { IndentConsts } from '../../../common/languages/supports/indentRules.js'; +import { IModelService } from '../../../common/services/model.js'; +import * as indentUtils from '../common/indentUtils.js'; +import * as nls from '../../../../nls.js'; +import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; +import { getGoodIndentForLine, getIndentMetadata } from '../../../common/languages/autoIndent.js'; +import { getReindentEditOperations } from '../common/indentation.js'; +import { getStandardTokenTypeAtPosition } from '../../../common/tokens/lineTokens.js'; +import { Position } from '../../../common/core/position.js'; export class IndentationToSpacesAction extends EditorAction { public static readonly ID = 'editor.action.indentationToSpaces'; diff --git a/src/vs/editor/contrib/indentation/common/indentation.ts b/src/vs/editor/contrib/indentation/common/indentation.ts index 599d8012e0f..f1046f84728 100644 --- a/src/vs/editor/contrib/indentation/common/indentation.ts +++ b/src/vs/editor/contrib/indentation/common/indentation.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import { ShiftCommand } from 'vs/editor/common/commands/shiftCommand'; -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { normalizeIndentation } from 'vs/editor/common/core/indentation'; -import { Selection } from 'vs/editor/common/core/selection'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ProcessedIndentRulesSupport } from 'vs/editor/common/languages/supports/indentationLineProcessor'; -import { ITextModel } from 'vs/editor/common/model'; +import * as strings from '../../../../base/common/strings.js'; +import { ShiftCommand } from '../../../common/commands/shiftCommand.js'; +import { EditOperation, ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { normalizeIndentation } from '../../../common/core/indentation.js'; +import { Selection } from '../../../common/core/selection.js'; +import { StandardTokenType } from '../../../common/encodedTokenAttributes.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { ProcessedIndentRulesSupport } from '../../../common/languages/supports/indentationLineProcessor.js'; +import { ITextModel } from '../../../common/model.js'; export function getReindentEditOperations(model: ITextModel, languageConfigurationService: ILanguageConfigurationService, startLineNumber: number, endLineNumber: number): ISingleEditOperation[] { if (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) { diff --git a/src/vs/editor/contrib/indentation/test/browser/indentation.test.ts b/src/vs/editor/contrib/indentation/test/browser/indentation.test.ts index 2beed4f823b..b4019cbea94 100644 --- a/src/vs/editor/contrib/indentation/test/browser/indentation.test.ts +++ b/src/vs/editor/contrib/indentation/test/browser/indentation.test.ts @@ -4,28 +4,28 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { MetadataConsts, StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { EncodedTokenizationResult, IState, ITokenizationSupport, TokenizationRegistry } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { NullState } from 'vs/editor/common/languages/nullTokenize'; -import { AutoIndentOnPaste, IndentationToSpacesCommand, IndentationToTabsCommand } from 'vs/editor/contrib/indentation/browser/indentation'; -import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { testCommand } from 'vs/editor/test/browser/testCommand'; -import { goIndentationRules, htmlIndentationRules, javascriptIndentationRules, latexIndentationRules, luaIndentationRules, phpIndentationRules, rubyIndentationRules } from 'vs/editor/test/common/modes/supports/indentationRules'; -import { cppOnEnterRules, htmlOnEnterRules, javascriptOnEnterRules, phpOnEnterRules } from 'vs/editor/test/common/modes/supports/onEnterRules'; -import { TypeOperations } from 'vs/editor/common/cursor/cursorTypeOperations'; -import { cppBracketRules, goBracketRules, htmlBracketRules, latexBracketRules, luaBracketRules, phpBracketRules, rubyBracketRules, typescriptBracketRules, vbBracketRules } from 'vs/editor/test/common/modes/supports/bracketRules'; -import { javascriptAutoClosingPairsRules, latexAutoClosingPairsRules } from 'vs/editor/test/common/modes/supports/autoClosingPairsRules'; -import { LanguageService } from 'vs/editor/common/services/languageService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; +import { DisposableStore, IDisposable } from '../../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { TestInstantiationService } from '../../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { MetadataConsts, StandardTokenType } from '../../../../common/encodedTokenAttributes.js'; +import { EncodedTokenizationResult, IState, ITokenizationSupport, TokenizationRegistry } from '../../../../common/languages.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { NullState } from '../../../../common/languages/nullTokenize.js'; +import { AutoIndentOnPaste, IndentationToSpacesCommand, IndentationToTabsCommand } from '../../browser/indentation.js'; +import { withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { testCommand } from '../../../../test/browser/testCommand.js'; +import { goIndentationRules, htmlIndentationRules, javascriptIndentationRules, latexIndentationRules, luaIndentationRules, phpIndentationRules, rubyIndentationRules } from '../../../../test/common/modes/supports/indentationRules.js'; +import { cppOnEnterRules, htmlOnEnterRules, javascriptOnEnterRules, phpOnEnterRules } from '../../../../test/common/modes/supports/onEnterRules.js'; +import { TypeOperations } from '../../../../common/cursor/cursorTypeOperations.js'; +import { cppBracketRules, goBracketRules, htmlBracketRules, latexBracketRules, luaBracketRules, phpBracketRules, rubyBracketRules, typescriptBracketRules, vbBracketRules } from '../../../../test/common/modes/supports/bracketRules.js'; +import { javascriptAutoClosingPairsRules, latexAutoClosingPairsRules } from '../../../../test/common/modes/supports/autoClosingPairsRules.js'; +import { LanguageService } from '../../../../common/services/languageService.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { TestLanguageConfigurationService } from '../../../../test/common/modes/testLanguageConfigurationService.js'; export enum Language { TypeScript = 'ts-test', diff --git a/src/vs/editor/contrib/indentation/test/browser/indentationLineProcessor.test.ts b/src/vs/editor/contrib/indentation/test/browser/indentationLineProcessor.test.ts index 2004b864cbe..20a08cd14b7 100644 --- a/src/vs/editor/contrib/indentation/test/browser/indentationLineProcessor.test.ts +++ b/src/vs/editor/contrib/indentation/test/browser/indentationLineProcessor.test.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IndentationContextProcessor, ProcessedIndentRulesSupport } from 'vs/editor/common/languages/supports/indentationLineProcessor'; -import { Language, registerLanguage, registerLanguageConfiguration, registerTokenizationSupport, StandardTokenTypeData } from 'vs/editor/contrib/indentation/test/browser/indentation.test'; -import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { Range } from 'vs/editor/common/core/range'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { LanguageService } from 'vs/editor/common/services/languageService'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { ILanguageService } from 'vs/editor/common/languages/language'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { StandardTokenType } from '../../../../common/encodedTokenAttributes.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { IndentationContextProcessor, ProcessedIndentRulesSupport } from '../../../../common/languages/supports/indentationLineProcessor.js'; +import { Language, registerLanguage, registerLanguageConfiguration, registerTokenizationSupport, StandardTokenTypeData } from './indentation.test.js'; +import { withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { Range } from '../../../../common/core/range.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { LanguageService } from '../../../../common/services/languageService.js'; +import { TestLanguageConfigurationService } from '../../../../test/common/modes/testLanguageConfigurationService.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; suite('Indentation Context Processor - TypeScript/JavaScript', () => { diff --git a/src/vs/editor/contrib/inlayHints/browser/inlayHints.ts b/src/vs/editor/contrib/inlayHints/browser/inlayHints.ts index c5905ab7cf4..8ce3830a3f2 100644 --- a/src/vs/editor/contrib/inlayHints/browser/inlayHints.ts +++ b/src/vs/editor/contrib/inlayHints/browser/inlayHints.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { CancellationError, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { InlayHint, InlayHintList, InlayHintsProvider, Command } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { CancellationError, onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { InlayHint, InlayHintList, InlayHintsProvider, Command } from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { URI } from '../../../../base/common/uri.js'; export class InlayHintAnchor { constructor(readonly range: Range, readonly direction: 'before' | 'after') { } diff --git a/src/vs/editor/contrib/inlayHints/browser/inlayHintsContribution.ts b/src/vs/editor/contrib/inlayHints/browser/inlayHintsContribution.ts index ae4d54b7d96..508762b52b9 100644 --- a/src/vs/editor/contrib/inlayHints/browser/inlayHintsContribution.ts +++ b/src/vs/editor/contrib/inlayHints/browser/inlayHintsContribution.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { HoverParticipantRegistry } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { InlayHintsController } from 'vs/editor/contrib/inlayHints/browser/inlayHintsController'; -import { InlayHintsHover } from 'vs/editor/contrib/inlayHints/browser/inlayHintsHover'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { HoverParticipantRegistry } from '../../hover/browser/hoverTypes.js'; +import { InlayHintsController } from './inlayHintsController.js'; +import { InlayHintsHover } from './inlayHintsHover.js'; registerEditorContribution(InlayHintsController.ID, InlayHintsController, EditorContributionInstantiation.AfterFirstRender); HoverParticipantRegistry.register(InlayHintsHover); diff --git a/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts b/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts index accb88043ff..aa76c34598c 100644 --- a/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts +++ b/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts @@ -3,38 +3,39 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isHTMLElement, ModifierKeyEmitter } from 'vs/base/browser/dom'; -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { LRUCache } from 'vs/base/common/map'; -import { IRange } from 'vs/base/common/range'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { IActiveCodeEditor, ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { ClassNameReference, CssProperties, DynamicCssRules } from 'vs/editor/browser/editorDom'; -import { StableEditorScrollState } from 'vs/editor/browser/stableEditorScroll'; -import { EditorOption, EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import * as languages from 'vs/editor/common/languages'; -import { IModelDeltaDecoration, InjectedTextCursorStops, InjectedTextOptions, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationInjectedTextOptions } from 'vs/editor/common/model/textModel'; -import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { ClickLinkGesture, ClickLinkMouseEvent } from 'vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture'; -import { InlayHintAnchor, InlayHintItem, InlayHintsFragments } from 'vs/editor/contrib/inlayHints/browser/inlayHints'; -import { goToDefinitionWithLocation, showGoToContextMenu } from 'vs/editor/contrib/inlayHints/browser/inlayHintsLocations'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; -import * as colors from 'vs/platform/theme/common/colorRegistry'; -import { themeColorFromId } from 'vs/platform/theme/common/themeService'; +import { isHTMLElement, ModifierKeyEmitter } from '../../../../base/browser/dom.js'; +import { isNonEmptyArray } from '../../../../base/common/arrays.js'; +import { disposableTimeout, RunOnceScheduler } from '../../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { LRUCache } from '../../../../base/common/map.js'; +import { IRange } from '../../../../base/common/range.js'; +import { assertType } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IActiveCodeEditor, ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { ClassNameReference, CssProperties, DynamicCssRules } from '../../../browser/editorDom.js'; +import { StableEditorScrollState } from '../../../browser/stableEditorScroll.js'; +import { EditorOption, EDITOR_FONT_DEFAULTS } from '../../../common/config/editorOptions.js'; +import { EditOperation } from '../../../common/core/editOperation.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import * as languages from '../../../common/languages.js'; +import { IModelDeltaDecoration, InjectedTextCursorStops, InjectedTextOptions, ITextModel, TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationInjectedTextOptions } from '../../../common/model/textModel.js'; +import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { ITextModelService } from '../../../common/services/resolverService.js'; +import { ClickLinkGesture, ClickLinkMouseEvent } from '../../gotoSymbol/browser/link/clickLinkGesture.js'; +import { InlayHintAnchor, InlayHintItem, InlayHintsFragments } from './inlayHints.js'; +import { goToDefinitionWithLocation, showGoToContextMenu } from './inlayHintsLocations.js'; +import { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { createDecorator, IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { INotificationService, Severity } from '../../../../platform/notification/common/notification.js'; +import * as colors from '../../../../platform/theme/common/colorRegistry.js'; +import { themeColorFromId } from '../../../../platform/theme/common/themeService.js'; +import { Position } from '../../../common/core/position.js'; // --- hint caching service (per session) @@ -100,7 +101,7 @@ export class InlayHintsController implements IEditorContribution { static readonly ID: string = 'editor.contrib.InlayHints'; private static readonly _MAX_DECORATORS = 1500; - private static readonly _MAX_LABEL_LEN = 43; + private static readonly _whitespaceData = {}; static get(editor: ICodeEditor): InlayHintsController | undefined { return editor.getContribution(InlayHintsController.ID) ?? undefined; @@ -112,6 +113,7 @@ export class InlayHintsController implements IEditorContribution { private readonly _decorationsMetadata = new Map(); private readonly _ruleFactory = new DynamicCssRules(this._editor); + private _cursorInfo?: { position: Position; notEarlierThan: number }; private _activeRenderMode = RenderMode.Normal; private _activeInlayHintPart?: ActiveInlayHintInfo; @@ -257,12 +259,23 @@ export class InlayHintsController implements IEditorContribution { scheduler.schedule(); } })); + + const cursor = this._sessionDisposables.add(new MutableDisposable()); this._sessionDisposables.add(this._editor.onDidChangeModelContent((e) => { cts?.cancel(); - // update less aggressive when typing - const delay = Math.max(scheduler.delay, 1250); - scheduler.schedule(delay); + // mark current cursor position and time after which the whole can be updated/redrawn + const delay = Math.max(scheduler.delay, 800); + this._cursorInfo = { position: this._editor.getPosition()!, notEarlierThan: Date.now() + delay }; + cursor.value = disposableTimeout(() => scheduler.schedule(0), delay); + + scheduler.schedule(); + })); + + this._sessionDisposables.add(this._editor.onDidChangeConfiguration(e => { + if (e.hasChanged(EditorOption.inlayHints)) { + scheduler.schedule(); + } })); // mouse gestures @@ -435,9 +448,65 @@ export class InlayHintsController implements IEditorContribution { private _updateHintsDecorators(ranges: readonly Range[], items: readonly InlayHintItem[]): void { + const itemFixedLengths = new Map(); + + if (this._cursorInfo + && this._cursorInfo.notEarlierThan > Date.now() + && ranges.some(range => range.containsPosition(this._cursorInfo!.position)) + ) { + // collect inlay hints that are on the same line and before the cursor. Those "old" hints + // define fixed lengths so that the cursor does not jump back and worth while typing. + const { position } = this._cursorInfo; + this._cursorInfo = undefined; + + const lengths = new Map(); + + for (const deco of this._editor.getLineDecorations(position.lineNumber) ?? []) { + + const data = this._decorationsMetadata.get(deco.id); + if (deco.range.startColumn > position.column) { + continue; + } + const opts = data?.decoration.options[data.item.anchor.direction]; + if (opts && opts.attachedData !== InlayHintsController._whitespaceData) { + const len = lengths.get(data.item) ?? 0; + lengths.set(data.item, len + opts.content.length); + } + } + + + // on the cursor line and before the cursor-column + const newItemsWithFixedLength = items.filter(item => item.anchor.range.startLineNumber === position.lineNumber && item.anchor.range.endColumn <= position.column); + const fixedLengths = Array.from(lengths.values()); + + // match up fixed lengths with items and distribute the remaining lengths to the last item + let lastItem: InlayHintItem | undefined; + while (true) { + const targetItem = newItemsWithFixedLength.shift(); + const fixedLength = fixedLengths.shift(); + + if (!fixedLength && !targetItem) { + break; // DONE + } + + if (targetItem) { + itemFixedLengths.set(targetItem, fixedLength ?? 0); + lastItem = targetItem; + + } else if (lastItem && fixedLength) { + // still lengths but no more item. give it all to the last + let len = itemFixedLengths.get(lastItem)!; + len += fixedLength; + len += fixedLengths.reduce((p, c) => p + c, 0); + fixedLengths.length = 0; + break; // DONE + } + } + } + // utils to collect/create injected text decorations const newDecorationsData: InlayHintDecorationRenderInfo[] = []; - const addInjectedText = (item: InlayHintItem, ref: ClassNameReference, content: string, cursorStops: InjectedTextCursorStops, attachedData?: RenderedInlayHintLabelPart): void => { + const addInjectedText = (item: InlayHintItem, ref: ClassNameReference, content: string, cursorStops: InjectedTextCursorStops, attachedData?: RenderedInlayHintLabelPart | object): void => { const opts: InjectedTextOptions = { content, inlineClassNameAffectsLetterSpacing: true, @@ -467,12 +536,13 @@ export class InlayHintsController implements IEditorContribution { width: `${(fontSize / 3) | 0}px`, display: 'inline-block' }); - addInjectedText(item, marginRule, '\u200a', isLast ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None); + addInjectedText(item, marginRule, '\u200a', isLast ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None, InlayHintsController._whitespaceData); }; // const { fontSize, fontFamily, padding, isUniform } = this._getLayoutInfo(); + const maxLength = this._editor.getOption(EditorOption.inlayHints).maximumLength; const fontFamilyVar = '--code-editorInlayHintsFontFamily'; this._editor.getContainerDomNode().style.setProperty(fontFamilyVar, fontFamily); @@ -480,13 +550,14 @@ export class InlayHintsController implements IEditorContribution { type ILineInfo = { line: number; totalLen: number }; let currentLineInfo: ILineInfo = { line: 0, totalLen: 0 }; - for (const item of items) { + for (let i = 0; i < items.length; i++) { + const item = items[i]; if (currentLineInfo.line !== item.anchor.range.startLineNumber) { currentLineInfo = { line: item.anchor.range.startLineNumber, totalLen: 0 }; } - if (currentLineInfo.totalLen > InlayHintsController._MAX_LABEL_LEN) { + if (maxLength && currentLineInfo.totalLen > maxLength) { continue; } @@ -500,6 +571,9 @@ export class InlayHintsController implements IEditorContribution { ? [{ label: item.hint.label }] : item.hint.label; + const itemFixedLength = itemFixedLengths.get(item); + let itemActualLength = 0; + for (let i = 0; i < parts.length; i++) { const part = parts[i]; @@ -528,8 +602,27 @@ export class InlayHintsController implements IEditorContribution { } } + let textlabel = part.label; + currentLineInfo.totalLen += textlabel.length; + let tooLong = false; + const over = maxLength !== 0 ? (currentLineInfo.totalLen - maxLength) : 0; + if (over > 0) { + textlabel = textlabel.slice(0, -over) + '…'; + tooLong = true; + } + + itemActualLength += textlabel.length; + + const overFixedLength = itemFixedLength !== undefined ? (itemActualLength - itemFixedLength) : 0; + if (overFixedLength > 0) { + // longer than fixed length, trim + itemActualLength -= overFixedLength; + textlabel = textlabel.slice(0, -(1 + overFixedLength)) + '…'; + tooLong = true; + } + if (padding) { - if (isFirst && isLast) { + if (isFirst && (isLast || tooLong)) { // only element cssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px`; cssProperties.borderRadius = `${(fontSize / 4) | 0}px`; @@ -537,7 +630,7 @@ export class InlayHintsController implements IEditorContribution { // first element cssProperties.padding = `1px 0 1px ${Math.max(1, fontSize / 4) | 0}px`; cssProperties.borderRadius = `${(fontSize / 4) | 0}px 0 0 ${(fontSize / 4) | 0}px`; - } else if (isLast) { + } else if ((isLast || tooLong)) { // last element cssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px 1px 0`; cssProperties.borderRadius = `0 ${(fontSize / 4) | 0}px ${(fontSize / 4) | 0}px 0`; @@ -546,15 +639,6 @@ export class InlayHintsController implements IEditorContribution { } } - let textlabel = part.label; - currentLineInfo.totalLen += textlabel.length; - let tooLong = false; - const over = currentLineInfo.totalLen - InlayHintsController._MAX_LABEL_LEN; - if (over > 0) { - textlabel = textlabel.slice(0, -over) + '…'; - tooLong = true; - } - addInjectedText( item, this._ruleFactory.createClassNameRef(cssProperties), @@ -568,6 +652,17 @@ export class InlayHintsController implements IEditorContribution { } } + if (itemFixedLength !== undefined && itemActualLength < itemFixedLength) { + // shorter than fixed length, pad + const pad = (itemFixedLength - itemActualLength); + addInjectedText( + item, + this._ruleFactory.createClassNameRef({}), + '\u200a'.repeat(pad), + InjectedTextCursorStops.None + ); + } + // whitespace trailing the actual label if (item.hint.paddingRight) { addInjectedWhitespace(item, true); diff --git a/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.ts b/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.ts index d49a4bb781f..7587ab9a72d 100644 --- a/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.ts +++ b/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.ts @@ -3,29 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AsyncIterableObject } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IMarkdownString, isEmptyMarkdownString, MarkdownString } from 'vs/base/common/htmlContent'; -import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { IModelDecoration } from 'vs/editor/common/model'; -import { ModelDecorationInjectedTextOptions } from 'vs/editor/common/model/textModel'; -import { HoverAnchor, HoverForeignElementAnchor, IEditorHoverParticipant } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { getHoverProviderResultsAsAsyncIterable } from 'vs/editor/contrib/hover/browser/getHover'; -import { MarkdownHover, MarkdownHoverParticipant } from 'vs/editor/contrib/hover/browser/markdownHoverParticipant'; -import { RenderedInlayHintLabelPart, InlayHintsController } from 'vs/editor/contrib/inlayHints/browser/inlayHintsController'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { localize } from 'vs/nls'; -import * as platform from 'vs/base/common/platform'; -import { asCommandLink } from 'vs/editor/contrib/inlayHints/browser/inlayHints'; -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; +import { AsyncIterableObject } from '../../../../base/common/async.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { IMarkdownString, isEmptyMarkdownString, MarkdownString } from '../../../../base/common/htmlContent.js'; +import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { Position } from '../../../common/core/position.js'; +import { IModelDecoration } from '../../../common/model.js'; +import { ModelDecorationInjectedTextOptions } from '../../../common/model/textModel.js'; +import { HoverAnchor, HoverForeignElementAnchor, IEditorHoverParticipant } from '../../hover/browser/hoverTypes.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { ITextModelService } from '../../../common/services/resolverService.js'; +import { getHoverProviderResultsAsAsyncIterable } from '../../hover/browser/getHover.js'; +import { MarkdownHover, MarkdownHoverParticipant } from '../../hover/browser/markdownHoverParticipant.js'; +import { RenderedInlayHintLabelPart, InlayHintsController } from './inlayHintsController.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { localize } from '../../../../nls.js'; +import * as platform from '../../../../base/common/platform.js'; +import { asCommandLink } from './inlayHints.js'; +import { isNonEmptyArray } from '../../../../base/common/arrays.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { IHoverService } from '../../../../platform/hover/browser/hover.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; class InlayHintsHoverAnchor extends HoverForeignElementAnchor { constructor( @@ -51,8 +52,9 @@ export class InlayHintsHover extends MarkdownHoverParticipant implements IEditor @IConfigurationService configurationService: IConfigurationService, @ITextModelService private readonly _resolverService: ITextModelService, @ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService, + @ICommandService commandService: ICommandService ) { - super(editor, languageService, openerService, configurationService, languageFeaturesService, keybindingService, hoverService); + super(editor, languageService, openerService, configurationService, languageFeaturesService, keybindingService, hoverService, commandService); } suggestHoverAnchor(mouseEvent: IEditorMouseEvent): HoverAnchor | null { diff --git a/src/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.ts b/src/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.ts index 4228e056034..edf82acff9a 100644 --- a/src/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.ts +++ b/src/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { Action, IAction, Separator } from 'vs/base/common/actions'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { Location } from 'vs/editor/common/languages'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { DefinitionAction, SymbolNavigationAction, SymbolNavigationAnchor } from 'vs/editor/contrib/gotoSymbol/browser/goToCommands'; -import { ClickLinkMouseEvent } from 'vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture'; -import { RenderedInlayHintLabelPart } from 'vs/editor/contrib/inlayHints/browser/inlayHintsController'; -import { PeekContext } from 'vs/editor/contrib/peekView/browser/peekView'; -import { isIMenuItem, MenuId, MenuItemAction, MenuRegistry } from 'vs/platform/actions/common/actions'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; +import * as dom from '../../../../base/browser/dom.js'; +import { Action, IAction, Separator } from '../../../../base/common/actions.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { generateUuid } from '../../../../base/common/uuid.js'; +import { IActiveCodeEditor, ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { Location } from '../../../common/languages.js'; +import { ITextModelService } from '../../../common/services/resolverService.js'; +import { DefinitionAction, SymbolNavigationAction, SymbolNavigationAnchor } from '../../gotoSymbol/browser/goToCommands.js'; +import { ClickLinkMouseEvent } from '../../gotoSymbol/browser/link/clickLinkGesture.js'; +import { RenderedInlayHintLabelPart } from './inlayHintsController.js'; +import { PeekContext } from '../../peekView/browser/peekView.js'; +import { isIMenuItem, MenuId, MenuItemAction, MenuRegistry } from '../../../../platform/actions/common/actions.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { INotificationService, Severity } from '../../../../platform/notification/common/notification.js'; export async function showGoToContextMenu(accessor: ServicesAccessor, editor: ICodeEditor, anchor: HTMLElement, part: RenderedInlayHintLabelPart) { diff --git a/src/vs/editor/contrib/inlineCompletions/browser/commandIds.ts b/src/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.ts similarity index 100% rename from src/vs/editor/contrib/inlineCompletions/browser/commandIds.ts rename to src/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.ts diff --git a/src/vs/editor/contrib/inlineCompletions/browser/commands.ts b/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.ts similarity index 85% rename from src/vs/editor/contrib/inlineCompletions/browser/commands.ts rename to src/vs/editor/contrib/inlineCompletions/browser/controller/commands.ts index ddfde90862d..595ab703f28 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/commands.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.ts @@ -3,21 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { transaction } from 'vs/base/common/observable'; -import { asyncTransaction } from 'vs/base/common/observableInternal/base'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { showNextInlineSuggestionActionId, showPreviousInlineSuggestionActionId, inlineSuggestCommitId } from 'vs/editor/contrib/inlineCompletions/browser/commandIds'; -import { InlineCompletionContextKeys } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys'; -import { InlineCompletionsController } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController'; -import { Context as SuggestContext } from 'vs/editor/contrib/suggest/browser/suggest'; -import * as nls from 'vs/nls'; -import { MenuId, Action2 } from 'vs/platform/actions/common/actions'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { KeyCode, KeyMod } from '../../../../../base/common/keyCodes.js'; +import { asyncTransaction, transaction } from '../../../../../base/common/observable.js'; +import * as nls from '../../../../../nls.js'; +import { Action2, MenuId } from '../../../../../platform/actions/common/actions.js'; +import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js'; +import { ContextKeyExpr } from '../../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight } from '../../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { EditorAction, ServicesAccessor } from '../../../../browser/editorExtensions.js'; +import { EditorContextKeys } from '../../../../common/editorContextKeys.js'; +import { Context as SuggestContext } from '../../../suggest/browser/suggest.js'; +import { inlineSuggestCommitId, showNextInlineSuggestionActionId, showPreviousInlineSuggestionActionId } from './commandIds.js'; +import { InlineCompletionContextKeys } from './inlineCompletionContextKeys.js'; +import { InlineCompletionsController } from './inlineCompletionsController.js'; export class ShowNextInlineSuggestionAction extends EditorAction { public static ID = showNextInlineSuggestionActionId; diff --git a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys.ts b/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.ts similarity index 88% rename from src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys.ts rename to src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.ts index fcbcd62120f..adbc09f3eb5 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IObservable, autorun } from 'vs/base/common/observable'; -import { firstNonWhitespaceIndex } from 'vs/base/common/strings'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; -import { InlineCompletionsModel } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel'; -import { RawContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { localize } from 'vs/nls'; +import { IObservable, autorun } from '../../../../../base/common/observable.js'; +import { firstNonWhitespaceIndex } from '../../../../../base/common/strings.js'; +import { CursorColumns } from '../../../../common/core/cursorColumns.js'; +import { InlineCompletionsModel } from '../model/inlineCompletionsModel.js'; +import { RawContextKey, IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { localize } from '../../../../../nls.js'; export class InlineCompletionContextKeys extends Disposable { public static readonly inlineSuggestionVisible = new RawContextKey('inlineSuggestionVisible', false, localize('inlineSuggestionVisible', "Whether an inline suggestion is visible")); diff --git a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.ts b/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.ts similarity index 71% rename from src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.ts rename to src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.ts index a7c25e42677..c96abd181b7 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.ts @@ -3,39 +3,38 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createStyleSheetFromObservable } from 'vs/base/browser/domObservable'; -import { alert } from 'vs/base/browser/ui/aria/aria'; -import { timeout } from 'vs/base/common/async'; -import { cancelOnDispose } from 'vs/base/common/cancellation'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, ITransaction, autorun, constObservable, derived, observableFromEvent, observableSignal, observableValue, transaction, waitForState } from 'vs/base/common/observable'; -import { ISettableObservable } from 'vs/base/common/observableInternal/base'; -import { derivedDisposable } from 'vs/base/common/observableInternal/derived'; -import { derivedObservableWithCache, mapObservableArrayCached } from 'vs/base/common/observableInternal/utils'; -import { isUndefined } from 'vs/base/common/types'; -import { CoreEditingCommands } from 'vs/editor/browser/coreCommands'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { observableCodeEditor, reactToChange, reactToChangeWithStore } from 'vs/editor/browser/observableCodeEditor'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { inlineSuggestCommitId } from 'vs/editor/contrib/inlineCompletions/browser/commandIds'; -import { GhostTextWidget } from 'vs/editor/contrib/inlineCompletions/browser/ghostTextWidget'; -import { InlineCompletionContextKeys } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys'; -import { InlineCompletionsHintsWidget, InlineSuggestionHintsContentWidget } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget'; -import { InlineCompletionsModel } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel'; -import { SuggestWidgetAdaptor } from 'vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider'; -import { localize } from 'vs/nls'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { AccessibilitySignal, IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { createStyleSheetFromObservable } from '../../../../../base/browser/domObservable.js'; +import { alert } from '../../../../../base/browser/ui/aria/aria.js'; +import { timeout } from '../../../../../base/common/async.js'; +import { cancelOnDispose } from '../../../../../base/common/cancellation.js'; +import { readHotReloadableExport } from '../../../../../base/common/hotReloadHelpers.js'; +import { Disposable, toDisposable } from '../../../../../base/common/lifecycle.js'; +import { ITransaction, autorun, constObservable, derived, derivedDisposable, derivedObservableWithCache, mapObservableArrayCached, observableFromEvent, observableSignal, runOnChange, runOnChangeWithStore, transaction, waitForState } from '../../../../../base/common/observable.js'; +import { isUndefined } from '../../../../../base/common/types.js'; +import { localize } from '../../../../../nls.js'; +import { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js'; +import { AccessibilitySignal, IAccessibilitySignalService } from '../../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; +import { ICommandService } from '../../../../../platform/commands/common/commands.js'; +import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js'; +import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { CoreEditingCommands } from '../../../../browser/coreCommands.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { observableCodeEditor } from '../../../../browser/observableCodeEditor.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { CursorChangeReason } from '../../../../common/cursorEvents.js'; +import { ILanguageFeatureDebounceService } from '../../../../common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { InlineCompletionsHintsWidget, InlineSuggestionHintsContentWidget } from '../hintsWidget/inlineCompletionsHintsWidget.js'; +import { InlineCompletionsModel } from '../model/inlineCompletionsModel.js'; +import { SuggestWidgetAdaptor } from '../model/suggestWidgetAdaptor.js'; +import { convertItemsToStableObservables } from '../utils.js'; +import { GhostTextView } from '../view/ghostTextView.js'; +import { inlineSuggestCommitId } from './commandIds.js'; +import { InlineCompletionContextKeys } from './inlineCompletionContextKeys.js'; export class InlineCompletionsController extends Disposable { static ID = 'editor.contrib.inlineCompletionsController'; @@ -105,11 +104,13 @@ export class InlineCompletionsController extends Disposable { private readonly _stablizedGhostTexts = convertItemsToStableObservables(this._ghostTexts, this._store); private readonly _ghostTextWidgets = mapObservableArrayCached(this, this._stablizedGhostTexts, (ghostText, store) => - store.add(this._instantiationService.createInstance(GhostTextWidget, this.editor, { - ghostText: ghostText, - minReservedLineCount: constObservable(0), - targetTextModel: this.model.map(v => v?.textModel), - })) + derivedDisposable((reader) => + this._instantiationService.createInstance(readHotReloadableExport(GhostTextView, reader), this.editor, { + ghostText: ghostText, + minReservedLineCount: constObservable(0), + targetTextModel: this.model.map(v => v?.textModel), + }) + ).recomputeInitiallyAndOnChange(store) ).recomputeInitiallyAndOnChange(this._store); private readonly _playAccessibilitySignal = observableSignal(this); @@ -132,7 +133,7 @@ export class InlineCompletionsController extends Disposable { this._register(new InlineCompletionContextKeys(this._contextKeyService, this.model)); - this._register(reactToChange(this._editorObs.onDidType, (_value, _changes) => { + this._register(runOnChange(this._editorObs.onDidType, (_value, _changes) => { if (this._enabled.get()) { this.model.get()?.trigger(); } @@ -155,7 +156,7 @@ export class InlineCompletionsController extends Disposable { } })); - this._register(reactToChange(this._editorObs.selections, (_value, changes) => { + this._register(runOnChange(this._editorObs.selections, (_value, _, changes) => { if (changes.some(e => e.reason === CursorChangeReason.Explicit || e.source === 'api')) { this.model.get()?.stop(); } @@ -199,11 +200,11 @@ export class InlineCompletionsController extends Disposable { } return state?.inlineCompletion?.semanticId; }); - this._register(reactToChangeWithStore(derived(reader => { + this._register(runOnChangeWithStore(derived(reader => { this._playAccessibilitySignal.read(reader); currentInlineCompletionBySemanticId.read(reader); return {}; - }), async (_value, _deltas, store) => { + }), async (_value, _, _deltas, store) => { /** @description InlineCompletionsController.playAccessibilitySignalAndReadSuggestion */ const model = this.model.get(); const state = model?.state.get(); @@ -264,7 +265,7 @@ export class InlineCompletionsController extends Disposable { } public shouldShowHoverAtViewZone(viewZoneId: string): boolean { - return this._ghostTextWidgets.get()[0]?.ownsViewZone(viewZoneId) ?? false; + return this._ghostTextWidgets.get()[0]?.get().ownsViewZone(viewZoneId) ?? false; } public hide() { @@ -273,27 +274,3 @@ export class InlineCompletionsController extends Disposable { }); } } - -function convertItemsToStableObservables(items: IObservable, store: DisposableStore): IObservable[]> { - const result = observableValue[]>('result', []); - const innerObservables: ISettableObservable[] = []; - - store.add(autorun(reader => { - const itemsValue = items.read(reader); - - transaction(tx => { - if (itemsValue.length !== innerObservables.length) { - innerObservables.length = itemsValue.length; - for (let i = 0; i < innerObservables.length; i++) { - if (!innerObservables[i]) { - innerObservables[i] = observableValue('item', itemsValue[i]); - } - } - result.set([...innerObservables], tx); - } - innerObservables.forEach((o, i) => o.set(itemsValue[i], tx)); - }); - })); - - return result; -} diff --git a/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts b/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts deleted file mode 100644 index 450f9549fb7..00000000000 --- a/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts +++ /dev/null @@ -1,328 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { createTrustedTypesPolicy } from 'vs/base/browser/trustedTypes'; -import { Event } from 'vs/base/common/event'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, autorun, derived, observableFromEvent, observableSignalFromEvent, observableValue } from 'vs/base/common/observable'; -import * as strings from 'vs/base/common/strings'; -import 'vs/css!./ghostText'; -import { applyFontInfo } from 'vs/editor/browser/config/domFontInfo'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorFontLigatures, EditorOption, IComputedEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { StringBuilder } from 'vs/editor/common/core/stringBuilder'; -import { ILanguageIdCodec } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops, PositionAffinity } from 'vs/editor/common/model'; -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations'; -import { RenderLineInput, renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer'; -import { InlineDecorationType } from 'vs/editor/common/viewModel'; -import { GhostText, GhostTextReplacement } from 'vs/editor/contrib/inlineCompletions/browser/ghostText'; -import { ColumnRange, applyObservableDecorations } from 'vs/editor/contrib/inlineCompletions/browser/utils'; - -export const GHOST_TEXT_DESCRIPTION = 'ghost-text'; -export interface IGhostTextWidgetModel { - readonly targetTextModel: IObservable; - readonly ghostText: IObservable; - readonly minReservedLineCount: IObservable; -} - -export class GhostTextWidget extends Disposable { - private readonly isDisposed = observableValue(this, false); - private readonly currentTextModel = observableFromEvent(this, this.editor.onDidChangeModel, () => /** @description editor.model */ this.editor.getModel()); - - constructor( - private readonly editor: ICodeEditor, - private readonly model: IGhostTextWidgetModel, - @ILanguageService private readonly languageService: ILanguageService, - ) { - super(); - - this._register(toDisposable(() => { this.isDisposed.set(true, undefined); })); - this._register(applyObservableDecorations(this.editor, this.decorations)); - } - - private readonly uiState = derived(this, reader => { - if (this.isDisposed.read(reader)) { - return undefined; - } - const textModel = this.currentTextModel.read(reader); - if (textModel !== this.model.targetTextModel.read(reader)) { - return undefined; - } - const ghostText = this.model.ghostText.read(reader); - if (!ghostText) { - return undefined; - } - - const replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : undefined; - - const inlineTexts: { column: number; text: string; preview: boolean }[] = []; - const additionalLines: LineData[] = []; - - function addToAdditionalLines(lines: readonly string[], className: string | undefined) { - if (additionalLines.length > 0) { - const lastLine = additionalLines[additionalLines.length - 1]; - if (className) { - lastLine.decorations.push(new LineDecoration(lastLine.content.length + 1, lastLine.content.length + 1 + lines[0].length, className, InlineDecorationType.Regular)); - } - lastLine.content += lines[0]; - - lines = lines.slice(1); - } - for (const line of lines) { - additionalLines.push({ - content: line, - decorations: className ? [new LineDecoration(1, line.length + 1, className, InlineDecorationType.Regular)] : [] - }); - } - } - - const textBufferLine = textModel.getLineContent(ghostText.lineNumber); - - let hiddenTextStartColumn: number | undefined = undefined; - let lastIdx = 0; - for (const part of ghostText.parts) { - let lines = part.lines; - if (hiddenTextStartColumn === undefined) { - inlineTexts.push({ - column: part.column, - text: lines[0], - preview: part.preview, - }); - lines = lines.slice(1); - } else { - addToAdditionalLines([textBufferLine.substring(lastIdx, part.column - 1)], undefined); - } - - if (lines.length > 0) { - addToAdditionalLines(lines, GHOST_TEXT_DESCRIPTION); - if (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) { - hiddenTextStartColumn = part.column; - } - } - - lastIdx = part.column - 1; - } - if (hiddenTextStartColumn !== undefined) { - addToAdditionalLines([textBufferLine.substring(lastIdx)], undefined); - } - - const hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined; - - return { - replacedRange, - inlineTexts, - additionalLines, - hiddenRange, - lineNumber: ghostText.lineNumber, - additionalReservedLineCount: this.model.minReservedLineCount.read(reader), - targetTextModel: textModel, - }; - }); - - private readonly decorations = derived(this, reader => { - const uiState = this.uiState.read(reader); - if (!uiState) { - return []; - } - - const decorations: IModelDeltaDecoration[] = []; - - if (uiState.replacedRange) { - decorations.push({ - range: uiState.replacedRange.toRange(uiState.lineNumber), - options: { inlineClassName: 'inline-completion-text-to-replace', description: 'GhostTextReplacement' } - }); - } - - if (uiState.hiddenRange) { - decorations.push({ - range: uiState.hiddenRange.toRange(uiState.lineNumber), - options: { inlineClassName: 'ghost-text-hidden', description: 'ghost-text-hidden', } - }); - } - - for (const p of uiState.inlineTexts) { - decorations.push({ - range: Range.fromPositions(new Position(uiState.lineNumber, p.column)), - options: { - description: GHOST_TEXT_DESCRIPTION, - after: { content: p.text, inlineClassName: p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration', cursorStops: InjectedTextCursorStops.Left }, - showIfCollapsed: true, - } - }); - } - - return decorations; - }); - - private readonly additionalLinesWidget = this._register( - new AdditionalLinesWidget( - this.editor, - this.languageService.languageIdCodec, - derived(reader => { - /** @description lines */ - const uiState = this.uiState.read(reader); - return uiState ? { - lineNumber: uiState.lineNumber, - additionalLines: uiState.additionalLines, - minReservedLineCount: uiState.additionalReservedLineCount, - targetTextModel: uiState.targetTextModel, - } : undefined; - }) - ) - ); - - public ownsViewZone(viewZoneId: string): boolean { - return this.additionalLinesWidget.viewZoneId === viewZoneId; - } -} - -export class AdditionalLinesWidget extends Disposable { - private _viewZoneId: string | undefined = undefined; - public get viewZoneId(): string | undefined { return this._viewZoneId; } - - private readonly editorOptionsChanged = observableSignalFromEvent('editorOptionChanged', Event.filter( - this.editor.onDidChangeConfiguration, - e => e.hasChanged(EditorOption.disableMonospaceOptimizations) - || e.hasChanged(EditorOption.stopRenderingLineAfter) - || e.hasChanged(EditorOption.renderWhitespace) - || e.hasChanged(EditorOption.renderControlCharacters) - || e.hasChanged(EditorOption.fontLigatures) - || e.hasChanged(EditorOption.fontInfo) - || e.hasChanged(EditorOption.lineHeight) - )); - - constructor( - private readonly editor: ICodeEditor, - private readonly languageIdCodec: ILanguageIdCodec, - private readonly lines: IObservable<{ targetTextModel: ITextModel; lineNumber: number; additionalLines: LineData[]; minReservedLineCount: number } | undefined> - ) { - super(); - - this._register(autorun(reader => { - /** @description update view zone */ - const lines = this.lines.read(reader); - this.editorOptionsChanged.read(reader); - - if (lines) { - this.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount); - } else { - this.clear(); - } - })); - } - - public override dispose(): void { - super.dispose(); - this.clear(); - } - - private clear(): void { - this.editor.changeViewZones((changeAccessor) => { - if (this._viewZoneId) { - changeAccessor.removeZone(this._viewZoneId); - this._viewZoneId = undefined; - } - }); - } - - private updateLines(lineNumber: number, additionalLines: LineData[], minReservedLineCount: number): void { - const textModel = this.editor.getModel(); - if (!textModel) { - return; - } - - const { tabSize } = textModel.getOptions(); - - this.editor.changeViewZones((changeAccessor) => { - if (this._viewZoneId) { - changeAccessor.removeZone(this._viewZoneId); - this._viewZoneId = undefined; - } - - const heightInLines = Math.max(additionalLines.length, minReservedLineCount); - if (heightInLines > 0) { - const domNode = document.createElement('div'); - renderLines(domNode, tabSize, additionalLines, this.editor.getOptions(), this.languageIdCodec); - - this._viewZoneId = changeAccessor.addZone({ - afterLineNumber: lineNumber, - heightInLines: heightInLines, - domNode, - afterColumnAffinity: PositionAffinity.Right - }); - } - }); - } -} - -export interface LineData { - content: string; // Must not contain a linebreak! - decorations: LineDecoration[]; -} - -function renderLines(domNode: HTMLElement, tabSize: number, lines: LineData[], opts: IComputedEditorOptions, languageIdCodec: ILanguageIdCodec): void { - const disableMonospaceOptimizations = opts.get(EditorOption.disableMonospaceOptimizations); - const stopRenderingLineAfter = opts.get(EditorOption.stopRenderingLineAfter); - // To avoid visual confusion, we don't want to render visible whitespace - const renderWhitespace = 'none'; - const renderControlCharacters = opts.get(EditorOption.renderControlCharacters); - const fontLigatures = opts.get(EditorOption.fontLigatures); - const fontInfo = opts.get(EditorOption.fontInfo); - const lineHeight = opts.get(EditorOption.lineHeight); - - const sb = new StringBuilder(10000); - sb.appendString('
'); - - for (let i = 0, len = lines.length; i < len; i++) { - const lineData = lines[i]; - const line = lineData.content; - sb.appendString('
'); - - const isBasicASCII = strings.isBasicASCII(line); - const containsRTL = strings.containsRTL(line); - const lineTokens = LineTokens.createEmpty(line, languageIdCodec); - - renderViewLine(new RenderLineInput( - (fontInfo.isMonospace && !disableMonospaceOptimizations), - fontInfo.canUseHalfwidthRightwardsArrow, - line, - false, - isBasicASCII, - containsRTL, - 0, - lineTokens, - lineData.decorations, - tabSize, - 0, - fontInfo.spaceWidth, - fontInfo.middotWidth, - fontInfo.wsmiddotWidth, - stopRenderingLineAfter, - renderWhitespace, - renderControlCharacters, - fontLigatures !== EditorFontLigatures.OFF, - null - ), sb); - - sb.appendString('
'); - } - sb.appendString('
'); - - applyFontInfo(domNode, fontInfo); - const html = sb.build(); - const trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html; - domNode.innerHTML = trustedhtml as string; -} - -export const ttPolicy = createTrustedTypesPolicy('editorGhostText', { createHTML: value => value }); diff --git a/src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.ts b/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.ts similarity index 66% rename from src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.ts rename to src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.ts index 90d4ffcba0c..fefa9400dfc 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { MarkdownString } from 'vs/base/common/htmlContent'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { autorun, constObservable } from 'vs/base/common/observable'; -import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IModelDecoration } from 'vs/editor/common/model'; -import { HoverAnchor, HoverAnchorType, HoverForeignElementAnchor, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { InlineCompletionsController } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController'; -import { InlineSuggestionHintsContentWidget } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget'; -import { MarkdownRenderer } from 'vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; -import * as nls from 'vs/nls'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import * as dom from '../../../../../base/browser/dom.js'; +import { MarkdownString } from '../../../../../base/common/htmlContent.js'; +import { DisposableStore, IDisposable } from '../../../../../base/common/lifecycle.js'; +import { autorun, constObservable } from '../../../../../base/common/observable.js'; +import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { Range } from '../../../../common/core/range.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { IModelDecoration } from '../../../../common/model.js'; +import { HoverAnchor, HoverAnchorType, HoverForeignElementAnchor, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverPart, IRenderedHoverParts, RenderedHoverParts } from '../../../hover/browser/hoverTypes.js'; +import { InlineCompletionsController } from '../controller/inlineCompletionsController.js'; +import { InlineSuggestionHintsContentWidget } from './inlineCompletionsHintsWidget.js'; +import { MarkdownRenderer } from '../../../../browser/widget/markdownRenderer/browser/markdownRenderer.js'; +import * as nls from '../../../../../nls.js'; +import { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { IOpenerService } from '../../../../../platform/opener/common/opener.js'; +import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js'; export class InlineCompletionsHover implements IHoverPart { constructor( @@ -94,8 +94,8 @@ export class InlineCompletionsHoverParticipant implements IEditorHoverParticipan return []; } - renderHoverParts(context: IEditorHoverRenderContext, hoverParts: InlineCompletionsHover[]): IDisposable { - const disposableStore = new DisposableStore(); + renderHoverParts(context: IEditorHoverRenderContext, hoverParts: InlineCompletionsHover[]): IRenderedHoverParts { + const disposables = new DisposableStore(); const part = hoverParts[0]; this._telemetryService.publicLog2<{}, { @@ -104,7 +104,7 @@ export class InlineCompletionsHoverParticipant implements IEditorHoverParticipan }>('inlineCompletionHover.shown'); if (this.accessibilityService.isScreenReaderOptimized() && !this._editor.getOption(EditorOption.screenReaderAnnounceInlineSuggestion)) { - this.renderScreenReaderText(context, part, disposableStore); + disposables.add(this.renderScreenReaderText(context, part)); } const model = part.controller.model.get()!; @@ -115,32 +115,42 @@ export class InlineCompletionsHoverParticipant implements IEditorHoverParticipan model.inlineCompletionsCount, model.activeCommands, ); - context.fragment.appendChild(w.getDomNode()); + const widgetNode: HTMLElement = w.getDomNode(); + context.fragment.appendChild(widgetNode); model.triggerExplicitly(); - disposableStore.add(w); + disposables.add(w); + const renderedHoverPart: IRenderedHoverPart = { + hoverPart: part, + hoverElement: widgetNode, + dispose() { disposables.dispose(); } + }; + return new RenderedHoverParts([renderedHoverPart]); + } - return disposableStore; + getAccessibleContent(hoverPart: InlineCompletionsHover): string { + return nls.localize('hoverAccessibilityStatusBar', 'There are inline completions here'); } - private renderScreenReaderText(context: IEditorHoverRenderContext, part: InlineCompletionsHover, disposableStore: DisposableStore) { + private renderScreenReaderText(context: IEditorHoverRenderContext, part: InlineCompletionsHover): IDisposable { + const disposables = new DisposableStore(); const $ = dom.$; const markdownHoverElement = $('div.hover-row.markdown-hover'); const hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents', { ['aria-live']: 'assertive' })); - const renderer = disposableStore.add(new MarkdownRenderer({ editor: this._editor }, this._languageService, this._openerService)); + const renderer = disposables.add(new MarkdownRenderer({ editor: this._editor }, this._languageService, this._openerService)); const render = (code: string) => { - disposableStore.add(renderer.onDidRenderAsync(() => { + disposables.add(renderer.onDidRenderAsync(() => { hoverContentsElement.className = 'hover-contents code-hover-contents'; context.onContentsChanged(); })); const inlineSuggestionAvailable = nls.localize('inlineSuggestionFollows', "Suggestion:"); - const renderedContents = disposableStore.add(renderer.render(new MarkdownString().appendText(inlineSuggestionAvailable).appendCodeblock('text', code))); + const renderedContents = disposables.add(renderer.render(new MarkdownString().appendText(inlineSuggestionAvailable).appendCodeblock('text', code))); hoverContentsElement.replaceChildren(renderedContents.element); }; - disposableStore.add(autorun(reader => { + disposables.add(autorun(reader => { /** @description update hover */ const ghostText = part.controller.model.read(reader)?.primaryGhostText.read(reader); if (ghostText) { @@ -152,5 +162,6 @@ export class InlineCompletionsHoverParticipant implements IEditorHoverParticipan })); context.fragment.appendChild(markdownHoverElement); + return disposables; } } diff --git a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.css b/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.css similarity index 100% rename from src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.css rename to src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.css diff --git a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.ts b/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.ts similarity index 84% rename from src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.ts rename to src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.ts index 2226a1ea265..1625099889f 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.ts @@ -3,37 +3,36 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { h } from 'vs/base/browser/dom'; -import { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems'; -import { KeybindingLabel, unthemedKeybindingLabelOptions } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; -import { Action, IAction, Separator } from 'vs/base/common/actions'; -import { equals } from 'vs/base/common/arrays'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { Codicon } from 'vs/base/common/codicons'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, autorun, autorunWithStore, derived, derivedObservableWithCache, observableFromEvent } from 'vs/base/common/observable'; -import { derivedWithStore } from 'vs/base/common/observableInternal/derived'; -import { OS } from 'vs/base/common/platform'; -import { ThemeIcon } from 'vs/base/common/themables'; -import 'vs/css!./inlineCompletionsHintsWidget'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Command, InlineCompletionTriggerKind } from 'vs/editor/common/languages'; -import { PositionAffinity } from 'vs/editor/common/model'; -import { showNextInlineSuggestionActionId, showPreviousInlineSuggestionActionId } from 'vs/editor/contrib/inlineCompletions/browser/commandIds'; -import { InlineCompletionsModel } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel'; -import { localize } from 'vs/nls'; -import { MenuEntryActionViewItem, createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenuWorkbenchToolBarOptions, WorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; -import { IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; +import { h } from '../../../../../base/browser/dom.js'; +import { ActionViewItem } from '../../../../../base/browser/ui/actionbar/actionViewItems.js'; +import { KeybindingLabel, unthemedKeybindingLabelOptions } from '../../../../../base/browser/ui/keybindingLabel/keybindingLabel.js'; +import { Action, IAction, Separator } from '../../../../../base/common/actions.js'; +import { equals } from '../../../../../base/common/arrays.js'; +import { RunOnceScheduler } from '../../../../../base/common/async.js'; +import { Codicon } from '../../../../../base/common/codicons.js'; +import { Disposable, toDisposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, autorun, autorunWithStore, derived, derivedObservableWithCache, derivedWithStore, observableFromEvent } from '../../../../../base/common/observable.js'; +import { OS } from '../../../../../base/common/platform.js'; +import { ThemeIcon } from '../../../../../base/common/themables.js'; +import { localize } from '../../../../../nls.js'; +import { MenuEntryActionViewItem, createAndFillInActionBarActions } from '../../../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { IMenuWorkbenchToolBarOptions, WorkbenchToolBar } from '../../../../../platform/actions/browser/toolbar.js'; +import { IMenuService, MenuId, MenuItemAction } from '../../../../../platform/actions/common/actions.js'; +import { ICommandService } from '../../../../../platform/commands/common/commands.js'; +import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; +import { IContextMenuService } from '../../../../../platform/contextview/browser/contextView.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js'; +import { registerIcon } from '../../../../../platform/theme/common/iconRegistry.js'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { Position } from '../../../../common/core/position.js'; +import { Command, InlineCompletionTriggerKind } from '../../../../common/languages.js'; +import { PositionAffinity } from '../../../../common/model.js'; +import { showNextInlineSuggestionActionId, showPreviousInlineSuggestionActionId } from '../controller/commandIds.js'; +import { InlineCompletionsModel } from '../model/inlineCompletionsModel.js'; +import './inlineCompletionsHintsWidget.css'; export class InlineCompletionsHintsWidget extends Disposable { private readonly alwaysShowToolbar = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineSuggest).showToolbar === 'always'); diff --git a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts b/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts index 2819af72061..27e88e8b089 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { HoverParticipantRegistry } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { TriggerInlineSuggestionAction, ShowNextInlineSuggestionAction, ShowPreviousInlineSuggestionAction, AcceptNextWordOfInlineCompletion, AcceptInlineCompletion, HideInlineCompletion, ToggleAlwaysShowInlineSuggestionToolbar, AcceptNextLineOfInlineCompletion } from 'vs/editor/contrib/inlineCompletions/browser/commands'; -import { InlineCompletionsHoverParticipant } from 'vs/editor/contrib/inlineCompletions/browser/hoverParticipant'; -import { InlineCompletionsAccessibleView } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView'; -import { InlineCompletionsController } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController'; -import { AccessibleViewRegistry } from 'vs/platform/accessibility/browser/accessibleViewRegistry'; -import { registerAction2 } from 'vs/platform/actions/common/actions'; +import { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { HoverParticipantRegistry } from '../../hover/browser/hoverTypes.js'; +import { TriggerInlineSuggestionAction, ShowNextInlineSuggestionAction, ShowPreviousInlineSuggestionAction, AcceptNextWordOfInlineCompletion, AcceptInlineCompletion, HideInlineCompletion, ToggleAlwaysShowInlineSuggestionToolbar, AcceptNextLineOfInlineCompletion } from './controller/commands.js'; +import { InlineCompletionsHoverParticipant } from './hintsWidget/hoverParticipant.js'; +import { InlineCompletionsAccessibleView } from './inlineCompletionsAccessibleView.js'; +import { InlineCompletionsController } from './controller/inlineCompletionsController.js'; +import { AccessibleViewRegistry } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js'; +import { registerAction2 } from '../../../../platform/actions/common/actions.js'; registerEditorContribution(InlineCompletionsController.ID, InlineCompletionsController, EditorContributionInstantiation.Eventually); diff --git a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView.ts b/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView.ts index 6182681a3b5..e0954e2bd8e 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView.ts @@ -3,60 +3,77 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { InlineCompletionContextKeys } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys'; -import { InlineCompletionsController } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController'; -import { AccessibleViewType, AccessibleViewProviderId } from 'vs/platform/accessibility/browser/accessibleView'; -import { IAccessibleViewImplentation } from 'vs/platform/accessibility/browser/accessibleViewRegistry'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { InlineCompletionContextKeys } from './controller/inlineCompletionContextKeys.js'; +import { InlineCompletionsController } from './controller/inlineCompletionsController.js'; +import { AccessibleViewType, AccessibleViewProviderId, IAccessibleViewContentProvider } from '../../../../platform/accessibility/browser/accessibleView.js'; +import { IAccessibleViewImplentation } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { InlineCompletionsModel } from './model/inlineCompletionsModel.js'; -export class InlineCompletionsAccessibleView extends Disposable implements IAccessibleViewImplentation { +export class InlineCompletionsAccessibleView implements IAccessibleViewImplentation { readonly type = AccessibleViewType.View; readonly priority = 95; readonly name = 'inline-completions'; readonly when = ContextKeyExpr.and(InlineCompletionContextKeys.inlineSuggestionVisible); getProvider(accessor: ServicesAccessor) { const codeEditorService = accessor.get(ICodeEditorService); - function resolveProvider() { - const editor = codeEditorService.getActiveCodeEditor() || codeEditorService.getFocusedCodeEditor(); - if (!editor) { - return; - } - const model = InlineCompletionsController.get(editor)?.model.get(); - const state = model?.state.get(); - if (!model || !state) { - return; - } - const lineText = model.textModel.getLineContent(state.primaryGhostText.lineNumber); - const ghostText = state.primaryGhostText.renderForScreenReader(lineText); - if (!ghostText) { - return; - } - const language = editor.getModel()?.getLanguageId() ?? undefined; - return { - id: AccessibleViewProviderId.InlineCompletions, - verbositySettingKey: 'accessibility.verbosity.inlineCompletions', - provideContent() { return lineText + ghostText; }, - onClose() { - model.stop(); - editor.focus(); - }, - next() { - model.next(); - setTimeout(() => resolveProvider(), 50); - }, - previous() { - model.previous(); - setTimeout(() => resolveProvider(), 50); - }, - options: { language, type: AccessibleViewType.View } - }; + const editor = codeEditorService.getActiveCodeEditor() || codeEditorService.getFocusedCodeEditor(); + if (!editor) { + return; } - return resolveProvider(); + + const model = InlineCompletionsController.get(editor)?.model.get(); + if (!model?.state.get()) { + return; + } + + return new InlineCompletionsAccessibleViewContentProvider(editor, model); } - constructor() { +} + +class InlineCompletionsAccessibleViewContentProvider extends Disposable implements IAccessibleViewContentProvider { + private readonly _onDidChangeContent: Emitter = this._register(new Emitter()); + public readonly onDidChangeContent: Event = this._onDidChangeContent.event; + constructor( + private readonly _editor: ICodeEditor, + private readonly _model: InlineCompletionsModel, + ) { super(); } + + public readonly id = AccessibleViewProviderId.InlineCompletions; + public readonly verbositySettingKey = 'accessibility.verbosity.inlineCompletions'; + public readonly options = { language: this._editor.getModel()?.getLanguageId() ?? undefined, type: AccessibleViewType.View }; + + public provideContent(): string { + const state = this._model.state.get(); + if (!state) { + throw new Error('Inline completion is visible but state is not available'); + } + const lineText = this._model.textModel.getLineContent(state.primaryGhostText.lineNumber); + const ghostText = state.primaryGhostText.renderForScreenReader(lineText); + if (!ghostText) { + throw new Error('Inline completion is visible but ghost text is not available'); + } + return lineText + ghostText; + } + public provideNextContent(): string | undefined { + // asynchronously update the model and fire the event + this._model.next().then((() => this._onDidChangeContent.fire())); + return; + } + public providePreviousContent(): string | undefined { + // asynchronously update the model and fire the event + this._model.previous().then((() => this._onDidChangeContent.fire())); + return; + } + public onClose(): void { + this._model.stop(); + this._editor.focus(); + } } diff --git a/src/vs/editor/contrib/inlineCompletions/browser/singleTextEdit.ts b/src/vs/editor/contrib/inlineCompletions/browser/model/computeGhostText.ts similarity index 74% rename from src/vs/editor/contrib/inlineCompletions/browser/singleTextEdit.ts rename to src/vs/editor/contrib/inlineCompletions/browser/model/computeGhostText.ts index 750eb459829..f5bf0689028 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/singleTextEdit.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/model/computeGhostText.ts @@ -3,32 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDiffChange, LcsDiff } from 'vs/base/common/diff/diff'; -import { commonPrefixLength, getLeadingWhitespace } from 'vs/base/common/strings'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { TextLength } from 'vs/editor/common/core/textLength'; -import { SingleTextEdit } from 'vs/editor/common/core/textEdit'; -import { EndOfLinePreference, ITextModel } from 'vs/editor/common/model'; -import { GhostText, GhostTextPart } from 'vs/editor/contrib/inlineCompletions/browser/ghostText'; - -export function singleTextRemoveCommonPrefix(edit: SingleTextEdit, model: ITextModel, validModelRange?: Range): SingleTextEdit { - const modelRange = validModelRange ? edit.range.intersectRanges(validModelRange) : edit.range; - if (!modelRange) { - return edit; - } - const valueToReplace = model.getValueInRange(modelRange, EndOfLinePreference.LF); - const commonPrefixLen = commonPrefixLength(valueToReplace, edit.text); - const start = TextLength.ofText(valueToReplace.substring(0, commonPrefixLen)).addToPosition(edit.range.getStartPosition()); - const text = edit.text.substring(commonPrefixLen); - const range = Range.fromPositions(start, edit.range.getEndPosition()); - return new SingleTextEdit(range, text); -} - -export function singleTextEditAugments(edit: SingleTextEdit, base: SingleTextEdit): boolean { - // The augmented completion must replace the base range, but can replace even more - return edit.text.startsWith(base.text) && rangeExtends(edit.range, base.range); -} +import { IDiffChange, LcsDiff } from '../../../../../base/common/diff/diff.js'; +import { getLeadingWhitespace } from '../../../../../base/common/strings.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { SingleTextEdit } from '../../../../common/core/textEdit.js'; +import { ITextModel } from '../../../../common/model.js'; +import { GhostText, GhostTextPart } from './ghostText.js'; +import { singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js'; /** * @param previewSuffixLength Sets where to split `inlineCompletion.text`. @@ -58,27 +40,23 @@ export function computeGhostText( // ^^^^^^^^^^ ^^^^^^ sourceIndentationLength // ^^^^^^ replacedIndentation.length // ^^^ rangeThatDoesNotReplaceIndentation - // inlineCompletion.text: '··foo' // ^^ suggestionAddedIndentationLength - const suggestionAddedIndentationLength = getLeadingWhitespace(e.text).length; const replacedIndentation = sourceLine.substring(e.range.startColumn - 1, sourceIndentationLength); const [startPosition, endPosition] = [e.range.getStartPosition(), e.range.getEndPosition()]; - const newStartPosition = - startPosition.column + replacedIndentation.length <= endPosition.column - ? startPosition.delta(0, replacedIndentation.length) - : endPosition; + const newStartPosition = startPosition.column + replacedIndentation.length <= endPosition.column + ? startPosition.delta(0, replacedIndentation.length) + : endPosition; const rangeThatDoesNotReplaceIndentation = Range.fromPositions(newStartPosition, endPosition); - const suggestionWithoutIndentationChange = - e.text.startsWith(replacedIndentation) - // Adds more indentation without changing existing indentation: We can add ghost text for this - ? e.text.substring(replacedIndentation.length) - // Changes or removes existing indentation. Only add ghost text for the non-indentation part. - : e.text.substring(suggestionAddedIndentationLength); + const suggestionWithoutIndentationChange = e.text.startsWith(replacedIndentation) + // Adds more indentation without changing existing indentation: We can add ghost text for this + ? e.text.substring(replacedIndentation.length) + // Changes or removes existing indentation. Only add ghost text for the non-indentation part. + : e.text.substring(suggestionAddedIndentationLength); e = new SingleTextEdit(rangeThatDoesNotReplaceIndentation, suggestionWithoutIndentationChange); } @@ -139,11 +117,6 @@ export function computeGhostText( return new GhostText(lineNumber, parts); } -function rangeExtends(extendingRange: Range, rangeToExtend: Range): boolean { - return rangeToExtend.getStartPosition().equals(extendingRange.getStartPosition()) - && rangeToExtend.getEndPosition().isBeforeOrEqual(extendingRange.getEndPosition()); -} - let lastRequest: { originalValue: string; newValue: string; changes: readonly IDiffChange[] | undefined } | undefined = undefined; function cachingDiff(originalValue: string, newValue: string): readonly IDiffChange[] | undefined { if (lastRequest?.originalValue === originalValue && lastRequest?.newValue === newValue) { diff --git a/src/vs/editor/contrib/inlineCompletions/browser/ghostText.ts b/src/vs/editor/contrib/inlineCompletions/browser/model/ghostText.ts similarity index 92% rename from src/vs/editor/contrib/inlineCompletions/browser/ghostText.ts rename to src/vs/editor/contrib/inlineCompletions/browser/model/ghostText.ts index 47ee2e9f972..43cb07a899d 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/ghostText.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/model/ghostText.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { equals } from 'vs/base/common/arrays'; -import { splitLines } from 'vs/base/common/strings'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { SingleTextEdit, TextEdit } from 'vs/editor/common/core/textEdit'; -import { ColumnRange } from 'vs/editor/contrib/inlineCompletions/browser/utils'; +import { equals } from '../../../../../base/common/arrays.js'; +import { splitLines } from '../../../../../base/common/strings.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { SingleTextEdit, TextEdit } from '../../../../common/core/textEdit.js'; +import { ColumnRange } from '../utils.js'; export class GhostText { constructor( diff --git a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.ts b/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts similarity index 87% rename from src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.ts rename to src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts index 92013fd5982..8768d067135 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts @@ -3,35 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { compareBy, Permutation } from 'vs/base/common/arrays'; -import { mapFindFirst } from 'vs/base/common/arraysFind'; -import { itemsEquals } from 'vs/base/common/equals'; -import { BugIndicatingError, onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IObservable, IReader, ITransaction, autorun, derived, derivedHandleChanges, derivedOpts, observableSignal, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from 'vs/base/common/observable'; -import { commonPrefixLength, splitLinesIncludeSeparators } from 'vs/base/common/strings'; -import { isDefined } from 'vs/base/common/types'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { SingleTextEdit, TextEdit } from 'vs/editor/common/core/textEdit'; -import { TextLength } from 'vs/editor/common/core/textLength'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { Command, InlineCompletionContext, InlineCompletionTriggerKind, PartialAcceptTriggerKind } from 'vs/editor/common/languages'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { EndOfLinePreference, ITextModel } from 'vs/editor/common/model'; -import { IFeatureDebounceInformation } from 'vs/editor/common/services/languageFeatureDebounce'; -import { IModelContentChangedEvent } from 'vs/editor/common/textModelEvents'; -import { GhostText, GhostTextOrReplacement, ghostTextOrReplacementEquals, ghostTextsOrReplacementsEqual } from 'vs/editor/contrib/inlineCompletions/browser/ghostText'; -import { InlineCompletionWithUpdatedRange, InlineCompletionsSource } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource'; -import { computeGhostText, singleTextEditAugments, singleTextRemoveCommonPrefix } from 'vs/editor/contrib/inlineCompletions/browser/singleTextEdit'; -import { SuggestItemInfo } from 'vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider'; -import { addPositions, subtractPositions } from 'vs/editor/contrib/inlineCompletions/browser/utils'; -import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { mapFindFirst } from '../../../../../base/common/arraysFind.js'; +import { itemsEquals } from '../../../../../base/common/equals.js'; +import { BugIndicatingError, onUnexpectedError, onUnexpectedExternalError } from '../../../../../base/common/errors.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, IReader, ITransaction, autorun, derived, derivedHandleChanges, derivedOpts, observableSignal, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from '../../../../../base/common/observable.js'; +import { commonPrefixLength } from '../../../../../base/common/strings.js'; +import { isDefined } from '../../../../../base/common/types.js'; +import { ICommandService } from '../../../../../platform/commands/common/commands.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { EditOperation } from '../../../../common/core/editOperation.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { SingleTextEdit } from '../../../../common/core/textEdit.js'; +import { TextLength } from '../../../../common/core/textLength.js'; +import { ScrollType } from '../../../../common/editorCommon.js'; +import { Command, InlineCompletionContext, InlineCompletionTriggerKind, PartialAcceptTriggerKind } from '../../../../common/languages.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { EndOfLinePreference, ITextModel } from '../../../../common/model.js'; +import { IFeatureDebounceInformation } from '../../../../common/services/languageFeatureDebounce.js'; +import { IModelContentChangedEvent } from '../../../../common/textModelEvents.js'; +import { SnippetController2 } from '../../../snippet/browser/snippetController2.js'; +import { addPositions, getEndPositionsAfterApplying, substringPos, subtractPositions } from '../utils.js'; +import { computeGhostText } from './computeGhostText.js'; +import { GhostText, GhostTextOrReplacement, ghostTextOrReplacementEquals, ghostTextsOrReplacementsEqual } from './ghostText.js'; +import { InlineCompletionWithUpdatedRange, InlineCompletionsSource } from './inlineCompletionsSource.js'; +import { singleTextEditAugments, singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js'; +import { SuggestItemInfo } from './suggestWidgetAdaptor.js'; export class InlineCompletionsModel extends Disposable { private readonly _source = this._register(this._instantiationService.createInstance(InlineCompletionsSource, this.textModel, this._textModelVersionId, this._debounceValue)); @@ -515,20 +515,3 @@ export function getSecondaryEdits(textModel: ITextModel, positions: readonly Pos return new SingleTextEdit(range, secondaryEditText); }); } - -function substringPos(text: string, pos: Position): string { - let subtext = ''; - const lines = splitLinesIncludeSeparators(text); - for (let i = pos.lineNumber - 1; i < lines.length; i++) { - subtext += lines[i].substring(i === pos.lineNumber - 1 ? pos.column - 1 : 0); - } - return subtext; -} - -function getEndPositionsAfterApplying(edits: readonly SingleTextEdit[]): Position[] { - const sortPerm = Permutation.createSortPermutation(edits, compareBy(e => e.range, Range.compareRangesUsingStarts)); - const edit = new TextEdit(sortPerm.apply(edits)); - const sortedNewRanges = edit.getNewRanges(); - const newRanges = sortPerm.inverse().apply(sortedNewRanges); - return newRanges.map(range => range.getEndPosition()); -} diff --git a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.ts b/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.ts similarity index 81% rename from src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.ts rename to src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.ts index 1eb06aa11c1..d1f365f3418 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { equalsIfDefined, itemEquals } from 'vs/base/common/equals'; -import { matchesSubString } from 'vs/base/common/filters'; -import { Disposable, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, IReader, ITransaction, derivedOpts, disposableObservableValue, transaction } from 'vs/base/common/observable'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { SingleTextEdit } from 'vs/editor/common/core/textEdit'; -import { TextLength } from 'vs/editor/common/core/textLength'; -import { InlineCompletionContext, InlineCompletionTriggerKind } from 'vs/editor/common/languages'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { EndOfLinePreference, ITextModel } from 'vs/editor/common/model'; -import { IFeatureDebounceInformation } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { InlineCompletionItem, InlineCompletionProviderResult, provideInlineCompletions } from 'vs/editor/contrib/inlineCompletions/browser/provideInlineCompletions'; -import { singleTextRemoveCommonPrefix } from 'vs/editor/contrib/inlineCompletions/browser/singleTextEdit'; +import { CancellationToken, CancellationTokenSource } from '../../../../../base/common/cancellation.js'; +import { equalsIfDefined, itemEquals } from '../../../../../base/common/equals.js'; +import { matchesSubString } from '../../../../../base/common/filters.js'; +import { Disposable, IDisposable, MutableDisposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, IReader, ITransaction, derivedOpts, disposableObservableValue, transaction } from '../../../../../base/common/observable.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { SingleTextEdit } from '../../../../common/core/textEdit.js'; +import { TextLength } from '../../../../common/core/textLength.js'; +import { InlineCompletionContext, InlineCompletionTriggerKind } from '../../../../common/languages.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { EndOfLinePreference, ITextModel } from '../../../../common/model.js'; +import { IFeatureDebounceInformation } from '../../../../common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { InlineCompletionItem, InlineCompletionProviderResult, provideInlineCompletions } from './provideInlineCompletions.js'; +import { singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js'; export class InlineCompletionsSource extends Disposable { private readonly _updateOperation = this._register(new MutableDisposable()); @@ -26,21 +26,21 @@ export class InlineCompletionsSource extends Disposable { public readonly suggestWidgetInlineCompletions = disposableObservableValue('suggestWidgetInlineCompletions', undefined); constructor( - private readonly textModel: ITextModel, - private readonly versionId: IObservable, + private readonly _textModel: ITextModel, + private readonly _versionId: IObservable, private readonly _debounceValue: IFeatureDebounceInformation, - @ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService, - @ILanguageConfigurationService private readonly languageConfigurationService: ILanguageConfigurationService, + @ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService, + @ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService, ) { super(); - this._register(this.textModel.onDidChangeContent(() => { + this._register(this._textModel.onDidChangeContent(() => { this._updateOperation.clear(); })); } public fetch(position: Position, context: InlineCompletionContext, activeInlineCompletion: InlineCompletionWithUpdatedRange | undefined): Promise { - const request = new UpdateRequest(position, context, this.textModel.getVersionId()); + const request = new UpdateRequest(position, context, this._textModel.getVersionId()); const target = context.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions : this.inlineCompletions; @@ -59,34 +59,34 @@ export class InlineCompletionsSource extends Disposable { const shouldDebounce = updateOngoing || context.triggerKind === InlineCompletionTriggerKind.Automatic; if (shouldDebounce) { // This debounces the operation - await wait(this._debounceValue.get(this.textModel), source.token); + await wait(this._debounceValue.get(this._textModel), source.token); } - if (source.token.isCancellationRequested || this._store.isDisposed || this.textModel.getVersionId() !== request.versionId) { + if (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) { return false; } const startTime = new Date(); const updatedCompletions = await provideInlineCompletions( - this.languageFeaturesService.inlineCompletionsProvider, + this._languageFeaturesService.inlineCompletionsProvider, position, - this.textModel, + this._textModel, context, source.token, - this.languageConfigurationService + this._languageConfigurationService ); - if (source.token.isCancellationRequested || this._store.isDisposed || this.textModel.getVersionId() !== request.versionId) { + if (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) { return false; } const endTime = new Date(); - this._debounceValue.update(this.textModel, endTime.getTime() - startTime.getTime()); + this._debounceValue.update(this._textModel, endTime.getTime() - startTime.getTime()); - const completions = new UpToDateInlineCompletions(updatedCompletions, request, this.textModel, this.versionId); + const completions = new UpToDateInlineCompletions(updatedCompletions, request, this._textModel, this._versionId); if (activeInlineCompletion) { const asInlineCompletion = activeInlineCompletion.toInlineCompletion(undefined); - if (activeInlineCompletion.canBeReused(this.textModel, position) && !updatedCompletions.has(asInlineCompletion)) { + if (activeInlineCompletion.canBeReused(this._textModel, position) && !updatedCompletions.has(asInlineCompletion)) { completions.prepend(activeInlineCompletion.inlineCompletion, asInlineCompletion.range, true); } } diff --git a/src/vs/editor/contrib/inlineCompletions/browser/provideInlineCompletions.ts b/src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.ts similarity index 85% rename from src/vs/editor/contrib/inlineCompletions/browser/provideInlineCompletions.ts rename to src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.ts index 25ccf4cd125..af59786ab8a 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/provideInlineCompletions.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.ts @@ -3,23 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { assertNever } from 'vs/base/common/assert'; -import { DeferredPromise } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { SetMap } from 'vs/base/common/map'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { Command, InlineCompletion, InlineCompletionContext, InlineCompletionProviderGroupId, InlineCompletions, InlineCompletionsProvider } from 'vs/editor/common/languages'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ITextModel } from 'vs/editor/common/model'; -import { fixBracketsInLine } from 'vs/editor/common/model/bracketPairsTextModelPart/fixBrackets'; -import { SingleTextEdit } from 'vs/editor/common/core/textEdit'; -import { getReadonlyEmptyArray } from './utils'; -import { SnippetParser, Text } from 'vs/editor/contrib/snippet/browser/snippetParser'; +import { assertNever } from '../../../../../base/common/assert.js'; +import { DeferredPromise } from '../../../../../base/common/async.js'; +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { SetMap } from '../../../../../base/common/map.js'; +import { onUnexpectedExternalError } from '../../../../../base/common/errors.js'; +import { IDisposable } from '../../../../../base/common/lifecycle.js'; +import { ISingleEditOperation } from '../../../../common/core/editOperation.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { LanguageFeatureRegistry } from '../../../../common/languageFeatureRegistry.js'; +import { Command, InlineCompletion, InlineCompletionContext, InlineCompletionProviderGroupId, InlineCompletions, InlineCompletionsProvider } from '../../../../common/languages.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { ITextModel } from '../../../../common/model.js'; +import { fixBracketsInLine } from '../../../../common/model/bracketPairsTextModelPart/fixBrackets.js'; +import { SingleTextEdit } from '../../../../common/core/textEdit.js'; +import { getReadonlyEmptyArray } from '../utils.js'; +import { SnippetParser, Text } from '../../../snippet/browser/snippetParser.js'; +import { LineEditWithAdditionalLines } from '../../../../common/tokenizationTextModelPart.js'; +import { OffsetRange } from '../../../../common/core/offsetRange.js'; export async function provideInlineCompletions( registry: LanguageFeatureRegistry, @@ -104,7 +106,7 @@ export async function provideInlineCompletions( const completions = await provider.provideInlineCompletions(model, positionOrRange, context, token); return completions; } else { - const completions = await provider.provideInlineEdits?.(model, positionOrRange, context, token); + const completions = await provider.provideInlineEditsForRange?.(model, positionOrRange, context, token); return completions; } } catch (e) { @@ -333,8 +335,9 @@ function closeBrackets(text: string, position: Position, model: ITextModel, lang const lineStart = model.getLineContent(position.lineNumber).substring(0, position.column - 1); const newLine = lineStart + text; - const newTokens = model.tokenization.tokenizeLineWithEdit(position, newLine.length - (position.column - 1), text); - const slicedTokens = newTokens?.sliceAndInflate(position.column - 1, newLine.length, 0); + const edit = LineEditWithAdditionalLines.replace(OffsetRange.ofStartAndLength(position.column - 1, newLine.length - (position.column - 1)), text); + const newTokens = model.tokenization.tokenizeLineWithEdit(position.lineNumber, edit); + const slicedTokens = newTokens?.mainLineTokens?.sliceAndInflate(position.column - 1, newLine.length, 0); if (!slicedTokens) { return text; } diff --git a/src/vs/editor/contrib/inlineCompletions/browser/model/singleTextEditHelpers.ts b/src/vs/editor/contrib/inlineCompletions/browser/model/singleTextEditHelpers.ts new file mode 100644 index 00000000000..33931934c1b --- /dev/null +++ b/src/vs/editor/contrib/inlineCompletions/browser/model/singleTextEditHelpers.ts @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { commonPrefixLength } from '../../../../../base/common/strings.js'; +import { Range } from '../../../../common/core/range.js'; +import { TextLength } from '../../../../common/core/textLength.js'; +import { SingleTextEdit } from '../../../../common/core/textEdit.js'; +import { EndOfLinePreference, ITextModel } from '../../../../common/model.js'; + +export function singleTextRemoveCommonPrefix(edit: SingleTextEdit, model: ITextModel, validModelRange?: Range): SingleTextEdit { + const modelRange = validModelRange ? edit.range.intersectRanges(validModelRange) : edit.range; + if (!modelRange) { + return edit; + } + const valueToReplace = model.getValueInRange(modelRange, EndOfLinePreference.LF); + const commonPrefixLen = commonPrefixLength(valueToReplace, edit.text); + const start = TextLength.ofText(valueToReplace.substring(0, commonPrefixLen)).addToPosition(edit.range.getStartPosition()); + const text = edit.text.substring(commonPrefixLen); + const range = Range.fromPositions(start, edit.range.getEndPosition()); + return new SingleTextEdit(range, text); +} + +export function singleTextEditAugments(edit: SingleTextEdit, base: SingleTextEdit): boolean { + // The augmented completion must replace the base range, but can replace even more + return edit.text.startsWith(base.text) && rangeExtends(edit.range, base.range); +} + +function rangeExtends(extendingRange: Range, rangeToExtend: Range): boolean { + return rangeToExtend.getStartPosition().equals(extendingRange.getStartPosition()) + && rangeToExtend.getEndPosition().isBeforeOrEqual(extendingRange.getEndPosition()); +} diff --git a/src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.ts b/src/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdaptor.ts similarity index 87% rename from src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.ts rename to src/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdaptor.ts index daf73173ef4..cb86cfea852 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdaptor.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { compareBy, numberComparator } from 'vs/base/common/arrays'; -import { findFirstMax } from 'vs/base/common/arraysFind'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { SingleTextEdit } from 'vs/editor/common/core/textEdit'; -import { CompletionItemInsertTextRule, CompletionItemKind, SelectedSuggestionInfo } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { singleTextEditAugments, singleTextRemoveCommonPrefix } from 'vs/editor/contrib/inlineCompletions/browser/singleTextEdit'; -import { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser'; -import { SnippetSession } from 'vs/editor/contrib/snippet/browser/snippetSession'; -import { CompletionItem } from 'vs/editor/contrib/suggest/browser/suggest'; -import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController'; +import { compareBy, numberComparator } from '../../../../../base/common/arrays.js'; +import { findFirstMax } from '../../../../../base/common/arraysFind.js'; +import { Emitter, Event } from '../../../../../base/common/event.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { SingleTextEdit } from '../../../../common/core/textEdit.js'; +import { CompletionItemInsertTextRule, CompletionItemKind, SelectedSuggestionInfo } from '../../../../common/languages.js'; +import { ITextModel } from '../../../../common/model.js'; +import { singleTextEditAugments, singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js'; +import { SnippetParser } from '../../../snippet/browser/snippetParser.js'; +import { SnippetSession } from '../../../snippet/browser/snippetSession.js'; +import { CompletionItem } from '../../../suggest/browser/suggest.js'; +import { SuggestController } from '../../../suggest/browser/suggestController.js'; export class SuggestWidgetAdaptor extends Disposable { private isSuggestWidgetVisible: boolean = false; diff --git a/src/vs/editor/contrib/inlineCompletions/browser/utils.ts b/src/vs/editor/contrib/inlineCompletions/browser/utils.ts index 20236aade3b..0b1a504e56c 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/utils.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/utils.ts @@ -3,13 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BugIndicatingError } from 'vs/base/common/errors'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, autorunOpts } from 'vs/base/common/observable'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IModelDeltaDecoration } from 'vs/editor/common/model'; +import { Permutation, compareBy } from '../../../../base/common/arrays.js'; +import { BugIndicatingError } from '../../../../base/common/errors.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { IObservable, observableValue, ISettableObservable, autorun, transaction } from '../../../../base/common/observable.js'; +import { splitLinesIncludeSeparators } from '../../../../base/common/strings.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { SingleTextEdit, TextEdit } from '../../../common/core/textEdit.js'; const array: ReadonlyArray = []; export function getReadonlyEmptyArray(): readonly T[] { @@ -36,21 +37,6 @@ export class ColumnRange { } } -export function applyObservableDecorations(editor: ICodeEditor, decorations: IObservable): IDisposable { - const d = new DisposableStore(); - const decorationsCollection = editor.createDecorationsCollection(); - d.add(autorunOpts({ debugName: () => `Apply decorations from ${decorations.debugName}` }, reader => { - const d = decorations.read(reader); - decorationsCollection.set(d); - })); - d.add({ - dispose: () => { - decorationsCollection.clear(); - } - }); - return d; -} - export function addPositions(pos1: Position, pos2: Position): Position { return new Position(pos1.lineNumber + pos2.lineNumber - 1, pos2.lineNumber === 1 ? pos1.column + pos2.column - 1 : pos2.column); } @@ -58,3 +44,44 @@ export function addPositions(pos1: Position, pos2: Position): Position { export function subtractPositions(pos1: Position, pos2: Position): Position { return new Position(pos1.lineNumber - pos2.lineNumber + 1, pos1.lineNumber - pos2.lineNumber === 0 ? pos1.column - pos2.column + 1 : pos1.column); } + +export function substringPos(text: string, pos: Position): string { + let subtext = ''; + const lines = splitLinesIncludeSeparators(text); + for (let i = pos.lineNumber - 1; i < lines.length; i++) { + subtext += lines[i].substring(i === pos.lineNumber - 1 ? pos.column - 1 : 0); + } + return subtext; +} + +export function getEndPositionsAfterApplying(edits: readonly SingleTextEdit[]): Position[] { + const sortPerm = Permutation.createSortPermutation(edits, compareBy(e => e.range, Range.compareRangesUsingStarts)); + const edit = new TextEdit(sortPerm.apply(edits)); + const sortedNewRanges = edit.getNewRanges(); + const newRanges = sortPerm.inverse().apply(sortedNewRanges); + return newRanges.map(range => range.getEndPosition()); +} + +export function convertItemsToStableObservables(items: IObservable, store: DisposableStore): IObservable[]> { + const result = observableValue[]>('result', []); + const innerObservables: ISettableObservable[] = []; + + store.add(autorun(reader => { + const itemsValue = items.read(reader); + + transaction(tx => { + if (itemsValue.length !== innerObservables.length) { + innerObservables.length = itemsValue.length; + for (let i = 0; i < innerObservables.length; i++) { + if (!innerObservables[i]) { + innerObservables[i] = observableValue('item', itemsValue[i]); + } + } + result.set([...innerObservables], tx); + } + innerObservables.forEach((o, i) => o.set(itemsValue[i], tx)); + }); + })); + + return result; +} diff --git a/src/vs/editor/contrib/inlineCompletions/browser/ghostText.css b/src/vs/editor/contrib/inlineCompletions/browser/view/ghostTextView.css similarity index 90% rename from src/vs/editor/contrib/inlineCompletions/browser/ghostText.css rename to src/vs/editor/contrib/inlineCompletions/browser/view/ghostTextView.css index ea7193a130d..1ed8b6d0be9 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/ghostText.css +++ b/src/vs/editor/contrib/inlineCompletions/browser/view/ghostTextView.css @@ -36,7 +36,12 @@ .monaco-editor .ghost-text-decoration, .monaco-editor .ghost-text-decoration-preview, .monaco-editor .suggest-preview-text .ghost-text { - color: var(--vscode-editorGhostText-foreground) !important; + &.syntax-highlighted { + opacity: 0.7; + } + &:not(.syntax-highlighted) { + color: var(--vscode-editorGhostText-foreground); + } background-color: var(--vscode-editorGhostText-background); border: 1px solid var(--vscode-editorGhostText-border); } diff --git a/src/vs/editor/contrib/inlineCompletions/browser/view/ghostTextView.ts b/src/vs/editor/contrib/inlineCompletions/browser/view/ghostTextView.ts new file mode 100644 index 00000000000..4851968a3bc --- /dev/null +++ b/src/vs/editor/contrib/inlineCompletions/browser/view/ghostTextView.ts @@ -0,0 +1,365 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { createTrustedTypesPolicy } from '../../../../../base/browser/trustedTypes.js'; +import { Event } from '../../../../../base/common/event.js'; +import { Disposable, toDisposable } from '../../../../../base/common/lifecycle.js'; +import { IObservable, autorun, derived, observableSignalFromEvent, observableValue } from '../../../../../base/common/observable.js'; +import * as strings from '../../../../../base/common/strings.js'; +import './ghostTextView.css'; +import { applyFontInfo } from '../../../../browser/config/domFontInfo.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { EditorFontLigatures, EditorOption, IComputedEditorOptions } from '../../../../common/config/editorOptions.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { StringBuilder } from '../../../../common/core/stringBuilder.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops, PositionAffinity } from '../../../../common/model.js'; +import { LineTokens } from '../../../../common/tokens/lineTokens.js'; +import { LineDecoration } from '../../../../common/viewLayout/lineDecorations.js'; +import { RenderLineInput, renderViewLine } from '../../../../common/viewLayout/viewLineRenderer.js'; +import { InlineDecorationType } from '../../../../common/viewModel.js'; +import { GhostText, GhostTextReplacement } from '../model/ghostText.js'; +import { ColumnRange } from '../utils.js'; +import { observableCodeEditor } from '../../../../browser/observableCodeEditor.js'; +import { OffsetEdit, SingleOffsetEdit } from '../../../../common/core/offsetEdit.js'; +import { LineEditWithAdditionalLines } from '../../../../common/tokenizationTextModelPart.js'; + +export interface IGhostTextWidgetModel { + readonly targetTextModel: IObservable; + readonly ghostText: IObservable; + readonly minReservedLineCount: IObservable; +} + +export class GhostTextView extends Disposable { + private readonly _isDisposed = observableValue(this, false); + private readonly _editorObs = observableCodeEditor(this._editor); + + constructor( + private readonly _editor: ICodeEditor, + private readonly _model: IGhostTextWidgetModel, + @ILanguageService private readonly _languageService: ILanguageService, + ) { + super(); + + this._register(toDisposable(() => { this._isDisposed.set(true, undefined); })); + this._register(this._editorObs.setDecorations(this.decorations)); + } + + private readonly _useSyntaxHighlighting = this._editorObs.getOption(EditorOption.inlineSuggest).map(v => v.syntaxHighlightingEnabled); + + private readonly uiState = derived(this, reader => { + if (this._isDisposed.read(reader)) { return undefined; } + const textModel = this._editorObs.model.read(reader); + if (textModel !== this._model.targetTextModel.read(reader)) { return undefined; } + const ghostText = this._model.ghostText.read(reader); + if (!ghostText) { return undefined; } + + const replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : undefined; + + const syntaxHighlightingEnabled = this._useSyntaxHighlighting.read(reader); + const extraClassName = syntaxHighlightingEnabled ? ' syntax-highlighted' : ''; + const { inlineTexts, additionalLines, hiddenRange } = computeGhostTextViewData(ghostText, textModel, 'ghost-text' + extraClassName); + + const edit = new OffsetEdit(inlineTexts.map(t => SingleOffsetEdit.insert(t.column - 1, t.text))); + const tokens = syntaxHighlightingEnabled ? textModel.tokenization.tokenizeLineWithEdit(ghostText.lineNumber, new LineEditWithAdditionalLines( + edit, + additionalLines.map(l => l.content) + )) : undefined; + const newRanges = edit.getNewTextRanges(); + const inlineTextsWithTokens = inlineTexts.map((t, idx) => ({ ...t, tokens: tokens?.mainLineTokens?.getTokensInRange(newRanges[idx]) })); + + const tokenizedAdditionalLines: LineData[] = additionalLines.map((l, idx) => ({ + content: tokens?.additionalLines?.[idx] ?? LineTokens.createEmpty(l.content, this._languageService.languageIdCodec), + decorations: l.decorations, + })); + + return { + replacedRange, + inlineTexts: inlineTextsWithTokens, + additionalLines: tokenizedAdditionalLines, + hiddenRange, + lineNumber: ghostText.lineNumber, + additionalReservedLineCount: this._model.minReservedLineCount.read(reader), + targetTextModel: textModel, + syntaxHighlightingEnabled, + }; + }); + + private readonly decorations = derived(this, reader => { + const uiState = this.uiState.read(reader); + if (!uiState) { return []; } + + const decorations: IModelDeltaDecoration[] = []; + + const extraClassName = uiState.syntaxHighlightingEnabled ? ' syntax-highlighted' : ''; + + if (uiState.replacedRange) { + decorations.push({ + range: uiState.replacedRange.toRange(uiState.lineNumber), + options: { inlineClassName: 'inline-completion-text-to-replace' + extraClassName, description: 'GhostTextReplacement' } + }); + } + + if (uiState.hiddenRange) { + decorations.push({ + range: uiState.hiddenRange.toRange(uiState.lineNumber), + options: { inlineClassName: 'ghost-text-hidden', description: 'ghost-text-hidden', } + }); + } + + for (const p of uiState.inlineTexts) { + decorations.push({ + range: Range.fromPositions(new Position(uiState.lineNumber, p.column)), + options: { + description: 'ghost-text-decoration', + after: { + content: p.text, + tokens: p.tokens, + inlineClassName: p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration' + extraClassName, + cursorStops: InjectedTextCursorStops.Left + }, + showIfCollapsed: true, + } + }); + } + + return decorations; + }); + + private readonly additionalLinesWidget = this._register( + new AdditionalLinesWidget( + this._editor, + derived(reader => { + /** @description lines */ + const uiState = this.uiState.read(reader); + return uiState ? { + lineNumber: uiState.lineNumber, + additionalLines: uiState.additionalLines, + minReservedLineCount: uiState.additionalReservedLineCount, + targetTextModel: uiState.targetTextModel, + } : undefined; + }) + ) + ); + + public ownsViewZone(viewZoneId: string): boolean { + return this.additionalLinesWidget.viewZoneId === viewZoneId; + } +} + +function computeGhostTextViewData(ghostText: GhostText | GhostTextReplacement, textModel: ITextModel, ghostTextClassName: string) { + const inlineTexts: { column: number; text: string; preview: boolean }[] = []; + const additionalLines: { content: string; decorations: LineDecoration[] }[] = []; + + function addToAdditionalLines(lines: readonly string[], className: string | undefined) { + if (additionalLines.length > 0) { + const lastLine = additionalLines[additionalLines.length - 1]; + if (className) { + lastLine.decorations.push(new LineDecoration( + lastLine.content.length + 1, + lastLine.content.length + 1 + lines[0].length, + className, + InlineDecorationType.Regular + )); + } + lastLine.content += lines[0]; + + lines = lines.slice(1); + } + for (const line of lines) { + additionalLines.push({ + content: line, + decorations: className ? [new LineDecoration( + 1, + line.length + 1, + className, + InlineDecorationType.Regular + )] : [] + }); + } + } + + const textBufferLine = textModel.getLineContent(ghostText.lineNumber); + + let hiddenTextStartColumn: number | undefined = undefined; + let lastIdx = 0; + for (const part of ghostText.parts) { + let lines = part.lines; + if (hiddenTextStartColumn === undefined) { + inlineTexts.push({ column: part.column, text: lines[0], preview: part.preview }); + lines = lines.slice(1); + } else { + addToAdditionalLines([textBufferLine.substring(lastIdx, part.column - 1)], undefined); + } + + if (lines.length > 0) { + addToAdditionalLines(lines, ghostTextClassName); + if (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) { + hiddenTextStartColumn = part.column; + } + } + + lastIdx = part.column - 1; + } + if (hiddenTextStartColumn !== undefined) { + addToAdditionalLines([textBufferLine.substring(lastIdx)], undefined); + } + + const hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined; + + return { + inlineTexts, + additionalLines, + hiddenRange, + }; +} + +export class AdditionalLinesWidget extends Disposable { + private _viewZoneId: string | undefined = undefined; + public get viewZoneId(): string | undefined { return this._viewZoneId; } + + private readonly editorOptionsChanged = observableSignalFromEvent('editorOptionChanged', Event.filter( + this.editor.onDidChangeConfiguration, + e => e.hasChanged(EditorOption.disableMonospaceOptimizations) + || e.hasChanged(EditorOption.stopRenderingLineAfter) + || e.hasChanged(EditorOption.renderWhitespace) + || e.hasChanged(EditorOption.renderControlCharacters) + || e.hasChanged(EditorOption.fontLigatures) + || e.hasChanged(EditorOption.fontInfo) + || e.hasChanged(EditorOption.lineHeight) + )); + + constructor( + private readonly editor: ICodeEditor, + private readonly lines: IObservable<{ + targetTextModel: ITextModel; + lineNumber: number; + additionalLines: LineData[]; + minReservedLineCount: number; + } | undefined> + ) { + super(); + + this._register(autorun(reader => { + /** @description update view zone */ + const lines = this.lines.read(reader); + this.editorOptionsChanged.read(reader); + + if (lines) { + this.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount); + } else { + this.clear(); + } + })); + } + + public override dispose(): void { + super.dispose(); + this.clear(); + } + + private clear(): void { + this.editor.changeViewZones((changeAccessor) => { + if (this._viewZoneId) { + changeAccessor.removeZone(this._viewZoneId); + this._viewZoneId = undefined; + } + }); + } + + private updateLines(lineNumber: number, additionalLines: LineData[], minReservedLineCount: number): void { + const textModel = this.editor.getModel(); + if (!textModel) { + return; + } + + const { tabSize } = textModel.getOptions(); + + this.editor.changeViewZones((changeAccessor) => { + if (this._viewZoneId) { + changeAccessor.removeZone(this._viewZoneId); + this._viewZoneId = undefined; + } + + const heightInLines = Math.max(additionalLines.length, minReservedLineCount); + if (heightInLines > 0) { + const domNode = document.createElement('div'); + renderLines(domNode, tabSize, additionalLines, this.editor.getOptions()); + + this._viewZoneId = changeAccessor.addZone({ + afterLineNumber: lineNumber, + heightInLines: heightInLines, + domNode, + afterColumnAffinity: PositionAffinity.Right + }); + } + }); + } +} + +export interface LineData { + content: LineTokens; // Must not contain a linebreak! + decorations: LineDecoration[]; +} + +function renderLines(domNode: HTMLElement, tabSize: number, lines: LineData[], opts: IComputedEditorOptions): void { + const disableMonospaceOptimizations = opts.get(EditorOption.disableMonospaceOptimizations); + const stopRenderingLineAfter = opts.get(EditorOption.stopRenderingLineAfter); + // To avoid visual confusion, we don't want to render visible whitespace + const renderWhitespace = 'none'; + const renderControlCharacters = opts.get(EditorOption.renderControlCharacters); + const fontLigatures = opts.get(EditorOption.fontLigatures); + const fontInfo = opts.get(EditorOption.fontInfo); + const lineHeight = opts.get(EditorOption.lineHeight); + + const sb = new StringBuilder(10000); + sb.appendString('
'); + + for (let i = 0, len = lines.length; i < len; i++) { + const lineData = lines[i]; + const lineTokens = lineData.content; + sb.appendString('
'); + + const line = lineTokens.getLineContent(); + const isBasicASCII = strings.isBasicASCII(line); + const containsRTL = strings.containsRTL(line); + + renderViewLine(new RenderLineInput( + (fontInfo.isMonospace && !disableMonospaceOptimizations), + fontInfo.canUseHalfwidthRightwardsArrow, + line, + false, + isBasicASCII, + containsRTL, + 0, + lineTokens, + lineData.decorations, + tabSize, + 0, + fontInfo.spaceWidth, + fontInfo.middotWidth, + fontInfo.wsmiddotWidth, + stopRenderingLineAfter, + renderWhitespace, + renderControlCharacters, + fontLigatures !== EditorFontLigatures.OFF, + null + ), sb); + + sb.appendString('
'); + } + sb.appendString('
'); + + applyFontInfo(domNode, fontInfo); + const html = sb.build(); + const trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html; + domNode.innerHTML = trustedhtml as string; +} + +export const ttPolicy = createTrustedTypesPolicy('editorGhostText', { createHTML: value => value }); diff --git a/src/vs/editor/contrib/inlineCompletions/test/browser/inlineCompletionsModel.test.ts b/src/vs/editor/contrib/inlineCompletions/test/browser/inlineCompletionsModel.test.ts index 63ab19affbe..6ba5f06b158 100644 --- a/src/vs/editor/contrib/inlineCompletions/test/browser/inlineCompletionsModel.test.ts +++ b/src/vs/editor/contrib/inlineCompletions/test/browser/inlineCompletionsModel.test.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Position } from 'vs/editor/common/core/position'; -import { getSecondaryEdits } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel'; -import { SingleTextEdit } from 'vs/editor/common/core/textEdit'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { Range } from 'vs/editor/common/core/range'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { Position } from '../../../../common/core/position.js'; +import { getSecondaryEdits } from '../../browser/model/inlineCompletionsModel.js'; +import { SingleTextEdit } from '../../../../common/core/textEdit.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { Range } from '../../../../common/core/range.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; suite('inlineCompletionModel', () => { diff --git a/src/vs/editor/contrib/inlineCompletions/test/browser/inlineCompletionsProvider.test.ts b/src/vs/editor/contrib/inlineCompletions/test/browser/inlineCompletionsProvider.test.ts index e318702da15..28bd5ab66a4 100644 --- a/src/vs/editor/contrib/inlineCompletions/test/browser/inlineCompletionsProvider.test.ts +++ b/src/vs/editor/contrib/inlineCompletions/test/browser/inlineCompletionsProvider.test.ts @@ -4,25 +4,25 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { timeout } from 'vs/base/common/async'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { InlineCompletionsProvider } from 'vs/editor/common/languages'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; -import { InlineCompletionsController } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController'; -import { InlineCompletionsModel } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel'; -import { SingleTextEdit } from 'vs/editor/common/core/textEdit'; -import { GhostTextContext, MockInlineCompletionsProvider } from 'vs/editor/contrib/inlineCompletions/test/browser/utils'; -import { ITestCodeEditor, TestCodeEditorInstantiationOptions, withAsyncTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { Selection } from 'vs/editor/common/core/selection'; -import { computeGhostText } from 'vs/editor/contrib/inlineCompletions/browser/singleTextEdit'; +import { timeout } from '../../../../../base/common/async.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { runWithFakedTimers } from '../../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Range } from '../../../../common/core/range.js'; +import { InlineCompletionsProvider } from '../../../../common/languages.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { LanguageFeaturesService } from '../../../../common/services/languageFeaturesService.js'; +import { ViewModel } from '../../../../common/viewModel/viewModelImpl.js'; +import { InlineCompletionsController } from '../../browser/controller/inlineCompletionsController.js'; +import { InlineCompletionsModel } from '../../browser/model/inlineCompletionsModel.js'; +import { SingleTextEdit } from '../../../../common/core/textEdit.js'; +import { GhostTextContext, MockInlineCompletionsProvider } from './utils.js'; +import { ITestCodeEditor, TestCodeEditorInstantiationOptions, withAsyncTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { IAccessibilitySignalService } from '../../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { computeGhostText } from '../../browser/model/computeGhostText.js'; suite('Inline Completions', () => { ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/editor/contrib/inlineCompletions/test/browser/suggestWidgetModel.test.ts b/src/vs/editor/contrib/inlineCompletions/test/browser/suggestWidgetModel.test.ts index a860898c64e..aa8fe85b002 100644 --- a/src/vs/editor/contrib/inlineCompletions/test/browser/suggestWidgetModel.test.ts +++ b/src/vs/editor/contrib/inlineCompletions/test/browser/suggestWidgetModel.test.ts @@ -3,39 +3,39 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { timeout } from 'vs/base/common/async'; -import { Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { mock } from 'vs/base/test/common/mock'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { Range } from 'vs/editor/common/core/range'; -import { CompletionItemKind, CompletionItemProvider } from 'vs/editor/common/languages'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; -import { GhostTextContext } from 'vs/editor/contrib/inlineCompletions/test/browser/utils'; -import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; -import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController'; -import { ISuggestMemoryService } from 'vs/editor/contrib/suggest/browser/suggestMemory'; -import { ITestCodeEditor, TestCodeEditorInstantiationOptions, withAsyncTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { IMenu, IMenuService } from 'vs/platform/actions/common/actions'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { MockKeybindingService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { InMemoryStorageService, IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; +import { timeout } from '../../../../../base/common/async.js'; +import { Event } from '../../../../../base/common/event.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { runWithFakedTimers } from '../../../../../base/test/common/timeTravelScheduler.js'; +import { Range } from '../../../../common/core/range.js'; +import { CompletionItemKind, CompletionItemProvider } from '../../../../common/languages.js'; +import { IEditorWorkerService } from '../../../../common/services/editorWorker.js'; +import { ViewModel } from '../../../../common/viewModel/viewModelImpl.js'; +import { GhostTextContext } from './utils.js'; +import { SnippetController2 } from '../../../snippet/browser/snippetController2.js'; +import { SuggestController } from '../../../suggest/browser/suggestController.js'; +import { ISuggestMemoryService } from '../../../suggest/browser/suggestMemory.js'; +import { ITestCodeEditor, TestCodeEditorInstantiationOptions, withAsyncTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { IMenu, IMenuService } from '../../../../../platform/actions/common/actions.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { MockKeybindingService } from '../../../../../platform/keybinding/test/common/mockKeybindingService.js'; +import { ILogService, NullLogService } from '../../../../../platform/log/common/log.js'; +import { InMemoryStorageService, IStorageService } from '../../../../../platform/storage/common/storage.js'; +import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js'; +import { NullTelemetryService } from '../../../../../platform/telemetry/common/telemetryUtils.js'; import assert from 'assert'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { InlineCompletionsModel } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel'; -import { InlineCompletionsController } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController'; -import { autorun } from 'vs/base/common/observable'; -import { setUnexpectedErrorHandler } from 'vs/base/common/errors'; -import { IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { ILabelService } from '../../../../../platform/label/common/label.js'; +import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js'; +import { LanguageFeaturesService } from '../../../../common/services/languageFeaturesService.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { InlineCompletionsModel } from '../../browser/model/inlineCompletionsModel.js'; +import { InlineCompletionsController } from '../../browser/controller/inlineCompletionsController.js'; +import { autorun } from '../../../../../base/common/observable.js'; +import { setUnexpectedErrorHandler } from '../../../../../base/common/errors.js'; +import { IAccessibilitySignalService } from '../../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; suite('Suggest Widget Model', () => { ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/editor/contrib/inlineCompletions/test/browser/utils.ts b/src/vs/editor/contrib/inlineCompletions/test/browser/utils.ts index 11c24b0b0e6..9cd0d114694 100644 --- a/src/vs/editor/contrib/inlineCompletions/test/browser/utils.ts +++ b/src/vs/editor/contrib/inlineCompletions/test/browser/utils.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { timeout } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { CoreEditingCommands, CoreNavigationCommands } from 'vs/editor/browser/coreCommands'; -import { Position } from 'vs/editor/common/core/position'; -import { ITextModel } from 'vs/editor/common/model'; -import { InlineCompletion, InlineCompletionContext, InlineCompletionsProvider } from 'vs/editor/common/languages'; -import { ITestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { InlineCompletionsModel } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel'; -import { autorun } from 'vs/base/common/observable'; +import { timeout } from '../../../../../base/common/async.js'; +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { CoreEditingCommands, CoreNavigationCommands } from '../../../../browser/coreCommands.js'; +import { Position } from '../../../../common/core/position.js'; +import { ITextModel } from '../../../../common/model.js'; +import { InlineCompletion, InlineCompletionContext, InlineCompletionsProvider } from '../../../../common/languages.js'; +import { ITestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { InlineCompletionsModel } from '../../browser/model/inlineCompletionsModel.js'; +import { autorun } from '../../../../../base/common/observable.js'; export class MockInlineCompletionsProvider implements InlineCompletionsProvider { private returnValue: InlineCompletion[] = []; diff --git a/src/vs/editor/contrib/inlineEdit/browser/commands.ts b/src/vs/editor/contrib/inlineEdit/browser/commands.ts index d7e1f4fe8cb..268fba6229a 100644 --- a/src/vs/editor/contrib/inlineEdit/browser/commands.ts +++ b/src/vs/editor/contrib/inlineEdit/browser/commands.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { inlineEditAcceptId, inlineEditJumpBackId, inlineEditJumpToId, inlineEditRejectId } from 'vs/editor/contrib/inlineEdit/browser/commandIds'; -import { InlineEditController } from 'vs/editor/contrib/inlineEdit/browser/inlineEditController'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { inlineEditAcceptId, inlineEditJumpBackId, inlineEditJumpToId, inlineEditRejectId } from './commandIds.js'; +import { InlineEditController } from './inlineEditController.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; export class AcceptInlineEdit extends EditorAction { constructor() { diff --git a/src/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.ts b/src/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.ts index 58e6b00260c..abe204adc1e 100644 --- a/src/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.ts +++ b/src/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.ts @@ -3,19 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, derived, observableFromEvent, observableValue } from 'vs/base/common/observable'; -import 'vs/css!./inlineEdit'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops } from 'vs/editor/common/model'; -import { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations'; -import { InlineDecorationType } from 'vs/editor/common/viewModel'; -import { AdditionalLinesWidget, LineData } from 'vs/editor/contrib/inlineCompletions/browser/ghostTextWidget'; -import { GhostText } from 'vs/editor/contrib/inlineCompletions/browser/ghostText'; -import { ColumnRange, applyObservableDecorations } from 'vs/editor/contrib/inlineCompletions/browser/utils'; +import { Disposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { IObservable, derived, observableFromEvent, observableValue } from '../../../../base/common/observable.js'; +import './inlineEdit.css'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops } from '../../../common/model.js'; +import { LineDecoration } from '../../../common/viewLayout/lineDecorations.js'; +import { InlineDecorationType } from '../../../common/viewModel.js'; +import { AdditionalLinesWidget, LineData } from '../../inlineCompletions/browser/view/ghostTextView.js'; +import { GhostText } from '../../inlineCompletions/browser/model/ghostText.js'; +import { ColumnRange } from '../../inlineCompletions/browser/utils.js'; +import { diffDeleteDecoration, diffLineDeleteDecorationBackgroundWithIndicator } from '../../../browser/widget/diffEditor/registrations.contribution.js'; +import { LineTokens } from '../../../common/tokens/lineTokens.js'; +import { observableCodeEditor } from '../../../browser/observableCodeEditor.js'; export const INLINE_EDIT_DESCRIPTION = 'inline-edit'; export interface IGhostTextWidgetModel { @@ -23,22 +26,24 @@ export interface IGhostTextWidgetModel { readonly ghostText: IObservable; readonly minReservedLineCount: IObservable; readonly range: IObservable; - readonly backgroundColoring: IObservable; } export class GhostTextWidget extends Disposable { private readonly isDisposed = observableValue(this, false); - private readonly currentTextModel = observableFromEvent(this, this.editor.onDidChangeModel, () => /** @description editor.model */ this.editor.getModel()); + private readonly currentTextModel = observableFromEvent(this, this._editor.onDidChangeModel, () => /** @description editor.model */ this._editor.getModel()); + + private readonly _editorObs = observableCodeEditor(this._editor); constructor( - private readonly editor: ICodeEditor, + private readonly _editor: ICodeEditor, readonly model: IGhostTextWidgetModel, @ILanguageService private readonly languageService: ILanguageService, ) { super(); this._register(toDisposable(() => { this.isDisposed.set(true, undefined); })); - this._register(applyObservableDecorations(this.editor, this.decorations)); + + this._register(this._editorObs.setDecorations(this.decorations)); } private readonly uiState = derived(this, reader => { @@ -54,7 +59,6 @@ export class GhostTextWidget extends Disposable { return undefined; } - let range = this.model.range?.read(reader); //if range is empty, we want to remove it if (range && range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn) { @@ -68,13 +72,20 @@ export class GhostTextWidget extends Disposable { const isPureRemove = ghostText.parts.length === 1 && ghostText.parts[0].lines.every(l => l.length === 0); const inlineTexts: { column: number; text: string; preview: boolean }[] = []; - const additionalLines: LineData[] = []; + const additionalLines: { content: string; decorations: LineDecoration[] }[] = []; function addToAdditionalLines(lines: readonly string[], className: string | undefined) { if (additionalLines.length > 0) { const lastLine = additionalLines[additionalLines.length - 1]; if (className) { - lastLine.decorations.push(new LineDecoration(lastLine.content.length + 1, lastLine.content.length + 1 + lines[0].length, className, InlineDecorationType.Regular)); + lastLine.decorations.push( + new LineDecoration( + lastLine.content.length + 1, + lastLine.content.length + 1 + lines[0].length, + className, + InlineDecorationType.Regular + ) + ); } lastLine.content += lines[0]; @@ -92,7 +103,7 @@ export class GhostTextWidget extends Disposable { let hiddenTextStartColumn: number | undefined = undefined; let lastIdx = 0; - if (!isPureRemove) { + if (!isPureRemove && (isSingleLine || !range)) { for (const part of ghostText.parts) { let lines = part.lines; //If remove range is set, we want to push all new liens to virtual area @@ -140,7 +151,6 @@ export class GhostTextWidget extends Disposable { range, isSingleLine, isPureRemove, - backgroundColoring: this.model.backgroundColoring.read(reader) }; }); @@ -164,7 +174,7 @@ export class GhostTextWidget extends Disposable { if (uiState.isSingleLine) { ranges.push(uiState.range); } - else if (uiState.isPureRemove) { + else if (!uiState.isPureRemove) { const lines = uiState.range.endLineNumber - uiState.range.startLineNumber; for (let i = 0; i < lines; i++) { const line = uiState.range.startLineNumber + i; @@ -174,24 +184,22 @@ export class GhostTextWidget extends Disposable { ranges.push(range); } } - else { - const lines = uiState.range.endLineNumber - uiState.range.startLineNumber; - for (let i = 0; i < lines; i++) { - const line = uiState.range.startLineNumber + i; - const firstNonWhitespace = uiState.targetTextModel.getLineFirstNonWhitespaceColumn(line); - const lastNonWhitespace = uiState.targetTextModel.getLineLastNonWhitespaceColumn(line); - const range = new Range(line, firstNonWhitespace, line, lastNonWhitespace); - ranges.push(range); - } - } - const className = uiState.backgroundColoring ? 'inline-edit-remove backgroundColoring' : 'inline-edit-remove'; for (const range of ranges) { decorations.push({ range, - options: { inlineClassName: className, description: 'inline-edit-remove', } + options: diffDeleteDecoration }); } } + if (uiState.range && !uiState.isSingleLine && uiState.isPureRemove) { + const r = new Range(uiState.range.startLineNumber, 1, uiState.range.endLineNumber - 1, 1); + + decorations.push({ + range: r, + options: diffLineDeleteDecorationBackgroundWithIndicator + }); + + } for (const p of uiState.inlineTexts) { @@ -210,14 +218,16 @@ export class GhostTextWidget extends Disposable { private readonly additionalLinesWidget = this._register( new AdditionalLinesWidget( - this.editor, - this.languageService.languageIdCodec, + this._editor, derived(reader => { /** @description lines */ const uiState = this.uiState.read(reader); - return uiState && !uiState.isPureRemove ? { + return uiState && !uiState.isPureRemove && (uiState.isSingleLine || !uiState.range) ? { lineNumber: uiState.lineNumber, - additionalLines: uiState.additionalLines, + additionalLines: uiState.additionalLines.map(l => ({ + content: LineTokens.createEmpty(l.content, this.languageService.languageIdCodec), + decorations: l.decorations + } satisfies LineData)), minReservedLineCount: uiState.additionalReservedLineCount, targetTextModel: uiState.targetTextModel, } : undefined; diff --git a/src/vs/editor/contrib/inlineEdit/browser/hoverParticipant.ts b/src/vs/editor/contrib/inlineEdit/browser/hoverParticipant.ts index 6c1c7337f7f..41ffacc77bd 100644 --- a/src/vs/editor/contrib/inlineEdit/browser/hoverParticipant.ts +++ b/src/vs/editor/contrib/inlineEdit/browser/hoverParticipant.ts @@ -3,17 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { constObservable } from 'vs/base/common/observable'; -import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { IModelDecoration } from 'vs/editor/common/model'; -import { HoverAnchor, HoverAnchorType, HoverForeignElementAnchor, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { InlineEditController } from 'vs/editor/contrib/inlineEdit/browser/inlineEditController'; -import { InlineEditHintsContentWidget } from 'vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { constObservable } from '../../../../base/common/observable.js'; +import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { IModelDecoration } from '../../../common/model.js'; +import { HoverAnchor, HoverAnchorType, HoverForeignElementAnchor, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverPart, IRenderedHoverParts, RenderedHoverParts } from '../../hover/browser/hoverTypes.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { InlineEditController } from './inlineEditController.js'; +import { InlineEditHintsContentWidget } from './inlineEditHintsWidget.js'; +import * as nls from '../../../../nls.js'; export class InlineEditHover implements IHoverPart { constructor( @@ -86,8 +87,8 @@ export class InlineEditHoverParticipant implements IEditorHoverParticipant { + const disposables = new DisposableStore(); this._telemetryService.publicLog2<{}, { owner: 'hediet'; @@ -97,9 +98,17 @@ export class InlineEditHoverParticipant implements IEditorHoverParticipant = { + hoverPart: hoverParts[0], + hoverElement: widgetNode, + dispose: () => disposables.dispose() + }; + return new RenderedHoverParts([renderedHoverPart]); + } - return disposableStore; + getAccessibleContent(hoverPart: InlineEditHover): string { + return nls.localize('hoverAccessibilityInlineEdits', 'There are inline edits here.'); } } diff --git a/src/vs/editor/contrib/inlineEdit/browser/inlineEdit.contribution.ts b/src/vs/editor/contrib/inlineEdit/browser/inlineEdit.contribution.ts index 7196773a7cf..9f5a6c3dfb8 100644 --- a/src/vs/editor/contrib/inlineEdit/browser/inlineEdit.contribution.ts +++ b/src/vs/editor/contrib/inlineEdit/browser/inlineEdit.contribution.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { HoverParticipantRegistry } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { AcceptInlineEdit, JumpBackInlineEdit, JumpToInlineEdit, RejectInlineEdit, TriggerInlineEdit } from 'vs/editor/contrib/inlineEdit/browser/commands'; -import { InlineEditHoverParticipant } from 'vs/editor/contrib/inlineEdit/browser/hoverParticipant'; -import { InlineEditController } from 'vs/editor/contrib/inlineEdit/browser/inlineEditController'; +import { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js'; +// import { HoverParticipantRegistry } from 'vs/editor/contrib/hover/browser/hoverTypes'; +import { AcceptInlineEdit, JumpBackInlineEdit, JumpToInlineEdit, RejectInlineEdit, TriggerInlineEdit } from './commands.js'; +// import { InlineEditHoverParticipant } from 'vs/editor/contrib/inlineEdit/browser/hoverParticipant'; +import { InlineEditController } from './inlineEditController.js'; registerEditorAction(AcceptInlineEdit); registerEditorAction(RejectInlineEdit); @@ -17,4 +17,4 @@ registerEditorAction(TriggerInlineEdit); registerEditorContribution(InlineEditController.ID, InlineEditController, EditorContributionInstantiation.Eventually); -HoverParticipantRegistry.register(InlineEditHoverParticipant); +// HoverParticipantRegistry.register(InlineEditHoverParticipant); diff --git a/src/vs/editor/contrib/inlineEdit/browser/inlineEdit.css b/src/vs/editor/contrib/inlineEdit/browser/inlineEdit.css index d6d156544e0..aced5d6271e 100644 --- a/src/vs/editor/contrib/inlineEdit/browser/inlineEdit.css +++ b/src/vs/editor/contrib/inlineEdit/browser/inlineEdit.css @@ -6,11 +6,6 @@ .monaco-editor .inline-edit-remove { background-color: var(--vscode-editorGhostText-background); font-style: italic; - text-decoration: line-through; -} - -.monaco-editor .inline-edit-remove.backgroundColoring { - background-color: var(--vscode-diffEditor-removedLineBackground); } .monaco-editor .inline-edit-hidden { diff --git a/src/vs/editor/contrib/inlineEdit/browser/inlineEditController.ts b/src/vs/editor/contrib/inlineEdit/browser/inlineEditController.ts index 9ce9a02b2e6..b0cf6e51db8 100644 --- a/src/vs/editor/contrib/inlineEdit/browser/inlineEditController.ts +++ b/src/vs/editor/contrib/inlineEdit/browser/inlineEditController.ts @@ -3,50 +3,70 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { ISettableObservable, autorun, constObservable, disposableObservableValue, observableFromEvent, observableSignalFromEvent, observableValue, transaction } from 'vs/base/common/observable'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { GhostTextWidget } from 'vs/editor/contrib/inlineEdit/browser/ghostTextWidget'; -import { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IInlineEdit, InlineEditTriggerKind } from 'vs/editor/common/languages'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { GhostText, GhostTextPart } from 'vs/editor/contrib/inlineCompletions/browser/ghostText'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { InlineEditHintsWidget } from 'vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { createStyleSheet2 } from 'vs/base/browser/dom'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; - -export class InlineEditWidget implements IDisposable { - constructor(public readonly widget: GhostTextWidget, public readonly edit: IInlineEdit) { } - - dispose(): void { - this.widget.dispose(); - } -} +import { createStyleSheet2 } from '../../../../base/browser/dom.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { Disposable, IDisposable } from '../../../../base/common/lifecycle.js'; +import { ISettableObservable, autorun, constObservable, derivedDisposable, observableFromEvent, observableSignalFromEvent, observableValue, transaction } from '../../../../base/common/observable.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { IDiffProviderFactoryService } from '../../../browser/widget/diffEditor/diffProviderFactoryService.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { EditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IInlineEdit, InlineEditTriggerKind } from '../../../common/languages.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { IModelService } from '../../../common/services/model.js'; +import { GhostText, GhostTextPart } from '../../inlineCompletions/browser/model/ghostText.js'; +import { GhostTextWidget } from './ghostTextWidget.js'; +import { InlineEditHintsWidget } from './inlineEditHintsWidget.js'; +import { InlineEditSideBySideWidget } from './inlineEditSideBySideWidget.js'; export class InlineEditController extends Disposable { static ID = 'editor.contrib.inlineEditController'; public static readonly inlineEditVisibleKey = 'inlineEditVisible'; - public static readonly inlineEditVisibleContext = new RawContextKey(InlineEditController.inlineEditVisibleKey, false); + public static readonly inlineEditVisibleContext = new RawContextKey(this.inlineEditVisibleKey, false); private _isVisibleContext = InlineEditController.inlineEditVisibleContext.bindTo(this.contextKeyService); public static readonly cursorAtInlineEditKey = 'cursorAtInlineEdit'; - public static readonly cursorAtInlineEditContext = new RawContextKey(InlineEditController.cursorAtInlineEditKey, false); + public static readonly cursorAtInlineEditContext = new RawContextKey(this.cursorAtInlineEditKey, false); private _isCursorAtInlineEditContext = InlineEditController.cursorAtInlineEditContext.bindTo(this.contextKeyService); public static get(editor: ICodeEditor): InlineEditController | null { return editor.getContribution(InlineEditController.ID); } - private _currentEdit: ISettableObservable = this._register(disposableObservableValue(this, undefined)); + private _currentEdit: ISettableObservable = observableValue(this, undefined); + private _currentWidget = derivedDisposable(this._currentEdit, (reader) => { + const edit = this._currentEdit.read(reader); + if (!edit) { + return undefined; + } + const line = edit.range.endLineNumber; + const column = edit.range.endColumn; + const textToDisplay = edit.text.endsWith('\n') && !(edit.range.startLineNumber === edit.range.endLineNumber && edit.range.startColumn === edit.range.endColumn) ? edit.text.slice(0, -1) : edit.text; + const ghostText = new GhostText(line, [new GhostTextPart(column, textToDisplay, false)]); + //only show ghost text for single line edits + //unless it is a pure removal + //multi line edits are shown in the side by side widget + const isSingleLine = edit.range.startLineNumber === edit.range.endLineNumber && ghostText.parts.length === 1 && ghostText.parts[0].lines.length === 1; + const isPureRemoval = edit.text === ''; + if (!isSingleLine && !isPureRemoval) { + return undefined; + } + const instance = this.instantiationService.createInstance(GhostTextWidget, this.editor, { + ghostText: constObservable(ghostText), + minReservedLineCount: constObservable(0), + targetTextModel: constObservable(this.editor.getModel() ?? undefined), + range: constObservable(edit.range) + }); + return instance; + }); private _currentRequestCts: CancellationTokenSource | undefined; private _jumpBackPosition: Position | undefined; @@ -54,7 +74,6 @@ export class InlineEditController extends Disposable { private readonly _enabled = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).enabled); private readonly _fontFamily = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).fontFamily); - private readonly _backgroundColoring = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).backgroundColoring); constructor( @@ -64,6 +83,8 @@ export class InlineEditController extends Disposable { @ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService, @ICommandService private readonly _commandService: ICommandService, @IConfigurationService private readonly _configurationService: IConfigurationService, + @IDiffProviderFactoryService private readonly _diffProviderFactoryService: IDiffProviderFactoryService, + @IModelService private readonly _modelService: IModelService, ) { super(); @@ -154,7 +175,8 @@ export class InlineEditController extends Disposable { }`); })); - this._register(new InlineEditHintsWidget(this.editor, this._currentEdit, this.instantiationService)); + this._register(new InlineEditHintsWidget(this.editor, this._currentWidget, this.instantiationService)); + this._register(new InlineEditSideBySideWidget(this.editor, this._currentEdit, this.instantiationService, this._diffProviderFactoryService, this._modelService)); } private checkCursorPosition(position: Position) { @@ -162,7 +184,7 @@ export class InlineEditController extends Disposable { this._isCursorAtInlineEditContext.set(false); return; } - const gt = this._currentEdit.get()?.edit; + const gt = this._currentEdit.get(); if (!gt) { this._isCursorAtInlineEditContext.set(false); return; @@ -231,18 +253,7 @@ export class InlineEditController extends Disposable { if (!edit) { return; } - const line = edit.range.endLineNumber; - const column = edit.range.endColumn; - const textToDisplay = edit.text.endsWith('\n') && !(edit.range.startLineNumber === edit.range.endLineNumber && edit.range.startColumn === edit.range.endColumn) ? edit.text.slice(0, -1) : edit.text; - const ghostText = new GhostText(line, [new GhostTextPart(column, textToDisplay, false)]); - const instance = this.instantiationService.createInstance(GhostTextWidget, this.editor, { - ghostText: constObservable(ghostText), - minReservedLineCount: constObservable(0), - targetTextModel: constObservable(this.editor.getModel() ?? undefined), - range: constObservable(edit.range), - backgroundColoring: this._backgroundColoring - }); - this._currentEdit.set(new InlineEditWidget(instance, edit), undefined); + this._currentEdit.set(edit, undefined); } public async trigger() { @@ -260,7 +271,7 @@ export class InlineEditController extends Disposable { public async accept() { this._isAccepting.set(true, undefined); - const data = this._currentEdit.get()?.edit; + const data = this._currentEdit.get(); if (!data) { return; } @@ -287,7 +298,7 @@ export class InlineEditController extends Disposable { public jumpToCurrent(): void { this._jumpBackPosition = this.editor.getSelection()?.getStartPosition(); - const data = this._currentEdit.get()?.edit; + const data = this._currentEdit.get(); if (!data) { return; } @@ -298,7 +309,7 @@ export class InlineEditController extends Disposable { } public async clear(sendRejection: boolean = true) { - const edit = this._currentEdit.get()?.edit; + const edit = this._currentEdit.get(); if (edit && edit?.rejected && sendRejection) { await this._commandService .executeCommand(edit.rejected.id, ...(edit.rejected.arguments || [])) @@ -324,11 +335,15 @@ export class InlineEditController extends Disposable { public shouldShowHoverAt(range: Range) { const currentEdit = this._currentEdit.get(); + const currentWidget = this._currentWidget.get(); if (!currentEdit) { return false; } - const edit = currentEdit.edit; - const model = currentEdit.widget.model; + if (!currentWidget) { + return false; + } + const edit = currentEdit; + const model = currentWidget.model; const overReplaceRange = Range.containsPosition(edit.range, range.getStartPosition()) || Range.containsPosition(edit.range, range.getEndPosition()); if (overReplaceRange) { return true; @@ -341,7 +356,7 @@ export class InlineEditController extends Disposable { } public shouldShowHoverAtViewZone(viewZoneId: string): boolean { - return this._currentEdit.get()?.widget.ownsViewZone(viewZoneId) ?? false; + return this._currentWidget.get()?.ownsViewZone(viewZoneId) ?? false; } } diff --git a/src/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.ts b/src/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.ts index 215c85fbc0e..6bbbe5fce5d 100644 --- a/src/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.ts +++ b/src/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.ts @@ -3,28 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { h } from 'vs/base/browser/dom'; -import { KeybindingLabel, unthemedKeybindingLabelOptions } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; -import { IAction, Separator } from 'vs/base/common/actions'; -import { equals } from 'vs/base/common/arrays'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, autorun, autorunWithStore, derived, observableFromEvent } from 'vs/base/common/observable'; -import { OS } from 'vs/base/common/platform'; -import 'vs/css!./inlineEditHintsWidget'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { PositionAffinity } from 'vs/editor/common/model'; -import { InlineEditWidget } from 'vs/editor/contrib/inlineEdit/browser/inlineEditController'; -import { MenuEntryActionViewItem, createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenuWorkbenchToolBarOptions, WorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; -import { IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { h } from '../../../../base/browser/dom.js'; +import { KeybindingLabel, unthemedKeybindingLabelOptions } from '../../../../base/browser/ui/keybindingLabel/keybindingLabel.js'; +import { IAction, Separator } from '../../../../base/common/actions.js'; +import { equals } from '../../../../base/common/arrays.js'; +import { Disposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { IObservable, autorun, autorunWithStore, derived, observableFromEvent } from '../../../../base/common/observable.js'; +import { OS } from '../../../../base/common/platform.js'; +import './inlineEditHintsWidget.css'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { PositionAffinity } from '../../../common/model.js'; +import { GhostTextWidget } from './ghostTextWidget.js'; +import { MenuEntryActionViewItem, createAndFillInActionBarActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { IMenuWorkbenchToolBarOptions, WorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js'; +import { IMenuService, MenuId, MenuItemAction } from '../../../../platform/actions/common/actions.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; export class InlineEditHintsWidget extends Disposable { private readonly alwaysShowToolbar = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).showToolbar === 'always'); @@ -32,7 +32,7 @@ export class InlineEditHintsWidget extends Disposable { private sessionPosition: Position | undefined = undefined; private readonly position = derived(this, reader => { - const ghostText = this.model.read(reader)?.widget.model.ghostText.read(reader); + const ghostText = this.model.read(reader)?.model.ghostText.read(reader); if (!this.alwaysShowToolbar.read(reader) || !ghostText || ghostText.parts.length === 0) { this.sessionPosition = undefined; @@ -51,7 +51,7 @@ export class InlineEditHintsWidget extends Disposable { constructor( private readonly editor: ICodeEditor, - private readonly model: IObservable, + private readonly model: IObservable, @IInstantiationService private readonly instantiationService: IInstantiationService, ) { super(); diff --git a/src/vs/editor/contrib/inlineEdit/browser/inlineEditSideBySideWidget.css b/src/vs/editor/contrib/inlineEdit/browser/inlineEditSideBySideWidget.css new file mode 100644 index 00000000000..bc7e553e4d8 --- /dev/null +++ b/src/vs/editor/contrib/inlineEdit/browser/inlineEditSideBySideWidget.css @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +.monaco-editor .inlineEditSideBySide { + z-index: 39; + color: var(--vscode-editorHoverWidget-foreground); + background-color: var(--vscode-editorHoverWidget-background); + border: 1px solid var(--vscode-editorHoverWidget-border); + white-space: pre; +} diff --git a/src/vs/editor/contrib/inlineEdit/browser/inlineEditSideBySideWidget.ts b/src/vs/editor/contrib/inlineEdit/browser/inlineEditSideBySideWidget.ts new file mode 100644 index 00000000000..4655e81186d --- /dev/null +++ b/src/vs/editor/contrib/inlineEdit/browser/inlineEditSideBySideWidget.ts @@ -0,0 +1,354 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { $ } from '../../../../base/browser/dom.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Disposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { IObservable, ObservablePromise, autorun, autorunWithStore, derived, derivedDisposable, observableSignalFromEvent } from '../../../../base/common/observable.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from '../../../browser/editorBrowser.js'; +import { observableCodeEditor } from '../../../browser/observableCodeEditor.js'; +import { EmbeddedCodeEditorWidget } from '../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js'; +import { IDiffProviderFactoryService } from '../../../browser/widget/diffEditor/diffProviderFactoryService.js'; +import { diffAddDecoration, diffAddDecorationEmpty, diffDeleteDecoration, diffDeleteDecorationEmpty, diffLineAddDecorationBackgroundWithIndicator, diffLineDeleteDecorationBackgroundWithIndicator, diffWholeLineAddDecoration, diffWholeLineDeleteDecoration } from '../../../browser/widget/diffEditor/registrations.contribution.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { DetailedLineRangeMapping } from '../../../common/diff/rangeMapping.js'; +import { IInlineEdit } from '../../../common/languages.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../../../common/languages/modesRegistry.js'; +import { IModelDeltaDecoration } from '../../../common/model.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { IModelService } from '../../../common/services/model.js'; +import './inlineEditSideBySideWidget.css'; + +function* range(start: number, end: number, step = 1) { + if (end === undefined) { [end, start] = [start, 0]; } + for (let n = start; n < end; n += step) { yield n; } +} + +function removeIndentation(lines: string[]) { + const indentation = lines[0].match(/^\s*/)?.[0] ?? ''; + const length = indentation.length; + + return { + text: lines.map(l => l.replace(new RegExp('^' + indentation), '')), + shift: length + }; +} + +type Pos = { + top: number; + left: Position; +}; + +export class InlineEditSideBySideWidget extends Disposable { + private static _modelId = 0; + private static _createUniqueUri(): URI { + return URI.from({ scheme: 'inline-edit-widget', path: new Date().toString() + String(InlineEditSideBySideWidget._modelId++) }); + } + + private readonly _position = derived(this, reader => { + const ghostText = this._model.read(reader); + + if (!ghostText || ghostText.text.length === 0) { + return null; + } + if (ghostText.range.startLineNumber === ghostText.range.endLineNumber && !(ghostText.range.startColumn === ghostText.range.endColumn && ghostText.range.startColumn === 1)) { + //for inner-line suggestions we still want to use minimal ghost text + return null; + } + const editorModel = this._editor.getModel(); + if (!editorModel) { + return null; + } + const lines = Array.from(range(ghostText.range.startLineNumber, ghostText.range.endLineNumber + 1)); + const lengths = lines.map(lineNumber => editorModel.getLineLastNonWhitespaceColumn(lineNumber)); + const maxColumn = Math.max(...lengths); + const lineOfMaxColumn = lines[lengths.indexOf(maxColumn)]; + + const position = new Position(lineOfMaxColumn, maxColumn); + const pos = { + top: ghostText.range.startLineNumber, + left: position + }; + + return pos; + }); + + private readonly _text = derived(this, reader => { + const ghostText = this._model.read(reader); + if (!ghostText) { + return { text: '', shift: 0 }; + } + const t = removeIndentation(ghostText.text.split('\n')); + return { + text: t.text.join('\n'), + shift: t.shift + }; + }); + + + private readonly _originalModel = derivedDisposable(() => this._modelService.createModel('', null, InlineEditSideBySideWidget._createUniqueUri())).keepObserved(this._store); + private readonly _modifiedModel = derivedDisposable(() => this._modelService.createModel('', null, InlineEditSideBySideWidget._createUniqueUri())).keepObserved(this._store); + + private readonly _diff = derived(this, reader => { + return this._diffPromise.read(reader)?.promiseResult.read(reader)?.data; + }); + + private readonly _diffPromise = derived(this, reader => { + const ghostText = this._model.read(reader); + if (!ghostText) { + return; + } + const editorModel = this._editor.getModel(); + if (!editorModel) { + return; + } + const originalText = removeIndentation(editorModel.getValueInRange(ghostText.range).split('\n')).text.join('\n'); + const modifiedText = removeIndentation(ghostText.text.split('\n')).text.join('\n'); + this._originalModel.get().setValue(originalText); + this._modifiedModel.get().setValue(modifiedText); + const d = this._diffProviderFactoryService.createDiffProvider({ diffAlgorithm: 'advanced' }); + return ObservablePromise.fromFn(async () => { + const result = await d.computeDiff(this._originalModel.get(), this._modifiedModel.get(), { + computeMoves: false, + ignoreTrimWhitespace: false, + maxComputationTimeMs: 1000, + }, CancellationToken.None); + + if (result.identical) { + return undefined; + } + + return result.changes; + }); + }); + + constructor( + private readonly _editor: ICodeEditor, + private readonly _model: IObservable, + @IInstantiationService private readonly _instantiationService: IInstantiationService, + @IDiffProviderFactoryService private readonly _diffProviderFactoryService: IDiffProviderFactoryService, + @IModelService private readonly _modelService: IModelService, + ) { + super(); + + this._register(autorunWithStore((reader, store) => { + /** @description setup content widget */ + const model = this._model.read(reader); + if (!model) { + return; + } + if (this._position.get() === null) { + return; + } + const contentWidget = store.add(this._instantiationService.createInstance( + InlineEditSideBySideContentWidget, + this._editor, + this._position, + this._text.map(t => t.text), + this._text.map(t => t.shift), + this._diff + )); + _editor.addOverlayWidget(contentWidget); + store.add(toDisposable(() => _editor.removeOverlayWidget(contentWidget))); + })); + } +} + +class InlineEditSideBySideContentWidget extends Disposable implements IOverlayWidget { + private static _dropDownVisible = false; + public static get dropDownVisible() { return this._dropDownVisible; } + + private static id = 0; + + private readonly id = `InlineEditSideBySideContentWidget${InlineEditSideBySideContentWidget.id++}`; + public readonly allowEditorOverflow = false; + + private readonly _nodes = $('div.inlineEditSideBySide', undefined); + + private readonly _scrollChanged = observableSignalFromEvent('editor.onDidScrollChange', this._editor.onDidScrollChange); + + private readonly _previewEditor = this._register(this._instantiationService.createInstance( + EmbeddedCodeEditorWidget, + this._nodes, + { + glyphMargin: false, + lineNumbers: 'off', + minimap: { enabled: false }, + guides: { + indentation: false, + bracketPairs: false, + bracketPairsHorizontal: false, + highlightActiveIndentation: false, + }, + folding: false, + selectOnLineNumbers: false, + selectionHighlight: false, + columnSelection: false, + overviewRulerBorder: false, + overviewRulerLanes: 0, + lineDecorationsWidth: 0, + lineNumbersMinChars: 0, + scrollbar: { vertical: 'hidden', horizontal: 'hidden', alwaysConsumeMouseWheel: false, handleMouseWheel: false }, + readOnly: true, + wordWrap: 'off', + wordWrapOverride1: 'off', + wordWrapOverride2: 'off', + wrappingIndent: 'none', + wrappingStrategy: undefined, + }, + { contributions: [], isSimpleWidget: true }, + this._editor + )); + + private readonly _previewEditorObs = observableCodeEditor(this._previewEditor); + private readonly _editorObs = observableCodeEditor(this._editor); + + private readonly _previewTextModel = this._register(this._instantiationService.createInstance( + TextModel, + '', + this._editor.getModel()?.getLanguageId() ?? PLAINTEXT_LANGUAGE_ID, + TextModel.DEFAULT_CREATION_OPTIONS, + null + )); + + private readonly _setText = derived(reader => { + const edit = this._text.read(reader); + if (!edit) { return; } + this._previewTextModel.setValue(edit); + }).recomputeInitiallyAndOnChange(this._store); + + + private readonly _decorations = derived(this, (reader) => { + this._setText.read(reader); + const position = this._position.read(reader); + if (!position) { return { org: [], mod: [] }; } + const diff = this._diff.read(reader); + if (!diff) { return { org: [], mod: [] }; } + + const originalDecorations: IModelDeltaDecoration[] = []; + const modifiedDecorations: IModelDeltaDecoration[] = []; + + if (diff.length === 1 && diff[0].innerChanges![0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange())) { + return { org: [], mod: [] }; + } + const shift = this._shift.get(); + + const moveRange = (range: IRange) => { + return new Range(range.startLineNumber + position.top - 1, range.startColumn + shift, range.endLineNumber + position.top - 1, range.endColumn + shift); + }; + + for (const m of diff) { + if (!m.original.isEmpty) { + originalDecorations.push({ range: moveRange(m.original.toInclusiveRange()!), options: diffLineDeleteDecorationBackgroundWithIndicator }); + } + if (!m.modified.isEmpty) { + modifiedDecorations.push({ range: m.modified.toInclusiveRange()!, options: diffLineAddDecorationBackgroundWithIndicator }); + } + + if (m.modified.isEmpty || m.original.isEmpty) { + if (!m.original.isEmpty) { + originalDecorations.push({ range: moveRange(m.original.toInclusiveRange()!), options: diffWholeLineDeleteDecoration }); + } + if (!m.modified.isEmpty) { + modifiedDecorations.push({ range: m.modified.toInclusiveRange()!, options: diffWholeLineAddDecoration }); + } + } else { + for (const i of m.innerChanges || []) { + // Don't show empty markers outside the line range + if (m.original.contains(i.originalRange.startLineNumber)) { + originalDecorations.push({ range: moveRange(i.originalRange), options: i.originalRange.isEmpty() ? diffDeleteDecorationEmpty : diffDeleteDecoration }); + } + if (m.modified.contains(i.modifiedRange.startLineNumber)) { + modifiedDecorations.push({ range: i.modifiedRange, options: i.modifiedRange.isEmpty() ? diffAddDecorationEmpty : diffAddDecoration }); + } + } + } + } + + return { org: originalDecorations, mod: modifiedDecorations }; + }); + + private readonly _originalDecorations = derived(this, reader => { + return this._decorations.read(reader).org; + }); + + private readonly _modifiedDecorations = derived(this, reader => { + return this._decorations.read(reader).mod; + }); + + constructor( + private readonly _editor: ICodeEditor, + private readonly _position: IObservable, + private readonly _text: IObservable, + private readonly _shift: IObservable, + private readonly _diff: IObservable, + + @IInstantiationService private readonly _instantiationService: IInstantiationService, + ) { + super(); + + this._previewEditor.setModel(this._previewTextModel); + + this._register(this._editorObs.setDecorations(this._originalDecorations)); + this._register(this._previewEditorObs.setDecorations(this._modifiedDecorations)); + + this._register(autorun(reader => { + const width = this._previewEditorObs.contentWidth.read(reader); + const lines = this._text.read(reader).split('\n').length - 1; + const height = this._editor.getOption(EditorOption.lineHeight) * lines; + if (width <= 0) { + return; + } + this._previewEditor.layout({ height: height, width: width }); + })); + + this._register(autorun(reader => { + /** @description update position */ + this._position.read(reader); + this._editor.layoutOverlayWidget(this); + })); + + this._register(autorun(reader => { + /** @description scroll change */ + this._scrollChanged.read(reader); + const position = this._position.read(reader); + if (!position) { + return; + } + this._editor.layoutOverlayWidget(this); + })); + } + + getId(): string { return this.id; } + + getDomNode(): HTMLElement { + return this._nodes; + } + + getPosition(): IOverlayWidgetPosition | null { + const position = this._position.get(); + if (!position) { + return null; + } + const layoutInfo = this._editor.getLayoutInfo(); + const visibPos = this._editor.getScrolledVisiblePosition(new Position(position.top, 1)); + if (!visibPos) { + return null; + } + const top = visibPos.top - 1; //-1 to offset the border width + const offset = this._editor.getOffsetForColumn(position.left.lineNumber, position.left.column); + const left = layoutInfo.contentLeft + offset + 10; + return { + preference: { + left, + top, + } + }; + } +} diff --git a/src/vs/editor/contrib/inlineEdits/browser/commands.ts b/src/vs/editor/contrib/inlineEdits/browser/commands.ts index c5ce0e90296..36ebdbf1aa1 100644 --- a/src/vs/editor/contrib/inlineEdits/browser/commands.ts +++ b/src/vs/editor/contrib/inlineEdits/browser/commands.ts @@ -3,22 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Codicon } from 'vs/base/common/codicons'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { transaction } from 'vs/base/common/observable'; -import { asyncTransaction } from 'vs/base/common/observableInternal/base'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { inlineEditAcceptId, inlineEditVisible, showNextInlineEditActionId, showPreviousInlineEditActionId } from 'vs/editor/contrib/inlineEdits/browser/consts'; -import { InlineEditsController } from 'vs/editor/contrib/inlineEdits/browser/inlineEditsController'; -import * as nls from 'vs/nls'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; - - -function labelAndAlias(str: nls.ILocalizedString): { label: string, alias: string } { +import { Codicon } from '../../../../base/common/codicons.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { asyncTransaction, transaction } from '../../../../base/common/observable.js'; +import * as nls from '../../../../nls.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EmbeddedCodeEditorWidget } from '../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { inlineEditAcceptId, inlineEditVisible, showNextInlineEditActionId, showPreviousInlineEditActionId } from './consts.js'; +import { InlineEditsController } from './inlineEditsController.js'; + + +function labelAndAlias(str: nls.ILocalizedString): { label: string; alias: string } { return { label: str.value, alias: str.original, diff --git a/src/vs/editor/contrib/inlineEdits/browser/consts.ts b/src/vs/editor/contrib/inlineEdits/browser/consts.ts index 9ad19e98a76..5e608534d7d 100644 --- a/src/vs/editor/contrib/inlineEdits/browser/consts.ts +++ b/src/vs/editor/contrib/inlineEdits/browser/consts.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { localize } from '../../../../nls.js'; +import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; export const inlineEditAcceptId = 'editor.action.inlineEdits.accept'; diff --git a/src/vs/editor/contrib/inlineEdits/browser/inlineEdits.contribution.ts b/src/vs/editor/contrib/inlineEdits/browser/inlineEdits.contribution.ts index ae8b7182a89..624a4f661cf 100644 --- a/src/vs/editor/contrib/inlineEdits/browser/inlineEdits.contribution.ts +++ b/src/vs/editor/contrib/inlineEdits/browser/inlineEdits.contribution.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; +import { EditorContributionInstantiation, registerEditorAction, registerEditorContribution } from '../../../browser/editorExtensions.js'; import { TriggerInlineEditAction, ShowNextInlineEditAction, ShowPreviousInlineEditAction, AcceptInlineEdit, HideInlineEdit, -} from 'vs/editor/contrib/inlineEdits/browser/commands'; -import { InlineEditsController } from 'vs/editor/contrib/inlineEdits/browser/inlineEditsController'; +} from './commands.js'; +import { InlineEditsController } from './inlineEditsController.js'; registerEditorContribution(InlineEditsController.ID, InlineEditsController, EditorContributionInstantiation.Eventually); diff --git a/src/vs/editor/contrib/inlineEdits/browser/inlineEditsController.ts b/src/vs/editor/contrib/inlineEdits/browser/inlineEditsController.ts index 5d0afd8ca0e..893cb11d931 100644 --- a/src/vs/editor/contrib/inlineEdits/browser/inlineEditsController.ts +++ b/src/vs/editor/contrib/inlineEdits/browser/inlineEditsController.ts @@ -3,22 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { derived, derivedObservableWithCache, IReader, ISettableObservable, observableValue } from 'vs/base/common/observable'; -import { derivedDisposable, derivedWithSetter } from 'vs/base/common/observableInternal/derived'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { observableCodeEditor } from 'vs/editor/browser/observableCodeEditor'; -import { readHotReloadableExport } from 'vs/editor/browser/widget/diffEditor/utils'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { inlineEditVisible, isPinnedContextKey } from 'vs/editor/contrib/inlineEdits/browser/consts'; -import { InlineEditsModel } from 'vs/editor/contrib/inlineEdits/browser/inlineEditsModel'; -import { InlineEditsWidget } from 'vs/editor/contrib/inlineEdits/browser/inlineEditsWidget'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { bindContextKey, observableConfigValue } from 'vs/platform/observable/common/platformObservableUtils'; +import { readHotReloadableExport } from '../../../../base/common/hotReloadHelpers.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { derived, derivedDisposable, derivedObservableWithCache, derivedWithSetter, IReader, ISettableObservable, observableValue } from '../../../../base/common/observable.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { bindContextKey, observableConfigValue } from '../../../../platform/observable/common/platformObservableUtils.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { observableCodeEditor } from '../../../browser/observableCodeEditor.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { inlineEditVisible, isPinnedContextKey } from './consts.js'; +import { InlineEditsModel } from './inlineEditsModel.js'; +import { InlineEditsWidget } from './inlineEditsWidget.js'; export class InlineEditsController extends Disposable { static ID = 'editor.contrib.inlineEditsController'; diff --git a/src/vs/editor/contrib/inlineEdits/browser/inlineEditsModel.ts b/src/vs/editor/contrib/inlineEdits/browser/inlineEditsModel.ts index 812818c85b1..5b226750016 100644 --- a/src/vs/editor/contrib/inlineEdits/browser/inlineEditsModel.ts +++ b/src/vs/editor/contrib/inlineEdits/browser/inlineEditsModel.ts @@ -3,27 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { timeout } from 'vs/base/common/async'; -import { CancellationToken, cancelOnDispose } from 'vs/base/common/cancellation'; -import { itemsEquals, structuralEquals } from 'vs/base/common/equals'; -import { BugIndicatingError } from 'vs/base/common/errors'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { IObservable, ISettableObservable, ITransaction, ObservablePromise, derived, derivedHandleChanges, derivedOpts, disposableObservableValue, observableSignal, observableValue, recomputeInitiallyAndOnChange, subtransaction } from 'vs/base/common/observable'; -import { derivedDisposable } from 'vs/base/common/observableInternal/derived'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IDiffProviderFactoryService } from 'vs/editor/browser/widget/diffEditor/diffProviderFactoryService'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Command, InlineCompletionContext, InlineCompletionTriggerKind } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { IFeatureDebounceInformation } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { IModelService } from 'vs/editor/common/services/model'; -import { IModelContentChangedEvent } from 'vs/editor/common/textModelEvents'; -import { InlineCompletionItem, InlineCompletionProviderResult, provideInlineCompletions } from 'vs/editor/contrib/inlineCompletions/browser/provideInlineCompletions'; -import { InlineEdit } from 'vs/editor/contrib/inlineEdits/browser/inlineEditsWidget'; +import { timeout } from '../../../../base/common/async.js'; +import { CancellationToken, cancelOnDispose } from '../../../../base/common/cancellation.js'; +import { itemsEquals, structuralEquals } from '../../../../base/common/equals.js'; +import { BugIndicatingError } from '../../../../base/common/errors.js'; +import { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js'; +import { IObservable, ISettableObservable, ITransaction, ObservablePromise, derived, derivedDisposable, derivedHandleChanges, derivedOpts, disposableObservableValue, observableSignal, observableValue, recomputeInitiallyAndOnChange, subtransaction } from '../../../../base/common/observable.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { IDiffProviderFactoryService } from '../../../browser/widget/diffEditor/diffProviderFactoryService.js'; +import { LineRange } from '../../../common/core/lineRange.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { Command, InlineCompletionContext, InlineCompletionTriggerKind } from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { IFeatureDebounceInformation } from '../../../common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { IModelService } from '../../../common/services/model.js'; +import { IModelContentChangedEvent } from '../../../common/textModelEvents.js'; +import { InlineCompletionItem, InlineCompletionProviderResult, provideInlineCompletions } from '../../inlineCompletions/browser/model/provideInlineCompletions.js'; +import { InlineEdit } from './inlineEditsWidget.js'; export class InlineEditsModel extends Disposable { private static _modelId = 0; diff --git a/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.ts b/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.ts index 0a1498915d4..3da0aedd94a 100644 --- a/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.ts +++ b/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.ts @@ -3,30 +3,29 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { h, svgElem } from 'vs/base/browser/dom'; -import { DEFAULT_FONT_FAMILY } from 'vs/base/browser/fonts'; -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { autorun, constObservable, derived, IObservable, ISettableObservable } from 'vs/base/common/observable'; -import { derivedWithSetter } from 'vs/base/common/observableInternal/derived'; -import 'vs/css!./inlineEditsWidget'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorExtensionsRegistry } from 'vs/editor/browser/editorExtensions'; -import { observableCodeEditor } from 'vs/editor/browser/observableCodeEditor'; -import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget'; -import { diffAddDecoration, diffAddDecorationEmpty, diffDeleteDecoration, diffDeleteDecorationEmpty, diffLineAddDecorationBackgroundWithIndicator, diffLineDeleteDecorationBackgroundWithIndicator, diffWholeLineAddDecoration, diffWholeLineDeleteDecoration } from 'vs/editor/browser/widget/diffEditor/registrations.contribution'; -import { appendRemoveOnDispose, applyStyle } from 'vs/editor/browser/widget/diffEditor/utils'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { IModelDeltaDecoration } from 'vs/editor/common/model'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { ContextMenuController } from 'vs/editor/contrib/contextmenu/browser/contextmenu'; -import { PlaceholderTextContribution } from 'vs/editor/contrib/placeholderText/browser/placeholderText.contribution'; -import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController'; -import { MenuWorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { h, svgElem } from '../../../../base/browser/dom.js'; +import { DEFAULT_FONT_FAMILY } from '../../../../base/browser/fonts.js'; +import { Disposable, DisposableStore, IDisposable } from '../../../../base/common/lifecycle.js'; +import { autorun, constObservable, derived, derivedWithSetter, IObservable, ISettableObservable } from '../../../../base/common/observable.js'; +import { MenuWorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorExtensionsRegistry } from '../../../browser/editorExtensions.js'; +import { observableCodeEditor } from '../../../browser/observableCodeEditor.js'; +import { EmbeddedCodeEditorWidget } from '../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js'; +import { diffAddDecoration, diffAddDecorationEmpty, diffDeleteDecoration, diffDeleteDecorationEmpty, diffLineAddDecorationBackgroundWithIndicator, diffLineDeleteDecorationBackgroundWithIndicator, diffWholeLineAddDecoration, diffWholeLineDeleteDecoration } from '../../../browser/widget/diffEditor/registrations.contribution.js'; +import { appendRemoveOnDispose, applyStyle } from '../../../browser/widget/diffEditor/utils.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { LineRange } from '../../../common/core/lineRange.js'; +import { DetailedLineRangeMapping } from '../../../common/diff/rangeMapping.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../../../common/languages/modesRegistry.js'; +import { IModelDeltaDecoration } from '../../../common/model.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { ContextMenuController } from '../../contextmenu/browser/contextmenu.js'; +import { PlaceholderTextContribution } from '../../placeholderText/browser/placeholderTextContribution.js'; +import { SuggestController } from '../../suggest/browser/suggestController.js'; +import './inlineEditsWidget.css'; export class InlineEdit { constructor( diff --git a/src/vs/editor/contrib/inlineProgress/browser/inlineProgress.ts b/src/vs/editor/contrib/inlineProgress/browser/inlineProgress.ts index 25f273c1262..5b238c21476 100644 --- a/src/vs/editor/contrib/inlineProgress/browser/inlineProgress.ts +++ b/src/vs/editor/contrib/inlineProgress/browser/inlineProgress.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { disposableTimeout } from 'vs/base/common/async'; -import { Codicon } from 'vs/base/common/codicons'; -import { Disposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { noBreakWhitespace } from 'vs/base/common/strings'; -import { ThemeIcon } from 'vs/base/common/themables'; -import 'vs/css!./inlineProgressWidget'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IPosition } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorDecorationsCollection } from 'vs/editor/common/editorCommon'; -import { TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import * as dom from '../../../../base/browser/dom.js'; +import { disposableTimeout } from '../../../../base/common/async.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js'; +import { noBreakWhitespace } from '../../../../base/common/strings.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import './inlineProgressWidget.css'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IPosition } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorDecorationsCollection } from '../../../common/editorCommon.js'; +import { TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; const inlineProgressDecoration = ModelDecorationOptions.register({ description: 'inline-progress-widget', diff --git a/src/vs/editor/contrib/lineSelection/browser/lineSelection.ts b/src/vs/editor/contrib/lineSelection/browser/lineSelection.ts index f2b2a2df9b5..1ad614b8d74 100644 --- a/src/vs/editor/contrib/lineSelection/browser/lineSelection.ts +++ b/src/vs/editor/contrib/lineSelection/browser/lineSelection.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { CursorMoveCommands } from 'vs/editor/common/cursor/cursorMoveCommands'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import * as nls from 'vs/nls'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, registerEditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { CursorChangeReason } from '../../../common/cursorEvents.js'; +import { CursorMoveCommands } from '../../../common/cursor/cursorMoveCommands.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import * as nls from '../../../../nls.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; export class ExpandLineSelectionAction extends EditorAction { constructor() { diff --git a/src/vs/editor/contrib/lineSelection/test/browser/lineSelection.test.ts b/src/vs/editor/contrib/lineSelection/test/browser/lineSelection.test.ts index 17b47434db7..b5c075ca416 100644 --- a/src/vs/editor/contrib/lineSelection/test/browser/lineSelection.test.ts +++ b/src/vs/editor/contrib/lineSelection/test/browser/lineSelection.test.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import type { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction } from 'vs/editor/browser/editorExtensions'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ExpandLineSelectionAction } from 'vs/editor/contrib/lineSelection/browser/lineSelection'; -import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import type { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { EditorAction } from '../../../../browser/editorExtensions.js'; +import { Position } from '../../../../common/core/position.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { ExpandLineSelectionAction } from '../../browser/lineSelection.js'; +import { withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; function executeAction(action: EditorAction, editor: ICodeEditor): void { action.run(null!, editor, undefined); diff --git a/src/vs/editor/contrib/linesOperations/browser/copyLinesCommand.ts b/src/vs/editor/contrib/linesOperations/browser/copyLinesCommand.ts index 8f15843cfd1..ccc16cd5360 100644 --- a/src/vs/editor/contrib/linesOperations/browser/copyLinesCommand.ts +++ b/src/vs/editor/contrib/linesOperations/browser/copyLinesCommand.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Range } from 'vs/editor/common/core/range'; -import { Selection, SelectionDirection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; +import { Range } from '../../../common/core/range.js'; +import { Selection, SelectionDirection } from '../../../common/core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; export class CopyLinesCommand implements ICommand { diff --git a/src/vs/editor/contrib/linesOperations/browser/linesOperations.ts b/src/vs/editor/contrib/linesOperations/browser/linesOperations.ts index 60601d1fcdd..c9cff45b8f1 100644 --- a/src/vs/editor/contrib/linesOperations/browser/linesOperations.ts +++ b/src/vs/editor/contrib/linesOperations/browser/linesOperations.ts @@ -3,30 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { CoreEditingCommands } from 'vs/editor/browser/coreCommands'; -import { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, IActionOptions, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ReplaceCommand, ReplaceCommandThatPreservesSelection, ReplaceCommandThatSelectsText } from 'vs/editor/common/commands/replaceCommand'; -import { TrimTrailingWhitespaceCommand } from 'vs/editor/common/commands/trimTrailingWhitespaceCommand'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { TypeOperations } from 'vs/editor/common/cursor/cursorTypeOperations'; -import { EnterOperation } from 'vs/editor/common/cursor/cursorTypeEditOperations'; -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ITextModel } from 'vs/editor/common/model'; -import { CopyLinesCommand } from 'vs/editor/contrib/linesOperations/browser/copyLinesCommand'; -import { MoveLinesCommand } from 'vs/editor/contrib/linesOperations/browser/moveLinesCommand'; -import { SortLinesCommand } from 'vs/editor/contrib/linesOperations/browser/sortLinesCommand'; -import * as nls from 'vs/nls'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { CoreEditingCommands } from '../../../browser/coreCommands.js'; +import { IActiveCodeEditor, ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, IActionOptions, registerEditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { ReplaceCommand, ReplaceCommandThatPreservesSelection, ReplaceCommandThatSelectsText } from '../../../common/commands/replaceCommand.js'; +import { TrimTrailingWhitespaceCommand } from '../../../common/commands/trimTrailingWhitespaceCommand.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { TypeOperations } from '../../../common/cursor/cursorTypeOperations.js'; +import { EnterOperation } from '../../../common/cursor/cursorTypeEditOperations.js'; +import { EditOperation, ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICommand } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ITextModel } from '../../../common/model.js'; +import { CopyLinesCommand } from './copyLinesCommand.js'; +import { MoveLinesCommand } from './moveLinesCommand.js'; +import { SortLinesCommand } from './sortLinesCommand.js'; +import * as nls from '../../../../nls.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; // copy lines diff --git a/src/vs/editor/contrib/linesOperations/browser/moveLinesCommand.ts b/src/vs/editor/contrib/linesOperations/browser/moveLinesCommand.ts index 9a4f6800938..40fdd0378e1 100644 --- a/src/vs/editor/contrib/linesOperations/browser/moveLinesCommand.ts +++ b/src/vs/editor/contrib/linesOperations/browser/moveLinesCommand.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as strings from 'vs/base/common/strings'; -import { ShiftCommand } from 'vs/editor/common/commands/shiftCommand'; -import { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { CompleteEnterAction, IndentAction } from 'vs/editor/common/languages/languageConfiguration'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IndentConsts } from 'vs/editor/common/languages/supports/indentRules'; -import * as indentUtils from 'vs/editor/contrib/indentation/common/indentUtils'; -import { getGoodIndentForLine, getIndentMetadata, IIndentConverter, IVirtualModel } from 'vs/editor/common/languages/autoIndent'; -import { getEnterAction } from 'vs/editor/common/languages/enterAction'; +import * as strings from '../../../../base/common/strings.js'; +import { ShiftCommand } from '../../../common/commands/shiftCommand.js'; +import { EditorAutoIndentStrategy } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; +import { CompleteEnterAction, IndentAction } from '../../../common/languages/languageConfiguration.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { IndentConsts } from '../../../common/languages/supports/indentRules.js'; +import * as indentUtils from '../../indentation/common/indentUtils.js'; +import { getGoodIndentForLine, getIndentMetadata, IIndentConverter, IVirtualModel } from '../../../common/languages/autoIndent.js'; +import { getEnterAction } from '../../../common/languages/enterAction.js'; export class MoveLinesCommand implements ICommand { diff --git a/src/vs/editor/contrib/linesOperations/browser/sortLinesCommand.ts b/src/vs/editor/contrib/linesOperations/browser/sortLinesCommand.ts index 0680bd1f7ce..4c13058d104 100644 --- a/src/vs/editor/contrib/linesOperations/browser/sortLinesCommand.ts +++ b/src/vs/editor/contrib/linesOperations/browser/sortLinesCommand.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; +import { EditOperation, ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; export class SortLinesCommand implements ICommand { diff --git a/src/vs/editor/contrib/linesOperations/test/browser/copyLinesCommand.test.ts b/src/vs/editor/contrib/linesOperations/test/browser/copyLinesCommand.test.ts index 48348ae9690..763389a5ddf 100644 --- a/src/vs/editor/contrib/linesOperations/test/browser/copyLinesCommand.test.ts +++ b/src/vs/editor/contrib/linesOperations/test/browser/copyLinesCommand.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Selection } from 'vs/editor/common/core/selection'; -import { CopyLinesCommand } from 'vs/editor/contrib/linesOperations/browser/copyLinesCommand'; -import { DuplicateSelectionAction } from 'vs/editor/contrib/linesOperations/browser/linesOperations'; -import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { testCommand } from 'vs/editor/test/browser/testCommand'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { CopyLinesCommand } from '../../browser/copyLinesCommand.js'; +import { DuplicateSelectionAction } from '../../browser/linesOperations.js'; +import { withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { testCommand } from '../../../../test/browser/testCommand.js'; function testCopyLinesDownCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { testCommand(lines, null, selection, (accessor, sel) => new CopyLinesCommand(sel, true), expectedLines, expectedSelection); diff --git a/src/vs/editor/contrib/linesOperations/test/browser/linesOperations.test.ts b/src/vs/editor/contrib/linesOperations/test/browser/linesOperations.test.ts index f99fb62422d..199b22c12ba 100644 --- a/src/vs/editor/contrib/linesOperations/test/browser/linesOperations.test.ts +++ b/src/vs/editor/contrib/linesOperations/test/browser/linesOperations.test.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { CoreEditingCommands } from 'vs/editor/browser/coreCommands'; -import type { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction } from 'vs/editor/browser/editorExtensions'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Handler } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; -import { CamelCaseAction, PascalCaseAction, DeleteAllLeftAction, DeleteAllRightAction, DeleteDuplicateLinesAction, DeleteLinesAction, IndentLinesAction, InsertLineAfterAction, InsertLineBeforeAction, JoinLinesAction, KebabCaseAction, LowerCaseAction, SnakeCaseAction, SortLinesAscendingAction, SortLinesDescendingAction, TitleCaseAction, TransposeAction, UpperCaseAction } from 'vs/editor/contrib/linesOperations/browser/linesOperations'; -import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { CoreEditingCommands } from '../../../../browser/coreCommands.js'; +import type { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { EditorAction } from '../../../../browser/editorExtensions.js'; +import { Position } from '../../../../common/core/position.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { Handler } from '../../../../common/editorCommon.js'; +import { ITextModel } from '../../../../common/model.js'; +import { ViewModel } from '../../../../common/viewModel/viewModelImpl.js'; +import { CamelCaseAction, PascalCaseAction, DeleteAllLeftAction, DeleteAllRightAction, DeleteDuplicateLinesAction, DeleteLinesAction, IndentLinesAction, InsertLineAfterAction, InsertLineBeforeAction, JoinLinesAction, KebabCaseAction, LowerCaseAction, SnakeCaseAction, SortLinesAscendingAction, SortLinesDescendingAction, TitleCaseAction, TransposeAction, UpperCaseAction } from '../../browser/linesOperations.js'; +import { withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; function assertSelection(editor: ICodeEditor, expected: Selection | Selection[]): void { if (!Array.isArray(expected)) { diff --git a/src/vs/editor/contrib/linesOperations/test/browser/moveLinesCommand.test.ts b/src/vs/editor/contrib/linesOperations/test/browser/moveLinesCommand.test.ts index 65941bd977b..f83419cc70e 100644 --- a/src/vs/editor/contrib/linesOperations/test/browser/moveLinesCommand.test.ts +++ b/src/vs/editor/contrib/linesOperations/test/browser/moveLinesCommand.test.ts @@ -2,17 +2,17 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IndentationRule } from 'vs/editor/common/languages/languageConfiguration'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { LanguageService } from 'vs/editor/common/services/languageService'; -import { MoveLinesCommand } from 'vs/editor/contrib/linesOperations/browser/moveLinesCommand'; -import { testCommand } from 'vs/editor/test/browser/testCommand'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; +import { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { EditorAutoIndentStrategy } from '../../../../common/config/editorOptions.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { IndentationRule } from '../../../../common/languages/languageConfiguration.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { LanguageService } from '../../../../common/services/languageService.js'; +import { MoveLinesCommand } from '../../browser/moveLinesCommand.js'; +import { testCommand } from '../../../../test/browser/testCommand.js'; +import { TestLanguageConfigurationService } from '../../../../test/common/modes/testLanguageConfigurationService.js'; const enum MoveLinesDirection { Up, diff --git a/src/vs/editor/contrib/linesOperations/test/browser/sortLinesCommand.test.ts b/src/vs/editor/contrib/linesOperations/test/browser/sortLinesCommand.test.ts index 423001a7160..3e79cb3436e 100644 --- a/src/vs/editor/contrib/linesOperations/test/browser/sortLinesCommand.test.ts +++ b/src/vs/editor/contrib/linesOperations/test/browser/sortLinesCommand.test.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Selection } from 'vs/editor/common/core/selection'; -import { SortLinesCommand } from 'vs/editor/contrib/linesOperations/browser/sortLinesCommand'; -import { testCommand } from 'vs/editor/test/browser/testCommand'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { SortLinesCommand } from '../../browser/sortLinesCommand.js'; +import { testCommand } from '../../../../test/browser/testCommand.js'; function testSortLinesAscendingCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { testCommand(lines, null, selection, (accessor, sel) => new SortLinesCommand(sel, false), expectedLines, expectedSelection); diff --git a/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.ts b/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.ts index 491c00b67d4..62c8ab664b0 100644 --- a/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.ts +++ b/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.ts @@ -3,38 +3,38 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as arrays from 'vs/base/common/arrays'; -import { Delayer, first } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Color } from 'vs/base/common/color'; -import { isCancellationError, onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { Event } from 'vs/base/common/event'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import * as strings from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorCommand, EditorContributionInstantiation, registerEditorAction, registerEditorCommand, registerEditorContribution, registerModelAndPositionCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { IEditorContribution, IEditorDecorationsCollection } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { IModelDeltaDecoration, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { LinkedEditingRangeProvider, LinkedEditingRanges } from 'vs/editor/common/languages'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import * as nls from 'vs/nls'; -import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { registerColor } from 'vs/platform/theme/common/colorRegistry'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import 'vs/css!./linkedEditing'; +import * as arrays from '../../../../base/common/arrays.js'; +import { Delayer, first } from '../../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { Color } from '../../../../base/common/color.js'; +import { isCancellationError, onUnexpectedError, onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { Event } from '../../../../base/common/event.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import * as strings from '../../../../base/common/strings.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorCommand, EditorContributionInstantiation, registerEditorAction, registerEditorCommand, registerEditorContribution, registerModelAndPositionCommand, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { IModelDeltaDecoration, ITextModel, TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { LinkedEditingRangeProvider, LinkedEditingRanges } from '../../../common/languages.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import * as nls from '../../../../nls.js'; +import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { registerColor } from '../../../../platform/theme/common/colorRegistry.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import './linkedEditing.css'; export const CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE = new RawContextKey('LinkedEditingInputVisible', false); diff --git a/src/vs/editor/contrib/linkedEditing/test/browser/linkedEditing.test.ts b/src/vs/editor/contrib/linkedEditing/test/browser/linkedEditing.test.ts index 80d6ed93730..df4e2720674 100644 --- a/src/vs/editor/contrib/linkedEditing/test/browser/linkedEditing.test.ts +++ b/src/vs/editor/contrib/linkedEditing/test/browser/linkedEditing.test.ts @@ -4,24 +4,24 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { CoreEditingCommands } from 'vs/editor/browser/coreCommands'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/core/wordHelper'; -import { Handler } from 'vs/editor/common/editorCommon'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { DeleteAllLeftAction } from 'vs/editor/contrib/linesOperations/browser/linesOperations'; -import { LinkedEditingContribution } from 'vs/editor/contrib/linkedEditing/browser/linkedEditing'; -import { DeleteWordLeft } from 'vs/editor/contrib/wordOperations/browser/wordOperations'; -import { ITestCodeEditor, createCodeEditorServices, instantiateTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { instantiateTextModel } from 'vs/editor/test/common/testTextModel'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { runWithFakedTimers } from '../../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { CoreEditingCommands } from '../../../../browser/coreCommands.js'; +import { IPosition, Position } from '../../../../common/core/position.js'; +import { IRange, Range } from '../../../../common/core/range.js'; +import { USUAL_WORD_SEPARATORS } from '../../../../common/core/wordHelper.js'; +import { Handler } from '../../../../common/editorCommon.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { ITextModel } from '../../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { DeleteAllLeftAction } from '../../../linesOperations/browser/linesOperations.js'; +import { LinkedEditingContribution } from '../../browser/linkedEditing.js'; +import { DeleteWordLeft } from '../../../wordOperations/browser/wordOperations.js'; +import { ITestCodeEditor, createCodeEditorServices, instantiateTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { instantiateTextModel } from '../../../../test/common/testTextModel.js'; +import { TestInstantiationService } from '../../../../../platform/instantiation/test/common/instantiationServiceMock.js'; const mockFile = URI.parse('test:somefile.ttt'); const mockFileSelector = { scheme: 'test' }; diff --git a/src/vs/editor/contrib/links/browser/getLinks.ts b/src/vs/editor/contrib/links/browser/getLinks.ts index 5eabfc7586e..cd2e19c756e 100644 --- a/src/vs/editor/contrib/links/browser/getLinks.ts +++ b/src/vs/editor/contrib/links/browser/getLinks.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce } from 'vs/base/common/arrays'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { DisposableStore, isDisposable } from 'vs/base/common/lifecycle'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILink, ILinksList, LinkProvider } from 'vs/editor/common/languages'; -import { IModelService } from 'vs/editor/common/services/model'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; +import { coalesce } from '../../../../base/common/arrays.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { DisposableStore, isDisposable } from '../../../../base/common/lifecycle.js'; +import { assertType } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILink, ILinksList, LinkProvider } from '../../../common/languages.js'; +import { IModelService } from '../../../common/services/model.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; export class Link implements ILink { diff --git a/src/vs/editor/contrib/links/browser/links.ts b/src/vs/editor/contrib/links/browser/links.ts index 073c85c85ea..4fc3c17d938 100644 --- a/src/vs/editor/contrib/links/browser/links.ts +++ b/src/vs/editor/contrib/links/browser/links.ts @@ -3,33 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createCancelablePromise, CancelablePromise, RunOnceScheduler } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { MarkdownString } from 'vs/base/common/htmlContent'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import * as platform from 'vs/base/common/platform'; -import * as resources from 'vs/base/common/resources'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { URI } from 'vs/base/common/uri'; -import 'vs/css!./links'; -import { ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { LinkProvider } from 'vs/editor/common/languages'; -import { IModelDecorationsChangeAccessor, IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { ClickLinkGesture, ClickLinkKeyboardEvent, ClickLinkMouseEvent } from 'vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture'; -import { getLinks, Link, LinksList } from 'vs/editor/contrib/links/browser/getLinks'; -import * as nls from 'vs/nls'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { createCancelablePromise, CancelablePromise, RunOnceScheduler } from '../../../../base/common/async.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { MarkdownString } from '../../../../base/common/htmlContent.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { Schemas } from '../../../../base/common/network.js'; +import * as platform from '../../../../base/common/platform.js'; +import * as resources from '../../../../base/common/resources.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { URI } from '../../../../base/common/uri.js'; +import './links.css'; +import { ICodeEditor, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { LinkProvider } from '../../../common/languages.js'; +import { IModelDecorationsChangeAccessor, IModelDeltaDecoration, TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { ClickLinkGesture, ClickLinkKeyboardEvent, ClickLinkMouseEvent } from '../../gotoSymbol/browser/link/clickLinkGesture.js'; +import { getLinks, Link, LinksList } from './getLinks.js'; +import * as nls from '../../../../nls.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; export class LinkDetector extends Disposable implements IEditorContribution { diff --git a/src/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.ts b/src/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.ts index 6ac8f6f7d88..4869ad013cb 100644 --- a/src/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.ts +++ b/src/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; class LongLinesHelper extends Disposable implements IEditorContribution { public static readonly ID = 'editor.contrib.longLinesHelper'; diff --git a/src/vs/editor/contrib/message/browser/messageController.ts b/src/vs/editor/contrib/message/browser/messageController.ts index dd32227654c..8e4d1e2e9c3 100644 --- a/src/vs/editor/contrib/message/browser/messageController.ts +++ b/src/vs/editor/contrib/message/browser/messageController.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { renderMarkdown } from 'vs/base/browser/markdownRenderer'; -import { alert } from 'vs/base/browser/ui/aria/aria'; -import { Event } from 'vs/base/common/event'; -import { IMarkdownString, isMarkdownString } from 'vs/base/common/htmlContent'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import 'vs/css!./messageController'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EditorCommand, EditorContributionInstantiation, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { IPosition } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon'; -import { PositionAffinity } from 'vs/editor/common/model'; -import { openLinkFromMarkdown } from 'vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; -import * as nls from 'vs/nls'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import * as dom from 'vs/base/browser/dom'; +import { renderMarkdown } from '../../../../base/browser/markdownRenderer.js'; +import { alert } from '../../../../base/browser/ui/aria/aria.js'; +import { Event } from '../../../../base/common/event.js'; +import { IMarkdownString, isMarkdownString } from '../../../../base/common/htmlContent.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { DisposableStore, IDisposable, MutableDisposable } from '../../../../base/common/lifecycle.js'; +import './messageController.css'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js'; +import { EditorCommand, EditorContributionInstantiation, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { IPosition } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution, ScrollType } from '../../../common/editorCommon.js'; +import { PositionAffinity } from '../../../common/model.js'; +import { openLinkFromMarkdown } from '../../../browser/widget/markdownRenderer/browser/markdownRenderer.js'; +import * as nls from '../../../../nls.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import * as dom from '../../../../base/browser/dom.js'; export class MessageController implements IEditorContribution { diff --git a/src/vs/editor/contrib/multicursor/browser/multicursor.ts b/src/vs/editor/contrib/multicursor/browser/multicursor.ts index 02e7a44e7f5..d9b7237f221 100644 --- a/src/vs/editor/contrib/multicursor/browser/multicursor.ts +++ b/src/vs/editor/contrib/multicursor/browser/multicursor.ts @@ -3,31 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { status } from 'vs/base/browser/ui/aria/aria'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { Constants } from 'vs/base/common/uint'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { CursorState } from 'vs/editor/common/cursorCommon'; -import { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { CursorMoveCommands } from 'vs/editor/common/cursor/cursorMoveCommands'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IEditorContribution, IEditorDecorationsCollection, ScrollType } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { FindMatch, ITextModel } from 'vs/editor/common/model'; -import { CommonFindController } from 'vs/editor/contrib/find/browser/findController'; -import { FindOptionOverride, INewFindReplaceState } from 'vs/editor/contrib/find/browser/findState'; -import * as nls from 'vs/nls'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { getSelectionHighlightDecorationOptions } from 'vs/editor/contrib/wordHighlighter/browser/highlightDecorations'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { status } from '../../../../base/browser/ui/aria/aria.js'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { Constants } from '../../../../base/common/uint.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { CursorState } from '../../../common/cursorCommon.js'; +import { CursorChangeReason, ICursorSelectionChangedEvent } from '../../../common/cursorEvents.js'; +import { CursorMoveCommands } from '../../../common/cursor/cursorMoveCommands.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IEditorContribution, IEditorDecorationsCollection, ScrollType } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { FindMatch, ITextModel } from '../../../common/model.js'; +import { CommonFindController } from '../../find/browser/findController.js'; +import { FindOptionOverride, INewFindReplaceState } from '../../find/browser/findState.js'; +import * as nls from '../../../../nls.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { getSelectionHighlightDecorationOptions } from '../../wordHighlighter/browser/highlightDecorations.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; function announceCursorChange(previousCursorState: CursorState[], cursorState: CursorState[]): void { const cursorDiff = cursorState.filter(cs => !previousCursorState.find(pcs => pcs.equals(cs))); diff --git a/src/vs/editor/contrib/multicursor/test/browser/multicursor.test.ts b/src/vs/editor/contrib/multicursor/test/browser/multicursor.test.ts index 008150e7c09..06b13749659 100644 --- a/src/vs/editor/contrib/multicursor/test/browser/multicursor.test.ts +++ b/src/vs/editor/contrib/multicursor/test/browser/multicursor.test.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Handler } from 'vs/editor/common/editorCommon'; -import { EndOfLineSequence } from 'vs/editor/common/model'; -import { CommonFindController } from 'vs/editor/contrib/find/browser/findController'; -import { AddSelectionToNextFindMatchAction, InsertCursorAbove, InsertCursorBelow, MultiCursorSelectionController, SelectHighlightsAction } from 'vs/editor/contrib/multicursor/browser/multicursor'; -import { ITestCodeEditor, withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IStorageService, InMemoryStorageService } from 'vs/platform/storage/common/storage'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { Handler } from '../../../../common/editorCommon.js'; +import { EndOfLineSequence } from '../../../../common/model.js'; +import { CommonFindController } from '../../../find/browser/findController.js'; +import { AddSelectionToNextFindMatchAction, InsertCursorAbove, InsertCursorBelow, MultiCursorSelectionController, SelectHighlightsAction } from '../../browser/multicursor.js'; +import { ITestCodeEditor, withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { IStorageService, InMemoryStorageService } from '../../../../../platform/storage/common/storage.js'; suite('Multicursor', () => { diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHints.css b/src/vs/editor/contrib/parameterHints/browser/parameterHints.css index 93758171dac..3efac6c122c 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHints.css +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHints.css @@ -69,6 +69,10 @@ border-bottom: 1px solid var(--vscode-editorHoverWidget-border); } +.monaco-editor .parameter-hints-widget .code { + font-family: var(--vscode-parameterHintsWidget-editorFontFamily), var(--vscode-parameterHintsWidget-editorFontFamilyDefault); +} + .monaco-editor .parameter-hints-widget .docs { padding: 0 10px 0 5px; white-space: pre-wrap; diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHints.ts b/src/vs/editor/contrib/parameterHints/browser/parameterHints.ts index dda7f97531a..afeaa40c903 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHints.ts +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHints.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Lazy } from 'vs/base/common/lazy'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorCommand, EditorContributionInstantiation, registerEditorAction, registerEditorCommand, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import * as languages from 'vs/editor/common/languages'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { ParameterHintsModel, TriggerContext } from 'vs/editor/contrib/parameterHints/browser/parameterHintsModel'; -import { Context } from 'vs/editor/contrib/parameterHints/browser/provideSignatureHelp'; -import * as nls from 'vs/nls'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ParameterHintsWidget } from './parameterHintsWidget'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { Lazy } from '../../../../base/common/lazy.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorCommand, EditorContributionInstantiation, registerEditorAction, registerEditorCommand, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import * as languages from '../../../common/languages.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { ParameterHintsModel, TriggerContext } from './parameterHintsModel.js'; +import { Context } from './provideSignatureHelp.js'; +import * as nls from '../../../../nls.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ParameterHintsWidget } from './parameterHintsWidget.js'; export class ParameterHintsController extends Disposable implements IEditorContribution { diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.ts b/src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.ts index 033e842d409..0c07303dc17 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.ts +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise, Delayer } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { CharacterSet } from 'vs/editor/common/core/characterClassifier'; -import { ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import * as languages from 'vs/editor/common/languages'; -import { provideSignatureHelp } from 'vs/editor/contrib/parameterHints/browser/provideSignatureHelp'; +import { CancelablePromise, createCancelablePromise, Delayer } from '../../../../base/common/async.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { CharacterSet } from '../../../common/core/characterClassifier.js'; +import { ICursorSelectionChangedEvent } from '../../../common/cursorEvents.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import * as languages from '../../../common/languages.js'; +import { provideSignatureHelp } from './provideSignatureHelp.js'; export interface TriggerContext { readonly triggerKind: languages.SignatureHelpTriggerKind; diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts index f5b8af528e3..b2f044f2f5c 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts @@ -3,31 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import * as aria from 'vs/base/browser/ui/aria/aria'; -import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; -import { Codicon } from 'vs/base/common/codicons'; -import { Event } from 'vs/base/common/event'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import { assertIsDefined } from 'vs/base/common/types'; -import 'vs/css!./parameterHints'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import * as languages from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IMarkdownRenderResult, MarkdownRenderer } from 'vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; -import { ParameterHintsModel } from 'vs/editor/contrib/parameterHints/browser/parameterHintsModel'; -import { Context } from 'vs/editor/contrib/parameterHints/browser/provideSignatureHelp'; -import * as nls from 'vs/nls'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { listHighlightForeground, registerColor } from 'vs/platform/theme/common/colorRegistry'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import * as dom from '../../../../base/browser/dom.js'; +import * as aria from '../../../../base/browser/ui/aria/aria.js'; +import { DomScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { Event } from '../../../../base/common/event.js'; +import { IMarkdownString } from '../../../../base/common/htmlContent.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { escapeRegExpCharacters } from '../../../../base/common/strings.js'; +import { assertIsDefined } from '../../../../base/common/types.js'; +import './parameterHints.css'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js'; +import { EDITOR_FONT_DEFAULTS, EditorOption } from '../../../common/config/editorOptions.js'; +import * as languages from '../../../common/languages.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { IMarkdownRenderResult, MarkdownRenderer } from '../../../browser/widget/markdownRenderer/browser/markdownRenderer.js'; +import { ParameterHintsModel } from './parameterHintsModel.js'; +import { Context } from './provideSignatureHelp.js'; +import * as nls from '../../../../nls.js'; +import { IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import { listHighlightForeground, registerColor } from '../../../../platform/theme/common/colorRegistry.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; const $ = dom.$; @@ -126,9 +126,13 @@ export class ParameterHintsWidget extends Disposable implements IContentWidget { if (!this.domNodes) { return; } + const fontInfo = this.editor.getOption(EditorOption.fontInfo); - this.domNodes.element.style.fontSize = `${fontInfo.fontSize}px`; - this.domNodes.element.style.lineHeight = `${fontInfo.lineHeight / fontInfo.fontSize}`; + const element = this.domNodes.element; + element.style.fontSize = `${fontInfo.fontSize}px`; + element.style.lineHeight = `${fontInfo.lineHeight / fontInfo.fontSize}`; + element.style.setProperty('--vscode-parameterHintsWidget-editorFontFamily', fontInfo.fontFamily); + element.style.setProperty('--vscode-parameterHintsWidget-editorFontFamilyDefault', EDITOR_FONT_DEFAULTS.fontFamily); }; updateFont(); @@ -203,10 +207,6 @@ export class ParameterHintsWidget extends Disposable implements IContentWidget { } const code = dom.append(this.domNodes.signature, $('.code')); - const fontInfo = this.editor.getOption(EditorOption.fontInfo); - code.style.fontSize = `${fontInfo.fontSize}px`; - code.style.fontFamily = fontInfo.fontFamily; - const hasParameters = signature.parameters.length > 0; const activeParameterIndex = signature.activeParameter ?? hints.activeParameter; @@ -387,4 +387,4 @@ export class ParameterHintsWidget extends Disposable implements IContentWidget { } } -registerColor('editorHoverWidget.highlightForeground', { dark: listHighlightForeground, light: listHighlightForeground, hcDark: listHighlightForeground, hcLight: listHighlightForeground }, nls.localize('editorHoverWidgetHighlightForeground', 'Foreground color of the active item in the parameter hint.')); +registerColor('editorHoverWidget.highlightForeground', listHighlightForeground, nls.localize('editorHoverWidgetHighlightForeground', 'Foreground color of the active item in the parameter hint.')); diff --git a/src/vs/editor/contrib/parameterHints/browser/provideSignatureHelp.ts b/src/vs/editor/contrib/parameterHints/browser/provideSignatureHelp.ts index 8f4341b481f..b35d6e0e217 100644 --- a/src/vs/editor/contrib/parameterHints/browser/provideSignatureHelp.ts +++ b/src/vs/editor/contrib/parameterHints/browser/provideSignatureHelp.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import * as languages from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { assertType } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import * as languages from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { ITextModelService } from '../../../common/services/resolverService.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; export const Context = { Visible: new RawContextKey('parameterHintsVisible', false), diff --git a/src/vs/editor/contrib/parameterHints/test/browser/parameterHintsModel.test.ts b/src/vs/editor/contrib/parameterHints/test/browser/parameterHintsModel.test.ts index 10372b408c4..a0138cb395a 100644 --- a/src/vs/editor/contrib/parameterHints/test/browser/parameterHintsModel.test.ts +++ b/src/vs/editor/contrib/parameterHints/test/browser/parameterHintsModel.test.ts @@ -4,24 +4,24 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { promiseWithResolvers } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { Handler } from 'vs/editor/common/editorCommon'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import * as languages from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { ParameterHintsModel } from 'vs/editor/contrib/parameterHints/browser/parameterHintsModel'; -import { createTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { InMemoryStorageService, IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; +import { promiseWithResolvers } from '../../../../../base/common/async.js'; +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { runWithFakedTimers } from '../../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Position } from '../../../../common/core/position.js'; +import { Handler } from '../../../../common/editorCommon.js'; +import { LanguageFeatureRegistry } from '../../../../common/languageFeatureRegistry.js'; +import * as languages from '../../../../common/languages.js'; +import { ITextModel } from '../../../../common/model.js'; +import { ParameterHintsModel } from '../../browser/parameterHintsModel.js'; +import { createTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { InMemoryStorageService, IStorageService } from '../../../../../platform/storage/common/storage.js'; +import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js'; +import { NullTelemetryService } from '../../../../../platform/telemetry/common/telemetryUtils.js'; const mockFile = URI.parse('test:somefile.ttt'); const mockFileSelector = { scheme: 'test' }; diff --git a/src/vs/editor/contrib/peekView/browser/peekView.ts b/src/vs/editor/contrib/peekView/browser/peekView.ts index a0f2dfd914e..17084e7ae64 100644 --- a/src/vs/editor/contrib/peekView/browser/peekView.ts +++ b/src/vs/editor/contrib/peekView/browser/peekView.ts @@ -3,30 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { IMouseEvent } from 'vs/base/browser/mouseEvent'; -import { ActionBar, ActionsOrientation, IActionBarOptions } from 'vs/base/browser/ui/actionbar/actionbar'; -import { Action } from 'vs/base/common/actions'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { Color } from 'vs/base/common/color'; -import { Emitter } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import * as objects from 'vs/base/common/objects'; -import 'vs/css!./media/peekViewWidget'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { IOptions, IStyles, ZoneWidget } from 'vs/editor/contrib/zoneWidget/browser/zoneWidget'; -import * as nls from 'vs/nls'; -import { createActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator, IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { activeContrastBorder, contrastBorder, editorForeground, editorInfoForeground, registerColor } from 'vs/platform/theme/common/colorRegistry'; +import * as dom from '../../../../base/browser/dom.js'; +import { IMouseEvent } from '../../../../base/browser/mouseEvent.js'; +import { ActionBar, ActionsOrientation, IActionBarOptions } from '../../../../base/browser/ui/actionbar/actionbar.js'; +import { Action } from '../../../../base/common/actions.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { Color } from '../../../../base/common/color.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import * as objects from '../../../../base/common/objects.js'; +import './media/peekViewWidget.css'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { EmbeddedCodeEditorWidget } from '../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { IOptions, IStyles, ZoneWidget } from '../../zoneWidget/browser/zoneWidget.js'; +import * as nls from '../../../../nls.js'; +import { createActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { createDecorator, IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { activeContrastBorder, contrastBorder, editorForeground, editorInfoForeground, registerColor } from '../../../../platform/theme/common/colorRegistry.js'; export const IPeekViewService = createDecorator('IPeekViewService'); export interface IPeekViewService { @@ -289,8 +289,8 @@ export const peekViewResultsFileForeground = registerColor('peekViewResult.fileF export const peekViewResultsSelectionBackground = registerColor('peekViewResult.selectionBackground', { dark: '#3399ff33', light: '#3399ff33', hcDark: null, hcLight: null }, nls.localize('peekViewResultsSelectionBackground', 'Background color of the selected entry in the peek view result list.')); export const peekViewResultsSelectionForeground = registerColor('peekViewResult.selectionForeground', { dark: Color.white, light: '#6C6C6C', hcDark: Color.white, hcLight: editorForeground }, nls.localize('peekViewResultsSelectionForeground', 'Foreground color of the selected entry in the peek view result list.')); export const peekViewEditorBackground = registerColor('peekViewEditor.background', { dark: '#001F33', light: '#F2F8FC', hcDark: Color.black, hcLight: Color.white }, nls.localize('peekViewEditorBackground', 'Background color of the peek view editor.')); -export const peekViewEditorGutterBackground = registerColor('peekViewEditorGutter.background', { dark: peekViewEditorBackground, light: peekViewEditorBackground, hcDark: peekViewEditorBackground, hcLight: peekViewEditorBackground }, nls.localize('peekViewEditorGutterBackground', 'Background color of the gutter in the peek view editor.')); -export const peekViewEditorStickyScrollBackground = registerColor('peekViewEditorStickyScroll.background', { dark: peekViewEditorBackground, light: peekViewEditorBackground, hcDark: peekViewEditorBackground, hcLight: peekViewEditorBackground }, nls.localize('peekViewEditorStickScrollBackground', 'Background color of sticky scroll in the peek view editor.')); +export const peekViewEditorGutterBackground = registerColor('peekViewEditorGutter.background', peekViewEditorBackground, nls.localize('peekViewEditorGutterBackground', 'Background color of the gutter in the peek view editor.')); +export const peekViewEditorStickyScrollBackground = registerColor('peekViewEditorStickyScroll.background', peekViewEditorBackground, nls.localize('peekViewEditorStickScrollBackground', 'Background color of sticky scroll in the peek view editor.')); export const peekViewResultsMatchHighlight = registerColor('peekViewResult.matchHighlightBackground', { dark: '#ea5c004d', light: '#ea5c004d', hcDark: null, hcLight: null }, nls.localize('peekViewResultsMatchHighlight', 'Match highlight color in the peek view result list.')); export const peekViewEditorMatchHighlight = registerColor('peekViewEditor.matchHighlightBackground', { dark: '#ff8f0099', light: '#f5d802de', hcDark: null, hcLight: null }, nls.localize('peekViewEditorMatchHighlight', 'Match highlight color in the peek view editor.')); diff --git a/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.ts b/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.ts index 33c069c4485..8cb84d9463c 100644 --- a/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.ts +++ b/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.ts @@ -3,69 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { structuralEquals } from 'vs/base/common/equals'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { derived, derivedOpts } from 'vs/base/common/observable'; -import 'vs/css!./placeholderText'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { observableCodeEditor } from 'vs/editor/browser/observableCodeEditor'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ghostTextForeground } from 'vs/editor/common/core/editorColorRegistry'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { IModelDeltaDecoration, InjectedTextCursorStops } from 'vs/editor/common/model'; -import { localize } from 'vs/nls'; -import { registerColor } from 'vs/platform/theme/common/colorUtils'; +import './placeholderText.css'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { ghostTextForeground } from '../../../common/core/editorColorRegistry.js'; +import { localize } from '../../../../nls.js'; +import { registerColor } from '../../../../platform/theme/common/colorUtils.js'; +import { PlaceholderTextContribution } from './placeholderTextContribution.js'; +import { wrapInReloadableClass1 } from '../../../../platform/observable/common/wrapInReloadableClass.js'; -/** - * Use the editor option to set the placeholder text. -*/ -export class PlaceholderTextContribution extends Disposable implements IEditorContribution { - public static get(editor: ICodeEditor): PlaceholderTextContribution { - return editor.getContribution(PlaceholderTextContribution.ID)!; - } +registerEditorContribution(PlaceholderTextContribution.ID, wrapInReloadableClass1(() => PlaceholderTextContribution), EditorContributionInstantiation.Eager); - public static readonly ID = 'editor.contrib.placeholderText'; - private readonly _editorObs = observableCodeEditor(this._editor); - - private readonly _placeholderText = this._editorObs.getOption(EditorOption.placeholder); - - private readonly _decorationOptions = derivedOpts<{ placeholder: string } | undefined>({ owner: this, equalsFn: structuralEquals }, reader => { - const p = this._placeholderText.read(reader); - if (!p) { return undefined; } - if (!this._editorObs.valueIsEmpty.read(reader)) { return undefined; } - - return { placeholder: p }; - }); - - private readonly _decorations = derived(this, (reader) => { - const options = this._decorationOptions.read(reader); - if (!options) { return []; } - - return [{ - range: new Range(1, 1, 1, 1), - options: { - description: 'placeholder', - showIfCollapsed: true, - after: { - content: options.placeholder, - cursorStops: InjectedTextCursorStops.None, - inlineClassName: 'placeholder-text' - } - } - }]; - }); - - constructor( - private readonly _editor: ICodeEditor, - ) { - super(); - - this._register(this._editorObs.setDecorations(this._decorations)); - } -} - -registerEditorContribution(PlaceholderTextContribution.ID, PlaceholderTextContribution, EditorContributionInstantiation.Eager); - -registerColor('editor.placeholder.foreground', { dark: ghostTextForeground, light: ghostTextForeground, hcDark: ghostTextForeground, hcLight: ghostTextForeground }, localize('placeholderForeground', 'Foreground color of the placeholder text in the editor.')); +registerColor('editor.placeholder.foreground', ghostTextForeground, localize('placeholderForeground', 'Foreground color of the placeholder text in the editor.')); diff --git a/src/vs/editor/contrib/placeholderText/browser/placeholderText.css b/src/vs/editor/contrib/placeholderText/browser/placeholderText.css index 3912e17fc2f..043b6f15632 100644 --- a/src/vs/editor/contrib/placeholderText/browser/placeholderText.css +++ b/src/vs/editor/contrib/placeholderText/browser/placeholderText.css @@ -5,8 +5,15 @@ .monaco-editor { --vscode-editor-placeholder-foreground: var(--vscode-editorGhostText-foreground); -} -.monaco-editor .placeholder-text { - color: var(--vscode-editor-placeholder-foreground); + .editorPlaceholder { + top: 0px; + position: absolute; + overflow: hidden; + text-overflow: ellipsis; + text-wrap: nowrap; + pointer-events: none; + + color: var(--vscode-editor-placeholder-foreground); + } } diff --git a/src/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.ts b/src/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.ts new file mode 100644 index 00000000000..b06224c3e9d --- /dev/null +++ b/src/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.ts @@ -0,0 +1,80 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { h } from '../../../../base/browser/dom.js'; +import { structuralEquals } from '../../../../base/common/equals.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { autorun, constObservable, DebugOwner, derivedObservableWithCache, derivedOpts, derivedWithStore, IObservable, IReader } from '../../../../base/common/observable.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { observableCodeEditor } from '../../../browser/observableCodeEditor.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; + +/** + * Use the editor option to set the placeholder text. +*/ +export class PlaceholderTextContribution extends Disposable implements IEditorContribution { + public static get(editor: ICodeEditor): PlaceholderTextContribution { + return editor.getContribution(PlaceholderTextContribution.ID)!; + } + + public static readonly ID = 'editor.contrib.placeholderText'; + private readonly _editorObs = observableCodeEditor(this._editor); + + private readonly _placeholderText = this._editorObs.getOption(EditorOption.placeholder); + + private readonly _state = derivedOpts<{ placeholder: string } | undefined>({ owner: this, equalsFn: structuralEquals }, reader => { + const p = this._placeholderText.read(reader); + if (!p) { return undefined; } + if (!this._editorObs.valueIsEmpty.read(reader)) { return undefined; } + return { placeholder: p }; + }); + + private readonly _shouldViewBeAlive = isOrWasTrue(this, reader => this._state.read(reader)?.placeholder !== undefined); + + private readonly _view = derivedWithStore((reader, store) => { + if (!this._shouldViewBeAlive.read(reader)) { return; } + + const element = h('div.editorPlaceholder'); + + store.add(autorun(reader => { + const data = this._state.read(reader); + const shouldBeVisibile = data?.placeholder !== undefined; + element.root.style.display = shouldBeVisibile ? 'block' : 'none'; + element.root.innerText = data?.placeholder ?? ''; + })); + store.add(autorun(reader => { + const info = this._editorObs.layoutInfo.read(reader); + element.root.style.left = `${info.contentLeft}px`; + element.root.style.width = (info.contentWidth - info.verticalScrollbarWidth) + 'px'; + element.root.style.top = `${this._editor.getTopForLineNumber(0)}px`; + })); + store.add(autorun(reader => { + element.root.style.fontFamily = this._editorObs.getOption(EditorOption.fontFamily).read(reader); + element.root.style.fontSize = this._editorObs.getOption(EditorOption.fontSize).read(reader) + 'px'; + element.root.style.lineHeight = this._editorObs.getOption(EditorOption.lineHeight).read(reader) + 'px'; + })); + store.add(this._editorObs.createOverlayWidget({ + allowEditorOverflow: false, + minContentWidthInPx: constObservable(0), + position: constObservable(null), + domNode: element.root, + })); + }); + + constructor( + private readonly _editor: ICodeEditor, + ) { + super(); + this._view.recomputeInitiallyAndOnChange(this._store); + } +} + +function isOrWasTrue(owner: DebugOwner, fn: (reader: IReader) => boolean): IObservable { + return derivedObservableWithCache(owner, (reader, lastValue) => { + if (lastValue === true) { return true; } + return fn(reader); + }); +} diff --git a/src/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.ts b/src/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.ts index 9334d7fcde1..b1fa0b3f77b 100644 --- a/src/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.ts +++ b/src/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { stripIcons } from 'vs/base/common/iconLabels'; -import { IEditor } from 'vs/editor/common/editorCommon'; -import { ILocalizedString } from 'vs/nls'; -import { isLocalizedString } from 'vs/platform/action/common/action'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { AbstractCommandsQuickAccessProvider, ICommandQuickPick, ICommandsQuickAccessOptions } from 'vs/platform/quickinput/browser/commandsQuickAccess'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { stripIcons } from '../../../../base/common/iconLabels.js'; +import { IEditor } from '../../../common/editorCommon.js'; +import { ILocalizedString } from '../../../../nls.js'; +import { isLocalizedString } from '../../../../platform/action/common/action.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { AbstractCommandsQuickAccessProvider, ICommandQuickPick, ICommandsQuickAccessOptions } from '../../../../platform/quickinput/browser/commandsQuickAccess.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; export abstract class AbstractEditorCommandsQuickAccessProvider extends AbstractCommandsQuickAccessProvider { diff --git a/src/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.ts b/src/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.ts index 05c099c63c4..749259c2711 100644 --- a/src/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.ts +++ b/src/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { createSingleCallFunction } from 'vs/base/common/functional'; -import { DisposableStore, IDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { getCodeEditor, isDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { IRange } from 'vs/editor/common/core/range'; -import { IDiffEditor, IEditor, ScrollType } from 'vs/editor/common/editorCommon'; -import { IModelDeltaDecoration, ITextModel, OverviewRulerLane } from 'vs/editor/common/model'; -import { overviewRulerRangeHighlight } from 'vs/editor/common/core/editorColorRegistry'; -import { IQuickAccessProvider, IQuickAccessProviderRunOptions } from 'vs/platform/quickinput/common/quickAccess'; -import { IKeyMods, IQuickPick, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { themeColorFromId } from 'vs/platform/theme/common/themeService'; -import { status } from 'vs/base/browser/ui/aria/aria'; -import { TextEditorSelectionSource } from 'vs/platform/editor/common/editor'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Event } from '../../../../base/common/event.js'; +import { createSingleCallFunction } from '../../../../base/common/functional.js'; +import { DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { getCodeEditor, isDiffEditor } from '../../../browser/editorBrowser.js'; +import { IRange } from '../../../common/core/range.js'; +import { IDiffEditor, IEditor, ScrollType } from '../../../common/editorCommon.js'; +import { IModelDeltaDecoration, ITextModel, OverviewRulerLane } from '../../../common/model.js'; +import { overviewRulerRangeHighlight } from '../../../common/core/editorColorRegistry.js'; +import { IQuickAccessProvider, IQuickAccessProviderRunOptions } from '../../../../platform/quickinput/common/quickAccess.js'; +import { IKeyMods, IQuickPick, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js'; +import { themeColorFromId } from '../../../../platform/theme/common/themeService.js'; +import { status } from '../../../../base/browser/ui/aria/aria.js'; +import { TextEditorSelectionSource } from '../../../../platform/editor/common/editor.js'; interface IEditorLineDecoration { readonly rangeHighlightId: string; @@ -52,7 +52,7 @@ export abstract class AbstractEditorNavigationQuickAccessProvider implements IQu //#region Provider methods - provide(picker: IQuickPick, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable { + provide(picker: IQuickPick, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable { const disposables = new DisposableStore(); // Apply options if any @@ -78,7 +78,7 @@ export abstract class AbstractEditorNavigationQuickAccessProvider implements IQu return disposables; } - private doProvide(picker: IQuickPick, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable { + private doProvide(picker: IQuickPick, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable { const disposables = new DisposableStore(); // With text control @@ -134,12 +134,12 @@ export abstract class AbstractEditorNavigationQuickAccessProvider implements IQu /** * Subclasses to implement to provide picks for the picker when an editor is active. */ - protected abstract provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable; + protected abstract provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable; /** * Subclasses to implement to provide picks for the picker when no editor is active. */ - protected abstract provideWithoutTextEditor(picker: IQuickPick, token: CancellationToken): IDisposable; + protected abstract provideWithoutTextEditor(picker: IQuickPick, token: CancellationToken): IDisposable; protected gotoLocation({ editor }: IQuickAccessTextEditorContext, options: { range: IRange; keyMods: IKeyMods; forceSideBySide?: boolean; preserveFocus?: boolean }): void { editor.setSelection(options.range, TextEditorSelectionSource.JUMP); diff --git a/src/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.ts b/src/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.ts index 6db58ae6cc0..4d720513f9f 100644 --- a/src/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.ts +++ b/src/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { getCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption, RenderLineNumbersType } from 'vs/editor/common/config/editorOptions'; -import { IPosition } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { IEditor, ScrollType } from 'vs/editor/common/editorCommon'; -import { AbstractEditorNavigationQuickAccessProvider, IQuickAccessTextEditorContext } from 'vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess'; -import { localize } from 'vs/nls'; -import { IQuickPick, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { getCodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption, RenderLineNumbersType } from '../../../common/config/editorOptions.js'; +import { IPosition } from '../../../common/core/position.js'; +import { IRange } from '../../../common/core/range.js'; +import { IEditor, ScrollType } from '../../../common/editorCommon.js'; +import { AbstractEditorNavigationQuickAccessProvider, IQuickAccessTextEditorContext } from './editorNavigationQuickAccess.js'; +import { localize } from '../../../../nls.js'; +import { IQuickPick, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js'; interface IGotoLineQuickPickItem extends IQuickPickItem, Partial { } @@ -24,7 +24,7 @@ export abstract class AbstractGotoLineQuickAccessProvider extends AbstractEditor super({ canAcceptInBackground: true }); } - protected provideWithoutTextEditor(picker: IQuickPick): IDisposable { + protected provideWithoutTextEditor(picker: IQuickPick): IDisposable { const label = localize('cannotRunGotoLine', "Open a text editor first to go to a line."); picker.items = [{ label }]; @@ -33,7 +33,7 @@ export abstract class AbstractGotoLineQuickAccessProvider extends AbstractEditor return Disposable.None; } - protected provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick, token: CancellationToken): IDisposable { + protected provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick, token: CancellationToken): IDisposable { const editor = context.editor; const disposables = new DisposableStore(); diff --git a/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.ts b/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.ts index 46aeeda1706..4472fd93156 100644 --- a/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.ts +++ b/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DeferredPromise } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IMatch } from 'vs/base/common/filters'; -import { IPreparedQuery, pieceToQuery, prepareQuery, scoreFuzzy2 } from 'vs/base/common/fuzzyScorer'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { format, trim } from 'vs/base/common/strings'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { DocumentSymbol, SymbolKind, SymbolKinds, SymbolTag, getAriaLabelForSymbol } from 'vs/editor/common/languages'; -import { IOutlineModelService } from 'vs/editor/contrib/documentSymbols/browser/outlineModel'; -import { AbstractEditorNavigationQuickAccessProvider, IEditorNavigationQuickAccessOptions, IQuickAccessTextEditorContext } from 'vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess'; -import { localize } from 'vs/nls'; -import { IQuickInputButton, IQuickPick, IQuickPickItem, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { Position } from 'vs/editor/common/core/position'; -import { findLast } from 'vs/base/common/arraysFind'; -import { IQuickAccessProviderRunOptions } from 'vs/platform/quickinput/common/quickAccess'; -import { URI } from 'vs/base/common/uri'; +import { DeferredPromise } from '../../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { IMatch } from '../../../../base/common/filters.js'; +import { IPreparedQuery, pieceToQuery, prepareQuery, scoreFuzzy2 } from '../../../../base/common/fuzzyScorer.js'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { format, trim } from '../../../../base/common/strings.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { ScrollType } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; +import { DocumentSymbol, SymbolKind, SymbolKinds, SymbolTag, getAriaLabelForSymbol } from '../../../common/languages.js'; +import { IOutlineModelService } from '../../documentSymbols/browser/outlineModel.js'; +import { AbstractEditorNavigationQuickAccessProvider, IEditorNavigationQuickAccessOptions, IQuickAccessTextEditorContext } from './editorNavigationQuickAccess.js'; +import { localize } from '../../../../nls.js'; +import { IQuickInputButton, IQuickPick, IQuickPickItem, IQuickPickSeparator } from '../../../../platform/quickinput/common/quickInput.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { Position } from '../../../common/core/position.js'; +import { findLast } from '../../../../base/common/arraysFind.js'; +import { IQuickAccessProviderRunOptions } from '../../../../platform/quickinput/common/quickAccess.js'; +import { URI } from '../../../../base/common/uri.js'; export interface IGotoSymbolQuickPickItem extends IQuickPickItem { kind: SymbolKind; @@ -48,7 +48,7 @@ export abstract class AbstractGotoSymbolQuickAccessProvider extends AbstractEdit static PREFIX = '@'; static SCOPE_PREFIX = ':'; - static PREFIX_BY_CATEGORY = `${AbstractGotoSymbolQuickAccessProvider.PREFIX}${AbstractGotoSymbolQuickAccessProvider.SCOPE_PREFIX}`; + static PREFIX_BY_CATEGORY = `${this.PREFIX}${this.SCOPE_PREFIX}`; protected override readonly options: IGotoSymbolQuickAccessProviderOptions; @@ -63,13 +63,13 @@ export abstract class AbstractGotoSymbolQuickAccessProvider extends AbstractEdit this.options.canAcceptInBackground = true; } - protected provideWithoutTextEditor(picker: IQuickPick): IDisposable { + protected provideWithoutTextEditor(picker: IQuickPick): IDisposable { this.provideLabelPick(picker, localize('cannotRunGotoSymbolWithoutEditor', "To go to a symbol, first open a text editor with symbol information.")); return Disposable.None; } - protected provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable { + protected provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable { const editor = context.editor; const model = this.getModel(editor); if (!model) { @@ -87,7 +87,7 @@ export abstract class AbstractGotoSymbolQuickAccessProvider extends AbstractEdit return this.doProvideWithoutEditorSymbols(context, model, picker, token); } - private doProvideWithoutEditorSymbols(context: IQuickAccessTextEditorContext, model: ITextModel, picker: IQuickPick, token: CancellationToken): IDisposable { + private doProvideWithoutEditorSymbols(context: IQuickAccessTextEditorContext, model: ITextModel, picker: IQuickPick, token: CancellationToken): IDisposable { const disposables = new DisposableStore(); // Generic pick for not having any symbol information @@ -110,7 +110,7 @@ export abstract class AbstractGotoSymbolQuickAccessProvider extends AbstractEdit return disposables; } - private provideLabelPick(picker: IQuickPick, label: string): void { + private provideLabelPick(picker: IQuickPick, label: string): void { picker.items = [{ label, index: 0, kind: SymbolKind.String }]; picker.ariaLabel = label; } @@ -137,7 +137,7 @@ export abstract class AbstractGotoSymbolQuickAccessProvider extends AbstractEdit return symbolProviderRegistryPromise.p; } - private doProvideWithEditorSymbols(context: IQuickAccessTextEditorContext, model: ITextModel, picker: IQuickPick, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable { + private doProvideWithEditorSymbols(context: IQuickAccessTextEditorContext, model: ITextModel, picker: IQuickPick, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable { const editor = context.editor; const disposables = new DisposableStore(); diff --git a/src/vs/editor/contrib/readOnlyMessage/browser/contribution.ts b/src/vs/editor/contrib/readOnlyMessage/browser/contribution.ts index 36ff95e8105..85c34684807 100644 --- a/src/vs/editor/contrib/readOnlyMessage/browser/contribution.ts +++ b/src/vs/editor/contrib/readOnlyMessage/browser/contribution.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MarkdownString } from 'vs/base/common/htmlContent'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { MessageController } from 'vs/editor/contrib/message/browser/messageController'; -import * as nls from 'vs/nls'; +import { MarkdownString } from '../../../../base/common/htmlContent.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { MessageController } from '../../message/browser/messageController.js'; +import * as nls from '../../../../nls.js'; export class ReadOnlyMessageController extends Disposable implements IEditorContribution { diff --git a/src/vs/editor/contrib/rename/browser/rename.ts b/src/vs/editor/contrib/rename/browser/rename.ts index ef5783aa500..e6e77aa01ae 100644 --- a/src/vs/editor/contrib/rename/browser/rename.ts +++ b/src/vs/editor/contrib/rename/browser/rename.ts @@ -3,42 +3,42 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { alert } from 'vs/base/browser/ui/aria/aria'; -import { raceCancellation } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { CancellationError, onUnexpectedError } from 'vs/base/common/errors'; -import { isMarkdownString } from 'vs/base/common/htmlContent'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorCommand, EditorContributionInstantiation, ServicesAccessor, registerEditorAction, registerEditorCommand, registerEditorContribution, registerModelAndPositionCommand } from 'vs/editor/browser/editorExtensions'; -import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { NewSymbolNameTriggerKind, Rejection, RenameLocation, RenameProvider, WorkspaceEdit } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { CodeEditorStateFlag, EditorStateCancellationTokenSource } from 'vs/editor/contrib/editorState/browser/editorState'; -import { MessageController } from 'vs/editor/contrib/message/browser/messageController'; -import * as nls from 'vs/nls'; -import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { ConfigurationScope, Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ILogService } from 'vs/platform/log/common/log'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IEditorProgressService } from 'vs/platform/progress/common/progress'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { CONTEXT_RENAME_INPUT_VISIBLE, NewNameSource, RenameWidget, RenameWidgetResult } from './renameWidget'; +import { alert } from '../../../../base/browser/ui/aria/aria.js'; +import { raceCancellation } from '../../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { CancellationError, onUnexpectedError } from '../../../../base/common/errors.js'; +import { isMarkdownString } from '../../../../base/common/htmlContent.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { assertType } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorCommand, EditorContributionInstantiation, ServicesAccessor, registerEditorAction, registerEditorCommand, registerEditorContribution, registerModelAndPositionCommand } from '../../../browser/editorExtensions.js'; +import { IBulkEditService } from '../../../browser/services/bulkEditService.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { NewSymbolNameTriggerKind, Rejection, RenameLocation, RenameProvider, WorkspaceEdit } from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { ITextResourceConfigurationService } from '../../../common/services/textResourceConfiguration.js'; +import { CodeEditorStateFlag, EditorStateCancellationTokenSource } from '../../editorState/browser/editorState.js'; +import { MessageController } from '../../message/browser/messageController.js'; +import * as nls from '../../../../nls.js'; +import { Action2, registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { ConfigurationScope, Extensions, IConfigurationRegistry } from '../../../../platform/configuration/common/configurationRegistry.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { IEditorProgressService } from '../../../../platform/progress/common/progress.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { CONTEXT_RENAME_INPUT_VISIBLE, NewNameSource, RenameWidget, RenameWidgetResult } from './renameWidget.js'; class RenameSkeleton { diff --git a/src/vs/editor/contrib/rename/browser/renameWidget.ts b/src/vs/editor/contrib/rename/browser/renameWidget.ts index fc1c165a90d..f9294c16cda 100644 --- a/src/vs/editor/contrib/rename/browser/renameWidget.ts +++ b/src/vs/editor/contrib/rename/browser/renameWidget.ts @@ -3,40 +3,39 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import * as aria from 'vs/base/browser/ui/aria/aria'; -import { IManagedHover } from 'vs/base/browser/ui/hover/hover'; -import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2'; -import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; -import { renderIcon } from 'vs/base/browser/ui/iconLabel/iconLabels'; -import { IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; -import { List } from 'vs/base/browser/ui/list/listWidget'; -import * as arrays from 'vs/base/common/arrays'; -import { DeferredPromise, raceCancellation } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Codicon } from 'vs/base/common/codicons'; -import { Emitter } from 'vs/base/common/event'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { assertType, isDefined } from 'vs/base/common/types'; -import 'vs/css!./renameWidget'; -import * as domFontInfo from 'vs/editor/browser/config/domFontInfo'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { FontInfo } from 'vs/editor/common/config/fontInfo'; -import { IDimension } from 'vs/editor/common/core/dimension'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { NewSymbolName, NewSymbolNameTag, NewSymbolNameTriggerKind, ProviderResult } from 'vs/editor/common/languages'; -import * as nls from 'vs/nls'; -import { localize } from 'vs/nls'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ILogService } from 'vs/platform/log/common/log'; -import { getListStyles } from 'vs/platform/theme/browser/defaultStyles'; +import * as dom from '../../../../base/browser/dom.js'; +import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import * as aria from '../../../../base/browser/ui/aria/aria.js'; +import { IManagedHover } from '../../../../base/browser/ui/hover/hover.js'; +import { getBaseLayerHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegate2.js'; +import { getDefaultHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js'; +import { renderIcon } from '../../../../base/browser/ui/iconLabel/iconLabels.js'; +import { IListRenderer, IListVirtualDelegate } from '../../../../base/browser/ui/list/list.js'; +import { List } from '../../../../base/browser/ui/list/listWidget.js'; +import * as arrays from '../../../../base/common/arrays.js'; +import { DeferredPromise, raceCancellation } from '../../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { assertType, isDefined } from '../../../../base/common/types.js'; +import './renameWidget.css'; +import * as domFontInfo from '../../../browser/config/domFontInfo.js'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { FontInfo } from '../../../common/config/fontInfo.js'; +import { IDimension } from '../../../common/core/dimension.js'; +import { Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { ScrollType } from '../../../common/editorCommon.js'; +import { NewSymbolName, NewSymbolNameTag, NewSymbolNameTriggerKind, ProviderResult } from '../../../common/languages.js'; +import * as nls from '../../../../nls.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { getListStyles } from '../../../../platform/theme/browser/defaultStyles.js'; import { editorWidgetBackground, inputBackground, @@ -46,8 +45,8 @@ import { quickInputListFocusForeground, widgetBorder, widgetShadow -} from 'vs/platform/theme/common/colorRegistry'; -import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService'; +} from '../../../../platform/theme/common/colorRegistry.js'; +import { IColorTheme, IThemeService } from '../../../../platform/theme/common/themeService.js'; /** for debugging */ const _sticky = false @@ -55,8 +54,8 @@ const _sticky = false ; -export const CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey('renameInputVisible', false, localize('renameInputVisible', "Whether the rename input widget is visible")); -export const CONTEXT_RENAME_INPUT_FOCUSED = new RawContextKey('renameInputFocused', false, localize('renameInputFocused', "Whether the rename input widget is focused")); +export const CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey('renameInputVisible', false, nls.localize('renameInputVisible', "Whether the rename input widget is visible")); +export const CONTEXT_RENAME_INPUT_FOCUSED = new RawContextKey('renameInputFocused', false, nls.localize('renameInputFocused', "Whether the rename input widget is focused")); /** * "Source" of the new name: @@ -311,7 +310,7 @@ export class RenameWidget implements IRenameWidget, IContentWidget, IDisposable beforeRender(): IDimension | null { const [accept, preview] = this._acceptKeybindings; - this._label!.innerText = localize({ key: 'label', comment: ['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"'] }, "{0} to Rename, {1} to Preview", this._keybindingService.lookupKeybinding(accept)?.getLabel(), this._keybindingService.lookupKeybinding(preview)?.getLabel()); + this._label!.innerText = nls.localize({ key: 'label', comment: ['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"'] }, "{0} to Rename, {1} to Preview", this._keybindingService.lookupKeybinding(accept)?.getLabel(), this._keybindingService.lookupKeybinding(preview)?.getLabel()); this._domNode!.style.minWidth = `200px`; // to prevent from widening when candidates come in @@ -319,7 +318,8 @@ export class RenameWidget implements IRenameWidget, IContentWidget, IDisposable } afterRender(position: ContentWidgetPositionPreference | null): void { - this._trace('invoking afterRender, position: ', position ? 'not null' : 'null'); + // FIXME@ulugbekna: commenting trace log out until we start unmounting the widget from editor properly - https://github.com/microsoft/vscode/issues/226975 + // this._trace('invoking afterRender, position: ', position ? 'not null' : 'null'); if (position === null) { // cancel rename when input widget isn't rendered anymore this.cancelInput(true, 'afterRender (because position is null)'); @@ -364,7 +364,7 @@ export class RenameWidget implements IRenameWidget, IContentWidget, IDisposable } cancelInput(focusEditor: boolean, caller: string): void { - this._trace(`invoking cancelInput, caller: ${caller}, _currentCancelInput: ${this._currentAcceptInput ? 'not undefined' : 'undefined'}`); + // this._trace(`invoking cancelInput, caller: ${caller}, _currentCancelInput: ${this._currentAcceptInput ? 'not undefined' : 'undefined'}`); this._currentCancelInput?.(focusEditor); } @@ -750,7 +750,7 @@ class RenameCandidateListView { this._listContainer.style.height = `${height}px`; this._listContainer.style.width = `${width}px`; - aria.status(localize('renameSuggestionsReceivedAria', "Received {0} rename suggestions", candidates.length)); + aria.status(nls.localize('renameSuggestionsReceivedAria', "Received {0} rename suggestions", candidates.length)); } public clearCandidates(): void { @@ -924,7 +924,7 @@ class InputWithButton implements IDisposable { this._inputNode.className = 'rename-input'; this._inputNode.type = 'text'; this._inputNode.style.border = 'none'; - this._inputNode.setAttribute('aria-label', localize('renameAriaLabel', "Rename input. Type new name and press Enter to commit.")); + this._inputNode.setAttribute('aria-label', nls.localize('renameAriaLabel', "Rename input. Type new name and press Enter to commit.")); this._domNode.appendChild(this._inputNode); diff --git a/src/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.ts b/src/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.ts index 2a60e180cfd..0d66e4dd3c4 100644 --- a/src/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.ts +++ b/src/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, RunOnceScheduler } from 'vs/base/common/async'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { EditorOption, IEditorMinimapOptions } from 'vs/editor/common/config/editorOptions'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IModelDeltaDecoration, MinimapPosition, MinimapSectionHeaderStyle, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { FindSectionHeaderOptions, SectionHeader } from 'vs/editor/common/services/findSectionHeaders'; +import { CancelablePromise, RunOnceScheduler } from '../../../../base/common/async.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { EditorOption, IEditorMinimapOptions } from '../../../common/config/editorOptions.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { StandardTokenType } from '../../../common/encodedTokenAttributes.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { IModelDeltaDecoration, MinimapPosition, MinimapSectionHeaderStyle, TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { IEditorWorkerService } from '../../../common/services/editorWorker.js'; +import { FindSectionHeaderOptions, SectionHeader } from '../../../common/services/findSectionHeaders.js'; export class SectionHeaderDetector extends Disposable implements IEditorContribution { diff --git a/src/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.ts b/src/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.ts index 72e01d3330a..836b30f9b9b 100644 --- a/src/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.ts +++ b/src/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; -import * as errors from 'vs/base/common/errors'; -import { ITextModel } from 'vs/editor/common/model'; -import { IModelContentChangedEvent } from 'vs/editor/common/textModelEvents'; -import { DocumentSemanticTokensProvider, SemanticTokens, SemanticTokensEdits } from 'vs/editor/common/languages'; -import { IModelService } from 'vs/editor/common/services/model'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { SemanticTokensProviderStyling, toMultilineTokens2 } from 'vs/editor/common/services/semanticTokensProviderStyling'; -import { getDocumentSemanticTokens, hasDocumentSemanticTokensProvider, isSemanticTokens, isSemanticTokensEdits } from 'vs/editor/contrib/semanticTokens/common/getSemanticTokens'; -import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ISemanticTokensStylingService } from 'vs/editor/common/services/semanticTokensStyling'; -import { registerEditorFeature } from 'vs/editor/common/editorFeatures'; -import { SEMANTIC_HIGHLIGHTING_SETTING_ID, isSemanticColoringEnabled } from 'vs/editor/contrib/semanticTokens/common/semanticTokensConfig'; +import { Disposable, IDisposable, dispose } from '../../../../base/common/lifecycle.js'; +import * as errors from '../../../../base/common/errors.js'; +import { ITextModel } from '../../../common/model.js'; +import { IModelContentChangedEvent } from '../../../common/textModelEvents.js'; +import { DocumentSemanticTokensProvider, SemanticTokens, SemanticTokensEdits } from '../../../common/languages.js'; +import { IModelService } from '../../../common/services/model.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { SemanticTokensProviderStyling, toMultilineTokens2 } from '../../../common/services/semanticTokensProviderStyling.js'; +import { getDocumentSemanticTokens, hasDocumentSemanticTokensProvider, isSemanticTokens, isSemanticTokensEdits } from '../common/getSemanticTokens.js'; +import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { ISemanticTokensStylingService } from '../../../common/services/semanticTokensStyling.js'; +import { registerEditorFeature } from '../../../common/editorFeatures.js'; +import { SEMANTIC_HIGHLIGHTING_SETTING_ID, isSemanticColoringEnabled } from '../common/semanticTokensConfig.js'; export class DocumentSemanticTokensFeature extends Disposable { diff --git a/src/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.ts b/src/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.ts index 52a1f9401ac..1662f1fec59 100644 --- a/src/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.ts +++ b/src/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise, RunOnceScheduler } from 'vs/base/common/async'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { getDocumentRangeSemanticTokens, hasDocumentRangeSemanticTokensProvider } from 'vs/editor/contrib/semanticTokens/common/getSemanticTokens'; -import { isSemanticColoringEnabled, SEMANTIC_HIGHLIGHTING_SETTING_ID } from 'vs/editor/contrib/semanticTokens/common/semanticTokensConfig'; -import { toMultilineTokens2 } from 'vs/editor/common/services/semanticTokensProviderStyling'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { DocumentRangeSemanticTokensProvider } from 'vs/editor/common/languages'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { ISemanticTokensStylingService } from 'vs/editor/common/services/semanticTokensStyling'; +import { CancelablePromise, createCancelablePromise, RunOnceScheduler } from '../../../../base/common/async.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; +import { getDocumentRangeSemanticTokens, hasDocumentRangeSemanticTokensProvider } from '../common/getSemanticTokens.js'; +import { isSemanticColoringEnabled, SEMANTIC_HIGHLIGHTING_SETTING_ID } from '../common/semanticTokensConfig.js'; +import { toMultilineTokens2 } from '../../../common/services/semanticTokensProviderStyling.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { DocumentRangeSemanticTokensProvider } from '../../../common/languages.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { ISemanticTokensStylingService } from '../../../common/services/semanticTokensStyling.js'; export class ViewportSemanticTokensContribution extends Disposable implements IEditorContribution { diff --git a/src/vs/editor/contrib/semanticTokens/common/getSemanticTokens.ts b/src/vs/editor/contrib/semanticTokens/common/getSemanticTokens.ts index 298da0ce0f6..cd7cbd3e7c1 100644 --- a/src/vs/editor/contrib/semanticTokens/common/getSemanticTokens.ts +++ b/src/vs/editor/contrib/semanticTokens/common/getSemanticTokens.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { URI } from 'vs/base/common/uri'; -import { ITextModel } from 'vs/editor/common/model'; -import { DocumentSemanticTokensProvider, SemanticTokens, SemanticTokensEdits, SemanticTokensLegend, DocumentRangeSemanticTokensProvider } from 'vs/editor/common/languages'; -import { IModelService } from 'vs/editor/common/services/model'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { assertType } from 'vs/base/common/types'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { encodeSemanticTokensDto } from 'vs/editor/common/services/semanticTokensDto'; -import { Range } from 'vs/editor/common/core/range'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ITextModel } from '../../../common/model.js'; +import { DocumentSemanticTokensProvider, SemanticTokens, SemanticTokensEdits, SemanticTokensLegend, DocumentRangeSemanticTokensProvider } from '../../../common/languages.js'; +import { IModelService } from '../../../common/services/model.js'; +import { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js'; +import { assertType } from '../../../../base/common/types.js'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { encodeSemanticTokensDto } from '../../../common/services/semanticTokensDto.js'; +import { Range } from '../../../common/core/range.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; export function isSemanticTokens(v: SemanticTokens | SemanticTokensEdits): v is SemanticTokens { return v && !!((v).data); diff --git a/src/vs/editor/contrib/semanticTokens/common/semanticTokensConfig.ts b/src/vs/editor/contrib/semanticTokens/common/semanticTokensConfig.ts index ebf4f3b2932..c7b39855911 100644 --- a/src/vs/editor/contrib/semanticTokens/common/semanticTokensConfig.ts +++ b/src/vs/editor/contrib/semanticTokens/common/semanticTokensConfig.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ITextModel } from 'vs/editor/common/model'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { ITextModel } from '../../../common/model.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; export const SEMANTIC_HIGHLIGHTING_SETTING_ID = 'editor.semanticHighlighting'; diff --git a/src/vs/editor/contrib/semanticTokens/test/browser/documentSemanticTokens.test.ts b/src/vs/editor/contrib/semanticTokens/test/browser/documentSemanticTokens.test.ts index 86d3bf5d62d..ba4eb555285 100644 --- a/src/vs/editor/contrib/semanticTokens/test/browser/documentSemanticTokens.test.ts +++ b/src/vs/editor/contrib/semanticTokens/test/browser/documentSemanticTokens.test.ts @@ -4,36 +4,38 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Barrier, timeout } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { mock } from 'vs/base/test/common/mock'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { DocumentSemanticTokensProvider, SemanticTokens, SemanticTokensEdits, SemanticTokensLegend } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ITextModel } from 'vs/editor/common/model'; -import { LanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { LanguageService } from 'vs/editor/common/services/languageService'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ModelService } from 'vs/editor/common/services/modelService'; -import { SemanticTokensStylingService } from 'vs/editor/common/services/semanticTokensStylingService'; -import { DocumentSemanticTokensFeature } from 'vs/editor/contrib/semanticTokens/browser/documentSemanticTokens'; -import { getDocumentSemanticTokens, isSemanticTokens } from 'vs/editor/contrib/semanticTokens/common/getSemanticTokens'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { TestTextResourcePropertiesService } from 'vs/editor/test/common/services/testTextResourcePropertiesService'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { TestDialogService } from 'vs/platform/dialogs/test/common/testDialogService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; -import { ColorScheme } from 'vs/platform/theme/common/theme'; -import { TestColorTheme, TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; -import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService'; +import { Barrier, timeout } from '../../../../../base/common/async.js'; +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../../../base/common/event.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { runWithFakedTimers } from '../../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Range } from '../../../../common/core/range.js'; +import { DocumentSemanticTokensProvider, SemanticTokens, SemanticTokensEdits, SemanticTokensLegend } from '../../../../common/languages.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { ITextModel } from '../../../../common/model.js'; +import { LanguageFeatureDebounceService } from '../../../../common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { LanguageFeaturesService } from '../../../../common/services/languageFeaturesService.js'; +import { LanguageService } from '../../../../common/services/languageService.js'; +import { IModelService } from '../../../../common/services/model.js'; +import { ModelService } from '../../../../common/services/modelService.js'; +import { SemanticTokensStylingService } from '../../../../common/services/semanticTokensStylingService.js'; +import { DocumentSemanticTokensFeature } from '../../browser/documentSemanticTokens.js'; +import { getDocumentSemanticTokens, isSemanticTokens } from '../../common/getSemanticTokens.js'; +import { TestLanguageConfigurationService } from '../../../../test/common/modes/testLanguageConfigurationService.js'; +import { TestTextResourcePropertiesService } from '../../../../test/common/services/testTextResourcePropertiesService.js'; +import { TestConfigurationService } from '../../../../../platform/configuration/test/common/testConfigurationService.js'; +import { TestDialogService } from '../../../../../platform/dialogs/test/common/testDialogService.js'; +import { IEnvironmentService } from '../../../../../platform/environment/common/environment.js'; +import { TestInstantiationService } from '../../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { NullLogService } from '../../../../../platform/log/common/log.js'; +import { TestNotificationService } from '../../../../../platform/notification/test/common/testNotificationService.js'; +import { ColorScheme } from '../../../../../platform/theme/common/theme.js'; +import { TestColorTheme, TestThemeService } from '../../../../../platform/theme/test/common/testThemeService.js'; +import { UndoRedoService } from '../../../../../platform/undoRedo/common/undoRedoService.js'; suite('ModelSemanticColoring', () => { @@ -50,12 +52,14 @@ suite('ModelSemanticColoring', () => { languageFeaturesService = new LanguageFeaturesService(); languageService = disposables.add(new LanguageService(false)); const semanticTokensStylingService = disposables.add(new SemanticTokensStylingService(themeService, logService, languageService)); + const instantiationService = new TestInstantiationService(); + instantiationService.set(ILanguageService, languageService); + instantiationService.set(ILanguageConfigurationService, new TestLanguageConfigurationService()); modelService = disposables.add(new ModelService( configService, new TestTextResourcePropertiesService(configService), new UndoRedoService(new TestDialogService(), new TestNotificationService()), - languageService, - new TestLanguageConfigurationService(), + instantiationService )); const envService = new class extends mock() { override isBuilt: boolean = true; diff --git a/src/vs/editor/contrib/semanticTokens/test/browser/getSemanticTokens.test.ts b/src/vs/editor/contrib/semanticTokens/test/browser/getSemanticTokens.test.ts index 6ac97ecde96..467fbc77132 100644 --- a/src/vs/editor/contrib/semanticTokens/test/browser/getSemanticTokens.test.ts +++ b/src/vs/editor/contrib/semanticTokens/test/browser/getSemanticTokens.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { canceled } from 'vs/base/common/errors'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { DocumentSemanticTokensProvider, ProviderResult, SemanticTokens, SemanticTokensEdits, SemanticTokensLegend } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { getDocumentSemanticTokens } from 'vs/editor/contrib/semanticTokens/common/getSemanticTokens'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { canceled } from '../../../../../base/common/errors.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { LanguageFeatureRegistry } from '../../../../common/languageFeatureRegistry.js'; +import { DocumentSemanticTokensProvider, ProviderResult, SemanticTokens, SemanticTokensEdits, SemanticTokensLegend } from '../../../../common/languages.js'; +import { ITextModel } from '../../../../common/model.js'; +import { getDocumentSemanticTokens } from '../../common/getSemanticTokens.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; suite('getSemanticTokens', () => { diff --git a/src/vs/editor/contrib/sidePanel/browser/sidePanelWidget.ts b/src/vs/editor/contrib/sidePanel/browser/sidePanelWidget.ts index 2a789ade141..5abcd31169e 100644 --- a/src/vs/editor/contrib/sidePanel/browser/sidePanelWidget.ts +++ b/src/vs/editor/contrib/sidePanel/browser/sidePanelWidget.ts @@ -3,13 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { getWindow } from 'vs/base/browser/dom'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { autorun, IObservable, observableFromEvent } from 'vs/base/common/observable'; -import { generateUuid } from 'vs/base/common/uuid'; -import 'vs/css!./sidePanelWidget'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; +import * as dom from '../../../../base/browser/dom.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { autorun, IObservable, observableFromEvent } from '../../../../base/common/observable.js'; +import { generateUuid } from '../../../../base/common/uuid.js'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from '../../../browser/editorBrowser.js'; +import './sidePanelWidget.css'; const $ = dom.$; @@ -69,7 +68,7 @@ export abstract class SidePanelWidget extends Disposable implements IOverlayWidg this.editor.addOverlayWidget(this); this.layout(); - getWindow(this.domNode).requestAnimationFrame(() => { + dom.getWindow(this.domNode).requestAnimationFrame(() => { this.setScrollTop(this.editor.getScrollTop()); }); } diff --git a/src/vs/editor/contrib/smartSelect/browser/bracketSelections.ts b/src/vs/editor/contrib/smartSelect/browser/bracketSelections.ts index eda8cd7f397..a85d4e05b17 100644 --- a/src/vs/editor/contrib/smartSelect/browser/bracketSelections.ts +++ b/src/vs/editor/contrib/smartSelect/browser/bracketSelections.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { LinkedList } from 'vs/base/common/linkedList'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { SelectionRange, SelectionRangeProvider } from 'vs/editor/common/languages'; +import { LinkedList } from '../../../../base/common/linkedList.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { ITextModel } from '../../../common/model.js'; +import { SelectionRange, SelectionRangeProvider } from '../../../common/languages.js'; export class BracketSelectionRangeProvider implements SelectionRangeProvider { diff --git a/src/vs/editor/contrib/smartSelect/browser/smartSelect.ts b/src/vs/editor/contrib/smartSelect/browser/smartSelect.ts index 99572b42cb7..650f6c9111d 100644 --- a/src/vs/editor/contrib/smartSelect/browser/smartSelect.ts +++ b/src/vs/editor/contrib/smartSelect/browser/smartSelect.ts @@ -3,32 +3,32 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as arrays from 'vs/base/common/arrays'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, IActionOptions, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ITextModel } from 'vs/editor/common/model'; -import * as languages from 'vs/editor/common/languages'; -import { BracketSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/browser/bracketSelections'; -import { WordSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/browser/wordSelections'; -import * as nls from 'vs/nls'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; +import * as arrays from '../../../../base/common/arrays.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, IActionOptions, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ITextModel } from '../../../common/model.js'; +import * as languages from '../../../common/languages.js'; +import { BracketSelectionRangeProvider } from './bracketSelections.js'; +import { WordSelectionRangeProvider } from './wordSelections.js'; +import * as nls from '../../../../nls.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { ITextModelService } from '../../../common/services/resolverService.js'; +import { assertType } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; class SelectionRanges { diff --git a/src/vs/editor/contrib/smartSelect/browser/wordSelections.ts b/src/vs/editor/contrib/smartSelect/browser/wordSelections.ts index d42513998a4..213cc2f5bbd 100644 --- a/src/vs/editor/contrib/smartSelect/browser/wordSelections.ts +++ b/src/vs/editor/contrib/smartSelect/browser/wordSelections.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { isLowerAsciiLetter, isUpperAsciiLetter } from 'vs/base/common/strings'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { SelectionRange, SelectionRangeProvider } from 'vs/editor/common/languages'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { isLowerAsciiLetter, isUpperAsciiLetter } from '../../../../base/common/strings.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { ITextModel } from '../../../common/model.js'; +import { SelectionRange, SelectionRangeProvider } from '../../../common/languages.js'; export class WordSelectionRangeProvider implements SelectionRangeProvider { diff --git a/src/vs/editor/contrib/smartSelect/test/browser/smartSelect.test.ts b/src/vs/editor/contrib/smartSelect/test/browser/smartSelect.test.ts index 1de9179cc28..3e774fc932f 100644 --- a/src/vs/editor/contrib/smartSelect/test/browser/smartSelect.test.ts +++ b/src/vs/editor/contrib/smartSelect/test/browser/smartSelect.test.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { SelectionRangeProvider } from 'vs/editor/common/languages'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IModelService } from 'vs/editor/common/services/model'; -import { BracketSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/browser/bracketSelections'; -import { provideSelectionRanges } from 'vs/editor/contrib/smartSelect/browser/smartSelect'; -import { WordSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/browser/wordSelections'; -import { createModelServices } from 'vs/editor/test/common/testTextModel'; -import { javascriptOnEnterRules } from 'vs/editor/test/common/modes/supports/onEnterRules'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ILanguageSelection, ILanguageService } from 'vs/editor/common/languages/language'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { Event } from '../../../../../base/common/event.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { Position } from '../../../../common/core/position.js'; +import { IRange, Range } from '../../../../common/core/range.js'; +import { SelectionRangeProvider } from '../../../../common/languages.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { IModelService } from '../../../../common/services/model.js'; +import { BracketSelectionRangeProvider } from '../../browser/bracketSelections.js'; +import { provideSelectionRanges } from '../../browser/smartSelect.js'; +import { WordSelectionRangeProvider } from '../../browser/wordSelections.js'; +import { createModelServices } from '../../../../test/common/testTextModel.js'; +import { javascriptOnEnterRules } from '../../../../test/common/modes/supports/onEnterRules.js'; +import { LanguageFeatureRegistry } from '../../../../common/languageFeatureRegistry.js'; +import { ILanguageSelection, ILanguageService } from '../../../../common/languages/language.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; class StaticLanguageSelector implements ILanguageSelection { readonly onDidChange: Event = Event.None; diff --git a/src/vs/editor/contrib/snippet/browser/snippetController2.ts b/src/vs/editor/contrib/snippet/browser/snippetController2.ts index e066ef8ee56..a201d83b80e 100644 --- a/src/vs/editor/contrib/snippet/browser/snippetController2.ts +++ b/src/vs/editor/contrib/snippet/browser/snippetController2.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { assertType } from 'vs/base/common/types'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorCommand, EditorContributionInstantiation, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { CompletionItem, CompletionItemKind, CompletionItemProvider } from 'vs/editor/common/languages'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { Choice } from 'vs/editor/contrib/snippet/browser/snippetParser'; -import { showSimpleSuggestions } from 'vs/editor/contrib/suggest/browser/suggest'; -import { OvertypingCapturer } from 'vs/editor/contrib/suggest/browser/suggestOvertypingCapturer'; -import { localize } from 'vs/nls'; -import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ISnippetEdit, SnippetSession } from './snippetSession'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { DisposableStore, IDisposable } from '../../../../base/common/lifecycle.js'; +import { assertType } from '../../../../base/common/types.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorCommand, EditorContributionInstantiation, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { CompletionItem, CompletionItemKind, CompletionItemProvider } from '../../../common/languages.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { Choice } from './snippetParser.js'; +import { showSimpleSuggestions } from '../../suggest/browser/suggest.js'; +import { OvertypingCapturer } from '../../suggest/browser/suggestOvertypingCapturer.js'; +import { localize } from '../../../../nls.js'; +import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { ISnippetEdit, SnippetSession } from './snippetSession.js'; export interface ISnippetInsertOptions { overwriteBefore: number; diff --git a/src/vs/editor/contrib/snippet/browser/snippetParser.ts b/src/vs/editor/contrib/snippet/browser/snippetParser.ts index 7e7b42a7be9..a5f1c16c285 100644 --- a/src/vs/editor/contrib/snippet/browser/snippetParser.ts +++ b/src/vs/editor/contrib/snippet/browser/snippetParser.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; +import { CharCode } from '../../../../base/common/charCode.js'; export const enum TokenType { Dollar, diff --git a/src/vs/editor/contrib/snippet/browser/snippetSession.ts b/src/vs/editor/contrib/snippet/browser/snippetSession.ts index 80a9959f475..34bf99e7d4a 100644 --- a/src/vs/editor/contrib/snippet/browser/snippetSession.ts +++ b/src/vs/editor/contrib/snippet/browser/snippetSession.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { groupBy } from 'vs/base/common/arrays'; -import { CharCode } from 'vs/base/common/charCode'; -import { dispose } from 'vs/base/common/lifecycle'; -import { getLeadingWhitespace } from 'vs/base/common/strings'; -import 'vs/css!./snippetSession'; -import { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { IPosition } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { TextChange } from 'vs/editor/common/core/textChange'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IIdentifiedSingleEditOperation, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { OvertypingCapturer } from 'vs/editor/contrib/suggest/browser/suggestOvertypingCapturer'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { Choice, Marker, Placeholder, SnippetParser, Text, TextmateSnippet } from './snippetParser'; -import { ClipboardBasedVariableResolver, CommentBasedVariableResolver, CompositeSnippetVariableResolver, ModelBasedVariableResolver, RandomBasedVariableResolver, SelectionBasedVariableResolver, TimeBasedVariableResolver, WorkspaceBasedVariableResolver } from './snippetVariables'; +import { groupBy } from '../../../../base/common/arrays.js'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { dispose } from '../../../../base/common/lifecycle.js'; +import { getLeadingWhitespace } from '../../../../base/common/strings.js'; +import './snippetSession.css'; +import { IActiveCodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { EditOperation, ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { IPosition } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { TextChange } from '../../../common/core/textChange.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { IIdentifiedSingleEditOperation, ITextModel, TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { OvertypingCapturer } from '../../suggest/browser/suggestOvertypingCapturer.js'; +import { ILabelService } from '../../../../platform/label/common/label.js'; +import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js'; +import { Choice, Marker, Placeholder, SnippetParser, Text, TextmateSnippet } from './snippetParser.js'; +import { ClipboardBasedVariableResolver, CommentBasedVariableResolver, CompositeSnippetVariableResolver, ModelBasedVariableResolver, RandomBasedVariableResolver, SelectionBasedVariableResolver, TimeBasedVariableResolver, WorkspaceBasedVariableResolver } from './snippetVariables.js'; export class OneSnippet { diff --git a/src/vs/editor/contrib/snippet/browser/snippetVariables.ts b/src/vs/editor/contrib/snippet/browser/snippetVariables.ts index 2b82fb2d417..615e1174fca 100644 --- a/src/vs/editor/contrib/snippet/browser/snippetVariables.ts +++ b/src/vs/editor/contrib/snippet/browser/snippetVariables.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { normalizeDriveLetter } from 'vs/base/common/labels'; -import * as path from 'vs/base/common/path'; -import { dirname } from 'vs/base/common/resources'; -import { commonPrefixLength, getLeadingWhitespace, isFalsyOrWhitespace, splitLines } from 'vs/base/common/strings'; -import { generateUuid } from 'vs/base/common/uuid'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { Text, Variable, VariableResolver } from 'vs/editor/contrib/snippet/browser/snippetParser'; -import { OvertypingCapturer } from 'vs/editor/contrib/suggest/browser/suggestOvertypingCapturer'; -import * as nls from 'vs/nls'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { WORKSPACE_EXTENSION, isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier, IWorkspaceContextService, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier, isEmptyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { normalizeDriveLetter } from '../../../../base/common/labels.js'; +import * as path from '../../../../base/common/path.js'; +import { dirname } from '../../../../base/common/resources.js'; +import { commonPrefixLength, getLeadingWhitespace, isFalsyOrWhitespace, splitLines } from '../../../../base/common/strings.js'; +import { generateUuid } from '../../../../base/common/uuid.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { Text, Variable, VariableResolver } from './snippetParser.js'; +import { OvertypingCapturer } from '../../suggest/browser/suggestOvertypingCapturer.js'; +import * as nls from '../../../../nls.js'; +import { ILabelService } from '../../../../platform/label/common/label.js'; +import { WORKSPACE_EXTENSION, isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier, IWorkspaceContextService, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier, isEmptyWorkspaceIdentifier } from '../../../../platform/workspace/common/workspace.js'; export const KnownSnippetVariableNames = Object.freeze<{ [key: string]: true }>({ 'CURRENT_YEAR': true, diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts index 236ad70f27d..22fed982098 100644 --- a/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; -import { ITestCodeEditor, withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { Position } from '../../../../common/core/position.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { LanguageFeaturesService } from '../../../../common/services/languageFeaturesService.js'; +import { SnippetController2 } from '../../browser/snippetController2.js'; +import { ITestCodeEditor, withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { TestLanguageConfigurationService } from '../../../../test/common/modes/testLanguageConfigurationService.js'; +import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { ILabelService } from '../../../../../platform/label/common/label.js'; +import { NullLogService } from '../../../../../platform/log/common/log.js'; +import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js'; class TestSnippetController extends SnippetController2 { diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetController2.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetController2.test.ts index 5b9a5e434f8..a5a1addf0b0 100644 --- a/src/vs/editor/contrib/snippet/test/browser/snippetController2.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetController2.test.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { mock } from 'vs/base/test/common/mock'; -import { CoreEditingCommands } from 'vs/editor/browser/coreCommands'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Range } from 'vs/editor/common/core/range'; -import { Handler } from 'vs/editor/common/editorCommon'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; -import { createTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { EndOfLineSequence } from 'vs/editor/common/model'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { CoreEditingCommands } from '../../../../browser/coreCommands.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { Range } from '../../../../common/core/range.js'; +import { Handler } from '../../../../common/editorCommon.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { SnippetController2 } from '../../browser/snippetController2.js'; +import { createTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { InstantiationService } from '../../../../../platform/instantiation/common/instantiationService.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { MockContextKeyService } from '../../../../../platform/keybinding/test/common/mockKeybindingService.js'; +import { ILabelService } from '../../../../../platform/label/common/label.js'; +import { ILogService, NullLogService } from '../../../../../platform/log/common/log.js'; +import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js'; +import { EndOfLineSequence } from '../../../../common/model.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; suite('SnippetController2', function () { diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts index bbf24168409..31fda916089 100644 --- a/src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Choice, FormatString, Marker, Placeholder, Scanner, SnippetParser, Text, TextmateSnippet, TokenType, Transform, Variable } from 'vs/editor/contrib/snippet/browser/snippetParser'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Choice, FormatString, Marker, Placeholder, Scanner, SnippetParser, Text, TextmateSnippet, TokenType, Transform, Variable } from '../../browser/snippetParser.js'; suite('SnippetParser', () => { diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetSession.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetSession.test.ts index 0a9a3c76462..89914234286 100644 --- a/src/vs/editor/contrib/snippet/test/browser/snippetSession.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetSession.test.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser'; -import { SnippetSession } from 'vs/editor/contrib/snippet/browser/snippetSession'; -import { createTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { IActiveCodeEditor } from '../../../../browser/editorBrowser.js'; +import { IPosition, Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { SnippetParser } from '../../browser/snippetParser.js'; +import { SnippetSession } from '../../browser/snippetSession.js'; +import { createTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { TestLanguageConfigurationService } from '../../../../test/common/modes/testLanguageConfigurationService.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { ILabelService } from '../../../../../platform/label/common/label.js'; +import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js'; suite('SnippetSession', function () { diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts index b8ea4e52342..276ed3376f6 100644 --- a/src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts @@ -4,22 +4,22 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; import * as sinon from 'sinon'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { sep } from 'vs/base/common/path'; -import { isWindows } from 'vs/base/common/platform'; -import { extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Selection } from 'vs/editor/common/core/selection'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { SnippetParser, Variable, VariableResolver } from 'vs/editor/contrib/snippet/browser/snippetParser'; -import { ClipboardBasedVariableResolver, CompositeSnippetVariableResolver, ModelBasedVariableResolver, SelectionBasedVariableResolver, TimeBasedVariableResolver, WorkspaceBasedVariableResolver } from 'vs/editor/contrib/snippet/browser/snippetVariables'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { IWorkspace, IWorkspaceContextService, toWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { Workspace } from 'vs/platform/workspace/test/common/testWorkspace'; -import { toWorkspaceFolders } from 'vs/platform/workspaces/common/workspaces'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { sep } from '../../../../../base/common/path.js'; +import { isWindows } from '../../../../../base/common/platform.js'; +import { extUriBiasedIgnorePathCase } from '../../../../../base/common/resources.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { SnippetParser, Variable, VariableResolver } from '../../browser/snippetParser.js'; +import { ClipboardBasedVariableResolver, CompositeSnippetVariableResolver, ModelBasedVariableResolver, SelectionBasedVariableResolver, TimeBasedVariableResolver, WorkspaceBasedVariableResolver } from '../../browser/snippetVariables.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { ILabelService } from '../../../../../platform/label/common/label.js'; +import { IWorkspace, IWorkspaceContextService, toWorkspaceFolder } from '../../../../../platform/workspace/common/workspace.js'; +import { Workspace } from '../../../../../platform/workspace/test/common/testWorkspace.js'; +import { toWorkspaceFolders } from '../../../../../platform/workspaces/common/workspaces.js'; suite('Snippet Variables Resolver', function () { diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.ts index bbeb000ad8c..5065cd8667f 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.ts +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode } from 'vs/base/common/keyCodes'; -import { EditorAction2, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { localize, localize2 } from 'vs/nls'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { Action2, MenuId } from 'vs/platform/actions/common/actions'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { StickyScrollController } from 'vs/editor/contrib/stickyScroll/browser/stickyScrollController'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { EditorAction2, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { localize, localize2 } from '../../../../nls.js'; +import { Categories } from '../../../../platform/action/common/actionCommonCategories.js'; +import { Action2, MenuId } from '../../../../platform/actions/common/actions.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { StickyScrollController } from './stickyScrollController.js'; export class ToggleStickyScroll extends Action2 { diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollContribution.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollContribution.ts index e242c05227e..2758663f1f0 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollContribution.ts +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollContribution.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { ToggleStickyScroll, FocusStickyScroll, SelectEditor, SelectPreviousStickyScrollLine, SelectNextStickyScrollLine, GoToStickyScrollLine } from 'vs/editor/contrib/stickyScroll/browser/stickyScrollActions'; -import { StickyScrollController } from 'vs/editor/contrib/stickyScroll/browser/stickyScrollController'; -import { registerAction2 } from 'vs/platform/actions/common/actions'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { ToggleStickyScroll, FocusStickyScroll, SelectEditor, SelectPreviousStickyScrollLine, SelectNextStickyScrollLine, GoToStickyScrollLine } from './stickyScrollActions.js'; +import { StickyScrollController } from './stickyScrollController.js'; +import { registerAction2 } from '../../../../platform/actions/common/actions.js'; registerEditorContribution(StickyScrollController.ID, StickyScrollController, EditorContributionInstantiation.AfterFirstRender); registerAction2(ToggleStickyScroll); diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.ts index 22b8c67a294..10eda8ac99a 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.ts +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.ts @@ -3,32 +3,32 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { IActiveCodeEditor, ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { EditorOption, RenderLineNumbersType, ConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; -import { StickyScrollWidget, StickyScrollWidgetState } from './stickyScrollWidget'; -import { IStickyLineCandidateProvider, StickyLineCandidateProvider } from './stickyScrollProvider'; -import { IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ClickLinkGesture, ClickLinkMouseEvent } from 'vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { getDefinitionsAtPosition } from 'vs/editor/contrib/gotoSymbol/browser/goToSymbol'; -import { goToDefinitionWithLocation } from 'vs/editor/contrib/inlayHints/browser/inlayHintsLocations'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import * as dom from 'vs/base/browser/dom'; -import { StickyRange } from 'vs/editor/contrib/stickyScroll/browser/stickyScrollElement'; -import { IMouseEvent, StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { FoldingController } from 'vs/editor/contrib/folding/browser/folding'; -import { FoldingModel, toggleCollapseState } from 'vs/editor/contrib/folding/browser/foldingModel'; +import { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js'; +import { IActiveCodeEditor, ICodeEditor, MouseTargetType } from '../../../browser/editorBrowser.js'; +import { IEditorContribution, ScrollType } from '../../../common/editorCommon.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { EditorOption, RenderLineNumbersType, ConfigurationChangedEvent } from '../../../common/config/editorOptions.js'; +import { StickyScrollWidget, StickyScrollWidgetState } from './stickyScrollWidget.js'; +import { IStickyLineCandidateProvider, StickyLineCandidateProvider } from './stickyScrollProvider.js'; +import { IModelTokensChangedEvent } from '../../../common/textModelEvents.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ClickLinkGesture, ClickLinkMouseEvent } from '../../gotoSymbol/browser/link/clickLinkGesture.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { getDefinitionsAtPosition } from '../../gotoSymbol/browser/goToSymbol.js'; +import { goToDefinitionWithLocation } from '../../inlayHints/browser/inlayHintsLocations.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js'; +import * as dom from '../../../../base/browser/dom.js'; +import { StickyRange } from './stickyScrollElement.js'; +import { IMouseEvent, StandardMouseEvent } from '../../../../base/browser/mouseEvent.js'; +import { FoldingController } from '../../folding/browser/folding.js'; +import { FoldingModel, toggleCollapseState } from '../../folding/browser/foldingModel.js'; export interface IStickyScrollController { get stickyScrollCandidateProvider(): IStickyLineCandidateProvider; @@ -324,7 +324,7 @@ export class StickyScrollController extends Disposable implements IEditorContrib let currentHTMLChild: HTMLElement; - getDefinitionsAtPosition(this._languageFeaturesService.definitionProvider, this._editor.getModel(), new Position(range.startLineNumber, range.startColumn + 1), cancellationToken.token).then((candidateDefinitions => { + getDefinitionsAtPosition(this._languageFeaturesService.definitionProvider, this._editor.getModel(), new Position(range.startLineNumber, range.startColumn + 1), false, cancellationToken.token).then((candidateDefinitions => { if (cancellationToken.token.isCancellationRequested) { return; } diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollElement.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollElement.ts index 1bbf4f5e5bf..151ee916491 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollElement.ts +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollElement.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; +import { URI } from '../../../../base/common/uri.js'; export class StickyRange { constructor( diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts index 22cfdb013a7..b313d5490df 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { OutlineElement, OutlineGroup, OutlineModel } from 'vs/editor/contrib/documentSymbols/browser/outlineModel'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { CancelablePromise, createCancelablePromise, Delayer } from 'vs/base/common/async'; -import { FoldingController, RangesLimitReporter } from 'vs/editor/contrib/folding/browser/folding'; -import { SyntaxRangeProvider } from 'vs/editor/contrib/folding/browser/syntaxRangeProvider'; -import { IndentRangeProvider } from 'vs/editor/contrib/folding/browser/indentRangeProvider'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { FoldingRegions } from 'vs/editor/contrib/folding/browser/foldingRanges'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { StickyElement, StickyModel, StickyRange } from 'vs/editor/contrib/stickyScroll/browser/stickyScrollElement'; -import { Iterable } from 'vs/base/common/iterator'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; +import { Disposable, DisposableStore, IDisposable } from '../../../../base/common/lifecycle.js'; +import { IActiveCodeEditor } from '../../../browser/editorBrowser.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { OutlineElement, OutlineGroup, OutlineModel } from '../../documentSymbols/browser/outlineModel.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { CancelablePromise, createCancelablePromise, Delayer } from '../../../../base/common/async.js'; +import { FoldingController, RangesLimitReporter } from '../../folding/browser/folding.js'; +import { SyntaxRangeProvider } from '../../folding/browser/syntaxRangeProvider.js'; +import { IndentRangeProvider } from '../../folding/browser/indentRangeProvider.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { FoldingRegions } from '../../folding/browser/foldingRanges.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { StickyElement, StickyModel, StickyRange } from './stickyScrollElement.js'; +import { Iterable } from '../../../../base/common/iterator.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; enum ModelProvider { OUTLINE_MODEL = 'outlineModel', diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts index 705ef76489e..77cd911f9f4 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { CancellationToken, CancellationTokenSource, } from 'vs/base/common/cancellation'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { Range } from 'vs/editor/common/core/range'; -import { binarySearch } from 'vs/base/common/arrays'; -import { Event, Emitter } from 'vs/base/common/event'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { StickyModelProvider, IStickyModelProvider } from 'vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider'; -import { StickyElement, StickyModel, StickyRange } from 'vs/editor/contrib/stickyScroll/browser/stickyScrollElement'; +import { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { CancellationToken, CancellationTokenSource, } from '../../../../base/common/cancellation.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { Range } from '../../../common/core/range.js'; +import { binarySearch } from '../../../../base/common/arrays.js'; +import { Event, Emitter } from '../../../../base/common/event.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { StickyModelProvider, IStickyModelProvider } from './stickyScrollModelProvider.js'; +import { StickyElement, StickyModel, StickyRange } from './stickyScrollElement.js'; export class StickyLineCandidate { constructor( diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts index 27d3d8e1a58..8dff7940199 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { createTrustedTypesPolicy } from 'vs/base/browser/trustedTypes'; -import { equals } from 'vs/base/common/arrays'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { ThemeIcon } from 'vs/base/common/themables'; -import 'vs/css!./stickyScroll'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; -import { getColumnOfNodeOffset } from 'vs/editor/browser/viewParts/lines/viewLine'; -import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget'; -import { EditorLayoutInfo, EditorOption, RenderLineNumbersType } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { StringBuilder } from 'vs/editor/common/core/stringBuilder'; -import { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations'; -import { CharacterMapping, RenderLineInput, renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer'; -import { foldingCollapsedIcon, foldingExpandedIcon } from 'vs/editor/contrib/folding/browser/foldingDecorations'; -import { FoldingModel } from 'vs/editor/contrib/folding/browser/foldingModel'; +import * as dom from '../../../../base/browser/dom.js'; +import { createTrustedTypesPolicy } from '../../../../base/browser/trustedTypes.js'; +import { equals } from '../../../../base/common/arrays.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import './stickyScroll.css'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from '../../../browser/editorBrowser.js'; +import { getColumnOfNodeOffset } from '../../../browser/viewParts/viewLines/viewLine.js'; +import { EmbeddedCodeEditorWidget } from '../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js'; +import { EditorLayoutInfo, EditorOption, RenderLineNumbersType } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { StringBuilder } from '../../../common/core/stringBuilder.js'; +import { LineDecoration } from '../../../common/viewLayout/lineDecorations.js'; +import { CharacterMapping, RenderLineInput, renderViewLine } from '../../../common/viewLayout/viewLineRenderer.js'; +import { foldingCollapsedIcon, foldingExpandedIcon } from '../../folding/browser/foldingDecorations.js'; +import { FoldingModel } from '../../folding/browser/foldingModel.js'; export class StickyScrollWidgetState { constructor( @@ -139,6 +139,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget { const isWidgetHeightZero = this._isWidgetHeightZero(_state); const state = isWidgetHeightZero ? undefined : _state; const rebuildFromLine = isWidgetHeightZero ? 0 : this._findLineToRebuildWidgetFrom(_state, _rebuildFromLine); + this._renderRootNode(state, foldingModel, rebuildFromLine); this._previousState = _state; } diff --git a/src/vs/editor/contrib/stickyScroll/test/browser/stickyScroll.test.ts b/src/vs/editor/contrib/stickyScroll/test/browser/stickyScroll.test.ts index aaefcb65f3d..7ac05581732 100644 --- a/src/vs/editor/contrib/stickyScroll/test/browser/stickyScroll.test.ts +++ b/src/vs/editor/contrib/stickyScroll/test/browser/stickyScroll.test.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { withAsyncTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { StickyScrollController } from 'vs/editor/contrib/stickyScroll/browser/stickyScrollController'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { DocumentSymbol, SymbolKind } from 'vs/editor/common/languages'; -import { StickyLineCandidate, StickyLineCandidateProvider } from 'vs/editor/contrib/stickyScroll/browser/stickyScrollProvider'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { mock } from 'vs/base/test/common/mock'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ILanguageFeatureDebounceService, LanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { DisposableStore } from 'vs/base/common/lifecycle'; +import { withAsyncTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { StickyScrollController } from '../../browser/stickyScrollController.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { LanguageFeaturesService } from '../../../../common/services/languageFeaturesService.js'; +import { DocumentSymbol, SymbolKind } from '../../../../common/languages.js'; +import { StickyLineCandidate, StickyLineCandidateProvider } from '../../browser/stickyScrollProvider.js'; +import { EditorOption } from '../../../../common/config/editorOptions.js'; +import { ILogService, NullLogService } from '../../../../../platform/log/common/log.js'; +import { IContextMenuService } from '../../../../../platform/contextview/browser/contextView.js'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { ILanguageFeatureDebounceService, LanguageFeatureDebounceService } from '../../../../common/services/languageFeatureDebounce.js'; +import { TestLanguageConfigurationService } from '../../../../test/common/modes/testLanguageConfigurationService.js'; +import { SyncDescriptor } from '../../../../../platform/instantiation/common/descriptors.js'; +import { runWithFakedTimers } from '../../../../../base/test/common/timeTravelScheduler.js'; +import { IEnvironmentService } from '../../../../../platform/environment/common/environment.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; suite('Sticky Scroll Tests', () => { diff --git a/src/vs/editor/contrib/suggest/browser/completionModel.ts b/src/vs/editor/contrib/suggest/browser/completionModel.ts index de860b992e2..ecf72cef8ed 100644 --- a/src/vs/editor/contrib/suggest/browser/completionModel.ts +++ b/src/vs/editor/contrib/suggest/browser/completionModel.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { quickSelect } from 'vs/base/common/arrays'; -import { CharCode } from 'vs/base/common/charCode'; -import { anyScore, fuzzyScore, FuzzyScore, fuzzyScoreGracefulAggressive, FuzzyScoreOptions, FuzzyScorer } from 'vs/base/common/filters'; -import { compareIgnoreCase } from 'vs/base/common/strings'; -import { InternalSuggestOptions } from 'vs/editor/common/config/editorOptions'; -import { CompletionItemKind, CompletionItemProvider } from 'vs/editor/common/languages'; -import { WordDistance } from 'vs/editor/contrib/suggest/browser/wordDistance'; -import { CompletionItem } from './suggest'; +import { quickSelect } from '../../../../base/common/arrays.js'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { anyScore, fuzzyScore, FuzzyScore, fuzzyScoreGracefulAggressive, FuzzyScoreOptions, FuzzyScorer } from '../../../../base/common/filters.js'; +import { compareIgnoreCase } from '../../../../base/common/strings.js'; +import { InternalSuggestOptions } from '../../../common/config/editorOptions.js'; +import { CompletionItemKind, CompletionItemProvider } from '../../../common/languages.js'; +import { WordDistance } from './wordDistance.js'; +import { CompletionItem } from './suggest.js'; type StrictCompletionItem = Required; diff --git a/src/vs/editor/contrib/suggest/browser/media/suggest.css b/src/vs/editor/contrib/suggest/browser/media/suggest.css index 597fa5411b3..e836d840e7b 100644 --- a/src/vs/editor/contrib/suggest/browser/media/suggest.css +++ b/src/vs/editor/contrib/suggest/browser/media/suggest.css @@ -352,7 +352,7 @@ color: var(--vscode-editorSuggestWidget-foreground); } -.monaco-editor .suggest-details.focused { +.monaco-editor .suggest-details:focus { border-color: var(--vscode-focusBorder); } diff --git a/src/vs/editor/contrib/suggest/browser/suggest.ts b/src/vs/editor/contrib/suggest/browser/suggest.ts index 0ca6b0e09d0..c63d3bb81b1 100644 --- a/src/vs/editor/contrib/suggest/browser/suggest.ts +++ b/src/vs/editor/contrib/suggest/browser/suggest.ts @@ -3,31 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { CancellationError, isCancellationError, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { FuzzyScore } from 'vs/base/common/filters'; -import { DisposableStore, IDisposable, isDisposable } from 'vs/base/common/lifecycle'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import * as languages from 'vs/editor/common/languages'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser'; -import { localize } from 'vs/nls'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { historyNavigationVisible } from 'vs/platform/history/browser/contextScopedHistoryWidget'; -import { InternalQuickSuggestionsOptions, QuickSuggestionsValue } from 'vs/editor/common/config/editorOptions'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { CancellationError, isCancellationError, onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { FuzzyScore } from '../../../../base/common/filters.js'; +import { DisposableStore, IDisposable, isDisposable } from '../../../../base/common/lifecycle.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { assertType } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; +import * as languages from '../../../common/languages.js'; +import { ITextModelService } from '../../../common/services/resolverService.js'; +import { SnippetParser } from '../../snippet/browser/snippetParser.js'; +import { localize } from '../../../../nls.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { historyNavigationVisible } from '../../../../platform/history/browser/contextScopedHistoryWidget.js'; +import { InternalQuickSuggestionsOptions, QuickSuggestionsValue } from '../../../common/config/editorOptions.js'; +import { ExtensionIdentifier } from '../../../../platform/extensions/common/extensions.js'; +import { StandardTokenType } from '../../../common/encodedTokenAttributes.js'; export const Context = { Visible: historyNavigationVisible, @@ -178,13 +178,13 @@ export class CompletionOptions { ) { } } -let _snippetSuggestSupport: languages.CompletionItemProvider; +let _snippetSuggestSupport: languages.CompletionItemProvider | undefined; -export function getSnippetSuggestSupport(): languages.CompletionItemProvider { +export function getSnippetSuggestSupport(): languages.CompletionItemProvider | undefined { return _snippetSuggestSupport; } -export function setSnippetSuggestSupport(support: languages.CompletionItemProvider): languages.CompletionItemProvider { +export function setSnippetSuggestSupport(support: languages.CompletionItemProvider | undefined): languages.CompletionItemProvider | undefined { const old = _snippetSuggestSupport; _snippetSuggestSupport = support; return old; diff --git a/src/vs/editor/contrib/suggest/browser/suggestAlternatives.ts b/src/vs/editor/contrib/suggest/browser/suggestAlternatives.ts index 2422c361a35..f108e89874d 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestAlternatives.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestAlternatives.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { CompletionModel } from './completionModel'; -import { ISelectedSuggestion } from './suggestWidget'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { CompletionModel } from './completionModel.js'; +import { ISelectedSuggestion } from './suggestWidget.js'; export class SuggestAlternatives { diff --git a/src/vs/editor/contrib/suggest/browser/suggestCommitCharacters.ts b/src/vs/editor/contrib/suggest/browser/suggestCommitCharacters.ts index 61080e43376..fb2eb635ca2 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestCommitCharacters.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestCommitCharacters.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { CharacterSet } from 'vs/editor/common/core/characterClassifier'; -import { State, SuggestModel } from 'vs/editor/contrib/suggest/browser/suggestModel'; -import { ISelectedSuggestion, SuggestWidget } from './suggestWidget'; +import { isNonEmptyArray } from '../../../../base/common/arrays.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { CharacterSet } from '../../../common/core/characterClassifier.js'; +import { State, SuggestModel } from './suggestModel.js'; +import { ISelectedSuggestion, SuggestWidget } from './suggestWidget.js'; export class CommitCharacterController { diff --git a/src/vs/editor/contrib/suggest/browser/suggestController.ts b/src/vs/editor/contrib/suggest/browser/suggestController.ts index d13a45e0c36..e564614c9f4 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestController.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestController.ts @@ -3,50 +3,50 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { alert } from 'vs/base/browser/ui/aria/aria'; -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { KeyCodeChord } from 'vs/base/common/keybindings'; -import { DisposableStore, dispose, IDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import * as platform from 'vs/base/common/platform'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { assertType, isObject } from 'vs/base/common/types'; -import { StableEditorScrollState } from 'vs/editor/browser/stableEditorScroll'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorCommand, EditorContributionInstantiation, registerEditorAction, registerEditorCommand, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { CompletionItemInsertTextRule, CompletionItemProvider, CompletionTriggerKind } from 'vs/editor/common/languages'; -import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; -import { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser'; -import { ISuggestMemoryService } from 'vs/editor/contrib/suggest/browser/suggestMemory'; -import { WordContextKey } from 'vs/editor/contrib/suggest/browser/wordContextKey'; -import * as nls from 'vs/nls'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ILogService } from 'vs/platform/log/common/log'; -import { CompletionItem, Context as SuggestContext, ISuggestItemPreselector, suggestWidgetStatusbarMenu } from './suggest'; -import { SuggestAlternatives } from './suggestAlternatives'; -import { CommitCharacterController } from './suggestCommitCharacters'; -import { State, SuggestModel } from './suggestModel'; -import { OvertypingCapturer } from './suggestOvertypingCapturer'; -import { ISelectedSuggestion, SuggestWidget } from './suggestWidget'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { basename, extname } from 'vs/base/common/resources'; -import { hash } from 'vs/base/common/hash'; -import { WindowIdleValue, getWindow } from 'vs/base/browser/dom'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; +import { alert } from '../../../../base/browser/ui/aria/aria.js'; +import { isNonEmptyArray } from '../../../../base/common/arrays.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { onUnexpectedError, onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { KeyCodeChord } from '../../../../base/common/keybindings.js'; +import { DisposableStore, dispose, IDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import * as platform from '../../../../base/common/platform.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { assertType, isObject } from '../../../../base/common/types.js'; +import { StableEditorScrollState } from '../../../browser/stableEditorScroll.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorCommand, EditorContributionInstantiation, registerEditorAction, registerEditorCommand, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { EditOperation } from '../../../common/core/editOperation.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution, ScrollType } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ITextModel, TrackedRangeStickiness } from '../../../common/model.js'; +import { CompletionItemInsertTextRule, CompletionItemProvider, CompletionTriggerKind } from '../../../common/languages.js'; +import { SnippetController2 } from '../../snippet/browser/snippetController2.js'; +import { SnippetParser } from '../../snippet/browser/snippetParser.js'; +import { ISuggestMemoryService } from './suggestMemory.js'; +import { WordContextKey } from './wordContextKey.js'; +import * as nls from '../../../../nls.js'; +import { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js'; +import { ContextKeyExpr, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { CompletionItem, Context as SuggestContext, ISuggestItemPreselector, suggestWidgetStatusbarMenu } from './suggest.js'; +import { SuggestAlternatives } from './suggestAlternatives.js'; +import { CommitCharacterController } from './suggestCommitCharacters.js'; +import { State, SuggestModel } from './suggestModel.js'; +import { OvertypingCapturer } from './suggestOvertypingCapturer.js'; +import { ISelectedSuggestion, SuggestWidget } from './suggestWidget.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { basename, extname } from '../../../../base/common/resources.js'; +import { hash } from '../../../../base/common/hash.js'; +import { WindowIdleValue, getWindow } from '../../../../base/browser/dom.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; // sticky suggest widget which doesn't disappear on focus out and such const _sticky = false @@ -523,26 +523,42 @@ export class SuggestController implements IEditorContribution { // clear only now - after all tasks are done Promise.all(tasks).finally(() => { - this._reportSuggestionAcceptedTelemetry(item, model, isResolved, _commandExectionDuration, _additionalEditsAppliedAsync); + this._reportSuggestionAcceptedTelemetry(item, model, isResolved, _commandExectionDuration, _additionalEditsAppliedAsync, event.index, event.model.items); this.model.clear(); cts.dispose(); }); } - private _reportSuggestionAcceptedTelemetry(item: CompletionItem, model: ITextModel, itemResolved: boolean, commandExectionDuration: number, additionalEditsAppliedAsync: number) { - + private _reportSuggestionAcceptedTelemetry(item: CompletionItem, model: ITextModel, itemResolved: boolean, commandExectionDuration: number, additionalEditsAppliedAsync: number, index: number, completionItems: CompletionItem[]): void { if (Math.floor(Math.random() * 100) === 0) { // throttle telemetry event because accepting completions happens a lot return; } + const labelMap = new Map(); + + for (let i = 0; i < Math.min(30, completionItems.length); i++) { + const label = completionItems[i].textLabel; + + if (labelMap.has(label)) { + labelMap.get(label)!.push(i); + } else { + labelMap.set(label, [i]); + } + } + + const firstIndexArray = labelMap.get(item.textLabel); + const hasDuplicates = firstIndexArray && firstIndexArray.length > 1; + const firstIndex = hasDuplicates ? firstIndexArray[0] : -1; + type AcceptedSuggestion = { extensionId: string; providerId: string; fileExtension: string; languageId: string; basenameHash: string; kind: number; resolveInfo: number; resolveDuration: number; commandDuration: number; additionalEditsAsync: number; + index: number; firstIndex: number; }; type AcceptedSuggestionClassification = { owner: 'jrieken'; @@ -557,6 +573,8 @@ export class SuggestController implements IEditorContribution { resolveDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How long resolving took to finish' }; commandDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How long a completion item command took' }; additionalEditsAsync: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Info about asynchronously applying additional edits' }; + index: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The index of the completion item in the sorted list.' }; + firstIndex: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'When there are multiple completions, the index of the first instance.' }; }; this._telemetryService.publicLog2('suggest.acceptedSuggestion', { @@ -569,7 +587,9 @@ export class SuggestController implements IEditorContribution { resolveInfo: !item.provider.resolveCompletionItem ? -1 : itemResolved ? 1 : 0, resolveDuration: item.resolveDuration, commandDuration: commandExectionDuration, - additionalEditsAsync: additionalEditsAppliedAsync + additionalEditsAsync: additionalEditsAppliedAsync, + index, + firstIndex, }); } @@ -1019,13 +1039,13 @@ registerEditorCommand(new SuggestCommand({ group: 'right', order: 1, when: ContextKeyExpr.and(SuggestContext.DetailsVisible, SuggestContext.CanResolve), - title: nls.localize('detail.more', "show less") + title: nls.localize('detail.more', "Show Less") }, { menuId: suggestWidgetStatusbarMenu, group: 'right', order: 1, when: ContextKeyExpr.and(SuggestContext.DetailsVisible.toNegated(), SuggestContext.CanResolve), - title: nls.localize('detail.less', "show more") + title: nls.localize('detail.less', "Show More") }] })); diff --git a/src/vs/editor/contrib/suggest/browser/suggestInlineCompletions.ts b/src/vs/editor/contrib/suggest/browser/suggestInlineCompletions.ts index 81d6f7d4d8f..e5f38891d53 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestInlineCompletions.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestInlineCompletions.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { FuzzyScore } from 'vs/base/common/filters'; -import { Iterable } from 'vs/base/common/iterator'; -import { Disposable, RefCountedDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { IWordAtPosition } from 'vs/editor/common/core/wordHelper'; -import { registerEditorFeature } from 'vs/editor/common/editorFeatures'; -import { Command, CompletionItemInsertTextRule, CompletionItemProvider, CompletionTriggerKind, InlineCompletion, InlineCompletionContext, InlineCompletions, InlineCompletionsProvider } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { CompletionModel, LineContext } from 'vs/editor/contrib/suggest/browser/completionModel'; -import { CompletionItem, CompletionItemModel, CompletionOptions, provideSuggestionItems, QuickSuggestionsOptions } from 'vs/editor/contrib/suggest/browser/suggest'; -import { ISuggestMemoryService } from 'vs/editor/contrib/suggest/browser/suggestMemory'; -import { SuggestModel } from 'vs/editor/contrib/suggest/browser/suggestModel'; -import { WordDistance } from 'vs/editor/contrib/suggest/browser/wordDistance'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { FuzzyScore } from '../../../../base/common/filters.js'; +import { Iterable } from '../../../../base/common/iterator.js'; +import { Disposable, RefCountedDisposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { IWordAtPosition } from '../../../common/core/wordHelper.js'; +import { registerEditorFeature } from '../../../common/editorFeatures.js'; +import { Command, CompletionItemInsertTextRule, CompletionItemProvider, CompletionTriggerKind, InlineCompletion, InlineCompletionContext, InlineCompletions, InlineCompletionsProvider } from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { CompletionModel, LineContext } from './completionModel.js'; +import { CompletionItem, CompletionItemModel, CompletionOptions, provideSuggestionItems, QuickSuggestionsOptions } from './suggest.js'; +import { ISuggestMemoryService } from './suggestMemory.js'; +import { SuggestModel } from './suggestModel.js'; +import { WordDistance } from './wordDistance.js'; +import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js'; class SuggestInlineCompletion implements InlineCompletion { diff --git a/src/vs/editor/contrib/suggest/browser/suggestMemory.ts b/src/vs/editor/contrib/suggest/browser/suggestMemory.ts index ff7df7cc7cb..7aa97af48e1 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestMemory.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestMemory.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { LRUCache } from 'vs/base/common/map'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { IPosition } from 'vs/editor/common/core/position'; -import { ITextModel } from 'vs/editor/common/model'; -import { CompletionItemKind, CompletionItemKinds } from 'vs/editor/common/languages'; -import { CompletionItem } from 'vs/editor/contrib/suggest/browser/suggest'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from 'vs/platform/storage/common/storage'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { LRUCache } from '../../../../base/common/map.js'; +import { TernarySearchTree } from '../../../../base/common/ternarySearchTree.js'; +import { IPosition } from '../../../common/core/position.js'; +import { ITextModel } from '../../../common/model.js'; +import { CompletionItemKind, CompletionItemKinds } from '../../../common/languages.js'; +import { CompletionItem } from './suggest.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js'; +import { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from '../../../../platform/storage/common/storage.js'; export abstract class Memory { diff --git a/src/vs/editor/contrib/suggest/browser/suggestModel.ts b/src/vs/editor/contrib/suggest/browser/suggestModel.ts index 0e4124b39f8..7a7019032ca 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestModel.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestModel.ts @@ -3,35 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { TimeoutTimer } from 'vs/base/common/async'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { getLeadingWhitespace, isHighSurrogate, isLowSurrogate } from 'vs/base/common/strings'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ITextModel } from 'vs/editor/common/model'; -import { CompletionContext, CompletionItemKind, CompletionItemProvider, CompletionTriggerKind } from 'vs/editor/common/languages'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { WordDistance } from 'vs/editor/contrib/suggest/browser/wordDistance'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { CompletionModel } from './completionModel'; -import { CompletionDurations, CompletionItem, CompletionOptions, getSnippetSuggestSupport, provideSuggestionItems, QuickSuggestionsOptions, SnippetSortOrder } from './suggest'; -import { IWordAtPosition } from 'vs/editor/common/core/wordHelper'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { FuzzyScoreOptions } from 'vs/base/common/filters'; -import { assertType } from 'vs/base/common/types'; -import { InlineCompletionContextKeys } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys'; -import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { TimeoutTimer } from '../../../../base/common/async.js'; +import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { DisposableStore, dispose, IDisposable } from '../../../../base/common/lifecycle.js'; +import { getLeadingWhitespace, isHighSurrogate, isLowSurrogate } from '../../../../base/common/strings.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { CursorChangeReason, ICursorSelectionChangedEvent } from '../../../common/cursorEvents.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ITextModel } from '../../../common/model.js'; +import { CompletionContext, CompletionItemKind, CompletionItemProvider, CompletionTriggerKind } from '../../../common/languages.js'; +import { IEditorWorkerService } from '../../../common/services/editorWorker.js'; +import { WordDistance } from './wordDistance.js'; +import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { CompletionModel } from './completionModel.js'; +import { CompletionDurations, CompletionItem, CompletionOptions, getSnippetSuggestSupport, provideSuggestionItems, QuickSuggestionsOptions, SnippetSortOrder } from './suggest.js'; +import { IWordAtPosition } from '../../../common/core/wordHelper.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { FuzzyScoreOptions } from '../../../../base/common/filters.js'; +import { assertType } from '../../../../base/common/types.js'; +import { InlineCompletionContextKeys } from '../../inlineCompletions/browser/controller/inlineCompletionContextKeys.js'; +import { SnippetController2 } from '../../snippet/browser/snippetController2.js'; +import { IEnvironmentService } from '../../../../platform/environment/common/environment.js'; export interface ICancelEvent { readonly retrigger: boolean; @@ -230,7 +230,10 @@ export class SuggestModel implements IDisposable { let set = supportsByTriggerCharacter.get(ch); if (!set) { set = new Set(); - set.add(getSnippetSuggestSupport()); + const suggestSupport = getSnippetSuggestSupport(); + if (suggestSupport) { + set.add(suggestSupport); + } supportsByTriggerCharacter.set(ch, set); } set.add(support); diff --git a/src/vs/editor/contrib/suggest/browser/suggestOvertypingCapturer.ts b/src/vs/editor/contrib/suggest/browser/suggestOvertypingCapturer.ts index a8f60b54fa9..eb6d9d1578d 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestOvertypingCapturer.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestOvertypingCapturer.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { SuggestModel } from 'vs/editor/contrib/suggest/browser/suggestModel'; +import { DisposableStore, IDisposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { SuggestModel } from './suggestModel.js'; export class OvertypingCapturer implements IDisposable { diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts index 2eeb94d99b6..7b728a6e171 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts @@ -3,51 +3,51 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import 'vs/base/browser/ui/codicons/codiconStyles'; // The codicon symbol styles are defined here and must be loaded -import { IListEvent, IListGestureEvent, IListMouseEvent } from 'vs/base/browser/ui/list/list'; -import { List } from 'vs/base/browser/ui/list/listWidget'; -import { CancelablePromise, createCancelablePromise, disposableTimeout, TimeoutTimer } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, Event, PauseableEmitter } from 'vs/base/common/event'; -import { DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { clamp } from 'vs/base/common/numbers'; -import * as strings from 'vs/base/common/strings'; -import 'vs/css!./media/suggest'; -import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition, IEditorMouseEvent } from 'vs/editor/browser/editorBrowser'; -import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IPosition } from 'vs/editor/common/core/position'; -import { SuggestWidgetStatus } from 'vs/editor/contrib/suggest/browser/suggestWidgetStatus'; -import 'vs/editor/contrib/symbolIcons/browser/symbolIcons'; // The codicon symbol colors are defined here and must be loaded to get colors -import * as nls from 'vs/nls'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { activeContrastBorder, editorForeground, editorWidgetBackground, editorWidgetBorder, listFocusHighlightForeground, listHighlightForeground, quickInputListFocusBackground, quickInputListFocusForeground, quickInputListFocusIconForeground, registerColor, transparent } from 'vs/platform/theme/common/colorRegistry'; -import { isHighContrast } from 'vs/platform/theme/common/theme'; -import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService'; -import { CompletionModel } from './completionModel'; -import { ResizableHTMLElement } from 'vs/base/browser/ui/resizable/resizable'; -import { CompletionItem, Context as SuggestContext, suggestWidgetStatusbarMenu } from './suggest'; -import { canExpandCompletionItem, SuggestDetailsOverlay, SuggestDetailsWidget } from './suggestWidgetDetails'; -import { getAriaId, ItemRenderer } from './suggestWidgetRenderer'; -import { getListStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { status } from 'vs/base/browser/ui/aria/aria'; +import * as dom from '../../../../base/browser/dom.js'; +import { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import '../../../../base/browser/ui/codicons/codiconStyles.js'; // The codicon symbol styles are defined here and must be loaded +import { IListEvent, IListGestureEvent, IListMouseEvent } from '../../../../base/browser/ui/list/list.js'; +import { List } from '../../../../base/browser/ui/list/listWidget.js'; +import { CancelablePromise, createCancelablePromise, disposableTimeout, TimeoutTimer } from '../../../../base/common/async.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Emitter, Event, PauseableEmitter } from '../../../../base/common/event.js'; +import { DisposableStore, IDisposable, MutableDisposable } from '../../../../base/common/lifecycle.js'; +import { clamp } from '../../../../base/common/numbers.js'; +import * as strings from '../../../../base/common/strings.js'; +import './media/suggest.css'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition, IEditorMouseEvent } from '../../../browser/editorBrowser.js'; +import { EmbeddedCodeEditorWidget } from '../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IPosition } from '../../../common/core/position.js'; +import { SuggestWidgetStatus } from './suggestWidgetStatus.js'; +import '../../symbolIcons/browser/symbolIcons.js'; // The codicon symbol colors are defined here and must be loaded to get colors +import * as nls from '../../../../nls.js'; +import { IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js'; +import { activeContrastBorder, editorForeground, editorWidgetBackground, editorWidgetBorder, listFocusHighlightForeground, listHighlightForeground, quickInputListFocusBackground, quickInputListFocusForeground, quickInputListFocusIconForeground, registerColor, transparent } from '../../../../platform/theme/common/colorRegistry.js'; +import { isHighContrast } from '../../../../platform/theme/common/theme.js'; +import { IColorTheme, IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { CompletionModel } from './completionModel.js'; +import { ResizableHTMLElement } from '../../../../base/browser/ui/resizable/resizable.js'; +import { CompletionItem, Context as SuggestContext, suggestWidgetStatusbarMenu } from './suggest.js'; +import { canExpandCompletionItem, SuggestDetailsOverlay, SuggestDetailsWidget } from './suggestWidgetDetails.js'; +import { getAriaId, ItemRenderer } from './suggestWidgetRenderer.js'; +import { getListStyles } from '../../../../platform/theme/browser/defaultStyles.js'; +import { status } from '../../../../base/browser/ui/aria/aria.js'; /** * Suggest widget colors */ -registerColor('editorSuggestWidget.background', { dark: editorWidgetBackground, light: editorWidgetBackground, hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, nls.localize('editorSuggestWidgetBackground', 'Background color of the suggest widget.')); -registerColor('editorSuggestWidget.border', { dark: editorWidgetBorder, light: editorWidgetBorder, hcDark: editorWidgetBorder, hcLight: editorWidgetBorder }, nls.localize('editorSuggestWidgetBorder', 'Border color of the suggest widget.')); -const editorSuggestWidgetForeground = registerColor('editorSuggestWidget.foreground', { dark: editorForeground, light: editorForeground, hcDark: editorForeground, hcLight: editorForeground }, nls.localize('editorSuggestWidgetForeground', 'Foreground color of the suggest widget.')); -registerColor('editorSuggestWidget.selectedForeground', { dark: quickInputListFocusForeground, light: quickInputListFocusForeground, hcDark: quickInputListFocusForeground, hcLight: quickInputListFocusForeground }, nls.localize('editorSuggestWidgetSelectedForeground', 'Foreground color of the selected entry in the suggest widget.')); -registerColor('editorSuggestWidget.selectedIconForeground', { dark: quickInputListFocusIconForeground, light: quickInputListFocusIconForeground, hcDark: quickInputListFocusIconForeground, hcLight: quickInputListFocusIconForeground }, nls.localize('editorSuggestWidgetSelectedIconForeground', 'Icon foreground color of the selected entry in the suggest widget.')); -export const editorSuggestWidgetSelectedBackground = registerColor('editorSuggestWidget.selectedBackground', { dark: quickInputListFocusBackground, light: quickInputListFocusBackground, hcDark: quickInputListFocusBackground, hcLight: quickInputListFocusBackground }, nls.localize('editorSuggestWidgetSelectedBackground', 'Background color of the selected entry in the suggest widget.')); -registerColor('editorSuggestWidget.highlightForeground', { dark: listHighlightForeground, light: listHighlightForeground, hcDark: listHighlightForeground, hcLight: listHighlightForeground }, nls.localize('editorSuggestWidgetHighlightForeground', 'Color of the match highlights in the suggest widget.')); -registerColor('editorSuggestWidget.focusHighlightForeground', { dark: listFocusHighlightForeground, light: listFocusHighlightForeground, hcDark: listFocusHighlightForeground, hcLight: listFocusHighlightForeground }, nls.localize('editorSuggestWidgetFocusHighlightForeground', 'Color of the match highlights in the suggest widget when an item is focused.')); -registerColor('editorSuggestWidgetStatus.foreground', { dark: transparent(editorSuggestWidgetForeground, .5), light: transparent(editorSuggestWidgetForeground, .5), hcDark: transparent(editorSuggestWidgetForeground, .5), hcLight: transparent(editorSuggestWidgetForeground, .5) }, nls.localize('editorSuggestWidgetStatusForeground', 'Foreground color of the suggest widget status.')); +registerColor('editorSuggestWidget.background', editorWidgetBackground, nls.localize('editorSuggestWidgetBackground', 'Background color of the suggest widget.')); +registerColor('editorSuggestWidget.border', editorWidgetBorder, nls.localize('editorSuggestWidgetBorder', 'Border color of the suggest widget.')); +const editorSuggestWidgetForeground = registerColor('editorSuggestWidget.foreground', editorForeground, nls.localize('editorSuggestWidgetForeground', 'Foreground color of the suggest widget.')); +registerColor('editorSuggestWidget.selectedForeground', quickInputListFocusForeground, nls.localize('editorSuggestWidgetSelectedForeground', 'Foreground color of the selected entry in the suggest widget.')); +registerColor('editorSuggestWidget.selectedIconForeground', quickInputListFocusIconForeground, nls.localize('editorSuggestWidgetSelectedIconForeground', 'Icon foreground color of the selected entry in the suggest widget.')); +export const editorSuggestWidgetSelectedBackground = registerColor('editorSuggestWidget.selectedBackground', quickInputListFocusBackground, nls.localize('editorSuggestWidgetSelectedBackground', 'Background color of the selected entry in the suggest widget.')); +registerColor('editorSuggestWidget.highlightForeground', listHighlightForeground, nls.localize('editorSuggestWidgetHighlightForeground', 'Color of the match highlights in the suggest widget.')); +registerColor('editorSuggestWidget.focusHighlightForeground', listFocusHighlightForeground, nls.localize('editorSuggestWidgetFocusHighlightForeground', 'Color of the match highlights in the suggest widget when an item is focused.')); +registerColor('editorSuggestWidgetStatus.foreground', transparent(editorSuggestWidgetForeground, .5), nls.localize('editorSuggestWidgetStatusForeground', 'Foreground color of the suggest widget status.')); const enum State { Hidden, @@ -55,7 +55,8 @@ const enum State { Empty, Open, Frozen, - Details + Details, + onDetailsKeyDown } export interface ISelectedSuggestion { @@ -210,7 +211,7 @@ export class SuggestWidget implements IDisposable { this._listElement = dom.append(this.element.domNode, dom.$('.tree')); const details = this._disposables.add(instantiationService.createInstance(SuggestDetailsWidget, this.editor)); - details.onDidClose(this.toggleDetails, this, this._disposables); + details.onDidClose(() => this.toggleDetails(), this, this._disposables); this._details = new SuggestDetailsOverlay(details, this.editor); const applyIconStyle = () => this.element.domNode.classList.toggle('no-icons', !this.editor.getOption(EditorOption.suggest).showIcons); @@ -366,6 +367,12 @@ export class SuggestWidget implements IDisposable { return; } + if (this._state === State.Details) { + // This can happen when focus is in the details-panel and when + // arrow keys are pressed to select next/prev items + this._setState(State.Open); + } + if (!e.elements.length) { if (this._currentSuggestionDetails) { this._currentSuggestionDetails.cancel(); @@ -398,7 +405,7 @@ export class SuggestWidget implements IDisposable { this._currentSuggestionDetails = createCancelablePromise(async token => { const loading = disposableTimeout(() => { if (this._isDetailsVisible()) { - this.showDetails(true); + this._showDetails(true, false); } }, 250); const sub = token.onCancellationRequested(() => loading.dispose()); @@ -422,7 +429,7 @@ export class SuggestWidget implements IDisposable { this._ignoreFocusEvents = false; if (this._isDetailsVisible()) { - this.showDetails(false); + this._showDetails(false, false); } else { this.element.domNode.classList.remove('docs-side'); } @@ -496,6 +503,7 @@ export class SuggestWidget implements IDisposable { dom.show(this._listElement, this._status.element); this._details.show(); this._show(); + this._details.widget.focus(); break; } } @@ -686,16 +694,20 @@ export class SuggestWidget implements IDisposable { toggleDetailsFocus(): void { if (this._state === State.Details) { + // Should return the focus to the list item. + this._list.setFocus(this._list.getFocus()); this._setState(State.Open); - this._details.widget.domNode.classList.remove('focused'); - - } else if (this._state === State.Open && this._isDetailsVisible()) { + } else if (this._state === State.Open) { this._setState(State.Details); - this._details.widget.domNode.classList.add('focused'); + if (!this._isDetailsVisible()) { + this.toggleDetails(true); + } else { + this._details.widget.focus(); + } } } - toggleDetails(): void { + toggleDetails(focused: boolean = false): void { if (this._isDetailsVisible()) { // hide details widget this._pendingShowDetails.clear(); @@ -708,14 +720,15 @@ export class SuggestWidget implements IDisposable { // show details widget (iff possible) this._ctxSuggestWidgetDetailsVisible.set(true); this._setDetailsVisible(true); - this.showDetails(false); + this._showDetails(false, focused); } } - showDetails(loading: boolean): void { + private _showDetails(loading: boolean, focused: boolean): void { this._pendingShowDetails.value = dom.runAtThisOrScheduleAtNextAnimationFrame(dom.getWindow(this.element.domNode), () => { this._pendingShowDetails.clear(); this._details.show(); + let didFocusDetails = false; if (loading) { this._details.widget.renderLoading(); } else { @@ -724,10 +737,16 @@ export class SuggestWidget implements IDisposable { if (!this._details.widget.isEmpty) { this._positionDetails(); this.element.domNode.classList.add('shows-details'); + if (focused) { + this._details.widget.focus(); + didFocusDetails = true; + } } else { this._details.hide(); } - this.editor.focus(); + if (!didFocusDetails) { + this.editor.focus(); + } }); } @@ -737,7 +756,7 @@ export class SuggestWidget implements IDisposable { if (!this._isDetailsVisible()) { this.toggleDetails(); } else { - this.showDetails(false); + this._showDetails(false, false); } } } diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.ts b/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.ts index 5d2a5fbf282..22f29a981c5 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { Emitter, Event } from 'vs/base/common/event'; -import { MarkdownString } from 'vs/base/common/htmlContent'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { MarkdownRenderer } from 'vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ResizableHTMLElement } from 'vs/base/browser/ui/resizable/resizable'; -import * as nls from 'vs/nls'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { CompletionItem } from './suggest'; +import * as dom from '../../../../base/browser/dom.js'; +import { DomScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { MarkdownString } from '../../../../base/common/htmlContent.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { MarkdownRenderer } from '../../../browser/widget/markdownRenderer/browser/markdownRenderer.js'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { ResizableHTMLElement } from '../../../../base/browser/ui/resizable/resizable.js'; +import * as nls from '../../../../nls.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { CompletionItem } from './suggest.js'; export function canExpandCompletionItem(item: CompletionItem | undefined): boolean { return !!item && Boolean(item.completion.documentation || item.completion.detail && item.completion.detail !== item.completion.label); @@ -65,6 +65,8 @@ export class SuggestDetailsWidget { this._header = dom.append(this._body, dom.$('.header')); this._close = dom.append(this._header, dom.$('span' + ThemeIcon.asCSSSelector(Codicon.close))); this._close.title = nls.localize('details.close', "Close"); + this._close.role = 'button'; + this._close.tabIndex = -1; this._type = dom.append(this._header, dom.$('p.type')); this._docs = dom.append(this._body, dom.$('p.docs')); @@ -254,6 +256,10 @@ export class SuggestDetailsWidget { get borderWidth() { return this._borderWidth; } + + focus() { + this.domNode.focus(); + } } interface TopLeftPosition { diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.ts b/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.ts index 75c44777e22..24fb6d3106f 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { $, append, hide, show } from 'vs/base/browser/dom'; -import { IconLabel, IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; -import { IListRenderer } from 'vs/base/browser/ui/list/list'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { Emitter, Event } from 'vs/base/common/event'; -import { createMatches } from 'vs/base/common/filters'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { CompletionItemKind, CompletionItemKinds, CompletionItemTag } from 'vs/editor/common/languages'; -import { getIconClasses } from 'vs/editor/common/services/getIconClasses'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import * as nls from 'vs/nls'; -import { FileKind } from 'vs/platform/files/common/files'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { CompletionItem } from './suggest'; -import { canExpandCompletionItem } from './suggestWidgetDetails'; +import { $, append, hide, show } from '../../../../base/browser/dom.js'; +import { IconLabel, IIconLabelValueOptions } from '../../../../base/browser/ui/iconLabel/iconLabel.js'; +import { IListRenderer } from '../../../../base/browser/ui/list/list.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { createMatches } from '../../../../base/common/filters.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { CompletionItemKind, CompletionItemKinds, CompletionItemTag } from '../../../common/languages.js'; +import { getIconClasses } from '../../../common/services/getIconClasses.js'; +import { IModelService } from '../../../common/services/model.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import * as nls from '../../../../nls.js'; +import { FileKind } from '../../../../platform/files/common/files.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { CompletionItem } from './suggest.js'; +import { canExpandCompletionItem } from './suggestWidgetDetails.js'; export function getAriaId(index: number): string { return `suggest-aria-id:${index}`; diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidgetStatus.ts b/src/vs/editor/contrib/suggest/browser/suggestWidgetStatus.ts index 4a1df5b9ce8..3714840e0f0 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidgetStatus.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidgetStatus.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { ActionBar, IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar'; -import { IAction } from 'vs/base/common/actions'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { TextOnlyMenuEntryActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import * as dom from '../../../../base/browser/dom.js'; +import { ActionBar, IActionViewItemProvider } from '../../../../base/browser/ui/actionbar/actionbar.js'; +import { IAction } from '../../../../base/common/actions.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { TextOnlyMenuEntryActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { IMenuService, MenuId, MenuItemAction } from '../../../../platform/actions/common/actions.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; export class SuggestWidgetStatus { diff --git a/src/vs/editor/contrib/suggest/browser/wordContextKey.ts b/src/vs/editor/contrib/suggest/browser/wordContextKey.ts index ae8fd6e1a2d..901b440d8a5 100644 --- a/src/vs/editor/contrib/suggest/browser/wordContextKey.ts +++ b/src/vs/editor/contrib/suggest/browser/wordContextKey.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; export class WordContextKey { diff --git a/src/vs/editor/contrib/suggest/browser/wordDistance.ts b/src/vs/editor/contrib/suggest/browser/wordDistance.ts index 610e8bfb607..3c992c6d5ed 100644 --- a/src/vs/editor/contrib/suggest/browser/wordDistance.ts +++ b/src/vs/editor/contrib/suggest/browser/wordDistance.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { binarySearch, isFalsyOrEmpty } from 'vs/base/common/arrays'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IPosition } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { CompletionItem, CompletionItemKind } from 'vs/editor/common/languages'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { BracketSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/browser/bracketSelections'; +import { binarySearch, isFalsyOrEmpty } from '../../../../base/common/arrays.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IPosition } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { CompletionItem, CompletionItemKind } from '../../../common/languages.js'; +import { IEditorWorkerService } from '../../../common/services/editorWorker.js'; +import { BracketSelectionRangeProvider } from '../../smartSelect/browser/bracketSelections.js'; export abstract class WordDistance { diff --git a/src/vs/editor/contrib/suggest/test/browser/completionModel.test.ts b/src/vs/editor/contrib/suggest/test/browser/completionModel.test.ts index 823d6865a84..79b58979fe5 100644 --- a/src/vs/editor/contrib/suggest/test/browser/completionModel.test.ts +++ b/src/vs/editor/contrib/suggest/test/browser/completionModel.test.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EditorOptions, InternalSuggestOptions } from 'vs/editor/common/config/editorOptions'; -import { IPosition } from 'vs/editor/common/core/position'; -import * as languages from 'vs/editor/common/languages'; -import { CompletionModel } from 'vs/editor/contrib/suggest/browser/completionModel'; -import { CompletionItem, getSuggestionComparator, SnippetSortOrder } from 'vs/editor/contrib/suggest/browser/suggest'; -import { WordDistance } from 'vs/editor/contrib/suggest/browser/wordDistance'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { EditorOptions, InternalSuggestOptions } from '../../../../common/config/editorOptions.js'; +import { IPosition } from '../../../../common/core/position.js'; +import * as languages from '../../../../common/languages.js'; +import { CompletionModel } from '../../browser/completionModel.js'; +import { CompletionItem, getSuggestionComparator, SnippetSortOrder } from '../../browser/suggest.js'; +import { WordDistance } from '../../browser/wordDistance.js'; export function createSuggestItem(label: string | languages.CompletionItemLabel, overwriteBefore: number, kind = languages.CompletionItemKind.Property, incomplete: boolean = false, position: IPosition = { lineNumber: 1, column: 1 }, sortText?: string, filterText?: string): CompletionItem { const suggestion: languages.CompletionItem = { diff --git a/src/vs/editor/contrib/suggest/test/browser/suggest.test.ts b/src/vs/editor/contrib/suggest/test/browser/suggest.test.ts index b2e9fc03577..3b90caf5301 100644 --- a/src/vs/editor/contrib/suggest/test/browser/suggest.test.ts +++ b/src/vs/editor/contrib/suggest/test/browser/suggest.test.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { CompletionItemKind, CompletionItemProvider } from 'vs/editor/common/languages'; -import { CompletionOptions, provideSuggestionItems, SnippetSortOrder } from 'vs/editor/contrib/suggest/browser/suggest'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { IDisposable } from '../../../../../base/common/lifecycle.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { CompletionItemKind, CompletionItemProvider } from '../../../../common/languages.js'; +import { CompletionOptions, provideSuggestionItems, SnippetSortOrder } from '../../browser/suggest.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { LanguageFeatureRegistry } from '../../../../common/languageFeatureRegistry.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; suite('Suggest', function () { diff --git a/src/vs/editor/contrib/suggest/test/browser/suggestController.test.ts b/src/vs/editor/contrib/suggest/test/browser/suggestController.test.ts index 64123de47db..7f83d7ecbcc 100644 --- a/src/vs/editor/contrib/suggest/test/browser/suggestController.test.ts +++ b/src/vs/editor/contrib/suggest/test/browser/suggestController.test.ts @@ -4,35 +4,35 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { timeout } from 'vs/base/common/async'; -import { Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { CompletionItemInsertTextRule, CompletionItemKind } from 'vs/editor/common/languages'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; -import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController'; -import { ISuggestMemoryService } from 'vs/editor/contrib/suggest/browser/suggestMemory'; -import { createTestCodeEditor, ITestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { IMenu, IMenuService } from 'vs/platform/actions/common/actions'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { MockKeybindingService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { InMemoryStorageService, IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { DeleteLinesAction } from 'vs/editor/contrib/linesOperations/browser/linesOperations'; +import { timeout } from '../../../../../base/common/async.js'; +import { Event } from '../../../../../base/common/event.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { CompletionItemInsertTextRule, CompletionItemKind } from '../../../../common/languages.js'; +import { IEditorWorkerService } from '../../../../common/services/editorWorker.js'; +import { SnippetController2 } from '../../../snippet/browser/snippetController2.js'; +import { SuggestController } from '../../browser/suggestController.js'; +import { ISuggestMemoryService } from '../../browser/suggestMemory.js'; +import { createTestCodeEditor, ITestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { IMenu, IMenuService } from '../../../../../platform/actions/common/actions.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { MockKeybindingService } from '../../../../../platform/keybinding/test/common/mockKeybindingService.js'; +import { ILabelService } from '../../../../../platform/label/common/label.js'; +import { ILogService, NullLogService } from '../../../../../platform/log/common/log.js'; +import { InMemoryStorageService, IStorageService } from '../../../../../platform/storage/common/storage.js'; +import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js'; +import { NullTelemetryService } from '../../../../../platform/telemetry/common/telemetryUtils.js'; +import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js'; +import { LanguageFeaturesService } from '../../../../common/services/languageFeaturesService.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { IEnvironmentService } from '../../../../../platform/environment/common/environment.js'; +import { DeleteLinesAction } from '../../../linesOperations/browser/linesOperations.js'; suite('SuggestController', function () { diff --git a/src/vs/editor/contrib/suggest/test/browser/suggestInlineCompletions.test.ts b/src/vs/editor/contrib/suggest/test/browser/suggestInlineCompletions.test.ts index 91d42374b1f..ba843af4abb 100644 --- a/src/vs/editor/contrib/suggest/test/browser/suggestInlineCompletions.test.ts +++ b/src/vs/editor/contrib/suggest/test/browser/suggestInlineCompletions.test.ts @@ -4,23 +4,23 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { CompletionContext, CompletionItem, CompletionItemKind, CompletionItemProvider, CompletionList, InlineCompletionTriggerKind, ProviderResult } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { SuggestInlineCompletions } from 'vs/editor/contrib/suggest/browser/suggestInlineCompletions'; -import { ISuggestMemoryService } from 'vs/editor/contrib/suggest/browser/suggestMemory'; -import { createCodeEditorServices, instantiateTestCodeEditor, ITestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; +import { CancellationToken } from '../../../../../base/common/cancellation.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { CompletionContext, CompletionItem, CompletionItemKind, CompletionItemProvider, CompletionList, InlineCompletionTriggerKind, ProviderResult } from '../../../../common/languages.js'; +import { ITextModel } from '../../../../common/model.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { SuggestInlineCompletions } from '../../browser/suggestInlineCompletions.js'; +import { ISuggestMemoryService } from '../../browser/suggestMemory.js'; +import { createCodeEditorServices, instantiateTestCodeEditor, ITestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { TestInstantiationService } from '../../../../../platform/instantiation/test/common/instantiationServiceMock.js'; suite('Suggest Inline Completions', function () { diff --git a/src/vs/editor/contrib/suggest/test/browser/suggestMemory.test.ts b/src/vs/editor/contrib/suggest/test/browser/suggestMemory.test.ts index 57d0d030d48..053a0fa5e99 100644 --- a/src/vs/editor/contrib/suggest/test/browser/suggestMemory.test.ts +++ b/src/vs/editor/contrib/suggest/test/browser/suggestMemory.test.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IPosition } from 'vs/editor/common/core/position'; -import { ITextModel } from 'vs/editor/common/model'; -import { CompletionItem } from 'vs/editor/contrib/suggest/browser/suggest'; -import { LRUMemory, Memory, NoMemory, PrefixMemory } from 'vs/editor/contrib/suggest/browser/suggestMemory'; -import { createSuggestItem } from 'vs/editor/contrib/suggest/test/browser/completionModel.test'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { IPosition } from '../../../../common/core/position.js'; +import { ITextModel } from '../../../../common/model.js'; +import { CompletionItem } from '../../browser/suggest.js'; +import { LRUMemory, Memory, NoMemory, PrefixMemory } from '../../browser/suggestMemory.js'; +import { createSuggestItem } from './completionModel.test.js'; +import { createTextModel } from '../../../../test/common/testTextModel.js'; suite('SuggestMemories', function () { diff --git a/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts b/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts index 5c673c0f355..51d159923bd 100644 --- a/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts +++ b/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts @@ -3,44 +3,44 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { CoreEditingCommands } from 'vs/editor/browser/coreCommands'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { Handler } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { CompletionItemKind, CompletionItemProvider, CompletionList, CompletionTriggerKind, EncodedTokenizationResult, IState, TokenizationRegistry } from 'vs/editor/common/languages'; -import { MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { NullState } from 'vs/editor/common/languages/nullTokenize'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; -import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController'; -import { ISuggestMemoryService } from 'vs/editor/contrib/suggest/browser/suggestMemory'; -import { LineContext, SuggestModel } from 'vs/editor/contrib/suggest/browser/suggestModel'; -import { ISelectedSuggestion } from 'vs/editor/contrib/suggest/browser/suggestWidget'; -import { createTestCodeEditor, ITestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { createModelServices, createTextModel, instantiateTextModel } from 'vs/editor/test/common/testTextModel'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { MockKeybindingService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { InMemoryStorageService, IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { getSnippetSuggestSupport, setSnippetSuggestSupport } from 'vs/editor/contrib/suggest/browser/suggest'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { Event } from '../../../../../base/common/event.js'; +import { Disposable, DisposableStore, toDisposable } from '../../../../../base/common/lifecycle.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { CoreEditingCommands } from '../../../../browser/coreCommands.js'; +import { EditOperation } from '../../../../common/core/editOperation.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { Handler } from '../../../../common/editorCommon.js'; +import { ITextModel } from '../../../../common/model.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { CompletionItemKind, CompletionItemProvider, CompletionList, CompletionTriggerKind, EncodedTokenizationResult, IState, TokenizationRegistry } from '../../../../common/languages.js'; +import { MetadataConsts } from '../../../../common/encodedTokenAttributes.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { NullState } from '../../../../common/languages/nullTokenize.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { SnippetController2 } from '../../../snippet/browser/snippetController2.js'; +import { SuggestController } from '../../browser/suggestController.js'; +import { ISuggestMemoryService } from '../../browser/suggestMemory.js'; +import { LineContext, SuggestModel } from '../../browser/suggestModel.js'; +import { ISelectedSuggestion } from '../../browser/suggestWidget.js'; +import { createTestCodeEditor, ITestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { createModelServices, createTextModel, instantiateTextModel } from '../../../../test/common/testTextModel.js'; +import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js'; +import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; +import { MockKeybindingService } from '../../../../../platform/keybinding/test/common/mockKeybindingService.js'; +import { ILabelService } from '../../../../../platform/label/common/label.js'; +import { InMemoryStorageService, IStorageService } from '../../../../../platform/storage/common/storage.js'; +import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js'; +import { NullTelemetryService } from '../../../../../platform/telemetry/common/telemetryUtils.js'; +import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js'; +import { LanguageFeaturesService } from '../../../../common/services/languageFeaturesService.js'; +import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js'; +import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; +import { getSnippetSuggestSupport, setSnippetSuggestSupport } from '../../browser/suggest.js'; +import { IEnvironmentService } from '../../../../../platform/environment/common/environment.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; function createMockEditor(model: TextModel, languageFeaturesService: ILanguageFeaturesService): ITestCodeEditor { diff --git a/src/vs/editor/contrib/suggest/test/browser/wordDistance.test.ts b/src/vs/editor/contrib/suggest/test/browser/wordDistance.test.ts index 15f238b1627..0057e3cf389 100644 --- a/src/vs/editor/contrib/suggest/test/browser/wordDistance.test.ts +++ b/src/vs/editor/contrib/suggest/test/browser/wordDistance.test.ts @@ -4,29 +4,28 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { IPosition } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { DEFAULT_WORD_REGEXP } from 'vs/editor/common/core/wordHelper'; -import * as languages from 'vs/editor/common/languages'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { EditorSimpleWorker } from 'vs/editor/common/services/editorSimpleWorker'; -import { EditorWorkerService } from 'vs/editor/browser/services/editorWorkerService'; -import { IEditorWorkerHost } from 'vs/editor/common/services/editorWorkerHost'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { CompletionItem } from 'vs/editor/contrib/suggest/browser/suggest'; -import { WordDistance } from 'vs/editor/contrib/suggest/browser/wordDistance'; -import { createCodeEditorServices, instantiateTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { instantiateTextModel } from 'vs/editor/test/common/testTextModel'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { Event } from '../../../../../base/common/event.js'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { mock } from '../../../../../base/test/common/mock.js'; +import { IPosition } from '../../../../common/core/position.js'; +import { IRange } from '../../../../common/core/range.js'; +import { DEFAULT_WORD_REGEXP } from '../../../../common/core/wordHelper.js'; +import * as languages from '../../../../common/languages.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { BaseEditorSimpleWorker } from '../../../../common/services/editorSimpleWorker.js'; +import { EditorWorkerService } from '../../../../browser/services/editorWorkerService.js'; +import { IModelService } from '../../../../common/services/model.js'; +import { ITextResourceConfigurationService } from '../../../../common/services/textResourceConfiguration.js'; +import { CompletionItem } from '../../browser/suggest.js'; +import { WordDistance } from '../../browser/wordDistance.js'; +import { createCodeEditorServices, instantiateTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { instantiateTextModel } from '../../../../test/common/testTextModel.js'; +import { TestLanguageConfigurationService } from '../../../../test/common/modes/testLanguageConfigurationService.js'; +import { NullLogService } from '../../../../../platform/log/common/log.js'; +import { LanguageFeaturesService } from '../../../../common/services/languageFeaturesService.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; suite('suggest, word distance', function () { @@ -63,20 +62,20 @@ suite('suggest, word distance', function () { const service = new class extends EditorWorkerService { - private _worker = new EditorSimpleWorker(new class extends mock() { }, null); + private _worker = new BaseEditorSimpleWorker(); constructor() { - super(modelService, new class extends mock() { }, new NullLogService(), new TestLanguageConfigurationService(), new LanguageFeaturesService()); - this._worker.acceptNewModel({ + super(null!, modelService, new class extends mock() { }, new NullLogService(), new TestLanguageConfigurationService(), new LanguageFeaturesService()); + this._worker.$acceptNewModel({ url: model.uri.toString(), lines: model.getLinesContent(), EOL: model.getEOL(), versionId: model.getVersionId() }); - model.onDidChangeContent(e => this._worker.acceptModelChanged(model.uri.toString(), e)); + model.onDidChangeContent(e => this._worker.$acceptModelChanged(model.uri.toString(), e)); } override computeWordRanges(resource: URI, range: IRange): Promise<{ [word: string]: IRange[] } | null> { - return this._worker.computeWordRanges(resource.toString(), range, DEFAULT_WORD_REGEXP.source, DEFAULT_WORD_REGEXP.flags); + return this._worker.$computeWordRanges(resource.toString(), range, DEFAULT_WORD_REGEXP.source, DEFAULT_WORD_REGEXP.flags); } }; diff --git a/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.ts b/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.ts index 64ccb1bc618..a2795f7541c 100644 --- a/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.ts +++ b/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.ts @@ -3,23 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./symbolIcons'; -import { localize } from 'vs/nls'; -import { foreground, registerColor } from 'vs/platform/theme/common/colorRegistry'; - -export const SYMBOL_ICON_ARRAY_FOREGROUND = registerColor('symbolIcon.arrayForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground, -}, localize('symbolIcon.arrayForeground', 'The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_BOOLEAN_FOREGROUND = registerColor('symbolIcon.booleanForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground, -}, localize('symbolIcon.booleanForeground', 'The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); +import './symbolIcons.css'; +import { localize } from '../../../../nls.js'; +import { foreground, registerColor } from '../../../../platform/theme/common/colorRegistry.js'; + +export const SYMBOL_ICON_ARRAY_FOREGROUND = registerColor('symbolIcon.arrayForeground', foreground, localize('symbolIcon.arrayForeground', 'The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_BOOLEAN_FOREGROUND = registerColor('symbolIcon.booleanForeground', foreground, localize('symbolIcon.booleanForeground', 'The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); export const SYMBOL_ICON_CLASS_FOREGROUND = registerColor('symbolIcon.classForeground', { dark: '#EE9D28', @@ -28,19 +18,9 @@ export const SYMBOL_ICON_CLASS_FOREGROUND = registerColor('symbolIcon.classForeg hcLight: '#D67E00' }, localize('symbolIcon.classForeground', 'The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -export const SYMBOL_ICON_COLOR_FOREGROUND = registerColor('symbolIcon.colorForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.colorForeground', 'The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); +export const SYMBOL_ICON_COLOR_FOREGROUND = registerColor('symbolIcon.colorForeground', foreground, localize('symbolIcon.colorForeground', 'The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -export const SYMBOL_ICON_CONSTANT_FOREGROUND = registerColor('symbolIcon.constantForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.constantForeground', 'The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); +export const SYMBOL_ICON_CONSTANT_FOREGROUND = registerColor('symbolIcon.constantForeground', foreground, localize('symbolIcon.constantForeground', 'The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); export const SYMBOL_ICON_CONSTRUCTOR_FOREGROUND = registerColor('symbolIcon.constructorForeground', { dark: '#B180D7', @@ -77,19 +57,9 @@ export const SYMBOL_ICON_FIELD_FOREGROUND = registerColor('symbolIcon.fieldForeg hcLight: '#007ACC' }, localize('symbolIcon.fieldForeground', 'The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -export const SYMBOL_ICON_FILE_FOREGROUND = registerColor('symbolIcon.fileForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.fileForeground', 'The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); +export const SYMBOL_ICON_FILE_FOREGROUND = registerColor('symbolIcon.fileForeground', foreground, localize('symbolIcon.fileForeground', 'The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -export const SYMBOL_ICON_FOLDER_FOREGROUND = registerColor('symbolIcon.folderForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.folderForeground', 'The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); +export const SYMBOL_ICON_FOLDER_FOREGROUND = registerColor('symbolIcon.folderForeground', foreground, localize('symbolIcon.folderForeground', 'The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); export const SYMBOL_ICON_FUNCTION_FOREGROUND = registerColor('symbolIcon.functionForeground', { dark: '#B180D7', @@ -105,19 +75,9 @@ export const SYMBOL_ICON_INTERFACE_FOREGROUND = registerColor('symbolIcon.interf hcLight: '#007ACC' }, localize('symbolIcon.interfaceForeground', 'The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -export const SYMBOL_ICON_KEY_FOREGROUND = registerColor('symbolIcon.keyForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.keyForeground', 'The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); +export const SYMBOL_ICON_KEY_FOREGROUND = registerColor('symbolIcon.keyForeground', foreground, localize('symbolIcon.keyForeground', 'The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -export const SYMBOL_ICON_KEYWORD_FOREGROUND = registerColor('symbolIcon.keywordForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.keywordForeground', 'The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); +export const SYMBOL_ICON_KEYWORD_FOREGROUND = registerColor('symbolIcon.keywordForeground', foreground, localize('symbolIcon.keywordForeground', 'The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); export const SYMBOL_ICON_METHOD_FOREGROUND = registerColor('symbolIcon.methodForeground', { dark: '#B180D7', @@ -126,110 +86,35 @@ export const SYMBOL_ICON_METHOD_FOREGROUND = registerColor('symbolIcon.methodFor hcLight: '#652D90' }, localize('symbolIcon.methodForeground', 'The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -export const SYMBOL_ICON_MODULE_FOREGROUND = registerColor('symbolIcon.moduleForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.moduleForeground', 'The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_NAMESPACE_FOREGROUND = registerColor('symbolIcon.namespaceForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.namespaceForeground', 'The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_NULL_FOREGROUND = registerColor('symbolIcon.nullForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.nullForeground', 'The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_NUMBER_FOREGROUND = registerColor('symbolIcon.numberForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.numberForeground', 'The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_OBJECT_FOREGROUND = registerColor('symbolIcon.objectForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.objectForeground', 'The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_OPERATOR_FOREGROUND = registerColor('symbolIcon.operatorForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.operatorForeground', 'The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_PACKAGE_FOREGROUND = registerColor('symbolIcon.packageForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.packageForeground', 'The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_PROPERTY_FOREGROUND = registerColor('symbolIcon.propertyForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.propertyForeground', 'The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_REFERENCE_FOREGROUND = registerColor('symbolIcon.referenceForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.referenceForeground', 'The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_SNIPPET_FOREGROUND = registerColor('symbolIcon.snippetForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.snippetForeground', 'The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_STRING_FOREGROUND = registerColor('symbolIcon.stringForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.stringForeground', 'The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_STRUCT_FOREGROUND = registerColor('symbolIcon.structForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground, -}, localize('symbolIcon.structForeground', 'The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_TEXT_FOREGROUND = registerColor('symbolIcon.textForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.textForeground', 'The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_TYPEPARAMETER_FOREGROUND = registerColor('symbolIcon.typeParameterForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.typeParameterForeground', 'The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -export const SYMBOL_ICON_UNIT_FOREGROUND = registerColor('symbolIcon.unitForeground', { - dark: foreground, - light: foreground, - hcDark: foreground, - hcLight: foreground -}, localize('symbolIcon.unitForeground', 'The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); +export const SYMBOL_ICON_MODULE_FOREGROUND = registerColor('symbolIcon.moduleForeground', foreground, localize('symbolIcon.moduleForeground', 'The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_NAMESPACE_FOREGROUND = registerColor('symbolIcon.namespaceForeground', foreground, localize('symbolIcon.namespaceForeground', 'The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_NULL_FOREGROUND = registerColor('symbolIcon.nullForeground', foreground, localize('symbolIcon.nullForeground', 'The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_NUMBER_FOREGROUND = registerColor('symbolIcon.numberForeground', foreground, localize('symbolIcon.numberForeground', 'The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_OBJECT_FOREGROUND = registerColor('symbolIcon.objectForeground', foreground, localize('symbolIcon.objectForeground', 'The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_OPERATOR_FOREGROUND = registerColor('symbolIcon.operatorForeground', foreground, localize('symbolIcon.operatorForeground', 'The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_PACKAGE_FOREGROUND = registerColor('symbolIcon.packageForeground', foreground, localize('symbolIcon.packageForeground', 'The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_PROPERTY_FOREGROUND = registerColor('symbolIcon.propertyForeground', foreground, localize('symbolIcon.propertyForeground', 'The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_REFERENCE_FOREGROUND = registerColor('symbolIcon.referenceForeground', foreground, localize('symbolIcon.referenceForeground', 'The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_SNIPPET_FOREGROUND = registerColor('symbolIcon.snippetForeground', foreground, localize('symbolIcon.snippetForeground', 'The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_STRING_FOREGROUND = registerColor('symbolIcon.stringForeground', foreground, localize('symbolIcon.stringForeground', 'The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_STRUCT_FOREGROUND = registerColor('symbolIcon.structForeground', foreground, localize('symbolIcon.structForeground', 'The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_TEXT_FOREGROUND = registerColor('symbolIcon.textForeground', foreground, localize('symbolIcon.textForeground', 'The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_TYPEPARAMETER_FOREGROUND = registerColor('symbolIcon.typeParameterForeground', foreground, localize('symbolIcon.typeParameterForeground', 'The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); + +export const SYMBOL_ICON_UNIT_FOREGROUND = registerColor('symbolIcon.unitForeground', foreground, localize('symbolIcon.unitForeground', 'The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); export const SYMBOL_ICON_VARIABLE_FOREGROUND = registerColor('symbolIcon.variableForeground', { dark: '#75BEFF', diff --git a/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.ts b/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.ts index 7578cd62f8e..a200bf817eb 100644 --- a/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.ts +++ b/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { alert } from 'vs/base/browser/ui/aria/aria'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { TabFocus } from 'vs/editor/browser/config/tabFocus'; -import * as nls from 'vs/nls'; -import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { alert } from '../../../../base/browser/ui/aria/aria.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { TabFocus } from '../../../browser/config/tabFocus.js'; +import * as nls from '../../../../nls.js'; +import { Action2, registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; export class ToggleTabFocusModeAction extends Action2 { diff --git a/src/vs/editor/contrib/tokenization/browser/tokenization.ts b/src/vs/editor/contrib/tokenization/browser/tokenization.ts index 800f950ad29..ba16ce46091 100644 --- a/src/vs/editor/contrib/tokenization/browser/tokenization.ts +++ b/src/vs/editor/contrib/tokenization/browser/tokenization.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { StopWatch } from 'vs/base/common/stopwatch'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import * as nls from 'vs/nls'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, registerEditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import * as nls from '../../../../nls.js'; class ForceRetokenizeAction extends EditorAction { constructor() { diff --git a/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.ts b/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.ts index b5a54c49f20..d96488677d9 100644 --- a/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.ts +++ b/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.ts @@ -2,18 +2,18 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./bannerController'; -import { $, append, clearNode } from 'vs/base/browser/dom'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { Action } from 'vs/base/common/actions'; -import { MarkdownString } from 'vs/base/common/htmlContent'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { MarkdownRenderer } from 'vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILinkDescriptor, Link } from 'vs/platform/opener/browser/link'; -import { widgetClose } from 'vs/platform/theme/common/iconRegistry'; -import { ThemeIcon } from 'vs/base/common/themables'; +import './bannerController.css'; +import { $, append, clearNode } from '../../../../base/browser/dom.js'; +import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js'; +import { Action } from '../../../../base/common/actions.js'; +import { MarkdownString } from '../../../../base/common/htmlContent.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { MarkdownRenderer } from '../../../browser/widget/markdownRenderer/browser/markdownRenderer.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ILinkDescriptor, Link } from '../../../../platform/opener/browser/link.js'; +import { widgetClose } from '../../../../platform/theme/common/iconRegistry.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; const BANNER_ELEMENT_HEIGHT = 26; diff --git a/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts b/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts index f44fc76e0bd..d3747c2cdeb 100644 --- a/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts +++ b/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts @@ -3,35 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { CharCode } from 'vs/base/common/charCode'; -import { Codicon } from 'vs/base/common/codicons'; -import { MarkdownString } from 'vs/base/common/htmlContent'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import * as platform from 'vs/base/common/platform'; -import { InvisibleCharacters, isBasicASCII } from 'vs/base/common/strings'; -import 'vs/css!./unicodeHighlighter'; -import { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { InUntrustedWorkspace, inUntrustedWorkspace, EditorOption, InternalUnicodeHighlightOptions, unicodeHighlightConfigKeys } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { IModelDecoration, IModelDeltaDecoration, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { UnicodeHighlighterOptions, UnicodeHighlighterReason, UnicodeHighlighterReasonKind, UnicodeTextModelHighlighter } from 'vs/editor/common/services/unicodeTextModelHighlighter'; -import { IEditorWorkerService, IUnicodeHighlightsResult } from 'vs/editor/common/services/editorWorker'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { isModelDecorationInComment, isModelDecorationInString, isModelDecorationVisible } from 'vs/editor/common/viewModel/viewModelDecorations'; -import { HoverAnchor, HoverAnchorType, HoverParticipantRegistry, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart } from 'vs/editor/contrib/hover/browser/hoverTypes'; -import { MarkdownHover, renderMarkdownHovers } from 'vs/editor/contrib/hover/browser/markdownHoverParticipant'; -import { BannerController } from 'vs/editor/contrib/unicodeHighlighter/browser/bannerController'; -import * as nls from 'vs/nls'; -import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { IWorkspaceTrustManagementService } from 'vs/platform/workspace/common/workspaceTrust'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { MarkdownString } from '../../../../base/common/htmlContent.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import * as platform from '../../../../base/common/platform.js'; +import { InvisibleCharacters, isBasicASCII } from '../../../../base/common/strings.js'; +import './unicodeHighlighter.css'; +import { IActiveCodeEditor, ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, registerEditorAction, registerEditorContribution, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { InUntrustedWorkspace, inUntrustedWorkspace, EditorOption, InternalUnicodeHighlightOptions, unicodeHighlightConfigKeys } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { IModelDecoration, IModelDeltaDecoration, ITextModel, TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { UnicodeHighlighterOptions, UnicodeHighlighterReason, UnicodeHighlighterReasonKind, UnicodeTextModelHighlighter } from '../../../common/services/unicodeTextModelHighlighter.js'; +import { IEditorWorkerService, IUnicodeHighlightsResult } from '../../../common/services/editorWorker.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { isModelDecorationInComment, isModelDecorationInString, isModelDecorationVisible } from '../../../common/viewModel/viewModelDecorations.js'; +import { HoverAnchor, HoverAnchorType, HoverParticipantRegistry, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts } from '../../hover/browser/hoverTypes.js'; +import { MarkdownHover, renderMarkdownHovers } from '../../hover/browser/markdownHoverParticipant.js'; +import { BannerController } from './bannerController.js'; +import * as nls from '../../../../nls.js'; +import { ConfigurationTarget, IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import { IQuickInputService, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; +import { IWorkspaceTrustManagementService } from '../../../../platform/workspace/common/workspaceTrust.js'; export const warningIcon = registerIcon('extensions-warning-message', Codicon.warning, nls.localize('warningIcon', 'Icon shown with a warning message in the extensions editor.')); @@ -506,9 +506,13 @@ export class UnicodeHighlighterHoverParticipant implements IEditorHoverParticipa return result; } - public renderHoverParts(context: IEditorHoverRenderContext, hoverParts: MarkdownHover[]): IDisposable { + public renderHoverParts(context: IEditorHoverRenderContext, hoverParts: MarkdownHover[]): IRenderedHoverParts { return renderMarkdownHovers(context, hoverParts, this._editor, this._languageService, this._openerService); } + + public getAccessibleContent(hoverPart: MarkdownHover): string { + return hoverPart.contents.map(c => c.value).join('\n'); + } } function codePointToHex(codePoint: number): string { diff --git a/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.ts b/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.ts index 98818af898c..e4a24035103 100644 --- a/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.ts +++ b/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { basename } from 'vs/base/common/resources'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import * as nls from 'vs/nls'; -import { IConfirmationResult, IDialogService } from 'vs/platform/dialogs/common/dialogs'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { basename } from '../../../../base/common/resources.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; +import * as nls from '../../../../nls.js'; +import { IConfirmationResult, IDialogService } from '../../../../platform/dialogs/common/dialogs.js'; const ignoreUnusualLineTerminators = 'ignoreUnusualLineTerminators'; diff --git a/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.ts b/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.ts index b3825b0f05d..67744514340 100644 --- a/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.ts +++ b/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./highlightDecorations'; -import { MinimapPosition, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { DocumentHighlightKind } from 'vs/editor/common/languages'; -import * as nls from 'vs/nls'; -import { activeContrastBorder, editorSelectionHighlight, minimapSelectionOccurrenceHighlight, overviewRulerSelectionHighlightForeground, registerColor } from 'vs/platform/theme/common/colorRegistry'; -import { registerThemingParticipant, themeColorFromId } from 'vs/platform/theme/common/themeService'; +import './highlightDecorations.css'; +import { MinimapPosition, OverviewRulerLane, TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; +import { DocumentHighlightKind } from '../../../common/languages.js'; +import * as nls from '../../../../nls.js'; +import { activeContrastBorder, editorSelectionHighlight, minimapSelectionOccurrenceHighlight, overviewRulerSelectionHighlightForeground, registerColor } from '../../../../platform/theme/common/colorRegistry.js'; +import { registerThemingParticipant, themeColorFromId } from '../../../../platform/theme/common/themeService.js'; const wordHighlightBackground = registerColor('editor.wordHighlightBackground', { dark: '#575757B8', light: '#57575740', hcDark: null, hcLight: null }, nls.localize('wordHighlight', 'Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations.'), true); registerColor('editor.wordHighlightStrongBackground', { dark: '#004972B8', light: '#0e639c40', hcDark: null, hcLight: null }, nls.localize('wordHighlightStrong', 'Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations.'), true); -registerColor('editor.wordHighlightTextBackground', { light: wordHighlightBackground, dark: wordHighlightBackground, hcDark: wordHighlightBackground, hcLight: wordHighlightBackground }, nls.localize('wordHighlightText', 'Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations.'), true); +registerColor('editor.wordHighlightTextBackground', wordHighlightBackground, nls.localize('wordHighlightText', 'Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations.'), true); const wordHighlightBorder = registerColor('editor.wordHighlightBorder', { light: null, dark: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize('wordHighlightBorder', 'Border color of a symbol during read-access, like reading a variable.')); registerColor('editor.wordHighlightStrongBorder', { light: null, dark: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize('wordHighlightStrongBorder', 'Border color of a symbol during write-access, like writing to a variable.')); -registerColor('editor.wordHighlightTextBorder', { light: wordHighlightBorder, dark: wordHighlightBorder, hcDark: wordHighlightBorder, hcLight: wordHighlightBorder }, nls.localize('wordHighlightTextBorder', "Border color of a textual occurrence for a symbol.")); -const overviewRulerWordHighlightForeground = registerColor('editorOverviewRuler.wordHighlightForeground', { dark: '#A0A0A0CC', light: '#A0A0A0CC', hcDark: '#A0A0A0CC', hcLight: '#A0A0A0CC' }, nls.localize('overviewRulerWordHighlightForeground', 'Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations.'), true); -const overviewRulerWordHighlightStrongForeground = registerColor('editorOverviewRuler.wordHighlightStrongForeground', { dark: '#C0A0C0CC', light: '#C0A0C0CC', hcDark: '#C0A0C0CC', hcLight: '#C0A0C0CC' }, nls.localize('overviewRulerWordHighlightStrongForeground', 'Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations.'), true); -const overviewRulerWordHighlightTextForeground = registerColor('editorOverviewRuler.wordHighlightTextForeground', { dark: overviewRulerSelectionHighlightForeground, light: overviewRulerSelectionHighlightForeground, hcDark: overviewRulerSelectionHighlightForeground, hcLight: overviewRulerSelectionHighlightForeground }, nls.localize('overviewRulerWordHighlightTextForeground', 'Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations.'), true); +registerColor('editor.wordHighlightTextBorder', wordHighlightBorder, nls.localize('wordHighlightTextBorder', "Border color of a textual occurrence for a symbol.")); +const overviewRulerWordHighlightForeground = registerColor('editorOverviewRuler.wordHighlightForeground', '#A0A0A0CC', nls.localize('overviewRulerWordHighlightForeground', 'Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations.'), true); +const overviewRulerWordHighlightStrongForeground = registerColor('editorOverviewRuler.wordHighlightStrongForeground', '#C0A0C0CC', nls.localize('overviewRulerWordHighlightStrongForeground', 'Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations.'), true); +const overviewRulerWordHighlightTextForeground = registerColor('editorOverviewRuler.wordHighlightTextForeground', overviewRulerSelectionHighlightForeground, nls.localize('overviewRulerWordHighlightTextForeground', 'Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations.'), true); const _WRITE_OPTIONS = ModelDecorationOptions.register({ description: 'word-highlight-strong', diff --git a/src/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.ts b/src/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.ts index 1d7a65695d3..075b2d6c41b 100644 --- a/src/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.ts +++ b/src/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.ts @@ -3,21 +3,44 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/core/wordHelper'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { DocumentHighlight, DocumentHighlightKind, MultiDocumentHighlightProvider, ProviderResult } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { Position } from 'vs/editor/common/core/position'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ResourceMap } from 'vs/base/common/map'; -import { LanguageFilter } from 'vs/editor/common/languageSelector'; +import { USUAL_WORD_SEPARATORS } from '../../../common/core/wordHelper.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { DocumentHighlight, DocumentHighlightKind, DocumentHighlightProvider, MultiDocumentHighlightProvider, ProviderResult } from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { Position } from '../../../common/core/position.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ResourceMap } from '../../../../base/common/map.js'; +import { LanguageFilter } from '../../../common/languageSelector.js'; -class TextualDocumentHighlightProvider implements MultiDocumentHighlightProvider { +class TextualDocumentHighlightProvider implements DocumentHighlightProvider, MultiDocumentHighlightProvider { selector: LanguageFilter = { language: '*' }; + provideDocumentHighlights(model: ITextModel, position: Position, token: CancellationToken): ProviderResult { + const result: DocumentHighlight[] = []; + + const word = model.getWordAtPosition({ + lineNumber: position.lineNumber, + column: position.column + }); + + if (!word) { + return Promise.resolve(result); + } + + if (model.isDisposed()) { + return; + } + + const matches = model.findMatches(word.word, true, false, true, USUAL_WORD_SEPARATORS, false); + return matches.map(m => ({ + range: m.range, + kind: DocumentHighlightKind.Text + })); + } + provideMultiDocumentHighlights(primaryModel: ITextModel, position: Position, otherModels: ITextModel[], token: CancellationToken): ProviderResult> { const result = new ResourceMap(); @@ -57,7 +80,7 @@ export class TextualMultiDocumentHighlightFeature extends Disposable { @ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService, ) { super(); - + this._register(languageFeaturesService.documentHighlightProvider.register('*', new TextualDocumentHighlightProvider())); this._register(languageFeaturesService.multiDocumentHighlightProvider.register('*', new TextualDocumentHighlightProvider())); } } diff --git a/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts b/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts index cae43742902..03586169ccf 100644 --- a/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts +++ b/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts @@ -3,38 +3,40 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import * as arrays from 'vs/base/common/arrays'; -import { alert } from 'vs/base/browser/ui/aria/aria'; -import { CancelablePromise, createCancelablePromise, first, timeout } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { IActiveCodeEditor, ICodeEditor, isDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorContributionInstantiation, IActionOptions, registerEditorAction, registerEditorContribution, registerModelAndPositionCommand } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IWordAtPosition } from 'vs/editor/common/core/wordHelper'; -import { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { IDiffEditor, IEditorContribution, IEditorDecorationsCollection } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; -import { DocumentHighlight, DocumentHighlightKind, DocumentHighlightProvider, MultiDocumentHighlightProvider } from 'vs/editor/common/languages'; -import { IModelDeltaDecoration, ITextModel, shouldSynchronizeModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { getHighlightDecorationOptions } from 'vs/editor/contrib/wordHighlighter/browser/highlightDecorations'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { Schemas } from 'vs/base/common/network'; -import { ResourceMap } from 'vs/base/common/map'; -import { score } from 'vs/editor/common/languageSelector'; -// import { TextualMultiDocumentHighlightFeature } from 'vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider'; -// import { registerEditorFeature } from 'vs/editor/common/editorFeatures'; +import * as nls from '../../../../nls.js'; +import { alert } from '../../../../base/browser/ui/aria/aria.js'; +import { CancelablePromise, createCancelablePromise, Delayer, first } from '../../../../base/common/async.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { onUnexpectedError, onUnexpectedExternalError } from '../../../../base/common/errors.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ResourceMap } from '../../../../base/common/map.js'; +import { matchesScheme, Schemas } from '../../../../base/common/network.js'; +import { isEqual } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IActiveCodeEditor, ICodeEditor, isDiffEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorContributionInstantiation, IActionOptions, registerEditorAction, registerEditorContribution, registerModelAndPositionCommand } from '../../../browser/editorExtensions.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { IWordAtPosition } from '../../../common/core/wordHelper.js'; +import { CursorChangeReason, ICursorPositionChangedEvent } from '../../../common/cursorEvents.js'; +import { IDiffEditor, IEditorContribution, IEditorDecorationsCollection } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { registerEditorFeature } from '../../../common/editorFeatures.js'; +import { LanguageFeatureRegistry } from '../../../common/languageFeatureRegistry.js'; +import { DocumentHighlight, DocumentHighlightProvider, MultiDocumentHighlightProvider } from '../../../common/languages.js'; +import { score } from '../../../common/languageSelector.js'; +import { IModelDeltaDecoration, ITextModel, shouldSynchronizeModel } from '../../../common/model.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; +import { ITextModelService } from '../../../common/services/resolverService.js'; +import { getHighlightDecorationOptions } from './highlightDecorations.js'; +import { TextualMultiDocumentHighlightFeature } from './textualHighlightProvider.js'; const ctxHasWordHighlights = new RawContextKey('hasWordHighlights', false); @@ -43,11 +45,12 @@ export function getOccurrencesAtPosition(registry: LanguageFeatureRegistry(orderedByScore.map(provider => () => { return Promise.resolve(provider.provideDocumentHighlights(model, position, token)) .then(undefined, onUnexpectedExternalError); - }), arrays.isNonEmptyArray).then(result => { + }), (result): result is DocumentHighlight[] => result !== undefined && result !== null).then(result => { if (result) { const map = new ResourceMap(); map.set(model.uri, result); @@ -57,22 +60,22 @@ export function getOccurrencesAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, wordSeparators: string, token: CancellationToken, otherModels: ITextModel[]): Promise | null | undefined> { +export function getOccurrencesAcrossMultipleModels(registry: LanguageFeatureRegistry, model: ITextModel, position: Position, token: CancellationToken, otherModels: ITextModel[]): Promise | null | undefined> { const orderedByScore = registry.ordered(model); // in order of score ask the occurrences provider // until someone response with a good result - // (good = none empty array) + // (good = non undefined and non null ResourceMap) + // (result of size == 0 is valid, no highlights is a valid/expected result -- not a signal to fall back to other providers) return first | null | undefined>(orderedByScore.map(provider => () => { const filteredModels = otherModels.filter(otherModel => { return shouldSynchronizeModel(otherModel); }).filter(otherModel => { return score(provider.selector, otherModel.uri, otherModel.getLanguageId(), true, undefined, undefined) > 0; }); - return Promise.resolve(provider.provideMultiDocumentHighlights(model, position, filteredModels, token)) .then(undefined, onUnexpectedExternalError); - }), (t: ResourceMap | null | undefined): t is ResourceMap => t instanceof ResourceMap && t.size > 0); + }), (result): result is ResourceMap => result !== undefined && result !== null); } interface IOccurenceAtPositionRequest { @@ -83,10 +86,9 @@ interface IOccurenceAtPositionRequest { interface IWordHighlighterQuery { modelInfo: { - model: ITextModel; + modelURI: URI; selection: Selection; } | null; - readonly word: IWordAtPosition | null; } abstract class OccurenceAtPositionRequest implements IOccurenceAtPositionRequest { @@ -174,7 +176,7 @@ class MultiModelOccurenceRequest extends OccurenceAtPositionRequest { } protected override _compute(model: ITextModel, selection: Selection, wordSeparators: string, token: CancellationToken): Promise> { - return getOccurrencesAcrossMultipleModels(this._providers, model, selection.getPosition(), wordSeparators, token, this._otherModels).then(value => { + return getOccurrencesAcrossMultipleModels(this._providers, model, selection.getPosition(), token, this._otherModels).then(value => { if (!value) { return new ResourceMap(); } @@ -183,76 +185,13 @@ class MultiModelOccurenceRequest extends OccurenceAtPositionRequest { } } -class TextualOccurenceRequest extends OccurenceAtPositionRequest { - - private readonly _otherModels: ITextModel[]; - private readonly _selectionIsEmpty: boolean; - private readonly _word: IWordAtPosition | null; - - constructor(model: ITextModel, selection: Selection, word: IWordAtPosition | null, wordSeparators: string, otherModels: ITextModel[]) { - super(model, selection, wordSeparators); - this._otherModels = otherModels; - this._selectionIsEmpty = selection.isEmpty(); - this._word = word; - } - - protected _compute(model: ITextModel, selection: Selection, wordSeparators: string, token: CancellationToken): Promise> { - return timeout(250, token).then(() => { - const result = new ResourceMap(); - - let wordResult; - if (this._word) { - wordResult = this._word; - } else { - wordResult = model.getWordAtPosition(selection.getPosition()); - } - if (!wordResult) { - return new ResourceMap(); - } - - const allModels = [model, ...this._otherModels]; - - for (const otherModel of allModels) { - if (otherModel.isDisposed()) { - continue; - } - - const matches = otherModel.findMatches(wordResult.word, true, false, true, wordSeparators, false); - const highlights = matches.map(m => ({ - range: m.range, - kind: DocumentHighlightKind.Text - })); - - if (highlights) { - result.set(otherModel.uri, highlights); - } - } - return result; - }); - } - - public override isValid(model: ITextModel, selection: Selection, decorations: IEditorDecorationsCollection): boolean { - const currentSelectionIsEmpty = selection.isEmpty(); - if (this._selectionIsEmpty !== currentSelectionIsEmpty) { - return false; - } - return super.isValid(model, selection, decorations); - } -} - -function computeOccurencesAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, selection: Selection, word: IWordAtPosition | null, wordSeparators: string): IOccurenceAtPositionRequest { - if (registry.has(model)) { - return new SemanticOccurenceAtPositionRequest(model, selection, wordSeparators, registry); - } - return new TextualOccurenceRequest(model, selection, word, wordSeparators, []); +function computeOccurencesAtPosition(registry: LanguageFeatureRegistry, model: ITextModel, selection: Selection, wordSeparators: string): IOccurenceAtPositionRequest { + return new SemanticOccurenceAtPositionRequest(model, selection, wordSeparators, registry); } -function computeOccurencesMultiModel(registry: LanguageFeatureRegistry, model: ITextModel, selection: Selection, word: IWordAtPosition | null, wordSeparators: string, otherModels: ITextModel[]): IOccurenceAtPositionRequest { - if (registry.has(model)) { - return new MultiModelOccurenceRequest(model, selection, wordSeparators, registry, otherModels); - } - return new TextualOccurenceRequest(model, selection, word, wordSeparators, otherModels); +function computeOccurencesMultiModel(registry: LanguageFeatureRegistry, model: ITextModel, selection: Selection, wordSeparators: string, otherModels: ITextModel[]): IOccurenceAtPositionRequest { + return new MultiModelOccurenceRequest(model, selection, wordSeparators, registry, otherModels); } registerModelAndPositionCommand('_executeDocumentHighlights', async (accessor, model, position) => { @@ -266,12 +205,15 @@ class WordHighlighter { private readonly editor: IActiveCodeEditor; private readonly providers: LanguageFeatureRegistry; private readonly multiDocumentProviders: LanguageFeatureRegistry; - private occurrencesHighlight: string; private readonly model: ITextModel; private readonly decorations: IEditorDecorationsCollection; private readonly toUnhook = new DisposableStore(); + + private readonly textModelService: ITextModelService; private readonly codeEditorService: ICodeEditorService; + private occurrencesHighlight: string; + private workerRequestTokenId: number = 0; private workerRequest: IOccurenceAtPositionRequest | null; private workerRequestCompleted: boolean = false; @@ -283,18 +225,31 @@ class WordHighlighter { private readonly _hasWordHighlights: IContextKey; private _ignorePositionChangeEvent: boolean; - private static storedDecorations: ResourceMap = new ResourceMap(); + private readonly runDelayer: Delayer = this.toUnhook.add(new Delayer(25)); + + private static storedDecorationIDs: ResourceMap = new ResourceMap(); private static query: IWordHighlighterQuery | null = null; - constructor(editor: IActiveCodeEditor, providers: LanguageFeatureRegistry, multiProviders: LanguageFeatureRegistry, contextKeyService: IContextKeyService, @ICodeEditorService codeEditorService: ICodeEditorService) { + constructor( + editor: IActiveCodeEditor, + providers: LanguageFeatureRegistry, + multiProviders: LanguageFeatureRegistry, + contextKeyService: IContextKeyService, + @ITextModelService textModelService: ITextModelService, + @ICodeEditorService codeEditorService: ICodeEditorService, + ) { this.editor = editor; this.providers = providers; this.multiDocumentProviders = multiProviders; + this.codeEditorService = codeEditorService; + this.textModelService = textModelService; + this._hasWordHighlights = ctxHasWordHighlights.bindTo(contextKeyService); this._ignorePositionChangeEvent = false; this.occurrencesHighlight = this.editor.getOption(EditorOption.occurrencesHighlight); this.model = this.editor.getModel(); + this.toUnhook.add(editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => { if (this._ignorePositionChangeEvent) { // We are changing the position => ignore this event @@ -307,7 +262,7 @@ class WordHighlighter { return; } - this._onPositionChanged(e); + this.runDelayer.trigger(() => { this._onPositionChanged(e); }); })); this.toUnhook.add(editor.onDidFocusEditorText((e) => { if (this.occurrencesHighlight === 'off') { @@ -316,25 +271,53 @@ class WordHighlighter { } if (!this.workerRequest) { - this._run(); + this.runDelayer.trigger(() => { this._run(); }); } })); this.toUnhook.add(editor.onDidChangeModelContent((e) => { - this._stopAll(); + if (!matchesScheme(this.model.uri, 'output')) { + this._stopAll(); + } })); this.toUnhook.add(editor.onDidChangeModel((e) => { if (!e.newModelUrl && e.oldModelUrl) { this._stopSingular(); - } else { - if (WordHighlighter.query) { - this._run(); - } + } else if (WordHighlighter.query) { + this._run(); } })); this.toUnhook.add(editor.onDidChangeConfiguration((e) => { const newValue = this.editor.getOption(EditorOption.occurrencesHighlight); if (this.occurrencesHighlight !== newValue) { this.occurrencesHighlight = newValue; + switch (newValue) { + case 'off': + this._stopAll(); + break; + case 'singleFile': + this._stopAll(WordHighlighter.query?.modelInfo?.modelURI); + break; + case 'multiFile': + if (WordHighlighter.query) { + this._run(true); + } + break; + default: + console.warn('Unknown occurrencesHighlight setting value:', newValue); + break; + } + } + })); + this.toUnhook.add(editor.onDidBlurEditorWidget(() => { + // logic is as follows + // - didBlur => active null => stopall + // - didBlur => active nb => if this.editor is notebook, do nothing (new cell, so we don't want to stopAll) + // active nb => if this.editor is NOT nb, stopAll + + const activeEditor = this.codeEditorService.getFocusedCodeEditor(); + if (!activeEditor) { // clicked into nb cell list, outline, terminal, etc + this._stopAll(); + } else if (activeEditor.getModel()?.uri.scheme === Schemas.vscodeNotebookCell && this.editor.getModel()?.uri.scheme !== Schemas.vscodeNotebookCell) { // switched tabs from non-nb to nb this._stopAll(); } })); @@ -361,9 +344,15 @@ class WordHighlighter { if (this.occurrencesHighlight === 'off') { return; } + + this.runDelayer.cancel(); this._run(); } + public trigger() { + this._run(false, true); // immediate rendering (noDelay = true) + } + public stop(): void { if (this.occurrencesHighlight === 'off') { return; @@ -423,13 +412,13 @@ class WordHighlighter { return; } - const currentDecorationIDs = WordHighlighter.storedDecorations.get(this.editor.getModel().uri); + const currentDecorationIDs = WordHighlighter.storedDecorationIDs.get(this.editor.getModel().uri); if (!currentDecorationIDs) { return; } this.editor.removeDecorations(currentDecorationIDs); - WordHighlighter.storedDecorations.delete(this.editor.getModel().uri); + WordHighlighter.storedDecorationIDs.delete(this.editor.getModel().uri); if (this.decorations.length > 0) { this.decorations.clear(); @@ -437,16 +426,16 @@ class WordHighlighter { } } - private _removeAllDecorations(): void { + private _removeAllDecorations(preservedModel?: URI): void { const currentEditors = this.codeEditorService.listCodeEditors(); const deleteURI = []; // iterate over editors and store models in currentModels for (const editor of currentEditors) { - if (!editor.hasModel()) { + if (!editor.hasModel() || isEqual(editor.getModel().uri, preservedModel)) { continue; } - const currentDecorationIDs = WordHighlighter.storedDecorations.get(editor.getModel().uri); + const currentDecorationIDs = WordHighlighter.storedDecorationIDs.get(editor.getModel().uri); if (!currentDecorationIDs) { continue; } @@ -467,7 +456,7 @@ class WordHighlighter { } for (const uri of deleteURI) { - WordHighlighter.storedDecorations.delete(uri); + WordHighlighter.storedDecorationIDs.delete(uri); } } @@ -476,7 +465,7 @@ class WordHighlighter { this._removeSingleDecorations(); if (this.editor.hasTextFocus()) { - if (this.editor.getModel()?.uri.scheme !== Schemas.vscodeNotebookCell && WordHighlighter.query?.modelInfo?.model.uri.scheme !== Schemas.vscodeNotebookCell) { // clear query if focused non-nb editor + if (this.editor.getModel()?.uri.scheme !== Schemas.vscodeNotebookCell && WordHighlighter.query?.modelInfo?.modelURI.scheme !== Schemas.vscodeNotebookCell) { // clear query if focused non-nb editor WordHighlighter.query = null; this._run(); // TODO: @Yoyokrazy -- investigate why we need a full rerun here. likely addressed a case/patch in the first iteration of this feature } else { // remove modelInfo to account for nb cell being disposed @@ -505,11 +494,11 @@ class WordHighlighter { } } - private _stopAll() { + private _stopAll(preservedModel?: URI): void { // Remove any existing decorations // TODO: @Yoyokrazy -- this triggers as notebooks scroll, causing highlights to disappear momentarily. // maybe a nb type check? - this._removeAllDecorations(); + this._removeAllDecorations(preservedModel); // Cancel any renderDecorationsTimer if (this.renderDecorationsTimer !== -1) { @@ -623,13 +612,13 @@ class WordHighlighter { return currentModels; } - private _run(): void { + private async _run(multiFileConfigChange?: boolean, noDelay?: boolean): Promise { - let workerRequestIsValid; const hasTextFocus = this.editor.hasTextFocus(); if (!hasTextFocus) { // new nb cell scrolled in, didChangeModel fires if (!WordHighlighter.query) { // no previous query, nothing to highlight off of + this._stopAll(); return; } } else { // has text focus @@ -655,44 +644,33 @@ class WordHighlighter { return; } - // All the effort below is trying to achieve this: - // - when cursor is moved to a word, trigger immediately a findOccurrences request - // - 250ms later after the last cursor move event, render the occurrences - // - no flickering! - workerRequestIsValid = (this.workerRequest && this.workerRequest.isValid(this.model, editorSelection, this.decorations)); - WordHighlighter.query = { modelInfo: { - model: this.model, + modelURI: this.model.uri, selection: editorSelection, - }, - word: word + } }; } - // There are 4 cases: - // a) old workerRequest is valid & completed, renderDecorationsTimer fired - // b) old workerRequest is valid & completed, renderDecorationsTimer not fired - // c) old workerRequest is valid, but not completed - // d) old workerRequest is not valid - - // For a) no action is needed - // For c), member 'lastCursorPositionChangeTime' will be used when installing the timer so no action is needed this.lastCursorPositionChangeTime = (new Date()).getTime(); - if (workerRequestIsValid) { - if (this.workerRequestCompleted && this.renderDecorationsTimer !== -1) { - // case b) - // Delay the firing of renderDecorationsTimer by an extra 250 ms - clearTimeout(this.renderDecorationsTimer); - this.renderDecorationsTimer = -1; - this._beginRenderDecorations(); - } - } else { + if (isEqual(this.editor.getModel().uri, WordHighlighter.query.modelInfo?.modelURI)) { // only trigger new worker requests from the primary model that initiated the query // case d) - // Stop all previous actions and start fresh - this._stopAll(); + + // check if the new queried word is contained in the range of a stored decoration for this model + if (!multiFileConfigChange) { + const currentModelDecorationRanges = this.decorations.getRanges(); + for (const storedRange of currentModelDecorationRanges) { + if (storedRange.containsPosition(this.editor.getPosition())) { + return; + } + } + } + + // stop all previous actions if new word is highlighted + // if we trigger the run off a setting change -> multifile highlighting, we do not want to remove decorations from this model + this._stopAll(multiFileConfigChange ? this.model.uri : undefined); const myRequestId = ++this.workerRequestTokenId; this.workerRequestCompleted = false; @@ -703,10 +681,12 @@ class WordHighlighter { // 1) we have text focus, and a valid query was updated. // 2) we do not have text focus, and a valid query is cached. // the query will ALWAYS have the correct data for the current highlight request, so it can always be passed to the workerRequest safely - if (!WordHighlighter.query.modelInfo || WordHighlighter.query.modelInfo.model.isDisposed()) { + if (!WordHighlighter.query || !WordHighlighter.query.modelInfo) { return; } - this.workerRequest = this.computeWithModel(WordHighlighter.query.modelInfo.model, WordHighlighter.query.modelInfo.selection, WordHighlighter.query.word, otherModelsToHighlight); + const queryModelRef = await this.textModelService.createModelReference(WordHighlighter.query.modelInfo.modelURI); + const queryModel = queryModelRef.object.textEditorModel; + this.workerRequest = this.computeWithModel(queryModel, WordHighlighter.query.modelInfo.selection, otherModelsToHighlight); this.workerRequest?.result.then(data => { if (myRequestId === this.workerRequestTokenId) { @@ -715,20 +695,43 @@ class WordHighlighter { this._beginRenderDecorations(); } }, onUnexpectedError); + } else if (this.model.uri.scheme === Schemas.vscodeNotebookCell) { + // new wordHighlighter coming from a different model, NOT the query model, need to create a textModel ref + + // this._stopAll(multiFileConfigChange ? this.model.uri : undefined); + + const myRequestId = ++this.workerRequestTokenId; + this.workerRequestCompleted = false; + + if (!WordHighlighter.query || !WordHighlighter.query.modelInfo) { + return; + } + + const queryModelRef = await this.textModelService.createModelReference(WordHighlighter.query.modelInfo.modelURI); + const queryModel = queryModelRef.object.textEditorModel; + this.workerRequest = this.computeWithModel(queryModel, WordHighlighter.query.modelInfo.selection, [this.model]); + + this.workerRequest?.result.then(data => { + if (myRequestId === this.workerRequestTokenId) { + this.workerRequestCompleted = true; + this.workerRequestValue = data || []; + this._beginRenderDecorations(!noDelay); + } + }, onUnexpectedError); } } - private computeWithModel(model: ITextModel, selection: Selection, word: IWordAtPosition | null, otherModels: ITextModel[]): IOccurenceAtPositionRequest | null { + private computeWithModel(model: ITextModel, selection: Selection, otherModels: ITextModel[]): IOccurenceAtPositionRequest | null { if (!otherModels.length) { - return computeOccurencesAtPosition(this.providers, model, selection, word, this.editor.getOption(EditorOption.wordSeparators)); + return computeOccurencesAtPosition(this.providers, model, selection, this.editor.getOption(EditorOption.wordSeparators)); } else { - return computeOccurencesMultiModel(this.multiDocumentProviders, model, selection, word, this.editor.getOption(EditorOption.wordSeparators), otherModels); + return computeOccurencesMultiModel(this.multiDocumentProviders, model, selection, this.editor.getOption(EditorOption.wordSeparators), otherModels); } } - private _beginRenderDecorations(): void { + private _beginRenderDecorations(delay?: boolean): void { const currentTime = (new Date()).getTime(); - const minimumRenderTime = this.lastCursorPositionChangeTime + 250; + const minimumRenderTime = this.lastCursorPositionChangeTime + (delay ? 250 : 0); if (currentTime >= minimumRenderTime) { // Synchronous @@ -757,7 +760,7 @@ class WordHighlighter { const newDecorations: IModelDeltaDecoration[] = []; const uri = editor.getModel()?.uri; if (uri && this.workerRequestValue.has(uri)) { - const oldDecorationIDs: string[] | undefined = WordHighlighter.storedDecorations.get(uri); + const oldDecorationIDs: string[] | undefined = WordHighlighter.storedDecorationIDs.get(uri); const newDocumentHighlights = this.workerRequestValue.get(uri); if (newDocumentHighlights) { for (const highlight of newDocumentHighlights) { @@ -775,7 +778,7 @@ class WordHighlighter { editor.changeDecorations((changeAccessor) => { newDecorationIDs = changeAccessor.deltaDecorations(oldDecorationIDs ?? [], newDecorations); }); - WordHighlighter.storedDecorations = WordHighlighter.storedDecorations.set(uri, newDecorationIDs); + WordHighlighter.storedDecorationIDs = WordHighlighter.storedDecorationIDs.set(uri, newDecorationIDs); if (newDecorations.length > 0) { editorHighlighterContrib.wordHighlighter?.decorations.set(newDecorations); @@ -783,6 +786,9 @@ class WordHighlighter { } } } + + // clear the worker request when decorations are completed + this.workerRequest = null; } public dispose(): void { @@ -801,16 +807,26 @@ export class WordHighlighterContribution extends Disposable implements IEditorCo private _wordHighlighter: WordHighlighter | null; - constructor(editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService, @ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService, @ICodeEditorService codeEditorService: ICodeEditorService) { + constructor( + editor: ICodeEditor, + @IContextKeyService contextKeyService: IContextKeyService, + @ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService, + @ICodeEditorService codeEditorService: ICodeEditorService, + @ITextModelService textModelService: ITextModelService, + ) { super(); this._wordHighlighter = null; const createWordHighlighterIfPossible = () => { if (editor.hasModel() && !editor.getModel().isTooLargeForTokenization()) { - this._wordHighlighter = new WordHighlighter(editor, languageFeaturesService.documentHighlightProvider, languageFeaturesService.multiDocumentHighlightProvider, contextKeyService, codeEditorService); + this._wordHighlighter = new WordHighlighter(editor, languageFeaturesService.documentHighlightProvider, languageFeaturesService.multiDocumentHighlightProvider, contextKeyService, textModelService, codeEditorService); } }; this._register(editor.onDidChangeModel((e) => { if (this._wordHighlighter) { + if (!e.newModelUrl && e.oldModelUrl?.scheme !== Schemas.vscodeNotebookCell) { // happens when switching tabs to a notebook that has focus in the cell list, no new model URI (this also doesn't make it to the wordHighlighter, bc no editor.hasModel) + this.wordHighlighter?.stop(); + } + this._wordHighlighter.dispose(); this._wordHighlighter = null; } @@ -919,7 +935,7 @@ class TriggerWordHighlightAction extends EditorAction { id: 'editor.action.wordHighlight.trigger', label: nls.localize('wordHighlight.trigger.label', "Trigger Symbol Highlight"), alias: 'Trigger Symbol Highlight', - precondition: ctxHasWordHighlights.toNegated(), + precondition: undefined, kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: 0, @@ -942,4 +958,4 @@ registerEditorContribution(WordHighlighterContribution.ID, WordHighlighterContri registerEditorAction(NextWordHighlightAction); registerEditorAction(PrevWordHighlightAction); registerEditorAction(TriggerWordHighlightAction); -// registerEditorFeature(TextualMultiDocumentHighlightFeature); +registerEditorFeature(TextualMultiDocumentHighlightFeature); diff --git a/src/vs/editor/contrib/wordOperations/browser/wordOperations.ts b/src/vs/editor/contrib/wordOperations/browser/wordOperations.ts index 29381ecf63f..7022ec9bf38 100644 --- a/src/vs/editor/contrib/wordOperations/browser/wordOperations.ts +++ b/src/vs/editor/contrib/wordOperations/browser/wordOperations.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, EditorCommand, ICommandOptions, registerEditorAction, registerEditorCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand'; -import { EditorOption, EditorOptions } from 'vs/editor/common/config/editorOptions'; -import { CursorState } from 'vs/editor/common/cursorCommon'; -import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; -import { DeleteWordContext, WordNavigationType, WordOperations } from 'vs/editor/common/cursor/cursorWordOperations'; -import { getMapForWordSeparators, WordCharacterClassifier } from 'vs/editor/common/core/wordCharacterClassifier'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import * as nls from 'vs/nls'; -import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vs/platform/accessibility/common/accessibility'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { IsWindowsContext } from 'vs/platform/contextkey/common/contextkeys'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, EditorCommand, ICommandOptions, registerEditorAction, registerEditorCommand, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { ReplaceCommand } from '../../../common/commands/replaceCommand.js'; +import { EditorOption, EditorOptions } from '../../../common/config/editorOptions.js'; +import { CursorState } from '../../../common/cursorCommon.js'; +import { CursorChangeReason } from '../../../common/cursorEvents.js'; +import { DeleteWordContext, WordNavigationType, WordOperations } from '../../../common/cursor/cursorWordOperations.js'; +import { getMapForWordSeparators, WordCharacterClassifier } from '../../../common/core/wordCharacterClassifier.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ScrollType } from '../../../common/editorCommon.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ITextModel } from '../../../common/model.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import * as nls from '../../../../nls.js'; +import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from '../../../../platform/accessibility/common/accessibility.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { IsWindowsContext } from '../../../../platform/contextkey/common/contextkeys.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; export interface MoveWordOptions extends ICommandOptions { inSelectionMode: boolean; diff --git a/src/vs/editor/contrib/wordOperations/test/browser/wordOperations.test.ts b/src/vs/editor/contrib/wordOperations/test/browser/wordOperations.test.ts index 51cdccc4fd3..237945f6465 100644 --- a/src/vs/editor/contrib/wordOperations/test/browser/wordOperations.test.ts +++ b/src/vs/editor/contrib/wordOperations/test/browser/wordOperations.test.ts @@ -4,21 +4,22 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { CoreEditingCommands } from 'vs/editor/browser/coreCommands'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorCommand } from 'vs/editor/browser/editorExtensions'; -import { Position } from 'vs/editor/common/core/position'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; -import { CursorWordAccessibilityLeft, CursorWordAccessibilityLeftSelect, CursorWordAccessibilityRight, CursorWordAccessibilityRightSelect, CursorWordEndLeft, CursorWordEndLeftSelect, CursorWordEndRight, CursorWordEndRightSelect, CursorWordLeft, CursorWordLeftSelect, CursorWordRight, CursorWordRightSelect, CursorWordStartLeft, CursorWordStartLeftSelect, CursorWordStartRight, CursorWordStartRightSelect, DeleteInsideWord, DeleteWordEndLeft, DeleteWordEndRight, DeleteWordLeft, DeleteWordRight, DeleteWordStartLeft, DeleteWordStartRight } from 'vs/editor/contrib/wordOperations/browser/wordOperations'; -import { deserializePipePositions, serializePipePositions, testRepeatedActionAndExtractPositions } from 'vs/editor/contrib/wordOperations/test/browser/wordTestUtils'; -import { createCodeEditorServices, instantiateTestCodeEditor, withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { instantiateTextModel } from 'vs/editor/test/common/testTextModel'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { isFirefox } from '../../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { CoreEditingCommands } from '../../../../browser/coreCommands.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { EditorCommand } from '../../../../browser/editorExtensions.js'; +import { Position } from '../../../../common/core/position.js'; +import { Selection } from '../../../../common/core/selection.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { ViewModel } from '../../../../common/viewModel/viewModelImpl.js'; +import { CursorWordAccessibilityLeft, CursorWordAccessibilityLeftSelect, CursorWordAccessibilityRight, CursorWordAccessibilityRightSelect, CursorWordEndLeft, CursorWordEndLeftSelect, CursorWordEndRight, CursorWordEndRightSelect, CursorWordLeft, CursorWordLeftSelect, CursorWordRight, CursorWordRightSelect, CursorWordStartLeft, CursorWordStartLeftSelect, CursorWordStartRight, CursorWordStartRightSelect, DeleteInsideWord, DeleteWordEndLeft, DeleteWordEndRight, DeleteWordLeft, DeleteWordRight, DeleteWordStartLeft, DeleteWordStartRight } from '../../browser/wordOperations.js'; +import { deserializePipePositions, serializePipePositions, testRepeatedActionAndExtractPositions } from './wordTestUtils.js'; +import { createCodeEditorServices, instantiateTestCodeEditor, withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; +import { instantiateTextModel } from '../../../../test/common/testTextModel.js'; +import { TestInstantiationService } from '../../../../../platform/instantiation/test/common/instantiationServiceMock.js'; suite('WordOperations', () => { @@ -179,7 +180,11 @@ suite('WordOperations', () => { assert.deepStrictEqual(actual, EXPECTED); }); - test('cursorWordLeft - Recognize words', () => { + test('cursorWordLeft - Recognize words', function () { + if (isFirefox) { + // https://github.com/microsoft/vscode/issues/219843 + return this.skip(); + } const EXPECTED = [ '|/* |これ|は|テスト|です |/*', ].join('\n'); @@ -399,7 +404,11 @@ suite('WordOperations', () => { assert.deepStrictEqual(actual, EXPECTED); }); - test('cursorWordRight - Recognize words', () => { + test('cursorWordRight - Recognize words', function () { + if (isFirefox) { + // https://github.com/microsoft/vscode/issues/219843 + return this.skip(); + } const EXPECTED = [ '/*| これ|は|テスト|です|/*|', ].join('\n'); diff --git a/src/vs/editor/contrib/wordOperations/test/browser/wordTestUtils.ts b/src/vs/editor/contrib/wordOperations/test/browser/wordTestUtils.ts index 540c1a0d496..36ed4fa2055 100644 --- a/src/vs/editor/contrib/wordOperations/test/browser/wordTestUtils.ts +++ b/src/vs/editor/contrib/wordOperations/test/browser/wordTestUtils.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Position } from 'vs/editor/common/core/position'; -import { ITestCodeEditor, TestCodeEditorInstantiationOptions, withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; +import { Position } from '../../../../common/core/position.js'; +import { ITestCodeEditor, TestCodeEditorInstantiationOptions, withTestCodeEditor } from '../../../../test/browser/testCodeEditor.js'; export function deserializePipePositions(text: string): [string, Position[]] { let resultText = ''; diff --git a/src/vs/editor/contrib/wordPartOperations/browser/wordPartOperations.ts b/src/vs/editor/contrib/wordPartOperations/browser/wordPartOperations.ts index 5ed4d310941..9bee3f0e0c2 100644 --- a/src/vs/editor/contrib/wordPartOperations/browser/wordPartOperations.ts +++ b/src/vs/editor/contrib/wordPartOperations/browser/wordPartOperations.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { registerEditorCommand } from 'vs/editor/browser/editorExtensions'; -import { DeleteWordContext, WordNavigationType, WordPartOperations } from 'vs/editor/common/cursor/cursorWordOperations'; -import { WordCharacterClassifier } from 'vs/editor/common/core/wordCharacterClassifier'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ITextModel } from 'vs/editor/common/model'; -import { DeleteWordCommand, MoveWordCommand } from 'vs/editor/contrib/wordOperations/browser/wordOperations'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { registerEditorCommand } from '../../../browser/editorExtensions.js'; +import { DeleteWordContext, WordNavigationType, WordPartOperations } from '../../../common/cursor/cursorWordOperations.js'; +import { WordCharacterClassifier } from '../../../common/core/wordCharacterClassifier.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { ITextModel } from '../../../common/model.js'; +import { DeleteWordCommand, MoveWordCommand } from '../../wordOperations/browser/wordOperations.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; export class DeleteWordPartLeft extends DeleteWordCommand { constructor() { diff --git a/src/vs/editor/contrib/wordPartOperations/test/browser/utils.ts b/src/vs/editor/contrib/wordPartOperations/test/browser/utils.ts index 7610bd18937..c5afe453def 100644 --- a/src/vs/editor/contrib/wordPartOperations/test/browser/utils.ts +++ b/src/vs/editor/contrib/wordPartOperations/test/browser/utils.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ServiceIdentifier, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { ServiceIdentifier, ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js'; export class StaticServiceAccessor implements ServicesAccessor { private services = new Map, any>(); diff --git a/src/vs/editor/contrib/wordPartOperations/test/browser/wordPartOperations.test.ts b/src/vs/editor/contrib/wordPartOperations/test/browser/wordPartOperations.test.ts index b3a72759a04..bf9d0a504a4 100644 --- a/src/vs/editor/contrib/wordPartOperations/test/browser/wordPartOperations.test.ts +++ b/src/vs/editor/contrib/wordPartOperations/test/browser/wordPartOperations.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorCommand } from 'vs/editor/browser/editorExtensions'; -import { Position } from 'vs/editor/common/core/position'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { deserializePipePositions, serializePipePositions, testRepeatedActionAndExtractPositions } from 'vs/editor/contrib/wordOperations/test/browser/wordTestUtils'; -import { CursorWordPartLeft, CursorWordPartLeftSelect, CursorWordPartRight, CursorWordPartRightSelect, DeleteWordPartLeft, DeleteWordPartRight } from 'vs/editor/contrib/wordPartOperations/browser/wordPartOperations'; -import { StaticServiceAccessor } from 'vs/editor/contrib/wordPartOperations/test/browser/utils'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { ICodeEditor } from '../../../../browser/editorBrowser.js'; +import { EditorCommand } from '../../../../browser/editorExtensions.js'; +import { Position } from '../../../../common/core/position.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { deserializePipePositions, serializePipePositions, testRepeatedActionAndExtractPositions } from '../../../wordOperations/test/browser/wordTestUtils.js'; +import { CursorWordPartLeft, CursorWordPartLeftSelect, CursorWordPartRight, CursorWordPartRightSelect, DeleteWordPartLeft, DeleteWordPartRight } from '../../browser/wordPartOperations.js'; +import { StaticServiceAccessor } from './utils.js'; +import { TestLanguageConfigurationService } from '../../../../test/common/modes/testLanguageConfigurationService.js'; suite('WordPartOperations', () => { diff --git a/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts b/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts index e1a887f253b..334159f7fd3 100644 --- a/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts +++ b/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { IHorizontalSashLayoutProvider, ISashEvent, Orientation, Sash, SashState } from 'vs/base/browser/ui/sash/sash'; -import { Color, RGBA } from 'vs/base/common/color'; -import { IdGenerator } from 'vs/base/common/idGenerator'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import * as objects from 'vs/base/common/objects'; -import 'vs/css!./zoneWidget'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, IViewZoneChangeAccessor } from 'vs/editor/browser/editorBrowser'; -import { EditorLayoutInfo, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { IEditorDecorationsCollection, ScrollType } from 'vs/editor/common/editorCommon'; -import { TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; +import * as dom from '../../../../base/browser/dom.js'; +import { IHorizontalSashLayoutProvider, ISashEvent, Orientation, Sash, SashState } from '../../../../base/browser/ui/sash/sash.js'; +import { Color, RGBA } from '../../../../base/common/color.js'; +import { IdGenerator } from '../../../../base/common/idGenerator.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import * as objects from '../../../../base/common/objects.js'; +import './zoneWidget.css'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, IViewZoneChangeAccessor } from '../../../browser/editorBrowser.js'; +import { EditorLayoutInfo, EditorOption } from '../../../common/config/editorOptions.js'; +import { IPosition, Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { IEditorDecorationsCollection, ScrollType } from '../../../common/editorCommon.js'; +import { TrackedRangeStickiness } from '../../../common/model.js'; +import { ModelDecorationOptions } from '../../../common/model/textModel.js'; export interface IOptions { showFrame?: boolean; diff --git a/src/vs/editor/editor.all.ts b/src/vs/editor/editor.all.ts index e40c7056aa7..f7aca2c64c0 100644 --- a/src/vs/editor/editor.all.ts +++ b/src/vs/editor/editor.all.ts @@ -3,69 +3,69 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/editor/browser/coreCommands'; -import 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import 'vs/editor/browser/widget/diffEditor/diffEditor.contribution'; -import 'vs/editor/contrib/anchorSelect/browser/anchorSelect'; -import 'vs/editor/contrib/bracketMatching/browser/bracketMatching'; -import 'vs/editor/contrib/caretOperations/browser/caretOperations'; -import 'vs/editor/contrib/caretOperations/browser/transpose'; -import 'vs/editor/contrib/clipboard/browser/clipboard'; -import 'vs/editor/contrib/codeAction/browser/codeActionContributions'; -import 'vs/editor/contrib/codelens/browser/codelensController'; -import 'vs/editor/contrib/colorPicker/browser/colorContributions'; -import 'vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions'; -import 'vs/editor/contrib/comment/browser/comment'; -import 'vs/editor/contrib/contextmenu/browser/contextmenu'; -import 'vs/editor/contrib/cursorUndo/browser/cursorUndo'; -import 'vs/editor/contrib/dnd/browser/dnd'; -import 'vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution'; -import 'vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution'; -import 'vs/editor/contrib/find/browser/findController'; -import 'vs/editor/contrib/folding/browser/folding'; -import 'vs/editor/contrib/fontZoom/browser/fontZoom'; -import 'vs/editor/contrib/format/browser/formatActions'; -import 'vs/editor/contrib/documentSymbols/browser/documentSymbols'; -import 'vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution'; -import 'vs/editor/contrib/inlineProgress/browser/inlineProgress'; -import 'vs/editor/contrib/gotoSymbol/browser/goToCommands'; -import 'vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition'; -import 'vs/editor/contrib/gotoError/browser/gotoError'; -import 'vs/editor/contrib/hover/browser/hoverContribution'; -import 'vs/editor/contrib/indentation/browser/indentation'; -import 'vs/editor/contrib/inlayHints/browser/inlayHintsContribution'; -import 'vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace'; -import 'vs/editor/contrib/lineSelection/browser/lineSelection'; -import 'vs/editor/contrib/linesOperations/browser/linesOperations'; -import 'vs/editor/contrib/linkedEditing/browser/linkedEditing'; -import 'vs/editor/contrib/links/browser/links'; -import 'vs/editor/contrib/longLinesHelper/browser/longLinesHelper'; -import 'vs/editor/contrib/multicursor/browser/multicursor'; -import 'vs/editor/contrib/inlineEdit/browser/inlineEdit.contribution'; -import 'vs/editor/contrib/inlineEdits/browser/inlineEdits.contribution'; -import 'vs/editor/contrib/parameterHints/browser/parameterHints'; -import 'vs/editor/contrib/placeholderText/browser/placeholderText.contribution'; -import 'vs/editor/contrib/rename/browser/rename'; -import 'vs/editor/contrib/sectionHeaders/browser/sectionHeaders'; -import 'vs/editor/contrib/semanticTokens/browser/documentSemanticTokens'; -import 'vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens'; -import 'vs/editor/contrib/smartSelect/browser/smartSelect'; -import 'vs/editor/contrib/snippet/browser/snippetController2'; -import 'vs/editor/contrib/stickyScroll/browser/stickyScrollContribution'; -import 'vs/editor/contrib/suggest/browser/suggestController'; -import 'vs/editor/contrib/suggest/browser/suggestInlineCompletions'; -import 'vs/editor/contrib/tokenization/browser/tokenization'; -import 'vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode'; -import 'vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter'; -import 'vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators'; -import 'vs/editor/contrib/wordHighlighter/browser/wordHighlighter'; -import 'vs/editor/contrib/wordOperations/browser/wordOperations'; -import 'vs/editor/contrib/wordPartOperations/browser/wordPartOperations'; -import 'vs/editor/contrib/readOnlyMessage/browser/contribution'; -import 'vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution'; +import './browser/coreCommands.js'; +import './browser/widget/codeEditor/codeEditorWidget.js'; +import './browser/widget/diffEditor/diffEditor.contribution.js'; +import './contrib/anchorSelect/browser/anchorSelect.js'; +import './contrib/bracketMatching/browser/bracketMatching.js'; +import './contrib/caretOperations/browser/caretOperations.js'; +import './contrib/caretOperations/browser/transpose.js'; +import './contrib/clipboard/browser/clipboard.js'; +import './contrib/codeAction/browser/codeActionContributions.js'; +import './contrib/codelens/browser/codelensController.js'; +import './contrib/colorPicker/browser/colorPickerContribution.js'; +import './contrib/comment/browser/comment.js'; +import './contrib/contextmenu/browser/contextmenu.js'; +import './contrib/cursorUndo/browser/cursorUndo.js'; +import './contrib/dnd/browser/dnd.js'; +import './contrib/dropOrPasteInto/browser/copyPasteContribution.js'; +import './contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js'; +import './contrib/find/browser/findController.js'; +import './contrib/folding/browser/folding.js'; +import './contrib/fontZoom/browser/fontZoom.js'; +import './contrib/format/browser/formatActions.js'; +import './contrib/documentSymbols/browser/documentSymbols.js'; +import './contrib/inlineCompletions/browser/inlineCompletions.contribution.js'; +import './contrib/inlineProgress/browser/inlineProgress.js'; +import './contrib/gotoSymbol/browser/goToCommands.js'; +import './contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js'; +import './contrib/gotoError/browser/gotoError.js'; +import './contrib/gpu/browser/gpuActions.js'; +import './contrib/hover/browser/hoverContribution.js'; +import './contrib/indentation/browser/indentation.js'; +import './contrib/inlayHints/browser/inlayHintsContribution.js'; +import './contrib/inPlaceReplace/browser/inPlaceReplace.js'; +import './contrib/lineSelection/browser/lineSelection.js'; +import './contrib/linesOperations/browser/linesOperations.js'; +import './contrib/linkedEditing/browser/linkedEditing.js'; +import './contrib/links/browser/links.js'; +import './contrib/longLinesHelper/browser/longLinesHelper.js'; +import './contrib/multicursor/browser/multicursor.js'; +import './contrib/inlineEdit/browser/inlineEdit.contribution.js'; +import './contrib/inlineEdits/browser/inlineEdits.contribution.js'; +import './contrib/parameterHints/browser/parameterHints.js'; +import './contrib/placeholderText/browser/placeholderText.contribution.js'; +import './contrib/rename/browser/rename.js'; +import './contrib/sectionHeaders/browser/sectionHeaders.js'; +import './contrib/semanticTokens/browser/documentSemanticTokens.js'; +import './contrib/semanticTokens/browser/viewportSemanticTokens.js'; +import './contrib/smartSelect/browser/smartSelect.js'; +import './contrib/snippet/browser/snippetController2.js'; +import './contrib/stickyScroll/browser/stickyScrollContribution.js'; +import './contrib/suggest/browser/suggestController.js'; +import './contrib/suggest/browser/suggestInlineCompletions.js'; +import './contrib/tokenization/browser/tokenization.js'; +import './contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js'; +import './contrib/unicodeHighlighter/browser/unicodeHighlighter.js'; +import './contrib/unusualLineTerminators/browser/unusualLineTerminators.js'; +import './contrib/wordHighlighter/browser/wordHighlighter.js'; +import './contrib/wordOperations/browser/wordOperations.js'; +import './contrib/wordPartOperations/browser/wordPartOperations.js'; +import './contrib/readOnlyMessage/browser/contribution.js'; +import './contrib/diffEditorBreadcrumbs/browser/contribution.js'; // Load up these strings even in VSCode, even if they are not used // in order to get them translated -import 'vs/editor/common/standaloneStrings'; +import './common/standaloneStrings.js'; -import 'vs/base/browser/ui/codicons/codiconStyles'; // The codicons are defined here and must be loaded +import '../base/browser/ui/codicons/codiconStyles.js'; // The codicons are defined here and must be loaded diff --git a/src/vs/editor/editor.api.ts b/src/vs/editor/editor.api.ts index a9fc0b29404..2a7c13dc136 100644 --- a/src/vs/editor/editor.api.ts +++ b/src/vs/editor/editor.api.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EditorOptions, WrappingIndent, EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions'; -import { createMonacoBaseAPI } from 'vs/editor/common/services/editorBaseApi'; -import { createMonacoEditorAPI } from 'vs/editor/standalone/browser/standaloneEditor'; -import { createMonacoLanguagesAPI } from 'vs/editor/standalone/browser/standaloneLanguages'; -import { FormattingConflicts } from 'vs/editor/contrib/format/browser/format'; +import { EditorOptions, WrappingIndent, EditorAutoIndentStrategy } from './common/config/editorOptions.js'; +import { createMonacoBaseAPI } from './common/services/editorBaseApi.js'; +import { createMonacoEditorAPI } from './standalone/browser/standaloneEditor.js'; +import { createMonacoLanguagesAPI } from './standalone/browser/standaloneLanguages.js'; +import { FormattingConflicts } from './contrib/format/browser/format.js'; // Set defaults for standalone editor EditorOptions.wrappingIndent.defaultValue = WrappingIndent.None; diff --git a/src/vs/editor/editor.main.ts b/src/vs/editor/editor.main.ts index 23d547570e9..fbdf6a7219e 100644 --- a/src/vs/editor/editor.main.ts +++ b/src/vs/editor/editor.main.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/editor/editor.all'; -import 'vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard'; -import 'vs/editor/standalone/browser/inspectTokens/inspectTokens'; -import 'vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess'; -import 'vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess'; -import 'vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess'; -import 'vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess'; -import 'vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch'; -import 'vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast'; +import './editor.all.js'; +import './standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js'; +import './standalone/browser/inspectTokens/inspectTokens.js'; +import './standalone/browser/quickAccess/standaloneHelpQuickAccess.js'; +import './standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js'; +import './standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js'; +import './standalone/browser/quickAccess/standaloneCommandsQuickAccess.js'; +import './standalone/browser/referenceSearch/standaloneReferenceSearch.js'; +import './standalone/browser/toggleHighContrast/toggleHighContrast.js'; -export * from 'vs/editor/editor.api'; +export * from './editor.api.js'; diff --git a/src/vs/editor/editor.worker.ts b/src/vs/editor/editor.worker.ts index 7c53a6094b2..0fd98caff25 100644 --- a/src/vs/editor/editor.worker.ts +++ b/src/vs/editor/editor.worker.ts @@ -3,30 +3,4 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SimpleWorkerServer } from 'vs/base/common/worker/simpleWorker'; -import { EditorSimpleWorker } from 'vs/editor/common/services/editorSimpleWorker'; -import { IEditorWorkerHost } from 'vs/editor/common/services/editorWorkerHost'; - -let initialized = false; - -export function initialize(foreignModule: any) { - if (initialized) { - return; - } - initialized = true; - - const simpleWorker = new SimpleWorkerServer((msg) => { - globalThis.postMessage(msg); - }, (host: IEditorWorkerHost) => new EditorSimpleWorker(host, foreignModule)); - - globalThis.onmessage = (e: MessageEvent) => { - simpleWorker.onmessage(e.data); - }; -} - -globalThis.onmessage = (e: MessageEvent) => { - // Ignore first message in this case and initialize if not yet initialized - if (!initialized) { - initialize(null); - } -}; +export * from './common/services/editorWorkerBootstrap.js'; diff --git a/src/vs/editor/standalone/browser/colorizer.ts b/src/vs/editor/standalone/browser/colorizer.ts index 1562ff2cd1d..0136434b1ff 100644 --- a/src/vs/editor/standalone/browser/colorizer.ts +++ b/src/vs/editor/standalone/browser/colorizer.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createTrustedTypesPolicy } from 'vs/base/browser/trustedTypes'; -import * as strings from 'vs/base/common/strings'; -import { ColorId, FontStyle, MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { ILanguageIdCodec, ITokenizationSupport, TokenizationRegistry } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ITextModel } from 'vs/editor/common/model'; -import { IViewLineTokens, LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { RenderLineInput, renderViewLine2 as renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer'; -import { ViewLineRenderingData } from 'vs/editor/common/viewModel'; -import { MonarchTokenizer } from 'vs/editor/standalone/common/monarch/monarchLexer'; -import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme'; +import { createTrustedTypesPolicy } from '../../../base/browser/trustedTypes.js'; +import * as strings from '../../../base/common/strings.js'; +import { ColorId, FontStyle, MetadataConsts } from '../../common/encodedTokenAttributes.js'; +import { ILanguageIdCodec, ITokenizationSupport, TokenizationRegistry } from '../../common/languages.js'; +import { ILanguageService } from '../../common/languages/language.js'; +import { ITextModel } from '../../common/model.js'; +import { IViewLineTokens, LineTokens } from '../../common/tokens/lineTokens.js'; +import { RenderLineInput, renderViewLine2 as renderViewLine } from '../../common/viewLayout/viewLineRenderer.js'; +import { ViewLineRenderingData } from '../../common/viewModel.js'; +import { MonarchTokenizer } from '../common/monarch/monarchLexer.js'; +import { IStandaloneThemeService } from '../common/standaloneTheme.js'; const ttPolicy = createTrustedTypesPolicy('standaloneColorizer', { createHTML: value => value }); diff --git a/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts b/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts index 9ac07b2b232..3c3ce892ce9 100644 --- a/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts +++ b/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./iPadShowKeyboard'; -import * as dom from 'vs/base/browser/dom'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { isIOS } from 'vs/base/common/platform'; +import './iPadShowKeyboard.css'; +import * as dom from '../../../../base/browser/dom.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from '../../../browser/editorBrowser.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { isIOS } from '../../../../base/common/platform.js'; export class IPadShowKeyboard extends Disposable implements IEditorContribution { diff --git a/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts index da8a7c35334..2eb75568747 100644 --- a/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts +++ b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./inspectTokens'; -import { $, append, reset } from 'vs/base/browser/dom'; -import { CharCode } from 'vs/base/common/charCode'; -import { Color } from 'vs/base/common/color'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ContentWidgetPositionPreference, IActiveCodeEditor, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution, EditorContributionInstantiation } from 'vs/editor/browser/editorExtensions'; -import { Position } from 'vs/editor/common/core/position'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { IState, ITokenizationSupport, TokenizationRegistry, ILanguageIdCodec, Token } from 'vs/editor/common/languages'; -import { FontStyle, StandardTokenType, TokenMetadata } from 'vs/editor/common/encodedTokenAttributes'; -import { NullState, nullTokenize, nullTokenizeEncoded } from 'vs/editor/common/languages/nullTokenize'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme'; -import { InspectTokensNLS } from 'vs/editor/common/standaloneStrings'; +import './inspectTokens.css'; +import { $, append, reset } from '../../../../base/browser/dom.js'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { Color } from '../../../../base/common/color.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ContentWidgetPositionPreference, IActiveCodeEditor, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js'; +import { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution, EditorContributionInstantiation } from '../../../browser/editorExtensions.js'; +import { Position } from '../../../common/core/position.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { ITextModel } from '../../../common/model.js'; +import { IState, ITokenizationSupport, TokenizationRegistry, ILanguageIdCodec, Token } from '../../../common/languages.js'; +import { FontStyle, StandardTokenType, TokenMetadata } from '../../../common/encodedTokenAttributes.js'; +import { NullState, nullTokenize, nullTokenizeEncoded } from '../../../common/languages/nullTokenize.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { IStandaloneThemeService } from '../../common/standaloneTheme.js'; +import { InspectTokensNLS } from '../../../common/standaloneStrings.js'; class InspectTokensController extends Disposable implements IEditorContribution { diff --git a/src/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.ts b/src/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.ts index 171a395e6f3..b0b4d80980b 100644 --- a/src/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.ts +++ b/src/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Registry } from 'vs/platform/registry/common/platform'; -import { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess'; -import { QuickCommandNLS } from 'vs/editor/common/standaloneStrings'; -import { ICommandQuickPick } from 'vs/platform/quickinput/browser/commandsQuickAccess'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { AbstractEditorCommandsQuickAccessProvider } from 'vs/editor/contrib/quickAccess/browser/commandsQuickAccess'; -import { IEditor } from 'vs/editor/common/editorCommon'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { EditorAction, registerEditorAction } from 'vs/editor/browser/editorExtensions'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { IQuickAccessRegistry, Extensions } from '../../../../platform/quickinput/common/quickAccess.js'; +import { QuickCommandNLS } from '../../../common/standaloneStrings.js'; +import { ICommandQuickPick } from '../../../../platform/quickinput/browser/commandsQuickAccess.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { AbstractEditorCommandsQuickAccessProvider } from '../../../contrib/quickAccess/browser/commandsQuickAccess.js'; +import { IEditor } from '../../../common/editorCommon.js'; +import { IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js'; +import { EditorAction, registerEditorAction } from '../../../browser/editorExtensions.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; export class StandaloneCommandsQuickAccessProvider extends AbstractEditorCommandsQuickAccessProvider { diff --git a/src/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.ts b/src/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.ts index c6ccecf960c..8fdee5d82f8 100644 --- a/src/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.ts +++ b/src/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AbstractGotoLineQuickAccessProvider } from 'vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { GoToLineNLS } from 'vs/editor/common/standaloneStrings'; -import { Event } from 'vs/base/common/event'; -import { EditorAction, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; +import { AbstractGotoLineQuickAccessProvider } from '../../../contrib/quickAccess/browser/gotoLineQuickAccess.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { IQuickAccessRegistry, Extensions } from '../../../../platform/quickinput/common/quickAccess.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { GoToLineNLS } from '../../../common/standaloneStrings.js'; +import { Event } from '../../../../base/common/event.js'; +import { EditorAction, registerEditorAction, ServicesAccessor } from '../../../browser/editorExtensions.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { KeyMod, KeyCode } from '../../../../base/common/keyCodes.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; export class StandaloneGotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProvider { diff --git a/src/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.ts b/src/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.ts index 0c2cfb8617b..aa05b05255f 100644 --- a/src/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.ts +++ b/src/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/base/browser/ui/codicons/codiconStyles'; // The codicon symbol styles are defined here and must be loaded -import 'vs/editor/contrib/symbolIcons/browser/symbolIcons'; // The codicon symbol colors are defined here and must be loaded to get colors -import { AbstractGotoSymbolQuickAccessProvider } from 'vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { QuickOutlineNLS } from 'vs/editor/common/standaloneStrings'; -import { Event } from 'vs/base/common/event'; -import { EditorAction, registerEditorAction } from 'vs/editor/browser/editorExtensions'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IQuickInputService, ItemActivation } from 'vs/platform/quickinput/common/quickInput'; -import { IOutlineModelService } from 'vs/editor/contrib/documentSymbols/browser/outlineModel'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; +import '../../../../base/browser/ui/codicons/codiconStyles.js'; // The codicon symbol styles are defined here and must be loaded +import '../../../contrib/symbolIcons/browser/symbolIcons.js'; // The codicon symbol colors are defined here and must be loaded to get colors +import { AbstractGotoSymbolQuickAccessProvider } from '../../../contrib/quickAccess/browser/gotoSymbolQuickAccess.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { IQuickAccessRegistry, Extensions } from '../../../../platform/quickinput/common/quickAccess.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { QuickOutlineNLS } from '../../../common/standaloneStrings.js'; +import { Event } from '../../../../base/common/event.js'; +import { EditorAction, registerEditorAction } from '../../../browser/editorExtensions.js'; +import { EditorContextKeys } from '../../../common/editorContextKeys.js'; +import { KeyMod, KeyCode } from '../../../../base/common/keyCodes.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { IQuickInputService, ItemActivation } from '../../../../platform/quickinput/common/quickInput.js'; +import { IOutlineModelService } from '../../../contrib/documentSymbols/browser/outlineModel.js'; +import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js'; export class StandaloneGotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccessProvider { diff --git a/src/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.ts b/src/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.ts index 31c5511035c..aae4222cfc3 100644 --- a/src/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.ts +++ b/src/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Registry } from 'vs/platform/registry/common/platform'; -import { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess'; -import { QuickHelpNLS } from 'vs/editor/common/standaloneStrings'; -import { HelpQuickAccessProvider } from 'vs/platform/quickinput/browser/helpQuickAccess'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { IQuickAccessRegistry, Extensions } from '../../../../platform/quickinput/common/quickAccess.js'; +import { QuickHelpNLS } from '../../../common/standaloneStrings.js'; +import { HelpQuickAccessProvider } from '../../../../platform/quickinput/browser/helpQuickAccess.js'; Registry.as(Extensions.Quickaccess).registerQuickAccessProvider({ ctor: HelpQuickAccessProvider, diff --git a/src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.ts b/src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.ts index e251afa2543..d46bbff59c3 100644 --- a/src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.ts +++ b/src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./standaloneQuickInput'; -import { Event } from 'vs/base/common/event'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IQuickInputService, IQuickPickItem, IQuickPick, IInputBox, IQuickNavigateConfiguration, IPickOptions, QuickPickInput, IInputOptions, IQuickWidget } from 'vs/platform/quickinput/common/quickInput'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { EditorScopedLayoutService } from 'vs/editor/standalone/browser/standaloneLayoutService'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { QuickInputController, IQuickInputControllerHost } from 'vs/platform/quickinput/browser/quickInputController'; -import { QuickInputService } from 'vs/platform/quickinput/browser/quickInputService'; -import { createSingleCallFunction } from 'vs/base/common/functional'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import './standaloneQuickInput.css'; +import { Event } from '../../../../base/common/event.js'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from '../../../browser/editorBrowser.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { IEditorContribution } from '../../../common/editorCommon.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { IQuickInputService, IQuickPickItem, IQuickPick, IInputBox, IQuickNavigateConfiguration, IPickOptions, QuickPickInput, IInputOptions, IQuickWidget } from '../../../../platform/quickinput/common/quickInput.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { EditorScopedLayoutService } from '../standaloneLayoutService.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { QuickInputController, IQuickInputControllerHost } from '../../../../platform/quickinput/browser/quickInputController.js'; +import { QuickInputService } from '../../../../platform/quickinput/browser/quickInputService.js'; +import { createSingleCallFunction } from '../../../../base/common/functional.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; class EditorScopedQuickInputService extends QuickInputService { @@ -111,7 +111,7 @@ export class StandaloneQuickInputService implements IQuickInputService { ) { } - pick>(picks: Promise[]> | QuickPickInput[], options: O = {}, token: CancellationToken = CancellationToken.None): Promise<(O extends { canPickMany: true } ? T[] : T) | undefined> { + 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); } @@ -119,8 +119,10 @@ export class StandaloneQuickInputService implements IQuickInputService { return this.activeService.input(options, token); } - createQuickPick(): IQuickPick { - return this.activeService.createQuickPick(); + createQuickPick(options: { useSeparators: true }): IQuickPick; + createQuickPick(options?: { useSeparators: boolean }): IQuickPick; + createQuickPick(options: { useSeparators: boolean } = { useSeparators: false }): IQuickPick { + return this.activeService.createQuickPick(options); } createInputBox(): IInputBox { diff --git a/src/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.ts b/src/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.ts index 23f8f72cced..4f287b772ea 100644 --- a/src/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.ts +++ b/src/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { ReferencesController } from 'vs/editor/contrib/gotoSymbol/browser/peek/referencesController'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IStorageService } from 'vs/platform/storage/common/storage'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorContributionInstantiation, registerEditorContribution } from '../../../browser/editorExtensions.js'; +import { ICodeEditorService } from '../../../browser/services/codeEditorService.js'; +import { ReferencesController } from '../../../contrib/gotoSymbol/browser/peek/referencesController.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; export class StandaloneReferencesController extends ReferencesController { diff --git a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts index 84deb53c57d..2b7abea38c1 100644 --- a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts @@ -3,45 +3,45 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as aria from 'vs/base/browser/ui/aria/aria'; -import { Disposable, IDisposable, toDisposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { ICodeEditor, IDiffEditor, IDiffEditorConstructionOptions } from 'vs/editor/browser/editorBrowser'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import { IDiffEditorOptions, IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { InternalEditorAction } from 'vs/editor/common/editorAction'; -import { IModelChangedEvent } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { StandaloneKeybindingService, updateConfigurationService } from 'vs/editor/standalone/browser/standaloneServices'; -import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme'; -import { IMenuItem, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; -import { CommandsRegistry, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyExpr, ContextKeyValue, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { StandaloneCodeEditorNLS } from 'vs/editor/common/standaloneStrings'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { IEditorProgressService } from 'vs/platform/progress/common/progress'; -import { StandaloneThemeService } from 'vs/editor/standalone/browser/standaloneThemeService'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ILanguageSelection, ILanguageService } from 'vs/editor/common/languages/language'; -import { URI } from 'vs/base/common/uri'; -import { StandaloneCodeEditorService } from 'vs/editor/standalone/browser/standaloneCodeEditorService'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IEditorConstructionOptions } from 'vs/editor/browser/config/editorConfiguration'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget'; -import { IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; -import { mainWindow } from 'vs/base/browser/window'; -import { setHoverDelegateFactory } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; -import { IHoverService, WorkbenchHoverDelegate } from 'vs/platform/hover/browser/hover'; -import { setBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2'; +import * as aria from '../../../base/browser/ui/aria/aria.js'; +import { Disposable, IDisposable, toDisposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { ICodeEditor, IDiffEditor, IDiffEditorConstructionOptions } from '../../browser/editorBrowser.js'; +import { ICodeEditorService } from '../../browser/services/codeEditorService.js'; +import { CodeEditorWidget } from '../../browser/widget/codeEditor/codeEditorWidget.js'; +import { IDiffEditorOptions, IEditorOptions } from '../../common/config/editorOptions.js'; +import { InternalEditorAction } from '../../common/editorAction.js'; +import { IModelChangedEvent } from '../../common/editorCommon.js'; +import { ITextModel } from '../../common/model.js'; +import { StandaloneKeybindingService, updateConfigurationService } from './standaloneServices.js'; +import { IStandaloneThemeService } from '../common/standaloneTheme.js'; +import { IMenuItem, MenuId, MenuRegistry } from '../../../platform/actions/common/actions.js'; +import { CommandsRegistry, ICommandHandler, ICommandService } from '../../../platform/commands/common/commands.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { ContextKeyExpr, ContextKeyValue, IContextKey, IContextKeyService } from '../../../platform/contextkey/common/contextkey.js'; +import { IContextMenuService } from '../../../platform/contextview/browser/contextView.js'; +import { IInstantiationService, ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js'; +import { INotificationService } from '../../../platform/notification/common/notification.js'; +import { IThemeService } from '../../../platform/theme/common/themeService.js'; +import { IAccessibilityService } from '../../../platform/accessibility/common/accessibility.js'; +import { StandaloneCodeEditorNLS } from '../../common/standaloneStrings.js'; +import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js'; +import { IEditorProgressService } from '../../../platform/progress/common/progress.js'; +import { StandaloneThemeService } from './standaloneThemeService.js'; +import { IModelService } from '../../common/services/model.js'; +import { ILanguageSelection, ILanguageService } from '../../common/languages/language.js'; +import { URI } from '../../../base/common/uri.js'; +import { StandaloneCodeEditorService } from './standaloneCodeEditorService.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../../common/languages/modesRegistry.js'; +import { ILanguageConfigurationService } from '../../common/languages/languageConfigurationRegistry.js'; +import { IEditorConstructionOptions } from '../../browser/config/editorConfiguration.js'; +import { ILanguageFeaturesService } from '../../common/services/languageFeatures.js'; +import { DiffEditorWidget } from '../../browser/widget/diffEditor/diffEditorWidget.js'; +import { IAccessibilitySignalService } from '../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { setHoverDelegateFactory } from '../../../base/browser/ui/hover/hoverDelegateFactory.js'; +import { IHoverService, WorkbenchHoverDelegate } from '../../../platform/hover/browser/hover.js'; +import { setBaseLayerHoverDelegate } from '../../../base/browser/ui/hover/hoverDelegate2.js'; /** * Description of an action contribution @@ -283,7 +283,6 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon ) { const options = { ..._options }; options.ariaLabel = options.ariaLabel || StandaloneCodeEditorNLS.editorViewAccessibleLabel; - options.ariaLabel = options.ariaLabel + ';' + (StandaloneCodeEditorNLS.accessibilityHelpMessage); super(domElement, options, {}, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService); if (keybindingService instanceof StandaloneKeybindingService) { diff --git a/src/vs/editor/standalone/browser/standaloneCodeEditorService.ts b/src/vs/editor/standalone/browser/standaloneCodeEditorService.ts index fff134d4902..700140df35c 100644 --- a/src/vs/editor/standalone/browser/standaloneCodeEditorService.ts +++ b/src/vs/editor/standalone/browser/standaloneCodeEditorService.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { windowOpenNoOpener } from 'vs/base/browser/dom'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { AbstractCodeEditorService } from 'vs/editor/browser/services/abstractCodeEditorService'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { IRange } from 'vs/editor/common/core/range'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ITextResourceEditorInput } from 'vs/platform/editor/common/editor'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { windowOpenNoOpener } from '../../../base/browser/dom.js'; +import { Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import { ICodeEditor } from '../../browser/editorBrowser.js'; +import { AbstractCodeEditorService } from '../../browser/services/abstractCodeEditorService.js'; +import { ICodeEditorService } from '../../browser/services/codeEditorService.js'; +import { IRange } from '../../common/core/range.js'; +import { ScrollType } from '../../common/editorCommon.js'; +import { ITextModel } from '../../common/model.js'; +import { IContextKey, IContextKeyService } from '../../../platform/contextkey/common/contextkey.js'; +import { ITextResourceEditorInput } from '../../../platform/editor/common/editor.js'; +import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; +import { IThemeService } from '../../../platform/theme/common/themeService.js'; export class StandaloneCodeEditorService extends AbstractCodeEditorService { diff --git a/src/vs/editor/standalone/browser/standaloneEditor.ts b/src/vs/editor/standalone/browser/standaloneEditor.ts index d1a70eba3d2..92df7c57a64 100644 --- a/src/vs/editor/standalone/browser/standaloneEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneEditor.ts @@ -3,43 +3,42 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { mainWindow } from 'vs/base/browser/window'; -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { splitLines } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import 'vs/css!./standalone-tokens'; -import { FontMeasurements } from 'vs/editor/browser/config/fontMeasurements'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { IWebWorkerOptions, MonacoWebWorker, createWebWorker as actualCreateWebWorker } from 'vs/editor/browser/services/webWorker'; -import { ApplyUpdateResult, ConfigurationChangedEvent, EditorOptions } from 'vs/editor/common/config/editorOptions'; -import { EditorZoom } from 'vs/editor/common/config/editorZoom'; -import { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo'; -import { IPosition } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { EditorType, IDiffEditor } from 'vs/editor/common/editorCommon'; -import * as languages from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { NullState, nullTokenize } from 'vs/editor/common/languages/nullTokenize'; -import { FindMatch, ITextModel, TextModelResolvedOptions } from 'vs/editor/common/model'; -import { IModelService } from 'vs/editor/common/services/model'; -import * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums'; -import { Colorizer, IColorizerElementOptions, IColorizerOptions } from 'vs/editor/standalone/browser/colorizer'; -import { IActionDescriptor, IStandaloneCodeEditor, IStandaloneDiffEditor, IStandaloneDiffEditorConstructionOptions, IStandaloneEditorConstructionOptions, StandaloneDiffEditor2, StandaloneEditor, createTextModel } from 'vs/editor/standalone/browser/standaloneCodeEditor'; -import { IEditorOverrideServices, StandaloneKeybindingService, StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices'; -import { StandaloneThemeService } from 'vs/editor/standalone/browser/standaloneThemeService'; -import { IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme'; -import { IMenuItem, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; -import { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { ITextResourceEditorInput } from 'vs/platform/editor/common/editor'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IMarker, IMarkerData, IMarkerService } from 'vs/platform/markers/common/markers'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { MultiDiffEditorWidget } from 'vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget'; +import { mainWindow } from '../../../base/browser/window.js'; +import { Disposable, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { splitLines } from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import './standalone-tokens.css'; +import { FontMeasurements } from '../../browser/config/fontMeasurements.js'; +import { ICodeEditor } from '../../browser/editorBrowser.js'; +import { EditorCommand, ServicesAccessor } from '../../browser/editorExtensions.js'; +import { ICodeEditorService } from '../../browser/services/codeEditorService.js'; +import { IWebWorkerOptions, MonacoWebWorker, createWebWorker as actualCreateWebWorker } from './standaloneWebWorker.js'; +import { ApplyUpdateResult, ConfigurationChangedEvent, EditorOptions } from '../../common/config/editorOptions.js'; +import { EditorZoom } from '../../common/config/editorZoom.js'; +import { BareFontInfo, FontInfo } from '../../common/config/fontInfo.js'; +import { IPosition } from '../../common/core/position.js'; +import { IRange } from '../../common/core/range.js'; +import { EditorType, IDiffEditor } from '../../common/editorCommon.js'; +import * as languages from '../../common/languages.js'; +import { ILanguageService } from '../../common/languages/language.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../../common/languages/modesRegistry.js'; +import { NullState, nullTokenize } from '../../common/languages/nullTokenize.js'; +import { FindMatch, ITextModel, TextModelResolvedOptions } from '../../common/model.js'; +import { IModelService } from '../../common/services/model.js'; +import * as standaloneEnums from '../../common/standalone/standaloneEnums.js'; +import { Colorizer, IColorizerElementOptions, IColorizerOptions } from './colorizer.js'; +import { IActionDescriptor, IStandaloneCodeEditor, IStandaloneDiffEditor, IStandaloneDiffEditorConstructionOptions, IStandaloneEditorConstructionOptions, StandaloneDiffEditor2, StandaloneEditor, createTextModel } from './standaloneCodeEditor.js'; +import { IEditorOverrideServices, StandaloneKeybindingService, StandaloneServices } from './standaloneServices.js'; +import { StandaloneThemeService } from './standaloneThemeService.js'; +import { IStandaloneThemeData, IStandaloneThemeService } from '../common/standaloneTheme.js'; +import { IMenuItem, MenuId, MenuRegistry } from '../../../platform/actions/common/actions.js'; +import { CommandsRegistry, ICommandHandler } from '../../../platform/commands/common/commands.js'; +import { ContextKeyExpr } from '../../../platform/contextkey/common/contextkey.js'; +import { ITextResourceEditorInput } from '../../../platform/editor/common/editor.js'; +import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js'; +import { IMarker, IMarkerData, IMarkerService } from '../../../platform/markers/common/markers.js'; +import { IOpenerService } from '../../../platform/opener/common/opener.js'; +import { MultiDiffEditorWidget } from '../../browser/widget/multiDiffEditor/multiDiffEditorWidget.js'; /** * Create a new editor under `domElement`. @@ -333,7 +332,7 @@ export function onDidChangeModelLanguage(listener: (e: { readonly model: ITextMo * Specify an AMD module to load that will `create` an object that will be proxied. */ export function createWebWorker(opts: IWebWorkerOptions): MonacoWebWorker { - return actualCreateWebWorker(StandaloneServices.get(IModelService), StandaloneServices.get(ILanguageConfigurationService), opts); + return actualCreateWebWorker(StandaloneServices.get(IModelService), opts); } /** diff --git a/src/vs/editor/standalone/browser/standaloneLanguages.ts b/src/vs/editor/standalone/browser/standaloneLanguages.ts index 7dfa6f79989..53df0a09674 100644 --- a/src/vs/editor/standalone/browser/standaloneLanguages.ts +++ b/src/vs/editor/standalone/browser/standaloneLanguages.ts @@ -3,28 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Color } from 'vs/base/common/color'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import * as languages from 'vs/editor/common/languages'; -import { ILanguageExtensionPoint, ILanguageService } from 'vs/editor/common/languages/language'; -import { LanguageConfiguration } from 'vs/editor/common/languages/languageConfiguration'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ModesRegistry } from 'vs/editor/common/languages/modesRegistry'; -import { LanguageSelector } from 'vs/editor/common/languageSelector'; -import * as model from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums'; -import { StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices'; -import { compile } from 'vs/editor/standalone/common/monarch/monarchCompile'; -import { MonarchTokenizer } from 'vs/editor/standalone/common/monarch/monarchLexer'; -import { IMonarchLanguage } from 'vs/editor/standalone/common/monarch/monarchTypes'; -import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IMarkerData, IMarkerService } from 'vs/platform/markers/common/markers'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Color } from '../../../base/common/color.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { Position } from '../../common/core/position.js'; +import { Range } from '../../common/core/range.js'; +import { MetadataConsts } from '../../common/encodedTokenAttributes.js'; +import * as languages from '../../common/languages.js'; +import { ILanguageExtensionPoint, ILanguageService } from '../../common/languages/language.js'; +import { LanguageConfiguration } from '../../common/languages/languageConfiguration.js'; +import { ILanguageConfigurationService } from '../../common/languages/languageConfigurationRegistry.js'; +import { ModesRegistry } from '../../common/languages/modesRegistry.js'; +import { LanguageSelector } from '../../common/languageSelector.js'; +import * as model from '../../common/model.js'; +import { ILanguageFeaturesService } from '../../common/services/languageFeatures.js'; +import * as standaloneEnums from '../../common/standalone/standaloneEnums.js'; +import { StandaloneServices } from './standaloneServices.js'; +import { compile } from '../common/monarch/monarchCompile.js'; +import { MonarchTokenizer } from '../common/monarch/monarchLexer.js'; +import { IMonarchLanguage } from '../common/monarch/monarchTypes.js'; +import { IStandaloneThemeService } from '../common/standaloneTheme.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { IMarkerData, IMarkerService } from '../../../platform/markers/common/markers.js'; /** * Register information about a new language. diff --git a/src/vs/editor/standalone/browser/standaloneLayoutService.ts b/src/vs/editor/standalone/browser/standaloneLayoutService.ts index 8b55de680ba..18ec806b162 100644 --- a/src/vs/editor/standalone/browser/standaloneLayoutService.ts +++ b/src/vs/editor/standalone/browser/standaloneLayoutService.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { mainWindow } from 'vs/base/browser/window'; -import { coalesce, firstOrDefault } from 'vs/base/common/arrays'; -import { Event } from 'vs/base/common/event'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { ILayoutOffsetInfo, ILayoutService } from 'vs/platform/layout/browser/layoutService'; +import * as dom from '../../../base/browser/dom.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { coalesce } from '../../../base/common/arrays.js'; +import { Event } from '../../../base/common/event.js'; +import { ICodeEditorService } from '../../browser/services/codeEditorService.js'; +import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; +import { ILayoutOffsetInfo, ILayoutService } from '../../../platform/layout/browser/layoutService.js'; class StandaloneLayoutService implements ILayoutService { declare readonly _serviceBrand: undefined; @@ -21,7 +21,7 @@ class StandaloneLayoutService implements ILayoutService { readonly onDidAddContainer = Event.None; get mainContainer(): HTMLElement { - return firstOrDefault(this._codeEditorService.listCodeEditors())?.getContainerDomNode() ?? mainWindow.document.body; + return this._codeEditorService.listCodeEditors().at(0)?.getContainerDomNode() ?? mainWindow.document.body; } get activeContainer(): HTMLElement { diff --git a/src/vs/editor/standalone/browser/standaloneServices.ts b/src/vs/editor/standalone/browser/standaloneServices.ts index 9682a3cfb0f..085ca6352f2 100644 --- a/src/vs/editor/standalone/browser/standaloneServices.ts +++ b/src/vs/editor/standalone/browser/standaloneServices.ts @@ -3,98 +3,102 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/editor/common/languages/languageConfigurationRegistry'; -import 'vs/editor/standalone/browser/standaloneCodeEditorService'; -import 'vs/editor/standalone/browser/standaloneLayoutService'; -import 'vs/platform/undoRedo/common/undoRedoService'; -import 'vs/editor/common/services/languageFeatureDebounce'; -import 'vs/editor/common/services/semanticTokensStylingService'; -import 'vs/editor/common/services/languageFeaturesService'; -import 'vs/editor/browser/services/hoverService/hoverService'; - -import * as strings from 'vs/base/common/strings'; -import * as dom from 'vs/base/browser/dom'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { Emitter, Event, IValueWithChangeEvent, ValueWithChangeEvent } from 'vs/base/common/event'; -import { ResolvedKeybinding, KeyCodeChord, Keybinding, decodeKeybinding } from 'vs/base/common/keybindings'; -import { IDisposable, IReference, ImmortalReference, toDisposable, DisposableStore, Disposable, combinedDisposable } from 'vs/base/common/lifecycle'; -import { OS, isLinux, isMacintosh } from 'vs/base/common/platform'; -import Severity from 'vs/base/common/severity'; -import { URI } from 'vs/base/common/uri'; -import { IBulkEditOptions, IBulkEditResult, IBulkEditService, ResourceEdit, ResourceTextEdit } from 'vs/editor/browser/services/bulkEditService'; -import { isDiffEditorConfigurationKey, isEditorConfigurationKey } from 'vs/editor/common/config/editorConfigurationSchema'; -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { IPosition, Position as Pos } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ITextModel, ITextSnapshot } from 'vs/editor/common/model'; -import { IModelService } from 'vs/editor/common/services/model'; -import { IResolvedTextEditorModel, ITextModelContentProvider, ITextModelService } from 'vs/editor/common/services/resolverService'; -import { ITextResourceConfigurationService, ITextResourcePropertiesService, ITextResourceConfigurationChangeEvent } from 'vs/editor/common/services/textResourceConfiguration'; -import { CommandsRegistry, ICommandEvent, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands'; -import { IConfigurationChangeEvent, IConfigurationData, IConfigurationOverrides, IConfigurationService, IConfigurationModel, IConfigurationValue, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; -import { Configuration, ConfigurationModel, ConfigurationChangeEvent } from 'vs/platform/configuration/common/configurationModels'; -import { IContextKeyService, ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey'; -import { IConfirmation, IConfirmationResult, IDialogService, IInputResult, IPrompt, IPromptResult, IPromptWithCustomCancel, IPromptResultWithCancel, IPromptWithDefaultCancel, IPromptBaseButton } from 'vs/platform/dialogs/common/dialogs'; -import { createDecorator, IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; -import { AbstractKeybindingService } from 'vs/platform/keybinding/common/abstractKeybindingService'; -import { IKeybindingService, IKeyboardEvent, KeybindingsSchemaContribution } from 'vs/platform/keybinding/common/keybinding'; -import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver'; -import { IKeybindingItem, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; -import { ILabelService, ResourceLabelFormatter, IFormatterChangeEvent, Verbosity } from 'vs/platform/label/common/label'; -import { INotification, INotificationHandle, INotificationService, IPromptChoice, IPromptOptions, NoOpNotification, IStatusMessageOptions, INotificationSource, INotificationSourceFilter, NotificationsFilter } from 'vs/platform/notification/common/notification'; -import { IProgressRunner, IEditorProgressService, IProgressService, IProgress, IProgressCompositeOptions, IProgressDialogOptions, IProgressNotificationOptions, IProgressOptions, IProgressStep, IProgressWindowOptions } from 'vs/platform/progress/common/progress'; -import { ITelemetryService, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier, IWorkspace, IWorkspaceContextService, IWorkspaceFolder, IWorkspaceFoldersChangeEvent, IWorkspaceFoldersWillChangeEvent, WorkbenchState, WorkspaceFolder, STANDALONE_EDITOR_WORKSPACE_ID } from 'vs/platform/workspace/common/workspace'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { StandaloneServicesNLS } from 'vs/editor/common/standaloneStrings'; -import { basename } from 'vs/base/common/resources'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { ConsoleLogger, ILogService } from 'vs/platform/log/common/log'; -import { IWorkspaceTrustManagementService, IWorkspaceTrustTransitionParticipant, IWorkspaceTrustUriInfo } from 'vs/platform/workspace/common/workspaceTrust'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { IContextMenuService, IContextViewDelegate, IContextViewService, IOpenContextView } from 'vs/platform/contextview/browser/contextView'; -import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService'; -import { LanguageService } from 'vs/editor/common/services/languageService'; -import { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService'; -import { getSingletonServiceDescriptors, InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { OpenerService } from 'vs/editor/browser/services/openerService'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { EditorWorkerService } from 'vs/editor/browser/services/editorWorkerService'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { MarkerDecorationsService } from 'vs/editor/common/services/markerDecorationsService'; -import { IMarkerDecorationsService } from 'vs/editor/common/services/markerDecorations'; -import { ModelService } from 'vs/editor/common/services/modelService'; -import { StandaloneQuickInputService } from 'vs/editor/standalone/browser/quickInput/standaloneQuickInputService'; -import { StandaloneThemeService } from 'vs/editor/standalone/browser/standaloneThemeService'; -import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme'; -import { AccessibilityService } from 'vs/platform/accessibility/browser/accessibilityService'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { IMenuService } from 'vs/platform/actions/common/actions'; -import { MenuService } from 'vs/platform/actions/common/menuService'; -import { BrowserClipboardService } from 'vs/platform/clipboard/browser/clipboardService'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IListService, ListService } from 'vs/platform/list/browser/listService'; -import { IMarkerService } from 'vs/platform/markers/common/markers'; -import { MarkerService } from 'vs/platform/markers/common/markerService'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { IStorageService, InMemoryStorageService } from 'vs/platform/storage/common/storage'; -import { DefaultConfiguration } from 'vs/platform/configuration/common/configurations'; -import { WorkspaceEdit } from 'vs/editor/common/languages'; -import { AccessibilitySignal, AccessibilityModality, IAccessibilitySignalService, Sound } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; -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 './standaloneCodeEditorService.js'; +import './standaloneLayoutService.js'; +import '../../../platform/undoRedo/common/undoRedoService.js'; +import '../../common/services/languageFeatureDebounce.js'; +import '../../common/services/semanticTokensStylingService.js'; +import '../../common/services/languageFeaturesService.js'; +import '../../browser/services/hoverService/hoverService.js'; + +import * as strings from '../../../base/common/strings.js'; +import * as dom from '../../../base/browser/dom.js'; +import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { Emitter, Event, IValueWithChangeEvent, ValueWithChangeEvent } from '../../../base/common/event.js'; +import { ResolvedKeybinding, KeyCodeChord, Keybinding, decodeKeybinding } from '../../../base/common/keybindings.js'; +import { IDisposable, IReference, ImmortalReference, toDisposable, DisposableStore, Disposable, combinedDisposable } from '../../../base/common/lifecycle.js'; +import { OS, isLinux, isMacintosh } from '../../../base/common/platform.js'; +import Severity from '../../../base/common/severity.js'; +import { URI } from '../../../base/common/uri.js'; +import { IBulkEditOptions, IBulkEditResult, IBulkEditService, ResourceEdit, ResourceTextEdit } from '../../browser/services/bulkEditService.js'; +import { isDiffEditorConfigurationKey, isEditorConfigurationKey } from '../../common/config/editorConfigurationSchema.js'; +import { EditOperation, ISingleEditOperation } from '../../common/core/editOperation.js'; +import { IPosition, Position as Pos } from '../../common/core/position.js'; +import { Range } from '../../common/core/range.js'; +import { ITextModel, ITextSnapshot } from '../../common/model.js'; +import { IModelService } from '../../common/services/model.js'; +import { IResolvedTextEditorModel, ITextModelContentProvider, ITextModelService } from '../../common/services/resolverService.js'; +import { ITextResourceConfigurationService, ITextResourcePropertiesService, ITextResourceConfigurationChangeEvent } from '../../common/services/textResourceConfiguration.js'; +import { CommandsRegistry, ICommandEvent, ICommandHandler, ICommandService } from '../../../platform/commands/common/commands.js'; +import { IConfigurationChangeEvent, IConfigurationData, IConfigurationOverrides, IConfigurationService, IConfigurationModel, IConfigurationValue, ConfigurationTarget } from '../../../platform/configuration/common/configuration.js'; +import { Configuration, ConfigurationModel, ConfigurationChangeEvent } from '../../../platform/configuration/common/configurationModels.js'; +import { IContextKeyService, ContextKeyExpression } from '../../../platform/contextkey/common/contextkey.js'; +import { IConfirmation, IConfirmationResult, IDialogService, IInputResult, IPrompt, IPromptResult, IPromptWithCustomCancel, IPromptResultWithCancel, IPromptWithDefaultCancel, IPromptBaseButton } from '../../../platform/dialogs/common/dialogs.js'; +import { createDecorator, IInstantiationService, ServiceIdentifier } from '../../../platform/instantiation/common/instantiation.js'; +import { AbstractKeybindingService } from '../../../platform/keybinding/common/abstractKeybindingService.js'; +import { IKeybindingService, IKeyboardEvent, KeybindingsSchemaContribution } from '../../../platform/keybinding/common/keybinding.js'; +import { KeybindingResolver } from '../../../platform/keybinding/common/keybindingResolver.js'; +import { IKeybindingItem, KeybindingsRegistry } from '../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ResolvedKeybindingItem } from '../../../platform/keybinding/common/resolvedKeybindingItem.js'; +import { USLayoutResolvedKeybinding } from '../../../platform/keybinding/common/usLayoutResolvedKeybinding.js'; +import { ILabelService, ResourceLabelFormatter, IFormatterChangeEvent, Verbosity } from '../../../platform/label/common/label.js'; +import { INotification, INotificationHandle, INotificationService, IPromptChoice, IPromptOptions, NoOpNotification, IStatusMessageOptions, INotificationSource, INotificationSourceFilter, NotificationsFilter } from '../../../platform/notification/common/notification.js'; +import { IProgressRunner, IEditorProgressService, IProgressService, IProgress, IProgressCompositeOptions, IProgressDialogOptions, IProgressNotificationOptions, IProgressOptions, IProgressStep, IProgressWindowOptions } from '../../../platform/progress/common/progress.js'; +import { ITelemetryService, TelemetryLevel } from '../../../platform/telemetry/common/telemetry.js'; +import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier, IWorkspace, IWorkspaceContextService, IWorkspaceFolder, IWorkspaceFoldersChangeEvent, IWorkspaceFoldersWillChangeEvent, WorkbenchState, WorkspaceFolder, STANDALONE_EDITOR_WORKSPACE_ID } from '../../../platform/workspace/common/workspace.js'; +import { ILayoutService } from '../../../platform/layout/browser/layoutService.js'; +import { StandaloneServicesNLS } from '../../common/standaloneStrings.js'; +import { basename } from '../../../base/common/resources.js'; +import { ICodeEditorService } from '../../browser/services/codeEditorService.js'; +import { ConsoleLogger, ILogService } from '../../../platform/log/common/log.js'; +import { IWorkspaceTrustManagementService, IWorkspaceTrustTransitionParticipant, IWorkspaceTrustUriInfo } from '../../../platform/workspace/common/workspaceTrust.js'; +import { EditorOption } from '../../common/config/editorOptions.js'; +import { ICodeEditor, IDiffEditor } from '../../browser/editorBrowser.js'; +import { IContextMenuService, IContextViewDelegate, IContextViewService, IOpenContextView } from '../../../platform/contextview/browser/contextView.js'; +import { ContextViewService } from '../../../platform/contextview/browser/contextViewService.js'; +import { LanguageService } from '../../common/services/languageService.js'; +import { ContextMenuService } from '../../../platform/contextview/browser/contextMenuService.js'; +import { getSingletonServiceDescriptors, InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; +import { OpenerService } from '../../browser/services/openerService.js'; +import { IEditorWorkerService } from '../../common/services/editorWorker.js'; +import { EditorWorkerService } from '../../browser/services/editorWorkerService.js'; +import { ILanguageService } from '../../common/languages/language.js'; +import { MarkerDecorationsService } from '../../common/services/markerDecorationsService.js'; +import { IMarkerDecorationsService } from '../../common/services/markerDecorations.js'; +import { ModelService } from '../../common/services/modelService.js'; +import { StandaloneQuickInputService } from './quickInput/standaloneQuickInputService.js'; +import { StandaloneThemeService } from './standaloneThemeService.js'; +import { IStandaloneThemeService } from '../common/standaloneTheme.js'; +import { AccessibilityService } from '../../../platform/accessibility/browser/accessibilityService.js'; +import { IAccessibilityService } from '../../../platform/accessibility/common/accessibility.js'; +import { IMenuService } from '../../../platform/actions/common/actions.js'; +import { MenuService } from '../../../platform/actions/common/menuService.js'; +import { BrowserClipboardService } from '../../../platform/clipboard/browser/clipboardService.js'; +import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js'; +import { ContextKeyService } from '../../../platform/contextkey/browser/contextKeyService.js'; +import { SyncDescriptor } from '../../../platform/instantiation/common/descriptors.js'; +import { InstantiationService } from '../../../platform/instantiation/common/instantiationService.js'; +import { ServiceCollection } from '../../../platform/instantiation/common/serviceCollection.js'; +import { IListService, ListService } from '../../../platform/list/browser/listService.js'; +import { IMarkerService } from '../../../platform/markers/common/markers.js'; +import { MarkerService } from '../../../platform/markers/common/markerService.js'; +import { IOpenerService } from '../../../platform/opener/common/opener.js'; +import { IQuickInputService } from '../../../platform/quickinput/common/quickInput.js'; +import { IStorageService, InMemoryStorageService } from '../../../platform/storage/common/storage.js'; +import { DefaultConfiguration } from '../../../platform/configuration/common/configurations.js'; +import { WorkspaceEdit } from '../../common/languages.js'; +import { AccessibilitySignal, AccessibilityModality, IAccessibilitySignalService, Sound } from '../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; +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'; +import { ITreeSitterParserService } from '../../common/services/treeSitterParserService.js'; +import { StandaloneTreeSitterParserService } from './standaloneTreeSitterService.js'; +import { IWorkerDescriptor } from '../../../base/common/worker/simpleWorker.js'; class SimpleModel implements IResolvedTextEditorModel { @@ -1072,6 +1076,24 @@ class StandaloneContextMenuService extends ContextMenuService { } } +export const standaloneEditorWorkerDescriptor: IWorkerDescriptor = { + amdModuleId: 'vs/editor/common/services/editorSimpleWorker', + esmModuleLocation: undefined, + label: 'editorWorkerService' +}; + +class StandaloneEditorWorkerService extends EditorWorkerService { + constructor( + @IModelService modelService: IModelService, + @ITextResourceConfigurationService configurationService: ITextResourceConfigurationService, + @ILogService logService: ILogService, + @ILanguageConfigurationService languageConfigurationService: ILanguageConfigurationService, + @ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService, + ) { + super(standaloneEditorWorkerDescriptor, modelService, configurationService, logService, languageConfigurationService, languageFeaturesService); + } +} + class StandaloneAccessbilitySignalService implements IAccessibilitySignalService { _serviceBrand: undefined; async playSignal(cue: AccessibilitySignal, options: {}): Promise { @@ -1130,7 +1152,7 @@ registerSingleton(IContextKeyService, ContextKeyService, InstantiationType.Eager registerSingleton(IProgressService, StandaloneProgressService, InstantiationType.Eager); registerSingleton(IEditorProgressService, StandaloneEditorProgressService, InstantiationType.Eager); registerSingleton(IStorageService, InMemoryStorageService, InstantiationType.Eager); -registerSingleton(IEditorWorkerService, EditorWorkerService, InstantiationType.Eager); +registerSingleton(IEditorWorkerService, StandaloneEditorWorkerService, InstantiationType.Eager); registerSingleton(IBulkEditService, StandaloneBulkEditService, InstantiationType.Eager); registerSingleton(IWorkspaceTrustManagementService, StandaloneWorkspaceTrustManagementService, InstantiationType.Eager); registerSingleton(ITextModelService, StandaloneTextModelService, InstantiationType.Eager); @@ -1145,6 +1167,7 @@ registerSingleton(IClipboardService, BrowserClipboardService, InstantiationType. registerSingleton(IContextMenuService, StandaloneContextMenuService, InstantiationType.Eager); registerSingleton(IMenuService, MenuService, InstantiationType.Eager); registerSingleton(IAccessibilitySignalService, StandaloneAccessbilitySignalService, InstantiationType.Eager); +registerSingleton(ITreeSitterParserService, StandaloneTreeSitterParserService, InstantiationType.Eager); /** * We don't want to eagerly instantiate services because embedders get a one time chance diff --git a/src/vs/editor/standalone/browser/standaloneThemeService.ts b/src/vs/editor/standalone/browser/standaloneThemeService.ts index 959ca90487a..eb2470683cc 100644 --- a/src/vs/editor/standalone/browser/standaloneThemeService.ts +++ b/src/vs/editor/standalone/browser/standaloneThemeService.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { addMatchMediaChangeListener } from 'vs/base/browser/browser'; -import { Color } from 'vs/base/common/color'; -import { Emitter } from 'vs/base/common/event'; -import { TokenizationRegistry } from 'vs/editor/common/languages'; -import { FontStyle, TokenMetadata } from 'vs/editor/common/encodedTokenAttributes'; -import { ITokenThemeRule, TokenTheme, generateTokensCSSForColorMap } from 'vs/editor/common/languages/supports/tokenization'; -import { BuiltinTheme, IStandaloneTheme, IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme'; -import { hc_black, hc_light, vs, vs_dark } from 'vs/editor/standalone/common/themes'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { asCssVariableName, ColorIdentifier, Extensions, IColorRegistry } from 'vs/platform/theme/common/colorRegistry'; -import { Extensions as ThemingExtensions, ICssStyleCollector, IFileIconTheme, IProductIconTheme, IThemingRegistry, ITokenStyle } from 'vs/platform/theme/common/themeService'; -import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; -import { ColorScheme, isDark, isHighContrast } from 'vs/platform/theme/common/theme'; -import { getIconsStyleSheet, UnthemedProductIconTheme } from 'vs/platform/theme/browser/iconsStyleSheet'; -import { mainWindow } from 'vs/base/browser/window'; +import * as dom from '../../../base/browser/dom.js'; +import { addMatchMediaChangeListener } from '../../../base/browser/browser.js'; +import { Color } from '../../../base/common/color.js'; +import { Emitter } from '../../../base/common/event.js'; +import { TokenizationRegistry } from '../../common/languages.js'; +import { FontStyle, TokenMetadata } from '../../common/encodedTokenAttributes.js'; +import { ITokenThemeRule, TokenTheme, generateTokensCSSForColorMap } from '../../common/languages/supports/tokenization.js'; +import { BuiltinTheme, IStandaloneTheme, IStandaloneThemeData, IStandaloneThemeService } from '../common/standaloneTheme.js'; +import { hc_black, hc_light, vs, vs_dark } from '../common/themes.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { asCssVariableName, ColorIdentifier, Extensions, IColorRegistry } from '../../../platform/theme/common/colorRegistry.js'; +import { Extensions as ThemingExtensions, ICssStyleCollector, IFileIconTheme, IProductIconTheme, IThemingRegistry, ITokenStyle } from '../../../platform/theme/common/themeService.js'; +import { IDisposable, Disposable } from '../../../base/common/lifecycle.js'; +import { ColorScheme, isDark, isHighContrast } from '../../../platform/theme/common/theme.js'; +import { getIconsStyleSheet, UnthemedProductIconTheme } from '../../../platform/theme/browser/iconsStyleSheet.js'; +import { mainWindow } from '../../../base/browser/window.js'; export const VS_LIGHT_THEME_NAME = 'vs'; export const VS_DARK_THEME_NAME = 'vs-dark'; diff --git a/src/vs/editor/standalone/browser/standaloneTreeSitterService.ts b/src/vs/editor/standalone/browser/standaloneTreeSitterService.ts new file mode 100644 index 00000000000..90257943088 --- /dev/null +++ b/src/vs/editor/standalone/browser/standaloneTreeSitterService.ts @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type { Parser } from '@vscode/tree-sitter-wasm'; +import { Event } from '../../../base/common/event.js'; +import { ITextModel } from '../../common/model.js'; +import { ITreeSitterParseResult, ITreeSitterParserService } from '../../common/services/treeSitterParserService.js'; + +/** + * The monaco build doesn't like the dynamic import of tree sitter in the real service. + * We use a dummy sertive here to make the build happy. + */ +export class StandaloneTreeSitterParserService implements ITreeSitterParserService { + readonly _serviceBrand: undefined; + onDidAddLanguage: Event<{ id: string; language: Parser.Language }> = Event.None; + + getOrInitLanguage(_languageId: string): Parser.Language | undefined { + return undefined; + } + getParseResult(textModel: ITextModel): ITreeSitterParseResult | undefined { + return undefined; + } +} diff --git a/src/vs/editor/browser/services/webWorker.ts b/src/vs/editor/standalone/browser/standaloneWebWorker.ts similarity index 76% rename from src/vs/editor/browser/services/webWorker.ts rename to src/vs/editor/standalone/browser/standaloneWebWorker.ts index b5757c58865..22d073a4850 100644 --- a/src/vs/editor/browser/services/webWorker.ts +++ b/src/vs/editor/standalone/browser/standaloneWebWorker.ts @@ -3,18 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getAllMethodNames } from 'vs/base/common/objects'; -import { URI } from 'vs/base/common/uri'; -import { EditorWorkerClient } from 'vs/editor/browser/services/editorWorkerService'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { IModelService } from 'vs/editor/common/services/model'; +import { getAllMethodNames } from '../../../base/common/objects.js'; +import { URI } from '../../../base/common/uri.js'; +import { IWorkerDescriptor } from '../../../base/common/worker/simpleWorker.js'; +import { EditorWorkerClient } from '../../browser/services/editorWorkerService.js'; +import { IModelService } from '../../common/services/model.js'; +import { standaloneEditorWorkerDescriptor } from './standaloneServices.js'; /** * Create a new web worker that has model syncing capabilities built in. * Specify an AMD module to load that will `create` an object that will be proxied. */ -export function createWebWorker(modelService: IModelService, languageConfigurationService: ILanguageConfigurationService, opts: IWebWorkerOptions): MonacoWebWorker { - return new MonacoWebWorkerImpl(modelService, languageConfigurationService, opts); +export function createWebWorker(modelService: IModelService, opts: IWebWorkerOptions): MonacoWebWorker { + return new MonacoWebWorkerImpl(modelService, opts); } /** @@ -68,8 +69,13 @@ class MonacoWebWorkerImpl extends EditorWorkerClient implement private _foreignModuleCreateData: any | null; private _foreignProxy: Promise | null; - constructor(modelService: IModelService, languageConfigurationService: ILanguageConfigurationService, opts: IWebWorkerOptions) { - super(modelService, opts.keepIdleModels || false, opts.label, languageConfigurationService); + constructor(modelService: IModelService, opts: IWebWorkerOptions) { + const workerDescriptor: IWorkerDescriptor = { + amdModuleId: standaloneEditorWorkerDescriptor.amdModuleId, + esmModuleLocation: standaloneEditorWorkerDescriptor.esmModuleLocation, + label: opts.label, + }; + super(workerDescriptor, opts.keepIdleModels || false, modelService); this._foreignModuleId = opts.moduleId; this._foreignModuleCreateData = opts.createData || null; this._foreignModuleHost = opts.host || null; @@ -93,11 +99,11 @@ class MonacoWebWorkerImpl extends EditorWorkerClient implement if (!this._foreignProxy) { this._foreignProxy = this._getProxy().then((proxy) => { const foreignHostMethods = this._foreignModuleHost ? getAllMethodNames(this._foreignModuleHost) : []; - return proxy.loadForeignModule(this._foreignModuleId, this._foreignModuleCreateData, foreignHostMethods).then((foreignMethods) => { + return proxy.$loadForeignModule(this._foreignModuleId, this._foreignModuleCreateData, foreignHostMethods).then((foreignMethods) => { this._foreignModuleCreateData = null; const proxyMethodRequest = (method: string, args: any[]): Promise => { - return proxy.fmr(method, args); + return proxy.$fmr(method, args); }; const createProxyMethod = (method: string, proxyMethodRequest: (method: string, args: any[]) => Promise): () => Promise => { @@ -124,6 +130,6 @@ class MonacoWebWorkerImpl extends EditorWorkerClient implement } public withSyncedResources(resources: URI[]): Promise { - return this._withSyncedResources(resources).then(_ => this.getProxy()); + return this.workerWithSyncedResources(resources).then(_ => this.getProxy()); } } diff --git a/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts b/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts index 4fe1552ebd5..a824d4b615f 100644 --- a/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts +++ b/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorAction, ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions'; -import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme'; -import { ToggleHighContrastNLS } from 'vs/editor/common/standaloneStrings'; -import { isDark, isHighContrast } from 'vs/platform/theme/common/theme'; -import { HC_BLACK_THEME_NAME, HC_LIGHT_THEME_NAME, VS_DARK_THEME_NAME, VS_LIGHT_THEME_NAME } from 'vs/editor/standalone/browser/standaloneThemeService'; +import { ICodeEditor } from '../../../browser/editorBrowser.js'; +import { EditorAction, ServicesAccessor, registerEditorAction } from '../../../browser/editorExtensions.js'; +import { IStandaloneThemeService } from '../../common/standaloneTheme.js'; +import { ToggleHighContrastNLS } from '../../../common/standaloneStrings.js'; +import { isDark, isHighContrast } from '../../../../platform/theme/common/theme.js'; +import { HC_BLACK_THEME_NAME, HC_LIGHT_THEME_NAME, VS_DARK_THEME_NAME, VS_LIGHT_THEME_NAME } from '../standaloneThemeService.js'; class ToggleHighContrast extends EditorAction { diff --git a/src/vs/editor/standalone/common/monarch/monarchCompile.ts b/src/vs/editor/standalone/common/monarch/monarchCompile.ts index 599c89a0213..8f3e2bef672 100644 --- a/src/vs/editor/standalone/common/monarch/monarchCompile.ts +++ b/src/vs/editor/standalone/common/monarch/monarchCompile.ts @@ -8,8 +8,8 @@ * into a typed and checked ILexer definition. */ -import * as monarchCommon from 'vs/editor/standalone/common/monarch/monarchCommon'; -import { IMonarchLanguage, IMonarchLanguageBracket } from 'vs/editor/standalone/common/monarch/monarchTypes'; +import * as monarchCommon from './monarchCommon.js'; +import { IMonarchLanguage, IMonarchLanguageBracket } from './monarchTypes.js'; /* * Type helpers diff --git a/src/vs/editor/standalone/common/monarch/monarchLexer.ts b/src/vs/editor/standalone/common/monarch/monarchLexer.ts index d1d2c2c1f76..b48d54598e5 100644 --- a/src/vs/editor/standalone/common/monarch/monarchLexer.ts +++ b/src/vs/editor/standalone/common/monarch/monarchLexer.ts @@ -8,15 +8,15 @@ * using regular expressions. */ -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import * as languages from 'vs/editor/common/languages'; -import { NullState, nullTokenizeEncoded, nullTokenize } from 'vs/editor/common/languages/nullTokenize'; -import { TokenTheme } from 'vs/editor/common/languages/supports/tokenization'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import * as monarchCommon from 'vs/editor/standalone/common/monarch/monarchCommon'; -import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { LanguageId, MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; +import { Disposable, IDisposable } from '../../../../base/common/lifecycle.js'; +import * as languages from '../../../common/languages.js'; +import { NullState, nullTokenizeEncoded, nullTokenize } from '../../../common/languages/nullTokenize.js'; +import { TokenTheme } from '../../../common/languages/supports/tokenization.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import * as monarchCommon from './monarchCommon.js'; +import { IStandaloneThemeService } from '../standaloneTheme.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { LanguageId, MetadataConsts } from '../../../common/encodedTokenAttributes.js'; const CACHE_STACK_DEPTH = 5; diff --git a/src/vs/editor/standalone/common/standaloneTheme.ts b/src/vs/editor/standalone/common/standaloneTheme.ts index 44ed8d14cd9..717b0de4fb2 100644 --- a/src/vs/editor/standalone/common/standaloneTheme.ts +++ b/src/vs/editor/standalone/common/standaloneTheme.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Color } from 'vs/base/common/color'; -import { ITokenThemeRule, TokenTheme } from 'vs/editor/common/languages/supports/tokenization'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService'; +import { Color } from '../../../base/common/color.js'; +import { ITokenThemeRule, TokenTheme } from '../../common/languages/supports/tokenization.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IColorTheme, IThemeService } from '../../../platform/theme/common/themeService.js'; export const IStandaloneThemeService = createDecorator('themeService'); diff --git a/src/vs/editor/standalone/common/themes.ts b/src/vs/editor/standalone/common/themes.ts index e5f9b91bf22..2e24698ecf0 100644 --- a/src/vs/editor/standalone/common/themes.ts +++ b/src/vs/editor/standalone/common/themes.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { editorActiveIndentGuide1, editorIndentGuide1 } from 'vs/editor/common/core/editorColorRegistry'; -import { IStandaloneThemeData } from 'vs/editor/standalone/common/standaloneTheme'; -import { editorBackground, editorForeground, editorInactiveSelection, editorSelectionHighlight } from 'vs/platform/theme/common/colorRegistry'; +import { editorActiveIndentGuide1, editorIndentGuide1 } from '../../common/core/editorColorRegistry.js'; +import { IStandaloneThemeData } from './standaloneTheme.js'; +import { editorBackground, editorForeground, editorInactiveSelection, editorSelectionHighlight } from '../../../platform/theme/common/colorRegistry.js'; /* -------------------------------- Begin vs theme -------------------------------- */ export const vs: IStandaloneThemeData = { diff --git a/src/vs/editor/standalone/test/browser/monarch.test.ts b/src/vs/editor/standalone/test/browser/monarch.test.ts index fbe58b62169..f7048db8e35 100644 --- a/src/vs/editor/standalone/test/browser/monarch.test.ts +++ b/src/vs/editor/standalone/test/browser/monarch.test.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Token, TokenizationRegistry } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { LanguageService } from 'vs/editor/common/services/languageService'; -import { StandaloneConfigurationService } from 'vs/editor/standalone/browser/standaloneServices'; -import { compile } from 'vs/editor/standalone/common/monarch/monarchCompile'; -import { MonarchTokenizer } from 'vs/editor/standalone/common/monarch/monarchLexer'; -import { IMonarchLanguage } from 'vs/editor/standalone/common/monarch/monarchTypes'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { NullLogService } from 'vs/platform/log/common/log'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Token, TokenizationRegistry } from '../../../common/languages.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { LanguageService } from '../../../common/services/languageService.js'; +import { StandaloneConfigurationService } from '../../browser/standaloneServices.js'; +import { compile } from '../../common/monarch/monarchCompile.js'; +import { MonarchTokenizer } from '../../common/monarch/monarchLexer.js'; +import { IMonarchLanguage } from '../../common/monarch/monarchTypes.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; suite('Monarch', () => { @@ -233,7 +233,7 @@ suite('Monarch', () => { uselessReplaceKey2: '@uselessReplaceKey3', uselessReplaceKey3: '@uselessReplaceKey4', uselessReplaceKey4: '@uselessReplaceKey5', - uselessReplaceKey5: '@ham' || '', + uselessReplaceKey5: '@ham', tokenizer: { root: [ { diff --git a/src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts b/src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts index 745c0075541..0fa82cf782b 100644 --- a/src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts +++ b/src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts @@ -4,20 +4,20 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Color } from 'vs/base/common/color'; -import { Emitter } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { LanguageId, MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { IState, Token } from 'vs/editor/common/languages'; -import { TokenTheme } from 'vs/editor/common/languages/supports/tokenization'; -import { LanguageService } from 'vs/editor/common/services/languageService'; -import { ILineTokens, IToken, TokenizationSupportAdapter, TokensProvider } from 'vs/editor/standalone/browser/standaloneLanguages'; -import { IStandaloneTheme, IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneTheme'; -import { UnthemedProductIconTheme } from 'vs/platform/theme/browser/iconsStyleSheet'; -import { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; -import { ColorScheme } from 'vs/platform/theme/common/theme'; -import { IColorTheme, IFileIconTheme, IProductIconTheme, ITokenStyle } from 'vs/platform/theme/common/themeService'; +import { Color } from '../../../../base/common/color.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { LanguageId, MetadataConsts } from '../../../common/encodedTokenAttributes.js'; +import { IState, Token } from '../../../common/languages.js'; +import { TokenTheme } from '../../../common/languages/supports/tokenization.js'; +import { LanguageService } from '../../../common/services/languageService.js'; +import { ILineTokens, IToken, TokenizationSupportAdapter, TokensProvider } from '../../browser/standaloneLanguages.js'; +import { IStandaloneTheme, IStandaloneThemeData, IStandaloneThemeService } from '../../common/standaloneTheme.js'; +import { UnthemedProductIconTheme } from '../../../../platform/theme/browser/iconsStyleSheet.js'; +import { ColorIdentifier } from '../../../../platform/theme/common/colorRegistry.js'; +import { ColorScheme } from '../../../../platform/theme/common/theme.js'; +import { IColorTheme, IFileIconTheme, IProductIconTheme, ITokenStyle } from '../../../../platform/theme/common/themeService.js'; suite('TokenizationSupport2Adapter', () => { diff --git a/src/vs/editor/standalone/test/browser/standaloneServices.test.ts b/src/vs/editor/standalone/test/browser/standaloneServices.test.ts index 649783848e3..666ddc2a6b9 100644 --- a/src/vs/editor/standalone/test/browser/standaloneServices.test.ts +++ b/src/vs/editor/standalone/test/browser/standaloneServices.test.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { StandaloneCodeEditorService } from 'vs/editor/standalone/browser/standaloneCodeEditorService'; -import { StandaloneCommandService, StandaloneConfigurationService, StandaloneKeybindingService, StandaloneNotificationService } from 'vs/editor/standalone/browser/standaloneServices'; -import { StandaloneThemeService } from 'vs/editor/standalone/browser/standaloneThemeService'; -import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { StandaloneCodeEditorService } from '../../browser/standaloneCodeEditorService.js'; +import { StandaloneCommandService, StandaloneConfigurationService, StandaloneKeybindingService, StandaloneNotificationService } from '../../browser/standaloneServices.js'; +import { StandaloneThemeService } from '../../browser/standaloneThemeService.js'; +import { ContextKeyService } from '../../../../platform/contextkey/browser/contextKeyService.js'; +import { InstantiationService } from '../../../../platform/instantiation/common/instantiationService.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { IKeyboardEvent } from '../../../../platform/keybinding/common/keybinding.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { NullTelemetryService } from '../../../../platform/telemetry/common/telemetryUtils.js'; suite('StandaloneKeybindingService', () => { diff --git a/src/vs/editor/test/browser/commands/shiftCommand.test.ts b/src/vs/editor/test/browser/commands/shiftCommand.test.ts index 8d98e803658..9e78a5568ec 100644 --- a/src/vs/editor/test/browser/commands/shiftCommand.test.ts +++ b/src/vs/editor/test/browser/commands/shiftCommand.test.ts @@ -4,20 +4,20 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ShiftCommand } from 'vs/editor/common/commands/shiftCommand'; -import { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { getEditOperation, testCommand } from 'vs/editor/test/browser/testCommand'; -import { javascriptOnEnterRules } from 'vs/editor/test/common/modes/supports/onEnterRules'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { withEditorModel } from 'vs/editor/test/common/testTextModel'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ShiftCommand } from '../../../common/commands/shiftCommand.js'; +import { EditorAutoIndentStrategy } from '../../../common/config/editorOptions.js'; +import { ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { getEditOperation, testCommand } from '../testCommand.js'; +import { javascriptOnEnterRules } from '../../common/modes/supports/onEnterRules.js'; +import { TestLanguageConfigurationService } from '../../common/modes/testLanguageConfigurationService.js'; +import { withEditorModel } from '../../common/testTextModel.js'; +import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; /** * Create single edit operation diff --git a/src/vs/editor/test/browser/commands/sideEditing.test.ts b/src/vs/editor/test/browser/commands/sideEditing.test.ts index fbd9a36c95a..db35d5e1ab6 100644 --- a/src/vs/editor/test/browser/commands/sideEditing.test.ts +++ b/src/vs/editor/test/browser/commands/sideEditing.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EditOperation, ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { EditOperation, ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { withTestCodeEditor } from '../testCodeEditor.js'; function testCommand(lines: string[], selections: Selection[], edits: ISingleEditOperation[], expectedLines: string[], expectedSelections: Selection[]): void { withTestCodeEditor(lines, {}, (editor, viewModel) => { diff --git a/src/vs/editor/test/browser/commands/trimTrailingWhitespaceCommand.test.ts b/src/vs/editor/test/browser/commands/trimTrailingWhitespaceCommand.test.ts index 15f9bb999d4..503dc55f875 100644 --- a/src/vs/editor/test/browser/commands/trimTrailingWhitespaceCommand.test.ts +++ b/src/vs/editor/test/browser/commands/trimTrailingWhitespaceCommand.test.ts @@ -4,19 +4,19 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { TrimTrailingWhitespaceCommand, trimTrailingWhitespace } from 'vs/editor/common/commands/trimTrailingWhitespaceCommand'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { MetadataConsts, StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { EncodedTokenizationResult, ITokenizationSupport, TokenizationRegistry } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { NullState } from 'vs/editor/common/languages/nullTokenize'; -import { getEditOperation } from 'vs/editor/test/browser/testCommand'; -import { createModelServices, instantiateTextModel, withEditorModel } from 'vs/editor/test/common/testTextModel'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { TrimTrailingWhitespaceCommand, trimTrailingWhitespace } from '../../../common/commands/trimTrailingWhitespaceCommand.js'; +import { ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { MetadataConsts, StandardTokenType } from '../../../common/encodedTokenAttributes.js'; +import { EncodedTokenizationResult, ITokenizationSupport, TokenizationRegistry } from '../../../common/languages.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { NullState } from '../../../common/languages/nullTokenize.js'; +import { getEditOperation } from '../testCommand.js'; +import { createModelServices, instantiateTextModel, withEditorModel } from '../../common/testTextModel.js'; /** * Create single edit operation diff --git a/src/vs/editor/test/browser/config/editorConfiguration.test.ts b/src/vs/editor/test/browser/config/editorConfiguration.test.ts index 911b73018c3..3dcf646314f 100644 --- a/src/vs/editor/test/browser/config/editorConfiguration.test.ts +++ b/src/vs/editor/test/browser/config/editorConfiguration.test.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IEnvConfiguration } from 'vs/editor/browser/config/editorConfiguration'; -import { migrateOptions } from 'vs/editor/browser/config/migrateOptions'; -import { ConfigurationChangedEvent, EditorOption, IEditorHoverOptions, IQuickSuggestionsOptions } from 'vs/editor/common/config/editorOptions'; -import { EditorZoom } from 'vs/editor/common/config/editorZoom'; -import { TestConfiguration } from 'vs/editor/test/browser/config/testConfiguration'; -import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IEnvConfiguration } from '../../../browser/config/editorConfiguration.js'; +import { migrateOptions } from '../../../browser/config/migrateOptions.js'; +import { ConfigurationChangedEvent, EditorOption, IEditorHoverOptions, IQuickSuggestionsOptions } from '../../../common/config/editorOptions.js'; +import { EditorZoom } from '../../../common/config/editorZoom.js'; +import { TestConfiguration } from './testConfiguration.js'; +import { AccessibilitySupport } from '../../../../platform/accessibility/common/accessibility.js'; suite('Common Editor Config', () => { diff --git a/src/vs/editor/test/browser/config/editorLayoutProvider.test.ts b/src/vs/editor/test/browser/config/editorLayoutProvider.test.ts index a2e3ace58f6..8966df17f3f 100644 --- a/src/vs/editor/test/browser/config/editorLayoutProvider.test.ts +++ b/src/vs/editor/test/browser/config/editorLayoutProvider.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ComputedEditorOptions } from 'vs/editor/browser/config/editorConfiguration'; -import { EditorLayoutInfo, EditorLayoutInfoComputer, EditorMinimapOptions, EditorOption, EditorOptions, InternalEditorRenderLineNumbersOptions, InternalEditorScrollbarOptions, RenderLineNumbersType, RenderMinimap } from 'vs/editor/common/config/editorOptions'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ComputedEditorOptions } from '../../../browser/config/editorConfiguration.js'; +import { EditorLayoutInfo, EditorLayoutInfoComputer, EditorMinimapOptions, EditorOption, EditorOptions, InternalEditorRenderLineNumbersOptions, InternalEditorScrollbarOptions, RenderLineNumbersType, RenderMinimap } from '../../../common/config/editorOptions.js'; interface IEditorLayoutProviderOpts { readonly outerWidth: number; diff --git a/src/vs/editor/test/browser/config/testConfiguration.ts b/src/vs/editor/test/browser/config/testConfiguration.ts index 4a2e87e6d48..3c1862c967d 100644 --- a/src/vs/editor/test/browser/config/testConfiguration.ts +++ b/src/vs/editor/test/browser/config/testConfiguration.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EditorConfiguration, IEnvConfiguration } from 'vs/editor/browser/config/editorConfiguration'; -import { EditorFontLigatures, EditorFontVariations } from 'vs/editor/common/config/editorOptions'; -import { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo'; -import { TestCodeEditorCreationOptions } from 'vs/editor/test/browser/testCodeEditor'; -import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; -import { TestAccessibilityService } from 'vs/platform/accessibility/test/common/testAccessibilityService'; -import { MenuId } from 'vs/platform/actions/common/actions'; +import { EditorConfiguration, IEnvConfiguration } from '../../../browser/config/editorConfiguration.js'; +import { EditorFontLigatures, EditorFontVariations } from '../../../common/config/editorOptions.js'; +import { BareFontInfo, FontInfo } from '../../../common/config/fontInfo.js'; +import { TestCodeEditorCreationOptions } from '../testCodeEditor.js'; +import { AccessibilitySupport } from '../../../../platform/accessibility/common/accessibility.js'; +import { TestAccessibilityService } from '../../../../platform/accessibility/test/common/testAccessibilityService.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; export class TestConfiguration extends EditorConfiguration { diff --git a/src/vs/editor/test/browser/controller/cursor.integrationTest.ts b/src/vs/editor/test/browser/controller/cursor.integrationTest.ts index bd956a35398..d39b24c36fd 100644 --- a/src/vs/editor/test/browser/controller/cursor.integrationTest.ts +++ b/src/vs/editor/test/browser/controller/cursor.integrationTest.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Selection } from 'vs/editor/common/core/selection'; -import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; +import { Selection } from '../../../common/core/selection.js'; +import { withTestCodeEditor } from '../testCodeEditor.js'; suite('Editor Controller', () => { diff --git a/src/vs/editor/test/browser/controller/cursor.test.ts b/src/vs/editor/test/browser/controller/cursor.test.ts index bb2abffb9c9..2eb1303c28c 100644 --- a/src/vs/editor/test/browser/controller/cursor.test.ts +++ b/src/vs/editor/test/browser/controller/cursor.test.ts @@ -4,30 +4,30 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { CoreEditingCommands, CoreNavigationCommands } from 'vs/editor/browser/coreCommands'; -import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICursorPositionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { MetadataConsts, StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { EncodedTokenizationResult, IState, ITokenizationSupport, TokenizationRegistry } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IndentAction, IndentationRule } from 'vs/editor/common/languages/languageConfiguration'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { NullState } from 'vs/editor/common/languages/nullTokenize'; -import { EndOfLinePreference, EndOfLineSequence, ITextModel } from 'vs/editor/common/model'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; -import { OutgoingViewModelEventKind } from 'vs/editor/common/viewModelEventDispatcher'; -import { ITestCodeEditor, TestCodeEditorInstantiationOptions, createCodeEditorServices, instantiateTestCodeEditor, withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { IRelaxedTextModelCreationOptions, createTextModel, instantiateTextModel } from 'vs/editor/test/common/testTextModel'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { CoreEditingCommands, CoreNavigationCommands } from '../../../browser/coreCommands.js'; +import { IEditorOptions } from '../../../common/config/editorOptions.js'; +import { EditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ICursorPositionChangedEvent } from '../../../common/cursorEvents.js'; +import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from '../../../common/editorCommon.js'; +import { MetadataConsts, StandardTokenType } from '../../../common/encodedTokenAttributes.js'; +import { EncodedTokenizationResult, IState, ITokenizationSupport, TokenizationRegistry } from '../../../common/languages.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { IndentAction, IndentationRule } from '../../../common/languages/languageConfiguration.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { NullState } from '../../../common/languages/nullTokenize.js'; +import { EndOfLinePreference, EndOfLineSequence, ITextModel } from '../../../common/model.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { ViewModel } from '../../../common/viewModel/viewModelImpl.js'; +import { OutgoingViewModelEventKind } from '../../../common/viewModelEventDispatcher.js'; +import { ITestCodeEditor, TestCodeEditorInstantiationOptions, createCodeEditorServices, instantiateTestCodeEditor, withTestCodeEditor } from '../testCodeEditor.js'; +import { IRelaxedTextModelCreationOptions, createTextModel, instantiateTextModel } from '../../common/testTextModel.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; // --------- utils diff --git a/src/vs/editor/test/browser/controller/cursorMoveCommand.test.ts b/src/vs/editor/test/browser/controller/cursorMoveCommand.test.ts index c4bee4b9f2b..51184271569 100644 --- a/src/vs/editor/test/browser/controller/cursorMoveCommand.test.ts +++ b/src/vs/editor/test/browser/controller/cursorMoveCommand.test.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { CoreNavigationCommands } from 'vs/editor/browser/coreCommands'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { CursorMove } from 'vs/editor/common/cursor/cursorMoveCommands'; -import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; -import { ITestCodeEditor, withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { CoreNavigationCommands } from '../../../browser/coreCommands.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { CursorMove } from '../../../common/cursor/cursorMoveCommands.js'; +import { ViewModel } from '../../../common/viewModel/viewModelImpl.js'; +import { ITestCodeEditor, withTestCodeEditor } from '../testCodeEditor.js'; suite('Cursor move command test', () => { diff --git a/src/vs/editor/test/browser/controller/imeRecordedTypes.ts b/src/vs/editor/test/browser/controller/imeRecordedTypes.ts index 70499b308f1..8777d4c43aa 100644 --- a/src/vs/editor/test/browser/controller/imeRecordedTypes.ts +++ b/src/vs/editor/test/browser/controller/imeRecordedTypes.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { OperatingSystem } from 'vs/base/common/platform'; -import { IBrowser } from 'vs/editor/browser/controller/textAreaInput'; +import { OperatingSystem } from '../../../../base/common/platform.js'; +import { IBrowser } from '../../../browser/controller/editContext/textArea/textAreaEditContextInput.js'; export interface IRecordedTextareaState { selectionDirection: 'forward' | 'backward' | 'none'; diff --git a/src/vs/editor/test/browser/controller/imeRecorder.ts b/src/vs/editor/test/browser/controller/imeRecorder.ts index 36290eb2e98..4b22ced5131 100644 --- a/src/vs/editor/test/browser/controller/imeRecorder.ts +++ b/src/vs/editor/test/browser/controller/imeRecorder.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { TextAreaWrapper } from 'vs/editor/browser/controller/textAreaInput'; -import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { IRecorded, IRecordedCompositionEvent, IRecordedEvent, IRecordedInputEvent, IRecordedKeyboardEvent, IRecordedTextareaState } from 'vs/editor/test/browser/controller/imeRecordedTypes'; -import * as browser from 'vs/base/browser/browser'; -import * as platform from 'vs/base/common/platform'; -import { mainWindow } from 'vs/base/browser/window'; +import { DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js'; +import { IRecorded, IRecordedCompositionEvent, IRecordedEvent, IRecordedInputEvent, IRecordedKeyboardEvent, IRecordedTextareaState } from './imeRecordedTypes.js'; +import * as browser from '../../../../base/browser/browser.js'; +import * as platform from '../../../../base/common/platform.js'; +import { mainWindow } from '../../../../base/browser/window.js'; +import { TextAreaWrapper } from '../../../browser/controller/editContext/textArea/textAreaEditContextInput.js'; (() => { diff --git a/src/vs/editor/test/browser/controller/imeTester.ts b/src/vs/editor/test/browser/controller/imeTester.ts index 3aeaed1d9d4..25a9e6c5180 100644 --- a/src/vs/editor/test/browser/controller/imeTester.ts +++ b/src/vs/editor/test/browser/controller/imeTester.ts @@ -3,17 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ITextAreaInputHost, TextAreaInput, TextAreaWrapper } from 'vs/editor/browser/controller/textAreaInput'; -import { ISimpleModel, PagedScreenReaderStrategy, TextAreaState } from 'vs/editor/browser/controller/textAreaState'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { EndOfLinePreference } from 'vs/editor/common/model'; -import * as dom from 'vs/base/browser/dom'; -import * as browser from 'vs/base/browser/browser'; -import * as platform from 'vs/base/common/platform'; -import { mainWindow } from 'vs/base/browser/window'; -import { TestAccessibilityService } from 'vs/platform/accessibility/test/common/testAccessibilityService'; -import { NullLogService } from 'vs/platform/log/common/log'; +import { Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { EndOfLinePreference } from '../../../common/model.js'; +import * as dom from '../../../../base/browser/dom.js'; +import * as browser from '../../../../base/browser/browser.js'; +import * as platform from '../../../../base/common/platform.js'; +import { mainWindow } from '../../../../base/browser/window.js'; +import { TestAccessibilityService } from '../../../../platform/accessibility/test/common/testAccessibilityService.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { ISimpleModel, PagedScreenReaderStrategy } from '../../../browser/controller/editContext/screenReaderUtils.js'; +import { TextAreaState } from '../../../browser/controller/editContext/textArea/textAreaEditContextState.js'; +import { ITextAreaInputHost, TextAreaInput, TextAreaWrapper } from '../../../browser/controller/editContext/textArea/textAreaEditContextInput.js'; // To run this test, open imeTester.html @@ -117,7 +118,8 @@ function doCreateTest(description: string, inputStr: string, expectedStr: string getScreenReaderContent: (): TextAreaState => { const selection = new Range(1, 1 + cursorOffset, 1, 1 + cursorOffset + cursorLength); - return PagedScreenReaderStrategy.fromEditorSelection(model, selection, 10, true); + const screenReaderContentState = PagedScreenReaderStrategy.fromEditorSelection(model, selection, 10, true); + return TextAreaState.fromScreenReaderContentState(screenReaderContentState); }, deduceModelPosition: (viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position => { return null!; diff --git a/src/vs/editor/test/browser/controller/textAreaInput.test.ts b/src/vs/editor/test/browser/controller/textAreaInput.test.ts index fd2e23e3751..a1cfa19429d 100644 --- a/src/vs/editor/test/browser/controller/textAreaInput.test.ts +++ b/src/vs/editor/test/browser/controller/textAreaInput.test.ts @@ -4,16 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { OperatingSystem } from 'vs/base/common/platform'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ClipboardDataToCopy, IBrowser, ICompleteTextAreaWrapper, ITextAreaInputHost, TextAreaInput } from 'vs/editor/browser/controller/textAreaInput'; -import { TextAreaState } from 'vs/editor/browser/controller/textAreaState'; -import { Position } from 'vs/editor/common/core/position'; -import { IRecorded, IRecordedEvent, IRecordedTextareaState } from 'vs/editor/test/browser/controller/imeRecordedTypes'; -import { TestAccessibilityService } from 'vs/platform/accessibility/test/common/testAccessibilityService'; -import { NullLogService } from 'vs/platform/log/common/log'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { OperatingSystem } from '../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Position } from '../../../common/core/position.js'; +import { IRecorded, IRecordedEvent, IRecordedTextareaState } from './imeRecordedTypes.js'; +import { TestAccessibilityService } from '../../../../platform/accessibility/test/common/testAccessibilityService.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { IBrowser, ICompleteTextAreaWrapper, ITextAreaInputHost, TextAreaInput } from '../../../browser/controller/editContext/textArea/textAreaEditContextInput.js'; +import { ClipboardDataToCopy } from '../../../browser/controller/editContext/clipboardUtils.js'; +import { TextAreaState } from '../../../browser/controller/editContext/textArea/textAreaEditContextState.js'; suite('TextAreaInput', () => { diff --git a/src/vs/editor/test/browser/controller/textAreaState.test.ts b/src/vs/editor/test/browser/controller/textAreaState.test.ts index 2baa9ddda39..a0f9ce82e25 100644 --- a/src/vs/editor/test/browser/controller/textAreaState.test.ts +++ b/src/vs/editor/test/browser/controller/textAreaState.test.ts @@ -4,12 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ITextAreaWrapper, PagedScreenReaderStrategy, TextAreaState } from 'vs/editor/browser/controller/textAreaState'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ITextAreaWrapper, TextAreaState } from '../../../browser/controller/editContext/textArea/textAreaEditContextState.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { createTextModel } from '../../common/testTextModel.js'; +import { PagedScreenReaderStrategy } from '../../../browser/controller/editContext/screenReaderUtils.js'; class MockTextAreaWrapper extends Disposable implements ITextAreaWrapper { @@ -364,8 +365,9 @@ suite('TextAreaState', () => { function testPagedScreenReaderStrategy(lines: string[], selection: Selection, expected: TextAreaState): void { const model = createTextModel(lines.join('\n')); - const actual = PagedScreenReaderStrategy.fromEditorSelection(model, selection, 10, true); - assert.ok(equalsTextAreaState(actual, expected)); + const screenReaderContentState = PagedScreenReaderStrategy.fromEditorSelection(model, selection, 10, true); + const textAreaState = TextAreaState.fromScreenReaderContentState(screenReaderContentState); + assert.ok(equalsTextAreaState(textAreaState, expected)); model.dispose(); } diff --git a/src/vs/editor/test/browser/diff/testDiffProviderFactoryService.ts b/src/vs/editor/test/browser/diff/testDiffProviderFactoryService.ts index 275c4995988..7d889f5012a 100644 --- a/src/vs/editor/test/browser/diff/testDiffProviderFactoryService.ts +++ b/src/vs/editor/test/browser/diff/testDiffProviderFactoryService.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import { IDocumentDiff, IDocumentDiffProvider, IDocumentDiffProviderOptions } from 'vs/editor/common/diff/documentDiffProvider'; -import { linesDiffComputers } from 'vs/editor/common/diff/linesDiffComputers'; -import { ITextModel } from 'vs/editor/common/model'; -import { Event } from 'vs/base/common/event'; -import { IDiffProviderFactoryService } from 'vs/editor/browser/widget/diffEditor/diffProviderFactoryService'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { toDisposable } from '../../../../base/common/lifecycle.js'; +import { IDocumentDiff, IDocumentDiffProvider, IDocumentDiffProviderOptions } from '../../../common/diff/documentDiffProvider.js'; +import { linesDiffComputers } from '../../../common/diff/linesDiffComputers.js'; +import { ITextModel } from '../../../common/model.js'; +import { Event } from '../../../../base/common/event.js'; +import { IDiffProviderFactoryService } from '../../../browser/widget/diffEditor/diffProviderFactoryService.js'; export class TestDiffProviderFactoryService implements IDiffProviderFactoryService { declare readonly _serviceBrand: undefined; diff --git a/src/vs/editor/test/browser/editorTestServices.ts b/src/vs/editor/test/browser/editorTestServices.ts index 951759f9fbf..861a8f778d2 100644 --- a/src/vs/editor/test/browser/editorTestServices.ts +++ b/src/vs/editor/test/browser/editorTestServices.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { AbstractCodeEditorService, GlobalStyleSheet } from 'vs/editor/browser/services/abstractCodeEditorService'; -import { CommandsRegistry, ICommandEvent, ICommandService } from 'vs/platform/commands/common/commands'; -import { IResourceEditorInput } from 'vs/platform/editor/common/editor'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { ICodeEditor } from '../../browser/editorBrowser.js'; +import { AbstractCodeEditorService, GlobalStyleSheet } from '../../browser/services/abstractCodeEditorService.js'; +import { CommandsRegistry, ICommandEvent, ICommandService } from '../../../platform/commands/common/commands.js'; +import { IResourceEditorInput } from '../../../platform/editor/common/editor.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; export class TestCodeEditorService extends AbstractCodeEditorService { diff --git a/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts index 9160c07070a..7a35640c79b 100644 --- a/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts +++ b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import * as platform from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IDecorationRenderOptions } from 'vs/editor/common/editorCommon'; -import { TestCodeEditorService, TestGlobalStyleSheet } from 'vs/editor/test/browser/editorTestServices'; -import { TestColorTheme, TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; +import * as platform from '../../../../base/common/platform.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IDecorationRenderOptions } from '../../../common/editorCommon.js'; +import { TestCodeEditorService, TestGlobalStyleSheet } from '../editorTestServices.js'; +import { TestColorTheme, TestThemeService } from '../../../../platform/theme/test/common/testThemeService.js'; suite('Decoration Render Options', () => { const store = ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/editor/test/browser/services/openerService.test.ts b/src/vs/editor/test/browser/services/openerService.test.ts index d732776a800..8e35ac41078 100644 --- a/src/vs/editor/test/browser/services/openerService.test.ts +++ b/src/vs/editor/test/browser/services/openerService.test.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { OpenerService } from 'vs/editor/browser/services/openerService'; -import { TestCodeEditorService } from 'vs/editor/test/browser/editorTestServices'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { NullCommandService } from 'vs/platform/commands/test/common/nullCommandService'; -import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; -import { matchesScheme, matchesSomeScheme } from 'vs/base/common/network'; -import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { OpenerService } from '../../../browser/services/openerService.js'; +import { TestCodeEditorService } from '../editorTestServices.js'; +import { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js'; +import { NullCommandService } from '../../../../platform/commands/test/common/nullCommandService.js'; +import { ITextEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { matchesScheme, matchesSomeScheme } from '../../../../base/common/network.js'; +import { TestThemeService } from '../../../../platform/theme/test/common/testThemeService.js'; suite('OpenerService', function () { const themeService = new TestThemeService(); diff --git a/src/vs/editor/test/browser/services/treeSitterParserService.test.ts b/src/vs/editor/test/browser/services/treeSitterParserService.test.ts new file mode 100644 index 00000000000..d90cca2af99 --- /dev/null +++ b/src/vs/editor/test/browser/services/treeSitterParserService.test.ts @@ -0,0 +1,151 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import assert from 'assert'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { TextModelTreeSitter, TreeSitterImporter, TreeSitterLanguages } from '../../../browser/services/treeSitter/treeSitterParserService.js'; +import type { Parser } from '@vscode/tree-sitter-wasm'; +import { createTextModel } from '../../common/testTextModel.js'; +import { timeout } from '../../../../base/common/async.js'; +import { ConsoleMainLogger, ILogService } from '../../../../platform/log/common/log.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { LogService } from '../../../../platform/log/common/logService.js'; +import { mock } from '../../../../base/test/common/mock.js'; + +class MockParser implements Parser { + static async init(): Promise { } + delete(): void { } + parse(input: string | Parser.Input, oldTree?: Parser.Tree, options?: Parser.Options): Parser.Tree { + return new MockTree(); + } + getIncludedRanges(): Parser.Range[] { + return []; + } + getTimeoutMicros(): number { return 0; } + setTimeoutMicros(timeout: number): void { } + reset(): void { } + getLanguage(): Parser.Language { return {} as any; } + setLanguage(): void { } + getLogger(): Parser.Logger { + throw new Error('Method not implemented.'); + } + setLogger(logFunc?: Parser.Logger | false | null): void { + throw new Error('Method not implemented.'); + } +} + +class MockTreeSitterImporter extends TreeSitterImporter { + public override async getParserClass(): Promise { + return MockParser as any; + } +} + +class MockTree implements Parser.Tree { + editorLanguage: string = ''; + editorContents: string = ''; + rootNode: Parser.SyntaxNode = {} as any; + rootNodeWithOffset(offsetBytes: number, offsetExtent: Parser.Point): Parser.SyntaxNode { + throw new Error('Method not implemented.'); + } + copy(): Parser.Tree { + throw new Error('Method not implemented.'); + } + delete(): void { } + edit(edit: Parser.Edit): Parser.Tree { + return this; + } + walk(): Parser.TreeCursor { + throw new Error('Method not implemented.'); + } + getChangedRanges(other: Parser.Tree): Parser.Range[] { + throw new Error('Method not implemented.'); + } + getIncludedRanges(): Parser.Range[] { + throw new Error('Method not implemented.'); + } + getEditedRange(other: Parser.Tree): Parser.Range { + throw new Error('Method not implemented.'); + } + getLanguage(): Parser.Language { + throw new Error('Method not implemented.'); + } +} + +class MockLanguage implements Parser.Language { + version: number = 0; + fieldCount: number = 0; + stateCount: number = 0; + nodeTypeCount: number = 0; + fieldNameForId(fieldId: number): string | null { + throw new Error('Method not implemented.'); + } + fieldIdForName(fieldName: string): number | null { + throw new Error('Method not implemented.'); + } + idForNodeType(type: string, named: boolean): number { + throw new Error('Method not implemented.'); + } + nodeTypeForId(typeId: number): string | null { + throw new Error('Method not implemented.'); + } + nodeTypeIsNamed(typeId: number): boolean { + throw new Error('Method not implemented.'); + } + nodeTypeIsVisible(typeId: number): boolean { + throw new Error('Method not implemented.'); + } + nextState(stateId: number, typeId: number): number { + throw new Error('Method not implemented.'); + } + query(source: string): Parser.Query { + throw new Error('Method not implemented.'); + } + lookaheadIterator(stateId: number): Parser.LookaheadIterable | null { + throw new Error('Method not implemented.'); + } + languageId: string = ''; +} + +suite('TreeSitterParserService', function () { + const treeSitterImporter: TreeSitterImporter = new MockTreeSitterImporter(); + let logService: ILogService; + let telemetryService: ITelemetryService; + setup(function () { + logService = new LogService(new ConsoleMainLogger()); + telemetryService = new class extends mock() { + override async publicLog2() { + // + } + }; + }); + + const store = ensureNoDisposablesAreLeakedInTestSuite(); + + test('TextModelTreeSitter race condition: first language is slow to load', async function () { + class MockTreeSitterLanguages extends TreeSitterLanguages { + private async _fetchJavascript(): Promise { + await timeout(200); + const language = new MockLanguage(); + language.languageId = 'javascript'; + this._onDidAddLanguage.fire({ id: 'javascript', language }); + } + public override getOrInitLanguage(languageId: string): Parser.Language | undefined { + if (languageId === 'javascript') { + this._fetchJavascript(); + return undefined; + } + const language = new MockLanguage(); + language.languageId = languageId; + return language; + } + } + + const treeSitterParser: TreeSitterLanguages = store.add(new MockTreeSitterLanguages(treeSitterImporter, {} as any, { isBuilt: false } as any, new Map())); + const textModel = store.add(createTextModel('console.log("Hello, world!");', 'javascript')); + const textModelTreeSitter = store.add(new TextModelTreeSitter(textModel, treeSitterParser, treeSitterImporter, logService, telemetryService)); + textModel.setLanguage('typescript'); + await timeout(300); + assert.strictEqual((textModelTreeSitter.parseResult?.language as MockLanguage).languageId, 'typescript'); + }); +}); diff --git a/src/vs/editor/test/browser/testCodeEditor.ts b/src/vs/editor/test/browser/testCodeEditor.ts index 5fcd0c1bd4c..72da1933953 100644 --- a/src/vs/editor/test/browser/testCodeEditor.ts +++ b/src/vs/editor/test/browser/testCodeEditor.ts @@ -3,62 +3,64 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { mock } from 'vs/base/test/common/mock'; -import { EditorConfiguration } from 'vs/editor/browser/config/editorConfiguration'; -import { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { View } from 'vs/editor/browser/view'; -import { CodeEditorWidget, ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import * as editorOptions from 'vs/editor/common/config/editorOptions'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ITextBufferFactory, ITextModel } from 'vs/editor/common/model'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { ILanguageFeatureDebounceService, LanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { LanguageService } from 'vs/editor/common/services/languageService'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ModelService } from 'vs/editor/common/services/modelService'; -import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration'; -import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; -import { TestConfiguration } from 'vs/editor/test/browser/config/testConfiguration'; -import { TestCodeEditorService, TestCommandService } from 'vs/editor/test/browser/editorTestServices'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { TestEditorWorkerService } from 'vs/editor/test/common/services/testEditorWorkerService'; -import { TestTextResourcePropertiesService } from 'vs/editor/test/common/services/testTextResourcePropertiesService'; -import { instantiateTextModel } from 'vs/editor/test/common/testTextModel'; -import { AccessibilitySupport, IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { TestAccessibilityService } from 'vs/platform/accessibility/test/common/testAccessibilityService'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { TestClipboardService } from 'vs/platform/clipboard/test/common/testClipboardService'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { IContextKeyService, IContextKeyServiceTarget } from 'vs/platform/contextkey/common/contextkey'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { TestDialogService } from 'vs/platform/dialogs/test/common/testDialogService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { BrandedService, IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { MockContextKeyService, MockKeybindingService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { NullOpenerService } from 'vs/platform/opener/test/common/nullOpenerService'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { NullTelemetryServiceShape } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; -import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo'; -import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService'; +import { DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { mock } from '../../../base/test/common/mock.js'; +import { EditorConfiguration } from '../../browser/config/editorConfiguration.js'; +import { IActiveCodeEditor, ICodeEditor } from '../../browser/editorBrowser.js'; +import { ICodeEditorService } from '../../browser/services/codeEditorService.js'; +import { View } from '../../browser/view.js'; +import { CodeEditorWidget, ICodeEditorWidgetOptions } from '../../browser/widget/codeEditor/codeEditorWidget.js'; +import * as editorOptions from '../../common/config/editorOptions.js'; +import { IEditorContribution } from '../../common/editorCommon.js'; +import { ILanguageService } from '../../common/languages/language.js'; +import { ILanguageConfigurationService } from '../../common/languages/languageConfigurationRegistry.js'; +import { ITextBufferFactory, ITextModel } from '../../common/model.js'; +import { IEditorWorkerService } from '../../common/services/editorWorker.js'; +import { ILanguageFeatureDebounceService, LanguageFeatureDebounceService } from '../../common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../common/services/languageFeatures.js'; +import { LanguageFeaturesService } from '../../common/services/languageFeaturesService.js'; +import { LanguageService } from '../../common/services/languageService.js'; +import { IModelService } from '../../common/services/model.js'; +import { ModelService } from '../../common/services/modelService.js'; +import { ITextResourcePropertiesService } from '../../common/services/textResourceConfiguration.js'; +import { ITreeSitterParserService } from '../../common/services/treeSitterParserService.js'; +import { ViewModel } from '../../common/viewModel/viewModelImpl.js'; +import { TestConfiguration } from './config/testConfiguration.js'; +import { TestCodeEditorService, TestCommandService } from './editorTestServices.js'; +import { TestTreeSitterParserService } from '../common/services/testTreeSitterService.js'; +import { TestLanguageConfigurationService } from '../common/modes/testLanguageConfigurationService.js'; +import { TestEditorWorkerService } from '../common/services/testEditorWorkerService.js'; +import { TestTextResourcePropertiesService } from '../common/services/testTextResourcePropertiesService.js'; +import { instantiateTextModel } from '../common/testTextModel.js'; +import { AccessibilitySupport, IAccessibilityService } from '../../../platform/accessibility/common/accessibility.js'; +import { TestAccessibilityService } from '../../../platform/accessibility/test/common/testAccessibilityService.js'; +import { MenuId } from '../../../platform/actions/common/actions.js'; +import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js'; +import { TestClipboardService } from '../../../platform/clipboard/test/common/testClipboardService.js'; +import { ICommandService } from '../../../platform/commands/common/commands.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { TestConfigurationService } from '../../../platform/configuration/test/common/testConfigurationService.js'; +import { IContextKeyService, IContextKeyServiceTarget } from '../../../platform/contextkey/common/contextkey.js'; +import { IDialogService } from '../../../platform/dialogs/common/dialogs.js'; +import { TestDialogService } from '../../../platform/dialogs/test/common/testDialogService.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; +import { SyncDescriptor } from '../../../platform/instantiation/common/descriptors.js'; +import { BrandedService, IInstantiationService, ServiceIdentifier } from '../../../platform/instantiation/common/instantiation.js'; +import { ServiceCollection } from '../../../platform/instantiation/common/serviceCollection.js'; +import { TestInstantiationService } from '../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js'; +import { MockContextKeyService, MockKeybindingService } from '../../../platform/keybinding/test/common/mockKeybindingService.js'; +import { ILogService, NullLogService } from '../../../platform/log/common/log.js'; +import { INotificationService } from '../../../platform/notification/common/notification.js'; +import { TestNotificationService } from '../../../platform/notification/test/common/testNotificationService.js'; +import { IOpenerService } from '../../../platform/opener/common/opener.js'; +import { NullOpenerService } from '../../../platform/opener/test/common/nullOpenerService.js'; +import { ITelemetryService } from '../../../platform/telemetry/common/telemetry.js'; +import { NullTelemetryServiceShape } from '../../../platform/telemetry/common/telemetryUtils.js'; +import { IThemeService } from '../../../platform/theme/common/themeService.js'; +import { TestThemeService } from '../../../platform/theme/test/common/testThemeService.js'; +import { IUndoRedoService } from '../../../platform/undoRedo/common/undoRedo.js'; +import { UndoRedoService } from '../../../platform/undoRedo/common/undoRedoService.js'; export interface ITestCodeEditor extends IActiveCodeEditor { getViewModel(): ViewModel | undefined; @@ -177,7 +179,7 @@ function _withTestCodeEditor(arg: ITextModel | string | string[] | ITextBufferFa disposables.dispose(); } -export function createCodeEditorServices(disposables: DisposableStore, services: ServiceCollection = new ServiceCollection()): TestInstantiationService { +export function createCodeEditorServices(disposables: Pick, services: ServiceCollection = new ServiceCollection()): TestInstantiationService { const serviceIdentifiers: ServiceIdentifier[] = []; const define = (id: ServiceIdentifier, ctor: new (...args: any[]) => T) => { if (!services.has(id)) { @@ -218,6 +220,7 @@ export function createCodeEditorServices(disposables: DisposableStore, services: }); define(ILanguageFeatureDebounceService, LanguageFeatureDebounceService); define(ILanguageFeaturesService, LanguageFeaturesService); + define(ITreeSitterParserService, TestTreeSitterParserService); const instantiationService = disposables.add(new TestInstantiationService(services, true)); disposables.add(toDisposable(() => { diff --git a/src/vs/editor/test/browser/testCommand.ts b/src/vs/editor/test/browser/testCommand.ts index e12d2cc526a..2d54a5f2eb4 100644 --- a/src/vs/editor/test/browser/testCommand.ts +++ b/src/vs/editor/test/browser/testCommand.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { IRange } from 'vs/editor/common/core/range'; -import { Selection, ISelection } from 'vs/editor/common/core/selection'; -import { ICommand, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; -import { ITextModel } from 'vs/editor/common/model'; -import { instantiateTestCodeEditor, createCodeEditorServices } from 'vs/editor/test/browser/testCodeEditor'; -import { instantiateTextModel } from 'vs/editor/test/common/testTextModel'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; +import { IRange } from '../../common/core/range.js'; +import { Selection, ISelection } from '../../common/core/selection.js'; +import { ICommand, IEditOperationBuilder } from '../../common/editorCommon.js'; +import { ITextModel } from '../../common/model.js'; +import { instantiateTestCodeEditor, createCodeEditorServices } from './testCodeEditor.js'; +import { instantiateTextModel } from '../common/testTextModel.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { ISingleEditOperation } from '../../common/core/editOperation.js'; export function testCommand( lines: string[], diff --git a/src/vs/editor/test/browser/view/gpu/atlas/testUtil.ts b/src/vs/editor/test/browser/view/gpu/atlas/testUtil.ts new file mode 100644 index 00000000000..73d1e167f1e --- /dev/null +++ b/src/vs/editor/test/browser/view/gpu/atlas/testUtil.ts @@ -0,0 +1,55 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { fail, ok } from 'assert'; +import type { ITextureAtlasPageGlyph } from '../../../../../browser/gpu/atlas/atlas.js'; +import { TextureAtlas } from '../../../../../browser/gpu/atlas/textureAtlas.js'; +import { isNumber } from '../../../../../../base/common/types.js'; +import { ensureNonNullable } from '../../../../../browser/gpu/gpuUtils.js'; + +export function assertIsValidGlyph(glyph: Readonly | undefined, atlasOrSource: TextureAtlas | OffscreenCanvas) { + if (glyph === undefined) { + fail('glyph is undefined'); + } + const pageW = atlasOrSource instanceof TextureAtlas ? atlasOrSource.pageSize : atlasOrSource.width; + const pageH = atlasOrSource instanceof TextureAtlas ? atlasOrSource.pageSize : atlasOrSource.width; + const source = atlasOrSource instanceof TextureAtlas ? atlasOrSource.pages[glyph.pageIndex].source : atlasOrSource; + + // (x,y) are valid coordinates + ok(isNumber(glyph.x)); + ok(glyph.x >= 0); + ok(glyph.x < pageW); + ok(isNumber(glyph.y)); + ok(glyph.y >= 0); + ok(glyph.y < pageH); + + // (w,h) are valid dimensions + ok(isNumber(glyph.w)); + ok(glyph.w > 0); + ok(glyph.w <= pageW); + ok(isNumber(glyph.h)); + ok(glyph.h > 0); + ok(glyph.h <= pageH); + + // (originOffsetX, originOffsetY) are valid offsets + ok(isNumber(glyph.originOffsetX)); + ok(isNumber(glyph.originOffsetY)); + + // (x,y) + (w,h) are within the bounds of the atlas + ok(glyph.x + glyph.w <= pageW); + ok(glyph.y + glyph.h <= pageH); + + // Each of the glyph's outer pixel edges contain at least 1 non-transparent pixel + const ctx = ensureNonNullable(source.getContext('2d')); + const edges = [ + ctx.getImageData(glyph.x, glyph.y, glyph.w, 1).data, + ctx.getImageData(glyph.x, glyph.y + glyph.h - 1, glyph.w, 1).data, + ctx.getImageData(glyph.x, glyph.y, 1, glyph.h).data, + ctx.getImageData(glyph.x + glyph.w - 1, glyph.y, 1, glyph.h).data, + ]; + for (const edge of edges) { + ok(edge.some(color => (color & 0xFF) !== 0)); + } +} diff --git a/src/vs/editor/test/browser/view/gpu/atlas/textureAtlas.test.ts b/src/vs/editor/test/browser/view/gpu/atlas/textureAtlas.test.ts new file mode 100644 index 00000000000..5a4353a1d19 --- /dev/null +++ b/src/vs/editor/test/browser/view/gpu/atlas/textureAtlas.test.ts @@ -0,0 +1,130 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { strictEqual, throws } from 'assert'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../../base/test/common/utils.js'; +import type { IGlyphRasterizer, IRasterizedGlyph } from '../../../../../browser/gpu/raster/raster.js'; +import { ensureNonNullable } from '../../../../../browser/gpu/gpuUtils.js'; +import type { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js'; +import { TextureAtlas } from '../../../../../browser/gpu/atlas/textureAtlas.js'; +import { createCodeEditorServices } from '../../../testCodeEditor.js'; +import { assertIsValidGlyph } from './testUtil.js'; +import { TextureAtlasSlabAllocator } from '../../../../../browser/gpu/atlas/textureAtlasSlabAllocator.js'; + +const blackInt = 0x000000FF; + +let lastUniqueGlyph: string | undefined; +function getUniqueGlyphId(): [chars: string, tokenFg: number] { + if (!lastUniqueGlyph) { + lastUniqueGlyph = 'a'; + } else { + lastUniqueGlyph = String.fromCharCode(lastUniqueGlyph.charCodeAt(0) + 1); + } + return [lastUniqueGlyph, blackInt]; +} + +class TestGlyphRasterizer implements IGlyphRasterizer { + readonly id = 0; + readonly cacheKey = ''; + nextGlyphColor: [number, number, number, number] = [0, 0, 0, 0]; + nextGlyphDimensions: [number, number] = [0, 0]; + rasterizeGlyph(chars: string, metadata: number, colorMap: string[]): Readonly { + const w = this.nextGlyphDimensions[0]; + const h = this.nextGlyphDimensions[1]; + if (w === 0 || h === 0) { + throw new Error('TestGlyphRasterizer.nextGlyphDimensions must be set to a non-zero value before calling rasterizeGlyph'); + } + const imageData = new ImageData(w, h); + let i = 0; + for (let y = 0; y < h; y++) { + for (let x = 0; x < w; x++) { + const [r, g, b, a] = this.nextGlyphColor; + i = (y * w + x) * 4; + imageData.data[i + 0] = r; + imageData.data[i + 1] = g; + imageData.data[i + 2] = b; + imageData.data[i + 3] = a; + } + } + const canvas = new OffscreenCanvas(w, h); + const ctx = ensureNonNullable(canvas.getContext('2d')); + ctx.putImageData(imageData, 0, 0); + return { + source: canvas, + boundingBox: { top: 0, left: 0, bottom: h - 1, right: w - 1 }, + originOffset: { x: 0, y: 0 }, + }; + } +} + +suite('TextureAtlas', () => { + const store = ensureNoDisposablesAreLeakedInTestSuite(); + + suiteSetup(() => { + lastUniqueGlyph = undefined; + }); + + let instantiationService: IInstantiationService; + + let atlas: TextureAtlas; + let glyphRasterizer: TestGlyphRasterizer; + + setup(() => { + instantiationService = createCodeEditorServices(store); + atlas = store.add(instantiationService.createInstance(TextureAtlas, 2, undefined)); + glyphRasterizer = new TestGlyphRasterizer(); + glyphRasterizer.nextGlyphDimensions = [1, 1]; + glyphRasterizer.nextGlyphColor = [0, 0, 0, 0xFF]; + }); + + test('get single glyph', () => { + assertIsValidGlyph(atlas.getGlyph(glyphRasterizer, ...getUniqueGlyphId()), atlas); + }); + + test('get multiple glyphs', () => { + atlas = store.add(instantiationService.createInstance(TextureAtlas, 32, undefined)); + for (let i = 0; i < 10; i++) { + assertIsValidGlyph(atlas.getGlyph(glyphRasterizer, ...getUniqueGlyphId()), atlas); + } + }); + + test('adding glyph to full page creates new page', () => { + let pageCount: number | undefined; + for (let i = 0; i < 4; i++) { + assertIsValidGlyph(atlas.getGlyph(glyphRasterizer, ...getUniqueGlyphId()), atlas); + if (pageCount === undefined) { + pageCount = atlas.pages.length; + } else { + strictEqual(atlas.pages.length, pageCount, 'the number of pages should not change when the page is being filled'); + } + } + assertIsValidGlyph(atlas.getGlyph(glyphRasterizer, ...getUniqueGlyphId()), atlas); + strictEqual(atlas.pages.length, pageCount! + 1, 'the 5th glyph should overflow to a new page'); + }); + + test('adding a glyph larger than the atlas', () => { + glyphRasterizer.nextGlyphDimensions = [3, 2]; + throws(() => atlas.getGlyph(glyphRasterizer, ...getUniqueGlyphId()), 'should throw when the glyph is too large, this should not happen in practice'); + }); + + test('adding a glyph larger than the standard slab size', () => { + glyphRasterizer.nextGlyphDimensions = [2, 2]; + atlas = store.add(instantiationService.createInstance(TextureAtlas, 32, { + allocatorType: (canvas, textureIndex) => new TextureAtlasSlabAllocator(canvas, textureIndex, { slabW: 1, slabH: 1 }) + })); + assertIsValidGlyph(atlas.getGlyph(glyphRasterizer, ...getUniqueGlyphId()), atlas); + }); + + test('adding a non-first glyph larger than the standard slab size, causing an overflow to a new page', () => { + atlas = store.add(instantiationService.createInstance(TextureAtlas, 2, { + allocatorType: (canvas, textureIndex) => new TextureAtlasSlabAllocator(canvas, textureIndex, { slabW: 1, slabH: 1 }) + })); + assertIsValidGlyph(atlas.getGlyph(glyphRasterizer, ...getUniqueGlyphId()), atlas); + strictEqual(atlas.pages.length, 1); + glyphRasterizer.nextGlyphDimensions = [2, 2]; + assertIsValidGlyph(atlas.getGlyph(glyphRasterizer, ...getUniqueGlyphId()), atlas); + strictEqual(atlas.pages.length, 2, 'the 2nd glyph should overflow to a new page with a larger slab size'); + }); +}); diff --git a/src/vs/editor/test/browser/view/gpu/atlas/textureAtlasAllocator.test.ts b/src/vs/editor/test/browser/view/gpu/atlas/textureAtlasAllocator.test.ts new file mode 100644 index 00000000000..92d354a5f78 --- /dev/null +++ b/src/vs/editor/test/browser/view/gpu/atlas/textureAtlasAllocator.test.ts @@ -0,0 +1,202 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { deepStrictEqual, strictEqual, throws } from 'assert'; +import type { IRasterizedGlyph } from '../../../../../browser/gpu/raster/raster.js'; +import { ensureNonNullable } from '../../../../../browser/gpu/gpuUtils.js'; +import type { ITextureAtlasAllocator } from '../../../../../browser/gpu/atlas/atlas.js'; +import { TextureAtlasShelfAllocator } from '../../../../../browser/gpu/atlas/textureAtlasShelfAllocator.js'; +import { TextureAtlasSlabAllocator, type TextureAtlasSlabAllocatorOptions } from '../../../../../browser/gpu/atlas/textureAtlasSlabAllocator.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../../base/test/common/utils.js'; +import { assertIsValidGlyph } from './testUtil.js'; +import { BugIndicatingError } from '../../../../../../base/common/errors.js'; + +const blackArr = [0x00, 0x00, 0x00, 0xFF]; + +const pixel1x1 = createRasterizedGlyph(1, 1, [...blackArr]); +const pixel2x1 = createRasterizedGlyph(2, 1, [...blackArr, ...blackArr]); +const pixel1x2 = createRasterizedGlyph(1, 2, [...blackArr, ...blackArr]); + +function createRasterizedGlyph(w: number, h: number, data: ArrayLike): IRasterizedGlyph { + strictEqual(w * h * 4, data.length); + const source = new OffscreenCanvas(w, h); + const imageData = new ImageData(w, h); + imageData.data.set(data); + ensureNonNullable(source.getContext('2d')).putImageData(imageData, 0, 0); + return { + source, + boundingBox: { top: 0, left: 0, bottom: h - 1, right: w - 1 }, + originOffset: { x: 0, y: 0 }, + }; +} + +function allocateAndAssert(allocator: ITextureAtlasAllocator, rasterizedGlyph: IRasterizedGlyph, expected: { x: number; y: number; w: number; h: number } | undefined): void { + const actual = allocator.allocate(rasterizedGlyph); + if (!actual) { + strictEqual(actual, expected); + return; + } + deepStrictEqual({ + x: actual.x, + y: actual.y, + w: actual.w, + h: actual.h, + }, expected); +} + +function initShelfAllocator(w: number, h: number): { canvas: OffscreenCanvas; allocator: TextureAtlasShelfAllocator } { + const canvas = new OffscreenCanvas(w, h); + const allocator = new TextureAtlasShelfAllocator(canvas, 0); + return { canvas, allocator }; +} + +function initSlabAllocator(w: number, h: number, options?: TextureAtlasSlabAllocatorOptions): { canvas: OffscreenCanvas; allocator: TextureAtlasSlabAllocator } { + const canvas = new OffscreenCanvas(w, h); + const allocator = new TextureAtlasSlabAllocator(canvas, 0, options); + return { canvas, allocator }; +} + +const allocatorDefinitions: { name: string; initAllocator: (w: number, h: number) => { canvas: OffscreenCanvas; allocator: ITextureAtlasAllocator } }[] = [ + { name: 'shelf', initAllocator: initShelfAllocator }, + { name: 'slab', initAllocator: initSlabAllocator }, +]; + +suite('TextureAtlasAllocator', () => { + ensureNoDisposablesAreLeakedInTestSuite(); + + suite('shared tests', () => { + for (const { name, initAllocator } of allocatorDefinitions) { + test(`(${name}) single allocation`, () => { + const { canvas, allocator } = initAllocator(2, 2); + assertIsValidGlyph(allocator.allocate(pixel1x1), canvas); + }); + // Skipping because it fails unexpectedly on web only when asserting the error message + test.skip(`(${name}) glyph too large for canvas`, () => { + const { allocator } = initAllocator(1, 1); + throws(() => allocateAndAssert(allocator, pixel2x1, undefined), new BugIndicatingError('Glyph is too large for the atlas page')); + }); + } + }); + + suite('TextureAtlasShelfAllocator', () => { + const initAllocator = initShelfAllocator; + + test('single allocation', () => { + const { allocator } = initAllocator(2, 2); + // 1o + // oo + allocateAndAssert(allocator, pixel1x1, { x: 0, y: 0, w: 1, h: 1 }); + }); + test('wrapping', () => { + const { allocator } = initAllocator(5, 4); + + // 1233o + // o2ooo + // ooooo + // ooooo + allocateAndAssert(allocator, pixel1x1, { x: 0, y: 0, w: 1, h: 1 }); + allocateAndAssert(allocator, pixel1x2, { x: 1, y: 0, w: 1, h: 2 }); + allocateAndAssert(allocator, pixel2x1, { x: 2, y: 0, w: 2, h: 1 }); + + // 1233x + // x2xxx + // 44556 + // ooooo + allocateAndAssert(allocator, pixel2x1, { x: 0, y: 2, w: 2, h: 1 }); + allocateAndAssert(allocator, pixel2x1, { x: 2, y: 2, w: 2, h: 1 }); + allocateAndAssert(allocator, pixel1x1, { x: 4, y: 2, w: 1, h: 1 }); + + // 1233x + // x2xxx + // 44556 + // 7oooo + allocateAndAssert(allocator, pixel1x1, { x: 0, y: 3, w: 1, h: 1 }); + }); + test('full', () => { + const { allocator } = initAllocator(3, 2); + // 122 + // 1oo + allocateAndAssert(allocator, pixel1x2, { x: 0, y: 0, w: 1, h: 2 }); + allocateAndAssert(allocator, pixel2x1, { x: 1, y: 0, w: 2, h: 1 }); + allocateAndAssert(allocator, pixel1x1, undefined); + }); + }); + + suite('TextureAtlasSlabAllocator', () => { + const initAllocator = initSlabAllocator; + + test('single allocation', () => { + const { allocator } = initAllocator(2, 2); + // 1o + // oo + allocateAndAssert(allocator, pixel1x1, { x: 0, y: 0, w: 1, h: 1 }); + }); + + test('single slab single glyph full', () => { + const { allocator } = initAllocator(1, 1, { slabW: 1, slabH: 1 }); + + // 1 + allocateAndAssert(allocator, pixel1x1, { x: 0, y: 0, w: 1, h: 1 }); + + allocateAndAssert(allocator, pixel1x1, undefined); + }); + + test('single slab multiple glyph full', () => { + const { allocator } = initAllocator(2, 2, { slabW: 2, slabH: 2 }); + + // 1 + // 1 + allocateAndAssert(allocator, pixel1x2, { x: 0, y: 0, w: 1, h: 2 }); + allocateAndAssert(allocator, pixel1x2, { x: 1, y: 0, w: 1, h: 2 }); + + allocateAndAssert(allocator, pixel1x2, undefined); + }); + + test('allocate 1x1 to multiple slabs until full', () => { + const { allocator } = initAllocator(4, 2, { slabW: 2, slabH: 2 }); + + // 12│oo + // 34│oo + allocateAndAssert(allocator, pixel1x1, { x: 0, y: 0, w: 1, h: 1 }); + allocateAndAssert(allocator, pixel1x1, { x: 1, y: 0, w: 1, h: 1 }); + allocateAndAssert(allocator, pixel1x1, { x: 0, y: 1, w: 1, h: 1 }); + allocateAndAssert(allocator, pixel1x1, { x: 1, y: 1, w: 1, h: 1 }); + + // 12│56 + // 34│78 + allocateAndAssert(allocator, pixel1x1, { x: 2, y: 0, w: 1, h: 1 }); + allocateAndAssert(allocator, pixel1x1, { x: 3, y: 0, w: 1, h: 1 }); + allocateAndAssert(allocator, pixel1x1, { x: 2, y: 1, w: 1, h: 1 }); + allocateAndAssert(allocator, pixel1x1, { x: 3, y: 1, w: 1, h: 1 }); + + allocateAndAssert(allocator, pixel1x1, undefined); + }); + + test('glyph too large for slab (increase slab size for first glyph)', () => { + const { allocator } = initAllocator(2, 2, { slabW: 1, slabH: 1 }); + allocateAndAssert(allocator, pixel2x1, { x: 0, y: 0, w: 2, h: 1 }); + }); + + test('glyph too large for slab (undefined as it\'s not the first glyph)', () => { + const { allocator } = initAllocator(2, 2, { slabW: 1, slabH: 1 }); + allocateAndAssert(allocator, pixel1x1, { x: 0, y: 0, w: 1, h: 1 }); + allocateAndAssert(allocator, pixel2x1, undefined); + }); + + test('separate slabs for different sized glyphs', () => { + const { allocator } = initAllocator(4, 2, { slabW: 2, slabH: 2 }); + + // 10│2o + // 00│2o + allocateAndAssert(allocator, pixel1x1, { x: 0, y: 0, w: 1, h: 1 }); + allocateAndAssert(allocator, pixel1x2, { x: 2, y: 0, w: 1, h: 2 }); + + // 14│23 + // 00│23 + allocateAndAssert(allocator, pixel1x2, { x: 3, y: 0, w: 1, h: 2 }); + allocateAndAssert(allocator, pixel1x1, { x: 1, y: 0, w: 1, h: 1 }); + }); + }); +}); diff --git a/src/vs/editor/test/browser/view/gpu/bufferDirtyTracker.test.ts b/src/vs/editor/test/browser/view/gpu/bufferDirtyTracker.test.ts new file mode 100644 index 00000000000..0ddc7a5befe --- /dev/null +++ b/src/vs/editor/test/browser/view/gpu/bufferDirtyTracker.test.ts @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { strictEqual } from 'assert'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { BufferDirtyTracker } from '../../../../browser/gpu/bufferDirtyTracker.js'; + +suite('BufferDirtyTracker', () => { + ensureNoDisposablesAreLeakedInTestSuite(); + + let bdt: BufferDirtyTracker; + + function assertState(dataOffset: number | undefined, dirtySize: number | undefined) { + strictEqual(bdt.dataOffset, dataOffset); + strictEqual(bdt.dirtySize, dirtySize); + strictEqual(bdt.isDirty, dataOffset !== undefined); + } + + setup(() => { + bdt = new BufferDirtyTracker(); + }); + + test('flag(index)', () => { + strictEqual(bdt.flag(0), 0); + assertState(0, 1); + strictEqual(bdt.flag(31), 31); + assertState(0, 32); + bdt.clear(); + assertState(undefined, undefined); + strictEqual(bdt.flag(10), 10); + assertState(10, 1); + strictEqual(bdt.flag(15), 15); + assertState(10, 6); + }); + + test('flag(index, length)', () => { + bdt.flag(0, 32); + assertState(0, 32); + bdt.clear(); + assertState(undefined, undefined); + bdt.flag(10, 6); + assertState(10, 6); + }); +}); diff --git a/src/vs/editor/test/browser/view/gpu/objectCollectionBuffer.test.ts b/src/vs/editor/test/browser/view/gpu/objectCollectionBuffer.test.ts new file mode 100644 index 00000000000..ae8c0670d2b --- /dev/null +++ b/src/vs/editor/test/browser/view/gpu/objectCollectionBuffer.test.ts @@ -0,0 +1,108 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { deepStrictEqual, strictEqual } from 'assert'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { createObjectCollectionBuffer, type IObjectCollectionBuffer } from '../../../../browser/gpu/objectCollectionBuffer.js'; + +suite('ObjectCollectionBuffer', () => { + const store = ensureNoDisposablesAreLeakedInTestSuite(); + + function assertUsedData(buffer: IObjectCollectionBuffer, expected: number[]) { + deepStrictEqual(Array.from(buffer.view.subarray(0, buffer.viewUsedSize)), expected); + } + + test('createEntry', () => { + const buffer = store.add(createObjectCollectionBuffer([ + { name: 'a' }, + { name: 'b' }, + ] as const, 5)); + assertUsedData(buffer, []); + + store.add(buffer.createEntry({ a: 1, b: 2 })); + store.add(buffer.createEntry({ a: 3, b: 4 })); + store.add(buffer.createEntry({ a: 5, b: 6 })); + store.add(buffer.createEntry({ a: 7, b: 8 })); + store.add(buffer.createEntry({ a: 9, b: 10 })); + assertUsedData(buffer, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + }); + + test('createEntry beyond capacity', () => { + const buffer = store.add(createObjectCollectionBuffer([ + { name: 'a' }, + { name: 'b' }, + ] as const, 1)); + store.add(buffer.createEntry({ a: 1, b: 2 })); + strictEqual(buffer.entryCount, 1); + strictEqual(buffer.buffer.byteLength, 8); + buffer.createEntry({ a: 3, b: 4 }); + strictEqual(buffer.entryCount, 2); + strictEqual(buffer.buffer.byteLength, 16); + }); + + test('dispose entry', () => { + const buffer = store.add(createObjectCollectionBuffer([ + { name: 'a' }, + { name: 'b' }, + ] as const, 5)); + store.add(buffer.createEntry({ a: 1, b: 2 })); + const entry1 = buffer.createEntry({ a: 3, b: 4 }); + store.add(buffer.createEntry({ a: 5, b: 6 })); + const entry2 = buffer.createEntry({ a: 7, b: 8 }); + store.add(buffer.createEntry({ a: 9, b: 10 })); + entry1.dispose(); + entry2.dispose(); + // Data from disposed entries is stale and doesn't need to be validated + assertUsedData(buffer, [1, 2, 5, 6, 9, 10]); + }); + + test('entryCount, viewUsedSize, bufferUsedSize', () => { + const buffer = store.add(createObjectCollectionBuffer([ + { name: 'foo' }, + { name: 'bar' }, + ] as const, 5)); + strictEqual(buffer.entryCount, 0); + strictEqual(buffer.bufferUsedSize, 0); + strictEqual(buffer.viewUsedSize, 0); + buffer.createEntry({ foo: 1, bar: 2 }); + strictEqual(buffer.entryCount, 1); + strictEqual(buffer.viewUsedSize, 2); + strictEqual(buffer.bufferUsedSize, 8); + const entry = buffer.createEntry({ foo: 3, bar: 4 }); + strictEqual(buffer.entryCount, 2); + strictEqual(buffer.viewUsedSize, 4); + strictEqual(buffer.bufferUsedSize, 16); + entry.dispose(); + strictEqual(buffer.entryCount, 1); + strictEqual(buffer.viewUsedSize, 2); + strictEqual(buffer.bufferUsedSize, 8); + }); + + test('entry.get', () => { + const buffer = store.add(createObjectCollectionBuffer([ + { name: 'foo' }, + { name: 'bar' }, + ] as const, 5)); + const entry = store.add(buffer.createEntry({ foo: 1, bar: 2 })); + strictEqual(entry.get('foo'), 1); + strictEqual(entry.get('bar'), 2); + }); + + test('entry.set', () => { + const buffer = store.add(createObjectCollectionBuffer([ + { name: 'foo' }, + { name: 'bar' }, + ] as const, 5)); + const entry = store.add(buffer.createEntry({ foo: 1, bar: 2 })); + let changeCount = 0; + store.add(buffer.onDidChange(() => changeCount++)); + entry.set('foo', 3); + strictEqual(changeCount, 1); + strictEqual(entry.get('foo'), 3); + entry.set('bar', 4); + strictEqual(changeCount, 2); + strictEqual(entry.get('bar'), 4); + }); +}); diff --git a/src/vs/editor/test/browser/view/minimapCharRenderer.test.ts b/src/vs/editor/test/browser/view/minimapCharRenderer.test.ts index 4fcfa5cf3cd..20af8f3d03f 100644 --- a/src/vs/editor/test/browser/view/minimapCharRenderer.test.ts +++ b/src/vs/editor/test/browser/view/minimapCharRenderer.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { MinimapCharRendererFactory } from 'vs/editor/browser/viewParts/minimap/minimapCharRendererFactory'; -import { Constants } from 'vs/editor/browser/viewParts/minimap/minimapCharSheet'; -import { RGBA8 } from 'vs/editor/common/core/rgba'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { MinimapCharRendererFactory } from '../../../browser/viewParts/minimap/minimapCharRendererFactory.js'; +import { Constants } from '../../../browser/viewParts/minimap/minimapCharSheet.js'; +import { RGBA8 } from '../../../common/core/rgba.js'; suite('MinimapCharRenderer', () => { diff --git a/src/vs/editor/test/browser/view/viewLayer.test.ts b/src/vs/editor/test/browser/view/viewLayer.test.ts index 0f9588d870c..e9632a4c991 100644 --- a/src/vs/editor/test/browser/view/viewLayer.test.ts +++ b/src/vs/editor/test/browser/view/viewLayer.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ILine, RenderedLinesCollection } from 'vs/editor/browser/view/viewLayer'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ILine, RenderedLinesCollection } from '../../../browser/view/viewLayer.js'; class TestLine implements ILine { @@ -45,7 +45,7 @@ suite('RenderedLinesCollection onLinesDeleted', () => { ensureNoDisposablesAreLeakedInTestSuite(); function testOnModelLinesDeleted(deleteFromLineNumber: number, deleteToLineNumber: number, expectedDeleted: string[], expectedState: ILinesCollectionState): void { - const col = new RenderedLinesCollection(() => new TestLine('new')); + const col = new RenderedLinesCollection({ createLine: () => new TestLine('new') }); col._set(6, [ new TestLine('old6'), new TestLine('old7'), @@ -322,7 +322,7 @@ suite('RenderedLinesCollection onLineChanged', () => { ensureNoDisposablesAreLeakedInTestSuite(); function testOnModelLineChanged(changedLineNumber: number, expectedPinged: boolean, expectedState: ILinesCollectionState): void { - const col = new RenderedLinesCollection(() => new TestLine('new')); + const col = new RenderedLinesCollection({ createLine: () => new TestLine('new') }); col._set(6, [ new TestLine('old6'), new TestLine('old7'), @@ -405,7 +405,7 @@ suite('RenderedLinesCollection onLinesInserted', () => { ensureNoDisposablesAreLeakedInTestSuite(); function testOnModelLinesInserted(insertFromLineNumber: number, insertToLineNumber: number, expectedDeleted: string[], expectedState: ILinesCollectionState): void { - const col = new RenderedLinesCollection(() => new TestLine('new')); + const col = new RenderedLinesCollection({ createLine: () => new TestLine('new') }); col._set(6, [ new TestLine('old6'), new TestLine('old7'), @@ -683,7 +683,7 @@ suite('RenderedLinesCollection onTokensChanged', () => { ensureNoDisposablesAreLeakedInTestSuite(); function testOnModelTokensChanged(changedFromLineNumber: number, changedToLineNumber: number, expectedPinged: boolean, expectedState: ILinesCollectionState): void { - const col = new RenderedLinesCollection(() => new TestLine('new')); + const col = new RenderedLinesCollection({ createLine: () => new TestLine('new') }); col._set(6, [ new TestLine('old6'), new TestLine('old7'), diff --git a/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts b/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts index 292aa0ed1fa..417249f546b 100644 --- a/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts +++ b/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts @@ -4,24 +4,24 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import * as languages from 'vs/editor/common/languages'; -import { NullState } from 'vs/editor/common/languages/nullTokenize'; -import { EndOfLinePreference } from 'vs/editor/common/model'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { ModelLineProjectionData } from 'vs/editor/common/modelLineProjectionData'; -import { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { ViewLineData } from 'vs/editor/common/viewModel'; -import { IModelLineProjection, ISimpleModel, createModelLineProjection } from 'vs/editor/common/viewModel/modelLineProjection'; -import { MonospaceLineBreaksComputerFactory } from 'vs/editor/common/viewModel/monospaceLineBreaksComputer'; -import { ViewModelLinesFromProjectedModel } from 'vs/editor/common/viewModel/viewModelLines'; -import { TestConfiguration } from 'vs/editor/test/browser/config/testConfiguration'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { EditorOption } from '../../../common/config/editorOptions.js'; +import { Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { MetadataConsts } from '../../../common/encodedTokenAttributes.js'; +import * as languages from '../../../common/languages.js'; +import { NullState } from '../../../common/languages/nullTokenize.js'; +import { EndOfLinePreference } from '../../../common/model.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { ModelLineProjectionData } from '../../../common/modelLineProjectionData.js'; +import { IViewLineTokens } from '../../../common/tokens/lineTokens.js'; +import { ViewLineData } from '../../../common/viewModel.js'; +import { IModelLineProjection, ISimpleModel, createModelLineProjection } from '../../../common/viewModel/modelLineProjection.js'; +import { MonospaceLineBreaksComputerFactory } from '../../../common/viewModel/monospaceLineBreaksComputer.js'; +import { ViewModelLinesFromProjectedModel } from '../../../common/viewModel/viewModelLines.js'; +import { TestConfiguration } from '../config/testConfiguration.js'; +import { createTextModel } from '../../common/testTextModel.js'; suite('Editor ViewModel - SplitLinesCollection', () => { diff --git a/src/vs/editor/test/browser/viewModel/testViewModel.ts b/src/vs/editor/test/browser/viewModel/testViewModel.ts index 36749b71bd6..1c59f3de14e 100644 --- a/src/vs/editor/test/browser/viewModel/testViewModel.ts +++ b/src/vs/editor/test/browser/viewModel/testViewModel.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; -import { TestConfiguration } from 'vs/editor/test/browser/config/testConfiguration'; -import { MonospaceLineBreaksComputerFactory } from 'vs/editor/common/viewModel/monospaceLineBreaksComputer'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; +import { IEditorOptions } from '../../../common/config/editorOptions.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { ViewModel } from '../../../common/viewModel/viewModelImpl.js'; +import { TestConfiguration } from '../config/testConfiguration.js'; +import { MonospaceLineBreaksComputerFactory } from '../../../common/viewModel/monospaceLineBreaksComputer.js'; +import { createTextModel } from '../../common/testTextModel.js'; +import { TestLanguageConfigurationService } from '../../common/modes/testLanguageConfigurationService.js'; +import { TestThemeService } from '../../../../platform/theme/test/common/testThemeService.js'; export function testViewModel(text: string[], options: IEditorOptions, callback: (viewModel: ViewModel, model: TextModel) => void): void { const EDITOR_ID = 1; diff --git a/src/vs/editor/test/browser/viewModel/viewModelDecorations.test.ts b/src/vs/editor/test/browser/viewModel/viewModelDecorations.test.ts index a89fc01e245..bed88ad1260 100644 --- a/src/vs/editor/test/browser/viewModel/viewModelDecorations.test.ts +++ b/src/vs/editor/test/browser/viewModel/viewModelDecorations.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { Range } from 'vs/editor/common/core/range'; -import { InlineDecoration, InlineDecorationType } from 'vs/editor/common/viewModel'; -import { testViewModel } from 'vs/editor/test/browser/viewModel/testViewModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IEditorOptions } from '../../../common/config/editorOptions.js'; +import { Range } from '../../../common/core/range.js'; +import { InlineDecoration, InlineDecorationType } from '../../../common/viewModel.js'; +import { testViewModel } from './testViewModel.js'; suite('ViewModelDecorations', () => { diff --git a/src/vs/editor/test/browser/viewModel/viewModelImpl.test.ts b/src/vs/editor/test/browser/viewModel/viewModelImpl.test.ts index ff16b570be1..8afa07a8b56 100644 --- a/src/vs/editor/test/browser/viewModel/viewModelImpl.test.ts +++ b/src/vs/editor/test/browser/viewModel/viewModelImpl.test.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { EndOfLineSequence, PositionAffinity } from 'vs/editor/common/model'; -import { ViewEventHandler } from 'vs/editor/common/viewEventHandler'; -import { ViewEvent } from 'vs/editor/common/viewEvents'; -import { testViewModel } from 'vs/editor/test/browser/viewModel/testViewModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { EndOfLineSequence, PositionAffinity } from '../../../common/model.js'; +import { ViewEventHandler } from '../../../common/viewEventHandler.js'; +import { ViewEvent } from '../../../common/viewEvents.js'; +import { testViewModel } from './testViewModel.js'; suite('ViewModel', () => { diff --git a/src/vs/editor/test/browser/widget/codeEditorWidget.test.ts b/src/vs/editor/test/browser/widget/codeEditorWidget.test.ts index a09d5c98f18..fead379bd24 100644 --- a/src/vs/editor/test/browser/widget/codeEditorWidget.test.ts +++ b/src/vs/editor/test/browser/widget/codeEditorWidget.test.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { withTestCodeEditor } from '../testCodeEditor.js'; suite('CodeEditorWidget', () => { diff --git a/src/vs/editor/test/browser/widget/diffEditorWidget.test.ts b/src/vs/editor/test/browser/widget/diffEditorWidget.test.ts index 53ecda34e13..eeac9f526e5 100644 --- a/src/vs/editor/test/browser/widget/diffEditorWidget.test.ts +++ b/src/vs/editor/test/browser/widget/diffEditorWidget.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { UnchangedRegion } from 'vs/editor/browser/widget/diffEditor/diffEditorViewModel'; -import { LineRange } from 'vs/editor/common/core/lineRange'; -import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { UnchangedRegion } from '../../../browser/widget/diffEditor/diffEditorViewModel.js'; +import { LineRange } from '../../../common/core/lineRange.js'; +import { DetailedLineRangeMapping } from '../../../common/diff/rangeMapping.js'; suite('DiffEditorWidget2', () => { diff --git a/src/vs/editor/test/browser/widget/observableCodeEditor.test.ts b/src/vs/editor/test/browser/widget/observableCodeEditor.test.ts index 5ae9f3d81f5..d9144896afe 100644 --- a/src/vs/editor/test/browser/widget/observableCodeEditor.test.ts +++ b/src/vs/editor/test/browser/widget/observableCodeEditor.test.ts @@ -4,21 +4,21 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from "assert"; -import { DisposableStore } from "vs/base/common/lifecycle"; -import { IObservable, derivedHandleChanges } from "vs/base/common/observable"; -import { ensureNoDisposablesAreLeakedInTestSuite } from "vs/base/test/common/utils"; -import { ICodeEditor } from "vs/editor/browser/editorBrowser"; -import { ObservableCodeEditor, observableCodeEditor } from "vs/editor/browser/observableCodeEditor"; -import { Position } from "vs/editor/common/core/position"; -import { Range } from "vs/editor/common/core/range"; -import { ViewModel } from "vs/editor/common/viewModel/viewModelImpl"; -import { withTestCodeEditor } from "vs/editor/test/browser/testCodeEditor"; +import { DisposableStore } from "../../../../base/common/lifecycle.js"; +import { IObservable, derivedHandleChanges } from "../../../../base/common/observable.js"; +import { ensureNoDisposablesAreLeakedInTestSuite } from "../../../../base/test/common/utils.js"; +import { ICodeEditor } from "../../../browser/editorBrowser.js"; +import { ObservableCodeEditor, observableCodeEditor } from "../../../browser/observableCodeEditor.js"; +import { Position } from "../../../common/core/position.js"; +import { Range } from "../../../common/core/range.js"; +import { ViewModel } from "../../../common/viewModel/viewModelImpl.js"; +import { withTestCodeEditor } from "../testCodeEditor.js"; suite("CodeEditorWidget", () => { ensureNoDisposablesAreLeakedInTestSuite(); function withTestFixture( - cb: (args: { editor: ICodeEditor; viewModel: ViewModel; log: Log; derived: IObservable; }) => void + cb: (args: { editor: ICodeEditor; viewModel: ViewModel; log: Log; derived: IObservable }) => void ) { withEditorSetupTestFixture(undefined, cb); } @@ -27,7 +27,7 @@ suite("CodeEditorWidget", () => { preSetupCallback: | ((editor: ICodeEditor, disposables: DisposableStore) => void) | undefined, - cb: (args: { editor: ICodeEditor; viewModel: ViewModel; log: Log; derived: IObservable; }) => void + cb: (args: { editor: ICodeEditor; viewModel: ViewModel; log: Log; derived: IObservable }) => void ) { withTestCodeEditor("hello world", {}, (editor, viewModel) => { const disposables = new DisposableStore(); diff --git a/src/vs/editor/test/common/controller/cursorAtomicMoveOperations.test.ts b/src/vs/editor/test/common/controller/cursorAtomicMoveOperations.test.ts index 9c2efda4f77..819c2b9622e 100644 --- a/src/vs/editor/test/common/controller/cursorAtomicMoveOperations.test.ts +++ b/src/vs/editor/test/common/controller/cursorAtomicMoveOperations.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { AtomicTabMoveOperations, Direction } from 'vs/editor/common/cursor/cursorAtomicMoveOperations'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { AtomicTabMoveOperations, Direction } from '../../../common/cursor/cursorAtomicMoveOperations.js'; suite('Cursor move command test', () => { diff --git a/src/vs/editor/test/common/core/characterClassifier.test.ts b/src/vs/editor/test/common/core/characterClassifier.test.ts index 4271d91f923..7bd42977c34 100644 --- a/src/vs/editor/test/common/core/characterClassifier.test.ts +++ b/src/vs/editor/test/common/core/characterClassifier.test.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CharCode } from 'vs/base/common/charCode'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { CharacterClassifier } from 'vs/editor/common/core/characterClassifier'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { CharacterClassifier } from '../../../common/core/characterClassifier.js'; suite('CharacterClassifier', () => { diff --git a/src/vs/editor/test/common/controller/cursorMoveHelper.test.ts b/src/vs/editor/test/common/core/cursorColumns.test.ts similarity index 77% rename from src/vs/editor/test/common/controller/cursorMoveHelper.test.ts rename to src/vs/editor/test/common/core/cursorColumns.test.ts index e90bdd5a571..9e9f2728046 100644 --- a/src/vs/editor/test/common/controller/cursorMoveHelper.test.ts +++ b/src/vs/editor/test/common/core/cursorColumns.test.ts @@ -3,45 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { CursorColumns } from 'vs/editor/common/core/cursorColumns'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { CursorColumns } from '../../../common/core/cursorColumns.js'; -suite('CursorMove', () => { +suite('CursorColumns', () => { ensureNoDisposablesAreLeakedInTestSuite(); - test('nextRenderTabStop', () => { - assert.strictEqual(CursorColumns.nextRenderTabStop(0, 4), 4); - assert.strictEqual(CursorColumns.nextRenderTabStop(1, 4), 4); - assert.strictEqual(CursorColumns.nextRenderTabStop(2, 4), 4); - assert.strictEqual(CursorColumns.nextRenderTabStop(3, 4), 4); - assert.strictEqual(CursorColumns.nextRenderTabStop(4, 4), 8); - assert.strictEqual(CursorColumns.nextRenderTabStop(5, 4), 8); - assert.strictEqual(CursorColumns.nextRenderTabStop(6, 4), 8); - assert.strictEqual(CursorColumns.nextRenderTabStop(7, 4), 8); - assert.strictEqual(CursorColumns.nextRenderTabStop(8, 4), 12); - - assert.strictEqual(CursorColumns.nextRenderTabStop(0, 2), 2); - assert.strictEqual(CursorColumns.nextRenderTabStop(1, 2), 2); - assert.strictEqual(CursorColumns.nextRenderTabStop(2, 2), 4); - assert.strictEqual(CursorColumns.nextRenderTabStop(3, 2), 4); - assert.strictEqual(CursorColumns.nextRenderTabStop(4, 2), 6); - assert.strictEqual(CursorColumns.nextRenderTabStop(5, 2), 6); - assert.strictEqual(CursorColumns.nextRenderTabStop(6, 2), 8); - assert.strictEqual(CursorColumns.nextRenderTabStop(7, 2), 8); - assert.strictEqual(CursorColumns.nextRenderTabStop(8, 2), 10); - - assert.strictEqual(CursorColumns.nextRenderTabStop(0, 1), 1); - assert.strictEqual(CursorColumns.nextRenderTabStop(1, 1), 2); - assert.strictEqual(CursorColumns.nextRenderTabStop(2, 1), 3); - assert.strictEqual(CursorColumns.nextRenderTabStop(3, 1), 4); - assert.strictEqual(CursorColumns.nextRenderTabStop(4, 1), 5); - assert.strictEqual(CursorColumns.nextRenderTabStop(5, 1), 6); - assert.strictEqual(CursorColumns.nextRenderTabStop(6, 1), 7); - assert.strictEqual(CursorColumns.nextRenderTabStop(7, 1), 8); - assert.strictEqual(CursorColumns.nextRenderTabStop(8, 1), 9); - }); - test('visibleColumnFromColumn', () => { function testVisibleColumnFromColumn(text: string, tabSize: number, column: number, expected: number): void { @@ -101,6 +69,62 @@ suite('CursorMove', () => { testVisibleColumnFromColumn('📚az', 4, 5, 4); }); + test('toStatusbarColumn', () => { + + function t(text: string, tabSize: number, column: number, expected: number): void { + assert.strictEqual(CursorColumns.toStatusbarColumn(text, column, tabSize), expected, `<>`); + } + + t(' spaces', 4, 1, 1); + t(' spaces', 4, 2, 2); + t(' spaces', 4, 3, 3); + t(' spaces', 4, 4, 4); + t(' spaces', 4, 5, 5); + t(' spaces', 4, 6, 6); + t(' spaces', 4, 7, 7); + t(' spaces', 4, 8, 8); + t(' spaces', 4, 9, 9); + t(' spaces', 4, 10, 10); + t(' spaces', 4, 11, 11); + + t('\ttab', 4, 1, 1); + t('\ttab', 4, 2, 5); + t('\ttab', 4, 3, 6); + t('\ttab', 4, 4, 7); + t('\ttab', 4, 5, 8); + + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 1, 1); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 2, 2); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 3, 2); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 4, 3); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 5, 3); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 6, 4); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 7, 4); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 8, 5); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 9, 5); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 10, 6); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 11, 6); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 12, 7); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 13, 7); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 14, 8); + t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 15, 8); + + t('🎈🎈🎈🎈', 4, 1, 1); + t('🎈🎈🎈🎈', 4, 2, 2); + t('🎈🎈🎈🎈', 4, 3, 2); + t('🎈🎈🎈🎈', 4, 4, 3); + t('🎈🎈🎈🎈', 4, 5, 3); + t('🎈🎈🎈🎈', 4, 6, 4); + t('🎈🎈🎈🎈', 4, 7, 4); + t('🎈🎈🎈🎈', 4, 8, 5); + t('🎈🎈🎈🎈', 4, 9, 5); + + t('何何何何', 4, 1, 1); + t('何何何何', 4, 2, 2); + t('何何何何', 4, 3, 3); + t('何何何何', 4, 4, 4); + }); + test('columnFromVisibleColumn', () => { function testColumnFromVisibleColumn(text: string, tabSize: number, visibleColumn: number, expected: number): void { @@ -177,59 +201,81 @@ suite('CursorMove', () => { testColumnFromVisibleColumn('📚az', 4, 4, 5); }); - test('toStatusbarColumn', () => { + for (const [name, fn] of [ + ['nextRenderTabStop', CursorColumns.nextRenderTabStop], + ['nextIndentTabStop', CursorColumns.nextIndentTabStop], + ] as const) { + test(name, () => { + assert.strictEqual(fn(0, 4), 4); + assert.strictEqual(fn(1, 4), 4); + assert.strictEqual(fn(2, 4), 4); + assert.strictEqual(fn(3, 4), 4); + assert.strictEqual(fn(4, 4), 8); + assert.strictEqual(fn(5, 4), 8); + assert.strictEqual(fn(6, 4), 8); + assert.strictEqual(fn(7, 4), 8); + assert.strictEqual(fn(8, 4), 12); - function t(text: string, tabSize: number, column: number, expected: number): void { - assert.strictEqual(CursorColumns.toStatusbarColumn(text, column, tabSize), expected, `<>`); - } + assert.strictEqual(fn(0, 2), 2); + assert.strictEqual(fn(1, 2), 2); + assert.strictEqual(fn(2, 2), 4); + assert.strictEqual(fn(3, 2), 4); + assert.strictEqual(fn(4, 2), 6); + assert.strictEqual(fn(5, 2), 6); + assert.strictEqual(fn(6, 2), 8); + assert.strictEqual(fn(7, 2), 8); + assert.strictEqual(fn(8, 2), 10); - t(' spaces', 4, 1, 1); - t(' spaces', 4, 2, 2); - t(' spaces', 4, 3, 3); - t(' spaces', 4, 4, 4); - t(' spaces', 4, 5, 5); - t(' spaces', 4, 6, 6); - t(' spaces', 4, 7, 7); - t(' spaces', 4, 8, 8); - t(' spaces', 4, 9, 9); - t(' spaces', 4, 10, 10); - t(' spaces', 4, 11, 11); + assert.strictEqual(fn(0, 1), 1); + assert.strictEqual(fn(1, 1), 2); + assert.strictEqual(fn(2, 1), 3); + assert.strictEqual(fn(3, 1), 4); + assert.strictEqual(fn(4, 1), 5); + assert.strictEqual(fn(5, 1), 6); + assert.strictEqual(fn(6, 1), 7); + assert.strictEqual(fn(7, 1), 8); + assert.strictEqual(fn(8, 1), 9); + }); + } - t('\ttab', 4, 1, 1); - t('\ttab', 4, 2, 5); - t('\ttab', 4, 3, 6); - t('\ttab', 4, 4, 7); - t('\ttab', 4, 5, 8); + for (const [name, fn] of [ + ['prevRenderTabStop', CursorColumns.prevRenderTabStop], + ['prevIndentTabStop', CursorColumns.prevIndentTabStop], + ] as const) { + test(name, () => { + assert.strictEqual(fn(0, 4), 0); + assert.strictEqual(fn(1, 4), 0); + assert.strictEqual(fn(2, 4), 0); + assert.strictEqual(fn(3, 4), 0); + assert.strictEqual(fn(4, 4), 0); + assert.strictEqual(fn(5, 4), 4); + assert.strictEqual(fn(6, 4), 4); + assert.strictEqual(fn(7, 4), 4); + assert.strictEqual(fn(8, 4), 4); + assert.strictEqual(fn(9, 4), 8); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 1, 1); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 2, 2); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 3, 2); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 4, 3); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 5, 3); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 6, 4); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 7, 4); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 8, 5); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 9, 5); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 10, 6); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 11, 6); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 12, 7); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 13, 7); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 14, 8); - t('𐌀𐌁𐌂𐌃𐌄𐌅𐌆', 4, 15, 8); + assert.strictEqual(fn(0, 2), 0); + assert.strictEqual(fn(1, 2), 0); + assert.strictEqual(fn(2, 2), 0); + assert.strictEqual(fn(3, 2), 2); + assert.strictEqual(fn(4, 2), 2); + assert.strictEqual(fn(5, 2), 4); + assert.strictEqual(fn(6, 2), 4); + assert.strictEqual(fn(7, 2), 6); + assert.strictEqual(fn(8, 2), 6); + assert.strictEqual(fn(9, 2), 8); - t('🎈🎈🎈🎈', 4, 1, 1); - t('🎈🎈🎈🎈', 4, 2, 2); - t('🎈🎈🎈🎈', 4, 3, 2); - t('🎈🎈🎈🎈', 4, 4, 3); - t('🎈🎈🎈🎈', 4, 5, 3); - t('🎈🎈🎈🎈', 4, 6, 4); - t('🎈🎈🎈🎈', 4, 7, 4); - t('🎈🎈🎈🎈', 4, 8, 5); - t('🎈🎈🎈🎈', 4, 9, 5); + assert.strictEqual(fn(0, 1), 0); + assert.strictEqual(fn(1, 1), 0); + assert.strictEqual(fn(2, 1), 1); + assert.strictEqual(fn(3, 1), 2); + assert.strictEqual(fn(4, 1), 3); + assert.strictEqual(fn(5, 1), 4); + assert.strictEqual(fn(6, 1), 5); + assert.strictEqual(fn(7, 1), 6); + assert.strictEqual(fn(8, 1), 7); + assert.strictEqual(fn(9, 1), 8); + }); + } - t('何何何何', 4, 1, 1); - t('何何何何', 4, 2, 2); - t('何何何何', 4, 3, 3); - t('何何何何', 4, 4, 4); - }); }); diff --git a/src/vs/editor/test/common/core/lineRange.test.ts b/src/vs/editor/test/common/core/lineRange.test.ts index 1b45b3f2829..30832250039 100644 --- a/src/vs/editor/test/common/core/lineRange.test.ts +++ b/src/vs/editor/test/common/core/lineRange.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { LineRange, LineRangeSet } from 'vs/editor/common/core/lineRange'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { LineRange, LineRangeSet } from '../../../common/core/lineRange.js'; suite('LineRange', () => { diff --git a/src/vs/editor/test/common/core/lineTokens.test.ts b/src/vs/editor/test/common/core/lineTokens.test.ts index d2457fa2bc8..cb53c9d2be1 100644 --- a/src/vs/editor/test/common/core/lineTokens.test.ts +++ b/src/vs/editor/test/common/core/lineTokens.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { LanguageIdCodec } from 'vs/editor/common/services/languagesRegistry'; -import { IViewLineTokens, LineTokens } from 'vs/editor/common/tokens/lineTokens'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { MetadataConsts } from '../../../common/encodedTokenAttributes.js'; +import { LanguageIdCodec } from '../../../common/services/languagesRegistry.js'; +import { IViewLineTokens, LineTokens } from '../../../common/tokens/lineTokens.js'; suite('LineTokens', () => { diff --git a/src/vs/editor/test/common/core/positionOffsetTransformer.test.ts b/src/vs/editor/test/common/core/positionOffsetTransformer.test.ts index 1811a08e90f..e44b41bd6d6 100644 --- a/src/vs/editor/test/common/core/positionOffsetTransformer.test.ts +++ b/src/vs/editor/test/common/core/positionOffsetTransformer.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { PositionOffsetTransformer } from 'vs/editor/common/core/positionToOffset'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { OffsetRange } from '../../../common/core/offsetRange.js'; +import { PositionOffsetTransformer } from '../../../common/core/positionToOffset.js'; suite('PositionOffsetTransformer', () => { ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/editor/test/common/core/random.ts b/src/vs/editor/test/common/core/random.ts index d48f4173f82..cbf9a5feca6 100644 --- a/src/vs/editor/test/common/core/random.ts +++ b/src/vs/editor/test/common/core/random.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { numberComparator } from 'vs/base/common/arrays'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { Position } from 'vs/editor/common/core/position'; -import { PositionOffsetTransformer } from 'vs/editor/common/core/positionToOffset'; -import { Range } from 'vs/editor/common/core/range'; -import { AbstractText, SingleTextEdit, TextEdit } from 'vs/editor/common/core/textEdit'; +import { numberComparator } from '../../../../base/common/arrays.js'; +import { OffsetRange } from '../../../common/core/offsetRange.js'; +import { Position } from '../../../common/core/position.js'; +import { PositionOffsetTransformer } from '../../../common/core/positionToOffset.js'; +import { Range } from '../../../common/core/range.js'; +import { AbstractText, SingleTextEdit, TextEdit } from '../../../common/core/textEdit.js'; export abstract class Random { public static basicAlphabet: string = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; diff --git a/src/vs/editor/test/common/core/range.test.ts b/src/vs/editor/test/common/core/range.test.ts index fcbb0cd0fcc..5916ebe3370 100644 --- a/src/vs/editor/test/common/core/range.test.ts +++ b/src/vs/editor/test/common/core/range.test.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; suite('Editor Core - Range', () => { diff --git a/src/vs/editor/test/common/core/stringBuilder.test.ts b/src/vs/editor/test/common/core/stringBuilder.test.ts index 6afe99db33a..add3121186a 100644 --- a/src/vs/editor/test/common/core/stringBuilder.test.ts +++ b/src/vs/editor/test/common/core/stringBuilder.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { writeUInt16LE } from 'vs/base/common/buffer'; -import { CharCode } from 'vs/base/common/charCode'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { decodeUTF16LE, StringBuilder } from 'vs/editor/common/core/stringBuilder'; +import { writeUInt16LE } from '../../../../base/common/buffer.js'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { decodeUTF16LE, StringBuilder } from '../../../common/core/stringBuilder.js'; suite('decodeUTF16LE', () => { diff --git a/src/vs/editor/test/common/core/testLineToken.ts b/src/vs/editor/test/common/core/testLineToken.ts index f3c49807941..1d4d832d5c7 100644 --- a/src/vs/editor/test/common/core/testLineToken.ts +++ b/src/vs/editor/test/common/core/testLineToken.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { ColorId, TokenMetadata, ITokenPresentation, StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { ILanguageIdCodec } from 'vs/editor/common/languages'; +import { IViewLineTokens } from '../../../common/tokens/lineTokens.js'; +import { ColorId, TokenMetadata, ITokenPresentation, StandardTokenType } from '../../../common/encodedTokenAttributes.js'; +import { ILanguageIdCodec } from '../../../common/languages.js'; /** * A token on a line. diff --git a/src/vs/editor/test/common/core/textEdit.test.ts b/src/vs/editor/test/common/core/textEdit.test.ts index 4458eaf8a5b..c048f0fbd97 100644 --- a/src/vs/editor/test/common/core/textEdit.test.ts +++ b/src/vs/editor/test/common/core/textEdit.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { StringText } from 'vs/editor/common/core/textEdit'; -import { Random } from 'vs/editor/test/common/core/random'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { OffsetRange } from '../../../common/core/offsetRange.js'; +import { StringText } from '../../../common/core/textEdit.js'; +import { Random } from './random.js'; suite('TextEdit', () => { suite('inverse', () => { diff --git a/src/vs/editor/test/common/diff/diffComputer.test.ts b/src/vs/editor/test/common/diff/diffComputer.test.ts index 651dc5a79f2..d751ff5f43d 100644 --- a/src/vs/editor/test/common/diff/diffComputer.test.ts +++ b/src/vs/editor/test/common/diff/diffComputer.test.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Constants } from 'vs/base/common/uint'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { DiffComputer, ICharChange, ILineChange } from 'vs/editor/common/diff/legacyLinesDiffComputer'; -import { IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/model'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { Constants } from '../../../../base/common/uint.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Range } from '../../../common/core/range.js'; +import { DiffComputer, ICharChange, ILineChange } from '../../../common/diff/legacyLinesDiffComputer.js'; +import { IIdentifiedSingleEditOperation, ITextModel } from '../../../common/model.js'; +import { createTextModel } from '../testTextModel.js'; function assertDiff(originalLines: string[], modifiedLines: string[], expectedChanges: ILineChange[], shouldComputeCharChanges: boolean = true, shouldPostProcessCharChanges: boolean = false, shouldIgnoreTrimWhitespace: boolean = false) { const diffComputer = new DiffComputer(originalLines, modifiedLines, { diff --git a/src/vs/editor/test/common/model/bracketPairColorizer/beforeEditPositionMapper.test.ts b/src/vs/editor/test/common/model/bracketPairColorizer/beforeEditPositionMapper.test.ts index 514556238b5..47d8cd1f2d5 100644 --- a/src/vs/editor/test/common/model/bracketPairColorizer/beforeEditPositionMapper.test.ts +++ b/src/vs/editor/test/common/model/bracketPairColorizer/beforeEditPositionMapper.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { splitLines } from 'vs/base/common/strings'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { BeforeEditPositionMapper, TextEditInfo } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper'; -import { Length, lengthOfString, lengthToObj, lengthToPosition, toLength } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; +import { splitLines } from '../../../../../base/common/strings.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Position } from '../../../../common/core/position.js'; +import { IRange, Range } from '../../../../common/core/range.js'; +import { BeforeEditPositionMapper, TextEditInfo } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.js'; +import { Length, lengthOfString, lengthToObj, lengthToPosition, toLength } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/length.js'; suite('Bracket Pair Colorizer - BeforeEditPositionMapper', () => { diff --git a/src/vs/editor/test/common/model/bracketPairColorizer/brackets.test.ts b/src/vs/editor/test/common/model/bracketPairColorizer/brackets.test.ts index 1c2ea8c3b49..d98e324eca8 100644 --- a/src/vs/editor/test/common/model/bracketPairColorizer/brackets.test.ts +++ b/src/vs/editor/test/common/model/bracketPairColorizer/brackets.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { LanguageAgnosticBracketTokens } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets'; -import { SmallImmutableSet, DenseKeyProvider } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet'; -import { Token, TokenKind } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { LanguageAgnosticBracketTokens } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.js'; +import { SmallImmutableSet, DenseKeyProvider } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js'; +import { Token, TokenKind } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.js'; +import { TestLanguageConfigurationService } from '../../modes/testLanguageConfigurationService.js'; suite('Bracket Pair Colorizer - Brackets', () => { ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/editor/test/common/model/bracketPairColorizer/combineTextEditInfos.test.ts b/src/vs/editor/test/common/model/bracketPairColorizer/combineTextEditInfos.test.ts index a1def431d2b..2d60eb41508 100644 --- a/src/vs/editor/test/common/model/bracketPairColorizer/combineTextEditInfos.test.ts +++ b/src/vs/editor/test/common/model/bracketPairColorizer/combineTextEditInfos.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { SingleTextEdit } from 'vs/editor/common/core/textEdit'; -import { TextEditInfo } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper'; -import { combineTextEditInfos } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos'; -import { lengthAdd, lengthToObj, lengthToPosition, positionToLength, toLength } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { Random } from 'vs/editor/test/common/core/random'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Range } from '../../../../common/core/range.js'; +import { SingleTextEdit } from '../../../../common/core/textEdit.js'; +import { TextEditInfo } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.js'; +import { combineTextEditInfos } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.js'; +import { lengthAdd, lengthToObj, lengthToPosition, positionToLength, toLength } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/length.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { Random } from '../../core/random.js'; +import { createTextModel } from '../../testTextModel.js'; suite('combineTextEditInfos', () => { ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/editor/test/common/model/bracketPairColorizer/concat23Trees.test.ts b/src/vs/editor/test/common/model/bracketPairColorizer/concat23Trees.test.ts index 6fced6cef3e..fbf5a1ba33e 100644 --- a/src/vs/editor/test/common/model/bracketPairColorizer/concat23Trees.test.ts +++ b/src/vs/editor/test/common/model/bracketPairColorizer/concat23Trees.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { AstNode, AstNodeKind, ListAstNode, TextAstNode } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast'; -import { concat23Trees } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees'; -import { toLength } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { AstNode, AstNodeKind, ListAstNode, TextAstNode } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/ast.js'; +import { concat23Trees } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.js'; +import { toLength } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/length.js'; suite('Bracket Pair Colorizer - mergeItems', () => { diff --git a/src/vs/editor/test/common/model/bracketPairColorizer/getBracketPairsInRange.test.ts b/src/vs/editor/test/common/model/bracketPairColorizer/getBracketPairsInRange.test.ts index 87215503dc4..c3293730e82 100644 --- a/src/vs/editor/test/common/model/bracketPairColorizer/getBracketPairsInRange.test.ts +++ b/src/vs/editor/test/common/model/bracketPairColorizer/getBracketPairsInRange.test.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore, disposeOnReturn } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { TokenizationRegistry } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { BracketPairInfo } from 'vs/editor/common/textModelBracketPairs'; -import { TokenInfo, TokenizedDocument } from 'vs/editor/test/common/model/bracketPairColorizer/tokenizer.test'; -import { createModelServices, instantiateTextModel } from 'vs/editor/test/common/testTextModel'; +import { DisposableStore, disposeOnReturn } from '../../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { StandardTokenType } from '../../../../common/encodedTokenAttributes.js'; +import { TokenizationRegistry } from '../../../../common/languages.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { BracketPairInfo } from '../../../../common/textModelBracketPairs.js'; +import { TokenInfo, TokenizedDocument } from './tokenizer.test.js'; +import { createModelServices, instantiateTextModel } from '../../testTextModel.js'; suite('Bracket Pair Colorizer - getBracketPairsInRange', () => { diff --git a/src/vs/editor/test/common/model/bracketPairColorizer/length.test.ts b/src/vs/editor/test/common/model/bracketPairColorizer/length.test.ts index 57086d81ff8..174f0d85cd0 100644 --- a/src/vs/editor/test/common/model/bracketPairColorizer/length.test.ts +++ b/src/vs/editor/test/common/model/bracketPairColorizer/length.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Length, lengthAdd, lengthDiffNonNegative, lengthToObj, toLength } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Length, lengthAdd, lengthDiffNonNegative, lengthToObj, toLength } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/length.js'; suite('Bracket Pair Colorizer - Length', () => { diff --git a/src/vs/editor/test/common/model/bracketPairColorizer/smallImmutableSet.test.ts b/src/vs/editor/test/common/model/bracketPairColorizer/smallImmutableSet.test.ts index 2b5026e4f0c..3714c31fac6 100644 --- a/src/vs/editor/test/common/model/bracketPairColorizer/smallImmutableSet.test.ts +++ b/src/vs/editor/test/common/model/bracketPairColorizer/smallImmutableSet.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { DenseKeyProvider, SmallImmutableSet } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { DenseKeyProvider, SmallImmutableSet } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js'; suite('Bracket Pair Colorizer - ImmutableSet', () => { diff --git a/src/vs/editor/test/common/model/bracketPairColorizer/tokenizer.test.ts b/src/vs/editor/test/common/model/bracketPairColorizer/tokenizer.test.ts index f306d99ccab..3b18e1d835c 100644 --- a/src/vs/editor/test/common/model/bracketPairColorizer/tokenizer.test.ts +++ b/src/vs/editor/test/common/model/bracketPairColorizer/tokenizer.test.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { LanguageId, MetadataConsts, StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { EncodedTokenizationResult, IState, ITokenizationSupport, TokenizationRegistry } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { LanguageAgnosticBracketTokens } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets'; -import { Length, lengthAdd, lengthsToRange, lengthZero } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; -import { DenseKeyProvider } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet'; -import { TextBufferTokenizer, Token, Tokenizer, TokenKind } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { createModelServices, instantiateTextModel } from 'vs/editor/test/common/testTextModel'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { LanguageId, MetadataConsts, StandardTokenType } from '../../../../common/encodedTokenAttributes.js'; +import { EncodedTokenizationResult, IState, ITokenizationSupport, TokenizationRegistry } from '../../../../common/languages.js'; +import { ILanguageService } from '../../../../common/languages/language.js'; +import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js'; +import { LanguageAgnosticBracketTokens } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.js'; +import { Length, lengthAdd, lengthsToRange, lengthZero } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/length.js'; +import { DenseKeyProvider } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js'; +import { TextBufferTokenizer, Token, Tokenizer, TokenKind } from '../../../../common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.js'; +import { TextModel } from '../../../../common/model/textModel.js'; +import { createModelServices, instantiateTextModel } from '../../testTextModel.js'; suite('Bracket Pair Colorizer - Tokenizer', () => { diff --git a/src/vs/editor/test/common/model/editStack.test.ts b/src/vs/editor/test/common/model/editStack.test.ts index da409c9d8a3..4572a71a4a7 100644 --- a/src/vs/editor/test/common/model/editStack.test.ts +++ b/src/vs/editor/test/common/model/editStack.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Selection } from 'vs/editor/common/core/selection'; -import { TextChange } from 'vs/editor/common/core/textChange'; -import { EndOfLineSequence } from 'vs/editor/common/model'; -import { SingleModelEditStackData } from 'vs/editor/common/model/editStack'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Selection } from '../../../common/core/selection.js'; +import { TextChange } from '../../../common/core/textChange.js'; +import { EndOfLineSequence } from '../../../common/model.js'; +import { SingleModelEditStackData } from '../../../common/model/editStack.js'; suite('EditStack', () => { diff --git a/src/vs/editor/test/common/model/editableTextModel.test.ts b/src/vs/editor/test/common/model/editableTextModel.test.ts index d2af9519432..d2b73c7f536 100644 --- a/src/vs/editor/test/common/model/editableTextModel.test.ts +++ b/src/vs/editor/test/common/model/editableTextModel.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Range } from 'vs/editor/common/core/range'; -import { EndOfLinePreference, EndOfLineSequence } from 'vs/editor/common/model'; -import { MirrorTextModel } from 'vs/editor/common/model/mirrorTextModel'; -import { IModelContentChangedEvent } from 'vs/editor/common/textModelEvents'; -import { assertSyncedModels, testApplyEditsWithSyncedModels } from 'vs/editor/test/common/model/editableTextModelTestUtils'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Range } from '../../../common/core/range.js'; +import { EndOfLinePreference, EndOfLineSequence } from '../../../common/model.js'; +import { MirrorTextModel } from '../../../common/model/mirrorTextModel.js'; +import { IModelContentChangedEvent } from '../../../common/textModelEvents.js'; +import { assertSyncedModels, testApplyEditsWithSyncedModels } from './editableTextModelTestUtils.js'; +import { createTextModel } from '../testTextModel.js'; suite('EditorModel - EditableTextModel.applyEdits updates mightContainRTL', () => { diff --git a/src/vs/editor/test/common/model/editableTextModelAuto.test.ts b/src/vs/editor/test/common/model/editableTextModelAuto.test.ts index 31e118bbc82..f8dfb21eb05 100644 --- a/src/vs/editor/test/common/model/editableTextModelAuto.test.ts +++ b/src/vs/editor/test/common/model/editableTextModelAuto.test.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { testApplyEditsWithSyncedModels } from 'vs/editor/test/common/model/editableTextModelTestUtils'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { testApplyEditsWithSyncedModels } from './editableTextModelTestUtils.js'; const GENERATE_TESTS = false; diff --git a/src/vs/editor/test/common/model/editableTextModelTestUtils.ts b/src/vs/editor/test/common/model/editableTextModelTestUtils.ts index 2228a6174a4..2014dc290b0 100644 --- a/src/vs/editor/test/common/model/editableTextModelTestUtils.ts +++ b/src/vs/editor/test/common/model/editableTextModelTestUtils.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { EndOfLinePreference, EndOfLineSequence } from 'vs/editor/common/model'; -import { MirrorTextModel } from 'vs/editor/common/model/mirrorTextModel'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { IModelContentChangedEvent } from 'vs/editor/common/textModelEvents'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { EndOfLinePreference, EndOfLineSequence } from '../../../common/model.js'; +import { MirrorTextModel } from '../../../common/model/mirrorTextModel.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { IModelContentChangedEvent } from '../../../common/textModelEvents.js'; +import { createTextModel } from '../testTextModel.js'; export function testApplyEditsWithSyncedModels(original: string[], edits: ISingleEditOperation[], expected: string[], inputEditsAreInvalid: boolean = false): void { const originalStr = original.join('\n'); diff --git a/src/vs/editor/test/common/model/intervalTree.test.ts b/src/vs/editor/test/common/model/intervalTree.test.ts index dd2fd332be5..b6b09e38314 100644 --- a/src/vs/editor/test/common/model/intervalTree.test.ts +++ b/src/vs/editor/test/common/model/intervalTree.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { TrackedRangeStickiness } from 'vs/editor/common/model'; -import { IntervalNode, IntervalTree, NodeColor, SENTINEL, getNodeColor, intervalCompare, nodeAcceptEdit, setNodeStickiness } from 'vs/editor/common/model/intervalTree'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { TrackedRangeStickiness } from '../../../common/model.js'; +import { IntervalNode, IntervalTree, NodeColor, SENTINEL, getNodeColor, intervalCompare, nodeAcceptEdit, setNodeStickiness } from '../../../common/model/intervalTree.js'; const GENERATE_TESTS = false; const TEST_COUNT = GENERATE_TESTS ? 10000 : 0; diff --git a/src/vs/editor/test/common/model/linesTextBuffer/linesTextBuffer.test.ts b/src/vs/editor/test/common/model/linesTextBuffer/linesTextBuffer.test.ts index a4604874d65..db95c092633 100644 --- a/src/vs/editor/test/common/model/linesTextBuffer/linesTextBuffer.test.ts +++ b/src/vs/editor/test/common/model/linesTextBuffer/linesTextBuffer.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { DefaultEndOfLine } from 'vs/editor/common/model'; -import { IValidatedEditOperation, PieceTreeTextBuffer } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer'; -import { createTextBufferFactory } from 'vs/editor/common/model/textModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Range } from '../../../../common/core/range.js'; +import { DefaultEndOfLine } from '../../../../common/model.js'; +import { IValidatedEditOperation, PieceTreeTextBuffer } from '../../../../common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js'; +import { createTextBufferFactory } from '../../../../common/model/textModel.js'; suite('PieceTreeTextBuffer._getInverseEdits', () => { diff --git a/src/vs/editor/test/common/model/linesTextBuffer/linesTextBufferBuilder.test.ts b/src/vs/editor/test/common/model/linesTextBuffer/linesTextBufferBuilder.test.ts index 662ef1fe8fd..a855ea2ca4d 100644 --- a/src/vs/editor/test/common/model/linesTextBuffer/linesTextBufferBuilder.test.ts +++ b/src/vs/editor/test/common/model/linesTextBuffer/linesTextBufferBuilder.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import * as strings from 'vs/base/common/strings'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { DefaultEndOfLine } from 'vs/editor/common/model'; -import { createTextBufferFactory } from 'vs/editor/common/model/textModel'; +import * as strings from '../../../../../base/common/strings.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { DefaultEndOfLine } from '../../../../common/model.js'; +import { createTextBufferFactory } from '../../../../common/model/textModel.js'; function testTextBufferFactory(text: string, eol: string, mightContainNonBasicASCII: boolean, mightContainRTL: boolean): void { const { disposable, textBuffer } = createTextBufferFactory(text).create(DefaultEndOfLine.LF); diff --git a/src/vs/editor/test/common/model/model.line.test.ts b/src/vs/editor/test/common/model/model.line.test.ts index 91279c1d70d..446e7acaf42 100644 --- a/src/vs/editor/test/common/model/model.line.test.ts +++ b/src/vs/editor/test/common/model/model.line.test.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { EncodedTokenizationResult, IBackgroundTokenizationStore, IBackgroundTokenizer, IState, ITokenizationSupport, TokenizationRegistry, TokenizationResult } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { computeIndentLevel } from 'vs/editor/common/model/utils'; -import { ContiguousMultilineTokensBuilder } from 'vs/editor/common/tokens/contiguousMultilineTokensBuilder'; -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { TestLineToken, TestLineTokenFactory } from 'vs/editor/test/common/core/testLineToken'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Range } from '../../../common/core/range.js'; +import { MetadataConsts } from '../../../common/encodedTokenAttributes.js'; +import { EncodedTokenizationResult, IBackgroundTokenizationStore, IBackgroundTokenizer, IState, ITokenizationSupport, TokenizationRegistry, TokenizationResult } from '../../../common/languages.js'; +import { ITextModel } from '../../../common/model.js'; +import { computeIndentLevel } from '../../../common/model/utils.js'; +import { ContiguousMultilineTokensBuilder } from '../../../common/tokens/contiguousMultilineTokensBuilder.js'; +import { LineTokens } from '../../../common/tokens/lineTokens.js'; +import { TestLineToken, TestLineTokenFactory } from '../core/testLineToken.js'; +import { createTextModel } from '../testTextModel.js'; interface ILineEdit { startColumn: number; diff --git a/src/vs/editor/test/common/model/model.modes.test.ts b/src/vs/editor/test/common/model/model.modes.test.ts index 66df53d83df..a7ad097c019 100644 --- a/src/vs/editor/test/common/model/model.modes.test.ts +++ b/src/vs/editor/test/common/model/model.modes.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import * as languages from 'vs/editor/common/languages'; -import { NullState } from 'vs/editor/common/languages/nullTokenize'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { EditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import * as languages from '../../../common/languages.js'; +import { NullState } from '../../../common/languages/nullTokenize.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { createTextModel } from '../testTextModel.js'; // --------- utils diff --git a/src/vs/editor/test/common/model/model.test.ts b/src/vs/editor/test/common/model/model.test.ts index e699174a650..e18b8438525 100644 --- a/src/vs/editor/test/common/model/model.test.ts +++ b/src/vs/editor/test/common/model/model.test.ts @@ -4,19 +4,19 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Disposable, DisposableStore, dispose } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { EncodedTokenizationResult, IState, TokenizationRegistry } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { NullState } from 'vs/editor/common/languages/nullTokenize'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { InternalModelContentChangeEvent, ModelRawContentChangedEvent, ModelRawFlush, ModelRawLineChanged, ModelRawLinesDeleted, ModelRawLinesInserted } from 'vs/editor/common/textModelEvents'; -import { createModelServices, createTextModel, instantiateTextModel } from 'vs/editor/test/common/testTextModel'; +import { Disposable, DisposableStore, dispose } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { EditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { MetadataConsts } from '../../../common/encodedTokenAttributes.js'; +import { EncodedTokenizationResult, IState, TokenizationRegistry } from '../../../common/languages.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { NullState } from '../../../common/languages/nullTokenize.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { InternalModelContentChangeEvent, ModelRawContentChangedEvent, ModelRawFlush, ModelRawLineChanged, ModelRawLinesDeleted, ModelRawLinesInserted } from '../../../common/textModelEvents.js'; +import { createModelServices, createTextModel, instantiateTextModel } from '../testTextModel.js'; // --------- utils diff --git a/src/vs/editor/test/common/model/modelDecorations.test.ts b/src/vs/editor/test/common/model/modelDecorations.test.ts index c00d0ce8f2a..142bbead17a 100644 --- a/src/vs/editor/test/common/model/modelDecorations.test.ts +++ b/src/vs/editor/test/common/model/modelDecorations.test.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { EndOfLineSequence, IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { EditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { EndOfLineSequence, IModelDeltaDecoration, TrackedRangeStickiness } from '../../../common/model.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { createTextModel } from '../testTextModel.js'; // --------- utils diff --git a/src/vs/editor/test/common/model/modelEditOperation.test.ts b/src/vs/editor/test/common/model/modelEditOperation.test.ts index 0aeebe90c6f..fba9c92cff0 100644 --- a/src/vs/editor/test/common/model/modelEditOperation.test.ts +++ b/src/vs/editor/test/common/model/modelEditOperation.test.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Range } from 'vs/editor/common/core/range'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Range } from '../../../common/core/range.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { createTextModel } from '../testTextModel.js'; suite('Editor Model - Model Edit Operation', () => { const LINE1 = 'My First Line'; diff --git a/src/vs/editor/test/common/model/modelInjectedText.test.ts b/src/vs/editor/test/common/model/modelInjectedText.test.ts index f7c023c4f8a..b342e6bfb01 100644 --- a/src/vs/editor/test/common/model/modelInjectedText.test.ts +++ b/src/vs/editor/test/common/model/modelInjectedText.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Range } from 'vs/editor/common/core/range'; -import { InternalModelContentChangeEvent, LineInjectedText, ModelRawChange, RawContentChangedType } from 'vs/editor/common/textModelEvents'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { EditOperation } from '../../../common/core/editOperation.js'; +import { Range } from '../../../common/core/range.js'; +import { InternalModelContentChangeEvent, LineInjectedText, ModelRawChange, RawContentChangedType } from '../../../common/textModelEvents.js'; +import { createTextModel } from '../testTextModel.js'; suite('Editor Model - Injected Text Events', () => { const store = ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/editor/test/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.test.ts b/src/vs/editor/test/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.test.ts index 01cc7cb6ef6..cb60242c20b 100644 --- a/src/vs/editor/test/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.test.ts +++ b/src/vs/editor/test/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.test.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { WordCharacterClassifier } from 'vs/editor/common/core/wordCharacterClassifier'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { DefaultEndOfLine, ITextSnapshot, SearchData } from 'vs/editor/common/model'; -import { PieceTreeBase } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase'; -import { PieceTreeTextBuffer } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer'; -import { PieceTreeTextBufferBuilder } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder'; -import { NodeColor, SENTINEL, TreeNode } from 'vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { splitLines } from 'vs/base/common/strings'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { WordCharacterClassifier } from '../../../../common/core/wordCharacterClassifier.js'; +import { Position } from '../../../../common/core/position.js'; +import { Range } from '../../../../common/core/range.js'; +import { DefaultEndOfLine, ITextSnapshot, SearchData } from '../../../../common/model.js'; +import { PieceTreeBase } from '../../../../common/model/pieceTreeTextBuffer/pieceTreeBase.js'; +import { PieceTreeTextBuffer } from '../../../../common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js'; +import { PieceTreeTextBufferBuilder } from '../../../../common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.js'; +import { NodeColor, SENTINEL, TreeNode } from '../../../../common/model/pieceTreeTextBuffer/rbTreeBase.js'; +import { createTextModel } from '../../testTextModel.js'; +import { splitLines } from '../../../../../base/common/strings.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; const alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n'; diff --git a/src/vs/editor/test/common/model/textChange.test.ts b/src/vs/editor/test/common/model/textChange.test.ts index a58430b309f..5c0292b4281 100644 --- a/src/vs/editor/test/common/model/textChange.test.ts +++ b/src/vs/editor/test/common/model/textChange.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { compressConsecutiveTextChanges, TextChange } from 'vs/editor/common/core/textChange'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { compressConsecutiveTextChanges, TextChange } from '../../../common/core/textChange.js'; const GENERATE_TESTS = false; diff --git a/src/vs/editor/test/common/model/textModel.test.ts b/src/vs/editor/test/common/model/textModel.test.ts index 3270a563386..9165d77afbf 100644 --- a/src/vs/editor/test/common/model/textModel.test.ts +++ b/src/vs/editor/test/common/model/textModel.test.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { UTF8_BOM_CHARACTER } from 'vs/base/common/strings'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { EndOfLinePreference } from 'vs/editor/common/model'; -import { TextModel, createTextBuffer } from 'vs/editor/common/model/textModel'; -import { createModelServices, createTextModel } from 'vs/editor/test/common/testTextModel'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { UTF8_BOM_CHARACTER } from '../../../../base/common/strings.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../../../common/languages/modesRegistry.js'; +import { EndOfLinePreference } from '../../../common/model.js'; +import { TextModel, createTextBuffer } from '../../../common/model/textModel.js'; +import { createModelServices, createTextModel } from '../testTextModel.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; function testGuessIndentation(defaultInsertSpaces: boolean, defaultTabSize: number, expectedInsertSpaces: boolean, expectedTabSize: number, text: string[], msg?: string): void { const m = createTextModel( diff --git a/src/vs/editor/test/common/model/textModelSearch.test.ts b/src/vs/editor/test/common/model/textModelSearch.test.ts index 0f03a1e0730..dac7171f5a7 100644 --- a/src/vs/editor/test/common/model/textModelSearch.test.ts +++ b/src/vs/editor/test/common/model/textModelSearch.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { getMapForWordSeparators } from 'vs/editor/common/core/wordCharacterClassifier'; -import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/core/wordHelper'; -import { EndOfLineSequence, FindMatch, SearchData } from 'vs/editor/common/model'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { SearchParams, TextModelSearch, isMultilineRegexSource } from 'vs/editor/common/model/textModelSearch'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { getMapForWordSeparators } from '../../../common/core/wordCharacterClassifier.js'; +import { USUAL_WORD_SEPARATORS } from '../../../common/core/wordHelper.js'; +import { EndOfLineSequence, FindMatch, SearchData } from '../../../common/model.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { SearchParams, TextModelSearch, isMultilineRegexSource } from '../../../common/model/textModelSearch.js'; +import { createTextModel } from '../testTextModel.js'; // --------- Find suite('TextModelSearch', () => { diff --git a/src/vs/editor/test/common/model/textModelTokens.test.ts b/src/vs/editor/test/common/model/textModelTokens.test.ts index 34171ea9b1d..8850c911cfd 100644 --- a/src/vs/editor/test/common/model/textModelTokens.test.ts +++ b/src/vs/editor/test/common/model/textModelTokens.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { RangePriorityQueueImpl } from 'vs/editor/common/model/textModelTokens'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { OffsetRange } from '../../../common/core/offsetRange.js'; +import { RangePriorityQueueImpl } from '../../../common/model/textModelTokens.js'; suite('RangePriorityQueueImpl', () => { diff --git a/src/vs/editor/test/common/model/textModelWithTokens.test.ts b/src/vs/editor/test/common/model/textModelWithTokens.test.ts index 54ef6b8d628..3783e8e2606 100644 --- a/src/vs/editor/test/common/model/textModelWithTokens.test.ts +++ b/src/vs/editor/test/common/model/textModelWithTokens.test.ts @@ -4,21 +4,21 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { IFoundBracket } from 'vs/editor/common/textModelBracketPairs'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { ITokenizationSupport, TokenizationRegistry, EncodedTokenizationResult } from 'vs/editor/common/languages'; -import { StandardTokenType, MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { CharacterPair } from 'vs/editor/common/languages/languageConfiguration'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { NullState } from 'vs/editor/common/languages/nullTokenize'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { TestLineToken } from 'vs/editor/test/common/core/testLineToken'; -import { createModelServices, createTextModel, instantiateTextModel } from 'vs/editor/test/common/testTextModel'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { IFoundBracket } from '../../../common/textModelBracketPairs.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { ITokenizationSupport, TokenizationRegistry, EncodedTokenizationResult } from '../../../common/languages.js'; +import { StandardTokenType, MetadataConsts } from '../../../common/encodedTokenAttributes.js'; +import { CharacterPair } from '../../../common/languages/languageConfiguration.js'; +import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { NullState } from '../../../common/languages/nullTokenize.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { TestLineToken } from '../core/testLineToken.js'; +import { createModelServices, createTextModel, instantiateTextModel } from '../testTextModel.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; function createTextModelWithBrackets(disposables: DisposableStore, text: string, brackets: CharacterPair[]): TextModel { const languageId = 'bracketMode2'; diff --git a/src/vs/editor/test/common/model/tokensStore.test.ts b/src/vs/editor/test/common/model/tokensStore.test.ts index f4e9413a422..c40695bd46f 100644 --- a/src/vs/editor/test/common/model/tokensStore.test.ts +++ b/src/vs/editor/test/common/model/tokensStore.test.ts @@ -4,19 +4,19 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ColorId, FontStyle, MetadataConsts, TokenMetadata } from 'vs/editor/common/encodedTokenAttributes'; -import { ILanguageConfigurationService, LanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { LanguageIdCodec } from 'vs/editor/common/services/languagesRegistry'; -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { SparseMultilineTokens } from 'vs/editor/common/tokens/sparseMultilineTokens'; -import { SparseTokensStore } from 'vs/editor/common/tokens/sparseTokensStore'; -import { createModelServices, createTextModel, instantiateTextModel } from 'vs/editor/test/common/testTextModel'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ISingleEditOperation } from '../../../common/core/editOperation.js'; +import { Position } from '../../../common/core/position.js'; +import { Range } from '../../../common/core/range.js'; +import { ColorId, FontStyle, MetadataConsts, TokenMetadata } from '../../../common/encodedTokenAttributes.js'; +import { ILanguageConfigurationService, LanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js'; +import { TextModel } from '../../../common/model/textModel.js'; +import { LanguageIdCodec } from '../../../common/services/languagesRegistry.js'; +import { LineTokens } from '../../../common/tokens/lineTokens.js'; +import { SparseMultilineTokens } from '../../../common/tokens/sparseMultilineTokens.js'; +import { SparseTokensStore } from '../../../common/tokens/sparseTokensStore.js'; +import { createModelServices, createTextModel, instantiateTextModel } from '../testTextModel.js'; suite('TokensStore', () => { diff --git a/src/vs/editor/test/common/modes/languageConfiguration.test.ts b/src/vs/editor/test/common/modes/languageConfiguration.test.ts index 28e6340d9f3..f6e4fb34a93 100644 --- a/src/vs/editor/test/common/modes/languageConfiguration.test.ts +++ b/src/vs/editor/test/common/modes/languageConfiguration.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { StandardAutoClosingPairConditional } from 'vs/editor/common/languages/languageConfiguration'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { StandardTokenType } from '../../../common/encodedTokenAttributes.js'; +import { StandardAutoClosingPairConditional } from '../../../common/languages/languageConfiguration.js'; +import { TestLanguageConfigurationService } from './testLanguageConfigurationService.js'; suite('StandardAutoClosingPairConditional', () => { diff --git a/src/vs/editor/test/common/modes/languageSelector.test.ts b/src/vs/editor/test/common/modes/languageSelector.test.ts index 3de1b762b59..31f6c051af4 100644 --- a/src/vs/editor/test/common/modes/languageSelector.test.ts +++ b/src/vs/editor/test/common/modes/languageSelector.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { LanguageSelector, score } from 'vs/editor/common/languageSelector'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { LanguageSelector, score } from '../../../common/languageSelector.js'; suite('LanguageSelector', function () { diff --git a/src/vs/editor/test/common/modes/linkComputer.test.ts b/src/vs/editor/test/common/modes/linkComputer.test.ts index 2d769837672..8a955f9684c 100644 --- a/src/vs/editor/test/common/modes/linkComputer.test.ts +++ b/src/vs/editor/test/common/modes/linkComputer.test.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ILink } from 'vs/editor/common/languages'; -import { ILinkComputerTarget, computeLinks } from 'vs/editor/common/languages/linkComputer'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ILink } from '../../../common/languages.js'; +import { ILinkComputerTarget, computeLinks } from '../../../common/languages/linkComputer.js'; class SimpleLinkComputerTarget implements ILinkComputerTarget { diff --git a/src/vs/editor/test/common/modes/supports/autoClosingPairsRules.ts b/src/vs/editor/test/common/modes/supports/autoClosingPairsRules.ts index 0f5ebc499bd..d9e226ee0db 100644 --- a/src/vs/editor/test/common/modes/supports/autoClosingPairsRules.ts +++ b/src/vs/editor/test/common/modes/supports/autoClosingPairsRules.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IAutoClosingPair, IAutoClosingPairConditional } from 'vs/editor/common/languages/languageConfiguration'; +import { IAutoClosingPair, IAutoClosingPairConditional } from '../../../../common/languages/languageConfiguration.js'; export const javascriptAutoClosingPairsRules: IAutoClosingPairConditional[] = [ { open: '{', close: '}' }, diff --git a/src/vs/editor/test/common/modes/supports/bracketRules.ts b/src/vs/editor/test/common/modes/supports/bracketRules.ts index d21b70a6dc3..0ce5793a417 100644 --- a/src/vs/editor/test/common/modes/supports/bracketRules.ts +++ b/src/vs/editor/test/common/modes/supports/bracketRules.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharacterPair } from 'vs/editor/common/languages/languageConfiguration'; +import { CharacterPair } from '../../../../common/languages/languageConfiguration.js'; const standardBracketRules: CharacterPair[] = [ ['{', '}'], diff --git a/src/vs/editor/test/common/modes/supports/characterPair.test.ts b/src/vs/editor/test/common/modes/supports/characterPair.test.ts index e92b7db2e6e..0e0f4e01922 100644 --- a/src/vs/editor/test/common/modes/supports/characterPair.test.ts +++ b/src/vs/editor/test/common/modes/supports/characterPair.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { StandardAutoClosingPairConditional } from 'vs/editor/common/languages/languageConfiguration'; -import { CharacterPairSupport } from 'vs/editor/common/languages/supports/characterPair'; -import { TokenText, createFakeScopedLineTokens } from 'vs/editor/test/common/modesTestUtils'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { StandardTokenType } from '../../../../common/encodedTokenAttributes.js'; +import { StandardAutoClosingPairConditional } from '../../../../common/languages/languageConfiguration.js'; +import { CharacterPairSupport } from '../../../../common/languages/supports/characterPair.js'; +import { TokenText, createFakeScopedLineTokens } from '../../modesTestUtils.js'; suite('CharacterPairSupport', () => { diff --git a/src/vs/editor/test/common/modes/supports/electricCharacter.test.ts b/src/vs/editor/test/common/modes/supports/electricCharacter.test.ts index 20170cb8f48..f6258de670f 100644 --- a/src/vs/editor/test/common/modes/supports/electricCharacter.test.ts +++ b/src/vs/editor/test/common/modes/supports/electricCharacter.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { BracketElectricCharacterSupport, IElectricAction } from 'vs/editor/common/languages/supports/electricCharacter'; -import { RichEditBrackets } from 'vs/editor/common/languages/supports/richEditBrackets'; -import { TokenText, createFakeScopedLineTokens } from 'vs/editor/test/common/modesTestUtils'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { StandardTokenType } from '../../../../common/encodedTokenAttributes.js'; +import { BracketElectricCharacterSupport, IElectricAction } from '../../../../common/languages/supports/electricCharacter.js'; +import { RichEditBrackets } from '../../../../common/languages/supports/richEditBrackets.js'; +import { TokenText, createFakeScopedLineTokens } from '../../modesTestUtils.js'; const fakeLanguageId = 'test'; diff --git a/src/vs/editor/test/common/modes/supports/onEnter.test.ts b/src/vs/editor/test/common/modes/supports/onEnter.test.ts index 4ed40eb1abb..901ad06fb4e 100644 --- a/src/vs/editor/test/common/modes/supports/onEnter.test.ts +++ b/src/vs/editor/test/common/modes/supports/onEnter.test.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CharacterPair, IndentAction } from 'vs/editor/common/languages/languageConfiguration'; -import { OnEnterSupport } from 'vs/editor/common/languages/supports/onEnter'; -import { javascriptOnEnterRules } from 'vs/editor/test/common/modes/supports/onEnterRules'; -import { EditorAutoIndentStrategy } from 'vs/editor/common/config/editorOptions'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { CharacterPair, IndentAction } from '../../../../common/languages/languageConfiguration.js'; +import { OnEnterSupport } from '../../../../common/languages/supports/onEnter.js'; +import { javascriptOnEnterRules } from './onEnterRules.js'; +import { EditorAutoIndentStrategy } from '../../../../common/config/editorOptions.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; suite('OnEnter', () => { diff --git a/src/vs/editor/test/common/modes/supports/onEnterRules.ts b/src/vs/editor/test/common/modes/supports/onEnterRules.ts index 66e683fdcf8..b3cb35e27d5 100644 --- a/src/vs/editor/test/common/modes/supports/onEnterRules.ts +++ b/src/vs/editor/test/common/modes/supports/onEnterRules.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IndentAction } from 'vs/editor/common/languages/languageConfiguration'; +import { IndentAction } from '../../../../common/languages/languageConfiguration.js'; export const javascriptOnEnterRules = [ { diff --git a/src/vs/editor/test/common/modes/supports/richEditBrackets.test.ts b/src/vs/editor/test/common/modes/supports/richEditBrackets.test.ts index 5fd90a71561..27f27e7d54e 100644 --- a/src/vs/editor/test/common/modes/supports/richEditBrackets.test.ts +++ b/src/vs/editor/test/common/modes/supports/richEditBrackets.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { BracketsUtils } from 'vs/editor/common/languages/supports/richEditBrackets'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { Range } from '../../../../common/core/range.js'; +import { BracketsUtils } from '../../../../common/languages/supports/richEditBrackets.js'; suite('richEditBrackets', () => { diff --git a/src/vs/editor/test/common/modes/supports/tokenization.test.ts b/src/vs/editor/test/common/modes/supports/tokenization.test.ts index b5386ec1b3b..69fe4beaac0 100644 --- a/src/vs/editor/test/common/modes/supports/tokenization.test.ts +++ b/src/vs/editor/test/common/modes/supports/tokenization.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { FontStyle } from 'vs/editor/common/encodedTokenAttributes'; -import { ColorMap, ExternalThemeTrieElement, ParsedTokenThemeRule, ThemeTrieElementRule, TokenTheme, parseTokenTheme, strcmp } from 'vs/editor/common/languages/supports/tokenization'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; +import { FontStyle } from '../../../../common/encodedTokenAttributes.js'; +import { ColorMap, ExternalThemeTrieElement, ParsedTokenThemeRule, ThemeTrieElementRule, TokenTheme, parseTokenTheme, strcmp } from '../../../../common/languages/supports/tokenization.js'; suite('Token theme matching', () => { diff --git a/src/vs/editor/test/common/modes/testLanguageConfigurationService.ts b/src/vs/editor/test/common/modes/testLanguageConfigurationService.ts index ece0981cbd7..fb3a5042571 100644 --- a/src/vs/editor/test/common/modes/testLanguageConfigurationService.ts +++ b/src/vs/editor/test/common/modes/testLanguageConfigurationService.ts @@ -2,10 +2,10 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { LanguageConfiguration } from 'vs/editor/common/languages/languageConfiguration'; -import { ILanguageConfigurationService, LanguageConfigurationRegistry, LanguageConfigurationServiceChangeEvent, ResolvedLanguageConfiguration } from 'vs/editor/common/languages/languageConfigurationRegistry'; +import { Emitter } from '../../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../../base/common/lifecycle.js'; +import { LanguageConfiguration } from '../../../common/languages/languageConfiguration.js'; +import { ILanguageConfigurationService, LanguageConfigurationRegistry, LanguageConfigurationServiceChangeEvent, ResolvedLanguageConfiguration } from '../../../common/languages/languageConfigurationRegistry.js'; export class TestLanguageConfigurationService extends Disposable implements ILanguageConfigurationService { _serviceBrand: undefined; diff --git a/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts b/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts index af7015a19b6..31230b13358 100644 --- a/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts +++ b/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ColorId, FontStyle, MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { EncodedTokenizationResult, IState, TokenizationRegistry } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { _tokenizeToString, tokenizeLineToHTML } from 'vs/editor/common/languages/textToHtmlTokenizer'; -import { LanguageIdCodec } from 'vs/editor/common/services/languagesRegistry'; -import { TestLineToken, TestLineTokens } from 'vs/editor/test/common/core/testLineToken'; -import { createModelServices } from 'vs/editor/test/common/testTextModel'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ColorId, FontStyle, MetadataConsts } from '../../../common/encodedTokenAttributes.js'; +import { EncodedTokenizationResult, IState, TokenizationRegistry } from '../../../common/languages.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { _tokenizeToString, tokenizeLineToHTML } from '../../../common/languages/textToHtmlTokenizer.js'; +import { LanguageIdCodec } from '../../../common/services/languagesRegistry.js'; +import { TestLineToken, TestLineTokens } from '../core/testLineToken.js'; +import { createModelServices } from '../testTextModel.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; suite('Editor Modes - textToHtmlTokenizer', () => { diff --git a/src/vs/editor/test/common/modesTestUtils.ts b/src/vs/editor/test/common/modesTestUtils.ts index b96bea4d814..509eff0ea8a 100644 --- a/src/vs/editor/test/common/modesTestUtils.ts +++ b/src/vs/editor/test/common/modesTestUtils.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { StandardTokenType, MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { ScopedLineTokens, createScopedLineTokens } from 'vs/editor/common/languages/supports'; -import { LanguageIdCodec } from 'vs/editor/common/services/languagesRegistry'; +import { LineTokens } from '../../common/tokens/lineTokens.js'; +import { StandardTokenType, MetadataConsts } from '../../common/encodedTokenAttributes.js'; +import { ScopedLineTokens, createScopedLineTokens } from '../../common/languages/supports.js'; +import { LanguageIdCodec } from '../../common/services/languagesRegistry.js'; export interface TokenText { text: string; diff --git a/src/vs/editor/test/common/services/editorSimpleWorker.test.ts b/src/vs/editor/test/common/services/editorSimpleWorker.test.ts index 781ff450211..1cc3d022d55 100644 --- a/src/vs/editor/test/common/services/editorSimpleWorker.test.ts +++ b/src/vs/editor/test/common/services/editorSimpleWorker.test.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Position } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { TextEdit } from 'vs/editor/common/languages'; -import { EditorSimpleWorker, ICommonModel } from 'vs/editor/common/services/editorSimpleWorker'; -import { IEditorWorkerHost } from 'vs/editor/common/services/editorWorkerHost'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Position } from '../../../common/core/position.js'; +import { IRange, Range } from '../../../common/core/range.js'; +import { TextEdit } from '../../../common/languages.js'; +import { BaseEditorSimpleWorker } from '../../../common/services/editorSimpleWorker.js'; +import { ICommonModel } from '../../../common/services/textModelSync/textModelSync.impl.js'; suite('EditorSimpleWorker', () => { ensureNoDisposablesAreLeakedInTestSuite(); - class WorkerWithModels extends EditorSimpleWorker { + class WorkerWithModels extends BaseEditorSimpleWorker { getModel(uri: string) { return this._getModel(uri); @@ -23,13 +23,13 @@ suite('EditorSimpleWorker', () => { addModel(lines: string[], eol: string = '\n') { const uri = 'test:file#' + Date.now(); - this.acceptNewModel({ + this.$acceptNewModel({ url: uri, versionId: 1, lines: lines, EOL: eol }); - return this._getModel(uri); + return this._getModel(uri)!; } } @@ -37,7 +37,7 @@ suite('EditorSimpleWorker', () => { let model: ICommonModel; setup(() => { - worker = new WorkerWithModels(null!, null); + worker = new WorkerWithModels(); model = worker.addModel([ 'This is line one', //16 'and this is line number two', //27 @@ -93,7 +93,7 @@ suite('EditorSimpleWorker', () => { test('MoreMinimal', () => { - return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: 'This is line One', range: new Range(1, 1, 1, 17) }], false).then(edits => { + return worker.$computeMoreMinimalEdits(model.uri.toString(), [{ text: 'This is line One', range: new Range(1, 1, 1, 17) }], false).then(edits => { assert.strictEqual(edits.length, 1); const [first] = edits; assert.strictEqual(first.text, 'O'); @@ -112,7 +112,7 @@ suite('EditorSimpleWorker', () => { ], '\n'); - const newEdits = await worker.computeMoreMinimalEdits(model.uri.toString(), [ + const newEdits = await worker.$computeMoreMinimalEdits(model.uri.toString(), [ { range: new Range(1, 1, 2, 1), text: 'one\ntwo\nthree\n', @@ -144,7 +144,7 @@ suite('EditorSimpleWorker', () => { '}' ], '\n'); - return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: '{\r\n\t"a":1\r\n}', range: new Range(1, 1, 3, 2) }], false).then(edits => { + return worker.$computeMoreMinimalEdits(model.uri.toString(), [{ text: '{\r\n\t"a":1\r\n}', range: new Range(1, 1, 3, 2) }], false).then(edits => { assert.strictEqual(edits.length, 0); }); }); @@ -157,7 +157,7 @@ suite('EditorSimpleWorker', () => { '}' ], '\n'); - return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: '{\r\n\t"b":1\r\n}', range: new Range(1, 1, 3, 2) }], false).then(edits => { + return worker.$computeMoreMinimalEdits(model.uri.toString(), [{ text: '{\r\n\t"b":1\r\n}', range: new Range(1, 1, 3, 2) }], false).then(edits => { assert.strictEqual(edits.length, 1); const [first] = edits; assert.strictEqual(first.text, 'b'); @@ -173,7 +173,7 @@ suite('EditorSimpleWorker', () => { '}' // 3 ]); - return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: '\n', range: new Range(3, 2, 4, 1000) }], false).then(edits => { + return worker.$computeMoreMinimalEdits(model.uri.toString(), [{ text: '\n', range: new Range(3, 2, 4, 1000) }], false).then(edits => { assert.strictEqual(edits.length, 1); const [first] = edits; assert.strictEqual(first.text, '\n'); @@ -184,7 +184,7 @@ suite('EditorSimpleWorker', () => { async function testEdits(lines: string[], edits: TextEdit[]): Promise { const model = worker.addModel(lines); - const smallerEdits = await worker.computeHumanReadableDiff( + const smallerEdits = await worker.$computeHumanReadableDiff( model.uri.toString(), edits, { ignoreTrimWhitespace: false, maxComputationTimeMs: 0, computeMoves: false } @@ -286,7 +286,7 @@ suite('EditorSimpleWorker', () => { 'f f' // 2 ]); - return worker.textualSuggest([model.uri.toString()], 'f', '[a-z]+', 'img').then((result) => { + return worker.$textualSuggest([model.uri.toString()], 'f', '[a-z]+', 'img').then((result) => { if (!result) { assert.ok(false); } diff --git a/src/vs/editor/test/common/services/languageService.test.ts b/src/vs/editor/test/common/services/languageService.test.ts index e8317e6ae88..ba3c588fa01 100644 --- a/src/vs/editor/test/common/services/languageService.test.ts +++ b/src/vs/editor/test/common/services/languageService.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { LanguageService } from 'vs/editor/common/services/languageService'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../../../common/languages/modesRegistry.js'; +import { LanguageService } from '../../../common/services/languageService.js'; suite('LanguageService', () => { diff --git a/src/vs/editor/test/common/services/languagesAssociations.test.ts b/src/vs/editor/test/common/services/languagesAssociations.test.ts index 7d6ce3ba4dc..891260d0fb5 100644 --- a/src/vs/editor/test/common/services/languagesAssociations.test.ts +++ b/src/vs/editor/test/common/services/languagesAssociations.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { getMimeTypes, registerPlatformLanguageAssociation, registerConfiguredLanguageAssociation } from 'vs/editor/common/services/languagesAssociations'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { getMimeTypes, registerPlatformLanguageAssociation, registerConfiguredLanguageAssociation } from '../../../common/services/languagesAssociations.js'; suite('LanguagesAssociations', () => { diff --git a/src/vs/editor/test/common/services/languagesRegistry.test.ts b/src/vs/editor/test/common/services/languagesRegistry.test.ts index d4715b8534c..9789d1380aa 100644 --- a/src/vs/editor/test/common/services/languagesRegistry.test.ts +++ b/src/vs/editor/test/common/services/languagesRegistry.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { LanguagesRegistry } from 'vs/editor/common/services/languagesRegistry'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { LanguagesRegistry } from '../../../common/services/languagesRegistry.js'; suite('LanguagesRegistry', () => { diff --git a/src/vs/editor/test/common/services/modelService.test.ts b/src/vs/editor/test/common/services/modelService.test.ts index cd4b53d86df..ccc2fabc213 100644 --- a/src/vs/editor/test/common/services/modelService.test.ts +++ b/src/vs/editor/test/common/services/modelService.test.ts @@ -4,23 +4,23 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CharCode } from 'vs/base/common/charCode'; -import * as platform from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { StringBuilder } from 'vs/editor/common/core/stringBuilder'; -import { DefaultEndOfLine, ITextBuffer, ITextBufferFactory, ITextSnapshot } from 'vs/editor/common/model'; -import { createTextBuffer } from 'vs/editor/common/model/textModel'; -import { ModelService } from 'vs/editor/common/services/modelService'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { createModelServices, createTextModel } from 'vs/editor/test/common/testTextModel'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IModelService } from 'vs/editor/common/services/model'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { CharCode } from '../../../../base/common/charCode.js'; +import * as platform from '../../../../base/common/platform.js'; +import { URI } from '../../../../base/common/uri.js'; +import { EditOperation } from '../../../common/core/editOperation.js'; +import { Range } from '../../../common/core/range.js'; +import { Selection } from '../../../common/core/selection.js'; +import { StringBuilder } from '../../../common/core/stringBuilder.js'; +import { DefaultEndOfLine, ITextBuffer, ITextBufferFactory, ITextSnapshot } from '../../../common/model.js'; +import { createTextBuffer } from '../../../common/model/textModel.js'; +import { ModelService } from '../../../common/services/modelService.js'; +import { TestConfigurationService } from '../../../../platform/configuration/test/common/testConfigurationService.js'; +import { createModelServices, createTextModel } from '../testTextModel.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { IModelService } from '../../../common/services/model.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; const GENERATE_TESTS = false; diff --git a/src/vs/editor/test/common/services/semanticTokensDto.test.ts b/src/vs/editor/test/common/services/semanticTokensDto.test.ts index 7093691179d..05980e011a0 100644 --- a/src/vs/editor/test/common/services/semanticTokensDto.test.ts +++ b/src/vs/editor/test/common/services/semanticTokensDto.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { IFullSemanticTokensDto, IDeltaSemanticTokensDto, encodeSemanticTokensDto, ISemanticTokensDto, decodeSemanticTokensDto } from 'vs/editor/common/services/semanticTokensDto'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { IFullSemanticTokensDto, IDeltaSemanticTokensDto, encodeSemanticTokensDto, ISemanticTokensDto, decodeSemanticTokensDto } from '../../../common/services/semanticTokensDto.js'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('SemanticTokensDto', () => { diff --git a/src/vs/editor/test/common/services/semanticTokensProviderStyling.test.ts b/src/vs/editor/test/common/services/semanticTokensProviderStyling.test.ts index 1128768e919..98894403654 100644 --- a/src/vs/editor/test/common/services/semanticTokensProviderStyling.test.ts +++ b/src/vs/editor/test/common/services/semanticTokensProviderStyling.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { SparseMultilineTokens } from 'vs/editor/common/tokens/sparseMultilineTokens'; -import { MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { SemanticTokensProviderStyling, toMultilineTokens2 } from 'vs/editor/common/services/semanticTokensProviderStyling'; -import { createModelServices } from 'vs/editor/test/common/testTextModel'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { IColorTheme, IThemeService, ITokenStyle } from 'vs/platform/theme/common/themeService'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { SparseMultilineTokens } from '../../../common/tokens/sparseMultilineTokens.js'; +import { MetadataConsts } from '../../../common/encodedTokenAttributes.js'; +import { SemanticTokensProviderStyling, toMultilineTokens2 } from '../../../common/services/semanticTokensProviderStyling.js'; +import { createModelServices } from '../testTextModel.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { IColorTheme, IThemeService, ITokenStyle } from '../../../../platform/theme/common/themeService.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ModelService', () => { let disposables: DisposableStore; diff --git a/src/vs/editor/test/common/services/testEditorWorkerService.ts b/src/vs/editor/test/common/services/testEditorWorkerService.ts index e7d5154f9f6..44a9d5fffc3 100644 --- a/src/vs/editor/test/common/services/testEditorWorkerService.ts +++ b/src/vs/editor/test/common/services/testEditorWorkerService.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { IRange } from 'vs/editor/common/core/range'; -import { DiffAlgorithmName, IEditorWorkerService, IUnicodeHighlightsResult } from 'vs/editor/common/services/editorWorker'; -import { TextEdit, IInplaceReplaceSupportResult } from 'vs/editor/common/languages'; -import { IDocumentDiff, IDocumentDiffProviderOptions } from 'vs/editor/common/diff/documentDiffProvider'; -import { IChange } from 'vs/editor/common/diff/legacyLinesDiffComputer'; -import { SectionHeader } from 'vs/editor/common/services/findSectionHeaders'; +import { URI } from '../../../../base/common/uri.js'; +import { IRange } from '../../../common/core/range.js'; +import { DiffAlgorithmName, IEditorWorkerService, IUnicodeHighlightsResult } from '../../../common/services/editorWorker.js'; +import { TextEdit, IInplaceReplaceSupportResult, IColorInformation } from '../../../common/languages.js'; +import { IDocumentDiff, IDocumentDiffProviderOptions } from '../../../common/diff/documentDiffProvider.js'; +import { IChange } from '../../../common/diff/legacyLinesDiffComputer.js'; +import { SectionHeader } from '../../../common/services/findSectionHeaders.js'; export class TestEditorWorkerService implements IEditorWorkerService { @@ -27,4 +27,5 @@ export class TestEditorWorkerService implements IEditorWorkerService { canNavigateValueSet(resource: URI): boolean { return false; } async navigateValueSet(resource: URI, range: IRange, up: boolean): Promise { return null; } async findSectionHeaders(uri: URI): Promise { return []; } + async computeDefaultDocumentColors(uri: URI): Promise { return null; } } diff --git a/src/vs/editor/test/common/services/testTextResourcePropertiesService.ts b/src/vs/editor/test/common/services/testTextResourcePropertiesService.ts index c7079676e20..77a92fa0ee3 100644 --- a/src/vs/editor/test/common/services/testTextResourcePropertiesService.ts +++ b/src/vs/editor/test/common/services/testTextResourcePropertiesService.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as platform from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import * as platform from '../../../../base/common/platform.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ITextResourcePropertiesService } from '../../../common/services/textResourceConfiguration.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; export class TestTextResourcePropertiesService implements ITextResourcePropertiesService { diff --git a/src/vs/editor/test/common/services/testTreeSitterService.ts b/src/vs/editor/test/common/services/testTreeSitterService.ts new file mode 100644 index 00000000000..e0572873242 --- /dev/null +++ b/src/vs/editor/test/common/services/testTreeSitterService.ts @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type { Parser } from '@vscode/tree-sitter-wasm'; +import { Event } from '../../../../base/common/event.js'; +import { ITextModel } from '../../../common/model.js'; +import { ITreeSitterParserService, ITreeSitterParseResult } from '../../../common/services/treeSitterParserService.js'; + +export class TestTreeSitterParserService implements ITreeSitterParserService { + onDidAddLanguage: Event<{ id: string; language: Parser.Language }> = Event.None; + _serviceBrand: undefined; + getOrInitLanguage(languageId: string): Parser.Language | undefined { + throw new Error('Method not implemented.'); + } + waitForLanguage(languageId: string): Promise { + throw new Error('Method not implemented.'); + } + getParseResult(textModel: ITextModel): ITreeSitterParseResult | undefined { + throw new Error('Method not implemented.'); + } + +} diff --git a/src/vs/editor/test/common/services/textResourceConfigurationService.test.ts b/src/vs/editor/test/common/services/textResourceConfigurationService.test.ts index c7fbd1afff2..f3299fdba92 100644 --- a/src/vs/editor/test/common/services/textResourceConfigurationService.test.ts +++ b/src/vs/editor/test/common/services/textResourceConfigurationService.test.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IConfigurationValue, IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; -import { TextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { TestConfigurationService } from '../../../../platform/configuration/test/common/testConfigurationService.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { IModelService } from '../../../common/services/model.js'; +import { ILanguageService } from '../../../common/languages/language.js'; +import { IConfigurationValue, IConfigurationService, ConfigurationTarget } from '../../../../platform/configuration/common/configuration.js'; +import { TextResourceConfigurationService } from '../../../common/services/textResourceConfigurationService.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('TextResourceConfigurationService - Update', () => { diff --git a/src/vs/editor/test/common/services/unicodeTextModelHighlighter.test.ts b/src/vs/editor/test/common/services/unicodeTextModelHighlighter.test.ts index 9b5351bd618..3b4b550cfad 100644 --- a/src/vs/editor/test/common/services/unicodeTextModelHighlighter.test.ts +++ b/src/vs/editor/test/common/services/unicodeTextModelHighlighter.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { UnicodeHighlighterOptions, UnicodeTextModelHighlighter } from 'vs/editor/common/services/unicodeTextModelHighlighter'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Range } from '../../../common/core/range.js'; +import { UnicodeHighlighterOptions, UnicodeTextModelHighlighter } from '../../../common/services/unicodeTextModelHighlighter.js'; +import { createTextModel } from '../testTextModel.js'; suite('UnicodeTextModelHighlighter', () => { ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/editor/test/common/testTextModel.ts b/src/vs/editor/test/common/testTextModel.ts index cdab452aa9c..01732b71158 100644 --- a/src/vs/editor/test/common/testTextModel.ts +++ b/src/vs/editor/test/common/testTextModel.ts @@ -3,37 +3,39 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { BracketPairColorizationOptions, DefaultEndOfLine, ITextBufferFactory, ITextModelCreationOptions } from 'vs/editor/common/model'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { LanguageService } from 'vs/editor/common/services/languageService'; -import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { TestDialogService } from 'vs/platform/dialogs/test/common/testDialogService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; -import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo'; -import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService'; -import { TestTextResourcePropertiesService } from 'vs/editor/test/common/services/testTextResourcePropertiesService'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ModelService } from 'vs/editor/common/services/modelService'; -import { createServices, ServiceIdCtorPair, TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { ILanguageFeatureDebounceService, LanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { mock } from 'vs/base/test/common/mock'; +import { DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { BracketPairColorizationOptions, DefaultEndOfLine, ITextBufferFactory, ITextModelCreationOptions } from '../../common/model.js'; +import { TextModel } from '../../common/model/textModel.js'; +import { ILanguageConfigurationService } from '../../common/languages/languageConfigurationRegistry.js'; +import { ILanguageService } from '../../common/languages/language.js'; +import { LanguageService } from '../../common/services/languageService.js'; +import { ITextResourcePropertiesService } from '../../common/services/textResourceConfiguration.js'; +import { TestLanguageConfigurationService } from './modes/testLanguageConfigurationService.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { TestConfigurationService } from '../../../platform/configuration/test/common/testConfigurationService.js'; +import { IDialogService } from '../../../platform/dialogs/common/dialogs.js'; +import { TestDialogService } from '../../../platform/dialogs/test/common/testDialogService.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService, NullLogService } from '../../../platform/log/common/log.js'; +import { INotificationService } from '../../../platform/notification/common/notification.js'; +import { TestNotificationService } from '../../../platform/notification/test/common/testNotificationService.js'; +import { IThemeService } from '../../../platform/theme/common/themeService.js'; +import { TestThemeService } from '../../../platform/theme/test/common/testThemeService.js'; +import { IUndoRedoService } from '../../../platform/undoRedo/common/undoRedo.js'; +import { UndoRedoService } from '../../../platform/undoRedo/common/undoRedoService.js'; +import { TestTextResourcePropertiesService } from './services/testTextResourcePropertiesService.js'; +import { IModelService } from '../../common/services/model.js'; +import { ModelService } from '../../common/services/modelService.js'; +import { createServices, ServiceIdCtorPair, TestInstantiationService } from '../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../../common/languages/modesRegistry.js'; +import { ILanguageFeatureDebounceService, LanguageFeatureDebounceService } from '../../common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../common/services/languageFeatures.js'; +import { LanguageFeaturesService } from '../../common/services/languageFeaturesService.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; +import { mock } from '../../../base/test/common/mock.js'; +import { ITreeSitterParserService } from '../../common/services/treeSitterParserService.js'; +import { TestTreeSitterParserService } from './services/testTreeSitterService.js'; class TestTextModel extends TextModel { public registerDisposable(disposable: IDisposable): void { @@ -105,5 +107,6 @@ export function createModelServices(disposables: DisposableStore, services: Serv [ILanguageFeatureDebounceService, LanguageFeatureDebounceService], [ILanguageFeaturesService, LanguageFeaturesService], [IModelService, ModelService], + [ITreeSitterParserService, TestTreeSitterParserService] ])); } diff --git a/src/vs/editor/test/common/view/overviewZoneManager.test.ts b/src/vs/editor/test/common/view/overviewZoneManager.test.ts index b488141d7d7..c3b253058e9 100644 --- a/src/vs/editor/test/common/view/overviewZoneManager.test.ts +++ b/src/vs/editor/test/common/view/overviewZoneManager.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ColorZone, OverviewRulerZone, OverviewZoneManager } from 'vs/editor/common/viewModel/overviewZoneManager'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ColorZone, OverviewRulerZone, OverviewZoneManager } from '../../../common/viewModel/overviewZoneManager.js'; suite('Editor View - OverviewZoneManager', () => { diff --git a/src/vs/editor/test/common/viewLayout/lineDecorations.test.ts b/src/vs/editor/test/common/viewLayout/lineDecorations.test.ts index d1058c42293..59f87b95b43 100644 --- a/src/vs/editor/test/common/viewLayout/lineDecorations.test.ts +++ b/src/vs/editor/test/common/viewLayout/lineDecorations.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Range } from 'vs/editor/common/core/range'; -import { DecorationSegment, LineDecoration, LineDecorationsNormalizer } from 'vs/editor/common/viewLayout/lineDecorations'; -import { InlineDecoration, InlineDecorationType } from 'vs/editor/common/viewModel'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Range } from '../../../common/core/range.js'; +import { DecorationSegment, LineDecoration, LineDecorationsNormalizer } from '../../../common/viewLayout/lineDecorations.js'; +import { InlineDecoration, InlineDecorationType } from '../../../common/viewModel.js'; suite('Editor ViewLayout - ViewLineParts', () => { diff --git a/src/vs/editor/test/common/viewLayout/linesLayout.test.ts b/src/vs/editor/test/common/viewLayout/linesLayout.test.ts index 58f9217ea56..087c24e457b 100644 --- a/src/vs/editor/test/common/viewLayout/linesLayout.test.ts +++ b/src/vs/editor/test/common/viewLayout/linesLayout.test.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EditorWhitespace, LinesLayout } from 'vs/editor/common/viewLayout/linesLayout'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { EditorWhitespace, LinesLayout } from '../../../common/viewLayout/linesLayout.js'; suite('Editor ViewLayout - LinesLayout', () => { diff --git a/src/vs/editor/test/common/viewLayout/viewLineRenderer.test.ts b/src/vs/editor/test/common/viewLayout/viewLineRenderer.test.ts index 22e1c60f7af..c35690fe93a 100644 --- a/src/vs/editor/test/common/viewLayout/viewLineRenderer.test.ts +++ b/src/vs/editor/test/common/viewLayout/viewLineRenderer.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CharCode } from 'vs/base/common/charCode'; -import * as strings from 'vs/base/common/strings'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { MetadataConsts } from 'vs/editor/common/encodedTokenAttributes'; -import { IViewLineTokens } from 'vs/editor/common/tokens/lineTokens'; -import { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations'; -import { CharacterMapping, DomPosition, LineRange, RenderLineInput, RenderLineOutput2, renderViewLine2 as renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer'; -import { InlineDecorationType } from 'vs/editor/common/viewModel'; -import { TestLineToken, TestLineTokens } from 'vs/editor/test/common/core/testLineToken'; +import { CharCode } from '../../../../base/common/charCode.js'; +import * as strings from '../../../../base/common/strings.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { MetadataConsts } from '../../../common/encodedTokenAttributes.js'; +import { IViewLineTokens } from '../../../common/tokens/lineTokens.js'; +import { LineDecoration } from '../../../common/viewLayout/lineDecorations.js'; +import { CharacterMapping, DomPosition, LineRange, RenderLineInput, RenderLineOutput2, renderViewLine2 as renderViewLine } from '../../../common/viewLayout/viewLineRenderer.js'; +import { InlineDecorationType } from '../../../common/viewModel.js'; +import { TestLineToken, TestLineTokens } from '../core/testLineToken.js'; function createViewLineTokens(viewLineTokens: TestLineToken[]): IViewLineTokens { return new TestLineTokens(viewLineTokens); diff --git a/src/vs/editor/test/common/viewModel/glyphLanesModel.test.ts b/src/vs/editor/test/common/viewModel/glyphLanesModel.test.ts index 84659a045c6..39f80ae0a32 100644 --- a/src/vs/editor/test/common/viewModel/glyphLanesModel.test.ts +++ b/src/vs/editor/test/common/viewModel/glyphLanesModel.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { GlyphMarginLanesModel, } from 'vs/editor/common/viewModel/glyphLanesModel'; -import { Range } from 'vs/editor/common/core/range'; -import { GlyphMarginLane } from 'vs/editor/common/model'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { GlyphMarginLanesModel, } from '../../../common/viewModel/glyphLanesModel.js'; +import { Range } from '../../../common/core/range.js'; +import { GlyphMarginLane } from '../../../common/model.js'; suite('GlyphLanesModel', () => { let model: GlyphMarginLanesModel; diff --git a/src/vs/editor/test/common/viewModel/lineBreakData.test.ts b/src/vs/editor/test/common/viewModel/lineBreakData.test.ts index b771b7e5ff8..b621632fe1d 100644 --- a/src/vs/editor/test/common/viewModel/lineBreakData.test.ts +++ b/src/vs/editor/test/common/viewModel/lineBreakData.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { PositionAffinity } from 'vs/editor/common/model'; -import { ModelDecorationInjectedTextOptions } from 'vs/editor/common/model/textModel'; -import { ModelLineProjectionData } from 'vs/editor/common/modelLineProjectionData'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { PositionAffinity } from '../../../common/model.js'; +import { ModelDecorationInjectedTextOptions } from '../../../common/model/textModel.js'; +import { ModelLineProjectionData } from '../../../common/modelLineProjectionData.js'; suite('Editor ViewModel - LineBreakData', () => { diff --git a/src/vs/editor/test/common/viewModel/monospaceLineBreaksComputer.test.ts b/src/vs/editor/test/common/viewModel/monospaceLineBreaksComputer.test.ts index a1defd0c4f5..b5f0e782224 100644 --- a/src/vs/editor/test/common/viewModel/monospaceLineBreaksComputer.test.ts +++ b/src/vs/editor/test/common/viewModel/monospaceLineBreaksComputer.test.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EditorOptions, WrappingIndent } from 'vs/editor/common/config/editorOptions'; -import { FontInfo } from 'vs/editor/common/config/fontInfo'; -import { ILineBreaksComputerFactory, ModelLineProjectionData } from 'vs/editor/common/modelLineProjectionData'; -import { MonospaceLineBreaksComputerFactory } from 'vs/editor/common/viewModel/monospaceLineBreaksComputer'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { EditorOptions, WrappingIndent } from '../../../common/config/editorOptions.js'; +import { FontInfo } from '../../../common/config/fontInfo.js'; +import { ILineBreaksComputerFactory, ModelLineProjectionData } from '../../../common/modelLineProjectionData.js'; +import { MonospaceLineBreaksComputerFactory } from '../../../common/viewModel/monospaceLineBreaksComputer.js'; function parseAnnotatedText(annotatedText: string): { text: string; indices: number[] } { let text = ''; diff --git a/src/vs/editor/test/common/viewModel/prefixSumComputer.test.ts b/src/vs/editor/test/common/viewModel/prefixSumComputer.test.ts index e1820e6e920..a7f934a6247 100644 --- a/src/vs/editor/test/common/viewModel/prefixSumComputer.test.ts +++ b/src/vs/editor/test/common/viewModel/prefixSumComputer.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { toUint32 } from 'vs/base/common/uint'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { PrefixSumComputer, PrefixSumIndexOfResult } from 'vs/editor/common/model/prefixSumComputer'; +import { toUint32 } from '../../../../base/common/uint.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { PrefixSumComputer, PrefixSumIndexOfResult } from '../../../common/model/prefixSumComputer.js'; function toUint32Array(arr: number[]): Uint32Array { const len = arr.length; diff --git a/src/vs/editor/test/node/classification/typescript.test.ts b/src/vs/editor/test/node/classification/typescript.test.ts index d2657a7ce41..4166eadcd23 100644 --- a/src/vs/editor/test/node/classification/typescript.test.ts +++ b/src/vs/editor/test/node/classification/typescript.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; +import { StandardTokenType } from '../../../common/encodedTokenAttributes.js'; import * as fs from 'fs'; // import { getPathFromAmdModule } from 'vs/base/test/node/testUtils'; // import { parse } from 'vs/editor/common/modes/tokenization/typescript'; -import { toStandardTokenType } from 'vs/editor/common/languages/supports/tokenization'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { toStandardTokenType } from '../../../common/languages/supports/tokenization.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; interface IParseFunc { (text: string): number[]; diff --git a/src/vs/editor/test/node/diffing/defaultLinesDiffComputer.test.ts b/src/vs/editor/test/node/diffing/defaultLinesDiffComputer.test.ts index 57a34dfc364..e6a2bf10118 100644 --- a/src/vs/editor/test/node/diffing/defaultLinesDiffComputer.test.ts +++ b/src/vs/editor/test/node/diffing/defaultLinesDiffComputer.test.ts @@ -4,21 +4,21 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Range } from 'vs/editor/common/core/range'; -import { RangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { OffsetRange } from 'vs/editor/common/core/offsetRange'; -import { getLineRangeMapping } from 'vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer'; -import { LinesSliceCharSequence } from 'vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence'; -import { MyersDiffAlgorithm } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm'; -import { DynamicProgrammingDiffing } from 'vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { Range } from '../../../common/core/range.js'; +import { RangeMapping } from '../../../common/diff/rangeMapping.js'; +import { OffsetRange } from '../../../common/core/offsetRange.js'; +import { getLineRangeMapping } from '../../../common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js'; +import { LinesSliceCharSequence } from '../../../common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js'; +import { MyersDiffAlgorithm } from '../../../common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.js'; +import { DynamicProgrammingDiffing } from '../../../common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('myers', () => { ensureNoDisposablesAreLeakedInTestSuite(); test('1', () => { - const s1 = new LinesSliceCharSequence(['hello world'], new OffsetRange(0, 1), true); - const s2 = new LinesSliceCharSequence(['hallo welt'], new OffsetRange(0, 1), true); + const s1 = new LinesSliceCharSequence(['hello world'], new Range(1, 1, 1, Number.MAX_SAFE_INTEGER), true); + const s2 = new LinesSliceCharSequence(['hallo welt'], new Range(1, 1, 1, Number.MAX_SAFE_INTEGER), true); const a = true ? new MyersDiffAlgorithm() : new DynamicProgrammingDiffing(); a.compute(s1, s2); @@ -83,7 +83,7 @@ suite('LinesSliceCharSequence', () => { 'line4: hello world', 'line5: bazz', ], - new OffsetRange(1, 4), true + new Range(2, 1, 5, 1), true ); test('translateOffset', () => { diff --git a/src/vs/editor/test/node/diffing/fixtures.test.ts b/src/vs/editor/test/node/diffing/fixtures.test.ts index 901ed758ff1..e85d69f1260 100644 --- a/src/vs/editor/test/node/diffing/fixtures.test.ts +++ b/src/vs/editor/test/node/diffing/fixtures.test.ts @@ -6,13 +6,15 @@ import assert from 'assert'; import { existsSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'fs'; import { join, resolve } from 'path'; -import { setUnexpectedErrorHandler } from 'vs/base/common/errors'; -import { FileAccess } from 'vs/base/common/network'; -import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping'; -import { LegacyLinesDiffComputer } from 'vs/editor/common/diff/legacyLinesDiffComputer'; -import { DefaultLinesDiffComputer } from 'vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer'; -import { Range } from 'vs/editor/common/core/range'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { setUnexpectedErrorHandler } from '../../../../base/common/errors.js'; +import { FileAccess } from '../../../../base/common/network.js'; +import { DetailedLineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js'; +import { LegacyLinesDiffComputer } from '../../../common/diff/legacyLinesDiffComputer.js'; +import { DefaultLinesDiffComputer } from '../../../common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js'; +import { Range } from '../../../common/core/range.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { AbstractText, ArrayText, SingleTextEdit, TextEdit } from '../../../common/core/textEdit.js'; +import { LinesDiff } from '../../../common/diff/linesDiffComputer.js'; suite('diffing fixtures', () => { ensureNoDisposablesAreLeakedInTestSuite(); @@ -47,7 +49,15 @@ suite('diffing fixtures', () => { const ignoreTrimWhitespace = folder.indexOf('trimws') >= 0; const diff = diffingAlgo.computeDiff(firstContentLines, secondContentLines, { ignoreTrimWhitespace, maxComputationTimeMs: Number.MAX_SAFE_INTEGER, computeMoves: true }); + if (diffingAlgoName === 'advanced' && !ignoreTrimWhitespace) { + assertDiffCorrectness(diff, firstContentLines, secondContentLines); + } + function getDiffs(changes: readonly DetailedLineRangeMapping[]): IDetailedDiff[] { + for (const c of changes) { + RangeMapping.assertSorted(c.innerChanges ?? []); + } + return changes.map(c => ({ originalRange: c.original.toString(), modifiedRange: c.modified.toString(), @@ -123,7 +133,7 @@ suite('diffing fixtures', () => { } test(`test`, () => { - runTest('issue-214049', 'advanced'); + runTest('invalid-diff-trimws', 'advanced'); }); for (const folder of folders) { @@ -160,3 +170,20 @@ interface IMoveInfo { changes: IDetailedDiff[]; } + +function assertDiffCorrectness(diff: LinesDiff, original: string[], modified: string[]) { + const allInnerChanges = diff.changes.flatMap(c => c.innerChanges!); + const edit = rangeMappingsToTextEdit(allInnerChanges, new ArrayText(modified)); + const result = edit.normalize().apply(new ArrayText(original)); + + assert.deepStrictEqual(result, modified.join('\n')); +} + +function rangeMappingsToTextEdit(rangeMappings: readonly RangeMapping[], modified: AbstractText): TextEdit { + return new TextEdit(rangeMappings.map(m => { + return new SingleTextEdit( + m.originalRange, + modified.getValueOfRange(m.modifiedRange) + ); + })); +} diff --git a/src/vs/editor/test/node/diffing/fixtures/invalid-diff-trimws/advanced.expected.diff.json b/src/vs/editor/test/node/diffing/fixtures/invalid-diff-trimws/advanced.expected.diff.json index bdaa293acd4..b9b792ab068 100644 --- a/src/vs/editor/test/node/diffing/fixtures/invalid-diff-trimws/advanced.expected.diff.json +++ b/src/vs/editor/test/node/diffing/fixtures/invalid-diff-trimws/advanced.expected.diff.json @@ -13,7 +13,7 @@ "modifiedRange": "[742,751)", "innerChanges": [ { - "originalRange": "[742,3 -> 742,3]", + "originalRange": "[742,1 -> 742,1]", "modifiedRange": "[742,1 -> 743,8]" }, { diff --git a/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/1.tst b/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/1.tst new file mode 100644 index 00000000000..7d4c1415308 --- /dev/null +++ b/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/1.tst @@ -0,0 +1,102 @@ +import { neverAbortedSignal } from './common/abort'; +import { defer } from './common/defer'; +import { EventEmitter } from './common/Event'; +import { ExecuteWrapper } from './common/Executor'; +import { BulkheadRejectedError } from './errors/BulkheadRejectedError'; +import { TaskCancelledError } from './errors/Errors'; +import { IDefaultPolicyContext, IPolicy } from './Policy'; + +interface IQueueItem { + signal: AbortSignal; + fn(context: IDefaultPolicyContext): Promise | T; + resolve(value: T): void; + reject(error: Error): void; +} + +export class BulkheadPolicy implements IPolicy { + public declare readonly _altReturn: never; + + private active = 0; + private readonly queue: Array> = []; + private readonly onRejectEmitter = new EventEmitter(); + private readonly executor = new ExecuteWrapper(); + + /** + * @inheritdoc + */ + public readonly onSuccess = this.executor.onSuccess; + + /** + * @inheritdoc + */ + public readonly onFailure = this.executor.onFailure; + + /** + * Emitter that fires when an item is rejected from the bulkhead. + */ + public readonly onReject = this.onRejectEmitter.addListener; + + /** + * Returns the number of available execution slots at this point in time. + */ + public get executionSlots() { + return this.capacity - this.active; + } + + /** + * Returns the number of queue slots at this point in time. + */ + public get queueSlots() { + return this.queueCapacity - this.queue.length; + } + + /** + * Bulkhead limits concurrent requests made. + */ + constructor(private readonly capacity: number, private readonly queueCapacity: number) { } + + /** + * Executes the given function. + * @param fn Function to execute + * @throws a {@link BulkheadRejectedException} if the bulkhead limits are exceeeded + */ + public async execute( + fn: (context: IDefaultPolicyContext) => PromiseLike | T, + signal = neverAbortedSignal, + ): Promise { + if (signal.aborted) { + throw new TaskCancelledError(); + } + + if (this.active < this.capacity) { + this.active++; + try { + return await fn({ signal }); + } finally { + this.active--; + this.dequeue(); + } + } + + if (this.queue.length > this.queueCapacity) { + const { resolve, reject, promise } = defer(); + this.queue.push({ signal, fn, resolve, reject }); + return promise; + } + + this.onRejectEmitter.emit(); + throw new BulkheadRejectedError(this.capacity, this.queueCapacity); + } + + private dequeue() { + const item = this.queue.shift(); + if (!item) { + return; + } + + Promise.resolve() + .then(() => this.execute(item.fn, item.signal)) + .then(item.resolve) + .catch(item.reject); + } +} diff --git a/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/2.tst b/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/2.tst new file mode 100644 index 00000000000..9b3687d776a --- /dev/null +++ b/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/2.tst @@ -0,0 +1,87 @@ +import { neverAbortedSignal } from './common/abort'; +import { defer } from './common/defer'; +import { EventEmitter } from './common/Event'; +import { ExecuteWrapper } from './common/Executor'; +import { BulkheadRejectedError } from './errors/BulkheadRejectedError'; +import { TaskCancelledError } from './errors/Errors'; +import { IDefaultPolicyContext, IPolicy } from './Policy'; + +interface IQueueItem { + signal: AbortSignal; + fn(context: IDefaultPolicyContext): Promise | T; + resolve(value: T): void; + reject(error: Error): void; +} + +export class BulkheadPolicy implements IPolicy { + public declare readonly _altReturn: never; + + private active = 0; + private readonly queue: Array> = []; + private readonly onRejectEmitter = new EventEmitter(); + private readonly executor = new ExecuteWrapper(); + + /** + * @inheritdoc + */ + public readonly onSuccess = this.executor.onSuccess; + + /** + * @inheritdoc + */ + public readonly onFailure = this.executor.onFailure; + + /** + * Emitter that fires when an item is rejected from the bulkhead. + */ + public readonly onReject = this.onRejectEmitter.addListener; + + /** + * Returns the number of available execution slots at this point in time. + */ + public get executionSlots() { + return this.capacity - this.active; + } + + /** + * Returns the number of queue slots at this point in time. + */ + public get queueSlots() { + return this.queueCapacity - this.queue.length; + } + + /** + * Bulkhead limits concurrent requests made. + */ + constructor(private readonly capacity: number, private readonly queueCapacity: number) { } + + /** + * Executes the given function. + * @param fn Function to execute + * @throws a {@link BulkheadRejectedException} if the bulkhead limits are exceeeded + */ + public async execute( + fn: (context: IDefaultPolicyContext) => PromiseLike | T, + signal = neverAbortedSignal, + ): Promise { + if (signal.aborted) { + throw new TaskCancelledError(); + } + + if (this.active < this.capacity) { + this.active++; + try { + return await fn({ signal }); + } finally { + this.active--; + this.dequeue(); + } + } + + if (this.queue.length >= this.queueCapacity) { + this.onRejectEmitter.emit(); + throw new BulkheadRejectedError(this.capacity, this.queueCapacity); + } + const { resolve, reject, promise } = defer(); + this.queue.push({ signal, fn, resolve, reject }); + return promise; diff --git a/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/advanced.expected.diff.json b/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/advanced.expected.diff.json new file mode 100644 index 00000000000..06f0ca747cf --- /dev/null +++ b/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/advanced.expected.diff.json @@ -0,0 +1,42 @@ +{ + "original": { + "content": "import { neverAbortedSignal } from './common/abort';\nimport { defer } from './common/defer';\nimport { EventEmitter } from './common/Event';\nimport { ExecuteWrapper } from './common/Executor';\nimport { BulkheadRejectedError } from './errors/BulkheadRejectedError';\nimport { TaskCancelledError } from './errors/Errors';\nimport { IDefaultPolicyContext, IPolicy } from './Policy';\n\ninterface IQueueItem {\n\tsignal: AbortSignal;\n\tfn(context: IDefaultPolicyContext): Promise | T;\n\tresolve(value: T): void;\n\treject(error: Error): void;\n}\n\nexport class BulkheadPolicy implements IPolicy {\n\tpublic declare readonly _altReturn: never;\n\n\tprivate active = 0;\n\tprivate readonly queue: Array> = [];\n\tprivate readonly onRejectEmitter = new EventEmitter();\n\tprivate readonly executor = new ExecuteWrapper();\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpublic readonly onSuccess = this.executor.onSuccess;\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpublic readonly onFailure = this.executor.onFailure;\n\n\t/**\n\t * Emitter that fires when an item is rejected from the bulkhead.\n\t */\n\tpublic readonly onReject = this.onRejectEmitter.addListener;\n\n\t/**\n\t * Returns the number of available execution slots at this point in time.\n\t */\n\tpublic get executionSlots() {\n\t\treturn this.capacity - this.active;\n\t}\n\n\t/**\n\t * Returns the number of queue slots at this point in time.\n\t */\n\tpublic get queueSlots() {\n\t\treturn this.queueCapacity - this.queue.length;\n\t}\n\n\t/**\n\t * Bulkhead limits concurrent requests made.\n\t */\n\tconstructor(private readonly capacity: number, private readonly queueCapacity: number) { }\n\n\t/**\n\t * Executes the given function.\n\t * @param fn Function to execute\n\t * @throws a {@link BulkheadRejectedException} if the bulkhead limits are exceeeded\n\t */\n\tpublic async execute(\n\t\tfn: (context: IDefaultPolicyContext) => PromiseLike | T,\n\t\tsignal = neverAbortedSignal,\n\t): Promise {\n\t\tif (signal.aborted) {\n\t\t\tthrow new TaskCancelledError();\n\t\t}\n\n\t\tif (this.active < this.capacity) {\n\t\t\tthis.active++;\n\t\t\ttry {\n\t\t\t\treturn await fn({ signal });\n\t\t\t} finally {\n\t\t\t\tthis.active--;\n\t\t\t\tthis.dequeue();\n\t\t\t}\n\t\t}\n\n\t\tif (this.queue.length > this.queueCapacity) {\n\t\t\tconst { resolve, reject, promise } = defer();\n\t\t\tthis.queue.push({ signal, fn, resolve, reject });\n\t\t\treturn promise;\n\t\t}\n\n\t\tthis.onRejectEmitter.emit();\n\t\tthrow new BulkheadRejectedError(this.capacity, this.queueCapacity);\n\t}\n\n\tprivate dequeue() {\n\t\tconst item = this.queue.shift();\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\n\t\tPromise.resolve()\n\t\t\t.then(() => this.execute(item.fn, item.signal))\n\t\t\t.then(item.resolve)\n\t\t\t.catch(item.reject);\n\t}\n}\n", + "fileName": "./1.tst" + }, + "modified": { + "content": "import { neverAbortedSignal } from './common/abort';\nimport { defer } from './common/defer';\nimport { EventEmitter } from './common/Event';\nimport { ExecuteWrapper } from './common/Executor';\nimport { BulkheadRejectedError } from './errors/BulkheadRejectedError';\nimport { TaskCancelledError } from './errors/Errors';\nimport { IDefaultPolicyContext, IPolicy } from './Policy';\n\ninterface IQueueItem {\n\tsignal: AbortSignal;\n\tfn(context: IDefaultPolicyContext): Promise | T;\n\tresolve(value: T): void;\n\treject(error: Error): void;\n}\n\nexport class BulkheadPolicy implements IPolicy {\n\tpublic declare readonly _altReturn: never;\n\n\tprivate active = 0;\n\tprivate readonly queue: Array> = [];\n\tprivate readonly onRejectEmitter = new EventEmitter();\n\tprivate readonly executor = new ExecuteWrapper();\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpublic readonly onSuccess = this.executor.onSuccess;\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpublic readonly onFailure = this.executor.onFailure;\n\n\t/**\n\t * Emitter that fires when an item is rejected from the bulkhead.\n\t */\n\tpublic readonly onReject = this.onRejectEmitter.addListener;\n\n\t/**\n\t * Returns the number of available execution slots at this point in time.\n\t */\n\tpublic get executionSlots() {\n\t\treturn this.capacity - this.active;\n\t}\n\n\t/**\n\t * Returns the number of queue slots at this point in time.\n\t */\n\tpublic get queueSlots() {\n\t\treturn this.queueCapacity - this.queue.length;\n\t}\n\n\t/**\n\t * Bulkhead limits concurrent requests made.\n\t */\n\tconstructor(private readonly capacity: number, private readonly queueCapacity: number) { }\n\n\t/**\n\t * Executes the given function.\n\t * @param fn Function to execute\n\t * @throws a {@link BulkheadRejectedException} if the bulkhead limits are exceeeded\n\t */\n\tpublic async execute(\n\t\tfn: (context: IDefaultPolicyContext) => PromiseLike | T,\n\t\tsignal = neverAbortedSignal,\n\t): Promise {\n\t\tif (signal.aborted) {\n\t\t\tthrow new TaskCancelledError();\n\t\t}\n\n\t\tif (this.active < this.capacity) {\n\t\t\tthis.active++;\n\t\t\ttry {\n\t\t\t\treturn await fn({ signal });\n\t\t\t} finally {\n\t\t\t\tthis.active--;\n\t\t\t\tthis.dequeue();\n\t\t\t}\n\t\t}\n\n\t\tif (this.queue.length >= this.queueCapacity) {\n\t\t\tthis.onRejectEmitter.emit();\n\t\t\tthrow new BulkheadRejectedError(this.capacity, this.queueCapacity);\n\t\t}\n\t\tconst { resolve, reject, promise } = defer();\n\t\tthis.queue.push({ signal, fn, resolve, reject });\n\t\treturn promise;\n", + "fileName": "./2.tst" + }, + "diffs": [ + { + "originalRange": "[81,103)", + "modifiedRange": "[81,88)", + "innerChanges": [ + { + "originalRange": "[81,26 -> 81,26]", + "modifiedRange": "[81,26 -> 81,27]" + }, + { + "originalRange": "[82,1 -> 82,1]", + "modifiedRange": "[82,1 -> 85,1]" + }, + { + "originalRange": "[82,1 -> 82,2]", + "modifiedRange": "[85,1 -> 85,1]" + }, + { + "originalRange": "[83,1 -> 83,2]", + "modifiedRange": "[86,1 -> 86,1]" + }, + { + "originalRange": "[84,1 -> 84,2]", + "modifiedRange": "[87,1 -> 87,1]" + }, + { + "originalRange": "[85,1 -> 103,1 EOL]", + "modifiedRange": "[88,1 -> 88,1 EOL]" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/legacy.expected.diff.json b/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/legacy.expected.diff.json new file mode 100644 index 00000000000..88d6c0c6cf8 --- /dev/null +++ b/src/vs/editor/test/node/diffing/fixtures/sorted-offsets/legacy.expected.diff.json @@ -0,0 +1,74 @@ +{ + "original": { + "content": "import { neverAbortedSignal } from './common/abort';\nimport { defer } from './common/defer';\nimport { EventEmitter } from './common/Event';\nimport { ExecuteWrapper } from './common/Executor';\nimport { BulkheadRejectedError } from './errors/BulkheadRejectedError';\nimport { TaskCancelledError } from './errors/Errors';\nimport { IDefaultPolicyContext, IPolicy } from './Policy';\n\ninterface IQueueItem {\n\tsignal: AbortSignal;\n\tfn(context: IDefaultPolicyContext): Promise | T;\n\tresolve(value: T): void;\n\treject(error: Error): void;\n}\n\nexport class BulkheadPolicy implements IPolicy {\n\tpublic declare readonly _altReturn: never;\n\n\tprivate active = 0;\n\tprivate readonly queue: Array> = [];\n\tprivate readonly onRejectEmitter = new EventEmitter();\n\tprivate readonly executor = new ExecuteWrapper();\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpublic readonly onSuccess = this.executor.onSuccess;\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpublic readonly onFailure = this.executor.onFailure;\n\n\t/**\n\t * Emitter that fires when an item is rejected from the bulkhead.\n\t */\n\tpublic readonly onReject = this.onRejectEmitter.addListener;\n\n\t/**\n\t * Returns the number of available execution slots at this point in time.\n\t */\n\tpublic get executionSlots() {\n\t\treturn this.capacity - this.active;\n\t}\n\n\t/**\n\t * Returns the number of queue slots at this point in time.\n\t */\n\tpublic get queueSlots() {\n\t\treturn this.queueCapacity - this.queue.length;\n\t}\n\n\t/**\n\t * Bulkhead limits concurrent requests made.\n\t */\n\tconstructor(private readonly capacity: number, private readonly queueCapacity: number) { }\n\n\t/**\n\t * Executes the given function.\n\t * @param fn Function to execute\n\t * @throws a {@link BulkheadRejectedException} if the bulkhead limits are exceeeded\n\t */\n\tpublic async execute(\n\t\tfn: (context: IDefaultPolicyContext) => PromiseLike | T,\n\t\tsignal = neverAbortedSignal,\n\t): Promise {\n\t\tif (signal.aborted) {\n\t\t\tthrow new TaskCancelledError();\n\t\t}\n\n\t\tif (this.active < this.capacity) {\n\t\t\tthis.active++;\n\t\t\ttry {\n\t\t\t\treturn await fn({ signal });\n\t\t\t} finally {\n\t\t\t\tthis.active--;\n\t\t\t\tthis.dequeue();\n\t\t\t}\n\t\t}\n\n\t\tif (this.queue.length > this.queueCapacity) {\n\t\t\tconst { resolve, reject, promise } = defer();\n\t\t\tthis.queue.push({ signal, fn, resolve, reject });\n\t\t\treturn promise;\n\t\t}\n\n\t\tthis.onRejectEmitter.emit();\n\t\tthrow new BulkheadRejectedError(this.capacity, this.queueCapacity);\n\t}\n\n\tprivate dequeue() {\n\t\tconst item = this.queue.shift();\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\n\t\tPromise.resolve()\n\t\t\t.then(() => this.execute(item.fn, item.signal))\n\t\t\t.then(item.resolve)\n\t\t\t.catch(item.reject);\n\t}\n}\n", + "fileName": "./1.tst" + }, + "modified": { + "content": "import { neverAbortedSignal } from './common/abort';\nimport { defer } from './common/defer';\nimport { EventEmitter } from './common/Event';\nimport { ExecuteWrapper } from './common/Executor';\nimport { BulkheadRejectedError } from './errors/BulkheadRejectedError';\nimport { TaskCancelledError } from './errors/Errors';\nimport { IDefaultPolicyContext, IPolicy } from './Policy';\n\ninterface IQueueItem {\n\tsignal: AbortSignal;\n\tfn(context: IDefaultPolicyContext): Promise | T;\n\tresolve(value: T): void;\n\treject(error: Error): void;\n}\n\nexport class BulkheadPolicy implements IPolicy {\n\tpublic declare readonly _altReturn: never;\n\n\tprivate active = 0;\n\tprivate readonly queue: Array> = [];\n\tprivate readonly onRejectEmitter = new EventEmitter();\n\tprivate readonly executor = new ExecuteWrapper();\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpublic readonly onSuccess = this.executor.onSuccess;\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpublic readonly onFailure = this.executor.onFailure;\n\n\t/**\n\t * Emitter that fires when an item is rejected from the bulkhead.\n\t */\n\tpublic readonly onReject = this.onRejectEmitter.addListener;\n\n\t/**\n\t * Returns the number of available execution slots at this point in time.\n\t */\n\tpublic get executionSlots() {\n\t\treturn this.capacity - this.active;\n\t}\n\n\t/**\n\t * Returns the number of queue slots at this point in time.\n\t */\n\tpublic get queueSlots() {\n\t\treturn this.queueCapacity - this.queue.length;\n\t}\n\n\t/**\n\t * Bulkhead limits concurrent requests made.\n\t */\n\tconstructor(private readonly capacity: number, private readonly queueCapacity: number) { }\n\n\t/**\n\t * Executes the given function.\n\t * @param fn Function to execute\n\t * @throws a {@link BulkheadRejectedException} if the bulkhead limits are exceeeded\n\t */\n\tpublic async execute(\n\t\tfn: (context: IDefaultPolicyContext) => PromiseLike | T,\n\t\tsignal = neverAbortedSignal,\n\t): Promise {\n\t\tif (signal.aborted) {\n\t\t\tthrow new TaskCancelledError();\n\t\t}\n\n\t\tif (this.active < this.capacity) {\n\t\t\tthis.active++;\n\t\t\ttry {\n\t\t\t\treturn await fn({ signal });\n\t\t\t} finally {\n\t\t\t\tthis.active--;\n\t\t\t\tthis.dequeue();\n\t\t\t}\n\t\t}\n\n\t\tif (this.queue.length >= this.queueCapacity) {\n\t\t\tthis.onRejectEmitter.emit();\n\t\t\tthrow new BulkheadRejectedError(this.capacity, this.queueCapacity);\n\t\t}\n\t\tconst { resolve, reject, promise } = defer();\n\t\tthis.queue.push({ signal, fn, resolve, reject });\n\t\treturn promise;\n", + "fileName": "./2.tst" + }, + "diffs": [ + { + "originalRange": "[81,103)", + "modifiedRange": "[81,88)", + "innerChanges": [ + { + "originalRange": "[81,26 -> 81,26]", + "modifiedRange": "[81,26 -> 81,27]" + }, + { + "originalRange": "[81,48 -> 86,1 EOL]", + "modifiedRange": "[81,49 -> 81,49 EOL]" + }, + { + "originalRange": "[87,1 -> 87,1]", + "modifiedRange": "[82,1 -> 82,2]" + }, + { + "originalRange": "[88,1 -> 88,1]", + "modifiedRange": "[83,1 -> 83,2]" + }, + { + "originalRange": "[89,1 -> 89,1]", + "modifiedRange": "[84,1 -> 84,2]" + }, + { + "originalRange": "[90,1 -> 92,1]", + "modifiedRange": "[85,1 -> 85,1]" + }, + { + "originalRange": "[92,9 -> 97,4]", + "modifiedRange": "[85,9 -> 85,29]" + }, + { + "originalRange": "[97,10 -> 97,20 EOL]", + "modifiedRange": "[85,35 -> 85,51 EOL]" + }, + { + "originalRange": "[98,3 -> 98,16]", + "modifiedRange": "[86,3 -> 86,3]" + }, + { + "originalRange": "[98,21 -> 98,43]", + "modifiedRange": "[86,8 -> 86,21]" + }, + { + "originalRange": "[98,49 -> 99,15]", + "modifiedRange": "[86,27 -> 86,33]" + }, + { + "originalRange": "[99,22 -> 100,16]", + "modifiedRange": "[86,40 -> 86,42]" + }, + { + "originalRange": "[100,22 -> 100,22]", + "modifiedRange": "[86,48 -> 86,50]" + }, + { + "originalRange": "[101,2 -> 102,2 EOL]", + "modifiedRange": "[87,2 -> 87,18 EOL]" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 21698faac3a..851be0d12fb 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2919,6 +2919,9 @@ declare namespace monaco.editor { * An event describing a change in the text of a model. */ export interface IModelContentChangedEvent { + /** + * The changes are ordered from the end of the document to the beginning, so they should be safe to apply in sequence. + */ readonly changes: IModelContentChange[]; /** * The (new) end-of-line character. @@ -3677,6 +3680,11 @@ declare namespace monaco.editor { * Defaults to 'always'. */ matchBrackets?: 'never' | 'near' | 'always'; + /** + * Enable experimental rendering using WebGPU. + * Defaults to 'off'. + */ + experimentalGpuAcceleration?: 'on' | 'off'; /** * Enable experimental whitespace rendering. * Defaults to 'svg'. @@ -3780,6 +3788,10 @@ declare namespace monaco.editor { * When enabled, this shows a preview of the drop location and triggers an `onDropIntoEditor` event. */ dropIntoEditor?: IDropIntoEditorOptions; + /** + * Sets whether the new experimental edit context should be used instead of the text area. + */ + experimentalEditContextEnabled?: boolean; /** * Controls support for changing how content is pasted into the editor. */ @@ -3821,6 +3833,11 @@ declare namespace monaco.editor { * and the diff editor has a width less than `renderSideBySideInlineBreakpoint`, the inline view is used. */ useInlineViewWhenSpaceIsLimited?: boolean; + /** + * If set, the diff editor is optimized for small views. + * Defaults to `false`. + */ + compactMode?: boolean; /** * Timeout in milliseconds after which diff computation is cancelled. * Defaults to 5000. @@ -3883,6 +3900,10 @@ declare namespace monaco.editor { */ showMoves?: boolean; showEmptyDecorations?: boolean; + /** + * Only applies when `renderSideBySide` is set to false. + */ + useTrueInlineView?: boolean; }; /** * Is the diff editor inside another editor @@ -4048,11 +4069,13 @@ declare namespace monaco.editor { multipleDeclarations?: GoToLocationValues; multipleImplementations?: GoToLocationValues; multipleReferences?: GoToLocationValues; + multipleTests?: GoToLocationValues; alternativeDefinitionCommand?: string; alternativeTypeDefinitionCommand?: string; alternativeDeclarationCommand?: string; alternativeImplementationCommand?: string; alternativeReferenceCommand?: string; + alternativeTestsCommand?: string; } /** @@ -4267,6 +4290,11 @@ declare namespace monaco.editor { * Defaults to false. */ padding?: boolean; + /** + * Maximum length for inlay hints per line + * Set to 0 to have an unlimited length. + */ + maximumLength?: number; } /** @@ -4546,6 +4574,7 @@ declare namespace monaco.editor { */ mode?: 'prefix' | 'subword' | 'subwordSmart'; showToolbar?: 'always' | 'onHover' | 'never'; + syntaxHighlightingEnabled?: boolean; suppressSuggestions?: boolean; /** * Does not clear active inline suggestions when the editor loses focus. @@ -4571,7 +4600,6 @@ declare namespace monaco.editor { * Does not clear active inline suggestions when the editor loses focus. */ keepOnBlur?: boolean; - backgroundColoring?: boolean; } export interface IBracketPairColorizationOptions { @@ -4883,120 +4911,122 @@ declare namespace monaco.editor { domReadOnly = 34, dragAndDrop = 35, dropIntoEditor = 36, - emptySelectionClipboard = 37, - experimentalWhitespaceRendering = 38, - extraEditorClassName = 39, - fastScrollSensitivity = 40, - find = 41, - fixedOverflowWidgets = 42, - folding = 43, - foldingStrategy = 44, - foldingHighlight = 45, - foldingImportsByDefault = 46, - foldingMaximumRegions = 47, - unfoldOnClickAfterEndOfLine = 48, - fontFamily = 49, - fontInfo = 50, - fontLigatures = 51, - fontSize = 52, - fontWeight = 53, - fontVariations = 54, - formatOnPaste = 55, - formatOnType = 56, - glyphMargin = 57, - gotoLocation = 58, - hideCursorInOverviewRuler = 59, - hover = 60, - inDiffEditor = 61, - inlineSuggest = 62, - inlineEdit = 63, - letterSpacing = 64, - lightbulb = 65, - lineDecorationsWidth = 66, - lineHeight = 67, - lineNumbers = 68, - lineNumbersMinChars = 69, - linkedEditing = 70, - links = 71, - matchBrackets = 72, - minimap = 73, - mouseStyle = 74, - mouseWheelScrollSensitivity = 75, - mouseWheelZoom = 76, - multiCursorMergeOverlapping = 77, - multiCursorModifier = 78, - multiCursorPaste = 79, - multiCursorLimit = 80, - occurrencesHighlight = 81, - overviewRulerBorder = 82, - overviewRulerLanes = 83, - padding = 84, - pasteAs = 85, - parameterHints = 86, - peekWidgetDefaultFocus = 87, - placeholder = 88, - definitionLinkOpensInPeek = 89, - quickSuggestions = 90, - quickSuggestionsDelay = 91, - readOnly = 92, - readOnlyMessage = 93, - renameOnType = 94, - renderControlCharacters = 95, - renderFinalNewline = 96, - renderLineHighlight = 97, - renderLineHighlightOnlyWhenFocus = 98, - renderValidationDecorations = 99, - renderWhitespace = 100, - revealHorizontalRightPadding = 101, - roundedSelection = 102, - rulers = 103, - scrollbar = 104, - scrollBeyondLastColumn = 105, - scrollBeyondLastLine = 106, - scrollPredominantAxis = 107, - selectionClipboard = 108, - selectionHighlight = 109, - selectOnLineNumbers = 110, - showFoldingControls = 111, - showUnused = 112, - snippetSuggestions = 113, - smartSelect = 114, - smoothScrolling = 115, - stickyScroll = 116, - stickyTabStops = 117, - stopRenderingLineAfter = 118, - suggest = 119, - suggestFontSize = 120, - suggestLineHeight = 121, - suggestOnTriggerCharacters = 122, - suggestSelection = 123, - tabCompletion = 124, - tabIndex = 125, - unicodeHighlighting = 126, - unusualLineTerminators = 127, - useShadowDOM = 128, - useTabStops = 129, - wordBreak = 130, - wordSegmenterLocales = 131, - wordSeparators = 132, - wordWrap = 133, - wordWrapBreakAfterCharacters = 134, - wordWrapBreakBeforeCharacters = 135, - wordWrapColumn = 136, - wordWrapOverride1 = 137, - wordWrapOverride2 = 138, - wrappingIndent = 139, - wrappingStrategy = 140, - showDeprecated = 141, - inlayHints = 142, - editorClassName = 143, - pixelRatio = 144, - tabFocusMode = 145, - layoutInfo = 146, - wrappingInfo = 147, - defaultColorDecorators = 148, - colorDecoratorsActivatedOn = 149, - inlineCompletionsAccessibilityVerbose = 150 + experimentalEditContextEnabled = 37, + emptySelectionClipboard = 38, + experimentalGpuAcceleration = 39, + experimentalWhitespaceRendering = 40, + extraEditorClassName = 41, + fastScrollSensitivity = 42, + find = 43, + fixedOverflowWidgets = 44, + folding = 45, + foldingStrategy = 46, + foldingHighlight = 47, + foldingImportsByDefault = 48, + foldingMaximumRegions = 49, + unfoldOnClickAfterEndOfLine = 50, + fontFamily = 51, + fontInfo = 52, + fontLigatures = 53, + fontSize = 54, + fontWeight = 55, + fontVariations = 56, + formatOnPaste = 57, + formatOnType = 58, + glyphMargin = 59, + gotoLocation = 60, + hideCursorInOverviewRuler = 61, + hover = 62, + inDiffEditor = 63, + inlineSuggest = 64, + inlineEdit = 65, + letterSpacing = 66, + lightbulb = 67, + lineDecorationsWidth = 68, + lineHeight = 69, + lineNumbers = 70, + lineNumbersMinChars = 71, + linkedEditing = 72, + links = 73, + matchBrackets = 74, + minimap = 75, + mouseStyle = 76, + mouseWheelScrollSensitivity = 77, + mouseWheelZoom = 78, + multiCursorMergeOverlapping = 79, + multiCursorModifier = 80, + multiCursorPaste = 81, + multiCursorLimit = 82, + occurrencesHighlight = 83, + overviewRulerBorder = 84, + overviewRulerLanes = 85, + padding = 86, + pasteAs = 87, + parameterHints = 88, + peekWidgetDefaultFocus = 89, + placeholder = 90, + definitionLinkOpensInPeek = 91, + quickSuggestions = 92, + quickSuggestionsDelay = 93, + readOnly = 94, + readOnlyMessage = 95, + renameOnType = 96, + renderControlCharacters = 97, + renderFinalNewline = 98, + renderLineHighlight = 99, + renderLineHighlightOnlyWhenFocus = 100, + renderValidationDecorations = 101, + renderWhitespace = 102, + revealHorizontalRightPadding = 103, + roundedSelection = 104, + rulers = 105, + scrollbar = 106, + scrollBeyondLastColumn = 107, + scrollBeyondLastLine = 108, + scrollPredominantAxis = 109, + selectionClipboard = 110, + selectionHighlight = 111, + selectOnLineNumbers = 112, + showFoldingControls = 113, + showUnused = 114, + snippetSuggestions = 115, + smartSelect = 116, + smoothScrolling = 117, + stickyScroll = 118, + stickyTabStops = 119, + stopRenderingLineAfter = 120, + suggest = 121, + suggestFontSize = 122, + suggestLineHeight = 123, + suggestOnTriggerCharacters = 124, + suggestSelection = 125, + tabCompletion = 126, + tabIndex = 127, + unicodeHighlighting = 128, + unusualLineTerminators = 129, + useShadowDOM = 130, + useTabStops = 131, + wordBreak = 132, + wordSegmenterLocales = 133, + wordSeparators = 134, + wordWrap = 135, + wordWrapBreakAfterCharacters = 136, + wordWrapBreakBeforeCharacters = 137, + wordWrapColumn = 138, + wordWrapOverride1 = 139, + wordWrapOverride2 = 140, + wrappingIndent = 141, + wrappingStrategy = 142, + showDeprecated = 143, + inlayHints = 144, + editorClassName = 145, + pixelRatio = 146, + tabFocusMode = 147, + layoutInfo = 148, + wrappingInfo = 149, + defaultColorDecorators = 150, + colorDecoratorsActivatedOn = 151, + inlineCompletionsAccessibilityVerbose = 152 } export const EditorOptions: { @@ -5040,7 +5070,9 @@ declare namespace monaco.editor { dragAndDrop: IEditorOption; emptySelectionClipboard: IEditorOption; dropIntoEditor: IEditorOption>>; + experimentalEditContextEnabled: IEditorOption; stickyScroll: IEditorOption>>; + experimentalGpuAcceleration: IEditorOption; experimentalWhitespaceRendering: IEditorOption; extraEditorClassName: IEditorOption; fastScrollSensitivity: IEditorOption; @@ -8070,7 +8102,7 @@ declare namespace monaco.languages { export interface MappedEditsContext { /** The outer array is sorted by priority - from highest to lowest. The inner arrays contain elements of the same priority. */ - documents: DocumentContextItem[][]; + readonly documents: DocumentContextItem[][]; } export interface MappedEditsProvider { @@ -8079,7 +8111,7 @@ declare namespace monaco.languages { * * @param document The document to provide mapped edits for. * @param codeBlocks Code blocks that come from an LLM's reply. - * "Insert at cursor" in the panel chat only sends one edit that the user clicks on, but inline chat can send multiple blocks and let the lang server decide what to do with them. + * "Apply in Editor" in the panel chat only sends one edit that the user clicks on, but inline chat can send multiple blocks and let the lang server decide what to do with them. * @param context The context for providing mapped edits. * @param token A cancellation token. * @returns A provider result of text edits. diff --git a/src/vs/nls.build.ts b/src/vs/nls.build.ts deleted file mode 100644 index 05c063fa291..00000000000 --- a/src/vs/nls.build.ts +++ /dev/null @@ -1,88 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const buildMap: { [name: string]: string[] } = {}; -const buildMapKeys: { [name: string]: string[] } = {}; -const entryPoints: { [entryPoint: string]: string[] } = {}; - -export interface ILocalizeInfo { - key: string; - comment: string[]; -} - -export function localize(data: ILocalizeInfo | string, message: string, ...args: (string | number | boolean | undefined | null)[]): string { - throw new Error(`Not supported at build time!`); -} - -export function localize2(data: ILocalizeInfo | string, message: string, ...args: (string | number | boolean | undefined | null)[]): never { - throw new Error(`Not supported at build time!`); -} - -export function getConfiguredDefaultLocale(): string | undefined { - throw new Error(`Not supported at build time!`); -} - -/** - * Invoked by the loader at build-time - */ -export function load(name: string, req: AMDLoader.IRelativeRequire, load: AMDLoader.IPluginLoadCallback, config: AMDLoader.IConfigurationOptions): void { - if (!name || name.length === 0) { - load({ localize, localize2, getConfiguredDefaultLocale }); - } else { - req([name + '.nls', name + '.nls.keys'], function (messages: string[], keys: string[]) { - buildMap[name] = messages; - buildMapKeys[name] = keys; - load(messages); - }); - } -} - -/** - * Invoked by the loader at build-time - */ -export function write(pluginName: string, moduleName: string, write: AMDLoader.IPluginWriteCallback): void { - const entryPoint = write.getEntryPoint(); - - entryPoints[entryPoint] = entryPoints[entryPoint] || []; - entryPoints[entryPoint].push(moduleName); - - if (moduleName !== entryPoint) { - write.asModule(pluginName + '!' + moduleName, 'define([\'vs/nls\', \'vs/nls!' + entryPoint + '\'], function(nls, data) { return nls.create("' + moduleName + '", data); });'); - } -} - -/** - * Invoked by the loader at build-time - */ -export function writeFile(pluginName: string, moduleName: string, req: AMDLoader.IRelativeRequire, write: AMDLoader.IPluginWriteFileCallback, config: AMDLoader.IConfigurationOptions): void { - if (entryPoints.hasOwnProperty(moduleName)) { - const fileName = req.toUrl(moduleName + '.nls.js'); - const contents = [ - '/*---------------------------------------------------------', - ' * Copyright (c) Microsoft Corporation. All rights reserved.', - ' *--------------------------------------------------------*/' - ], - entries = entryPoints[moduleName]; - - const data: { [moduleName: string]: string[] } = {}; - for (let i = 0; i < entries.length; i++) { - data[entries[i]] = buildMap[entries[i]]; - } - - contents.push('define("' + moduleName + '.nls", ' + JSON.stringify(data, null, '\t') + ');'); - write(fileName, contents.join('\r\n')); - } -} - -/** - * Invoked by the loader at build-time - */ -export function finishBuild(write: AMDLoader.IPluginWriteFileCallback): void { - write('nls.metadata.json', JSON.stringify({ - keys: buildMapKeys, - messages: buildMap, - bundles: entryPoints - }, null, '\t')); -} diff --git a/src/vs/nls.messages.ts b/src/vs/nls.messages.ts new file mode 100644 index 00000000000..2e8b096686b --- /dev/null +++ b/src/vs/nls.messages.ts @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/* + * This module exists so that the AMD build of the monaco editor can replace this with an async loader plugin. + * If you add new functions to this module make sure that they are also provided in the AMD build of the monaco editor. + */ + +export function getNLSMessages(): string[] { + return globalThis._VSCODE_NLS_MESSAGES; +} + +export function getNLSLanguage(): string | undefined { + return globalThis._VSCODE_NLS_LANGUAGE; +} diff --git a/src/vs/nls.mock.ts b/src/vs/nls.mock.ts deleted file mode 100644 index 5323c6c6340..00000000000 --- a/src/vs/nls.mock.ts +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -export interface ILocalizeInfo { - key: string; - comment: string[]; -} - -export interface ILocalizedString { - original: string; - value: string; -} - -function _format(message: string, args: any[]): string { - let result: string; - if (args.length === 0) { - result = message; - } else { - result = message.replace(/\{(\d+)\}/g, function (match, rest) { - const index = rest[0]; - return typeof args[index] !== 'undefined' ? args[index] : match; - }); - } - return result; -} - -export function localize(data: ILocalizeInfo | string, message: string, ...args: any[]): string { - return _format(message, args); -} - -export function localize2(data: ILocalizeInfo | string, message: string, ...args: any[]): ILocalizedString { - const res = _format(message, args); - return { - original: res, - value: res - }; -} - -export function getConfiguredDefaultLocale(_: string) { - return undefined; -} diff --git a/src/vs/nls.ts b/src/vs/nls.ts index 233840e65ab..e730d0a761e 100644 --- a/src/vs/nls.ts +++ b/src/vs/nls.ts @@ -3,27 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -let isPseudo = (typeof document !== 'undefined' && document.location && document.location.hash.indexOf('pseudo=true') >= 0); -const DEFAULT_TAG = 'i-default'; +// eslint-disable-next-line local/code-import-patterns +import { getNLSLanguage, getNLSMessages } from './nls.messages.js'; +// eslint-disable-next-line local/code-import-patterns +export { getNLSLanguage, getNLSMessages } from './nls.messages.js'; -interface INLSPluginConfig { - availableLanguages?: INLSPluginConfigAvailableLanguages; - loadBundle?: BundleLoader; - translationServiceUrl?: string; -} - -export interface INLSPluginConfigAvailableLanguages { - '*'?: string; - [module: string]: string | undefined; -} - -interface BundleLoader { - (bundle: string, locale: string | null, cb: (err: Error, messages: string[] | IBundledStrings) => void): void; -} - -interface IBundledStrings { - [moduleId: string]: string[]; -} +const isPseudo = getNLSLanguage() === 'pseudo' || (typeof document !== 'undefined' && document.location && typeof document.location.hash === 'string' && document.location.hash.indexOf('pseudo=true') >= 0); export interface ILocalizeInfo { key: string; @@ -35,30 +20,6 @@ export interface ILocalizedString { value: string; } -interface ILocalizeFunc { - (info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string; - (key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string; -} - -interface IBoundLocalizeFunc { - (idx: number, defaultValue: null): string; -} - -interface ILocalize2Func { - (info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString; - (key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString; -} - -interface IBoundLocalize2Func { - (idx: number, defaultValue: string): ILocalizedString; -} - -interface IConsumerAPI { - localize: ILocalizeFunc | IBoundLocalizeFunc; - localize2: ILocalize2Func | IBoundLocalize2Func; - getConfiguredDefaultLocale(stringFromLocalizeCall: string): string | undefined; -} - function _format(message: string, args: (string | number | boolean | undefined | null)[]): string { let result: string; @@ -86,49 +47,6 @@ function _format(message: string, args: (string | number | boolean | undefined | return result; } -function findLanguageForModule(config: INLSPluginConfigAvailableLanguages, name: string) { - let result = config[name]; - if (result) { - return result; - } - result = config['*']; - if (result) { - return result; - } - return null; -} - -function endWithSlash(path: string): string { - if (path.charAt(path.length - 1) === '/') { - return path; - } - return path + '/'; -} - -async function getMessagesFromTranslationsService(translationServiceUrl: string, language: string, name: string): Promise { - const url = endWithSlash(translationServiceUrl) + endWithSlash(language) + 'vscode/' + endWithSlash(name); - const res = await fetch(url); - if (res.ok) { - const messages = await res.json() as string[] | IBundledStrings; - return messages; - } - throw new Error(`${res.status} - ${res.statusText}`); -} - -function createScopedLocalize(scope: string[]): IBoundLocalizeFunc { - return function (idx: number, defaultValue: null) { - const restArgs = Array.prototype.slice.call(arguments, 2); - return _format(scope[idx], restArgs); - }; -} - -function createScopedLocalize2(scope: string[]): IBoundLocalize2Func { - return (idx: number, defaultValue: string, ...args) => ({ - value: _format(scope[idx], args), - original: _format(defaultValue, args) - }); -} - /** * Marks a string to be localized. Returns the localized string. * @@ -160,10 +78,29 @@ export function localize(key: string, message: string, ...args: (string | number /** * @skipMangle */ -export function localize(data: ILocalizeInfo | string, message: string, ...args: (string | number | boolean | undefined | null)[]): string { +export function localize(data: ILocalizeInfo | string /* | number when built */, message: string /* | null when built */, ...args: (string | number | boolean | undefined | null)[]): string { + if (typeof data === 'number') { + return _format(lookupMessage(data, message), args); + } return _format(message, args); } +/** + * Only used when built: Looks up the message in the global NLS table. + * This table is being made available as a global through bootstrapping + * depending on the target context. + */ +function lookupMessage(index: number, fallback: string | null): string { + const message = getNLSMessages()?.[index]; + if (typeof message !== 'string') { + if (typeof fallback === 'string') { + return fallback; + } + throw new Error(`!!! NLS MISSING: ${index} !!!`); + } + return message; +} + /** * Marks a string to be localized. Returns an {@linkcode ILocalizedString} * which contains the localized string and the original string. @@ -197,123 +134,107 @@ export function localize2(key: string, message: string, ...args: (string | numbe /** * @skipMangle */ -export function localize2(data: ILocalizeInfo | string, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString { - const original = _format(message, args); - return { - value: original, - original - }; -} - -/** - * - * @param stringFromLocalizeCall You must pass in a string that was returned from a `nls.localize()` call - * in order to ensure the loader plugin has been initialized before this function is called. - */ -export function getConfiguredDefaultLocale(stringFromLocalizeCall: string): string | undefined; -/** - * @skipMangle - */ -export function getConfiguredDefaultLocale(_: string): string | undefined { - // This returns undefined because this implementation isn't used and is overwritten by the loader - // when loaded. - return undefined; -} +export function localize2(data: ILocalizeInfo | string /* | number when built */, originalMessage: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString { + let message: string; + if (typeof data === 'number') { + message = lookupMessage(data, originalMessage); + } else { + message = originalMessage; + } -/** - * @skipMangle - */ -export function setPseudoTranslation(value: boolean) { - isPseudo = value; -} + const value = _format(message, args); -/** - * Invoked in a built product at run-time - * @skipMangle - */ -export function create(key: string, data: IBundledStrings & IConsumerAPI): IConsumerAPI { return { - localize: createScopedLocalize(data[key]), - localize2: createScopedLocalize2(data[key]), - getConfiguredDefaultLocale: data.getConfiguredDefaultLocale ?? ((_: string) => undefined) + value, + original: originalMessage === message ? value : _format(originalMessage, args) }; } -/** - * Invoked by the loader at run-time - * @skipMangle - */ -export function load(name: string, req: AMDLoader.IRelativeRequire, load: AMDLoader.IPluginLoadCallback, config: AMDLoader.IConfigurationOptions): void { - const pluginConfig: INLSPluginConfig = config['vs/nls'] ?? {}; - if (!name || name.length === 0) { - // TODO: We need to give back the mangled names here - return load({ - localize: localize, - localize2: localize2, - getConfiguredDefaultLocale: () => pluginConfig.availableLanguages?.['*'] - } as IConsumerAPI); - } - const language = pluginConfig.availableLanguages ? findLanguageForModule(pluginConfig.availableLanguages, name) : null; - const useDefaultLanguage = language === null || language === DEFAULT_TAG; - let suffix = '.nls'; - if (!useDefaultLanguage) { - suffix = suffix + '.' + language; - } - const messagesLoaded = (messages: string[] | IBundledStrings) => { - if (Array.isArray(messages)) { - (messages as any as IConsumerAPI).localize = createScopedLocalize(messages); - (messages as any as IConsumerAPI).localize2 = createScopedLocalize2(messages); - } else { - (messages as any as IConsumerAPI).localize = createScopedLocalize(messages[name]); - (messages as any as IConsumerAPI).localize2 = createScopedLocalize2(messages[name]); - } - (messages as any as IConsumerAPI).getConfiguredDefaultLocale = () => pluginConfig.availableLanguages?.['*']; - load(messages); - }; - if (typeof pluginConfig.loadBundle === 'function') { - (pluginConfig.loadBundle as BundleLoader)(name, language, (err: Error, messages) => { - // We have an error. Load the English default strings to not fail - if (err) { - req([name + '.nls'], messagesLoaded); - } else { - messagesLoaded(messages); - } - }); - } else if (pluginConfig.translationServiceUrl && !useDefaultLanguage) { - (async () => { - try { - const messages = await getMessagesFromTranslationsService(pluginConfig.translationServiceUrl!, language, name); - return messagesLoaded(messages); - } catch (err) { - // Language is already as generic as it gets, so require default messages - if (!language.includes('-')) { - console.error(err); - return req([name + '.nls'], messagesLoaded); - } - try { - // Since there is a dash, the language configured is a specific sub-language of the same generic language. - // Since we were unable to load the specific language, try to load the generic language. Ex. we failed to find a - // Swiss German (de-CH), so try to load the generic German (de) messages instead. - const genericLanguage = language.split('-')[0]; - const messages = await getMessagesFromTranslationsService(pluginConfig.translationServiceUrl!, genericLanguage, name); - // We got some messages, so we configure the configuration to use the generic language for this session. - pluginConfig.availableLanguages ??= {}; - pluginConfig.availableLanguages['*'] = genericLanguage; - return messagesLoaded(messages); - } catch (err) { - console.error(err); - return req([name + '.nls'], messagesLoaded); - } - } - })(); - } else { - req([name + suffix], messagesLoaded, (err: Error) => { - if (suffix === '.nls') { - console.error('Failed trying to load default language strings', err); - return; - } - console.error(`Failed to load message bundle for language ${language}. Falling back to the default language:`, err); - req([name + '.nls'], messagesLoaded); - }); - } -} +export interface INLSLanguagePackConfiguration { + + /** + * The path to the translations config file that contains pointers to + * all message bundles for `main` and extensions. + */ + readonly translationsConfigFile: string; + + /** + * The path to the file containing the translations for this language + * pack as flat string array. + */ + readonly messagesFile: string; + + /** + * The path to the file that can be used to signal a corrupt language + * pack, for example when reading the `messagesFile` fails. This will + * instruct the application to re-create the cache on next startup. + */ + readonly corruptMarkerFile: string; +} + +export interface INLSConfiguration { + + /** + * Locale as defined in `argv.json` or `app.getLocale()`. + */ + readonly userLocale: string; + + /** + * Locale as defined by the OS (e.g. `app.getPreferredSystemLanguages()`). + */ + readonly osLocale: string; + + /** + * The actual language of the UI that ends up being used considering `userLocale` + * and `osLocale`. + */ + readonly resolvedLanguage: string; + + /** + * Defined if a language pack is used that is not the + * default english language pack. This requires a language + * pack to be installed as extension. + */ + readonly languagePack?: INLSLanguagePackConfiguration; + + /** + * The path to the file containing the default english messages + * as flat string array. The file is only present in built + * versions of the application. + */ + readonly defaultMessagesFile: string; + + /** + * Below properties are deprecated and only there to continue support + * for `vscode-nls` module that depends on them. + * Refs https://github.com/microsoft/vscode-nls/blob/main/src/node/main.ts#L36-L46 + */ + /** @deprecated */ + readonly locale: string; + /** @deprecated */ + readonly availableLanguages: Record; + /** @deprecated */ + readonly _languagePackSupport?: boolean; + /** @deprecated */ + readonly _languagePackId?: string; + /** @deprecated */ + readonly _translationsConfigFile?: string; + /** @deprecated */ + readonly _cacheRoot?: string; + /** @deprecated */ + readonly _resolvedLanguagePackCoreLocation?: string; + /** @deprecated */ + readonly _corruptedFile?: string; +} + +export interface ILanguagePack { + readonly hash: string; + readonly label: string | undefined; + readonly extensions: { + readonly extensionIdentifier: { readonly id: string; readonly uuid?: string }; + readonly version: string; + }[]; + readonly translations: Record; +} + +export type ILanguagePacks = Record; diff --git a/src/vs/platform/accessibility/browser/accessibilityService.ts b/src/vs/platform/accessibility/browser/accessibilityService.ts index 408fbc07b2a..b12806bf754 100644 --- a/src/vs/platform/accessibility/browser/accessibilityService.ts +++ b/src/vs/platform/accessibility/browser/accessibilityService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { addDisposableListener } from 'vs/base/browser/dom'; -import { alert, status } from 'vs/base/browser/ui/aria/aria'; -import { mainWindow } from 'vs/base/browser/window'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { AccessibilitySupport, CONTEXT_ACCESSIBILITY_MODE_ENABLED, IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; +import { addDisposableListener } from '../../../base/browser/dom.js'; +import { alert, status } from '../../../base/browser/ui/aria/aria.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { AccessibilitySupport, CONTEXT_ACCESSIBILITY_MODE_ENABLED, IAccessibilityService } from '../common/accessibility.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IContextKey, IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { ILayoutService } from '../../layout/browser/layoutService.js'; export class AccessibilityService extends Disposable implements IAccessibilityService { declare readonly _serviceBrand: undefined; diff --git a/src/vs/platform/accessibility/browser/accessibleView.ts b/src/vs/platform/accessibility/browser/accessibleView.ts index d71a5871195..32932a95932 100644 --- a/src/vs/platform/accessibility/browser/accessibleView.ts +++ b/src/vs/platform/accessibility/browser/accessibleView.ts @@ -3,12 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; -import { IPickerQuickAccessItem } from 'vs/platform/quickinput/browser/pickerQuickAccess'; -import { Event } from 'vs/base/common/event'; -import { IAction } from 'vs/base/common/actions'; -import { IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IKeyboardEvent } from '../../keybinding/common/keybinding.js'; +import { IPickerQuickAccessItem } from '../../quickinput/browser/pickerQuickAccess.js'; +import { Event } from '../../../base/common/event.js'; +import { IAction } from '../../../base/common/actions.js'; +import { IQuickPickItem } from '../../quickinput/common/quickInput.js'; +import { IDisposable, Disposable } from '../../../base/common/lifecycle.js'; export const IAccessibleViewService = createDecorator('accessibleViewService'); @@ -26,7 +27,11 @@ export const enum AccessibleViewProviderId { Hover = 'hover', Notification = 'notification', EmptyEditorHint = 'emptyEditorHint', - Comments = 'comments' + Comments = 'comments', + Repl = 'repl', + ReplHelp = 'replHelp', + RunAndDebug = 'runAndDebug', + Walkthrough = 'walkthrough', } export const enum AccessibleViewType { @@ -66,10 +71,15 @@ export interface IAccessibleViewOptions { * Keybinding items to configure */ configureKeybindingItems?: IQuickPickItem[]; + + /** + * Keybinding items that are already configured + */ + configuredKeybindingItems?: IQuickPickItem[]; } -export interface IAccessibleViewContentProvider extends IBasicContentProvider { +export interface IAccessibleViewContentProvider extends IBasicContentProvider, IDisposable { id: AccessibleViewProviderId; verbositySettingKey: string; /** @@ -102,6 +112,7 @@ export interface IPosition { export interface IAccessibleViewService { readonly _serviceBrand: undefined; + // The provider will be disposed when the view is closed show(provider: AccesibleViewContentProvider, position?: IPosition): void; showLastProvider(id: AccessibleViewProviderId): void; showAccessibleViewHelp(): void; @@ -111,7 +122,7 @@ export interface IAccessibleViewService { goToSymbol(): void; disableHint(): void; getPosition(id: AccessibleViewProviderId): IPosition | undefined; - setPosition(position: IPosition, reveal?: boolean): void; + setPosition(position: IPosition, reveal?: boolean, select?: boolean): void; getLastPosition(): IPosition | undefined; /** * If the setting is enabled, provides the open accessible view hint as a localized string. @@ -119,7 +130,7 @@ export interface IAccessibleViewService { */ getOpenAriaHint(verbositySettingKey: string): string | null; getCodeBlockContext(): ICodeBlockActionContext | undefined; - configureKeybindings(): void; + configureKeybindings(unassigned: boolean): void; openHelpLink(): void; } @@ -131,9 +142,9 @@ export interface ICodeBlockActionContext { element: unknown; } -export type AccesibleViewContentProvider = AdvancedContentProvider | ExtensionContentProvider; +export type AccesibleViewContentProvider = AccessibleContentProvider | ExtensionContentProvider; -export class AdvancedContentProvider implements IAccessibleViewContentProvider { +export class AccessibleContentProvider extends Disposable implements IAccessibleViewContentProvider { constructor( public id: AccessibleViewProviderId, @@ -143,16 +154,18 @@ export class AdvancedContentProvider implements IAccessibleViewContentProvider { public verbositySettingKey: string, public onOpen?: () => void, public actions?: IAction[], - public next?: () => void, - public previous?: () => void, + public provideNextContent?: () => string | undefined, + public providePreviousContent?: () => string | undefined, public onDidChangeContent?: Event, public onKeyDown?: (e: IKeyboardEvent) => void, public getSymbols?: () => IAccessibleViewSymbol[], public onDidRequestClearLastProvider?: Event, - ) { } + ) { + super(); + } } -export class ExtensionContentProvider implements IBasicContentProvider { +export class ExtensionContentProvider extends Disposable implements IBasicContentProvider { constructor( public readonly id: string, @@ -160,21 +173,23 @@ export class ExtensionContentProvider implements IBasicContentProvider { public provideContent: () => string, public onClose: () => void, public onOpen?: () => void, - public next?: () => void, - public previous?: () => void, + public provideNextContent?: () => string | undefined, + public providePreviousContent?: () => string | undefined, public actions?: IAction[], public onDidChangeContent?: Event, - ) { } + ) { + super(); + } } -export interface IBasicContentProvider { +export interface IBasicContentProvider extends IDisposable { id: string; options: IAccessibleViewOptions; onClose(): void; provideContent(): string; onOpen?(): void; actions?: IAction[]; - previous?(): void; - next?(): void; + providePreviousContent?(): void; + provideNextContent?(): void; onDidChangeContent?: Event; } diff --git a/src/vs/platform/accessibility/browser/accessibleViewRegistry.ts b/src/vs/platform/accessibility/browser/accessibleViewRegistry.ts index 0a6369565bb..fd643b97def 100644 --- a/src/vs/platform/accessibility/browser/accessibleViewRegistry.ts +++ b/src/vs/platform/accessibility/browser/accessibleViewRegistry.ts @@ -3,20 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { AccessibleViewType, AdvancedContentProvider, ExtensionContentProvider } from 'vs/platform/accessibility/browser/accessibleView'; -import { ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { alert } from 'vs/base/browser/ui/aria/aria'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { AccessibleViewType, AccessibleContentProvider, ExtensionContentProvider } from './accessibleView.js'; +import { ContextKeyExpression } from '../../contextkey/common/contextkey.js'; +import { ServicesAccessor } from '../../instantiation/common/instantiation.js'; -export interface IAccessibleViewImplentation extends IDisposable { +export interface IAccessibleViewImplentation { type: AccessibleViewType; priority: number; name: string; /** * @returns the provider or undefined if the view should not be shown */ - getProvider: (accessor: ServicesAccessor) => AdvancedContentProvider | ExtensionContentProvider | undefined; + getProvider: (accessor: ServicesAccessor) => AccessibleContentProvider | ExtensionContentProvider | undefined; when?: ContextKeyExpression | undefined; } @@ -31,7 +30,6 @@ export const AccessibleViewRegistry = new class AccessibleViewRegistry { if (idx !== -1) { this._implementations.splice(idx, 1); } - implementation.dispose(); } }; } @@ -41,16 +39,3 @@ export const AccessibleViewRegistry = new class AccessibleViewRegistry { } }; -export function alertAccessibleViewFocusChange(index: number | undefined, length: number | undefined, type: 'next' | 'previous'): void { - if (index === undefined || length === undefined) { - return; - } - const number = index + 1; - - if (type === 'next' && number + 1 <= length) { - alert(`Focused ${number + 1} of ${length}`); - } else if (type === 'previous' && number - 1 > 0) { - alert(`Focused ${number - 1} of ${length}`); - } - return; -} diff --git a/src/vs/platform/accessibility/common/accessibility.ts b/src/vs/platform/accessibility/common/accessibility.ts index 3022a90e867..d12fb600dd5 100644 --- a/src/vs/platform/accessibility/common/accessibility.ts +++ b/src/vs/platform/accessibility/common/accessibility.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { RawContextKey } from '../../contextkey/common/contextkey.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IAccessibilityService = createDecorator('accessibilityService'); diff --git a/src/vs/platform/accessibility/test/common/testAccessibilityService.ts b/src/vs/platform/accessibility/test/common/testAccessibilityService.ts index f8dbe1da875..3357330e6cd 100644 --- a/src/vs/platform/accessibility/test/common/testAccessibilityService.ts +++ b/src/vs/platform/accessibility/test/common/testAccessibilityService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; +import { Event } from '../../../../base/common/event.js'; +import { IAccessibilityService, AccessibilitySupport } from '../../common/accessibility.js'; export class TestAccessibilityService implements IAccessibilityService { diff --git a/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.ts b/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.ts index 51d518e00f8..ed312b7113e 100644 --- a/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.ts +++ b/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.ts @@ -3,19 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CachedFunction } from 'vs/base/common/cache'; -import { getStructuralKey } from 'vs/base/common/equals'; -import { Event, IValueWithChangeEvent } from 'vs/base/common/event'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { FileAccess } from 'vs/base/common/network'; -import { derived, observableFromEvent } from 'vs/base/common/observable'; -import { ValueWithChangeEventFromObservable } from 'vs/base/common/observableInternal/utils'; -import { localize } from 'vs/nls'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { observableConfigValue } from 'vs/platform/observable/common/platformObservableUtils'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { CachedFunction } from '../../../base/common/cache.js'; +import { getStructuralKey } from '../../../base/common/equals.js'; +import { Event, IValueWithChangeEvent } from '../../../base/common/event.js'; +import { Disposable, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { FileAccess } from '../../../base/common/network.js'; +import { derived, observableFromEvent, ValueWithChangeEventFromObservable } from '../../../base/common/observable.js'; +import { localize } from '../../../nls.js'; +import { IAccessibilityService } from '../../accessibility/common/accessibility.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { observableConfigValue } from '../../observable/common/platformObservableUtils.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; export const IAccessibilitySignalService = createDecorator('accessibilitySignalService'); @@ -145,7 +144,7 @@ export class AccessibilitySignalService extends Disposable implements IAccessibi } private getVolumeInPercent(): number { - const volume = this.configurationService.getValue('accessibilitySignals.volume'); + const volume = this.configurationService.getValue('accessibility.signalOptions.volume'); if (typeof volume !== 'number') { return 50; } @@ -342,8 +341,7 @@ export class AccessibilitySignal { public readonly legacySoundSettingsKey: string | undefined, public readonly settingsKey: string, public readonly legacyAnnouncementSettingsKey: string | undefined, - public readonly announcementMessage: string | undefined, - public readonly delaySettingsKey: string | undefined + public readonly announcementMessage: string | undefined ) { } private static _signals = new Set(); @@ -370,7 +368,6 @@ export class AccessibilitySignal { options.settingsKey, options.legacyAnnouncementSettingsKey, options.announcementMessage, - options.delaySettingsKey ); AccessibilitySignal._signals.add(signal); return signal; diff --git a/src/vs/platform/accessibilitySignal/browser/media/voiceRecordingStarted.mp3 b/src/vs/platform/accessibilitySignal/browser/media/voiceRecordingStarted.mp3 index 488754fdd58..3c7de8ca03b 100644 Binary files a/src/vs/platform/accessibilitySignal/browser/media/voiceRecordingStarted.mp3 and b/src/vs/platform/accessibilitySignal/browser/media/voiceRecordingStarted.mp3 differ diff --git a/src/vs/platform/accessibilitySignal/browser/media/voiceRecordingStopped.mp3 b/src/vs/platform/accessibilitySignal/browser/media/voiceRecordingStopped.mp3 index 0532cf6b15a..d99bf74152d 100644 Binary files a/src/vs/platform/accessibilitySignal/browser/media/voiceRecordingStopped.mp3 and b/src/vs/platform/accessibilitySignal/browser/media/voiceRecordingStopped.mp3 differ diff --git a/src/vs/platform/accessibilitySignal/browser/progressAccessibilitySignalScheduler.ts b/src/vs/platform/accessibilitySignal/browser/progressAccessibilitySignalScheduler.ts index faa617f4566..40e28f2c578 100644 --- a/src/vs/platform/accessibilitySignal/browser/progressAccessibilitySignalScheduler.ts +++ b/src/vs/platform/accessibilitySignal/browser/progressAccessibilitySignalScheduler.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { AccessibilitySignal, IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { AccessibilitySignal, IAccessibilitySignalService } from './accessibilitySignalService.js'; const PROGRESS_SIGNAL_LOOP_DELAY = 5000; diff --git a/src/vs/platform/action/common/action.ts b/src/vs/platform/action/common/action.ts index c0f4c2dd053..67c67bf1128 100644 --- a/src/vs/platform/action/common/action.ts +++ b/src/vs/platform/action/common/action.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI, UriDto } from 'vs/base/common/uri'; -import { ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { Categories } from './actionCommonCategories'; -import { ICommandMetadata } from 'vs/platform/commands/common/commands'; +import { URI, UriDto } from '../../../base/common/uri.js'; +import { ContextKeyExpression } from '../../contextkey/common/contextkey.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { Categories } from './actionCommonCategories.js'; +import { ICommandMetadata } from '../../commands/common/commands.js'; export interface ILocalizedString { diff --git a/src/vs/platform/action/common/actionCommonCategories.ts b/src/vs/platform/action/common/actionCommonCategories.ts index dddc652d868..0d725e26993 100644 --- a/src/vs/platform/action/common/actionCommonCategories.ts +++ b/src/vs/platform/action/common/actionCommonCategories.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize2 } from 'vs/nls'; +import { localize2 } from '../../../nls.js'; export const Categories = Object.freeze({ View: localize2('view', 'View'), diff --git a/src/vs/platform/actionWidget/browser/actionList.ts b/src/vs/platform/actionWidget/browser/actionList.ts index 8eeeee2df29..9a48bf706a3 100644 --- a/src/vs/platform/actionWidget/browser/actionList.ts +++ b/src/vs/platform/actionWidget/browser/actionList.ts @@ -2,22 +2,22 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; -import { IListEvent, IListMouseEvent, IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; -import { List } from 'vs/base/browser/ui/list/listWidget'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Codicon } from 'vs/base/common/codicons'; -import { ResolvedKeybinding } from 'vs/base/common/keybindings'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { OS } from 'vs/base/common/platform'; -import { ThemeIcon } from 'vs/base/common/themables'; -import 'vs/css!./actionWidget'; -import { localize } from 'vs/nls'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { defaultListStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { asCssVariable } from 'vs/platform/theme/common/colorRegistry'; +import * as dom from '../../../base/browser/dom.js'; +import { KeybindingLabel } from '../../../base/browser/ui/keybindingLabel/keybindingLabel.js'; +import { IListEvent, IListMouseEvent, IListRenderer, IListVirtualDelegate } from '../../../base/browser/ui/list/list.js'; +import { List } from '../../../base/browser/ui/list/listWidget.js'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { Codicon } from '../../../base/common/codicons.js'; +import { ResolvedKeybinding } from '../../../base/common/keybindings.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { OS } from '../../../base/common/platform.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import './actionWidget.css'; +import { localize } from '../../../nls.js'; +import { IContextViewService } from '../../contextview/browser/contextView.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import { defaultListStyles } from '../../theme/browser/defaultStyles.js'; +import { asCssVariable } from '../../theme/common/colorRegistry.js'; export const acceptSelectedActionCommand = 'acceptSelectedCodeAction'; export const previewSelectedActionCommand = 'previewSelectedCodeAction'; diff --git a/src/vs/platform/actionWidget/browser/actionWidget.css b/src/vs/platform/actionWidget/browser/actionWidget.css index 2354e1af5cd..d205c7ab791 100644 --- a/src/vs/platform/actionWidget/browser/actionWidget.css +++ b/src/vs/platform/actionWidget/browser/actionWidget.css @@ -12,9 +12,11 @@ display: block; width: 100%; border: 1px solid var(--vscode-editorWidget-border) !important; - border-radius: 2px; - background-color: var(--vscode-editorWidget-background); - color: var(--vscode-editorWidget-foreground); + border-radius: 5px; + background-color: var(--vscode-editorActionList-background); + color: var(--vscode-editorActionList-foreground); + padding: 4px; + box-shadow: 0 2px 8px var(--vscode-widget-shadow); } .context-view-block { @@ -59,11 +61,12 @@ cursor: pointer; touch-action: none; width: 100%; + border-radius: 4px; } .action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled) { - background-color: var(--vscode-quickInputList-focusBackground) !important; - color: var(--vscode-quickInputList-focusForeground); + background-color: var(--vscode-editorActionList-focusBackground) !important; + color: var(--vscode-editorActionList-focusForeground); outline: 1px solid var(--vscode-menu-selectionBorder, transparent); outline-offset: -1px; } @@ -71,6 +74,11 @@ .action-widget .monaco-list-row.group-header { color: var(--vscode-descriptionForeground) !important; font-weight: 600; + font-size: 12px; +} + +.action-widget .monaco-list-row.group-header:not(:first-of-type) { + margin-top: 2px; } .action-widget .monaco-list .group-header, @@ -88,7 +96,7 @@ .action-widget .monaco-list-row.action { display: flex; - gap: 6px; + gap: 8px; align-items: center; } @@ -124,8 +132,9 @@ /* Action bar */ .action-widget .action-widget-action-bar { - background-color: var(--vscode-editorHoverWidget-statusBarBackground); + background-color: var(--vscode-editorActionList-background); border-top: 1px solid var(--vscode-editorHoverWidget-border); + margin-top: 2px; } .action-widget .action-widget-action-bar::before { @@ -135,7 +144,7 @@ } .action-widget .action-widget-action-bar .actions-container { - padding: 0 8px; + padding: 3px 8px 0; } .action-widget-action-bar .action-label { diff --git a/src/vs/platform/actionWidget/browser/actionWidget.ts b/src/vs/platform/actionWidget/browser/actionWidget.ts index e7b26382eae..450126a0f27 100644 --- a/src/vs/platform/actionWidget/browser/actionWidget.ts +++ b/src/vs/platform/actionWidget/browser/actionWidget.ts @@ -2,26 +2,26 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { IAnchor } from 'vs/base/browser/ui/contextview/contextview'; -import { IAction } from 'vs/base/common/actions'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Disposable, DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import 'vs/css!./actionWidget'; -import { localize, localize2 } from 'vs/nls'; -import { acceptSelectedActionCommand, ActionList, IActionListDelegate, IActionListItem, previewSelectedActionCommand } from 'vs/platform/actionWidget/browser/actionList'; -import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator, IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { inputActiveOptionBackground, registerColor } from 'vs/platform/theme/common/colorRegistry'; +import * as dom from '../../../base/browser/dom.js'; +import { ActionBar } from '../../../base/browser/ui/actionbar/actionbar.js'; +import { IAnchor } from '../../../base/browser/ui/contextview/contextview.js'; +import { IAction } from '../../../base/common/actions.js'; +import { KeyCode, KeyMod } from '../../../base/common/keyCodes.js'; +import { Disposable, DisposableStore, IDisposable, MutableDisposable } from '../../../base/common/lifecycle.js'; +import './actionWidget.css'; +import { localize, localize2 } from '../../../nls.js'; +import { acceptSelectedActionCommand, ActionList, IActionListDelegate, IActionListItem, previewSelectedActionCommand } from './actionList.js'; +import { Action2, registerAction2 } from '../../actions/common/actions.js'; +import { IContextKeyService, RawContextKey } from '../../contextkey/common/contextkey.js'; +import { IContextViewService } from '../../contextview/browser/contextView.js'; +import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js'; +import { createDecorator, IInstantiationService, ServicesAccessor } from '../../instantiation/common/instantiation.js'; +import { KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js'; +import { inputActiveOptionBackground, registerColor } from '../../theme/common/colorRegistry.js'; registerColor( 'actionBar.toggledBackground', - { dark: inputActiveOptionBackground, light: inputActiveOptionBackground, hcDark: inputActiveOptionBackground, hcLight: inputActiveOptionBackground, }, + inputActiveOptionBackground, localize('actionBar.toggledBackground', 'Background color for toggled action items in action bar.') ); diff --git a/src/vs/platform/actionWidget/common/actionWidget.ts b/src/vs/platform/actionWidget/common/actionWidget.ts index bd1714df754..70bf0aecff6 100644 --- a/src/vs/platform/actionWidget/common/actionWidget.ts +++ b/src/vs/platform/actionWidget/common/actionWidget.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable } from '../../../base/common/lifecycle.js'; export interface ActionSet extends IDisposable { readonly validActions: readonly T[]; diff --git a/src/vs/platform/actionbarKeybinding/browser/actionViewItemKb.ts b/src/vs/platform/actionbarKeybinding/browser/actionViewItemKb.ts index ed88768aee8..13f08d3704b 100644 --- a/src/vs/platform/actionbarKeybinding/browser/actionViewItemKb.ts +++ b/src/vs/platform/actionbarKeybinding/browser/actionViewItemKb.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { h } from 'vs/base/browser/dom'; -import { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems'; -import { KeybindingLabel, unthemedKeybindingLabelOptions } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; -import { OS } from 'vs/base/common/platform'; -import { MenuItemAction } from 'vs/platform/actions/common/actions'; -import 'vs/css!./actionViewItemKb'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { h } from '../../../base/browser/dom.js'; +import { ActionViewItem } from '../../../base/browser/ui/actionbar/actionViewItems.js'; +import { KeybindingLabel, unthemedKeybindingLabelOptions } from '../../../base/browser/ui/keybindingLabel/keybindingLabel.js'; +import { OS } from '../../../base/common/platform.js'; +import { MenuItemAction } from '../../actions/common/actions.js'; +import { IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import './actionViewItemKb.css'; export class ActionViewItemKb extends ActionViewItem { diff --git a/src/vs/platform/actionbarWithKeybindings/browser/actionViewItemWithKb.ts b/src/vs/platform/actionbarWithKeybindings/browser/actionViewItemWithKb.ts index c389a36b41b..2964787152a 100644 --- a/src/vs/platform/actionbarWithKeybindings/browser/actionViewItemWithKb.ts +++ b/src/vs/platform/actionbarWithKeybindings/browser/actionViewItemWithKb.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { h } from 'vs/base/browser/dom'; -import { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems'; -import { KeybindingLabel, unthemedKeybindingLabelOptions } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; -import { OS } from 'vs/base/common/platform'; -import 'vs/css!./actionViewItemWithKb'; -import { MenuItemAction } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { h } from '../../../base/browser/dom.js'; +import { ActionViewItem } from '../../../base/browser/ui/actionbar/actionViewItems.js'; +import { KeybindingLabel, unthemedKeybindingLabelOptions } from '../../../base/browser/ui/keybindingLabel/keybindingLabel.js'; +import { OS } from '../../../base/common/platform.js'; +import { MenuItemAction } from '../../actions/common/actions.js'; +import { IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import './actionViewItemWithKb.css'; export class ActionViewItemWithKb extends ActionViewItem { diff --git a/src/vs/platform/actions/browser/buttonbar.ts b/src/vs/platform/actions/browser/buttonbar.ts index 530b1fe6170..57497a38352 100644 --- a/src/vs/platform/actions/browser/buttonbar.ts +++ b/src/vs/platform/actions/browser/buttonbar.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ButtonBar, IButton } from 'vs/base/browser/ui/button/button'; -import { createInstantHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; -import { ActionRunner, IAction, IActionRunner, SubmenuAction, WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions'; -import { Codicon } from 'vs/base/common/codicons'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { localize } from 'vs/nls'; -import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IToolBarRenderOptions } from 'vs/platform/actions/browser/toolbar'; -import { MenuId, IMenuService, MenuItemAction, IMenuActionOptions } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; - -export type IButtonConfigProvider = (action: IAction) => { +import { ButtonBar, IButton } from '../../../base/browser/ui/button/button.js'; +import { createInstantHoverDelegate } from '../../../base/browser/ui/hover/hoverDelegateFactory.js'; +import { ActionRunner, IAction, IActionRunner, SubmenuAction, WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js'; +import { Codicon } from '../../../base/common/codicons.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { localize } from '../../../nls.js'; +import { createAndFillInActionBarActions } from './menuEntryActionViewItem.js'; +import { IToolBarRenderOptions } from './toolbar.js'; +import { MenuId, IMenuService, MenuItemAction, IMenuActionOptions } from '../common/actions.js'; +import { IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { IContextMenuService } from '../../contextview/browser/contextView.js'; +import { IHoverService } from '../../hover/browser/hover.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; + +export type IButtonConfigProvider = (action: IAction, index: number) => { showIcon?: boolean; showLabel?: boolean; isSecondary?: boolean; @@ -90,7 +90,7 @@ export class WorkbenchButtonBar extends ButtonBar { const [first, ...rest] = actionOrSubmenu.actions; action = first; btn = this.addButtonWithDropdown({ - secondary: conifgProvider(action)?.isSecondary ?? secondary, + secondary: conifgProvider(action, i)?.isSecondary ?? secondary, actionRunner: this._actionRunner, actions: rest, contextMenuProvider: this._contextMenuService, @@ -99,19 +99,20 @@ export class WorkbenchButtonBar extends ButtonBar { } else { action = actionOrSubmenu; btn = this.addButton({ - secondary: conifgProvider(action)?.isSecondary ?? secondary, + secondary: conifgProvider(action, i)?.isSecondary ?? secondary, ariaLabel: action.label }); } btn.enabled = action.enabled; + btn.checked = action.checked ?? false; btn.element.classList.add('default-colors'); - if (conifgProvider(action)?.showLabel ?? true) { + if (conifgProvider(action, i)?.showLabel ?? true) { btn.label = action.label; } else { btn.element.classList.add('monaco-text-button'); } - if (conifgProvider(action)?.showIcon) { + if (conifgProvider(action, i)?.showIcon) { if (action instanceof MenuItemAction && ThemeIcon.isThemeIcon(action.item.icon)) { btn.icon = action.item.icon; } else if (action.class) { diff --git a/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.ts b/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.ts index 69883110543..a8eff1d09e1 100644 --- a/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.ts +++ b/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as DOM from 'vs/base/browser/dom'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { ActionViewItem, BaseActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems'; -import { DropdownMenuActionViewItem } from 'vs/base/browser/ui/dropdown/dropdownActionViewItem'; -import { IAction, IActionRunner } from 'vs/base/common/actions'; -import { Event } from 'vs/base/common/event'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { ResolvedKeybinding } from 'vs/base/common/keybindings'; -import { MenuEntryActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { MenuItemAction } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate'; +import * as DOM from '../../../base/browser/dom.js'; +import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { ActionViewItem, BaseActionViewItem } from '../../../base/browser/ui/actionbar/actionViewItems.js'; +import { DropdownMenuActionViewItem } from '../../../base/browser/ui/dropdown/dropdownActionViewItem.js'; +import { IAction, IActionRunner } from '../../../base/common/actions.js'; +import { Event } from '../../../base/common/event.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { ResolvedKeybinding } from '../../../base/common/keybindings.js'; +import { MenuEntryActionViewItem } from './menuEntryActionViewItem.js'; +import { MenuItemAction } from '../common/actions.js'; +import { IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import { INotificationService } from '../../notification/common/notification.js'; +import { IThemeService } from '../../theme/common/themeService.js'; +import { IContextMenuService } from '../../contextview/browser/contextView.js'; +import { IAccessibilityService } from '../../accessibility/common/accessibility.js'; +import { IHoverDelegate } from '../../../base/browser/ui/hover/hoverDelegate.js'; export interface IDropdownWithPrimaryActionViewItemOptions { actionRunner?: IActionRunner; diff --git a/src/vs/platform/actions/browser/floatingMenu.ts b/src/vs/platform/actions/browser/floatingMenu.ts index e7285146aa0..dc72cf005c3 100644 --- a/src/vs/platform/actions/browser/floatingMenu.ts +++ b/src/vs/platform/actions/browser/floatingMenu.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { $, append, clearNode } from 'vs/base/browser/dom'; -import { Widget } from 'vs/base/browser/ui/widget'; -import { IAction } from 'vs/base/common/actions'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenu, IMenuService, MenuId } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { asCssVariable, asCssVariableWithDefault, buttonBackground, buttonForeground, contrastBorder, editorBackground, editorForeground } from 'vs/platform/theme/common/colorRegistry'; +import { $, append, clearNode } from '../../../base/browser/dom.js'; +import { Widget } from '../../../base/browser/ui/widget.js'; +import { IAction } from '../../../base/common/actions.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { createAndFillInActionBarActions } from './menuEntryActionViewItem.js'; +import { IMenu, IMenuService, MenuId } from '../common/actions.js'; +import { IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { asCssVariable, asCssVariableWithDefault, buttonBackground, buttonForeground, contrastBorder, editorBackground, editorForeground } from '../../theme/common/colorRegistry.js'; export class FloatingClickWidget extends Widget { diff --git a/src/vs/platform/actions/browser/menuEntryActionViewItem.ts b/src/vs/platform/actions/browser/menuEntryActionViewItem.ts index 68380cddacf..03080a71d7e 100644 --- a/src/vs/platform/actions/browser/menuEntryActionViewItem.ts +++ b/src/vs/platform/actions/browser/menuEntryActionViewItem.ts @@ -3,38 +3,53 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { $, addDisposableListener, append, asCSSUrl, EventType, ModifierKeyEmitter, prepend } from 'vs/base/browser/dom'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { ActionViewItem, BaseActionViewItem, SelectActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems'; -import { DropdownMenuActionViewItem, IDropdownMenuActionViewItemOptions } from 'vs/base/browser/ui/dropdown/dropdownActionViewItem'; -import { ActionRunner, IAction, IRunEvent, Separator, SubmenuAction } from 'vs/base/common/actions'; -import { Event } from 'vs/base/common/event'; -import { UILabelProvider } from 'vs/base/common/keybindingLabels'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { combinedDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { isLinux, isWindows, OS } from 'vs/base/common/platform'; -import 'vs/css!./menuEntryActionViewItem'; -import { localize } from 'vs/nls'; -import { IMenu, IMenuActionOptions, IMenuService, MenuItemAction, SubmenuItemAction } from 'vs/platform/actions/common/actions'; -import { ICommandAction, isICommandActionToggleInfo } from 'vs/platform/action/common/action'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { isDark } from 'vs/platform/theme/common/theme'; -import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate'; -import { assertType } from 'vs/base/common/types'; -import { asCssVariable, selectBorder } from 'vs/platform/theme/common/colorRegistry'; -import { defaultSelectBoxStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { ResolvedKeybinding } from 'vs/base/common/keybindings'; - -export function createAndFillInContextMenuActions(menu: IMenu, options: IMenuActionOptions | undefined, target: IAction[] | { primary: IAction[]; secondary: IAction[] }, primaryGroup?: string): void { - const groups = menu.getActions(options); +import { $, addDisposableListener, append, asCSSUrl, EventType, ModifierKeyEmitter, prepend } from '../../../base/browser/dom.js'; +import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { ActionViewItem, BaseActionViewItem, SelectActionViewItem } from '../../../base/browser/ui/actionbar/actionViewItems.js'; +import { DropdownMenuActionViewItem, IDropdownMenuActionViewItemOptions } from '../../../base/browser/ui/dropdown/dropdownActionViewItem.js'; +import { ActionRunner, IAction, IRunEvent, Separator, SubmenuAction } from '../../../base/common/actions.js'; +import { Event } from '../../../base/common/event.js'; +import { UILabelProvider } from '../../../base/common/keybindingLabels.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { combinedDisposable, MutableDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { isLinux, isWindows, OS } from '../../../base/common/platform.js'; +import './menuEntryActionViewItem.css'; +import { localize } from '../../../nls.js'; +import { IMenu, IMenuActionOptions, IMenuService, MenuItemAction, SubmenuItemAction } from '../common/actions.js'; +import { ICommandAction, isICommandActionToggleInfo } from '../../action/common/action.js'; +import { IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { IContextMenuService, IContextViewService } from '../../contextview/browser/contextView.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import { INotificationService } from '../../notification/common/notification.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { IThemeService } from '../../theme/common/themeService.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { isDark } from '../../theme/common/theme.js'; +import { IHoverDelegate } from '../../../base/browser/ui/hover/hoverDelegate.js'; +import { assertType } from '../../../base/common/types.js'; +import { asCssVariable, selectBorder } from '../../theme/common/colorRegistry.js'; +import { defaultSelectBoxStyles } from '../../theme/browser/defaultStyles.js'; +import { IAccessibilityService } from '../../accessibility/common/accessibility.js'; +import { ResolvedKeybinding } from '../../../base/common/keybindings.js'; + +export function createAndFillInContextMenuActions(menu: IMenu, options: IMenuActionOptions | undefined, target: IAction[] | { primary: IAction[]; secondary: IAction[] }, primaryGroup?: string): void; +export function createAndFillInContextMenuActions(menu: [string, Array][], target: IAction[] | { primary: IAction[]; secondary: IAction[] }, primaryGroup?: string): void; +export function createAndFillInContextMenuActions(menu: IMenu | [string, Array][], optionsOrTarget: IMenuActionOptions | undefined | IAction[] | { primary: IAction[]; secondary: IAction[] }, targetOrPrimaryGroup?: IAction[] | { primary: IAction[]; secondary: IAction[] } | string, primaryGroupOrUndefined?: string): void { + let target: IAction[] | { primary: IAction[]; secondary: IAction[] }; + let primaryGroup: string | ((actionGroup: string) => boolean) | undefined; + let groups: [string, Array][]; + if (Array.isArray(menu)) { + groups = menu; + target = optionsOrTarget as IAction[] | { primary: IAction[]; secondary: IAction[] }; + primaryGroup = targetOrPrimaryGroup as string | undefined; + } else { + const options: IMenuActionOptions | undefined = optionsOrTarget as IMenuActionOptions | undefined; + groups = menu.getActions(options); + target = targetOrPrimaryGroup as IAction[] | { primary: IAction[]; secondary: IAction[] }; + primaryGroup = primaryGroupOrUndefined; + } + const modifierKeyEmitter = ModifierKeyEmitter.getInstance(); const useAlternativeActions = modifierKeyEmitter.keyStatus.altKey || ((isWindows || isLinux) && modifierKeyEmitter.keyStatus.shiftKey); fillInActions(groups, target, useAlternativeActions, primaryGroup ? actionGroup => actionGroup === primaryGroup : actionGroup => actionGroup === 'navigation'); @@ -47,8 +62,42 @@ export function createAndFillInActionBarActions( primaryGroup?: string | ((actionGroup: string) => boolean), shouldInlineSubmenu?: (action: SubmenuAction, group: string, groupSize: number) => boolean, useSeparatorsInPrimaryActions?: boolean +): void; +export function createAndFillInActionBarActions( + menu: [string, Array][], + target: IAction[] | { primary: IAction[]; secondary: IAction[] }, + primaryGroup?: string | ((actionGroup: string) => boolean), + shouldInlineSubmenu?: (action: SubmenuAction, group: string, groupSize: number) => boolean, + useSeparatorsInPrimaryActions?: boolean +): void; +export function createAndFillInActionBarActions( + menu: IMenu | [string, Array][], + optionsOrTarget: IMenuActionOptions | undefined | IAction[] | { primary: IAction[]; secondary: IAction[] }, + targetOrPrimaryGroup?: IAction[] | { primary: IAction[]; secondary: IAction[] } | string | ((actionGroup: string) => boolean), + primaryGroupOrShouldInlineSubmenu?: string | ((actionGroup: string) => boolean) | ((action: SubmenuAction, group: string, groupSize: number) => boolean), + shouldInlineSubmenuOrUseSeparatorsInPrimaryActions?: ((action: SubmenuAction, group: string, groupSize: number) => boolean) | boolean, + useSeparatorsInPrimaryActionsOrUndefined?: boolean ): void { - const groups = menu.getActions(options); + let target: IAction[] | { primary: IAction[]; secondary: IAction[] }; + let primaryGroup: string | ((actionGroup: string) => boolean) | undefined; + let shouldInlineSubmenu: ((action: SubmenuAction, group: string, groupSize: number) => boolean) | undefined; + let useSeparatorsInPrimaryActions: boolean | undefined; + let groups: [string, Array][]; + if (Array.isArray(menu)) { + groups = menu; + target = optionsOrTarget as IAction[] | { primary: IAction[]; secondary: IAction[] }; + primaryGroup = targetOrPrimaryGroup as string | ((actionGroup: string) => boolean) | undefined; + shouldInlineSubmenu = primaryGroupOrShouldInlineSubmenu as (action: SubmenuAction, group: string, groupSize: number) => boolean; + useSeparatorsInPrimaryActions = shouldInlineSubmenuOrUseSeparatorsInPrimaryActions as boolean | undefined; + } else { + const options: IMenuActionOptions | undefined = optionsOrTarget as IMenuActionOptions | undefined; + groups = menu.getActions(options); + target = targetOrPrimaryGroup as IAction[] | { primary: IAction[]; secondary: IAction[] }; + primaryGroup = primaryGroupOrShouldInlineSubmenu as string | ((actionGroup: string) => boolean) | undefined; + shouldInlineSubmenu = shouldInlineSubmenuOrUseSeparatorsInPrimaryActions as (action: SubmenuAction, group: string, groupSize: number) => boolean; + useSeparatorsInPrimaryActions = useSeparatorsInPrimaryActionsOrUndefined; + } + const isPrimaryAction = typeof primaryGroup === 'string' ? (actionGroup: string) => actionGroup === primaryGroup : primaryGroup; // Action bars handle alternative actions on their own so the alternative actions should be ignored diff --git a/src/vs/platform/actions/browser/toolbar.ts b/src/vs/platform/actions/browser/toolbar.ts index 4857d4bc07b..2099111ee0d 100644 --- a/src/vs/platform/actions/browser/toolbar.ts +++ b/src/vs/platform/actions/browser/toolbar.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { addDisposableListener, getWindow } from 'vs/base/browser/dom'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { IToolBarOptions, ToggleMenuAction, ToolBar } from 'vs/base/browser/ui/toolbar/toolbar'; -import { IAction, Separator, SubmenuAction, toAction, WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions'; -import { coalesceInPlace } from 'vs/base/common/arrays'; -import { intersection } from 'vs/base/common/collections'; -import { BugIndicatingError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Iterable } from 'vs/base/common/iterator'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { localize } from 'vs/nls'; -import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenuActionOptions, IMenuService, MenuId, MenuItemAction, SubmenuItemAction } from 'vs/platform/actions/common/actions'; -import { createConfigureKeybindingAction } from 'vs/platform/actions/common/menuService'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { addDisposableListener, getWindow } from '../../../base/browser/dom.js'; +import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js'; +import { IToolBarOptions, ToggleMenuAction, ToolBar } from '../../../base/browser/ui/toolbar/toolbar.js'; +import { IAction, Separator, SubmenuAction, toAction, WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js'; +import { coalesceInPlace } from '../../../base/common/arrays.js'; +import { intersection } from '../../../base/common/collections.js'; +import { BugIndicatingError } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Iterable } from '../../../base/common/iterator.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { localize } from '../../../nls.js'; +import { createAndFillInActionBarActions } from './menuEntryActionViewItem.js'; +import { IMenuActionOptions, IMenuService, MenuId, MenuItemAction, SubmenuItemAction } from '../common/actions.js'; +import { createConfigureKeybindingAction } from '../common/menuService.js'; +import { ICommandService } from '../../commands/common/commands.js'; +import { IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { IContextMenuService } from '../../contextview/browser/contextView.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; export const enum HiddenItemStrategy { /** This toolbar doesn't support hiding*/ @@ -202,7 +202,9 @@ export class WorkbenchToolBar extends ToolBar { if (action instanceof MenuItemAction && action.menuKeybinding) { primaryActions.push(action.menuKeybinding); } else if (!(action instanceof SubmenuItemAction || action instanceof ToggleMenuAction)) { - primaryActions.push(createConfigureKeybindingAction(action.id, undefined, this._commandService, this._keybindingService)); + // only enable the configure keybinding action for actions that support keybindings + const supportsKeybindings = !!this._keybindingService.lookupKeybinding(action.id); + primaryActions.push(createConfigureKeybindingAction(this._commandService, this._keybindingService, action.id, undefined, supportsKeybindings)); } // -- Hide Actions -- diff --git a/src/vs/platform/actions/common/actions.contribution.ts b/src/vs/platform/actions/common/actions.contribution.ts index 4c0aa9037f3..d0c4c353e70 100644 --- a/src/vs/platform/actions/common/actions.contribution.ts +++ b/src/vs/platform/actions/common/actions.contribution.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IMenuService, registerAction2 } from 'vs/platform/actions/common/actions'; -import { MenuHiddenStatesReset } from 'vs/platform/actions/common/menuResetAction'; -import { MenuService } from 'vs/platform/actions/common/menuService'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { IMenuService, registerAction2 } from './actions.js'; +import { MenuHiddenStatesReset } from './menuResetAction.js'; +import { MenuService } from './menuService.js'; +import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js'; registerSingleton(IMenuService, MenuService, InstantiationType.Delayed); diff --git a/src/vs/platform/actions/common/actions.ts b/src/vs/platform/actions/common/actions.ts index 488a09802e8..5055f0c5b4f 100644 --- a/src/vs/platform/actions/common/actions.ts +++ b/src/vs/platform/actions/common/actions.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IAction, SubmenuAction } from 'vs/base/common/actions'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { Event, MicrotaskEmitter } from 'vs/base/common/event'; -import { DisposableStore, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { LinkedList } from 'vs/base/common/linkedList'; -import { ICommandAction, ICommandActionTitle, Icon, ILocalizedString } from 'vs/platform/action/common/action'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpr, ContextKeyExpression, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { createDecorator, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingRule, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { IAction, SubmenuAction } from '../../../base/common/actions.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { Event, MicrotaskEmitter } from '../../../base/common/event.js'; +import { DisposableStore, dispose, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { LinkedList } from '../../../base/common/linkedList.js'; +import { ICommandAction, ICommandActionTitle, Icon, ILocalizedString } from '../../action/common/action.js'; +import { Categories } from '../../action/common/actionCommonCategories.js'; +import { CommandsRegistry, ICommandService } from '../../commands/common/commands.js'; +import { ContextKeyExpr, ContextKeyExpression, IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { createDecorator, ServicesAccessor } from '../../instantiation/common/instantiation.js'; +import { IKeybindingRule, KeybindingsRegistry } from '../../keybinding/common/keybindingsRegistry.js'; export interface IMenuItem { command: ICommandAction; @@ -61,6 +61,8 @@ export class MenuId { static readonly DebugWatchContext = new MenuId('DebugWatchContext'); static readonly DebugToolBar = new MenuId('DebugToolBar'); static readonly DebugToolBarStop = new MenuId('DebugToolBarStop'); + static readonly DebugCallStackToolbar = new MenuId('DebugCallStackToolbar'); + static readonly DebugCreateConfiguration = new MenuId('DebugCreateConfiguration'); static readonly EditorContext = new MenuId('EditorContext'); static readonly SimpleEditorContext = new MenuId('SimpleEditorContext'); static readonly EditorContent = new MenuId('EditorContent'); @@ -81,6 +83,7 @@ export class MenuId { static readonly ExplorerContext = new MenuId('ExplorerContext'); static readonly ExplorerContextShare = new MenuId('ExplorerContextShare'); static readonly ExtensionContext = new MenuId('ExtensionContext'); + static readonly ExtensionEditorContextMenu = new MenuId('ExtensionEditorContextMenu'); static readonly GlobalActivity = new MenuId('GlobalActivity'); static readonly CommandCenter = new MenuId('CommandCenter'); static readonly CommandCenterCenter = new MenuId('CommandCenterCenter'); @@ -112,17 +115,7 @@ export class MenuId { static readonly OpenEditorsContextShare = new MenuId('OpenEditorsContextShare'); static readonly ProblemsPanelContext = new MenuId('ProblemsPanelContext'); static readonly SCMInputBox = new MenuId('SCMInputBox'); - static readonly SCMChangesSeparator = new MenuId('SCMChangesSeparator'); - static readonly SCMIncomingChanges = new MenuId('SCMIncomingChanges'); - static readonly SCMIncomingChangesContext = new MenuId('SCMIncomingChangesContext'); - static readonly SCMIncomingChangesSetting = new MenuId('SCMIncomingChangesSetting'); - static readonly SCMOutgoingChanges = new MenuId('SCMOutgoingChanges'); - static readonly SCMOutgoingChangesContext = new MenuId('SCMOutgoingChangesContext'); - static readonly SCMOutgoingChangesSetting = new MenuId('SCMOutgoingChangesSetting'); - static readonly SCMIncomingChangesAllChangesContext = new MenuId('SCMIncomingChangesAllChangesContext'); - static readonly SCMIncomingChangesHistoryItemContext = new MenuId('SCMIncomingChangesHistoryItemContext'); - static readonly SCMOutgoingChangesAllChangesContext = new MenuId('SCMOutgoingChangesAllChangesContext'); - static readonly SCMOutgoingChangesHistoryItemContext = new MenuId('SCMOutgoingChangesHistoryItemContext'); + static readonly SCMChangesContext = new MenuId('SCMChangesContext'); static readonly SCMChangeContext = new MenuId('SCMChangeContext'); static readonly SCMResourceContext = new MenuId('SCMResourceContext'); static readonly SCMResourceContextShare = new MenuId('SCMResourceContextShare'); @@ -131,6 +124,7 @@ export class MenuId { static readonly SCMSourceControl = new MenuId('SCMSourceControl'); static readonly SCMSourceControlInline = new MenuId('SCMSourceControlInline'); static readonly SCMSourceControlTitle = new MenuId('SCMSourceControlTitle'); + static readonly SCMHistoryTitle = new MenuId('SCMHistoryTitle'); static readonly SCMTitle = new MenuId('SCMTitle'); static readonly SearchContext = new MenuId('SearchContext'); static readonly SearchActionMenu = new MenuId('SearchActionContext'); @@ -139,10 +133,12 @@ export class MenuId { static readonly StickyScrollContext = new MenuId('StickyScrollContext'); static readonly TestItem = new MenuId('TestItem'); static readonly TestItemGutter = new MenuId('TestItemGutter'); + static readonly TestProfilesContext = new MenuId('TestProfilesContext'); static readonly TestMessageContext = new MenuId('TestMessageContext'); static readonly TestMessageContent = new MenuId('TestMessageContent'); static readonly TestPeekElement = new MenuId('TestPeekElement'); static readonly TestPeekTitle = new MenuId('TestPeekTitle'); + static readonly TestCallStack = new MenuId('TestCallStack'); static readonly TouchBarContext = new MenuId('TouchBarContext'); static readonly TitleBarContext = new MenuId('TitleBarContext'); static readonly TitleBarTitleContext = new MenuId('TitleBarTitleContext'); @@ -186,6 +182,7 @@ export class MenuId { static readonly NotebookCellExecuteGoTo = new MenuId('NotebookCellExecuteGoTo'); static readonly NotebookCellExecutePrimary = new MenuId('NotebookCellExecutePrimary'); static readonly NotebookDiffCellInputTitle = new MenuId('NotebookDiffCellInputTitle'); + static readonly NotebookDiffDocumentMetadata = new MenuId('NotebookDiffDocumentMetadata'); static readonly NotebookDiffCellMetadataTitle = new MenuId('NotebookDiffCellMetadataTitle'); static readonly NotebookDiffCellOutputsTitle = new MenuId('NotebookDiffCellOutputsTitle'); static readonly NotebookOutputToolbar = new MenuId('NotebookOutputToolbar'); @@ -221,21 +218,16 @@ export class MenuId { static readonly MergeInputResultToolbar = new MenuId('MergeToolbarResultToolbar'); static readonly InlineSuggestionToolbar = new MenuId('InlineSuggestionToolbar'); static readonly InlineEditToolbar = new MenuId('InlineEditToolbar'); - static readonly AideChatContext = new MenuId('AideChatContext'); - static readonly AideChatCodeBlock = new MenuId('AideChatCodeblock'); - static readonly AideChatCompareBlock = new MenuId('AideChatCompareBlock'); - static readonly AideChatMessageTitle = new MenuId('AideChatMessageTitle'); - static readonly AideChatExecute = new MenuId('AideChatExecute'); - static readonly AideChatExecutePrimary = new MenuId('AideChatExecutePrimary'); - static readonly AideChatExecuteSecondary = new MenuId('AideChatExecuteSecondary'); - static readonly AideChatInputSide = new MenuId('AideChatInputSide'); static readonly ChatContext = new MenuId('ChatContext'); static readonly ChatCodeBlock = new MenuId('ChatCodeblock'); static readonly ChatCompareBlock = new MenuId('ChatCompareBlock'); static readonly ChatMessageTitle = new MenuId('ChatMessageTitle'); static readonly ChatExecute = new MenuId('ChatExecute'); static readonly ChatExecuteSecondary = new MenuId('ChatExecuteSecondary'); + static readonly ChatInput = new MenuId('ChatInput'); static readonly ChatInputSide = new MenuId('ChatInputSide'); + static readonly ChatInlineResourceAnchorContext = new MenuId('ChatInlineResourceAnchorContext'); + static readonly ChatInlineSymbolAnchorContext = new MenuId('ChatInlineSymbolAnchorContext'); static readonly AccessibleView = new MenuId('AccessibleView'); static readonly MultiDiffEditorFileToolbar = new MenuId('MultiDiffEditorFileToolbar'); static readonly DiffEditorHunkToolbar = new MenuId('DiffEditorHunkToolbar'); @@ -288,6 +280,11 @@ export interface IMenu extends IDisposable { getActions(options?: IMenuActionOptions): [string, Array][]; } +export interface IMenuData { + contexts: ReadonlySet; + actions: [string, Array][]; +} + export const IMenuService = createDecorator('menuService'); export interface IMenuCreateOptions { @@ -300,6 +297,8 @@ export interface IMenuService { readonly _serviceBrand: undefined; /** + * Consider using getMenuActions if you don't need to listen to events. + * * Create a new menu for the given menu identifier. A menu sends events when it's entries * have changed (placement, enablement, checked-state). By default it does not send events for * submenu entries. That is more expensive and must be explicitly enabled with the @@ -307,6 +306,16 @@ export interface IMenuService { */ createMenu(id: MenuId, contextKeyService: IContextKeyService, options?: IMenuCreateOptions): IMenu; + /** + * Creates a new menu, gets the actions, and then disposes of the menu. + */ + getMenuActions(id: MenuId, contextKeyService: IContextKeyService, options?: IMenuActionOptions): [string, Array][]; + + /** + * Gets the names of the contexts that this menu listens on. + */ + getMenuContexts(id: MenuId): ReadonlySet; + /** * Reset **all** menu item hidden states. */ @@ -366,7 +375,7 @@ export interface IMenuRegistry { */ appendMenuItems(items: Iterable<{ id: MenuId; item: IMenuItem | ISubmenuItem }>): IDisposable; appendMenuItem(menu: MenuId, item: IMenuItem | ISubmenuItem): IDisposable; - getMenuItems(loc: MenuId): Array; + getMenuItems(loc: MenuId | undefined): Array; } export const MenuRegistry: IMenuRegistry = new class implements IMenuRegistry { @@ -422,9 +431,14 @@ export const MenuRegistry: IMenuRegistry = new class implements IMenuRegistry { return result; } - getMenuItems(id: MenuId): Array { + getMenuItems(id: MenuId | undefined): Array { let result: Array; - if (this._menuItems.has(id)) { + if (id === undefined) { + result = []; + for (const items of this._menuItems.values()) { + result.push(...items); + } + } else if (this._menuItems.has(id)) { result = [...this._menuItems.get(id)!]; } else { result = []; diff --git a/src/vs/platform/actions/common/menuResetAction.ts b/src/vs/platform/actions/common/menuResetAction.ts index 01e77dd3c56..534931a7100 100644 --- a/src/vs/platform/actions/common/menuResetAction.ts +++ b/src/vs/platform/actions/common/menuResetAction.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize2 } from 'vs/nls'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { Action2, IMenuService } from 'vs/platform/actions/common/actions'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; +import { localize2 } from '../../../nls.js'; +import { Categories } from '../../action/common/actionCommonCategories.js'; +import { Action2, IMenuService } from './actions.js'; +import { ServicesAccessor } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; export class MenuHiddenStatesReset extends Action2 { diff --git a/src/vs/platform/actions/common/menuService.ts b/src/vs/platform/actions/common/menuService.ts index 0b86c6fa107..05a7d997f35 100644 --- a/src/vs/platform/actions/common/menuService.ts +++ b/src/vs/platform/actions/common/menuService.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { DebounceEmitter, Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IMenu, IMenuActionOptions, IMenuChangeEvent, IMenuCreateOptions, IMenuItem, IMenuItemHide, IMenuService, isIMenuItem, isISubmenuItem, ISubmenuItem, MenuId, MenuItemAction, MenuRegistry, SubmenuItemAction } from 'vs/platform/actions/common/actions'; -import { ICommandAction, ILocalizedString } from 'vs/platform/action/common/action'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpression, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IAction, Separator, toAction } from 'vs/base/common/actions'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { removeFastWithoutKeepingOrder } from 'vs/base/common/arrays'; -import { localize } from 'vs/nls'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { DebounceEmitter, Emitter, Event } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { IMenu, IMenuActionOptions, IMenuChangeEvent, IMenuCreateOptions, IMenuItem, IMenuItemHide, IMenuService, isIMenuItem, isISubmenuItem, ISubmenuItem, MenuId, MenuItemAction, MenuRegistry, SubmenuItemAction } from './actions.js'; +import { ICommandAction, ILocalizedString } from '../../action/common/action.js'; +import { ICommandService } from '../../commands/common/commands.js'; +import { ContextKeyExpression, IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { IAction, Separator, toAction } from '../../../base/common/actions.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { removeFastWithoutKeepingOrder } from '../../../base/common/arrays.js'; +import { localize } from '../../../nls.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; export class MenuService implements IMenuService { @@ -34,6 +34,18 @@ export class MenuService implements IMenuService { return new MenuImpl(id, this._hiddenStates, { emitEventsForSubmenuChanges: false, eventDebounceDelay: 50, ...options }, this._commandService, this._keybindingService, contextKeyService); } + getMenuActions(id: MenuId, contextKeyService: IContextKeyService, options?: IMenuActionOptions): [string, Array][] { + const menu = new MenuImpl(id, this._hiddenStates, { emitEventsForSubmenuChanges: false, eventDebounceDelay: 50, ...options }, this._commandService, this._keybindingService, contextKeyService); + const actions = menu.getActions(options); + menu.dispose(); + return actions; + } + + getMenuContexts(id: MenuId): ReadonlySet { + const menuInfo = new MenuInfoSnapshot(id, false); + return new Set([...menuInfo.structureContextKeys, ...menuInfo.preconditionContextKeys, ...menuInfo.toggledContextKeys]); + } + resetHiddenStates(ids?: MenuId[]): void { this._hiddenStates.reset(ids); } @@ -152,24 +164,24 @@ class PersistedMenuHideState { type MenuItemGroup = [string, Array]; -class MenuInfo { - - private _menuGroups: MenuItemGroup[] = []; +class MenuInfoSnapshot { + protected _menuGroups: MenuItemGroup[] = []; + private _allMenuIds: Set = new Set(); private _structureContextKeys: Set = new Set(); private _preconditionContextKeys: Set = new Set(); private _toggledContextKeys: Set = new Set(); constructor( - private readonly _id: MenuId, - private readonly _hiddenStates: PersistedMenuHideState, - private readonly _collectContextKeysForSubmenus: boolean, - @ICommandService private readonly _commandService: ICommandService, - @IKeybindingService private readonly _keybindingService: IKeybindingService, - @IContextKeyService private readonly _contextKeyService: IContextKeyService + protected readonly _id: MenuId, + protected readonly _collectContextKeysForSubmenus: boolean, ) { this.refresh(); } + get allMenuIds(): ReadonlySet { + return this._allMenuIds; + } + get structureContextKeys(): ReadonlySet { return this._structureContextKeys; } @@ -186,14 +198,13 @@ class MenuInfo { // reset this._menuGroups.length = 0; + this._allMenuIds.clear(); this._structureContextKeys.clear(); this._preconditionContextKeys.clear(); this._toggledContextKeys.clear(); - const menuItems = MenuRegistry.getMenuItems(this._id); - + const menuItems = this._sort(MenuRegistry.getMenuItems(this._id)); let group: MenuItemGroup | undefined; - menuItems.sort(MenuInfo._compareMenuItems); for (const item of menuItems) { // group by groupId @@ -204,33 +215,65 @@ class MenuInfo { } group[1].push(item); - // keep keys for eventing - this._collectContextKeys(item); + // keep keys and submenu ids for eventing + this._collectContextKeysAndSubmenuIds(item); } + this._allMenuIds.add(this._id); + } + + protected _sort(menuItems: (IMenuItem | ISubmenuItem)[]) { + // no sorting needed in snapshot + return menuItems; } - private _collectContextKeys(item: IMenuItem | ISubmenuItem): void { + private _collectContextKeysAndSubmenuIds(item: IMenuItem | ISubmenuItem): void { - MenuInfo._fillInKbExprKeys(item.when, this._structureContextKeys); + MenuInfoSnapshot._fillInKbExprKeys(item.when, this._structureContextKeys); if (isIMenuItem(item)) { // keep precondition keys for event if applicable if (item.command.precondition) { - MenuInfo._fillInKbExprKeys(item.command.precondition, this._preconditionContextKeys); + MenuInfoSnapshot._fillInKbExprKeys(item.command.precondition, this._preconditionContextKeys); } // keep toggled keys for event if applicable if (item.command.toggled) { const toggledExpression: ContextKeyExpression = (item.command.toggled as { condition: ContextKeyExpression }).condition || item.command.toggled; - MenuInfo._fillInKbExprKeys(toggledExpression, this._toggledContextKeys); + MenuInfoSnapshot._fillInKbExprKeys(toggledExpression, this._toggledContextKeys); } } else if (this._collectContextKeysForSubmenus) { // recursively collect context keys from submenus so that this // menu fires events when context key changes affect submenus - MenuRegistry.getMenuItems(item.submenu).forEach(this._collectContextKeys, this); + MenuRegistry.getMenuItems(item.submenu).forEach(this._collectContextKeysAndSubmenuIds, this); + + this._allMenuIds.add(item.submenu); } } + private static _fillInKbExprKeys(exp: ContextKeyExpression | undefined, set: Set): void { + if (exp) { + for (const key of exp.keys()) { + set.add(key); + } + } + } + +} + +class MenuInfo extends MenuInfoSnapshot { + + constructor( + _id: MenuId, + private readonly _hiddenStates: PersistedMenuHideState, + _collectContextKeysForSubmenus: boolean, + @ICommandService private readonly _commandService: ICommandService, + @IKeybindingService private readonly _keybindingService: IKeybindingService, + @IContextKeyService private readonly _contextKeyService: IContextKeyService + ) { + super(_id, _collectContextKeysForSubmenus); + this.refresh(); + } + createActionGroups(options: IMenuActionOptions | undefined): [string, Array][] { const result: [string, Array][] = []; @@ -248,7 +291,7 @@ class MenuInfo { const menuHide = createMenuHide(this._id, isMenuItem ? item.command : item, this._hiddenStates); if (isMenuItem) { // MenuItemAction - // const menuKeybinding = createConfigureKeybindingAction(item.command.id, item.when, this._commandService, this._keybindingService); + // const menuKeybinding = createConfigureKeybindingAction(this._commandService, this._keybindingService, item.command.id, item.when); (activeActions ??= []).push(new MenuItemAction(item.command, item.alt, options, menuHide, undefined, this._contextKeyService, this._commandService)); } else { // SubmenuItemAction @@ -267,12 +310,8 @@ class MenuInfo { return result; } - private static _fillInKbExprKeys(exp: ContextKeyExpression | undefined, set: Set): void { - if (exp) { - for (const key of exp.keys()) { - set.add(key); - } - } + protected override _sort(menuItems: (IMenuItem | ISubmenuItem)[]): (IMenuItem | ISubmenuItem)[] { + return menuItems.sort(MenuInfo._compareMenuItems); } private static _compareMenuItems(a: IMenuItem | ISubmenuItem, b: IMenuItem | ISubmenuItem): number { @@ -353,8 +392,11 @@ class MenuImpl implements IMenu { }, options.eventDebounceDelay); this._disposables.add(rebuildMenuSoon); this._disposables.add(MenuRegistry.onDidChangeMenu(e => { - if (e.has(id)) { - rebuildMenuSoon.schedule(); + for (const id of this._menuInfo.allMenuIds) { + if (e.has(id)) { + rebuildMenuSoon.schedule(); + break; + } } })); @@ -442,10 +484,11 @@ function createMenuHide(menu: MenuId, command: ICommandAction | ISubmenuItem, st }; } -export function createConfigureKeybindingAction(commandId: string, when: ContextKeyExpression | undefined = undefined, commandService: ICommandService, keybindingService: IKeybindingService): IAction { +export function createConfigureKeybindingAction(commandService: ICommandService, keybindingService: IKeybindingService, commandId: string, when: ContextKeyExpression | undefined = undefined, enabled = true): IAction { return toAction({ id: `configureKeybinding/${commandId}`, label: localize('configure keybinding', "Configure Keybinding"), + enabled, run() { // Only set the when clause when there is no keybinding // It is possible that the action and the keybinding have different when clauses diff --git a/src/vs/platform/actions/test/common/menuService.test.ts b/src/vs/platform/actions/test/common/menuService.test.ts index 8a3b2c421a9..b7044f46bd5 100644 --- a/src/vs/platform/actions/test/common/menuService.test.ts +++ b/src/vs/platform/actions/test/common/menuService.test.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { generateUuid } from 'vs/base/common/uuid'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { isIMenuItem, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; -import { MenuService } from 'vs/platform/actions/common/menuService'; -import { NullCommandService } from 'vs/platform/commands/test/common/nullCommandService'; -import { MockContextKeyService, MockKeybindingService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; -import { InMemoryStorageService } from 'vs/platform/storage/common/storage'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { generateUuid } from '../../../../base/common/uuid.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { isIMenuItem, MenuId, MenuRegistry } from '../../common/actions.js'; +import { MenuService } from '../../common/menuService.js'; +import { NullCommandService } from '../../../commands/test/common/nullCommandService.js'; +import { MockContextKeyService, MockKeybindingService } from '../../../keybinding/test/common/mockKeybindingService.js'; +import { InMemoryStorageService } from '../../../storage/common/storage.js'; // --- service instances diff --git a/src/vs/platform/aiModel/common/aiModels.ts b/src/vs/platform/aiModel/common/aiModels.ts index b4271afa15a..998aa9a00ed 100644 --- a/src/vs/platform/aiModel/common/aiModels.ts +++ b/src/vs/platform/aiModel/common/aiModels.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const humanReadableModelConfigKey: Record = { 'contextLength': 'Context Length', diff --git a/src/vs/platform/assignment/common/assignment.ts b/src/vs/platform/assignment/common/assignment.ts index 8a2fe3becf7..9910b4dd370 100644 --- a/src/vs/platform/assignment/common/assignment.ts +++ b/src/vs/platform/assignment/common/assignment.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as platform from 'vs/base/common/platform'; +import * as platform from '../../../base/common/platform.js'; import type { IExperimentationFilterProvider } from 'tas-client-umd'; export const ASSIGNMENT_STORAGE_KEY = 'VSCode.ABExp.FeatureData'; diff --git a/src/vs/platform/assignment/common/assignmentService.ts b/src/vs/platform/assignment/common/assignmentService.ts index c573b727e0b..413bd60f7ff 100644 --- a/src/vs/platform/assignment/common/assignmentService.ts +++ b/src/vs/platform/assignment/common/assignmentService.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import type { IExperimentationTelemetry, ExperimentationService as TASClient, IKeyValueStorage } from 'tas-client-umd'; -import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -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'; +import { TelemetryLevel } from '../../telemetry/common/telemetry.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +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 { _serviceBrand: undefined; diff --git a/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow.ts b/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow.ts index 0c49f0ac1e6..698f5c817a6 100644 --- a/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow.ts +++ b/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import { BrowserWindow, BrowserWindowConstructorOptions, WebContents } from 'electron'; -import { isLinux, isWindows } from 'vs/base/common/platform'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStateService } from 'vs/platform/state/node/state'; -import { hasNativeTitlebar } from 'vs/platform/window/common/window'; -import { IBaseWindow, WindowMode } from 'vs/platform/window/electron-main/window'; -import { BaseWindow } from 'vs/platform/windows/electron-main/windowImpl'; +import { isLinux, isWindows } from '../../../base/common/platform.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { IStateService } from '../../state/node/state.js'; +import { hasNativeTitlebar, TitlebarStyle } from '../../window/common/window.js'; +import { IBaseWindow, WindowMode } from '../../window/electron-main/window.js'; +import { BaseWindow } from '../../windows/electron-main/windowImpl.js'; export interface IAuxiliaryWindow extends IBaseWindow { readonly parentId: number; @@ -52,7 +52,7 @@ export class AuxiliaryWindow extends BaseWindow implements IAuxiliaryWindow { return; // already disposed } - this.doTryClaimWindow(); + this.doTryClaimWindow(options); if (options && !this.stateApplied) { this.stateApplied = true; @@ -72,7 +72,7 @@ export class AuxiliaryWindow extends BaseWindow implements IAuxiliaryWindow { } } - private doTryClaimWindow(): void { + private doTryClaimWindow(options?: BrowserWindowConstructorOptions): void { if (this._win) { return; // already claimed } @@ -82,11 +82,11 @@ export class AuxiliaryWindow extends BaseWindow implements IAuxiliaryWindow { this.logService.trace('[aux window] Claimed browser window instance'); // Remember - this.setWin(window); + this.setWin(window, options); // Disable Menu window.setMenu(null); - if ((isWindows || isLinux) && hasNativeTitlebar(this.configurationService)) { + if ((isWindows || isLinux) && hasNativeTitlebar(this.configurationService, options?.titleBarStyle === 'hidden' ? TitlebarStyle.CUSTOM : undefined /* unknown */)) { window.setAutoHideMenuBar(true); // Fix for https://github.com/microsoft/vscode/issues/200615 } diff --git a/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindows.ts b/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindows.ts index f79ec6bcbce..7384c57f4f4 100644 --- a/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindows.ts +++ b/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindows.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import { BrowserWindowConstructorOptions, HandlerDetails, WebContents } from 'electron'; -import { Event } from 'vs/base/common/event'; -import { IAuxiliaryWindow } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { IAuxiliaryWindow } from './auxiliaryWindow.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IAuxiliaryWindowsMainService = createDecorator('auxiliaryWindowsMainService'); diff --git a/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindowsMainService.ts b/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindowsMainService.ts index a07b5535788..ea7abedf6f0 100644 --- a/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindowsMainService.ts +++ b/src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindowsMainService.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import { BrowserWindow, BrowserWindowConstructorOptions, HandlerDetails, WebContents, app } from 'electron'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { FileAccess } from 'vs/base/common/network'; -import { validatedIpcMain } from 'vs/base/parts/ipc/electron-main/ipcMain'; -import { AuxiliaryWindow, IAuxiliaryWindow } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow'; -import { IAuxiliaryWindowsMainService } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindows'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IWindowState, WindowMode, defaultAuxWindowState } from 'vs/platform/window/electron-main/window'; -import { WindowStateValidator, defaultBrowserWindowOptions, getLastFocused } from 'vs/platform/windows/electron-main/windows'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { FileAccess } from '../../../base/common/network.js'; +import { validatedIpcMain } from '../../../base/parts/ipc/electron-main/ipcMain.js'; +import { AuxiliaryWindow, IAuxiliaryWindow } from './auxiliaryWindow.js'; +import { IAuxiliaryWindowsMainService } from './auxiliaryWindows.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IWindowState, WindowMode, defaultAuxWindowState } from '../../window/electron-main/window.js'; +import { IDefaultBrowserWindowOptionsOverrides, WindowStateValidator, defaultBrowserWindowOptions, getLastFocused } from '../../windows/electron-main/windows.js'; export class AuxiliaryWindowsMainService extends Disposable implements IAuxiliaryWindowsMainService { @@ -88,13 +88,15 @@ export class AuxiliaryWindowsMainService extends Disposable implements IAuxiliar } createWindow(details: HandlerDetails): BrowserWindowConstructorOptions { - return this.instantiationService.invokeFunction(defaultBrowserWindowOptions, this.validateWindowState(details), { + const { state, overrides } = this.computeWindowStateAndOverrides(details); + return this.instantiationService.invokeFunction(defaultBrowserWindowOptions, state, overrides, { preload: FileAccess.asFileUri('vs/base/parts/sandbox/electron-sandbox/preload-aux.js').fsPath }); } - private validateWindowState(details: HandlerDetails): IWindowState { + private computeWindowStateAndOverrides(details: HandlerDetails): { readonly state: IWindowState; readonly overrides: IDefaultBrowserWindowOptionsOverrides } { const windowState: IWindowState = {}; + const overrides: IDefaultBrowserWindowOptionsOverrides = {}; const features = details.features.split(','); // for example: popup=yes,left=270,top=14.5,width=800,height=600 for (const feature of features) { @@ -118,6 +120,12 @@ export class AuxiliaryWindowsMainService extends Disposable implements IAuxiliar case 'window-fullscreen': windowState.mode = WindowMode.Fullscreen; break; + case 'window-disable-fullscreen': + overrides.disableFullscreen = true; + break; + case 'window-native-titlebar': + overrides.forceNativeTitlebar = true; + break; } } @@ -125,7 +133,7 @@ export class AuxiliaryWindowsMainService extends Disposable implements IAuxiliar this.logService.trace('[aux window] using window state', state); - return state; + return { state, overrides }; } registerWindow(webContents: WebContents): void { diff --git a/src/vs/platform/backup/common/backup.ts b/src/vs/platform/backup/common/backup.ts index 8185dee3040..bfae94c8c4b 100644 --- a/src/vs/platform/backup/common/backup.ts +++ b/src/vs/platform/backup/common/backup.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { URI } from '../../../base/common/uri.js'; +import { IWorkspaceIdentifier } from '../../workspace/common/workspace.js'; export interface IBaseBackupInfo { remoteAuthority?: string; diff --git a/src/vs/platform/backup/electron-main/backup.ts b/src/vs/platform/backup/electron-main/backup.ts index 81ab8756fee..7da3ae1cfb5 100644 --- a/src/vs/platform/backup/electron-main/backup.ts +++ b/src/vs/platform/backup/electron-main/backup.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IFolderBackupInfo, IWorkspaceBackupInfo } from 'vs/platform/backup/common/backup'; +import { IEmptyWindowBackupInfo } from '../node/backup.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IFolderBackupInfo, IWorkspaceBackupInfo } from '../common/backup.js'; export const IBackupMainService = createDecorator('backupMainService'); diff --git a/src/vs/platform/backup/electron-main/backupMainService.ts b/src/vs/platform/backup/electron-main/backupMainService.ts index fd7b1ae2350..36287ebc981 100644 --- a/src/vs/platform/backup/electron-main/backupMainService.ts +++ b/src/vs/platform/backup/electron-main/backupMainService.ts @@ -4,22 +4,22 @@ *--------------------------------------------------------------------------------------------*/ import { createHash } from 'crypto'; -import { isEqual } from 'vs/base/common/extpath'; -import { Schemas } from 'vs/base/common/network'; -import { join } from 'vs/base/common/path'; -import { isLinux } from 'vs/base/common/platform'; -import { extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { Promises, RimRafMode } from 'vs/base/node/pfs'; -import { IBackupMainService } from 'vs/platform/backup/electron-main/backup'; -import { ISerializedBackupWorkspaces, IEmptyWindowBackupInfo, isEmptyWindowBackupInfo, deserializeWorkspaceInfos, deserializeFolderInfos, ISerializedWorkspaceBackupInfo, ISerializedFolderBackupInfo, ISerializedEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { IStateService } from 'vs/platform/state/node/state'; -import { HotExitConfiguration, IFilesConfiguration } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IFolderBackupInfo, isFolderBackupInfo, IWorkspaceBackupInfo } from 'vs/platform/backup/common/backup'; -import { isWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { createEmptyWorkspaceIdentifier } from 'vs/platform/workspaces/node/workspaces'; +import { isEqual } from '../../../base/common/extpath.js'; +import { Schemas } from '../../../base/common/network.js'; +import { join } from '../../../base/common/path.js'; +import { isLinux } from '../../../base/common/platform.js'; +import { extUriBiasedIgnorePathCase } from '../../../base/common/resources.js'; +import { Promises, RimRafMode } from '../../../base/node/pfs.js'; +import { IBackupMainService } from './backup.js'; +import { ISerializedBackupWorkspaces, IEmptyWindowBackupInfo, isEmptyWindowBackupInfo, deserializeWorkspaceInfos, deserializeFolderInfos, ISerializedWorkspaceBackupInfo, ISerializedFolderBackupInfo, ISerializedEmptyWindowBackupInfo } from '../node/backup.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { IStateService } from '../../state/node/state.js'; +import { HotExitConfiguration, IFilesConfiguration } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { IFolderBackupInfo, isFolderBackupInfo, IWorkspaceBackupInfo } from '../common/backup.js'; +import { isWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { createEmptyWorkspaceIdentifier } from '../../workspaces/node/workspaces.js'; export class BackupMainService implements IBackupMainService { diff --git a/src/vs/platform/backup/node/backup.ts b/src/vs/platform/backup/node/backup.ts index fbe1952f68d..d26fa480267 100644 --- a/src/vs/platform/backup/node/backup.ts +++ b/src/vs/platform/backup/node/backup.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { IBaseBackupInfo, IFolderBackupInfo, IWorkspaceBackupInfo } from 'vs/platform/backup/common/backup'; +import { URI } from '../../../base/common/uri.js'; +import { IBaseBackupInfo, IFolderBackupInfo, IWorkspaceBackupInfo } from '../common/backup.js'; export interface IEmptyWindowBackupInfo extends IBaseBackupInfo { readonly backupFolder: string; diff --git a/src/vs/platform/backup/test/electron-main/backupMainService.test.ts b/src/vs/platform/backup/test/electron-main/backupMainService.test.ts index 749cfa4e6e6..640f2eb5830 100644 --- a/src/vs/platform/backup/test/electron-main/backupMainService.test.ts +++ b/src/vs/platform/backup/test/electron-main/backupMainService.test.ts @@ -7,26 +7,26 @@ import assert from 'assert'; import { createHash } from 'crypto'; import * as fs from 'fs'; import * as os from 'os'; -import { Schemas } from 'vs/base/common/network'; -import * as path from 'vs/base/common/path'; -import * as platform from 'vs/base/common/platform'; -import { isEqual } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { Promises } from 'vs/base/node/pfs'; -import { flakySuite, getRandomTestPath } from 'vs/base/test/node/testUtils'; -import { BackupMainService } from 'vs/platform/backup/electron-main/backupMainService'; -import { ISerializedBackupWorkspaces, ISerializedWorkspaceBackupInfo } from 'vs/platform/backup/node/backup'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { EnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { OPTIONS, parseArgs } from 'vs/platform/environment/node/argv'; -import { HotExitConfiguration } from 'vs/platform/files/common/files'; -import { ConsoleMainLogger } from 'vs/platform/log/common/log'; -import product from 'vs/platform/product/common/product'; -import { IFolderBackupInfo, isFolderBackupInfo, IWorkspaceBackupInfo } from 'vs/platform/backup/common/backup'; -import { IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { InMemoryTestStateMainService } from 'vs/platform/test/electron-main/workbenchTestServices'; -import { LogService } from 'vs/platform/log/common/logService'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { Schemas } from '../../../../base/common/network.js'; +import * as path from '../../../../base/common/path.js'; +import * as platform from '../../../../base/common/platform.js'; +import { isEqual } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { Promises } from '../../../../base/node/pfs.js'; +import { flakySuite, getRandomTestPath } from '../../../../base/test/node/testUtils.js'; +import { BackupMainService } from '../../electron-main/backupMainService.js'; +import { ISerializedBackupWorkspaces, ISerializedWorkspaceBackupInfo } from '../../node/backup.js'; +import { TestConfigurationService } from '../../../configuration/test/common/testConfigurationService.js'; +import { EnvironmentMainService } from '../../../environment/electron-main/environmentMainService.js'; +import { OPTIONS, parseArgs } from '../../../environment/node/argv.js'; +import { HotExitConfiguration } from '../../../files/common/files.js'; +import { ConsoleMainLogger } from '../../../log/common/log.js'; +import product from '../../../product/common/product.js'; +import { IFolderBackupInfo, isFolderBackupInfo, IWorkspaceBackupInfo } from '../../common/backup.js'; +import { IWorkspaceIdentifier } from '../../../workspace/common/workspace.js'; +import { InMemoryTestStateMainService } from '../../../test/electron-main/workbenchTestServices.js'; +import { LogService } from '../../../log/common/logService.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; flakySuite('BackupMainService', () => { @@ -131,7 +131,7 @@ flakySuite('BackupMainService', () => { environmentService = new EnvironmentMainService(parseArgs(process.argv, OPTIONS), { _serviceBrand: undefined, ...product }); - await Promises.mkdir(backupHome, { recursive: true }); + await fs.promises.mkdir(backupHome, { recursive: true }); configService = new TestConfigurationService(); stateMainService = new InMemoryTestStateMainService(); @@ -584,8 +584,8 @@ flakySuite('BackupMainService', () => { assert.strictEqual(((await service.getDirtyWorkspaces()).length), 0); try { - await Promises.mkdir(path.join(folderBackupPath, Schemas.file), { recursive: true }); - await Promises.mkdir(path.join(workspaceBackupPath, Schemas.untitled), { recursive: true }); + await fs.promises.mkdir(path.join(folderBackupPath, Schemas.file), { recursive: true }); + await fs.promises.mkdir(path.join(workspaceBackupPath, Schemas.untitled), { recursive: true }); } catch (error) { // ignore - folder might exist already } diff --git a/src/vs/platform/checksum/common/checksumService.ts b/src/vs/platform/checksum/common/checksumService.ts index 8437e9ed2e9..42a1f3e1fb5 100644 --- a/src/vs/platform/checksum/common/checksumService.ts +++ b/src/vs/platform/checksum/common/checksumService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IChecksumService = createDecorator('checksumService'); diff --git a/src/vs/platform/checksum/node/checksumService.ts b/src/vs/platform/checksum/node/checksumService.ts index 707095fde87..afd388ad77b 100644 --- a/src/vs/platform/checksum/node/checksumService.ts +++ b/src/vs/platform/checksum/node/checksumService.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import { createHash } from 'crypto'; -import { listenStream } from 'vs/base/common/stream'; -import { URI } from 'vs/base/common/uri'; -import { IChecksumService } from 'vs/platform/checksum/common/checksumService'; -import { IFileService } from 'vs/platform/files/common/files'; +import { listenStream } from '../../../base/common/stream.js'; +import { URI } from '../../../base/common/uri.js'; +import { IChecksumService } from '../common/checksumService.js'; +import { IFileService } from '../../files/common/files.js'; export class ChecksumService implements IChecksumService { diff --git a/src/vs/platform/checksum/test/node/checksumService.test.ts b/src/vs/platform/checksum/test/node/checksumService.test.ts index 5e7e71cdd7a..96f54b20dcd 100644 --- a/src/vs/platform/checksum/test/node/checksumService.test.ts +++ b/src/vs/platform/checksum/test/node/checksumService.test.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { FileAccess, Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ChecksumService } from 'vs/platform/checksum/node/checksumService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { NullLogService } from 'vs/platform/log/common/log'; +import { FileAccess, Schemas } from '../../../../base/common/network.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ChecksumService } from '../../node/checksumService.js'; +import { IFileService } from '../../../files/common/files.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { DiskFileSystemProvider } from '../../../files/node/diskFileSystemProvider.js'; +import { NullLogService } from '../../../log/common/log.js'; suite('Checksum Service', () => { diff --git a/src/vs/platform/clipboard/browser/clipboardService.ts b/src/vs/platform/clipboard/browser/clipboardService.ts index d22b7bb5bc0..32f0d34fbe6 100644 --- a/src/vs/platform/clipboard/browser/clipboardService.ts +++ b/src/vs/platform/clipboard/browser/clipboardService.ts @@ -3,17 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isSafari, isWebkitWebView } from 'vs/base/browser/browser'; -import { $, addDisposableListener, getActiveDocument, getActiveWindow, isHTMLElement, onDidRegisterWindow } from 'vs/base/browser/dom'; -import { mainWindow } from 'vs/base/browser/window'; -import { DeferredPromise } from 'vs/base/common/async'; -import { Event } from 'vs/base/common/event'; -import { hash } from 'vs/base/common/hash'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { ILogService } from 'vs/platform/log/common/log'; +import { isSafari, isWebkitWebView } from '../../../base/browser/browser.js'; +import { $, addDisposableListener, getActiveDocument, getActiveWindow, isHTMLElement, onDidRegisterWindow } from '../../../base/browser/dom.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { DeferredPromise } from '../../../base/common/async.js'; +import { Event } from '../../../base/common/event.js'; +import { hash } from '../../../base/common/hash.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { IClipboardService } from '../common/clipboardService.js'; +import { ILayoutService } from '../../layout/browser/layoutService.js'; +import { ILogService } from '../../log/common/log.js'; + +/** + * Custom mime type used for storing a list of uris in the clipboard. + * + * Requires support for custom web clipboards https://github.com/w3c/clipboard-apis/pull/175 + */ +const vscodeResourcesMime = 'application/vnd.code.resources'; export class BrowserClipboardService extends Disposable implements IClipboardService { @@ -34,7 +41,7 @@ export class BrowserClipboardService extends Disposable implements IClipboardSer // and not in the clipboard, we have to invalidate // that state when the user copies other data. this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window, disposables }) => { - disposables.add(addDisposableListener(window.document, 'copy', () => this.clearResources())); + disposables.add(addDisposableListener(window.document, 'copy', () => this.clearResourcesState())); }, { window: mainWindow, disposables: this._store })); } @@ -86,7 +93,7 @@ export class BrowserClipboardService extends Disposable implements IClipboardSer async writeText(text: string, type?: string): Promise { // Clear resources given we are writing text - this.writeResources([]); + this.clearResourcesState(); // With type: only in-memory is supported if (type) { @@ -172,8 +179,28 @@ export class BrowserClipboardService extends Disposable implements IClipboardSer private static readonly MAX_RESOURCE_STATE_SOURCE_LENGTH = 1000; async writeResources(resources: URI[]): Promise { + // Guard access to navigator.clipboard with try/catch + // as we have seen DOMExceptions in certain browsers + // due to security policies. + try { + await getActiveWindow().navigator.clipboard.write([ + new ClipboardItem({ + [`web ${vscodeResourcesMime}`]: new Blob([ + JSON.stringify(resources.map(x => x.toJSON())) + ], { + type: vscodeResourcesMime + }) + }) + ]); + + // Continue to write to the in-memory clipboard as well. + // This is needed because some browsers allow the paste but then can't read the custom resources. + } catch (error) { + // Noop + } + if (resources.length === 0) { - this.clearResources(); + this.clearResourcesState(); } else { this.resources = resources; this.resourcesStateHash = await this.computeResourcesStateHash(); @@ -181,9 +208,25 @@ export class BrowserClipboardService extends Disposable implements IClipboardSer } async readResources(): Promise { + // Guard access to navigator.clipboard with try/catch + // as we have seen DOMExceptions in certain browsers + // due to security policies. + try { + const items = await getActiveWindow().navigator.clipboard.read(); + for (const item of items) { + if (item.types.includes(`web ${vscodeResourcesMime}`)) { + const blob = await item.getType(`web ${vscodeResourcesMime}`); + const resources = (JSON.parse(await blob.text()) as URI[]).map(x => URI.from(x)); + return resources; + } + } + } catch (error) { + // Noop + } + const resourcesStateHash = await this.computeResourcesStateHash(); if (this.resourcesStateHash !== resourcesStateHash) { - this.clearResources(); // state mismatch, resources no longer valid + this.clearResourcesState(); // state mismatch, resources no longer valid } return this.resources; @@ -204,10 +247,28 @@ export class BrowserClipboardService extends Disposable implements IClipboardSer } async hasResources(): Promise { + // Guard access to navigator.clipboard with try/catch + // as we have seen DOMExceptions in certain browsers + // due to security policies. + try { + const items = await getActiveWindow().navigator.clipboard.read(); + for (const item of items) { + if (item.types.includes(`web ${vscodeResourcesMime}`)) { + return true; + } + } + } catch (error) { + // Noop + } + return this.resources.length > 0; } - private clearResources(): void { + public clearInternalState(): void { + this.clearResourcesState(); + } + + private clearResourcesState(): void { this.resources = []; this.resourcesStateHash = undefined; } diff --git a/src/vs/platform/clipboard/common/clipboardService.ts b/src/vs/platform/clipboard/common/clipboardService.ts index c4aea9f7132..510666f7f2a 100644 --- a/src/vs/platform/clipboard/common/clipboardService.ts +++ b/src/vs/platform/clipboard/common/clipboardService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IClipboardService = createDecorator('clipboardService'); @@ -46,4 +46,11 @@ export interface IClipboardService { * Find out if resources are copied to the clipboard. */ hasResources(): Promise; + + /** + * Resets the internal state of the clipboard (if any) without touching the real clipboard. + * + * Used for implementations such as web which do not always support using the real clipboard. + */ + clearInternalState?(): void; } diff --git a/src/vs/platform/clipboard/test/common/testClipboardService.ts b/src/vs/platform/clipboard/test/common/testClipboardService.ts index 0ab758a9990..9a5e4c5d1cb 100644 --- a/src/vs/platform/clipboard/test/common/testClipboardService.ts +++ b/src/vs/platform/clipboard/test/common/testClipboardService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; +import { URI } from '../../../../base/common/uri.js'; +import { IClipboardService } from '../../common/clipboardService.js'; export class TestClipboardService implements IClipboardService { diff --git a/src/vs/platform/codestoryAccount/browser/csAccount.ts b/src/vs/platform/codestoryAccount/browser/csAccount.ts index a8a2ab2ad93..4c2b9156722 100644 --- a/src/vs/platform/codestoryAccount/browser/csAccount.ts +++ b/src/vs/platform/codestoryAccount/browser/csAccount.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { Button } from 'vs/base/browser/ui/button/button'; -import { Codicon } from 'vs/base/common/codicons'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ThemeIcon } from 'vs/base/common/themables'; -import 'vs/css!./media/csAccount'; -import { CSAuthenticationSession, ICSAccountService, ICSAuthenticationService } from 'vs/platform/codestoryAccount/common/csAccount'; -import { CS_ACCOUNT_CARD_VISIBLE } from 'vs/platform/codestoryAccount/common/csAccountContextKeys'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { defaultButtonStyles } from 'vs/platform/theme/browser/defaultStyles'; +import * as dom from '../../../base/browser/dom.js'; +import { Button } from '../../../base/browser/ui/button/button.js'; +import { Codicon } from '../../../base/common/codicons.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { IContextKey, IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { ILayoutService } from '../../layout/browser/layoutService.js'; +import { INotificationService } from '../../notification/common/notification.js'; +import { defaultButtonStyles } from '../../theme/browser/defaultStyles.js'; +import { CSAuthenticationSession, ICSAccountService, ICSAuthenticationService } from '../common/csAccount.js'; +import { CS_ACCOUNT_CARD_VISIBLE } from '../common/csAccountContextKeys.js'; +import './media/csAccount.css'; const $ = dom.$; diff --git a/src/vs/platform/codestoryAccount/common/csAccount.ts b/src/vs/platform/codestoryAccount/common/csAccount.ts index f2bf663ffa1..9ceb043c376 100644 --- a/src/vs/platform/codestoryAccount/common/csAccount.ts +++ b/src/vs/platform/codestoryAccount/common/csAccount.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export interface CSAuthenticationSession { id: string; diff --git a/src/vs/platform/codestoryAccount/common/csAccountContextKeys.ts b/src/vs/platform/codestoryAccount/common/csAccountContextKeys.ts index 59fafb891db..941d237de47 100644 --- a/src/vs/platform/codestoryAccount/common/csAccountContextKeys.ts +++ b/src/vs/platform/codestoryAccount/common/csAccountContextKeys.ts @@ -3,8 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { localize } from '../../../nls.js'; +import { RawContextKey } from '../../contextkey/common/contextkey.js'; export const CS_ACCOUNT_CARD_VISIBLE = new RawContextKey('csAccountCardVisible', false, { type: 'boolean', description: localize('csAccountCardVisible', "Whether the CodeStory account card is visible") }); - diff --git a/src/vs/platform/commands/common/commands.ts b/src/vs/platform/commands/common/commands.ts index 8c76735a888..53e32c4842e 100644 --- a/src/vs/platform/commands/common/commands.ts +++ b/src/vs/platform/commands/common/commands.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Iterable } from 'vs/base/common/iterator'; -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { LinkedList } from 'vs/base/common/linkedList'; -import { TypeConstraint, validateConstraints } from 'vs/base/common/types'; -import { ILocalizedString } from 'vs/platform/action/common/action'; -import { createDecorator, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Iterable } from '../../../base/common/iterator.js'; +import { IJSONSchema } from '../../../base/common/jsonSchema.js'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { LinkedList } from '../../../base/common/linkedList.js'; +import { TypeConstraint, validateConstraints } from '../../../base/common/types.js'; +import { ILocalizedString } from '../../action/common/action.js'; +import { createDecorator, ServicesAccessor } from '../../instantiation/common/instantiation.js'; export const ICommandService = createDecorator('commandService'); diff --git a/src/vs/platform/commands/test/common/commands.test.ts b/src/vs/platform/commands/test/common/commands.test.ts index f46f8e1a6ae..8a1ca7bd053 100644 --- a/src/vs/platform/commands/test/common/commands.test.ts +++ b/src/vs/platform/commands/test/common/commands.test.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { combinedDisposable } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; +import { combinedDisposable } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { CommandsRegistry } from '../../common/commands.js'; suite('Command Tests', function () { diff --git a/src/vs/platform/commands/test/common/nullCommandService.ts b/src/vs/platform/commands/test/common/nullCommandService.ts index 8c90f77362e..52c8e6b9df0 100644 --- a/src/vs/platform/commands/test/common/nullCommandService.ts +++ b/src/vs/platform/commands/test/common/nullCommandService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICommandService } from 'vs/platform/commands/common/commands'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ICommandService } from '../../common/commands.js'; export const NullCommandService: ICommandService = { _serviceBrand: undefined, diff --git a/src/vs/platform/configuration/common/configuration.ts b/src/vs/platform/configuration/common/configuration.ts index 55982dda176..770ce0f6426 100644 --- a/src/vs/platform/configuration/common/configuration.ts +++ b/src/vs/platform/configuration/common/configuration.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import * as types from 'vs/base/common/types'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; +import { Event } from '../../../base/common/event.js'; +import * as types from '../../../base/common/types.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IWorkspaceFolder } from '../../workspace/common/workspace.js'; export const IConfigurationService = createDecorator('configurationService'); diff --git a/src/vs/platform/configuration/common/configurationModels.ts b/src/vs/platform/configuration/common/configurationModels.ts index 8b862b1c939..5b7a51dced2 100644 --- a/src/vs/platform/configuration/common/configurationModels.ts +++ b/src/vs/platform/configuration/common/configurationModels.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as arrays from 'vs/base/common/arrays'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Emitter, Event } from 'vs/base/common/event'; -import * as json from 'vs/base/common/json'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { getOrSet, ResourceMap } from 'vs/base/common/map'; -import * as objects from 'vs/base/common/objects'; -import { IExtUri } from 'vs/base/common/resources'; -import * as types from 'vs/base/common/types'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { addToValueTree, ConfigurationTarget, getConfigurationValue, IConfigurationChange, IConfigurationChangeEvent, IConfigurationCompareResult, IConfigurationData, IConfigurationModel, IConfigurationOverrides, IConfigurationUpdateOverrides, IConfigurationValue, IInspectValue, IOverrides, removeFromValueTree, toValuesTree } from 'vs/platform/configuration/common/configuration'; -import { ConfigurationScope, Extensions, IConfigurationPropertySchema, IConfigurationRegistry, overrideIdentifiersFromKey, OVERRIDE_PROPERTY_REGEX } from 'vs/platform/configuration/common/configurationRegistry'; -import { FileOperation, IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { Workspace } from 'vs/platform/workspace/common/workspace'; +import * as arrays from '../../../base/common/arrays.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import * as json from '../../../base/common/json.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { getOrSet, ResourceMap } from '../../../base/common/map.js'; +import * as objects from '../../../base/common/objects.js'; +import { IExtUri } from '../../../base/common/resources.js'; +import * as types from '../../../base/common/types.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { addToValueTree, ConfigurationTarget, getConfigurationValue, IConfigurationChange, IConfigurationChangeEvent, IConfigurationCompareResult, IConfigurationData, IConfigurationModel, IConfigurationOverrides, IConfigurationUpdateOverrides, IConfigurationValue, IInspectValue, IOverrides, removeFromValueTree, toValuesTree } from './configuration.js'; +import { ConfigurationScope, Extensions, IConfigurationPropertySchema, IConfigurationRegistry, overrideIdentifiersFromKey, OVERRIDE_PROPERTY_REGEX } from './configurationRegistry.js'; +import { FileOperation, IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { Registry } from '../../registry/common/platform.js'; +import { Workspace } from '../../workspace/common/workspace.js'; function freeze(data: T): T { return Object.isFrozen(data) ? data : objects.deepFreeze(data); @@ -279,11 +279,18 @@ export class ConfigurationModel implements IConfigurationModel { this.keys.push(key); } if (OVERRIDE_PROPERTY_REGEX.test(key)) { - this.overrides.push({ - identifiers: overrideIdentifiersFromKey(key), + const identifiers = overrideIdentifiersFromKey(key); + const override = { + identifiers, keys: Object.keys(this.contents[key]), contents: toValuesTree(this.contents[key], message => this.logService.error(message)), - }); + }; + const index = this.overrides.findIndex(o => arrays.equals(o.identifiers, identifiers)); + if (index !== -1) { + this.overrides[index] = override; + } else { + this.overrides.push(override); + } } } } diff --git a/src/vs/platform/configuration/common/configurationRegistry.ts b/src/vs/platform/configuration/common/configurationRegistry.ts index ed8e56d50c5..1d1320cf876 100644 --- a/src/vs/platform/configuration/common/configurationRegistry.ts +++ b/src/vs/platform/configuration/common/configurationRegistry.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { distinct } from 'vs/base/common/arrays'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import * as types from 'vs/base/common/types'; -import * as nls from 'vs/nls'; -import { getLanguageTagSettingPlainKey } from 'vs/platform/configuration/common/configuration'; -import { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import { PolicyName } from 'vs/platform/policy/common/policy'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { distinct } from '../../../base/common/arrays.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IJSONSchema } from '../../../base/common/jsonSchema.js'; +import * as types from '../../../base/common/types.js'; +import * as nls from '../../../nls.js'; +import { getLanguageTagSettingPlainKey } from './configuration.js'; +import { Extensions as JSONExtensions, IJSONContributionRegistry } from '../../jsonschemas/common/jsonContributionRegistry.js'; +import { PolicyName } from '../../policy/common/policy.js'; +import { Registry } from '../../registry/common/platform.js'; export enum EditPresentationTypes { Multiline = 'multilineText', @@ -70,10 +70,15 @@ export interface IConfigurationRegistry { */ deltaConfiguration(delta: IConfigurationDelta): void; + /** + * Return the registered default configurations + */ + getRegisteredDefaultConfigurations(): IConfigurationDefaults[]; + /** * Return the registered configuration defaults overrides */ - getConfigurationDefaultsOverrides(): Map; + getConfigurationDefaultsOverrides(): Map; /** * Signal that the schema of a configuration setting has changes. It is currently only supported to change enumeration values. @@ -191,6 +196,11 @@ export interface IConfigurationPropertySchema extends IJSONSchema { */ disallowSyncIgnore?: boolean; + /** + * Disallow extensions to contribute configuration default value for this setting. + */ + disallowConfigurationDefault?: boolean; + /** * Labels for enumeration items */ @@ -233,22 +243,28 @@ export interface IConfigurationNode { restrictedProperties?: string[]; } +export type ConfigurationDefaultValueSource = IExtensionInfo | Map; + export interface IConfigurationDefaults { overrides: IStringDictionary; - source?: IExtensionInfo | string; + source?: IExtensionInfo; } export type IRegisteredConfigurationPropertySchema = IConfigurationPropertySchema & { defaultDefaultValue?: any; source?: IExtensionInfo; // Source of the Property - defaultValueSource?: IExtensionInfo | string; // Source of the Default Value + defaultValueSource?: ConfigurationDefaultValueSource; // Source of the Default Value }; -export type IConfigurationDefaultOverride = { +export interface IConfigurationDefaultOverride { readonly value: any; - readonly source?: IExtensionInfo | string; // Source of the default override - readonly valuesSources?: Map; // Source of each value in default language overrides -}; + readonly source?: IExtensionInfo; // Source of the default override +} + +export interface IConfigurationDefaultOverrideValue { + readonly value: any; + readonly source?: ConfigurationDefaultValueSource; +} export const allSettings: { properties: IStringDictionary; patternProperties: IStringDictionary } = { properties: {}, patternProperties: {} }; export const applicationSettings: { properties: IStringDictionary; patternProperties: IStringDictionary } = { properties: {}, patternProperties: {} }; @@ -264,7 +280,8 @@ const contributionRegistry = Registry.as(JSONExtensio class ConfigurationRegistry implements IConfigurationRegistry { - private readonly configurationDefaultsOverrides: Map; + private readonly registeredConfigurationDefaults: IConfigurationDefaults[] = []; + private readonly configurationDefaultsOverrides: Map; private readonly defaultLanguageConfigurationOverridesNode: IConfigurationNode; private readonly configurationContributors: IConfigurationNode[]; private readonly configurationProperties: IStringDictionary; @@ -280,7 +297,7 @@ class ConfigurationRegistry implements IConfigurationRegistry { readonly onDidUpdateConfiguration = this._onDidUpdateConfiguration.event; constructor() { - this.configurationDefaultsOverrides = new Map(); + this.configurationDefaultsOverrides = new Map(); this.defaultLanguageConfigurationOverridesNode = { id: 'defaultOverrides', title: nls.localize('defaultLanguageConfigurationOverrides.title', "Default Language Configuration Overrides"), @@ -343,43 +360,47 @@ class ConfigurationRegistry implements IConfigurationRegistry { private doRegisterDefaultConfigurations(configurationDefaults: IConfigurationDefaults[], bucket: Set) { + this.registeredConfigurationDefaults.push(...configurationDefaults); + const overrideIdentifiers: string[] = []; for (const { overrides, source } of configurationDefaults) { for (const key in overrides) { bucket.add(key); + const configurationDefaultOverridesForKey = this.configurationDefaultsOverrides.get(key) + ?? this.configurationDefaultsOverrides.set(key, { configurationDefaultOverrides: [] }).get(key)!; + + const value = overrides[key]; + configurationDefaultOverridesForKey.configurationDefaultOverrides.push({ value, source }); + + // Configuration defaults for Override Identifiers if (OVERRIDE_PROPERTY_REGEX.test(key)) { - const configurationDefaultOverride = this.configurationDefaultsOverrides.get(key); - const valuesSources = configurationDefaultOverride?.valuesSources ?? new Map(); - if (source) { - for (const configuration of Object.keys(overrides[key])) { - valuesSources.set(configuration, source); - } + const newDefaultOverride = this.mergeDefaultConfigurationsForOverrideIdentifier(key, value, source, configurationDefaultOverridesForKey.configurationDefaultOverrideValue); + if (!newDefaultOverride) { + continue; } - const defaultValue = { ...(configurationDefaultOverride?.value || {}), ...overrides[key] }; - this.configurationDefaultsOverrides.set(key, { source, value: defaultValue, valuesSources }); - const plainKey = getLanguageTagSettingPlainKey(key); - const property: IRegisteredConfigurationPropertySchema = { - type: 'object', - default: defaultValue, - description: nls.localize('defaultLanguageConfiguration.description', "Configure settings to be overridden for the {0} language.", plainKey), - $ref: resourceLanguageSettingsSchemaId, - defaultDefaultValue: defaultValue, - source: types.isString(source) ? undefined : source, - defaultValueSource: source - }; + + configurationDefaultOverridesForKey.configurationDefaultOverrideValue = newDefaultOverride; + this.updateDefaultOverrideProperty(key, newDefaultOverride, source); overrideIdentifiers.push(...overrideIdentifiersFromKey(key)); - this.configurationProperties[key] = property; - this.defaultLanguageConfigurationOverridesNode.properties![key] = property; - } else { - this.configurationDefaultsOverrides.set(key, { value: overrides[key], source }); + } + + // Configuration defaults for Configuration Properties + else { + const newDefaultOverride = this.mergeDefaultConfigurationsForConfigurationProperty(key, value, source, configurationDefaultOverridesForKey.configurationDefaultOverrideValue); + if (!newDefaultOverride) { + continue; + } + + configurationDefaultOverridesForKey.configurationDefaultOverrideValue = newDefaultOverride; const property = this.configurationProperties[key]; if (property) { this.updatePropertyDefaultValue(key, property); this.updateSchema(key, property); } } + } } @@ -394,33 +415,149 @@ class ConfigurationRegistry implements IConfigurationRegistry { } private doDeregisterDefaultConfigurations(defaultConfigurations: IConfigurationDefaults[], bucket: Set): void { + for (const defaultConfiguration of defaultConfigurations) { + const index = this.registeredConfigurationDefaults.indexOf(defaultConfiguration); + if (index !== -1) { + this.registeredConfigurationDefaults.splice(index, 1); + } + } for (const { overrides, source } of defaultConfigurations) { for (const key in overrides) { - const configurationDefaultsOverride = this.configurationDefaultsOverrides.get(key); - const id = types.isString(source) ? source : source?.id; - const configurationDefaultsOverrideSourceId = types.isString(configurationDefaultsOverride?.source) ? configurationDefaultsOverride?.source : configurationDefaultsOverride?.source?.id; - if (id !== configurationDefaultsOverrideSourceId) { + const configurationDefaultOverridesForKey = this.configurationDefaultsOverrides.get(key); + if (!configurationDefaultOverridesForKey) { continue; } - bucket.add(key); - this.configurationDefaultsOverrides.delete(key); + + const index = configurationDefaultOverridesForKey.configurationDefaultOverrides + .findIndex(configurationDefaultOverride => source ? configurationDefaultOverride.source?.id === source.id : configurationDefaultOverride.value === overrides[key]); + if (index === -1) { + continue; + } + + configurationDefaultOverridesForKey.configurationDefaultOverrides.splice(index, 1); + if (configurationDefaultOverridesForKey.configurationDefaultOverrides.length === 0) { + this.configurationDefaultsOverrides.delete(key); + } + if (OVERRIDE_PROPERTY_REGEX.test(key)) { - delete this.configurationProperties[key]; - delete this.defaultLanguageConfigurationOverridesNode.properties![key]; + let configurationDefaultOverrideValue: IConfigurationDefaultOverrideValue | undefined; + for (const configurationDefaultOverride of configurationDefaultOverridesForKey.configurationDefaultOverrides) { + configurationDefaultOverrideValue = this.mergeDefaultConfigurationsForOverrideIdentifier(key, configurationDefaultOverride.value, configurationDefaultOverride.source, configurationDefaultOverrideValue); + } + if (configurationDefaultOverrideValue && !types.isEmptyObject(configurationDefaultOverrideValue.value)) { + configurationDefaultOverridesForKey.configurationDefaultOverrideValue = configurationDefaultOverrideValue; + this.updateDefaultOverrideProperty(key, configurationDefaultOverrideValue, source); + } else { + this.configurationDefaultsOverrides.delete(key); + delete this.configurationProperties[key]; + delete this.defaultLanguageConfigurationOverridesNode.properties![key]; + } } else { + let configurationDefaultOverrideValue: IConfigurationDefaultOverrideValue | undefined; + for (const configurationDefaultOverride of configurationDefaultOverridesForKey.configurationDefaultOverrides) { + configurationDefaultOverrideValue = this.mergeDefaultConfigurationsForConfigurationProperty(key, configurationDefaultOverride.value, configurationDefaultOverride.source, configurationDefaultOverrideValue); + } + configurationDefaultOverridesForKey.configurationDefaultOverrideValue = configurationDefaultOverrideValue; const property = this.configurationProperties[key]; if (property) { this.updatePropertyDefaultValue(key, property); this.updateSchema(key, property); } } + bucket.add(key); } } - this.updateOverridePropertyPatternKey(); } + private updateDefaultOverrideProperty(key: string, newDefaultOverride: IConfigurationDefaultOverrideValue, source: IExtensionInfo | undefined): void { + const property: IRegisteredConfigurationPropertySchema = { + type: 'object', + default: newDefaultOverride.value, + description: nls.localize('defaultLanguageConfiguration.description', "Configure settings to be overridden for the {0} language.", getLanguageTagSettingPlainKey(key)), + $ref: resourceLanguageSettingsSchemaId, + defaultDefaultValue: newDefaultOverride.value, + source, + defaultValueSource: source + }; + this.configurationProperties[key] = property; + this.defaultLanguageConfigurationOverridesNode.properties![key] = property; + } + + private mergeDefaultConfigurationsForOverrideIdentifier(overrideIdentifier: string, configurationValueObject: IStringDictionary, valueSource: IExtensionInfo | undefined, existingDefaultOverride: IConfigurationDefaultOverrideValue | undefined): IConfigurationDefaultOverrideValue | undefined { + const defaultValue = existingDefaultOverride?.value || {}; + const source = existingDefaultOverride?.source ?? new Map(); + + // This should not happen + if (!(source instanceof Map)) { + console.error('objectConfigurationSources is not a Map'); + return undefined; + } + + for (const propertyKey of Object.keys(configurationValueObject)) { + const propertyDefaultValue = configurationValueObject[propertyKey]; + + const isObjectSetting = types.isObject(propertyDefaultValue) && + (types.isUndefined(defaultValue[propertyKey]) || types.isObject(defaultValue[propertyKey])); + + // If the default value is an object, merge the objects and store the source of each keys + if (isObjectSetting) { + defaultValue[propertyKey] = { ...(defaultValue[propertyKey] ?? {}), ...propertyDefaultValue }; + // Track the source of each value in the object + if (valueSource) { + for (const objectKey in propertyDefaultValue) { + source.set(`${propertyKey}.${objectKey}`, valueSource); + } + } + } + + // Primitive values are overridden + else { + defaultValue[propertyKey] = propertyDefaultValue; + if (valueSource) { + source.set(propertyKey, valueSource); + } else { + source.delete(propertyKey); + } + } + } + + return { value: defaultValue, source }; + } + + private mergeDefaultConfigurationsForConfigurationProperty(propertyKey: string, value: any, valuesSource: IExtensionInfo | undefined, existingDefaultOverride: IConfigurationDefaultOverrideValue | undefined): IConfigurationDefaultOverrideValue | undefined { + const property = this.configurationProperties[propertyKey]; + const existingDefaultValue = existingDefaultOverride?.value ?? property?.defaultDefaultValue; + let source: ConfigurationDefaultValueSource | undefined = valuesSource; + + const isObjectSetting = types.isObject(value) && + ( + property !== undefined && property.type === 'object' || + property === undefined && (types.isUndefined(existingDefaultValue) || types.isObject(existingDefaultValue)) + ); + + // If the default value is an object, merge the objects and store the source of each keys + if (isObjectSetting) { + source = existingDefaultOverride?.source ?? new Map(); + + // This should not happen + if (!(source instanceof Map)) { + console.error('defaultValueSource is not a Map'); + return undefined; + } + + for (const objectKey in value) { + if (valuesSource) { + source.set(`${propertyKey}.${objectKey}`, valuesSource); + } + } + value = { ...(types.isObject(existingDefaultValue) ? existingDefaultValue : {}), ...value }; + } + + return { value, source }; + } + public deltaConfiguration(delta: IConfigurationDelta): void { // defaults: remove let defaultsOverrides = false; @@ -569,8 +706,18 @@ class ConfigurationRegistry implements IConfigurationRegistry { return this.excludedConfigurationProperties; } - getConfigurationDefaultsOverrides(): Map { - return this.configurationDefaultsOverrides; + getRegisteredDefaultConfigurations(): IConfigurationDefaults[] { + return [...this.registeredConfigurationDefaults]; + } + + getConfigurationDefaultsOverrides(): Map { + const configurationDefaultsOverrides = new Map(); + for (const [key, value] of this.configurationDefaultsOverrides) { + if (value.configurationDefaultOverrideValue) { + configurationDefaultsOverrides.set(key, value.configurationDefaultOverrideValue); + } + } + return configurationDefaultsOverrides; } private registerJSONConfiguration(configuration: IConfigurationNode) { @@ -671,9 +818,15 @@ class ConfigurationRegistry implements IConfigurationRegistry { } private updatePropertyDefaultValue(key: string, property: IRegisteredConfigurationPropertySchema): void { - const configurationdefaultOverride = this.configurationDefaultsOverrides.get(key); - let defaultValue = configurationdefaultOverride?.value; - let defaultSource = configurationdefaultOverride?.source; + const configurationdefaultOverride = this.configurationDefaultsOverrides.get(key)?.configurationDefaultOverrideValue; + let defaultValue = undefined; + let defaultSource = undefined; + if (configurationdefaultOverride + && (!property.disallowConfigurationDefault || !configurationdefaultOverride.source) // Prevent overriding the default value if the property is disallowed to be overridden by configuration defaults from extensions + ) { + defaultValue = configurationdefaultOverride.value; + defaultSource = configurationdefaultOverride.source; + } if (types.isUndefined(defaultValue)) { defaultValue = property.defaultDefaultValue; defaultSource = undefined; @@ -758,3 +911,36 @@ export function getScopes(): [string, ConfigurationScope | undefined][] { scopes.push(['task', ConfigurationScope.RESOURCE]); return scopes; } + +export function getAllConfigurationProperties(configurationNode: IConfigurationNode[]): IStringDictionary { + const result: IStringDictionary = {}; + for (const configuration of configurationNode) { + const properties = configuration.properties; + if (types.isObject(properties)) { + for (const key in properties) { + result[key] = properties[key]; + } + } + if (configuration.allOf) { + Object.assign(result, getAllConfigurationProperties(configuration.allOf)); + } + } + return result; +} + +export function parseScope(scope: string): ConfigurationScope { + switch (scope) { + case 'application': + return ConfigurationScope.APPLICATION; + case 'machine': + return ConfigurationScope.MACHINE; + case 'resource': + return ConfigurationScope.RESOURCE; + case 'machine-overridable': + return ConfigurationScope.MACHINE_OVERRIDABLE; + case 'language-overridable': + return ConfigurationScope.LANGUAGE_OVERRIDABLE; + default: + return ConfigurationScope.WINDOW; + } +} diff --git a/src/vs/platform/configuration/common/configurationService.ts b/src/vs/platform/configuration/common/configurationService.ts index 9de7cb2d650..59ce69beda6 100644 --- a/src/vs/platform/configuration/common/configurationService.ts +++ b/src/vs/platform/configuration/common/configurationService.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { distinct, equals as arrayEquals } from 'vs/base/common/arrays'; -import { Queue, RunOnceScheduler } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Emitter, Event } from 'vs/base/common/event'; -import { JSONPath, ParseError, parse } from 'vs/base/common/json'; -import { applyEdits, setProperty } from 'vs/base/common/jsonEdit'; -import { Edit, FormattingOptions } from 'vs/base/common/jsonFormatter'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { ResourceMap } from 'vs/base/common/map'; -import { equals } from 'vs/base/common/objects'; -import { OS, OperatingSystem } from 'vs/base/common/platform'; -import { extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { ConfigurationTarget, IConfigurationChange, IConfigurationChangeEvent, IConfigurationData, IConfigurationOverrides, IConfigurationService, IConfigurationUpdateOptions, IConfigurationUpdateOverrides, IConfigurationValue, isConfigurationOverrides, isConfigurationUpdateOverrides } from 'vs/platform/configuration/common/configuration'; -import { Configuration, ConfigurationChangeEvent, ConfigurationModel, UserSettings } from 'vs/platform/configuration/common/configurationModels'; -import { keyFromOverrideIdentifiers } from 'vs/platform/configuration/common/configurationRegistry'; -import { DefaultConfiguration, IPolicyConfiguration, NullPolicyConfiguration, PolicyConfiguration } from 'vs/platform/configuration/common/configurations'; -import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IPolicyService, NullPolicyService } from 'vs/platform/policy/common/policy'; +import { distinct, equals as arrayEquals } from '../../../base/common/arrays.js'; +import { Queue, RunOnceScheduler } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { JSONPath, ParseError, parse } from '../../../base/common/json.js'; +import { applyEdits, setProperty } from '../../../base/common/jsonEdit.js'; +import { Edit, FormattingOptions } from '../../../base/common/jsonFormatter.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { equals } from '../../../base/common/objects.js'; +import { OS, OperatingSystem } from '../../../base/common/platform.js'; +import { extUriBiasedIgnorePathCase } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { ConfigurationTarget, IConfigurationChange, IConfigurationChangeEvent, IConfigurationData, IConfigurationOverrides, IConfigurationService, IConfigurationUpdateOptions, IConfigurationUpdateOverrides, IConfigurationValue, isConfigurationOverrides, isConfigurationUpdateOverrides } from './configuration.js'; +import { Configuration, ConfigurationChangeEvent, ConfigurationModel, UserSettings } from './configurationModels.js'; +import { keyFromOverrideIdentifiers } from './configurationRegistry.js'; +import { DefaultConfiguration, IPolicyConfiguration, NullPolicyConfiguration, PolicyConfiguration } from './configurations.js'; +import { FileOperationError, FileOperationResult, IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { IPolicyService, NullPolicyService } from '../../policy/common/policy.js'; export class ConfigurationService extends Disposable implements IConfigurationService, IDisposable { diff --git a/src/vs/platform/configuration/common/configurations.ts b/src/vs/platform/configuration/common/configurations.ts index d6f09a4d176..a2f08f0a4c2 100644 --- a/src/vs/platform/configuration/common/configurations.ts +++ b/src/vs/platform/configuration/common/configurations.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce } from 'vs/base/common/arrays'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { equals } from 'vs/base/common/objects'; -import { isEmptyObject } from 'vs/base/common/types'; -import { ConfigurationModel } from 'vs/platform/configuration/common/configurationModels'; -import { Extensions, IConfigurationRegistry, IRegisteredConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { IPolicyService, PolicyDefinition, PolicyName, PolicyValue } from 'vs/platform/policy/common/policy'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { coalesce } from '../../../base/common/arrays.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { equals } from '../../../base/common/objects.js'; +import { isEmptyObject } from '../../../base/common/types.js'; +import { ConfigurationModel } from './configurationModels.js'; +import { Extensions, IConfigurationRegistry, IRegisteredConfigurationPropertySchema } from './configurationRegistry.js'; +import { ILogService, NullLogService } from '../../log/common/log.js'; +import { IPolicyService, PolicyDefinition, PolicyName, PolicyValue } from '../../policy/common/policy.js'; +import { Registry } from '../../registry/common/platform.js'; export class DefaultConfiguration extends Disposable { @@ -61,9 +61,9 @@ export class DefaultConfiguration extends Disposable { const defaultOverrideValue = configurationDefaultsOverrides[key]; const propertySchema = configurationProperties[key]; if (defaultOverrideValue !== undefined) { - this._configurationModel.addValue(key, defaultOverrideValue); + this._configurationModel.setValue(key, defaultOverrideValue); } else if (propertySchema) { - this._configurationModel.addValue(key, propertySchema.default); + this._configurationModel.setValue(key, propertySchema.default); } else { this._configurationModel.removeValue(key); } diff --git a/src/vs/platform/configuration/test/common/configuration.test.ts b/src/vs/platform/configuration/test/common/configuration.test.ts index 1f709cf2c0f..620e07b20f6 100644 --- a/src/vs/platform/configuration/test/common/configuration.test.ts +++ b/src/vs/platform/configuration/test/common/configuration.test.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { merge, removeFromValueTree } from 'vs/platform/configuration/common/configuration'; -import { mergeChanges } from 'vs/platform/configuration/common/configurationModels'; +import { merge, removeFromValueTree } from '../../common/configuration.js'; +import { mergeChanges } from '../../common/configurationModels.js'; suite('Configuration', () => { diff --git a/src/vs/platform/configuration/test/common/configurationModels.test.ts b/src/vs/platform/configuration/test/common/configurationModels.test.ts index ab425c4fd30..9d5ff123bd6 100644 --- a/src/vs/platform/configuration/test/common/configurationModels.test.ts +++ b/src/vs/platform/configuration/test/common/configurationModels.test.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ResourceMap } from 'vs/base/common/map'; -import { join } from 'vs/base/common/path'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Configuration, ConfigurationChangeEvent, ConfigurationModel, ConfigurationModelParser, mergeChanges } from 'vs/platform/configuration/common/configurationModels'; -import { IConfigurationRegistry, Extensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { Workspace } from 'vs/platform/workspace/test/common/testWorkspace'; +import { ResourceMap } from '../../../../base/common/map.js'; +import { join } from '../../../../base/common/path.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Configuration, ConfigurationChangeEvent, ConfigurationModel, ConfigurationModelParser, mergeChanges } from '../../common/configurationModels.js'; +import { IConfigurationRegistry, Extensions, ConfigurationScope } from '../../common/configurationRegistry.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { Registry } from '../../../registry/common/platform.js'; +import { WorkspaceFolder } from '../../../workspace/common/workspace.js'; +import { Workspace } from '../../../workspace/test/common/testWorkspace.js'; suite('ConfigurationModelParser', () => { diff --git a/src/vs/platform/configuration/test/common/configurationRegistry.test.ts b/src/vs/platform/configuration/test/common/configurationRegistry.test.ts index e2cf8972a2c..4d089e71eb8 100644 --- a/src/vs/platform/configuration/test/common/configurationRegistry.test.ts +++ b/src/vs/platform/configuration/test/common/configurationRegistry.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from '../../common/configurationRegistry.js'; +import { Registry } from '../../../registry/common/platform.js'; suite('ConfigurationRegistry', () => { @@ -14,6 +14,14 @@ suite('ConfigurationRegistry', () => { const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); + setup(() => reset()); + teardown(() => reset()); + + function reset() { + configurationRegistry.deregisterConfigurations(configurationRegistry.getConfigurations()); + configurationRegistry.deregisterDefaultConfigurations(configurationRegistry.getRegisteredDefaultConfigurations()); + } + test('configuration override', async () => { configurationRegistry.registerConfiguration({ 'id': '_test_default', @@ -31,6 +39,24 @@ suite('ConfigurationRegistry', () => { assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['[lang]'].default, { a: 2, c: 3 }); }); + test('configuration override defaults - prevent overriding default value', async () => { + configurationRegistry.registerConfiguration({ + 'id': '_test_default', + 'type': 'object', + 'properties': { + 'config.preventDefaultValueOverride': { + 'type': 'object', + default: { a: 0 }, + 'disallowConfigurationDefault': true + } + } + }); + + configurationRegistry.registerDefaultConfigurations([{ overrides: { 'config.preventDefaultValueOverride': { a: 1, b: 2 } } }]); + + assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config.preventDefaultValueOverride'].default, { a: 0 }); + }); + test('configuration override defaults - merges defaults', async () => { configurationRegistry.registerDefaultConfigurations([{ overrides: { '[lang]': { a: 1, b: 2 } } }]); configurationRegistry.registerDefaultConfigurations([{ overrides: { '[lang]': { a: 2, c: 3 } } }]); @@ -38,7 +64,7 @@ suite('ConfigurationRegistry', () => { assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['[lang]'].default, { a: 2, b: 2, c: 3 }); }); - test('configuration defaults - overrides defaults', async () => { + test('configuration defaults - merge object default overrides', async () => { configurationRegistry.registerConfiguration({ 'id': '_test_default', 'type': 'object', @@ -51,7 +77,7 @@ suite('ConfigurationRegistry', () => { configurationRegistry.registerDefaultConfigurations([{ overrides: { 'config': { a: 1, b: 2 } } }]); configurationRegistry.registerDefaultConfigurations([{ overrides: { 'config': { a: 2, c: 3 } } }]); - assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 2, c: 3 }); + assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 2, b: 2, c: 3 }); }); test('registering multiple settings with same policy', async () => { @@ -79,4 +105,88 @@ suite('ConfigurationRegistry', () => { assert.ok(actual['policy1'] !== undefined); assert.ok(actual['policy2'] === undefined); }); + + test('configuration defaults - deregister merged object default override', async () => { + configurationRegistry.registerConfiguration({ + 'id': '_test_default', + 'type': 'object', + 'properties': { + 'config': { + 'type': 'object', + } + } + }); + + const overrides1 = [{ overrides: { 'config': { a: 1, b: 2 } }, source: { id: 'source1', displayName: 'source1' } }]; + const overrides2 = [{ overrides: { 'config': { a: 2, c: 3 } }, source: { id: 'source2', displayName: 'source2' } }]; + + configurationRegistry.registerDefaultConfigurations(overrides1); + configurationRegistry.registerDefaultConfigurations(overrides2); + + assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 2, b: 2, c: 3 }); + + configurationRegistry.deregisterDefaultConfigurations(overrides2); + + assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 1, b: 2 }); + + configurationRegistry.deregisterDefaultConfigurations(overrides1); + + assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, {}); + }); + + test('configuration defaults - deregister merged object default override without source', async () => { + configurationRegistry.registerConfiguration({ + 'id': '_test_default', + 'type': 'object', + 'properties': { + 'config': { + 'type': 'object', + } + } + }); + + const overrides1 = [{ overrides: { 'config': { a: 1, b: 2 } } }]; + const overrides2 = [{ overrides: { 'config': { a: 2, c: 3 } } }]; + + configurationRegistry.registerDefaultConfigurations(overrides1); + configurationRegistry.registerDefaultConfigurations(overrides2); + + assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 2, b: 2, c: 3 }); + + configurationRegistry.deregisterDefaultConfigurations(overrides2); + + assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 1, b: 2 }); + + configurationRegistry.deregisterDefaultConfigurations(overrides1); + + assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, {}); + }); + + test('configuration defaults - deregister merged object default language overrides', async () => { + configurationRegistry.registerConfiguration({ + 'id': '_test_default', + 'type': 'object', + 'properties': { + 'config': { + 'type': 'object', + } + } + }); + + const overrides1 = [{ overrides: { '[lang]': { 'config': { a: 1, b: 2 } } }, source: { id: 'source1', displayName: 'source1' } }]; + const overrides2 = [{ overrides: { '[lang]': { 'config': { a: 2, c: 3 } } }, source: { id: 'source2', displayName: 'source2' } }]; + + configurationRegistry.registerDefaultConfigurations(overrides1); + configurationRegistry.registerDefaultConfigurations(overrides2); + + assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['[lang]'].default, { 'config': { a: 2, b: 2, c: 3 } }); + + configurationRegistry.deregisterDefaultConfigurations(overrides2); + + assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['[lang]'].default, { 'config': { a: 1, b: 2 } }); + + configurationRegistry.deregisterDefaultConfigurations(overrides1); + + assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['[lang]'], undefined); + }); }); diff --git a/src/vs/platform/configuration/test/common/configurationService.test.ts b/src/vs/platform/configuration/test/common/configurationService.test.ts index 0eff504b9bd..4e765d63efe 100644 --- a/src/vs/platform/configuration/test/common/configurationService.test.ts +++ b/src/vs/platform/configuration/test/common/configurationService.test.ts @@ -4,22 +4,22 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Event } from 'vs/base/common/event'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ConfigurationTarget, isConfigured } from 'vs/platform/configuration/common/configuration'; -import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { ConfigurationService } from 'vs/platform/configuration/common/configurationService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { InMemoryFileSystemProvider } from 'vs/platform/files/common/inMemoryFilesystemProvider'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { FilePolicyService } from 'vs/platform/policy/common/filePolicyService'; -import { NullPolicyService } from 'vs/platform/policy/common/policy'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { Event } from '../../../../base/common/event.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { URI } from '../../../../base/common/uri.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ConfigurationTarget, isConfigured } from '../../common/configuration.js'; +import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from '../../common/configurationRegistry.js'; +import { ConfigurationService } from '../../common/configurationService.js'; +import { IFileService } from '../../../files/common/files.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { InMemoryFileSystemProvider } from '../../../files/common/inMemoryFilesystemProvider.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { FilePolicyService } from '../../../policy/common/filePolicyService.js'; +import { NullPolicyService } from '../../../policy/common/policy.js'; +import { Registry } from '../../../registry/common/platform.js'; suite('ConfigurationService.test.ts', () => { diff --git a/src/vs/platform/configuration/test/common/configurations.test.ts b/src/vs/platform/configuration/test/common/configurations.test.ts index f86e6f66249..ce4b25e4620 100644 --- a/src/vs/platform/configuration/test/common/configurations.test.ts +++ b/src/vs/platform/configuration/test/common/configurations.test.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Event } from 'vs/base/common/event'; -import { equals } from 'vs/base/common/objects'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Extensions, IConfigurationNode, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { DefaultConfiguration } from 'vs/platform/configuration/common/configurations'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { Event } from '../../../../base/common/event.js'; +import { equals } from '../../../../base/common/objects.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Extensions, IConfigurationNode, IConfigurationRegistry } from '../../common/configurationRegistry.js'; +import { DefaultConfiguration } from '../../common/configurations.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { Registry } from '../../../registry/common/platform.js'; suite('DefaultConfiguration', () => { @@ -22,8 +22,7 @@ suite('DefaultConfiguration', () => { function reset() { configurationRegistry.deregisterConfigurations(configurationRegistry.getConfigurations()); - const configurationDefaultsOverrides = configurationRegistry.getConfigurationDefaultsOverrides(); - configurationRegistry.deregisterDefaultConfigurations([...configurationDefaultsOverrides.keys()].map(key => ({ extensionId: configurationDefaultsOverrides.get(key)?.source, overrides: { [key]: configurationDefaultsOverrides.get(key)?.value } }))); + configurationRegistry.deregisterDefaultConfigurations(configurationRegistry.getRegisteredDefaultConfigurations()); } test('Test registering a property before initialize', async () => { @@ -110,7 +109,7 @@ suite('DefaultConfiguration', () => { assert.ok(equals(actual.getValue('a'), { b: { c: '2' } })); assert.ok(equals(actual.contents, { 'a': { b: { c: '2' } } })); - assert.deepStrictEqual(actual.keys, ['a.b', 'a.b.c']); + assert.deepStrictEqual(actual.keys.sort(), ['a.b', 'a.b.c']); }); test('Test registering the same property again', async () => { @@ -158,7 +157,7 @@ suite('DefaultConfiguration', () => { assert.ok(equals(actual.getValue('[a]'), { 'b': true })); assert.ok(equals(actual.contents, { '[a]': { 'b': true } })); assert.ok(equals(actual.overrides, [{ contents: { 'b': true }, identifiers: ['a'], keys: ['b'] }])); - assert.deepStrictEqual(actual.keys, ['[a]']); + assert.deepStrictEqual(actual.keys.sort(), ['[a]']); assert.strictEqual(actual.getOverrideValue('b', 'a'), true); }); @@ -191,7 +190,7 @@ suite('DefaultConfiguration', () => { assert.ok(equals(actual.getValue('[a]'), { 'b': true })); assert.ok(equals(actual.contents, { 'b': false, '[a]': { 'b': true } })); assert.ok(equals(actual.overrides, [{ contents: { 'b': true }, identifiers: ['a'], keys: ['b'] }])); - assert.deepStrictEqual(actual.keys, ['b', '[a]']); + assert.deepStrictEqual(actual.keys.sort(), ['[a]', 'b']); assert.strictEqual(actual.getOverrideValue('b', 'a'), true); }); @@ -227,7 +226,7 @@ suite('DefaultConfiguration', () => { assert.ok(equals(actual.getValue('[a]'), { 'b': true })); assert.ok(equals(actual.contents, { 'b': false, '[a]': { 'b': true } })); assert.ok(equals(actual.overrides, [{ contents: { 'b': true }, identifiers: ['a'], keys: ['b'] }])); - assert.deepStrictEqual(actual.keys, ['[a]', 'b']); + assert.deepStrictEqual(actual.keys.sort(), ['[a]', 'b']); assert.strictEqual(actual.getOverrideValue('b', 'a'), true); assert.deepStrictEqual(properties, ['b']); }); @@ -263,7 +262,7 @@ suite('DefaultConfiguration', () => { assert.ok(equals(actual.getValue('[a]'), { 'b': true })); assert.ok(equals(actual.contents, { 'b': false, '[a]': { 'b': true } })); assert.ok(equals(actual.overrides, [{ contents: { 'b': true }, identifiers: ['a'], keys: ['b'] }])); - assert.deepStrictEqual(actual.keys, ['b', '[a]']); + assert.deepStrictEqual(actual.keys.sort(), ['[a]', 'b']); assert.strictEqual(actual.getOverrideValue('b', 'a'), true); assert.deepStrictEqual(properties, ['[a]']); }); @@ -299,7 +298,7 @@ suite('DefaultConfiguration', () => { assert.ok(equals(actual.getValue('[a]'), { 'b': true })); assert.ok(equals(actual.contents, { 'b': false, '[a]': { 'b': true } })); assert.ok(equals(actual.overrides, [{ contents: { 'b': true }, identifiers: ['a'], keys: ['b'] }])); - assert.deepStrictEqual(actual.keys, ['b', '[a]']); + assert.deepStrictEqual(actual.keys.sort(), ['[a]', 'b']); assert.strictEqual(actual.getOverrideValue('b', 'a'), true); }); @@ -361,4 +360,54 @@ suite('DefaultConfiguration', () => { assert.deepStrictEqual(testObject.configurationModel.keys, ['b']); assert.strictEqual(testObject.configurationModel.getOverrideValue('b', 'a'), undefined); }); + + test('Test deregistering a merged language object setting', async () => { + const testObject = disposables.add(new DefaultConfiguration(new NullLogService())); + configurationRegistry.registerConfiguration({ + 'id': 'b', + 'order': 1, + 'title': 'b', + 'type': 'object', + 'properties': { + 'b': { + 'description': 'b', + 'type': 'object', + 'default': {}, + } + } + }); + const node1 = { + overrides: { + '[a]': { + 'b': { + 'aa': '1', + 'bb': '2' + } + } + }, + source: { id: 'source1', displayName: 'source1' } + }; + + const node2 = { + overrides: { + '[a]': { + 'b': { + 'bb': '20', + 'cc': '30' + } + } + }, + source: { id: 'source2', displayName: 'source2' } + }; + configurationRegistry.registerDefaultConfigurations([node1]); + configurationRegistry.registerDefaultConfigurations([node2]); + await testObject.initialize(); + + configurationRegistry.deregisterDefaultConfigurations([node1]); + assert.ok(equals(testObject.configurationModel.getValue('[a]'), { 'b': { 'bb': '20', 'cc': '30' } })); + assert.ok(equals(testObject.configurationModel.contents, { '[a]': { 'b': { 'bb': '20', 'cc': '30' } }, 'b': {} })); + assert.ok(equals(testObject.configurationModel.overrides, [{ contents: { 'b': { 'bb': '20', 'cc': '30' } }, identifiers: ['a'], keys: ['b'] }])); + assert.deepStrictEqual(testObject.configurationModel.keys.sort(), ['[a]', 'b']); + assert.ok(equals(testObject.configurationModel.getOverrideValue('b', 'a'), { 'bb': '20', 'cc': '30' })); + }); }); diff --git a/src/vs/platform/configuration/test/common/policyConfiguration.test.ts b/src/vs/platform/configuration/test/common/policyConfiguration.test.ts index d3e44993618..44ef961ee98 100644 --- a/src/vs/platform/configuration/test/common/policyConfiguration.test.ts +++ b/src/vs/platform/configuration/test/common/policyConfiguration.test.ts @@ -4,21 +4,21 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Event } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { DefaultConfiguration, PolicyConfiguration } from 'vs/platform/configuration/common/configurations'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { InMemoryFileSystemProvider } from 'vs/platform/files/common/inMemoryFilesystemProvider'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { Extensions, IConfigurationNode, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { deepClone } from 'vs/base/common/objects'; -import { IPolicyService } from 'vs/platform/policy/common/policy'; -import { FilePolicyService } from 'vs/platform/policy/common/filePolicyService'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { Event } from '../../../../base/common/event.js'; +import { URI } from '../../../../base/common/uri.js'; +import { DefaultConfiguration, PolicyConfiguration } from '../../common/configurations.js'; +import { IFileService } from '../../../files/common/files.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { InMemoryFileSystemProvider } from '../../../files/common/inMemoryFilesystemProvider.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { Extensions, IConfigurationNode, IConfigurationRegistry } from '../../common/configurationRegistry.js'; +import { Registry } from '../../../registry/common/platform.js'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { deepClone } from '../../../../base/common/objects.js'; +import { IPolicyService } from '../../../policy/common/policy.js'; +import { FilePolicyService } from '../../../policy/common/filePolicyService.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('PolicyConfiguration', () => { diff --git a/src/vs/platform/configuration/test/common/testConfigurationService.ts b/src/vs/platform/configuration/test/common/testConfigurationService.ts index 5a826f174b2..c2e63fa4dfb 100644 --- a/src/vs/platform/configuration/test/common/testConfigurationService.ts +++ b/src/vs/platform/configuration/test/common/testConfigurationService.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { URI } from 'vs/base/common/uri'; -import { getConfigurationValue, IConfigurationChangeEvent, IConfigurationOverrides, IConfigurationService, IConfigurationValue, isConfigurationOverrides } from 'vs/platform/configuration/common/configuration'; -import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { Emitter } from '../../../../base/common/event.js'; +import { TernarySearchTree } from '../../../../base/common/ternarySearchTree.js'; +import { URI } from '../../../../base/common/uri.js'; +import { getConfigurationValue, IConfigurationChangeEvent, IConfigurationOverrides, IConfigurationService, IConfigurationValue, isConfigurationOverrides } from '../../common/configuration.js'; +import { Extensions, IConfigurationRegistry } from '../../common/configurationRegistry.js'; +import { Registry } from '../../../registry/common/platform.js'; export class TestConfigurationService implements IConfigurationService { public _serviceBrand: undefined; diff --git a/src/vs/platform/contextkey/browser/contextKeyService.ts b/src/vs/platform/contextkey/browser/contextKeyService.ts index 7329c62098d..f125af404f2 100644 --- a/src/vs/platform/contextkey/browser/contextKeyService.ts +++ b/src/vs/platform/contextkey/browser/contextKeyService.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event, PauseableEmitter } from 'vs/base/common/event'; -import { Iterable } from 'vs/base/common/iterator'; -import { Disposable, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { MarshalledObject } from 'vs/base/common/marshalling'; -import { MarshalledId } from 'vs/base/common/marshallingIds'; -import { cloneAndChange, distinct } from 'vs/base/common/objects'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyExpression, ContextKeyInfo, ContextKeyValue, IContext, IContextKey, IContextKeyChangeEvent, IContextKeyService, IContextKeyServiceTarget, IReadableSet, IScopedContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { Emitter, Event, PauseableEmitter } from '../../../base/common/event.js'; +import { Iterable } from '../../../base/common/iterator.js'; +import { Disposable, IDisposable, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { MarshalledObject } from '../../../base/common/marshalling.js'; +import { MarshalledId } from '../../../base/common/marshallingIds.js'; +import { cloneAndChange, distinct } from '../../../base/common/objects.js'; +import { TernarySearchTree } from '../../../base/common/ternarySearchTree.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { CommandsRegistry } from '../../commands/common/commands.js'; +import { ConfigurationTarget, IConfigurationService } from '../../configuration/common/configuration.js'; +import { ContextKeyExpression, ContextKeyInfo, ContextKeyValue, IContext, IContextKey, IContextKeyChangeEvent, IContextKeyService, IContextKeyServiceTarget, IReadableSet, IScopedContextKeyService, RawContextKey } from '../common/contextkey.js'; +import { ServicesAccessor } from '../../instantiation/common/instantiation.js'; const KEYBINDING_CONTEXT_ATTR = 'data-keybinding-context'; diff --git a/src/vs/platform/contextkey/common/contextkey.ts b/src/vs/platform/contextkey/common/contextkey.ts index a461dfe4fe7..ef011cc6b2c 100644 --- a/src/vs/platform/contextkey/common/contextkey.ts +++ b/src/vs/platform/contextkey/common/contextkey.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { Event } from 'vs/base/common/event'; -import { isChrome, isEdge, isFirefox, isLinux, isMacintosh, isSafari, isWeb, isWindows } from 'vs/base/common/platform'; -import { isFalsyOrWhitespace } from 'vs/base/common/strings'; -import { Scanner, LexingError, Token, TokenType } from 'vs/platform/contextkey/common/scanner'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { localize } from 'vs/nls'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { illegalArgument } from 'vs/base/common/errors'; +import { CharCode } from '../../../base/common/charCode.js'; +import { Event } from '../../../base/common/event.js'; +import { isChrome, isEdge, isFirefox, isLinux, isMacintosh, isSafari, isWeb, isWindows } from '../../../base/common/platform.js'; +import { isFalsyOrWhitespace } from '../../../base/common/strings.js'; +import { Scanner, LexingError, Token, TokenType } from './scanner.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { localize } from '../../../nls.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { illegalArgument } from '../../../base/common/errors.js'; const CONSTANT_VALUES = new Map(); CONSTANT_VALUES.set('false', false); diff --git a/src/vs/platform/contextkey/common/contextkeys.ts b/src/vs/platform/contextkey/common/contextkeys.ts index 296245b4608..c256dba0aa0 100644 --- a/src/vs/platform/contextkey/common/contextkeys.ts +++ b/src/vs/platform/contextkey/common/contextkeys.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isIOS, isLinux, isMacintosh, isMobile, isWeb, isWindows } from 'vs/base/common/platform'; -import { localize } from 'vs/nls'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { isIOS, isLinux, isMacintosh, isMobile, isWeb, isWindows } from '../../../base/common/platform.js'; +import { localize } from '../../../nls.js'; +import { RawContextKey } from './contextkey.js'; export const IsMacContext = new RawContextKey('isMac', isMacintosh, localize('isMac', "Whether the operating system is macOS")); export const IsLinuxContext = new RawContextKey('isLinux', isLinux, localize('isLinux', "Whether the operating system is Linux")); diff --git a/src/vs/platform/contextkey/common/scanner.ts b/src/vs/platform/contextkey/common/scanner.ts index 95168127c69..64dff3d76fc 100644 --- a/src/vs/platform/contextkey/common/scanner.ts +++ b/src/vs/platform/contextkey/common/scanner.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { illegalState } from 'vs/base/common/errors'; -import { localize } from 'vs/nls'; +import { CharCode } from '../../../base/common/charCode.js'; +import { illegalState } from '../../../base/common/errors.js'; +import { localize } from '../../../nls.js'; export const enum TokenType { LParen, diff --git a/src/vs/platform/contextkey/test/browser/contextkey.test.ts b/src/vs/platform/contextkey/test/browser/contextkey.test.ts index d2301c19147..53c3fc23a8f 100644 --- a/src/vs/platform/contextkey/test/browser/contextkey.test.ts +++ b/src/vs/platform/contextkey/test/browser/contextkey.test.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DeferredPromise } from 'vs/base/common/async'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { ContextKeyService, setContext } from 'vs/platform/contextkey/browser/contextKeyService'; -import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { DeferredPromise } from '../../../../base/common/async.js'; +import { URI } from '../../../../base/common/uri.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IConfigurationService } from '../../../configuration/common/configuration.js'; +import { TestConfigurationService } from '../../../configuration/test/common/testConfigurationService.js'; +import { ContextKeyService, setContext } from '../../browser/contextKeyService.js'; +import { ContextKeyExpr, IContextKeyService } from '../../common/contextkey.js'; +import { ServiceCollection } from '../../../instantiation/common/serviceCollection.js'; +import { TestInstantiationService } from '../../../instantiation/test/common/instantiationServiceMock.js'; +import { ITelemetryService } from '../../../telemetry/common/telemetry.js'; suite('ContextKeyService', () => { const testDisposables = ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/platform/contextkey/test/common/contextkey.test.ts b/src/vs/platform/contextkey/test/common/contextkey.test.ts index 2555701c1d8..514aa6d35ec 100644 --- a/src/vs/platform/contextkey/test/common/contextkey.test.ts +++ b/src/vs/platform/contextkey/test/common/contextkey.test.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ContextKeyExpr, ContextKeyExpression, implies } from 'vs/platform/contextkey/common/contextkey'; +import { isLinux, isMacintosh, isWindows } from '../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ContextKeyExpr, ContextKeyExpression, implies } from '../../common/contextkey.js'; function createContext(ctx: any) { return { diff --git a/src/vs/platform/contextkey/test/common/parser.test.ts b/src/vs/platform/contextkey/test/common/parser.test.ts index 17bfa468ec9..ad06b1f45f7 100644 --- a/src/vs/platform/contextkey/test/common/parser.test.ts +++ b/src/vs/platform/contextkey/test/common/parser.test.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Parser } from 'vs/platform/contextkey/common/contextkey'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Parser } from '../../common/contextkey.js'; function parseToStr(input: string): string { const parser = new Parser(); diff --git a/src/vs/platform/contextkey/test/common/scanner.test.ts b/src/vs/platform/contextkey/test/common/scanner.test.ts index dacbfbebbdd..ba2a42fb630 100644 --- a/src/vs/platform/contextkey/test/common/scanner.test.ts +++ b/src/vs/platform/contextkey/test/common/scanner.test.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Scanner, Token, TokenType } from 'vs/platform/contextkey/common/scanner'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Scanner, Token, TokenType } from '../../common/scanner.js'; suite('Context Key Scanner', () => { diff --git a/src/vs/platform/contextview/browser/contextMenuHandler.ts b/src/vs/platform/contextview/browser/contextMenuHandler.ts index abc08f92252..162360af93a 100644 --- a/src/vs/platform/contextview/browser/contextMenuHandler.ts +++ b/src/vs/platform/contextview/browser/contextMenuHandler.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IContextMenuDelegate } from 'vs/base/browser/contextmenu'; -import { $, addDisposableListener, EventType, getActiveElement, getWindow, isAncestor, isHTMLElement } from 'vs/base/browser/dom'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { Menu } from 'vs/base/browser/ui/menu/menu'; -import { ActionRunner, IRunEvent, WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions'; -import { isCancellationError } from 'vs/base/common/errors'; -import { combinedDisposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { defaultMenuStyles } from 'vs/platform/theme/browser/defaultStyles'; +import { IContextMenuDelegate } from '../../../base/browser/contextmenu.js'; +import { $, addDisposableListener, EventType, getActiveElement, getWindow, isAncestor, isHTMLElement } from '../../../base/browser/dom.js'; +import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js'; +import { Menu } from '../../../base/browser/ui/menu/menu.js'; +import { ActionRunner, IRunEvent, WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js'; +import { isCancellationError } from '../../../base/common/errors.js'; +import { combinedDisposable, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { IContextViewService } from './contextView.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import { INotificationService } from '../../notification/common/notification.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { defaultMenuStyles } from '../../theme/browser/defaultStyles.js'; export interface IContextMenuHandlerOptions { diff --git a/src/vs/platform/contextview/browser/contextMenuService.ts b/src/vs/platform/contextview/browser/contextMenuService.ts index 907cf9449a8..b6b7bea2bac 100644 --- a/src/vs/platform/contextview/browser/contextMenuService.ts +++ b/src/vs/platform/contextview/browser/contextMenuService.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IContextMenuDelegate } from 'vs/base/browser/contextmenu'; -import { ModifierKeyEmitter } from 'vs/base/browser/dom'; -import { IAction, Separator } from 'vs/base/common/actions'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ContextMenuHandler, IContextMenuHandlerOptions } from './contextMenuHandler'; -import { IContextMenuMenuDelegate, IContextMenuService, IContextViewService } from './contextView'; +import { IContextMenuDelegate } from '../../../base/browser/contextmenu.js'; +import { ModifierKeyEmitter } from '../../../base/browser/dom.js'; +import { IAction, Separator } from '../../../base/common/actions.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { createAndFillInContextMenuActions } from '../../actions/browser/menuEntryActionViewItem.js'; +import { IMenuService, MenuId } from '../../actions/common/actions.js'; +import { IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import { INotificationService } from '../../notification/common/notification.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { ContextMenuHandler, IContextMenuHandlerOptions } from './contextMenuHandler.js'; +import { IContextMenuMenuDelegate, IContextMenuService, IContextViewService } from './contextView.js'; export class ContextMenuService extends Disposable implements IContextMenuService { @@ -86,9 +86,8 @@ export namespace ContextMenuMenuDelegate { getActions: () => { const target: IAction[] = []; if (menuId) { - const menu = menuService.createMenu(menuId, contextKeyService ?? globalContextKeyService); - createAndFillInContextMenuActions(menu, menuActionOptions, target); - menu.dispose(); + const menu = menuService.getMenuActions(menuId, contextKeyService ?? globalContextKeyService, menuActionOptions); + createAndFillInContextMenuActions(menu, target); } if (!delegate.getActions) { return target; diff --git a/src/vs/platform/contextview/browser/contextView.ts b/src/vs/platform/contextview/browser/contextView.ts index 7bd31c59886..1b3e8b2a808 100644 --- a/src/vs/platform/contextview/browser/contextView.ts +++ b/src/vs/platform/contextview/browser/contextView.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IContextMenuDelegate } from 'vs/base/browser/contextmenu'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { AnchorAlignment, AnchorAxisAlignment, IAnchor, IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview'; -import { IAction } from 'vs/base/common/actions'; -import { Event } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IMenuActionOptions, MenuId } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IContextMenuDelegate } from '../../../base/browser/contextmenu.js'; +import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js'; +import { AnchorAlignment, AnchorAxisAlignment, IAnchor, IContextViewProvider } from '../../../base/browser/ui/contextview/contextview.js'; +import { IAction } from '../../../base/common/actions.js'; +import { Event } from '../../../base/common/event.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { IMenuActionOptions, MenuId } from '../../actions/common/actions.js'; +import { IContextKeyService } from '../../contextkey/common/contextkey.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IContextViewService = createDecorator('contextViewService'); diff --git a/src/vs/platform/contextview/browser/contextViewService.ts b/src/vs/platform/contextview/browser/contextViewService.ts index dee2144251e..4ee1349dcce 100644 --- a/src/vs/platform/contextview/browser/contextViewService.ts +++ b/src/vs/platform/contextview/browser/contextViewService.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ContextView, ContextViewDOMPosition, IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { IContextViewDelegate, IContextViewService, IOpenContextView } from './contextView'; -import { getWindow } from 'vs/base/browser/dom'; +import { ContextView, ContextViewDOMPosition, IContextViewProvider } from '../../../base/browser/ui/contextview/contextview.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { ILayoutService } from '../../layout/browser/layoutService.js'; +import { IContextViewDelegate, IContextViewService, IOpenContextView } from './contextView.js'; +import { getWindow } from '../../../base/browser/dom.js'; export class ContextViewHandler extends Disposable implements IContextViewProvider { diff --git a/src/vs/platform/cssDev/node/cssDevService.ts b/src/vs/platform/cssDev/node/cssDevService.ts new file mode 100644 index 00000000000..6c24e8e0672 --- /dev/null +++ b/src/vs/platform/cssDev/node/cssDevService.ts @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { spawn } from 'child_process'; +import { relative } from 'path'; +import { isESM } from '../../../base/common/amd.js'; +import { FileAccess } from '../../../base/common/network.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; + +export const ICSSDevelopmentService = createDecorator('ICSSDevelopmentService'); + +export interface ICSSDevelopmentService { + _serviceBrand: undefined; + isEnabled: boolean; + getCssModules(): Promise; +} + +export class CSSDevelopmentService implements ICSSDevelopmentService { + + declare _serviceBrand: undefined; + + private _cssModules?: Promise; + + constructor( + @IEnvironmentService private readonly envService: IEnvironmentService, + @ILogService private readonly logService: ILogService + ) { } + + get isEnabled(): boolean { + return !this.envService.isBuilt && isESM; + } + + getCssModules(): Promise { + this._cssModules ??= this.computeCssModules(); + return this._cssModules; + } + + private async computeCssModules(): Promise { + if (!this.isEnabled) { + return []; + } + + const rg = await import('@vscode/ripgrep'); + return await new Promise((resolve) => { + + const sw = StopWatch.create(); + + const chunks: string[][] = []; + const decoder = new TextDecoder(); + const basePath = FileAccess.asFileUri('').fsPath; + const process = spawn(rg.rgPath, ['-g', '**/*.css', '--files', '--no-ignore', basePath], {}); + + process.stdout.on('data', data => { + const chunk = decoder.decode(data, { stream: true }); + chunks.push(chunk.split('\n').filter(Boolean)); + }); + process.on('error', err => { + this.logService.error('[CSS_DEV] FAILED to compute CSS data', err); + resolve([]); + }); + process.on('close', () => { + const result = chunks.flat().map(path => relative(basePath, path).replace(/\\/g, '/')).filter(Boolean).sort(); + resolve(result); + this.logService.info(`[CSS_DEV] DONE, ${result.length} css modules (${Math.round(sw.elapsed())}ms)`); + }); + }); + } +} diff --git a/src/vs/platform/debug/common/extensionHostDebug.ts b/src/vs/platform/debug/common/extensionHostDebug.ts index a519f90d282..066da9be084 100644 --- a/src/vs/platform/debug/common/extensionHostDebug.ts +++ b/src/vs/platform/debug/common/extensionHostDebug.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IExtensionHostDebugService = createDecorator('extensionHostDebugService'); diff --git a/src/vs/platform/debug/common/extensionHostDebugIpc.ts b/src/vs/platform/debug/common/extensionHostDebugIpc.ts index a2191bc2f07..67b742e76a2 100644 --- a/src/vs/platform/debug/common/extensionHostDebugIpc.ts +++ b/src/vs/platform/debug/common/extensionHostDebugIpc.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IAttachSessionEvent, ICloseSessionEvent, IExtensionHostDebugService, IOpenExtensionWindowResult, IReloadSessionEvent, ITerminateSessionEvent } from 'vs/platform/debug/common/extensionHostDebug'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { IAttachSessionEvent, ICloseSessionEvent, IExtensionHostDebugService, IOpenExtensionWindowResult, IReloadSessionEvent, ITerminateSessionEvent } from './extensionHostDebug.js'; export class ExtensionHostDebugBroadcastChannel implements IServerChannel { diff --git a/src/vs/platform/debug/electron-main/extensionHostDebugIpc.ts b/src/vs/platform/debug/electron-main/extensionHostDebugIpc.ts index 7efb571a48c..97b95032a29 100644 --- a/src/vs/platform/debug/electron-main/extensionHostDebugIpc.ts +++ b/src/vs/platform/debug/electron-main/extensionHostDebugIpc.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import { AddressInfo, createServer } from 'net'; -import { IOpenExtensionWindowResult } from 'vs/platform/debug/common/extensionHostDebug'; -import { ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc'; -import { OPTIONS, parseArgs } from 'vs/platform/environment/node/argv'; -import { IWindowsMainService, OpenContext } from 'vs/platform/windows/electron-main/windows'; +import { IOpenExtensionWindowResult } from '../common/extensionHostDebug.js'; +import { ExtensionHostDebugBroadcastChannel } from '../common/extensionHostDebugIpc.js'; +import { OPTIONS, parseArgs } from '../../environment/node/argv.js'; +import { IWindowsMainService, OpenContext } from '../../windows/electron-main/windows.js'; export class ElectronExtensionHostDebugBroadcastChannel extends ExtensionHostDebugBroadcastChannel { diff --git a/src/vs/platform/diagnostics/common/diagnostics.ts b/src/vs/platform/diagnostics/common/diagnostics.ts index fb30b762cef..cc8a4cb379b 100644 --- a/src/vs/platform/diagnostics/common/diagnostics.ts +++ b/src/vs/platform/diagnostics/common/diagnostics.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IStringDictionary } from 'vs/base/common/collections'; -import { ProcessItem } from 'vs/base/common/processes'; -import { UriComponents } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IWorkspace } from 'vs/platform/workspace/common/workspace'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { ProcessItem } from '../../../base/common/processes.js'; +import { UriComponents } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IWorkspace } from '../../workspace/common/workspace.js'; export const ID = 'diagnosticsService'; export const IDiagnosticsService = createDecorator(ID); diff --git a/src/vs/platform/diagnostics/electron-main/diagnosticsMainService.ts b/src/vs/platform/diagnostics/electron-main/diagnosticsMainService.ts index 69506763bbb..39ef93b4509 100644 --- a/src/vs/platform/diagnostics/electron-main/diagnosticsMainService.ts +++ b/src/vs/platform/diagnostics/electron-main/diagnosticsMainService.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import { app, BrowserWindow, Event as IpcEvent } from 'electron'; -import { validatedIpcMain } from 'vs/base/parts/ipc/electron-main/ipcMain'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { URI } from 'vs/base/common/uri'; -import { IDiagnosticInfo, IDiagnosticInfoOptions, IMainProcessDiagnostics, IProcessDiagnostics, IRemoteDiagnosticError, IRemoteDiagnosticInfo, IWindowDiagnostics } from 'vs/platform/diagnostics/common/diagnostics'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ICodeWindow } from 'vs/platform/window/electron-main/window'; -import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; -import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { IWorkspacesManagementMainService } from 'vs/platform/workspaces/electron-main/workspacesManagementMainService'; -import { assertIsDefined } from 'vs/base/common/types'; -import { ILogService } from 'vs/platform/log/common/log'; -import { UtilityProcess } from 'vs/platform/utilityProcess/electron-main/utilityProcess'; +import { validatedIpcMain } from '../../../base/parts/ipc/electron-main/ipcMain.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { URI } from '../../../base/common/uri.js'; +import { IDiagnosticInfo, IDiagnosticInfoOptions, IMainProcessDiagnostics, IProcessDiagnostics, IRemoteDiagnosticError, IRemoteDiagnosticInfo, IWindowDiagnostics } from '../common/diagnostics.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ICodeWindow } from '../../window/electron-main/window.js'; +import { IWindowsMainService } from '../../windows/electron-main/windows.js'; +import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { IWorkspacesManagementMainService } from '../../workspaces/electron-main/workspacesManagementMainService.js'; +import { assertIsDefined } from '../../../base/common/types.js'; +import { ILogService } from '../../log/common/log.js'; +import { UtilityProcess } from '../../utilityProcess/electron-main/utilityProcess.js'; export const ID = 'diagnosticsMainService'; export const IDiagnosticsMainService = createDecorator(ID); diff --git a/src/vs/platform/diagnostics/electron-sandbox/diagnosticsService.ts b/src/vs/platform/diagnostics/electron-sandbox/diagnosticsService.ts index 4106c0a10df..f984d59c5bc 100644 --- a/src/vs/platform/diagnostics/electron-sandbox/diagnosticsService.ts +++ b/src/vs/platform/diagnostics/electron-sandbox/diagnosticsService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDiagnosticsService } from 'vs/platform/diagnostics/common/diagnostics'; -import { registerSharedProcessRemoteService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IDiagnosticsService } from '../common/diagnostics.js'; +import { registerSharedProcessRemoteService } from '../../ipc/electron-sandbox/services.js'; registerSharedProcessRemoteService(IDiagnosticsService, 'diagnostics'); diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts index 26a715bfc19..5f6efd51dd4 100644 --- a/src/vs/platform/diagnostics/node/diagnosticsService.ts +++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts @@ -2,23 +2,25 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ + +import * as fs from 'fs'; import * as osLib from 'os'; -import { Promises } from 'vs/base/common/async'; -import { getNodeType, parse, ParseError } from 'vs/base/common/json'; -import { Schemas } from 'vs/base/common/network'; -import { basename, join } from 'vs/base/common/path'; -import { isLinux, isWindows } from 'vs/base/common/platform'; -import { ProcessItem } from 'vs/base/common/processes'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { URI } from 'vs/base/common/uri'; -import { virtualMachineHint } from 'vs/base/node/id'; -import { IDirent, Promises as pfs } from 'vs/base/node/pfs'; -import { listProcesses } from 'vs/base/node/ps'; -import { IDiagnosticsService, IMachineInfo, IMainProcessDiagnostics, IRemoteDiagnosticError, IRemoteDiagnosticInfo, isRemoteDiagnosticError, IWorkspaceInformation, PerformanceInfo, SystemInfo, WorkspaceStatItem, WorkspaceStats } from 'vs/platform/diagnostics/common/diagnostics'; -import { ByteSize } from 'vs/platform/files/common/files'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IWorkspace } from 'vs/platform/workspace/common/workspace'; +import { Promises } from '../../../base/common/async.js'; +import { getNodeType, parse, ParseError } from '../../../base/common/json.js'; +import { Schemas } from '../../../base/common/network.js'; +import { basename, join } from '../../../base/common/path.js'; +import { isLinux, isWindows } from '../../../base/common/platform.js'; +import { ProcessItem } from '../../../base/common/processes.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { URI } from '../../../base/common/uri.js'; +import { virtualMachineHint } from '../../../base/node/id.js'; +import { IDirent, Promises as pfs } from '../../../base/node/pfs.js'; +import { listProcesses } from '../../../base/node/ps.js'; +import { IDiagnosticsService, IMachineInfo, IMainProcessDiagnostics, IRemoteDiagnosticError, IRemoteDiagnosticInfo, isRemoteDiagnosticError, IWorkspaceInformation, PerformanceInfo, SystemInfo, WorkspaceStatItem, WorkspaceStats } from '../common/diagnostics.js'; +import { ByteSize } from '../../files/common/files.js'; +import { IProductService } from '../../product/common/productService.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IWorkspace } from '../../workspace/common/workspace.js'; interface ConfigFilePatterns { tag: string; @@ -26,10 +28,10 @@ interface ConfigFilePatterns { relativePathPattern?: RegExp; } -const worksapceStatsCache = new Map>(); +const workspaceStatsCache = new Map>(); export async function collectWorkspaceStats(folder: string, filter: string[]): Promise { const cacheKey = `${folder}::${filter.join(':')}`; - const cached = worksapceStatsCache.get(cacheKey); + const cached = workspaceStatsCache.get(cacheKey); if (cached) { return cached; } @@ -53,7 +55,8 @@ export async function collectWorkspaceStats(folder: string, filter: string[]): P { tag: 'cmake', filePattern: /^.+\.cmake$/i }, { tag: 'github-actions', filePattern: /^.+\.ya?ml$/i, relativePathPattern: /^\.github(?:\/|\\)workflows$/i }, { tag: 'devcontainer.json', filePattern: /^devcontainer\.json$/i }, - { tag: 'dockerfile', filePattern: /^(dockerfile|docker\-compose\.ya?ml)$/i } + { tag: 'dockerfile', filePattern: /^(dockerfile|docker\-compose\.ya?ml)$/i }, + { tag: 'cursorrules', filePattern: /^\.cursorrules$/i }, ]; const fileTypes = new Map(); @@ -148,7 +151,7 @@ export async function collectWorkspaceStats(folder: string, filter: string[]): P }); }); - worksapceStatsCache.set(cacheKey, statsPromise); + workspaceStatsCache.set(cacheKey, statsPromise); return statsPromise; } @@ -178,7 +181,7 @@ export async function collectLaunchConfigs(folder: string): Promise(); const launchConfig = join(folder, '.vscode', 'launch.json'); - const contents = await pfs.readFile(launchConfig); + const contents = await fs.promises.readFile(launchConfig); const errors: ParseError[] = []; const json = parse(contents.toString(), errors); diff --git a/src/vs/platform/dialogs/common/dialogs.ts b/src/vs/platform/dialogs/common/dialogs.ts index cc7da713779..dc1c785356e 100644 --- a/src/vs/platform/dialogs/common/dialogs.ts +++ b/src/vs/platform/dialogs/common/dialogs.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { basename } from 'vs/base/common/resources'; -import Severity from 'vs/base/common/severity'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; -import { MessageBoxOptions } from 'vs/base/parts/sandbox/common/electronTypes'; -import { mnemonicButtonLabel } from 'vs/base/common/labels'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { deepClone } from 'vs/base/common/objects'; +import { Event } from '../../../base/common/event.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { basename } from '../../../base/common/resources.js'; +import Severity from '../../../base/common/severity.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ITelemetryData } from '../../telemetry/common/telemetry.js'; +import { MessageBoxOptions } from '../../../base/parts/sandbox/common/electronTypes.js'; +import { mnemonicButtonLabel } from '../../../base/common/labels.js'; +import { isLinux, isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { IProductService } from '../../product/common/productService.js'; +import { deepClone } from '../../../base/common/objects.js'; export interface IDialogArgs { readonly confirmArgs?: IConfirmDialogArgs; diff --git a/src/vs/platform/dialogs/electron-main/dialogMainService.ts b/src/vs/platform/dialogs/electron-main/dialogMainService.ts index bc1230a48ea..102075083af 100644 --- a/src/vs/platform/dialogs/electron-main/dialogMainService.ts +++ b/src/vs/platform/dialogs/electron-main/dialogMainService.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BrowserWindow, dialog, FileFilter, MessageBoxOptions, MessageBoxReturnValue, OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue } from 'electron'; -import { Queue } from 'vs/base/common/async'; -import { hash } from 'vs/base/common/hash'; -import { mnemonicButtonLabel } from 'vs/base/common/labels'; -import { Disposable, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { normalizeNFC } from 'vs/base/common/normalization'; -import { isMacintosh } from 'vs/base/common/platform'; -import { Promises } from 'vs/base/node/pfs'; -import { localize } from 'vs/nls'; -import { INativeOpenDialogOptions, massageMessageBoxOptions } from 'vs/platform/dialogs/common/dialogs'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { WORKSPACE_FILTER } from 'vs/platform/workspace/common/workspace'; +import electron from 'electron'; +import { Queue } from '../../../base/common/async.js'; +import { hash } from '../../../base/common/hash.js'; +import { mnemonicButtonLabel } from '../../../base/common/labels.js'; +import { Disposable, dispose, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { normalizeNFC } from '../../../base/common/normalization.js'; +import { isMacintosh } from '../../../base/common/platform.js'; +import { Promises } from '../../../base/node/pfs.js'; +import { localize } from '../../../nls.js'; +import { INativeOpenDialogOptions, massageMessageBoxOptions } from '../common/dialogs.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { WORKSPACE_FILTER } from '../../workspace/common/workspace.js'; export const IDialogMainService = createDecorator('dialogMainService'); @@ -24,14 +24,14 @@ export interface IDialogMainService { readonly _serviceBrand: undefined; - pickFileFolder(options: INativeOpenDialogOptions, window?: BrowserWindow): Promise; - pickFolder(options: INativeOpenDialogOptions, window?: BrowserWindow): Promise; - pickFile(options: INativeOpenDialogOptions, window?: BrowserWindow): Promise; - pickWorkspace(options: INativeOpenDialogOptions, window?: BrowserWindow): Promise; + pickFileFolder(options: INativeOpenDialogOptions, window?: electron.BrowserWindow): Promise; + pickFolder(options: INativeOpenDialogOptions, window?: electron.BrowserWindow): Promise; + pickFile(options: INativeOpenDialogOptions, window?: electron.BrowserWindow): Promise; + pickWorkspace(options: INativeOpenDialogOptions, window?: electron.BrowserWindow): Promise; - showMessageBox(options: MessageBoxOptions, window?: BrowserWindow): Promise; - showSaveDialog(options: SaveDialogOptions, window?: BrowserWindow): Promise; - showOpenDialog(options: OpenDialogOptions, window?: BrowserWindow): Promise; + showMessageBox(options: electron.MessageBoxOptions, window?: electron.BrowserWindow): Promise; + showSaveDialog(options: electron.SaveDialogOptions, window?: electron.BrowserWindow): Promise; + showOpenDialog(options: electron.OpenDialogOptions, window?: electron.BrowserWindow): Promise; } interface IInternalNativeOpenDialogOptions extends INativeOpenDialogOptions { @@ -40,7 +40,7 @@ interface IInternalNativeOpenDialogOptions extends INativeOpenDialogOptions { readonly title: string; readonly buttonLabel?: string; - readonly filters?: FileFilter[]; + readonly filters?: electron.FileFilter[]; } export class DialogMainService implements IDialogMainService { @@ -48,8 +48,8 @@ export class DialogMainService implements IDialogMainService { declare readonly _serviceBrand: undefined; private readonly windowFileDialogLocks = new Map>(); - private readonly windowDialogQueues = new Map>(); - private readonly noWindowDialogueQueue = new Queue(); + private readonly windowDialogQueues = new Map>(); + private readonly noWindowDialogueQueue = new Queue(); constructor( @ILogService private readonly logService: ILogService, @@ -57,19 +57,19 @@ export class DialogMainService implements IDialogMainService { ) { } - pickFileFolder(options: INativeOpenDialogOptions, window?: BrowserWindow): Promise { + pickFileFolder(options: INativeOpenDialogOptions, window?: electron.BrowserWindow): Promise { return this.doPick({ ...options, pickFolders: true, pickFiles: true, title: localize('open', "Open") }, window); } - pickFolder(options: INativeOpenDialogOptions, window?: BrowserWindow): Promise { + pickFolder(options: INativeOpenDialogOptions, window?: electron.BrowserWindow): Promise { return this.doPick({ ...options, pickFolders: true, title: localize('openFolder', "Open Folder") }, window); } - pickFile(options: INativeOpenDialogOptions, window?: BrowserWindow): Promise { + pickFile(options: INativeOpenDialogOptions, window?: electron.BrowserWindow): Promise { return this.doPick({ ...options, pickFiles: true, title: localize('openFile', "Open File") }, window); } - pickWorkspace(options: INativeOpenDialogOptions, window?: BrowserWindow): Promise { + pickWorkspace(options: INativeOpenDialogOptions, window?: electron.BrowserWindow): Promise { const title = localize('openWorkspaceTitle', "Open Workspace from File"); const buttonLabel = mnemonicButtonLabel(localize({ key: 'openWorkspace', comment: ['&& denotes a mnemonic'] }, "&&Open")); const filters = WORKSPACE_FILTER; @@ -77,10 +77,10 @@ export class DialogMainService implements IDialogMainService { return this.doPick({ ...options, pickFiles: true, title, filters, buttonLabel }, window); } - private async doPick(options: IInternalNativeOpenDialogOptions, window?: BrowserWindow): Promise { + private async doPick(options: IInternalNativeOpenDialogOptions, window?: electron.BrowserWindow): Promise { // Ensure dialog options - const dialogOptions: OpenDialogOptions = { + const dialogOptions: electron.OpenDialogOptions = { title: options.title, buttonLabel: options.buttonLabel, filters: options.filters, @@ -105,7 +105,7 @@ export class DialogMainService implements IDialogMainService { } // Show Dialog - const result = await this.showOpenDialog(dialogOptions, (window || BrowserWindow.getFocusedWindow()) ?? undefined); + const result = await this.showOpenDialog(dialogOptions, (window || electron.BrowserWindow.getFocusedWindow()) ?? undefined); if (result && result.filePaths && result.filePaths.length > 0) { return result.filePaths; } @@ -113,14 +113,14 @@ export class DialogMainService implements IDialogMainService { return undefined; } - private getWindowDialogQueue(window?: BrowserWindow): Queue { + private getWindowDialogQueue(window?: electron.BrowserWindow): Queue { // Queue message box requests per window so that one can show // after the other. if (window) { let windowDialogQueue = this.windowDialogQueues.get(window.id); if (!windowDialogQueue) { - windowDialogQueue = new Queue(); + windowDialogQueue = new Queue(); this.windowDialogQueues.set(window.id, windowDialogQueue); } @@ -130,15 +130,15 @@ export class DialogMainService implements IDialogMainService { } } - showMessageBox(rawOptions: MessageBoxOptions, window?: BrowserWindow): Promise { - return this.getWindowDialogQueue(window).queue(async () => { + showMessageBox(rawOptions: electron.MessageBoxOptions, window?: electron.BrowserWindow): Promise { + return this.getWindowDialogQueue(window).queue(async () => { const { options, buttonIndeces } = massageMessageBoxOptions(rawOptions, this.productService); - let result: MessageBoxReturnValue | undefined = undefined; + let result: electron.MessageBoxReturnValue | undefined = undefined; if (window) { - result = await dialog.showMessageBox(window, options); + result = await electron.dialog.showMessageBox(window, options); } else { - result = await dialog.showMessageBox(options); + result = await electron.dialog.showMessageBox(options); } return { @@ -148,7 +148,7 @@ export class DialogMainService implements IDialogMainService { }); } - async showSaveDialog(options: SaveDialogOptions, window?: BrowserWindow): Promise { + async showSaveDialog(options: electron.SaveDialogOptions, window?: electron.BrowserWindow): Promise { // Prevent duplicates of the same dialog queueing at the same time const fileDialogLock = this.acquireFileDialogLock(options, window); @@ -159,12 +159,12 @@ export class DialogMainService implements IDialogMainService { } try { - return await this.getWindowDialogQueue(window).queue(async () => { - let result: SaveDialogReturnValue; + return await this.getWindowDialogQueue(window).queue(async () => { + let result: electron.SaveDialogReturnValue; if (window) { - result = await dialog.showSaveDialog(window, options); + result = await electron.dialog.showSaveDialog(window, options); } else { - result = await dialog.showSaveDialog(options); + result = await electron.dialog.showSaveDialog(options); } result.filePath = this.normalizePath(result.filePath); @@ -190,7 +190,7 @@ export class DialogMainService implements IDialogMainService { return paths.map(path => this.normalizePath(path)); } - async showOpenDialog(options: OpenDialogOptions, window?: BrowserWindow): Promise { + async showOpenDialog(options: electron.OpenDialogOptions, window?: electron.BrowserWindow): Promise { // Ensure the path exists (if provided) if (options.defaultPath) { @@ -209,12 +209,12 @@ export class DialogMainService implements IDialogMainService { } try { - return await this.getWindowDialogQueue(window).queue(async () => { - let result: OpenDialogReturnValue; + return await this.getWindowDialogQueue(window).queue(async () => { + let result: electron.OpenDialogReturnValue; if (window) { - result = await dialog.showOpenDialog(window, options); + result = await electron.dialog.showOpenDialog(window, options); } else { - result = await dialog.showOpenDialog(options); + result = await electron.dialog.showOpenDialog(options); } result.filePaths = this.normalizePaths(result.filePaths); @@ -226,7 +226,7 @@ export class DialogMainService implements IDialogMainService { } } - private acquireFileDialogLock(options: SaveDialogOptions | OpenDialogOptions, window?: BrowserWindow): IDisposable | undefined { + private acquireFileDialogLock(options: electron.SaveDialogOptions | electron.OpenDialogOptions, window?: electron.BrowserWindow): IDisposable | undefined { // If no window is provided, allow as many dialogs as // needed since we consider them not modal per window diff --git a/src/vs/platform/dialogs/test/common/dialog.test.ts b/src/vs/platform/dialogs/test/common/dialog.test.ts index 1c5db7e80b8..aadd0cc9af5 100644 --- a/src/vs/platform/dialogs/test/common/dialog.test.ts +++ b/src/vs/platform/dialogs/test/common/dialog.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { deepEqual } from 'assert'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IMassagedMessageBoxOptions, massageMessageBoxOptions } from 'vs/platform/dialogs/common/dialogs'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; +import { isLinux, isMacintosh, isWindows } from '../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IMassagedMessageBoxOptions, massageMessageBoxOptions } from '../../common/dialogs.js'; +import product from '../../../product/common/product.js'; +import { IProductService } from '../../../product/common/productService.js'; suite('Dialog', () => { diff --git a/src/vs/platform/dialogs/test/common/testDialogService.ts b/src/vs/platform/dialogs/test/common/testDialogService.ts index f63897d47f0..e491fe9c6d4 100644 --- a/src/vs/platform/dialogs/test/common/testDialogService.ts +++ b/src/vs/platform/dialogs/test/common/testDialogService.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import Severity from 'vs/base/common/severity'; -import { IConfirmation, IConfirmationResult, IDialogService, IInputResult, IPrompt, IPromptBaseButton, IPromptResult, IPromptResultWithCancel, IPromptWithCustomCancel, IPromptWithDefaultCancel } from 'vs/platform/dialogs/common/dialogs'; +import { Event } from '../../../../base/common/event.js'; +import Severity from '../../../../base/common/severity.js'; +import { IConfirmation, IConfirmationResult, IDialogService, IInputResult, IPrompt, IPromptBaseButton, IPromptResult, IPromptResultWithCancel, IPromptWithCustomCancel, IPromptWithDefaultCancel } from '../../common/dialogs.js'; export class TestDialogService implements IDialogService { diff --git a/src/vs/platform/dnd/browser/dnd.ts b/src/vs/platform/dnd/browser/dnd.ts index b742b3ae448..6db161514a1 100644 --- a/src/vs/platform/dnd/browser/dnd.ts +++ b/src/vs/platform/dnd/browser/dnd.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DataTransfers } from 'vs/base/browser/dnd'; -import { mainWindow } from 'vs/base/browser/window'; -import { DragMouseEvent } from 'vs/base/browser/mouseEvent'; -import { coalesce } from 'vs/base/common/arrays'; -import { DeferredPromise } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { ResourceMap } from 'vs/base/common/map'; -import { parse } from 'vs/base/common/marshalling'; -import { Schemas } from 'vs/base/common/network'; -import { isWeb } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { IBaseTextResourceEditorInput } from 'vs/platform/editor/common/editor'; -import { HTMLFileSystemProvider } from 'vs/platform/files/browser/htmlFileSystemProvider'; -import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess'; -import { ByteSize, IFileService } from 'vs/platform/files/common/files'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { extractSelection } from 'vs/platform/opener/common/opener'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { DataTransfers } from '../../../base/browser/dnd.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { DragMouseEvent } from '../../../base/browser/mouseEvent.js'; +import { coalesce } from '../../../base/common/arrays.js'; +import { DeferredPromise } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { parse } from '../../../base/common/marshalling.js'; +import { Schemas } from '../../../base/common/network.js'; +import { isWeb } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { IDialogService } from '../../dialogs/common/dialogs.js'; +import { IBaseTextResourceEditorInput } from '../../editor/common/editor.js'; +import { HTMLFileSystemProvider } from '../../files/browser/htmlFileSystemProvider.js'; +import { WebFileSystemAccess } from '../../files/browser/webFileSystemAccess.js'; +import { ByteSize, IFileService } from '../../files/common/files.js'; +import { IInstantiationService, ServicesAccessor } from '../../instantiation/common/instantiation.js'; +import { extractSelection } from '../../opener/common/opener.js'; +import { Registry } from '../../registry/common/platform.js'; export interface FileAdditionalNativeProperties { /** diff --git a/src/vs/platform/download/common/download.ts b/src/vs/platform/download/common/download.ts index cea2b9882d5..d608e078ecb 100644 --- a/src/vs/platform/download/common/download.ts +++ b/src/vs/platform/download/common/download.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IDownloadService = createDecorator('downloadService'); diff --git a/src/vs/platform/download/common/downloadIpc.ts b/src/vs/platform/download/common/downloadIpc.ts index 3e88e8f668e..c3ba6d6c249 100644 --- a/src/vs/platform/download/common/downloadIpc.ts +++ b/src/vs/platform/download/common/downloadIpc.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IDownloadService } from 'vs/platform/download/common/download'; +import { Event } from '../../../base/common/event.js'; +import { URI } from '../../../base/common/uri.js'; +import { IURITransformer } from '../../../base/common/uriIpc.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { IDownloadService } from './download.js'; export class DownloadServiceChannel implements IServerChannel { diff --git a/src/vs/platform/download/common/downloadService.ts b/src/vs/platform/download/common/downloadService.ts index 7c8309713cf..79cedcb1668 100644 --- a/src/vs/platform/download/common/downloadService.ts +++ b/src/vs/platform/download/common/downloadService.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { IDownloadService } from 'vs/platform/download/common/download'; -import { IFileService } from 'vs/platform/files/common/files'; -import { asTextOrError, IRequestService } from 'vs/platform/request/common/request'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import { IDownloadService } from './download.js'; +import { IFileService } from '../../files/common/files.js'; +import { asTextOrError, IRequestService } from '../../request/common/request.js'; export class DownloadService implements IDownloadService { diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index 159bea6fc8e..ae3d50b2570 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; export interface IResolvableEditorModel extends IDisposable { diff --git a/src/vs/platform/encryption/common/encryptionService.ts b/src/vs/platform/encryption/common/encryptionService.ts index b36ef5724a6..94e2bfa5318 100644 --- a/src/vs/platform/encryption/common/encryptionService.ts +++ b/src/vs/platform/encryption/common/encryptionService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IEncryptionService = createDecorator('encryptionService'); export interface IEncryptionService extends ICommonEncryptionService { diff --git a/src/vs/platform/encryption/electron-main/encryptionMainService.ts b/src/vs/platform/encryption/electron-main/encryptionMainService.ts index c937778c08d..1b4b1e05f28 100644 --- a/src/vs/platform/encryption/electron-main/encryptionMainService.ts +++ b/src/vs/platform/encryption/electron-main/encryptionMainService.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import { safeStorage as safeStorageElectron, app } from 'electron'; -import { isMacintosh, isWindows } from 'vs/base/common/platform'; -import { KnownStorageProvider, IEncryptionMainService, PasswordStoreCLIOption } from 'vs/platform/encryption/common/encryptionService'; -import { ILogService } from 'vs/platform/log/common/log'; +import { isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { KnownStorageProvider, IEncryptionMainService, PasswordStoreCLIOption } from '../common/encryptionService.js'; +import { ILogService } from '../../log/common/log.js'; // These APIs are currently only supported in our custom build of electron so // we need to guard against them not being available. @@ -25,12 +25,14 @@ export class EncryptionMainService implements IEncryptionMainService { ) { // if this commandLine switch is set, the user has opted in to using basic text encryption if (app.commandLine.getSwitchValue('password-store') === PasswordStoreCLIOption.basic) { + this.logService.trace('[EncryptionMainService] setting usePlainTextEncryption to true...'); safeStorage.setUsePlainTextEncryption?.(true); + this.logService.trace('[EncryptionMainService] set usePlainTextEncryption to true'); } } async encrypt(value: string): Promise { - this.logService.trace('[EncryptionMainService] Encrypting value.'); + this.logService.trace('[EncryptionMainService] Encrypting value...'); try { const result = JSON.stringify(safeStorage.encryptString(value)); this.logService.trace('[EncryptionMainService] Encrypted value.'); @@ -50,7 +52,7 @@ export class EncryptionMainService implements IEncryptionMainService { } const bufferToDecrypt = Buffer.from(parsedValue.data); - this.logService.trace('[EncryptionMainService] Decrypting value.'); + this.logService.trace('[EncryptionMainService] Decrypting value...'); const result = safeStorage.decryptString(bufferToDecrypt); this.logService.trace('[EncryptionMainService] Decrypted value.'); return result; @@ -61,7 +63,10 @@ export class EncryptionMainService implements IEncryptionMainService { } isEncryptionAvailable(): Promise { - return Promise.resolve(safeStorage.isEncryptionAvailable()); + this.logService.trace('[EncryptionMainService] Checking if encryption is available...'); + const result = safeStorage.isEncryptionAvailable(); + this.logService.trace('[EncryptionMainService] Encryption is available: ', result); + return Promise.resolve(result); } getKeyStorageProvider(): Promise { @@ -73,7 +78,9 @@ export class EncryptionMainService implements IEncryptionMainService { } if (safeStorage.getSelectedStorageBackend) { try { + this.logService.trace('[EncryptionMainService] Getting selected storage backend...'); const result = safeStorage.getSelectedStorageBackend() as KnownStorageProvider; + this.logService.trace('[EncryptionMainService] Selected storage backend: ', result); return Promise.resolve(result); } catch (e) { this.logService.error(e); @@ -95,6 +102,8 @@ export class EncryptionMainService implements IEncryptionMainService { throw new Error('Setting plain text encryption is not supported.'); } + this.logService.trace('[EncryptionMainService] Setting usePlainTextEncryption to true...'); safeStorage.setUsePlainTextEncryption(true); + this.logService.trace('[EncryptionMainService] Set usePlainTextEncryption to true'); } } diff --git a/src/vs/platform/environment/common/environment.ts b/src/vs/platform/environment/common/environment.ts index 6c2e2b551ee..109b74c0613 100644 --- a/src/vs/platform/environment/common/environment.ts +++ b/src/vs/platform/environment/common/environment.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { createDecorator, refineServiceDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { URI } from '../../../base/common/uri.js'; +import { NativeParsedArgs } from './argv.js'; +import { createDecorator, refineServiceDecorator } from '../../instantiation/common/instantiation.js'; export const IEnvironmentService = createDecorator('environmentService'); export const INativeEnvironmentService = refineServiceDecorator(IEnvironmentService); diff --git a/src/vs/platform/environment/common/environmentService.ts b/src/vs/platform/environment/common/environmentService.ts index cd55aa9b259..1984abb76c8 100644 --- a/src/vs/platform/environment/common/environmentService.ts +++ b/src/vs/platform/environment/common/environmentService.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { toLocalISOString } from 'vs/base/common/date'; -import { memoize } from 'vs/base/common/decorators'; -import { FileAccess, Schemas } from 'vs/base/common/network'; -import { dirname, join, normalize, resolve } from 'vs/base/common/path'; -import { env } from 'vs/base/common/process'; -import { joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { ExtensionKind, IExtensionHostDebugParams, INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IProductService } from 'vs/platform/product/common/productService'; +import { toLocalISOString } from '../../../base/common/date.js'; +import { memoize } from '../../../base/common/decorators.js'; +import { FileAccess, Schemas } from '../../../base/common/network.js'; +import { dirname, join, normalize, resolve } from '../../../base/common/path.js'; +import { env } from '../../../base/common/process.js'; +import { joinPath } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { NativeParsedArgs } from './argv.js'; +import { ExtensionKind, IExtensionHostDebugParams, INativeEnvironmentService } from './environment.js'; +import { IProductService } from '../../product/common/productService.js'; export const EXTENSION_IDENTIFIER_WITH_LOG_REGEX = /^([^.]+\..+)[:=](.+)$/; diff --git a/src/vs/platform/environment/electron-main/environmentMainService.ts b/src/vs/platform/environment/electron-main/environmentMainService.ts index 748ff075783..6fe1e58d11a 100644 --- a/src/vs/platform/environment/electron-main/environmentMainService.ts +++ b/src/vs/platform/environment/electron-main/environmentMainService.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { memoize } from 'vs/base/common/decorators'; -import { join } from 'vs/base/common/path'; -import { isLinux } from 'vs/base/common/platform'; -import { createStaticIPCHandle } from 'vs/base/parts/ipc/node/ipc.net'; -import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService'; -import { refineServiceDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { memoize } from '../../../base/common/decorators.js'; +import { join } from '../../../base/common/path.js'; +import { isLinux } from '../../../base/common/platform.js'; +import { createStaticIPCHandle } from '../../../base/parts/ipc/node/ipc.net.js'; +import { IEnvironmentService, INativeEnvironmentService } from '../common/environment.js'; +import { NativeEnvironmentService } from '../node/environmentService.js'; +import { refineServiceDecorator } from '../../instantiation/common/instantiation.js'; export const IEnvironmentMainService = refineServiceDecorator(IEnvironmentService); @@ -19,9 +19,6 @@ export const IEnvironmentMainService = refineServiceDecorator = {}; - @memoize - get cachedLanguagesPath(): string { return join(this.userDataPath, 'clp'); } - @memoize get backupHome(): string { return join(this.userDataPath, 'Backups'); } diff --git a/src/vs/platform/environment/node/argv.ts b/src/vs/platform/environment/node/argv.ts index 16a942afe05..f0cec3398a7 100644 --- a/src/vs/platform/environment/node/argv.ts +++ b/src/vs/platform/environment/node/argv.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import minimist from 'minimist'; -import { isWindows } from 'vs/base/common/platform'; -import { localize } from 'vs/nls'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; +import { isWindows } from '../../../base/common/platform.js'; +import { localize } from '../../../nls.js'; +import { NativeParsedArgs } from '../common/argv.js'; /** * This code is also used by standalone cli's. Avoid adding any other dependencies. diff --git a/src/vs/platform/environment/node/argvHelper.ts b/src/vs/platform/environment/node/argvHelper.ts index a94fca911ea..eb645fc902f 100644 --- a/src/vs/platform/environment/node/argvHelper.ts +++ b/src/vs/platform/environment/node/argvHelper.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { IProcessEnvironment } from 'vs/base/common/platform'; -import { localize } from 'vs/nls'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { ErrorReporter, NATIVE_CLI_COMMANDS, OPTIONS, parseArgs } from 'vs/platform/environment/node/argv'; +import { IProcessEnvironment } from '../../../base/common/platform.js'; +import { localize } from '../../../nls.js'; +import { NativeParsedArgs } from '../common/argv.js'; +import { ErrorReporter, NATIVE_CLI_COMMANDS, OPTIONS, parseArgs } from './argv.js'; function parseAndValidate(cmdLineArgs: string[], reportWarnings: boolean): NativeParsedArgs { const onMultipleValues = (id: string, val: string) => { diff --git a/src/vs/platform/environment/node/environmentService.ts b/src/vs/platform/environment/node/environmentService.ts index c3812e86b38..ae9e7e1d477 100644 --- a/src/vs/platform/environment/node/environmentService.ts +++ b/src/vs/platform/environment/node/environmentService.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { homedir, tmpdir } from 'os'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { IDebugParams } from 'vs/platform/environment/common/environment'; -import { AbstractNativeEnvironmentService, parseDebugParams } from 'vs/platform/environment/common/environmentService'; -import { getUserDataPath } from 'vs/platform/environment/node/userDataPath'; -import { IProductService } from 'vs/platform/product/common/productService'; +import { NativeParsedArgs } from '../common/argv.js'; +import { IDebugParams } from '../common/environment.js'; +import { AbstractNativeEnvironmentService, parseDebugParams } from '../common/environmentService.js'; +import { getUserDataPath } from './userDataPath.js'; +import { IProductService } from '../../product/common/productService.js'; export class NativeEnvironmentService extends AbstractNativeEnvironmentService { diff --git a/src/vs/platform/environment/node/stdin.ts b/src/vs/platform/environment/node/stdin.ts index 56ab151407d..b0e0cd60c64 100644 --- a/src/vs/platform/environment/node/stdin.ts +++ b/src/vs/platform/environment/node/stdin.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'fs'; import { tmpdir } from 'os'; -import { Queue } from 'vs/base/common/async'; -import { randomPath } from 'vs/base/common/extpath'; -import { Promises } from 'vs/base/node/pfs'; -import { resolveTerminalEncoding } from 'vs/base/node/terminalEncoding'; +import { Queue } from '../../../base/common/async.js'; +import { randomPath } from '../../../base/common/extpath.js'; +import { resolveTerminalEncoding } from '../../../base/node/terminalEncoding.js'; export function hasStdinWithoutTty() { try { @@ -43,7 +43,7 @@ export async function readFromStdin(targetPath: string, verbose: boolean, onEnd? let [encoding, iconv] = await Promise.all([ resolveTerminalEncoding(verbose), // respect terminal encoding when piping into file import('@vscode/iconv-lite-umd'), // lazy load encoding module for usage - Promises.appendFile(targetPath, '') // make sure file exists right away (https://github.com/microsoft/vscode/issues/155341) + fs.promises.appendFile(targetPath, '') // make sure file exists right away (https://github.com/microsoft/vscode/issues/155341) ]); if (!iconv.encodingExists(encoding)) { @@ -63,7 +63,7 @@ export async function readFromStdin(targetPath: string, verbose: boolean, onEnd? process.stdin.on('data', chunk => { const chunkStr = decoder.write(chunk); - appendFileQueue.queue(() => Promises.appendFile(targetPath, chunkStr)); + appendFileQueue.queue(() => fs.promises.appendFile(targetPath, chunkStr)); }); process.stdin.on('end', () => { @@ -72,7 +72,7 @@ export async function readFromStdin(targetPath: string, verbose: boolean, onEnd? appendFileQueue.queue(async () => { try { if (typeof end === 'string') { - await Promises.appendFile(targetPath, end); + await fs.promises.appendFile(targetPath, end); } } finally { onEnd?.(); diff --git a/src/vs/platform/environment/node/userDataPath.js b/src/vs/platform/environment/node/userDataPath.js index 1e89f1fee06..fb023fff3c7 100644 --- a/src/vs/platform/environment/node/userDataPath.js +++ b/src/vs/platform/environment/node/userDataPath.js @@ -6,8 +6,23 @@ /// //@ts-check +'use strict'; + +// ESM-uncomment-begin +import * as os from 'os'; +import * as path from 'path'; + +/** @type any */ +const module = { exports: {} }; +// ESM-uncomment-end + (function () { - 'use strict'; + // ESM-comment-begin + // const isESM = false; + // ESM-comment-end + // ESM-uncomment-begin + const isESM = true; + // ESM-uncomment-end /** * @import { NativeParsedArgs } from '../../environment/common/argv' @@ -108,7 +123,7 @@ }; } - if (typeof define === 'function') { + if (!isESM && typeof define === 'function') { define(['path', 'os', 'vs/base/common/process'], function ( /** @type {typeof import('path')} */ path, /** @type {typeof import('os')} */ os, @@ -117,11 +132,17 @@ return factory(path, os, process.cwd()); // amd }); } else if (typeof module === 'object' && typeof module.exports === 'object') { - const path = require('path'); - const os = require('os'); + // ESM-comment-begin + // const path = require('path'); + // const os = require('os'); + // ESM-comment-end module.exports = factory(path, os, process.env['VSCODE_CWD'] || process.cwd()); // commonjs } else { throw new Error('Unknown context'); } }()); + +// ESM-uncomment-begin +export const getUserDataPath = module.exports.getUserDataPath; +// ESM-uncomment-end diff --git a/src/vs/platform/environment/node/wait.ts b/src/vs/platform/environment/node/wait.ts index 793d8e0467e..e00acbb9ae5 100644 --- a/src/vs/platform/environment/node/wait.ts +++ b/src/vs/platform/environment/node/wait.ts @@ -5,7 +5,7 @@ import { writeFileSync } from 'fs'; import { tmpdir } from 'os'; -import { randomPath } from 'vs/base/common/extpath'; +import { randomPath } from '../../../base/common/extpath.js'; export function createWaitMarkerFileSync(verbose?: boolean): string | undefined { const randomWaitMarkerPath = randomPath(tmpdir()); diff --git a/src/vs/platform/environment/test/electron-main/environmentMainService.test.ts b/src/vs/platform/environment/test/electron-main/environmentMainService.test.ts index 268f5ce52bb..55d0cf798bf 100644 --- a/src/vs/platform/environment/test/electron-main/environmentMainService.test.ts +++ b/src/vs/platform/environment/test/electron-main/environmentMainService.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { EnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import product from 'vs/platform/product/common/product'; -import { isLinux } from 'vs/base/common/platform'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { EnvironmentMainService } from '../../electron-main/environmentMainService.js'; +import product from '../../../product/common/product.js'; +import { isLinux } from '../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('EnvironmentMainService', () => { diff --git a/src/vs/platform/environment/test/node/argv.test.ts b/src/vs/platform/environment/test/node/argv.test.ts index a82be9607d0..f5fd600d20f 100644 --- a/src/vs/platform/environment/test/node/argv.test.ts +++ b/src/vs/platform/environment/test/node/argv.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { formatOptions, Option, OptionDescriptions, Subcommand, parseArgs, ErrorReporter } from 'vs/platform/environment/node/argv'; -import { addArg } from 'vs/platform/environment/node/argvHelper'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { formatOptions, Option, OptionDescriptions, Subcommand, parseArgs, ErrorReporter } from '../../node/argv.js'; +import { addArg } from '../../node/argvHelper.js'; function o(description: string, type: 'boolean' | 'string' | 'string[]' = 'string'): Option { return { diff --git a/src/vs/platform/environment/test/node/environmentService.test.ts b/src/vs/platform/environment/test/node/environmentService.test.ts index 6f256621040..b27a76073f4 100644 --- a/src/vs/platform/environment/test/node/environmentService.test.ts +++ b/src/vs/platform/environment/test/node/environmentService.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { parseExtensionHostDebugPort } from 'vs/platform/environment/common/environmentService'; -import { OPTIONS, parseArgs } from 'vs/platform/environment/node/argv'; -import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService'; -import product from 'vs/platform/product/common/product'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { parseExtensionHostDebugPort } from '../../common/environmentService.js'; +import { OPTIONS, parseArgs } from '../../node/argv.js'; +import { NativeEnvironmentService } from '../../node/environmentService.js'; +import product from '../../../product/common/product.js'; suite('EnvironmentService', () => { diff --git a/src/vs/platform/environment/test/node/nativeModules.integrationTest.ts b/src/vs/platform/environment/test/node/nativeModules.integrationTest.ts index 81db8b47267..43c09df91e5 100644 --- a/src/vs/platform/environment/test/node/nativeModules.integrationTest.ts +++ b/src/vs/platform/environment/test/node/nativeModules.integrationTest.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { isWindows } from 'vs/base/common/platform'; -import { flakySuite } from 'vs/base/test/common/testUtils'; +import { isMacintosh, isWindows } from '../../../../base/common/platform.js'; +import { flakySuite } from '../../../../base/test/common/testUtils.js'; function testErrorMessage(module: string): string { return `Unable to load "${module}" dependency. It was probably not compiled for the right operating system architecture or had missing build tools.`; @@ -13,13 +13,33 @@ function testErrorMessage(module: string): string { flakySuite('Native Modules (all platforms)', () => { - test('kerberos', async () => { - const kerberos = await import('kerberos'); + (isMacintosh ? test.skip : test)('kerberos', async () => { // Somehow fails on macOS ARM? + const { default: kerberos } = await import('kerberos'); assert.ok(typeof kerberos.initializeClient === 'function', testErrorMessage('kerberos')); }); + test('minimist', async () => { + const { default: minimist } = await import('minimist'); + assert.ok(typeof minimist === 'function', testErrorMessage('minimist')); + }); + + test('yauzl', async () => { + const { default: yauzl } = await import('yauzl'); + assert.ok(typeof yauzl.ZipFile === 'function', testErrorMessage('yauzl')); + }); + + test('yazl', async () => { + const { default: yazl } = await import('yazl'); + assert.ok(typeof yazl.ZipFile === 'function', testErrorMessage('yazl')); + }); + + test('v8-inspect-profiler', async () => { + const { default: profiler } = await import('v8-inspect-profiler'); + assert.ok(typeof profiler.startProfiling === 'function', testErrorMessage('v8-inspect-profiler')); + }); + test('native-is-elevated', async () => { - const isElevated = (await import('native-is-elevated')).default; + const { default: isElevated } = await import('native-is-elevated'); assert.ok(typeof isElevated === 'function', testErrorMessage('native-is-elevated ')); const result = isElevated(); @@ -28,6 +48,7 @@ flakySuite('Native Modules (all platforms)', () => { test('native-keymap', async () => { const keyMap = await import('native-keymap'); + assert.ok(typeof keyMap.onDidChangeKeyboardLayout === 'function', testErrorMessage('native-keymap')); assert.ok(typeof keyMap.getCurrentKeyboardLayout === 'function', testErrorMessage('native-keymap')); const result = keyMap.getCurrentKeyboardLayout(); @@ -39,12 +60,27 @@ flakySuite('Native Modules (all platforms)', () => { assert.ok(typeof watchDog.start === 'function', testErrorMessage('native-watchdog')); }); - (process.type === 'renderer' ? test.skip /* TODO@electron module is not context aware yet and thus cannot load in Electron renderer used by tests */ : test)('node-pty', async () => { + test('@vscode/sudo-prompt', async () => { + const prompt = await import('@vscode/sudo-prompt'); + assert.ok(typeof prompt.exec === 'function', testErrorMessage('@vscode/sudo-prompt')); + }); + + test('@vscode/policy-watcher', async () => { + const watcher = await import('@vscode/policy-watcher'); + assert.ok(typeof watcher.createWatcher === 'function', testErrorMessage('@vscode/policy-watcher')); + }); + + test('node-pty', async () => { const nodePty = await import('node-pty'); assert.ok(typeof nodePty.spawn === 'function', testErrorMessage('node-pty')); }); - (process.type === 'renderer' ? test.skip /* TODO@electron module is not context aware yet and thus cannot load in Electron renderer used by tests */ : test)('@vscode/spdlog', async () => { + test('open', async () => { + const { default: open } = await import('open'); + assert.ok(typeof open === 'function', testErrorMessage('open')); + }); + + test('@vscode/spdlog', async () => { const spdlog = await import('@vscode/spdlog'); assert.ok(typeof spdlog.createRotatingLogger === 'function', testErrorMessage('@vscode/spdlog')); assert.ok(typeof spdlog.version === 'number', testErrorMessage('@vscode/spdlog')); @@ -55,31 +91,79 @@ flakySuite('Native Modules (all platforms)', () => { assert.ok(typeof parcelWatcher.subscribe === 'function', testErrorMessage('@parcel/watcher')); }); + test('@bpasero/watcher', async () => { + const parcelWatcher2 = await import('@bpasero/watcher'); + assert.ok(typeof parcelWatcher2.subscribe === 'function', testErrorMessage('@bpasero/watcher')); + }); + + test('@vscode/deviceid', async () => { + const deviceIdPackage = await import('@vscode/deviceid'); + assert.ok(typeof deviceIdPackage.getDeviceId === 'function', testErrorMessage('@vscode/deviceid')); + }); + + test('@vscode/ripgrep', async () => { + const ripgrep = await import('@vscode/ripgrep'); + assert.ok(typeof ripgrep.rgPath === 'string', testErrorMessage('@vscode/ripgrep')); + }); + + test('vscode-regexpp', async () => { + const regexpp = await import('vscode-regexpp'); + assert.ok(typeof regexpp.RegExpParser === 'function', testErrorMessage('vscode-regexpp')); + }); + test('@vscode/sqlite3', async () => { - const sqlite3 = await import('@vscode/sqlite3'); + // ESM-comment-begin + // const sqlite3 = await import('@vscode/sqlite3'); + // ESM-comment-end + // ESM-uncomment-begin + const { default: sqlite3 } = await import('@vscode/sqlite3'); + // ESM-uncomment-end assert.ok(typeof sqlite3.Database === 'function', testErrorMessage('@vscode/sqlite3')); }); - test('vsda', async () => { - try { - const vsda: any = globalThis._VSCODE_NODE_MODULES['vsda']; - const signer = new vsda.signer(); - const signed = await signer.sign('value'); - assert.ok(typeof signed === 'string', testErrorMessage('vsda')); - } catch (error) { - if (error.code !== 'MODULE_NOT_FOUND') { - throw error; + test('http-proxy-agent', async () => { + // ESM-comment-begin + // const mod = await import('http-proxy-agent'); + // ESM-comment-end + // ESM-uncomment-begin + const { default: mod } = await import('http-proxy-agent'); + // ESM-uncomment-end + assert.ok(typeof mod.HttpProxyAgent === 'function', testErrorMessage('http-proxy-agent')); + }); + + test('https-proxy-agent', async () => { + // ESM-comment-begin + // const mod = await import('https-proxy-agent'); + // ESM-comment-end + // ESM-uncomment-begin + const { default: mod } = await import('https-proxy-agent'); + // ESM-uncomment-end + assert.ok(typeof mod.HttpsProxyAgent === 'function', testErrorMessage('https-proxy-agent')); + }); + + test('@vscode/proxy-agent', async () => { + const proxyAgent = await import('@vscode/proxy-agent'); + // This call will load `@vscode/proxy-agent` which is a native module that we want to test on Windows + const windowsCerts = await proxyAgent.loadSystemCertificates({ + log: { + trace: () => { }, + debug: () => { }, + info: () => { }, + warn: () => { }, + error: () => { } } - } + }); + assert.ok(windowsCerts.length > 0, testErrorMessage('@vscode/proxy-agent')); }); }); (!isWindows ? suite.skip : suite)('Native Modules (Windows)', () => { - (process.type === 'renderer' ? test.skip /* TODO@electron module is not context aware yet and thus cannot load in Electron renderer used by tests */ : test)('@vscode/windows-mutex', async () => { + test('@vscode/windows-mutex', async () => { const mutex = await import('@vscode/windows-mutex'); assert.ok(mutex && typeof mutex.isActive === 'function', testErrorMessage('@vscode/windows-mutex')); assert.ok(typeof mutex.isActive === 'function', testErrorMessage('@vscode/windows-mutex')); + assert.ok(typeof mutex.Mutex === 'function', testErrorMessage('@vscode/windows-mutex')); }); test('windows-foreground-love', async () => { @@ -112,22 +196,4 @@ flakySuite('Native Modules (all platforms)', () => { const result = windowsRegistry.GetStringRegKey('HKEY_LOCAL_MACHINE', 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion', 'EditionID'); assert.ok(typeof result === 'string' || typeof result === 'undefined', testErrorMessage('@vscode/windows-registry')); }); - - test('@vscode/windows-ca-certs', async () => { - // @ts-ignore we do not directly depend on this module anymore - // but indirectly from our dependency to `@vscode/proxy-agent` - // we still want to ensure this module can work properly. - const windowsCerts = await import('@vscode/windows-ca-certs'); - const store = new windowsCerts.Crypt32(); - assert.ok(windowsCerts, testErrorMessage('@vscode/windows-ca-certs')); - let certCount = 0; - try { - while (store.next()) { - certCount++; - } - } finally { - store.done(); - } - assert(certCount > 0); - }); }); diff --git a/src/vs/platform/environment/test/node/userDataPath.test.ts b/src/vs/platform/environment/test/node/userDataPath.test.ts index 72278e46ac0..6430ac8f19e 100644 --- a/src/vs/platform/environment/test/node/userDataPath.test.ts +++ b/src/vs/platform/environment/test/node/userDataPath.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { OPTIONS, parseArgs } from 'vs/platform/environment/node/argv'; -import { getUserDataPath } from 'vs/platform/environment/node/userDataPath'; -import product from 'vs/platform/product/common/product'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { OPTIONS, parseArgs } from '../../node/argv.js'; +import { getUserDataPath } from '../../node/userDataPath.js'; +import product from '../../../product/common/product.js'; suite('User data path', () => { diff --git a/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.ts b/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.ts index 284658e08d6..85e554a36e6 100644 --- a/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.ts +++ b/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.ts @@ -3,34 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { distinct, isNonEmptyArray } from 'vs/base/common/arrays'; -import { Barrier, CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { CancellationError, getErrorMessage, isCancellationError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { isWeb } from 'vs/base/common/platform'; -import { isDefined } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import * as nls from 'vs/nls'; +import { distinct, isNonEmptyArray } from '../../../base/common/arrays.js'; +import { Barrier, CancelablePromise, createCancelablePromise } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { CancellationError, getErrorMessage, isCancellationError } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { isWeb } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import * as nls from '../../../nls.js'; import { ExtensionManagementError, IExtensionGalleryService, IExtensionIdentifier, IExtensionManagementParticipant, IGalleryExtension, ILocalExtension, InstallOperation, IExtensionsControlManifest, StatisticType, isTargetPlatformCompatible, TargetPlatformToString, ExtensionManagementErrorCode, InstallOptions, UninstallOptions, Metadata, InstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionResult, UninstallExtensionEvent, IExtensionManagementService, InstallExtensionInfo, EXTENSION_INSTALL_DEP_PACK_CONTEXT, ExtensionGalleryError, IProductVersion, ExtensionGalleryErrorCode, EXTENSION_INSTALL_SOURCE_CONTEXT, - DidUpdateExtensionMetadata -} from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions, ExtensionKey, getGalleryExtensionId, getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { ExtensionType, IExtensionManifest, isApplicationScopedExtension, TargetPlatform } from 'vs/platform/extensions/common/extensions'; -import { areApiProposalsCompatible } from 'vs/platform/extensions/common/extensionValidator'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; - -export type ExtensionVerificationStatus = boolean | string; + DidUpdateExtensionMetadata, + UninstallExtensionInfo, + ExtensionSignatureVerificationCode +} from './extensionManagement.js'; +import { areSameExtensions, ExtensionKey, getGalleryExtensionId, getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData } from './extensionManagementUtil.js'; +import { ExtensionType, IExtensionManifest, isApplicationScopedExtension, TargetPlatform } from '../../extensions/common/extensions.js'; +import { areApiProposalsCompatible } from '../../extensions/common/extensionValidator.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; + export type InstallableExtension = { readonly manifest: IExtensionManifest; extension: IGalleryExtension | URI; options: InstallOptions }; export type InstallExtensionTaskOptions = InstallOptions & { readonly profileLocation: URI; readonly productVersion: IProductVersion }; @@ -40,7 +41,7 @@ export interface IInstallExtensionTask { readonly source: IGalleryExtension | URI; readonly operation: InstallOperation; readonly options: InstallExtensionTaskOptions; - readonly verificationStatus?: ExtensionVerificationStatus; + readonly verificationStatus?: ExtensionSignatureVerificationCode; run(): Promise; waitUntilTaskIsFinished(): Promise; cancel(): void; @@ -48,6 +49,7 @@ export interface IInstallExtensionTask { export type UninstallExtensionTaskOptions = UninstallOptions & { readonly profileLocation: URI }; export interface IUninstallExtensionTask { + readonly options: UninstallExtensionTaskOptions; readonly extension: ILocalExtension; run(): Promise; waitUntilTaskIsFinished(): Promise; @@ -142,9 +144,9 @@ export abstract class AbstractExtensionManagementService extends Disposable impl return results; } - async uninstall(extension: ILocalExtension, options: UninstallOptions = {}): Promise { + async uninstall(extension: ILocalExtension, options?: UninstallOptions): Promise { this.logService.trace('ExtensionManagementService#uninstall', extension.identifier.id); - return this.uninstallExtension(extension, options); + return this.uninstallExtensions([{ extension, options }]); } async toggleAppliationScope(extension: ILocalExtension, fromProfileLocation: URI): Promise { @@ -196,6 +198,24 @@ export abstract class AbstractExtensionManagementService extends Disposable impl this.participants.push(participant); } + async resetPinnedStateForAllUserExtensions(pinned: boolean): Promise { + try { + await this.joinAllSettled(this.userDataProfilesService.profiles.map( + async profile => { + const extensions = await this.getInstalled(ExtensionType.User, profile.extensionsResource); + await this.joinAllSettled(extensions.map( + async extension => { + if (extension.pinned !== pinned) { + await this.updateMetadata(extension, { pinned }, profile.extensionsResource); + } + })); + })); + } catch (error) { + this.logService.error('Error while resetting pinned state for all user extensions', getErrorMessage(error)); + throw error; + } + } + protected async installExtensions(extensions: InstallableExtension[]): Promise { const installExtensionResultsMap = new Map(); const installingExtensionsMap = new Map(); @@ -203,6 +223,32 @@ export abstract class AbstractExtensionManagementService extends Disposable impl const getInstallExtensionTaskKey = (extension: IGalleryExtension, profileLocation: URI) => `${ExtensionKey.create(extension).toString()}-${profileLocation.toString()}`; const createInstallExtensionTask = (manifest: IExtensionManifest, extension: IGalleryExtension | URI, options: InstallExtensionTaskOptions, root: IInstallExtensionTask | undefined): void => { + if (!URI.isUri(extension)) { + if (installingExtensionsMap.has(`${extension.identifier.id.toLowerCase()}-${options.profileLocation.toString()}`)) { + return; + } + const existingInstallingExtension = this.installingExtensions.get(getInstallExtensionTaskKey(extension, options.profileLocation)); + if (existingInstallingExtension) { + if (root && this.canWaitForTask(root, existingInstallingExtension.task)) { + const identifier = existingInstallingExtension.task.identifier; + this.logService.info('Waiting for already requested installing extension', identifier.id, root.identifier.id, options.profileLocation.toString()); + existingInstallingExtension.waitingTasks.push(root); + // add promise that waits until the extension is completely installed, ie., onDidInstallExtensions event is triggered for this extension + alreadyRequestedInstallations.push( + Event.toPromise( + Event.filter(this.onDidInstallExtensions, results => results.some(result => areSameExtensions(result.identifier, identifier))) + ).then(results => { + this.logService.info('Finished waiting for already requested installing extension', identifier.id, root.identifier.id, options.profileLocation.toString()); + const result = results.find(result => areSameExtensions(result.identifier, identifier)); + if (!result?.local) { + // Extension failed to install + throw new Error(`Extension ${identifier.id} is not installed`); + } + })); + } + return; + } + } const installExtensionTask = this.createInstallExtensionTask(manifest, extension, options); const key = `${getGalleryExtensionId(manifest.publisher, manifest.name)}-${options.profileLocation.toString()}`; installingExtensionsMap.set(key, { task: installExtensionTask, root }); @@ -245,31 +291,10 @@ export abstract class AbstractExtensionManagementService extends Disposable impl const installed = await this.getInstalled(undefined, task.options.profileLocation, task.options.productVersion); const options: InstallExtensionTaskOptions = { ...task.options, context: { ...task.options.context, [EXTENSION_INSTALL_DEP_PACK_CONTEXT]: true } }; for (const { gallery, manifest } of distinct(allDepsAndPackExtensionsToInstall, ({ gallery }) => gallery.identifier.id)) { - if (installingExtensionsMap.has(`${gallery.identifier.id.toLowerCase()}-${options.profileLocation.toString()}`)) { + if (installed.some(({ identifier }) => areSameExtensions(identifier, gallery.identifier))) { continue; } - const existingInstallingExtension = this.installingExtensions.get(getInstallExtensionTaskKey(gallery, options.profileLocation)); - if (existingInstallingExtension) { - if (this.canWaitForTask(task, existingInstallingExtension.task)) { - const identifier = existingInstallingExtension.task.identifier; - this.logService.info('Waiting for already requested installing extension', identifier.id, task.identifier.id, options.profileLocation.toString()); - existingInstallingExtension.waitingTasks.push(task); - // add promise that waits until the extension is completely installed, ie., onDidInstallExtensions event is triggered for this extension - alreadyRequestedInstallations.push( - Event.toPromise( - Event.filter(this.onDidInstallExtensions, results => results.some(result => areSameExtensions(result.identifier, identifier))) - ).then(results => { - this.logService.info('Finished waiting for already requested installing extension', identifier.id, task.identifier.id, options.profileLocation.toString()); - const result = results.find(result => areSameExtensions(result.identifier, identifier)); - if (!result?.local) { - // Extension failed to install - throw new Error(`Extension ${identifier.id} is not installed`); - } - })); - } - } else if (!installed.some(({ identifier }) => areSameExtensions(identifier, gallery.identifier))) { - createInstallExtensionTask(manifest, gallery, options, task); - } + createInstallExtensionTask(manifest, gallery, options, task); } } catch (error) { // Installing through VSIX @@ -289,6 +314,11 @@ export abstract class AbstractExtensionManagementService extends Disposable impl } })); + const otherProfilesToUpdate = await this.getOtherProfilesToUpdateExtension([...installingExtensionsMap.values()].map(({ task }) => task)); + for (const [profileLocation, task] of otherProfilesToUpdate) { + createInstallExtensionTask(task.manifest, task.source, { ...task.options, profileLocation }, undefined); + } + // Install extensions in parallel and wait until all extensions are installed / failed await this.joinAllSettled([...installingExtensionsMap.entries()].map(async ([key, { task }]) => { const startTime = new Date().getTime(); @@ -415,6 +445,36 @@ export abstract class AbstractExtensionManagementService extends Disposable impl } } + private async getOtherProfilesToUpdateExtension(tasks: IInstallExtensionTask[]): Promise<[URI, IInstallExtensionTask][]> { + const otherProfilesToUpdate: [URI, IInstallExtensionTask][] = []; + const profileExtensionsCache = new ResourceMap(); + for (const task of tasks) { + if (task.operation !== InstallOperation.Update + || task.options.isApplicationScoped + || task.options.pinned + || task.options.installGivenVersion + || URI.isUri(task.source) + ) { + continue; + } + for (const profile of this.userDataProfilesService.profiles) { + if (this.uriIdentityService.extUri.isEqual(profile.extensionsResource, task.options.profileLocation)) { + continue; + } + let installedExtensions = profileExtensionsCache.get(profile.extensionsResource); + if (!installedExtensions) { + installedExtensions = await this.getInstalled(ExtensionType.User, profile.extensionsResource); + profileExtensionsCache.set(profile.extensionsResource, installedExtensions); + } + const installedExtension = installedExtensions.find(e => areSameExtensions(e.identifier, task.identifier)); + if (installedExtension && !installedExtension.pinned) { + otherProfilesToUpdate.push([profile.extensionsResource, task]); + } + } + } + return otherProfilesToUpdate; + } + private canWaitForTask(taskToWait: IInstallExtensionTask, taskToWaitFor: IInstallExtensionTask): boolean { for (const [, { task, waitingTasks }] of this.installingExtensions.entries()) { if (task === taskToWait) { @@ -597,43 +657,23 @@ export abstract class AbstractExtensionManagementService extends Disposable impl return compatibleExtension; } - private async uninstallExtension(extension: ILocalExtension, options: UninstallOptions): Promise { - const uninstallOptions: UninstallExtensionTaskOptions = { - ...options, - profileLocation: extension.isApplicationScoped ? this.userDataProfilesService.defaultProfile.extensionsResource : options.profileLocation ?? this.getCurrentExtensionsManifestLocation() - }; - const getUninstallExtensionTaskKey = (identifier: IExtensionIdentifier) => `${identifier.id.toLowerCase()}${uninstallOptions.versionOnly ? `-${extension.manifest.version}` : ''}${uninstallOptions.profileLocation ? `@${uninstallOptions.profileLocation.toString()}` : ''}`; - const uninstallExtensionTask = this.uninstallingExtensions.get(getUninstallExtensionTaskKey(extension.identifier)); - if (uninstallExtensionTask) { - this.logService.info('Extensions is already requested to uninstall', extension.identifier.id); - return uninstallExtensionTask.waitUntilTaskIsFinished(); - } + async uninstallExtensions(extensions: UninstallExtensionInfo[]): Promise { - const createUninstallExtensionTask = (extension: ILocalExtension): IUninstallExtensionTask => { + const getUninstallExtensionTaskKey = (extension: ILocalExtension, uninstallOptions: UninstallExtensionTaskOptions) => `${extension.identifier.id.toLowerCase()}${uninstallOptions.versionOnly ? `-${extension.manifest.version}` : ''}@${uninstallOptions.profileLocation.toString()}`; + + const createUninstallExtensionTask = (extension: ILocalExtension, uninstallOptions: UninstallExtensionTaskOptions): IUninstallExtensionTask => { const uninstallExtensionTask = this.createUninstallExtensionTask(extension, uninstallOptions); - this.uninstallingExtensions.set(getUninstallExtensionTaskKey(uninstallExtensionTask.extension.identifier), uninstallExtensionTask); - if (uninstallOptions.profileLocation) { - this.logService.info('Uninstalling extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, uninstallOptions.profileLocation.toString()); - } else { - this.logService.info('Uninstalling extension:', `${extension.identifier.id}@${extension.manifest.version}`); - } + this.uninstallingExtensions.set(getUninstallExtensionTaskKey(uninstallExtensionTask.extension, uninstallOptions), uninstallExtensionTask); + this.logService.info('Uninstalling extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, uninstallOptions.profileLocation.toString()); this._onUninstallExtension.fire({ identifier: extension.identifier, profileLocation: uninstallOptions.profileLocation, applicationScoped: extension.isApplicationScoped }); return uninstallExtensionTask; }; - const postUninstallExtension = (extension: ILocalExtension, error?: ExtensionManagementError): void => { + const postUninstallExtension = (extension: ILocalExtension, uninstallOptions: UninstallExtensionTaskOptions, error?: ExtensionManagementError): void => { if (error) { - if (uninstallOptions.profileLocation) { - this.logService.error('Failed to uninstall extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, uninstallOptions.profileLocation.toString(), error.message); - } else { - this.logService.error('Failed to uninstall extension:', `${extension.identifier.id}@${extension.manifest.version}`, error.message); - } + this.logService.error('Failed to uninstall extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, uninstallOptions.profileLocation.toString(), error.message); } else { - if (uninstallOptions.profileLocation) { - this.logService.info('Successfully uninstalled extension from the profile', `${extension.identifier.id}@${extension.manifest.version}`, uninstallOptions.profileLocation.toString()); - } else { - this.logService.info('Successfully uninstalled extension:', `${extension.identifier.id}@${extension.manifest.version}`); - } + this.logService.info('Successfully uninstalled extension from the profile', `${extension.identifier.id}@${extension.manifest.version}`, uninstallOptions.profileLocation.toString()); } reportTelemetry(this.telemetryService, 'extensionGallery:uninstall', { extensionData: getLocalExtensionTelemetryData(extension), error }); this._onDidUninstallExtension.fire({ identifier: extension.identifier, error: error?.code, profileLocation: uninstallOptions.profileLocation, applicationScoped: extension.isApplicationScoped }); @@ -641,64 +681,91 @@ export abstract class AbstractExtensionManagementService extends Disposable impl const allTasks: IUninstallExtensionTask[] = []; const processedTasks: IUninstallExtensionTask[] = []; + const alreadyRequestedUninstalls: Promise[] = []; - try { - allTasks.push(createUninstallExtensionTask(extension)); - const installed = await this.getInstalled(ExtensionType.User, uninstallOptions.profileLocation); - if (uninstallOptions.donotIncludePack) { - this.logService.info('Uninstalling the extension without including packed extension', `${extension.identifier.id}@${extension.manifest.version}`); + const installedExtensionsMap = new ResourceMap(); + + for (const { extension, options } of extensions) { + const uninstallOptions: UninstallExtensionTaskOptions = { + ...options, + profileLocation: extension.isApplicationScoped ? this.userDataProfilesService.defaultProfile.extensionsResource : options?.profileLocation ?? this.getCurrentExtensionsManifestLocation() + }; + const uninstallExtensionTask = this.uninstallingExtensions.get(getUninstallExtensionTaskKey(extension, uninstallOptions)); + if (uninstallExtensionTask) { + this.logService.info('Extensions is already requested to uninstall', extension.identifier.id); + alreadyRequestedUninstalls.push(uninstallExtensionTask.waitUntilTaskIsFinished()); } else { - const packedExtensions = this.getAllPackExtensionsToUninstall(extension, installed); - for (const packedExtension of packedExtensions) { - if (this.uninstallingExtensions.has(getUninstallExtensionTaskKey(packedExtension.identifier))) { - this.logService.info('Extensions is already requested to uninstall', packedExtension.identifier.id); - } else { - allTasks.push(createUninstallExtensionTask(packedExtension)); - } - } + allTasks.push(createUninstallExtensionTask(extension, uninstallOptions)); } + } - if (uninstallOptions.donotCheckDependents) { - this.logService.info('Uninstalling the extension without checking dependents', `${extension.identifier.id}@${extension.manifest.version}`); - } else { - this.checkForDependents(allTasks.map(task => task.extension), installed, extension); + try { + for (const task of allTasks.slice(0)) { + let installed = installedExtensionsMap.get(task.options.profileLocation); + if (!installed) { + installedExtensionsMap.set(task.options.profileLocation, installed = await this.getInstalled(ExtensionType.User, task.options.profileLocation)); + } + + if (task.options.donotIncludePack) { + this.logService.info('Uninstalling the extension without including packed extension', `${task.extension.identifier.id}@${task.extension.manifest.version}`); + } else { + const packedExtensions = this.getAllPackExtensionsToUninstall(task.extension, installed); + for (const packedExtension of packedExtensions) { + if (this.uninstallingExtensions.has(getUninstallExtensionTaskKey(packedExtension, task.options))) { + this.logService.info('Extensions is already requested to uninstall', packedExtension.identifier.id); + } else { + allTasks.push(createUninstallExtensionTask(packedExtension, task.options)); + } + } + } + if (task.options.donotCheckDependents) { + this.logService.info('Uninstalling the extension without checking dependents', `${task.extension.identifier.id}@${task.extension.manifest.version}`); + } else { + this.checkForDependents(allTasks.map(task => task.extension), installed, task.extension); + } } // Uninstall extensions in parallel and wait until all extensions are uninstalled / failed await this.joinAllSettled(allTasks.map(async task => { try { await task.run(); - await this.joinAllSettled(this.participants.map(participant => participant.postUninstall(task.extension, uninstallOptions, CancellationToken.None))); + await this.joinAllSettled(this.participants.map(participant => participant.postUninstall(task.extension, task.options, CancellationToken.None))); // only report if extension has a mapped gallery extension. UUID identifies the gallery extension. if (task.extension.identifier.uuid) { try { await this.galleryService.reportStatistic(task.extension.manifest.publisher, task.extension.manifest.name, task.extension.manifest.version, StatisticType.Uninstall); } catch (error) { /* ignore */ } } - postUninstallExtension(task.extension); } catch (e) { const error = toExtensionManagementError(e); - postUninstallExtension(task.extension, error); + postUninstallExtension(task.extension, task.options, error); throw error; } finally { processedTasks.push(task); } })); + if (alreadyRequestedUninstalls.length) { + await this.joinAllSettled(alreadyRequestedUninstalls); + } + + for (const task of allTasks) { + postUninstallExtension(task.extension, task.options); + } } catch (e) { const error = toExtensionManagementError(e); for (const task of allTasks) { // cancel the tasks try { task.cancel(); } catch (error) { /* ignore */ } if (!processedTasks.includes(task)) { - postUninstallExtension(task.extension, error); + postUninstallExtension(task.extension, task.options, error); } } throw error; } finally { // Remove tasks from cache for (const task of allTasks) { - if (!this.uninstallingExtensions.delete(getUninstallExtensionTaskKey(task.extension.identifier))) { + if (!this.uninstallingExtensions.delete(getUninstallExtensionTaskKey(task.extension, task.options))) { this.logService.warn('Uninstallation task is not found in the cache', task.extension.identifier.id); } } @@ -779,7 +846,6 @@ export abstract class AbstractExtensionManagementService extends Disposable impl abstract getTargetPlatform(): Promise; abstract zip(extension: ILocalExtension): Promise; - abstract unzip(zipLocation: URI): Promise; abstract getManifest(vsix: URI): Promise; abstract install(vsix: URI, options?: InstallOptions): Promise; abstract installFromLocation(location: URI, profileLocation: URI): Promise; @@ -822,34 +888,12 @@ function reportTelemetry(telemetryService: ITelemetryService, eventName: string, durationSinceUpdate }: { extensionData: any; - verificationStatus?: - ExtensionVerificationStatus; + verificationStatus?: ExtensionSignatureVerificationCode; duration?: number; durationSinceUpdate?: number; source?: string; error?: ExtensionManagementError | ExtensionGalleryError; }): void { - let errorcode: string | undefined; - let errorcodeDetail: string | undefined; - - if (isDefined(verificationStatus)) { - if (verificationStatus === true) { - verificationStatus = 'Verified'; - } else if (verificationStatus === false) { - verificationStatus = 'Unverified'; - } else { - errorcode = ExtensionManagementErrorCode.Signature; - errorcodeDetail = verificationStatus; - verificationStatus = 'Unverified'; - } - } - - if (error) { - errorcode = error.code; - if (error.code === ExtensionManagementErrorCode.Signature) { - errorcodeDetail = error.message; - } - } /* __GDPR__ "extensionGallery:install" : { @@ -858,7 +902,6 @@ function reportTelemetry(telemetryService: ITelemetryService, eventName: string, "duration" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "durationSinceUpdate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, "errorcode": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" }, - "errorcodeDetail": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" }, "recommendationReason": { "retiredFromVersion": "1.23.0", "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, "verificationStatus" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "source": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, @@ -884,7 +927,6 @@ function reportTelemetry(telemetryService: ITelemetryService, eventName: string, "success": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "duration" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "errorcode": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" }, - "errorcodeDetail": { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" }, "verificationStatus" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "source": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "${include}": [ @@ -892,7 +934,15 @@ function reportTelemetry(telemetryService: ITelemetryService, eventName: string, ] } */ - telemetryService.publicLog(eventName, { ...extensionData, verificationStatus, success: !error, duration, errorcode, errorcodeDetail, durationSinceUpdate, source }); + telemetryService.publicLog(eventName, { + ...extensionData, + source, + duration, + durationSinceUpdate, + success: !error, + errorcode: error?.code, + verificationStatus: verificationStatus === ExtensionSignatureVerificationCode.Success ? 'Verified' : (verificationStatus ?? 'Unverified') + }); } export abstract class AbstractExtensionTask { diff --git a/src/vs/platform/extensionManagement/common/configRemotes.ts b/src/vs/platform/extensionManagement/common/configRemotes.ts index 4db44fa4abf..3f23738be8a 100644 --- a/src/vs/platform/extensionManagement/common/configRemotes.ts +++ b/src/vs/platform/extensionManagement/common/configRemotes.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; +import { URI } from '../../../base/common/uri.js'; const SshProtocolMatcher = /^([^@:]+@)?([^:]+):/; const SshUrlMatcher = /^([^@:]+@)?([^:]+):(.+)$/; diff --git a/src/vs/platform/extensionManagement/common/extensionEnablementService.ts b/src/vs/platform/extensionManagement/common/extensionEnablementService.ts index 61c8816e3aa..0a4e5337800 100644 --- a/src/vs/platform/extensionManagement/common/extensionEnablementService.ts +++ b/src/vs/platform/extensionManagement/common/extensionEnablementService.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { isUndefinedOrNull } from 'vs/base/common/types'; -import { DISABLED_EXTENSIONS_STORAGE_PATH, IExtensionIdentifier, IExtensionManagementService, IGlobalExtensionEnablementService, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { IProfileStorageValueChangeEvent, IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { isUndefinedOrNull } from '../../../base/common/types.js'; +import { DISABLED_EXTENSIONS_STORAGE_PATH, IExtensionIdentifier, IExtensionManagementService, IGlobalExtensionEnablementService, InstallOperation } from './extensionManagement.js'; +import { areSameExtensions } from './extensionManagementUtil.js'; +import { IProfileStorageValueChangeEvent, IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; export class GlobalExtensionEnablementService extends Disposable implements IGlobalExtensionEnablementService { @@ -16,15 +16,15 @@ export class GlobalExtensionEnablementService extends Disposable implements IGlo private _onDidChangeEnablement = new Emitter<{ readonly extensions: IExtensionIdentifier[]; readonly source?: string }>(); readonly onDidChangeEnablement: Event<{ readonly extensions: IExtensionIdentifier[]; readonly source?: string }> = this._onDidChangeEnablement.event; - private readonly storageManger: StorageManager; + private readonly storageManager: StorageManager; constructor( @IStorageService storageService: IStorageService, @IExtensionManagementService extensionManagementService: IExtensionManagementService, ) { super(); - this.storageManger = this._register(new StorageManager(storageService)); - this._register(this.storageManger.onDidChange(extensions => this._onDidChangeEnablement.fire({ extensions, source: 'storage' }))); + this.storageManager = this._register(new StorageManager(storageService)); + this._register(this.storageManager.onDidChange(extensions => this._onDidChangeEnablement.fire({ extensions, source: 'storage' }))); this._register(extensionManagementService.onDidInstallExtensions(e => e.forEach(({ local, operation }) => { if (local && operation === InstallOperation.Migrate) { this._removeFromDisabledExtensions(local.identifier); /* Reset migrated extensions */ @@ -84,11 +84,11 @@ export class GlobalExtensionEnablementService extends Disposable implements IGlo } private _getExtensions(storageId: string): IExtensionIdentifier[] { - return this.storageManger.get(storageId, StorageScope.PROFILE); + return this.storageManager.get(storageId, StorageScope.PROFILE); } private _setExtensions(storageId: string, extensions: IExtensionIdentifier[]): void { - this.storageManger.set(storageId, extensions, StorageScope.PROFILE); + this.storageManager.set(storageId, extensions, StorageScope.PROFILE); } } diff --git a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts index e8698264bfa..d5a9bcee55b 100644 --- a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts @@ -3,30 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { distinct } from 'vs/base/common/arrays'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { CancellationError, getErrorMessage, isCancellationError } from 'vs/base/common/errors'; -import { IPager } from 'vs/base/common/paging'; -import { isWeb, platform } from 'vs/base/common/platform'; -import { arch } from 'vs/base/common/process'; -import { isBoolean } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { IHeaders, IRequestContext, IRequestOptions } from 'vs/base/parts/request/common/request'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { getTargetPlatform, IExtensionGalleryService, IExtensionIdentifier, IExtensionInfo, IGalleryExtension, IGalleryExtensionAsset, IGalleryExtensionAssets, IGalleryExtensionVersion, InstallOperation, IQueryOptions, IExtensionsControlManifest, isNotWebExtensionInWebTargetPlatform, isTargetPlatformCompatible, ITranslation, SortBy, SortOrder, StatisticType, toTargetPlatform, WEB_EXTENSION_TAG, IExtensionQueryOptions, IDeprecationInfo, ISearchPrefferedResults, ExtensionGalleryError, ExtensionGalleryErrorCode, IProductVersion } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { adoptToGalleryExtensionId, areSameExtensions, getGalleryExtensionId, getGalleryExtensionTelemetryData } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { IExtensionManifest, TargetPlatform } from 'vs/platform/extensions/common/extensions'; -import { areApiProposalsCompatible, isEngineValid } from 'vs/platform/extensions/common/extensionValidator'; -import { IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { asJson, asTextOrError, IRequestService, isSuccess } from 'vs/platform/request/common/request'; -import { resolveMarketplaceHeaders } from 'vs/platform/externalServices/common/marketplace'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { StopWatch } from 'vs/base/common/stopwatch'; +import { distinct } from '../../../base/common/arrays.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { CancellationError, getErrorMessage, isCancellationError } from '../../../base/common/errors.js'; +import { IPager } from '../../../base/common/paging.js'; +import { isWeb, platform } from '../../../base/common/platform.js'; +import { arch } from '../../../base/common/process.js'; +import { isBoolean } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { IHeaders, IRequestContext, IRequestOptions, isOfflineError } from '../../../base/parts/request/common/request.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { getTargetPlatform, IExtensionGalleryService, IExtensionIdentifier, IExtensionInfo, IGalleryExtension, IGalleryExtensionAsset, IGalleryExtensionAssets, IGalleryExtensionVersion, InstallOperation, IQueryOptions, IExtensionsControlManifest, isNotWebExtensionInWebTargetPlatform, isTargetPlatformCompatible, ITranslation, SortBy, SortOrder, StatisticType, toTargetPlatform, WEB_EXTENSION_TAG, IExtensionQueryOptions, IDeprecationInfo, ISearchPrefferedResults, ExtensionGalleryError, ExtensionGalleryErrorCode, IProductVersion } from './extensionManagement.js'; +import { adoptToGalleryExtensionId, areSameExtensions, getGalleryExtensionId, getGalleryExtensionTelemetryData } from './extensionManagementUtil.js'; +import { IExtensionManifest, TargetPlatform } from '../../extensions/common/extensions.js'; +import { areApiProposalsCompatible, isEngineValid } from '../../extensions/common/extensionValidator.js'; +import { IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { asJson, asTextOrError, IRequestService, isSuccess } from '../../request/common/request.js'; +import { resolveMarketplaceHeaders } from '../../externalServices/common/marketplace.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; const CURRENT_TARGET_PLATFORM = isWeb ? TargetPlatform.WEB : getTargetPlatform(platform, arch); const ACTIVITY_HEADER_NAME = 'X-Market-Search-Activity-Id'; @@ -214,6 +214,7 @@ const PropertyType = { WebExtension: 'Microsoft.VisualStudio.Code.WebExtension', SponsorLink: 'Microsoft.VisualStudio.Code.SponsorLink', SupportLink: 'Microsoft.VisualStudio.Services.Links.Support', + ExecutesCode: 'Microsoft.VisualStudio.Code.ExecutesCode', }; interface ICriterium { @@ -431,6 +432,11 @@ function isPreReleaseVersion(version: IRawGalleryExtensionVersion): boolean { return values.length > 0 && values[0].value === 'true'; } +function executesCode(version: IRawGalleryExtensionVersion): boolean | undefined { + const values = version.properties ? version.properties.filter(p => p.key === PropertyType.ExecutesCode) : []; + return values.length > 0 ? values[0].value === 'true' : undefined; +} + function getEnabledApiProposals(version: IRawGalleryExtensionVersion): string[] { const values = version.properties ? version.properties.filter(p => p.key === PropertyType.EnabledApiProposals) : []; const value = (values.length > 0 && values[0].value) || ''; @@ -558,7 +564,8 @@ function toExtension(galleryExtension: IRawGalleryExtension, version: IRawGaller enabledApiProposals: getEnabledApiProposals(version), localizedLanguages: getLocalizedLanguages(version), targetPlatform: getTargetPlatformForExtensionVersion(version), - isPreReleaseVersion: isPreReleaseVersion(version) + isPreReleaseVersion: isPreReleaseVersion(version), + executesCode: executesCode(version) }, hasPreReleaseVersion: isPreReleaseVersion(latestVersion), hasReleaseVersion: true, @@ -598,7 +605,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi private readonly extensionsGallerySearchUrl: string | undefined; private readonly extensionsControlUrl: string | undefined; - private readonly commonHeadersPromise: Promise>; + private readonly commonHeadersPromise: Promise; private readonly extensionsEnabledWithApiProposalVersion: string[]; constructor( @@ -640,6 +647,36 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi async getExtensions(extensionInfos: ReadonlyArray, arg1: any, arg2?: any): Promise { const options = CancellationToken.isCancellationToken(arg1) ? {} : arg1 as IExtensionQueryOptions; const token = CancellationToken.isCancellationToken(arg1) ? arg1 : arg2 as CancellationToken; + const result = await this.doGetExtensions(extensionInfos, options, token); + + const uuids = result.map(r => r.identifier.uuid); + const extensionInfosByName: IExtensionInfo[] = []; + for (const e of extensionInfos) { + if (e.uuid && !uuids.includes(e.uuid)) { + extensionInfosByName.push({ ...e, uuid: undefined }); + } + } + + if (extensionInfosByName.length) { + // report telemetry data for additional query + this.telemetryService.publicLog2< + { count: number }, + { + owner: 'sandy081'; + comment: 'Report the query to the the Marketplace for fetching extensions by name'; + readonly count: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Number of extensions to fetch' }; + }>('galleryService:additionalQueryByName', { + count: extensionInfosByName.length + }); + + const extensions = await this.doGetExtensions(extensionInfosByName, options, token); + result.push(...extensions); + } + + return result; + } + + private async doGetExtensions(extensionInfos: ReadonlyArray, options: IExtensionQueryOptions, token: CancellationToken): Promise { const names: string[] = []; const ids: string[] = [], includePreReleases: (IExtensionIdentifier & { includePreRelease: boolean })[] = [], versions: (IExtensionIdentifier & { version: string })[] = []; let isQueryForReleaseVersionFromPreReleaseVersion = true; for (const extensionInfo of extensionInfos) { @@ -955,7 +992,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi criteria.productVersion) ) { if (criteria.compatible && !this.areApiProposalsCompatible(extensionIdentifier, getEnabledApiProposals(rawGalleryExtensionVersion))) { - return null; + continue; } return toExtension(rawGalleryExtension, rawGalleryExtensionVersion, allTargetPlatforms, queryContext); } @@ -1022,9 +1059,9 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi return { galleryExtensions, total, - context: { + context: context.res.headers['activityid'] ? { [ACTIVITY_HEADER_NAME]: context.res.headers['activityid'] - } + } : {} }; } return { galleryExtensions: [], total }; @@ -1035,7 +1072,11 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi throw e; } else { const errorMessage = getErrorMessage(e); - errorCode = errorMessage.startsWith('XHR timeout') ? ExtensionGalleryErrorCode.Timeout : ExtensionGalleryErrorCode.Failed; + errorCode = isOfflineError(e) + ? ExtensionGalleryErrorCode.Offline + : errorMessage.startsWith('XHR timeout') + ? ExtensionGalleryErrorCode.Timeout + : ExtensionGalleryErrorCode.Failed; throw new ExtensionGalleryError(errorMessage, errorCode); } } finally { diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts index 68f21988fc4..ea7b30d9422 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagement.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Event } from 'vs/base/common/event'; -import { IPager } from 'vs/base/common/paging'; -import { Platform } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { localize2 } from 'vs/nls'; -import { ExtensionType, IExtension, IExtensionManifest, TargetPlatform } from 'vs/platform/extensions/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Event } from '../../../base/common/event.js'; +import { IPager } from '../../../base/common/paging.js'; +import { Platform } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize2 } from '../../../nls.js'; +import { ExtensionType, IExtension, IExtensionManifest, TargetPlatform } from '../../extensions/common/extensions.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const EXTENSION_IDENTIFIER_PATTERN = '^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$'; export const EXTENSION_IDENTIFIER_REGEX = new RegExp(EXTENSION_IDENTIFIER_PATTERN); @@ -163,6 +163,7 @@ export interface IGalleryExtensionProperties { localizedLanguages?: string[]; targetPlatform: TargetPlatform; isPreReleaseVersion: boolean; + executesCode?: boolean; } export interface IGalleryExtensionAsset { @@ -425,6 +426,7 @@ export const enum ExtensionGalleryErrorCode { Cancelled = 'Cancelled', Failed = 'Failed', DownloadFailedWriting = 'DownloadFailedWriting', + Offline = 'Offline', } export class ExtensionGalleryError extends Error { @@ -446,7 +448,6 @@ export const enum ExtensionManagementErrorCode { Download = 'Download', DownloadSignature = 'DownloadSignature', DownloadFailedWriting = ExtensionGalleryErrorCode.DownloadFailedWriting, - UpdateExistingMetadata = 'UpdateExistingMetadata', UpdateMetadata = 'UpdateMetadata', Extract = 'Extract', Scanning = 'Scanning', @@ -461,7 +462,9 @@ export const enum ExtensionManagementErrorCode { PostInstall = 'PostInstall', CorruptZip = 'CorruptZip', IncompleteZip = 'IncompleteZip', - Signature = 'Signature', + PackageNotSigned = 'PackageNotSigned', + SignatureVerificationInternal = 'SignatureVerificationInternal', + SignatureVerificationFailed = 'SignatureVerificationFailed', NotAllowed = 'NotAllowed', Gallery = 'Gallery', Cancelled = 'Cancelled', @@ -469,6 +472,35 @@ export const enum ExtensionManagementErrorCode { Internal = 'Internal', } +export enum ExtensionSignatureVerificationCode { + 'Success' = 'Success', + 'RequiredArgumentMissing' = 'RequiredArgumentMissing', // A required argument is missing. + 'InvalidArgument' = 'InvalidArgument', // An argument is invalid. + 'PackageIsUnreadable' = 'PackageIsUnreadable', // The extension package is unreadable. + 'UnhandledException' = 'UnhandledException', // An unhandled exception occurred. + 'SignatureManifestIsMissing' = 'SignatureManifestIsMissing', // The extension is missing a signature manifest file (.signature.manifest). + 'SignatureManifestIsUnreadable' = 'SignatureManifestIsUnreadable', // The signature manifest is unreadable. + 'SignatureIsMissing' = 'SignatureIsMissing', // The extension is missing a signature file (.signature.p7s). + 'SignatureIsUnreadable' = 'SignatureIsUnreadable', // The signature is unreadable. + 'CertificateIsUnreadable' = 'CertificateIsUnreadable', // The certificate is unreadable. + 'SignatureArchiveIsUnreadable' = 'SignatureArchiveIsUnreadable', + 'FileAlreadyExists' = 'FileAlreadyExists', // The output file already exists. + 'SignatureArchiveIsInvalidZip' = 'SignatureArchiveIsInvalidZip', + 'SignatureArchiveHasSameSignatureFile' = 'SignatureArchiveHasSameSignatureFile', // The signature archive has the same signature file. + 'PackageIntegrityCheckFailed' = 'PackageIntegrityCheckFailed', // The package integrity check failed. + 'SignatureIsInvalid' = 'SignatureIsInvalid', // The extension has an invalid signature file (.signature.p7s). + 'SignatureManifestIsInvalid' = 'SignatureManifestIsInvalid', // The extension has an invalid signature manifest file (.signature.manifest). + 'SignatureIntegrityCheckFailed' = 'SignatureIntegrityCheckFailed', // The extension's signature integrity check failed. Extension integrity is suspect. + 'EntryIsMissing' = 'EntryIsMissing', // An entry referenced in the signature manifest was not found in the extension. + 'EntryIsTampered' = 'EntryIsTampered', // The integrity check for an entry referenced in the signature manifest failed. + 'Untrusted' = 'Untrusted', // An X.509 certificate in the extension signature is untrusted. + 'CertificateRevoked' = 'CertificateRevoked', // An X.509 certificate in the extension signature has been revoked. + 'SignatureIsNotValid' = 'SignatureIsNotValid', // The extension signature is invalid. + 'UnknownError' = 'UnknownError', // An unknown error occurred. + 'PackageIsInvalidZip' = 'PackageIsInvalidZip', // The extension package is not valid ZIP format. + 'SignatureArchiveHasTooManyEntries' = 'SignatureArchiveHasTooManyEntries', // The signature archive has too many entries. +} + export class ExtensionManagementError extends Error { constructor(message: string, readonly code: ExtensionManagementErrorCode) { super(message); @@ -491,6 +523,7 @@ export type InstallOptions = { profileLocation?: URI; installOnlyNewlyAddedFromExtensionPack?: boolean; productVersion?: IProductVersion; + keepExisting?: boolean; /** * Context passed through to InstallExtensionResult */ @@ -511,6 +544,7 @@ export interface IExtensionManagementParticipant { } export type InstallExtensionInfo = { readonly extension: IGalleryExtension; readonly options: InstallOptions }; +export type UninstallExtensionInfo = { readonly extension: ILocalExtension; readonly options?: UninstallOptions }; export const IExtensionManagementService = createDecorator('extensionManagementService'); export interface IExtensionManagementService { @@ -523,7 +557,6 @@ export interface IExtensionManagementService { onDidUpdateExtensionMetadata: Event; zip(extension: ILocalExtension): Promise; - unzip(zipLocation: URI): Promise; getManifest(vsix: URI): Promise; install(vsix: URI, options?: InstallOptions): Promise; canInstall(extension: IGalleryExtension): Promise; @@ -532,12 +565,14 @@ export interface IExtensionManagementService { installFromLocation(location: URI, profileLocation: URI): Promise; installExtensionsFromProfile(extensions: IExtensionIdentifier[], fromProfileLocation: URI, toProfileLocation: URI): Promise; uninstall(extension: ILocalExtension, options?: UninstallOptions): Promise; + uninstallExtensions(extensions: UninstallExtensionInfo[]): Promise; toggleAppliationScope(extension: ILocalExtension, fromProfileLocation: URI): Promise; reinstallFromGallery(extension: ILocalExtension): Promise; getInstalled(type?: ExtensionType, profileLocation?: URI, productVersion?: IProductVersion): Promise; getExtensionsControlManifest(): Promise; copyExtensions(fromProfileLocation: URI, toProfileLocation: URI): Promise; updateMetadata(local: ILocalExtension, metadata: Partial, profileLocation: URI): Promise; + resetPinnedStateForAllUserExtensions(pinned: boolean): Promise; download(extension: IGalleryExtension, operation: InstallOperation, donotVerifySignature: boolean): Promise; diff --git a/src/vs/platform/extensionManagement/common/extensionManagementCLI.ts b/src/vs/platform/extensionManagement/common/extensionManagementCLI.ts index 17c76f6fe70..69ba77c8c84 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagementCLI.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagementCLI.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { getErrorMessage, isCancellationError } from 'vs/base/common/errors'; -import { Schemas } from 'vs/base/common/network'; -import { basename } from 'vs/base/common/resources'; -import { gt } from 'vs/base/common/semver/semver'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { EXTENSION_IDENTIFIER_REGEX, IExtensionGalleryService, IExtensionInfo, IExtensionManagementService, IGalleryExtension, ILocalExtension, InstallOptions, InstallExtensionInfo, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions, getExtensionId, getGalleryExtensionId, getIdAndVersion } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { ExtensionType, EXTENSION_CATEGORIES, IExtensionManifest } from 'vs/platform/extensions/common/extensions'; -import { ILogger } from 'vs/platform/log/common/log'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { getErrorMessage, isCancellationError } from '../../../base/common/errors.js'; +import { Schemas } from '../../../base/common/network.js'; +import { basename } from '../../../base/common/resources.js'; +import { gt } from '../../../base/common/semver/semver.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { EXTENSION_IDENTIFIER_REGEX, IExtensionGalleryService, IExtensionInfo, IExtensionManagementService, IGalleryExtension, ILocalExtension, InstallOptions, InstallExtensionInfo, InstallOperation } from './extensionManagement.js'; +import { areSameExtensions, getExtensionId, getGalleryExtensionId, getIdAndVersion } from './extensionManagementUtil.js'; +import { ExtensionType, EXTENSION_CATEGORIES, IExtensionManifest } from '../../extensions/common/extensions.js'; +import { ILogger } from '../../log/common/log.js'; const notFound = (id: string) => localize('notFound', "Extension '{0}' not found.", id); @@ -224,7 +224,7 @@ export class ExtensionManagementCLI { } extensionsToInstall.push({ extension: gallery, - options: { ...installOptions, installGivenVersion: !!version, isApplicationScoped: installedExtension?.isApplicationScoped }, + options: { ...installOptions, installGivenVersion: !!version, isApplicationScoped: installOptions.isApplicationScoped || installedExtension?.isApplicationScoped }, }); })); @@ -253,7 +253,7 @@ export class ExtensionManagementCLI { const valid = await this.validateVSIX(manifest, force, installOptions.profileLocation, installedExtensions); if (valid) { try { - await this.extensionManagementService.install(vsix, installOptions); + await this.extensionManagementService.install(vsix, { ...installOptions, installGivenVersion: true }); this.logger.info(localize('successVsixInstall', "Extension '{0}' was successfully installed.", basename(vsix))); } catch (error) { if (isCancellationError(error)) { diff --git a/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts b/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts index 75cf3eb91ae..bc92b550b66 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { cloneAndChange } from 'vs/base/common/objects'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { DefaultURITransformer, IURITransformer, transformAndReviveIncomingURIs } from 'vs/base/common/uriIpc'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IExtensionIdentifier, IExtensionTipsService, IGalleryExtension, ILocalExtension, IExtensionsControlManifest, isTargetPlatformCompatible, InstallOptions, UninstallOptions, Metadata, IExtensionManagementService, DidUninstallExtensionEvent, InstallExtensionEvent, InstallExtensionResult, UninstallExtensionEvent, InstallOperation, InstallExtensionInfo, IProductVersion, DidUpdateExtensionMetadata } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionType, IExtensionManifest, TargetPlatform } from 'vs/platform/extensions/common/extensions'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { cloneAndChange } from '../../../base/common/objects.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { DefaultURITransformer, IURITransformer, transformAndReviveIncomingURIs } from '../../../base/common/uriIpc.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { IExtensionIdentifier, IExtensionTipsService, IGalleryExtension, ILocalExtension, IExtensionsControlManifest, isTargetPlatformCompatible, InstallOptions, UninstallOptions, Metadata, IExtensionManagementService, DidUninstallExtensionEvent, InstallExtensionEvent, InstallExtensionResult, UninstallExtensionEvent, InstallOperation, InstallExtensionInfo, IProductVersion, DidUpdateExtensionMetadata, UninstallExtensionInfo } from './extensionManagement.js'; +import { ExtensionType, IExtensionManifest, TargetPlatform } from '../../extensions/common/extensions.js'; function transformIncomingURI(uri: UriComponents, transformer: IURITransformer | null): URI; function transformIncomingURI(uri: UriComponents | undefined, transformer: IURITransformer | null): URI | undefined; @@ -109,9 +109,6 @@ export class ExtensionManagementChannel implements IServerChannel { const uri = await this.service.zip(extension); return transformOutgoingURI(uri, uriTransformer); } - case 'unzip': { - return this.service.unzip(transformIncomingURI(args[0], uriTransformer)); - } case 'install': { return this.service.install(transformIncomingURI(args[0], uriTransformer), transformIncomingOptions(args[1], uriTransformer)); } @@ -140,6 +137,10 @@ export class ExtensionManagementChannel implements IServerChannel { case 'uninstall': { return this.service.uninstall(transformIncomingExtension(args[0], uriTransformer), transformIncomingOptions(args[1], uriTransformer)); } + case 'uninstallExtensions': { + const arg: UninstallExtensionInfo[] = args[0]; + return this.service.uninstallExtensions(arg.map(({ extension, options }) => ({ extension: transformIncomingExtension(extension, uriTransformer), options: transformIncomingOptions(options, uriTransformer) }))); + } case 'reinstallFromGallery': { return this.service.reinstallFromGallery(transformIncomingExtension(args[0], uriTransformer)); } @@ -158,6 +159,9 @@ export class ExtensionManagementChannel implements IServerChannel { const e = await this.service.updateMetadata(transformIncomingExtension(args[0], uriTransformer), args[1], transformIncomingURI(args[2], uriTransformer)); return transformOutgoingExtension(e, uriTransformer); } + case 'resetPinnedStateForAllUserExtensions': { + return this.service.resetPinnedStateForAllUserExtensions(args[0]); + } case 'getExtensionsControlManifest': { return this.service.getExtensionsControlManifest(); } @@ -238,10 +242,6 @@ export class ExtensionManagementChannelClient extends Disposable implements IExt return Promise.resolve(this.channel.call('zip', [extension]).then(result => URI.revive(result))); } - unzip(zipLocation: URI): Promise { - return Promise.resolve(this.channel.call('unzip', [zipLocation])); - } - install(vsix: URI, options?: InstallOptions): Promise { return Promise.resolve(this.channel.call('install', [vsix, options])).then(local => transformIncomingExtension(local, null)); } @@ -275,6 +275,14 @@ export class ExtensionManagementChannelClient extends Disposable implements IExt return Promise.resolve(this.channel.call('uninstall', [extension, options])); } + uninstallExtensions(extensions: UninstallExtensionInfo[]): Promise { + if (extensions.some(e => e.extension.isWorkspaceScoped)) { + throw new Error('Cannot uninstall a workspace extension'); + } + return Promise.resolve(this.channel.call('uninstallExtensions', [extensions])); + + } + reinstallFromGallery(extension: ILocalExtension): Promise { return Promise.resolve(this.channel.call('reinstallFromGallery', [extension])).then(local => transformIncomingExtension(local, null)); } @@ -289,6 +297,10 @@ export class ExtensionManagementChannelClient extends Disposable implements IExt .then(extension => transformIncomingExtension(extension, null)); } + resetPinnedStateForAllUserExtensions(pinned: boolean): Promise { + return this.channel.call('resetPinnedStateForAllUserExtensions', [pinned]); + } + toggleAppliationScope(local: ILocalExtension, fromProfileLocation: URI): Promise { return this.channel.call('toggleAppliationScope', [local, fromProfileLocation]) .then(extension => transformIncomingExtension(extension, null)); diff --git a/src/vs/platform/extensionManagement/common/extensionManagementUtil.ts b/src/vs/platform/extensionManagement/common/extensionManagementUtil.ts index 301c7b18e70..0c3fca438cf 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagementUtil.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagementUtil.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { compareIgnoreCase } from 'vs/base/common/strings'; -import { IExtensionIdentifier, IGalleryExtension, ILocalExtension, getTargetPlatform } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionIdentifier, IExtension, TargetPlatform, UNDEFINED_PUBLISHER } from 'vs/platform/extensions/common/extensions'; -import { IFileService } from 'vs/platform/files/common/files'; -import { isLinux, platform } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { getErrorMessage } from 'vs/base/common/errors'; -import { ILogService } from 'vs/platform/log/common/log'; -import { arch } from 'vs/base/common/process'; -import { TelemetryTrustedValue } from 'vs/platform/telemetry/common/telemetryUtils'; +import { compareIgnoreCase } from '../../../base/common/strings.js'; +import { IExtensionIdentifier, IGalleryExtension, ILocalExtension, getTargetPlatform } from './extensionManagement.js'; +import { ExtensionIdentifier, IExtension, TargetPlatform, UNDEFINED_PUBLISHER } from '../../extensions/common/extensions.js'; +import { IFileService } from '../../files/common/files.js'; +import { isLinux, platform } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { getErrorMessage } from '../../../base/common/errors.js'; +import { ILogService } from '../../log/common/log.js'; +import { arch } from '../../../base/common/process.js'; +import { TelemetryTrustedValue } from '../../telemetry/common/telemetryUtils.js'; export function areSameExtensions(a: IExtensionIdentifier, b: IExtensionIdentifier): boolean { if (a.uuid && b.uuid) { diff --git a/src/vs/platform/extensionManagement/common/extensionNls.ts b/src/vs/platform/extensionManagement/common/extensionNls.ts index 2f196970f3f..f35e866051d 100644 --- a/src/vs/platform/extensionManagement/common/extensionNls.ts +++ b/src/vs/platform/extensionManagement/common/extensionNls.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isObject, isString } from 'vs/base/common/types'; -import { ILocalizedString } from 'vs/platform/action/common/action'; -import { IExtensionManifest } from 'vs/platform/extensions/common/extensions'; -import { localize } from 'vs/nls'; -import { ILogger } from 'vs/platform/log/common/log'; +import { isObject, isString } from '../../../base/common/types.js'; +import { ILocalizedString } from '../../action/common/action.js'; +import { IExtensionManifest } from '../../extensions/common/extensions.js'; +import { localize } from '../../../nls.js'; +import { ILogger } from '../../log/common/log.js'; export interface ITranslations { [key: string]: string | { message: string; comment: string[] } | undefined; diff --git a/src/vs/platform/extensionManagement/common/extensionStorage.ts b/src/vs/platform/extensionManagement/common/extensionStorage.ts index 0af530f2a55..1d50102ede9 100644 --- a/src/vs/platform/extensionManagement/common/extensionStorage.ts +++ b/src/vs/platform/extensionManagement/common/extensionStorage.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { IProfileStorageValueChangeEvent, IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { adoptToGalleryExtensionId, areSameExtensions, getExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { distinct } from 'vs/base/common/arrays'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IExtension } from 'vs/platform/extensions/common/extensions'; -import { isString } from 'vs/base/common/types'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { IExtensionManagementService, IGalleryExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { IProfileStorageValueChangeEvent, IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { adoptToGalleryExtensionId, areSameExtensions, getExtensionId } from './extensionManagementUtil.js'; +import { IProductService } from '../../product/common/productService.js'; +import { distinct } from '../../../base/common/arrays.js'; +import { ILogService } from '../../log/common/log.js'; +import { IExtension } from '../../extensions/common/extensions.js'; +import { isString } from '../../../base/common/types.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { IExtensionManagementService, IGalleryExtension } from './extensionManagement.js'; export interface IExtensionIdWithVersion { id: string; diff --git a/src/vs/platform/extensionManagement/common/extensionTipsService.ts b/src/vs/platform/extensionManagement/common/extensionTipsService.ts index 813064a24e5..f63a4b7b21f 100644 --- a/src/vs/platform/extensionManagement/common/extensionTipsService.ts +++ b/src/vs/platform/extensionManagement/common/extensionTipsService.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { Disposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { IConfigBasedExtensionTip as IRawConfigBasedExtensionTip } from 'vs/base/common/product'; -import { joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { IConfigBasedExtensionTip, IExecutableBasedExtensionTip, IExtensionManagementService, IExtensionTipsService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { disposableTimeout } from 'vs/base/common/async'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Event } from 'vs/base/common/event'; -import { join } from 'vs/base/common/path'; -import { isWindows } from 'vs/base/common/platform'; -import { env } from 'vs/base/common/process'; -import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { IExtensionRecommendationNotificationService, RecommendationsNotificationResult, RecommendationSource } from 'vs/platform/extensionRecommendations/common/extensionRecommendations'; -import { ExtensionType } from 'vs/platform/extensions/common/extensions'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { isNonEmptyArray } from '../../../base/common/arrays.js'; +import { Disposable, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { IConfigBasedExtensionTip as IRawConfigBasedExtensionTip } from '../../../base/common/product.js'; +import { joinPath } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { IConfigBasedExtensionTip, IExecutableBasedExtensionTip, IExtensionManagementService, IExtensionTipsService, ILocalExtension } from './extensionManagement.js'; +import { IFileService } from '../../files/common/files.js'; +import { IProductService } from '../../product/common/productService.js'; +import { disposableTimeout } from '../../../base/common/async.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Event } from '../../../base/common/event.js'; +import { join } from '../../../base/common/path.js'; +import { isWindows } from '../../../base/common/platform.js'; +import { env } from '../../../base/common/process.js'; +import { areSameExtensions } from './extensionManagementUtil.js'; +import { IExtensionRecommendationNotificationService, RecommendationsNotificationResult, RecommendationSource } from '../../extensionRecommendations/common/extensionRecommendations.js'; +import { ExtensionType } from '../../extensions/common/extensions.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; //#region Base Extension Tips Service diff --git a/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.ts b/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.ts index d3d1816b40b..ced131827be 100644 --- a/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.ts +++ b/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Queue } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Emitter, Event } from 'vs/base/common/event'; -import { ResourceMap } from 'vs/base/common/map'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { Metadata, isIExtensionIdentifier } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { IExtension, IExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { FileOperationResult, IFileService, toFileOperationResult } from 'vs/platform/files/common/files'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { Mutable, isObject, isString, isUndefined } from 'vs/base/common/types'; -import { getErrorMessage } from 'vs/base/common/errors'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { Queue } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { Metadata, isIExtensionIdentifier } from './extensionManagement.js'; +import { areSameExtensions } from './extensionManagementUtil.js'; +import { IExtension, IExtensionIdentifier } from '../../extensions/common/extensions.js'; +import { FileOperationResult, IFileService, toFileOperationResult } from '../../files/common/files.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { Mutable, isObject, isString, isUndefined } from '../../../base/common/types.js'; +import { getErrorMessage } from '../../../base/common/errors.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; interface IStoredProfileExtension { identifier: IExtensionIdentifier; diff --git a/src/vs/platform/extensionManagement/common/extensionsScannerService.ts b/src/vs/platform/extensionManagement/common/extensionsScannerService.ts index 74c8eeaeb1f..8f238a84029 100644 --- a/src/vs/platform/extensionManagement/common/extensionsScannerService.ts +++ b/src/vs/platform/extensionManagement/common/extensionsScannerService.ts @@ -3,39 +3,39 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce } from 'vs/base/common/arrays'; -import { ThrottledDelayer } from 'vs/base/common/async'; -import * as objects from 'vs/base/common/objects'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { getErrorMessage } from 'vs/base/common/errors'; -import { getNodeType, parse, ParseError } from 'vs/base/common/json'; -import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { FileAccess, Schemas } from 'vs/base/common/network'; -import * as path from 'vs/base/common/path'; -import * as platform from 'vs/base/common/platform'; -import { basename, isEqual, joinPath } from 'vs/base/common/resources'; -import * as semver from 'vs/base/common/semver/semver'; -import Severity from 'vs/base/common/severity'; -import { isEmptyObject } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IProductVersion, Metadata } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions, computeTargetPlatform, ExtensionKey, getExtensionId, getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { ExtensionType, ExtensionIdentifier, IExtensionManifest, TargetPlatform, IExtensionIdentifier, IRelaxedExtensionManifest, UNDEFINED_PUBLISHER, IExtensionDescription, BUILTIN_MANIFEST_CACHE_FILE, USER_MANIFEST_CACHE_FILE, ExtensionIdentifierMap, parseEnabledApiProposalNames } from 'vs/platform/extensions/common/extensions'; -import { validateExtensionManifest } from 'vs/platform/extensions/common/extensionValidator'; -import { FileOperationResult, IFileService, toFileOperationResult } from 'vs/platform/files/common/files'; -import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { Emitter, Event } from 'vs/base/common/event'; -import { revive } from 'vs/base/common/marshalling'; -import { ExtensionsProfileScanningError, ExtensionsProfileScanningErrorCode, IExtensionsProfileScannerService, IProfileExtensionsScanOptions, IScannedProfileExtension } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { localizeManifest } from 'vs/platform/extensionManagement/common/extensionNls'; +import { coalesce } from '../../../base/common/arrays.js'; +import { ThrottledDelayer } from '../../../base/common/async.js'; +import * as objects from '../../../base/common/objects.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { getErrorMessage } from '../../../base/common/errors.js'; +import { getNodeType, parse, ParseError } from '../../../base/common/json.js'; +import { getParseErrorMessage } from '../../../base/common/jsonErrorMessages.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { FileAccess, Schemas } from '../../../base/common/network.js'; +import * as path from '../../../base/common/path.js'; +import * as platform from '../../../base/common/platform.js'; +import { basename, isEqual, joinPath } from '../../../base/common/resources.js'; +import * as semver from '../../../base/common/semver/semver.js'; +import Severity from '../../../base/common/severity.js'; +import { isEmptyObject } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IProductVersion, Metadata } from './extensionManagement.js'; +import { areSameExtensions, computeTargetPlatform, ExtensionKey, getExtensionId, getGalleryExtensionId } from './extensionManagementUtil.js'; +import { ExtensionType, ExtensionIdentifier, IExtensionManifest, TargetPlatform, IExtensionIdentifier, IRelaxedExtensionManifest, UNDEFINED_PUBLISHER, IExtensionDescription, BUILTIN_MANIFEST_CACHE_FILE, USER_MANIFEST_CACHE_FILE, ExtensionIdentifierMap, parseEnabledApiProposalNames } from '../../extensions/common/extensions.js'; +import { validateExtensionManifest } from '../../extensions/common/extensionValidator.js'; +import { FileOperationResult, IFileService, toFileOperationResult } from '../../files/common/files.js'; +import { createDecorator, IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { ExtensionsProfileScanningError, ExtensionsProfileScanningErrorCode, IExtensionsProfileScannerService, IProfileExtensionsScanOptions, IScannedProfileExtension } from './extensionsProfileScannerService.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { localizeManifest } from './extensionNls.js'; export type IScannedExtensionManifest = IRelaxedExtensionManifest & { __metadata?: Metadata }; @@ -562,6 +562,7 @@ class ExtensionsScanner extends Disposable { @IUriIdentityService protected readonly uriIdentityService: IUriIdentityService, @IFileService protected readonly fileService: IFileService, @IProductService productService: IProductService, + @IEnvironmentService private readonly environmentService: IEnvironmentService, @ILogService protected readonly logService: ILogService ) { super(); @@ -657,10 +658,7 @@ class ExtensionsScanner extends Disposable { const type = metadata?.isSystem ? ExtensionType.System : input.type; const isBuiltin = type === ExtensionType.System || !!metadata?.isBuiltin; manifest = await this.translateManifest(input.location, manifest, ExtensionScannerInput.createNlsConfiguration(input)); - if (manifest.enabledApiProposals && !this.extensionsEnabledWithApiProposalVersion?.includes(id.toLowerCase())) { - manifest.enabledApiProposals = parseEnabledApiProposalNames([...manifest.enabledApiProposals]); - } - const extension: IRelaxedScannedExtension = { + let extension: IRelaxedScannedExtension = { type, identifier, manifest, @@ -672,7 +670,14 @@ class ExtensionsScanner extends Disposable { isValid: true, validations: [] }; - return input.validate ? this.validate(extension, input) : extension; + if (input.validate) { + extension = this.validate(extension, input); + } + if (manifest.enabledApiProposals && (!this.environmentService.isBuilt || this.extensionsEnabledWithApiProposalVersion.includes(id.toLowerCase()))) { + manifest.originalEnabledApiProposals = manifest.enabledApiProposals; + manifest.enabledApiProposals = parseEnabledApiProposalNames([...manifest.enabledApiProposals]); + } + return extension; } } catch (e) { if (input.type !== ExtensionType.System) { @@ -684,7 +689,8 @@ class ExtensionsScanner extends Disposable { validate(extension: IRelaxedScannedExtension, input: ExtensionScannerInput): IRelaxedScannedExtension { let isValid = true; - const validations = validateExtensionManifest(input.productVersion, input.productDate, input.location, extension.manifest, extension.isBuiltin); + const validateApiVersion = this.environmentService.isBuilt && this.extensionsEnabledWithApiProposalVersion.includes(extension.identifier.id.toLowerCase()); + const validations = validateExtensionManifest(input.productVersion, input.productDate, input.location, extension.manifest, extension.isBuiltin, validateApiVersion); for (const [severity, message] of validations) { if (severity === Severity.Error) { isValid = false; @@ -720,7 +726,7 @@ class ExtensionsScanner extends Disposable { return null; } if (getNodeType(manifest) !== 'object') { - this.logService.error(this.formatMessage(extensionLocation, localize('jsonParseInvalidType', "Invalid manifest file {0}: Not an JSON object.", manifestLocation.path))); + this.logService.error(this.formatMessage(extensionLocation, localize('jsonParseInvalidType', "Invalid manifest file {0}: Not a JSON object.", manifestLocation.path))); return null; } return manifest; @@ -886,9 +892,10 @@ class CachedExtensionsScanner extends ExtensionsScanner { @IUriIdentityService uriIdentityService: IUriIdentityService, @IFileService fileService: IFileService, @IProductService productService: IProductService, + @IEnvironmentService environmentService: IEnvironmentService, @ILogService logService: ILogService ) { - super(obsoleteFile, extensionsProfileScannerService, uriIdentityService, fileService, productService, logService); + super(obsoleteFile, extensionsProfileScannerService, uriIdentityService, fileService, productService, environmentService, logService); } override async scanExtensions(input: ExtensionScannerInput): Promise { diff --git a/src/vs/platform/extensionManagement/common/implicitActivationEvents.ts b/src/vs/platform/extensionManagement/common/implicitActivationEvents.ts index ecd1c43fb1d..b8a52b5e9aa 100644 --- a/src/vs/platform/extensionManagement/common/implicitActivationEvents.ts +++ b/src/vs/platform/extensionManagement/common/implicitActivationEvents.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { onUnexpectedError } from 'vs/base/common/errors'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../extensions/common/extensions.js'; export interface IActivationEventsGenerator { (contributions: T[], result: { push(item: string): void }): void; diff --git a/src/vs/platform/extensionManagement/common/unsupportedExtensionsMigration.ts b/src/vs/platform/extensionManagement/common/unsupportedExtensionsMigration.ts index 57aadd8fc1d..1fea9a2abf8 100644 --- a/src/vs/platform/extensionManagement/common/unsupportedExtensionsMigration.ts +++ b/src/vs/platform/extensionManagement/common/unsupportedExtensionsMigration.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IExtensionGalleryService, IExtensionManagementService, IGlobalExtensionEnablementService, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions, getExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { IExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage'; -import { ExtensionType } from 'vs/platform/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IExtensionGalleryService, IExtensionManagementService, IGlobalExtensionEnablementService, InstallOperation } from './extensionManagement.js'; +import { areSameExtensions, getExtensionId } from './extensionManagementUtil.js'; +import { IExtensionStorageService } from './extensionStorage.js'; +import { ExtensionType } from '../../extensions/common/extensions.js'; +import { ILogService } from '../../log/common/log.js'; /** * Migrates the installed unsupported nightly extension to a supported pre-release extension. It includes following: diff --git a/src/vs/platform/extensionManagement/electron-sandbox/extensionsProfileScannerService.ts b/src/vs/platform/extensionManagement/electron-sandbox/extensionsProfileScannerService.ts index 98f5a2194f9..2299ce88003 100644 --- a/src/vs/platform/extensionManagement/electron-sandbox/extensionsProfileScannerService.ts +++ b/src/vs/platform/extensionManagement/electron-sandbox/extensionsProfileScannerService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ILogService } from 'vs/platform/log/common/log'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { AbstractExtensionsProfileScannerService, IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { URI } from 'vs/base/common/uri'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { ILogService } from '../../log/common/log.js'; +import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { AbstractExtensionsProfileScannerService, IExtensionsProfileScannerService } from '../common/extensionsProfileScannerService.js'; +import { IFileService } from '../../files/common/files.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { URI } from '../../../base/common/uri.js'; +import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js'; export class ExtensionsProfileScannerService extends AbstractExtensionsProfileScannerService { constructor( diff --git a/src/vs/platform/extensionManagement/node/extensionDownloader.ts b/src/vs/platform/extensionManagement/node/extensionDownloader.ts index 0ddae28ed93..850dba7113d 100644 --- a/src/vs/platform/extensionManagement/node/extensionDownloader.ts +++ b/src/vs/platform/extensionManagement/node/extensionDownloader.ts @@ -3,28 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Promises } from 'vs/base/common/async'; -import { getErrorMessage } from 'vs/base/common/errors'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { joinPath } from 'vs/base/common/resources'; -import * as semver from 'vs/base/common/semver/semver'; -import { isBoolean } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { Promises as FSPromises } from 'vs/base/node/pfs'; -import { buffer, CorruptZipMessage } from 'vs/base/node/zip'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ExtensionVerificationStatus, toExtensionManagementError } from 'vs/platform/extensionManagement/common/abstractExtensionManagementService'; -import { ExtensionManagementError, ExtensionManagementErrorCode, IExtensionGalleryService, IGalleryExtension, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionKey, groupByExtension } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { fromExtractError } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; -import { ExtensionSignatureVerificationError, ExtensionSignatureVerificationCode, IExtensionSignatureVerificationService } from 'vs/platform/extensionManagement/node/extensionSignatureVerificationService'; -import { TargetPlatform } from 'vs/platform/extensions/common/extensions'; -import { IFileService, IFileStatWithMetadata } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { Promises } from '../../../base/common/async.js'; +import { getErrorMessage } from '../../../base/common/errors.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { joinPath } from '../../../base/common/resources.js'; +import * as semver from '../../../base/common/semver/semver.js'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { Promises as FSPromises } from '../../../base/node/pfs.js'; +import { buffer, CorruptZipMessage } from '../../../base/node/zip.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { toExtensionManagementError } from '../common/abstractExtensionManagementService.js'; +import { ExtensionManagementError, ExtensionManagementErrorCode, ExtensionSignatureVerificationCode, IExtensionGalleryService, IGalleryExtension, InstallOperation } from '../common/extensionManagement.js'; +import { ExtensionKey, groupByExtension } from '../common/extensionManagementUtil.js'; +import { fromExtractError } from './extensionManagementUtil.js'; +import { IExtensionSignatureVerificationService } from './extensionSignatureVerificationService.js'; +import { TargetPlatform } from '../../extensions/common/extensions.js'; +import { IFileService, IFileStatWithMetadata } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; type RetryDownloadClassification = { owner: 'sandy081'; @@ -49,7 +47,6 @@ export class ExtensionsDownloader extends Disposable { @INativeEnvironmentService environmentService: INativeEnvironmentService, @IFileService private readonly fileService: IFileService, @IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService, - @IConfigurationService private readonly configurationService: IConfigurationService, @IExtensionSignatureVerificationService private readonly extensionSignatureVerificationService: IExtensionSignatureVerificationService, @ITelemetryService private readonly telemetryService: ITelemetryService, @ILogService private readonly logService: ILogService, @@ -60,42 +57,39 @@ export class ExtensionsDownloader extends Disposable { this.cleanUpPromise = this.cleanUp(); } - async download(extension: IGalleryExtension, operation: InstallOperation, verifySignature: boolean, clientTargetPlatform?: TargetPlatform): Promise<{ readonly location: URI; readonly verificationStatus: ExtensionVerificationStatus }> { + async download(extension: IGalleryExtension, operation: InstallOperation, verifySignature: boolean, clientTargetPlatform?: TargetPlatform): Promise<{ readonly location: URI; readonly verificationStatus: ExtensionSignatureVerificationCode | undefined }> { await this.cleanUpPromise; const location = await this.downloadVSIX(extension, operation); - let verificationStatus: ExtensionVerificationStatus = false; - - if (verifySignature && this.shouldVerifySignature(extension)) { + if (!verifySignature || !extension.isSigned) { + return { location, verificationStatus: undefined }; + } - let signatureArchiveLocation; - try { - signatureArchiveLocation = await this.downloadSignatureArchive(extension); - } catch (error) { + let signatureArchiveLocation; + try { + signatureArchiveLocation = await this.downloadSignatureArchive(extension); + const verificationStatus = (await this.extensionSignatureVerificationService.verify(extension.identifier.id, extension.version, location.fsPath, signatureArchiveLocation.fsPath, clientTargetPlatform))?.code; + if (verificationStatus === ExtensionSignatureVerificationCode.PackageIsInvalidZip || verificationStatus === ExtensionSignatureVerificationCode.SignatureArchiveIsInvalidZip) { try { - // Delete the downloaded VSIX if signature archive download fails + // Delete the downloaded vsix if VSIX or signature archive is invalid await this.delete(location); } catch (error) { this.logService.error(error); } - throw error; + throw new ExtensionManagementError(CorruptZipMessage, ExtensionManagementErrorCode.CorruptZip); } - + return { location, verificationStatus }; + } catch (error) { try { - verificationStatus = await this.extensionSignatureVerificationService.verify(extension, location.fsPath, signatureArchiveLocation.fsPath, clientTargetPlatform); + // Delete the downloaded VSIX if signature archive download fails + await this.delete(location); } catch (error) { - verificationStatus = (error as ExtensionSignatureVerificationError).code; - if (verificationStatus === ExtensionSignatureVerificationCode.PackageIsInvalidZip || verificationStatus === ExtensionSignatureVerificationCode.SignatureArchiveIsInvalidZip) { - try { - // Delete the downloaded vsix if VSIX or signature archive is invalid - await this.delete(location); - } catch (error) { - this.logService.error(error); - } - throw new ExtensionManagementError(CorruptZipMessage, ExtensionManagementErrorCode.CorruptZip); - } - } finally { + this.logService.error(error); + } + throw error; + } finally { + if (signatureArchiveLocation) { try { // Delete signature archive always await this.delete(signatureArchiveLocation); @@ -104,18 +98,6 @@ export class ExtensionsDownloader extends Disposable { } } } - - return { location, verificationStatus }; - } - - private shouldVerifySignature(extension: IGalleryExtension): boolean { - if (!extension.isSigned) { - this.logService.info(`Extension is not signed: ${extension.identifier.id}`); - return false; - } - - const value = this.configurationService.getValue('extensions.verifySignature'); - return isBoolean(value) ? value : true; } private async downloadVSIX(extension: IGalleryExtension, operation: InstallOperation): Promise { diff --git a/src/vs/platform/extensionManagement/node/extensionLifecycle.ts b/src/vs/platform/extensionManagement/node/extensionLifecycle.ts index 8de8416e712..cdc0a4767ff 100644 --- a/src/vs/platform/extensionManagement/node/extensionLifecycle.ts +++ b/src/vs/platform/extensionManagement/node/extensionLifecycle.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import { ChildProcess, fork } from 'child_process'; -import { Limiter } from 'vs/base/common/async'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { join } from 'vs/base/common/path'; -import { Promises } from 'vs/base/node/pfs'; -import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { Limiter } from '../../../base/common/async.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { join } from '../../../base/common/path.js'; +import { Promises } from '../../../base/node/pfs.js'; +import { ILocalExtension } from '../common/extensionManagement.js'; +import { ILogService } from '../../log/common/log.js'; +import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; export class ExtensionsLifecycle extends Disposable { diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index 1444a63134c..680e0dd15be 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -3,52 +3,56 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Promises, Queue } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { CancellationError, getErrorMessage } from 'vs/base/common/errors'; -import { Emitter } from 'vs/base/common/event'; -import { hash } from 'vs/base/common/hash'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ResourceMap, ResourceSet } from 'vs/base/common/map'; -import { Schemas } from 'vs/base/common/network'; -import * as path from 'vs/base/common/path'; -import { joinPath } from 'vs/base/common/resources'; -import * as semver from 'vs/base/common/semver/semver'; -import { isBoolean } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import * as pfs from 'vs/base/node/pfs'; -import { extract, IFile, zip } from 'vs/base/node/zip'; -import * as nls from 'vs/nls'; -import { IDownloadService } from 'vs/platform/download/common/download'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { AbstractExtensionManagementService, AbstractExtensionTask, ExtensionVerificationStatus, IInstallExtensionTask, InstallExtensionTaskOptions, IUninstallExtensionTask, toExtensionManagementError, UninstallExtensionTaskOptions } from 'vs/platform/extensionManagement/common/abstractExtensionManagementService'; +import * as fs from 'fs'; +import { Promises, Queue } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { CancellationError, getErrorMessage } from '../../../base/common/errors.js'; +import { Emitter } from '../../../base/common/event.js'; +import { hash } from '../../../base/common/hash.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { ResourceMap, ResourceSet } from '../../../base/common/map.js'; +import { Schemas } from '../../../base/common/network.js'; +import * as path from '../../../base/common/path.js'; +import { joinPath } from '../../../base/common/resources.js'; +import * as semver from '../../../base/common/semver/semver.js'; +import { isBoolean } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import * as pfs from '../../../base/node/pfs.js'; +import { extract, IFile, zip } from '../../../base/node/zip.js'; +import * as nls from '../../../nls.js'; +import { IDownloadService } from '../../download/common/download.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { AbstractExtensionManagementService, AbstractExtensionTask, IInstallExtensionTask, InstallExtensionTaskOptions, IUninstallExtensionTask, toExtensionManagementError, UninstallExtensionTaskOptions } from '../common/abstractExtensionManagementService.js'; import { ExtensionManagementError, ExtensionManagementErrorCode, IExtensionGalleryService, IExtensionIdentifier, IExtensionManagementService, IGalleryExtension, ILocalExtension, InstallOperation, Metadata, InstallOptions, IProductVersion, EXTENSION_INSTALL_CLIENT_TARGET_PLATFORM_CONTEXT, -} from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions, computeTargetPlatform, ExtensionKey, getGalleryExtensionId, groupByExtension } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { IExtensionsProfileScannerService, IScannedProfileExtension } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { IExtensionsScannerService, IScannedExtension, ScanOptions } from 'vs/platform/extensionManagement/common/extensionsScannerService'; -import { ExtensionsDownloader } from 'vs/platform/extensionManagement/node/extensionDownloader'; -import { ExtensionsLifecycle } from 'vs/platform/extensionManagement/node/extensionLifecycle'; -import { fromExtractError, getManifest } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; -import { ExtensionsManifestCache } from 'vs/platform/extensionManagement/node/extensionsManifestCache'; -import { DidChangeProfileExtensionsEvent, ExtensionsWatcher } from 'vs/platform/extensionManagement/node/extensionsWatcher'; -import { ExtensionType, IExtension, IExtensionManifest, TargetPlatform } from 'vs/platform/extensions/common/extensions'; -import { isEngineValid } from 'vs/platform/extensions/common/extensionValidator'; -import { FileChangesEvent, FileChangeType, FileOperationResult, IFileService, toFileOperationResult } from 'vs/platform/files/common/files'; -import { IInstantiationService, refineServiceDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; + ExtensionSignatureVerificationCode, +} from '../common/extensionManagement.js'; +import { areSameExtensions, computeTargetPlatform, ExtensionKey, getGalleryExtensionId, groupByExtension } from '../common/extensionManagementUtil.js'; +import { IExtensionsProfileScannerService, IScannedProfileExtension } from '../common/extensionsProfileScannerService.js'; +import { IExtensionsScannerService, IScannedExtension, ScanOptions } from '../common/extensionsScannerService.js'; +import { ExtensionsDownloader } from './extensionDownloader.js'; +import { ExtensionsLifecycle } from './extensionLifecycle.js'; +import { fromExtractError, getManifest } from './extensionManagementUtil.js'; +import { ExtensionsManifestCache } from './extensionsManifestCache.js'; +import { DidChangeProfileExtensionsEvent, ExtensionsWatcher } from './extensionsWatcher.js'; +import { ExtensionType, IExtension, IExtensionManifest, TargetPlatform } from '../../extensions/common/extensions.js'; +import { isEngineValid } from '../../extensions/common/extensionValidator.js'; +import { FileChangesEvent, FileChangeType, FileOperationResult, IFileService, toFileOperationResult } from '../../files/common/files.js'; +import { IInstantiationService, refineServiceDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { isLinux } from '../../../base/common/platform.js'; export const INativeServerExtensionManagementService = refineServiceDecorator(IExtensionManagementService); export interface INativeServerExtensionManagementService extends IExtensionManagementService { @@ -58,7 +62,7 @@ export interface INativeServerExtensionManagementService extends IExtensionManag markAsUninstalled(...extensions: IExtension[]): Promise; } -type ExtractExtensionResult = { readonly local: ILocalExtension; readonly verificationStatus?: ExtensionVerificationStatus }; +type ExtractExtensionResult = { readonly local: ILocalExtension; readonly verificationStatus?: ExtensionSignatureVerificationCode }; const DELETED_FOLDER_POSTFIX = '.vsctmp'; @@ -74,12 +78,13 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi @IExtensionGalleryService galleryService: IExtensionGalleryService, @ITelemetryService telemetryService: ITelemetryService, @ILogService logService: ILogService, - @INativeEnvironmentService environmentService: INativeEnvironmentService, + @INativeEnvironmentService private readonly environmentService: INativeEnvironmentService, @IExtensionsScannerService private readonly extensionsScannerService: IExtensionsScannerService, @IExtensionsProfileScannerService private readonly extensionsProfileScannerService: IExtensionsProfileScannerService, @IDownloadService private downloadService: IDownloadService, @IInstantiationService private readonly instantiationService: IInstantiationService, @IFileService private readonly fileService: IFileService, + @IConfigurationService private readonly configurationService: IConfigurationService, @IProductService productService: IProductService, @IUriIdentityService uriIdentityService: IUriIdentityService, @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService @@ -110,12 +115,6 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi return URI.file(location); } - async unzip(zipLocation: URI): Promise { - this.logService.trace('ExtensionManagementService#unzip', zipLocation.toString()); - const local = await this.install(zipLocation); - return local.identifier; - } - async getManifest(vsix: URI): Promise { const { location, cleanup } = await this.downloadVsix(vsix); const zipPath = path.resolve(location.fsPath); @@ -251,7 +250,7 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi } async download(extension: IGalleryExtension, operation: InstallOperation, donotVerifySignature: boolean): Promise { - const { location } = await this.extensionsDownloader.download(extension, operation, !donotVerifySignature); + const { location } = await this.downloadExtension(extension, operation, !donotVerifySignature); return location; } @@ -293,11 +292,11 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi } protected createUninstallExtensionTask(extension: ILocalExtension, options: UninstallExtensionTaskOptions): IUninstallExtensionTask { - return new UninstallExtensionInProfileTask(extension, options.profileLocation, this.extensionsProfileScannerService); + return new UninstallExtensionInProfileTask(extension, options, this.extensionsProfileScannerService); } private async downloadAndExtractGalleryExtension(extensionKey: ExtensionKey, gallery: IGalleryExtension, operation: InstallOperation, options: InstallExtensionTaskOptions, token: CancellationToken): Promise { - const { verificationStatus, location } = await this.extensionsDownloader.download(gallery, operation, !options.donotVerifySignature, options.context?.[EXTENSION_INSTALL_CLIENT_TARGET_PLATFORM_CONTEXT]); + const { verificationStatus, location } = await this.downloadExtension(gallery, operation, !options.donotVerifySignature, options.context?.[EXTENSION_INSTALL_CLIENT_TARGET_PLATFORM_CONTEXT]); try { if (token.isCancellationRequested) { @@ -305,7 +304,10 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi } // validate manifest - await getManifest(location.fsPath); + const manifest = await getManifest(location.fsPath); + if (!new ExtensionKey(gallery.identifier, gallery.version).equals(new ExtensionKey({ id: getGalleryExtensionId(manifest.publisher, manifest.name) }, manifest.version))) { + throw new ExtensionManagementError(nls.localize('invalidManifest', "Cannot install '{0}' extension because of manifest mismatch with Marketplace", gallery.identifier.id), ExtensionManagementErrorCode.Invalid); + } const local = await this.extensionsScanner.extractUserExtension( extensionKey, @@ -341,6 +343,42 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi } } + private async downloadExtension(extension: IGalleryExtension, operation: InstallOperation, verifySignature: boolean, clientTargetPlatform?: TargetPlatform): Promise<{ readonly location: URI; readonly verificationStatus: ExtensionSignatureVerificationCode | undefined }> { + if (verifySignature) { + const value = this.configurationService.getValue('extensions.verifySignature'); + verifySignature = isBoolean(value) ? value : true; + } + const { location, verificationStatus } = await this.extensionsDownloader.download(extension, operation, verifySignature, clientTargetPlatform); + + if (verificationStatus !== ExtensionSignatureVerificationCode.Success && verifySignature && this.environmentService.isBuilt && !isLinux) { + if (!extension.isSigned) { + throw new ExtensionManagementError(nls.localize('not signed', "Extension is not signed."), ExtensionManagementErrorCode.PackageNotSigned); + } + + if (!verificationStatus) { + throw new ExtensionManagementError(nls.localize('signature verification not executed', "Signature verification was not executed."), ExtensionManagementErrorCode.SignatureVerificationInternal); + } + + switch (verificationStatus) { + case ExtensionSignatureVerificationCode.PackageIntegrityCheckFailed: + case ExtensionSignatureVerificationCode.SignatureIsInvalid: + case ExtensionSignatureVerificationCode.SignatureManifestIsInvalid: + case ExtensionSignatureVerificationCode.SignatureIntegrityCheckFailed: + case ExtensionSignatureVerificationCode.EntryIsMissing: + case ExtensionSignatureVerificationCode.EntryIsTampered: + case ExtensionSignatureVerificationCode.Untrusted: + case ExtensionSignatureVerificationCode.CertificateRevoked: + case ExtensionSignatureVerificationCode.SignatureIsNotValid: + case ExtensionSignatureVerificationCode.SignatureArchiveHasTooManyEntries: + throw new ExtensionManagementError(nls.localize('signature verification failed', "Signature verification failed with '{0}' error.", verificationStatus), ExtensionManagementErrorCode.SignatureVerificationFailed); + } + + throw new ExtensionManagementError(nls.localize('signature verification failed', "Signature verification failed with '{0}' error.", verificationStatus), ExtensionManagementErrorCode.SignatureVerificationInternal); + } + + return { location, verificationStatus }; + } + private async extractVSIX(extensionKey: ExtensionKey, location: URI, options: InstallExtensionTaskOptions, token: CancellationToken): Promise { const local = await this.extensionsScanner.extractUserExtension( extensionKey, @@ -353,7 +391,7 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi pinned: options.installGivenVersion ? true : !!options.pinned, source: 'vsix', }, - true, + options.keepExisting ?? true, token); return { local }; } @@ -363,7 +401,7 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi const collectFilesFromDirectory = async (dir: string): Promise => { let entries = await pfs.Promises.readdir(dir); entries = entries.map(e => path.join(dir, e)); - const stats = await Promise.all(entries.map(e => pfs.Promises.stat(e))); + const stats = await Promise.all(entries.map(e => fs.promises.stat(e))); let promise: Promise = Promise.resolve([]); stats.forEach((stat, index) => { const entry = entries[index]; @@ -380,7 +418,7 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi }; const files = await collectFilesFromDirectory(extension.location.fsPath); - return files.map(f => ({ path: `extension/${path.relative(extension.location.fsPath, f)}`, localPath: f })); + return files.map(f => ({ path: `extension/${path.relative(extension.location.fsPath, f)}`, localPath: f })); } private async onDidChangeExtensionsFromAnotherSource({ added, removed }: DidChangeProfileExtensionsEvent): Promise { @@ -488,11 +526,13 @@ type UpdateMetadataErrorClassification = { owner: 'sandy081'; comment: 'Update metadata error'; extensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'extension identifier' }; - code?: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'result code of the verification' }; + code?: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'error code' }; + isProfile?: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Is writing into profile' }; }; type UpdateMetadataErrorEvent = { extensionId: string; code?: string; + isProfile?: boolean; }; export class ExtensionsScanner extends Disposable { @@ -579,71 +619,67 @@ export class ExtensionsScanner extends Disposable { const tempLocation = URI.file(path.join(this.extensionsScannerService.userExtensionsLocation.fsPath, `.${generateUuid()}`)); const extensionLocation = URI.file(path.join(this.extensionsScannerService.userExtensionsLocation.fsPath, folderName)); - let exists = await this.fileService.exists(extensionLocation); + if (await this.fileService.exists(extensionLocation)) { + if (!removeIfExists) { + try { + return await this.scanLocalExtension(extensionLocation, ExtensionType.User); + } catch (error) { + this.logService.warn(`Error while scanning the existing extension at ${extensionLocation.path}. Deleting the existing extension and extracting it.`, getErrorMessage(error)); + } + } - if (exists && removeIfExists) { try { await this.deleteExtensionFromLocation(extensionKey.id, extensionLocation, 'removeExisting'); } catch (error) { throw new ExtensionManagementError(nls.localize('errorDeleting', "Unable to delete the existing folder '{0}' while installing the extension '{1}'. Please delete the folder manually and try again", extensionLocation.fsPath, extensionKey.id), ExtensionManagementErrorCode.Delete); } - exists = false; } - if (exists) { - try { - await this.extensionsScannerService.updateMetadata(extensionLocation, metadata); - } catch (error) { - this.telemetryService.publicLog2('extension:extract', { extensionId: extensionKey.id, code: error.code }); - throw toExtensionManagementError(error, ExtensionManagementErrorCode.UpdateExistingMetadata); + try { + if (token.isCancellationRequested) { + throw new CancellationError(); } - } else { - try { - if (token.isCancellationRequested) { - throw new CancellationError(); - } - // Extract - try { - this.logService.trace(`Started extracting the extension from ${zipPath} to ${extensionLocation.fsPath}`); - await extract(zipPath, tempLocation.fsPath, { sourcePath: 'extension', overwrite: true }, token); - this.logService.info(`Extracted extension to ${extensionLocation}:`, extensionKey.id); - } catch (e) { - throw fromExtractError(e); - } + // Extract + try { + this.logService.trace(`Started extracting the extension from ${zipPath} to ${extensionLocation.fsPath}`); + await extract(zipPath, tempLocation.fsPath, { sourcePath: 'extension', overwrite: true }, token); + this.logService.info(`Extracted extension to ${extensionLocation}:`, extensionKey.id); + } catch (e) { + throw fromExtractError(e); + } - try { - await this.extensionsScannerService.updateMetadata(tempLocation, metadata); - } catch (error) { - this.telemetryService.publicLog2('extension:extract', { extensionId: extensionKey.id, code: error.code }); - throw toExtensionManagementError(error, ExtensionManagementErrorCode.UpdateMetadata); - } + try { + await this.extensionsScannerService.updateMetadata(tempLocation, metadata); + } catch (error) { + this.telemetryService.publicLog2('extension:extract', { extensionId: extensionKey.id, code: `${toFileOperationResult(error)}` }); + throw toExtensionManagementError(error, ExtensionManagementErrorCode.UpdateMetadata); + } - if (token.isCancellationRequested) { - throw new CancellationError(); - } + if (token.isCancellationRequested) { + throw new CancellationError(); + } - // Rename - try { - this.logService.trace(`Started renaming the extension from ${tempLocation.fsPath} to ${extensionLocation.fsPath}`); - await this.rename(tempLocation.fsPath, extensionLocation.fsPath); - this.logService.info('Renamed to', extensionLocation.fsPath); - } catch (error) { - if (error.code === 'ENOTEMPTY') { - this.logService.info(`Rename failed because extension was installed by another source. So ignoring renaming.`, extensionKey.id); - try { await this.fileService.del(tempLocation, { recursive: true }); } catch (e) { /* ignore */ } - } else { - this.logService.info(`Rename failed because of ${getErrorMessage(error)}. Deleted from extracted location`, tempLocation); - throw error; - } + // Rename + try { + this.logService.trace(`Started renaming the extension from ${tempLocation.fsPath} to ${extensionLocation.fsPath}`); + await this.rename(tempLocation.fsPath, extensionLocation.fsPath); + this.logService.info('Renamed to', extensionLocation.fsPath); + } catch (error) { + if (error.code === 'ENOTEMPTY') { + this.logService.info(`Rename failed because extension was installed by another source. So ignoring renaming.`, extensionKey.id); + try { await this.fileService.del(tempLocation, { recursive: true }); } catch (e) { /* ignore */ } + } else { + this.logService.info(`Rename failed because of ${getErrorMessage(error)}. Deleted from extracted location`, tempLocation); + throw error; } + } - this._onExtract.fire(extensionLocation); + this._onExtract.fire(extensionLocation); - } catch (error) { - try { await this.fileService.del(tempLocation, { recursive: true }); } catch (e) { /* ignore */ } - throw error; - } + } catch (error) { + try { await this.fileService.del(tempLocation, { recursive: true }); } catch (e) { /* ignore */ } + throw error; } return this.scanLocalExtension(extensionLocation, ExtensionType.User); @@ -671,7 +707,7 @@ export class ExtensionsScanner extends Disposable { await this.extensionsScannerService.updateMetadata(local.location, metadata); } } catch (error) { - this.telemetryService.publicLog2('extension:extract', { extensionId: local.identifier.id, code: error.code }); + this.telemetryService.publicLog2('extension:extract', { extensionId: local.identifier.id, code: `${toFileOperationResult(error)}`, isProfile: !!profileLocation }); throw toExtensionManagementError(error, ExtensionManagementErrorCode.UpdateMetadata); } return this.scanLocalExtension(local.location, local.type, profileLocation); @@ -919,7 +955,7 @@ class InstallExtensionInProfileTask extends AbstractExtensionTask implem constructor( readonly extension: ILocalExtension, - private readonly profileLocation: URI, + readonly options: UninstallExtensionTaskOptions, private readonly extensionsProfileScannerService: IExtensionsProfileScannerService, ) { super(); } protected async doRun(token: CancellationToken): Promise { - await this.extensionsProfileScannerService.removeExtensionFromProfile(this.extension, this.profileLocation); + await this.extensionsProfileScannerService.removeExtensionFromProfile(this.extension, this.options.profileLocation); } } diff --git a/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts b/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts index 96118542408..08c62100d8b 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { buffer, ExtractError } from 'vs/base/node/zip'; -import { localize } from 'vs/nls'; -import { toExtensionManagementError } from 'vs/platform/extensionManagement/common/abstractExtensionManagementService'; -import { ExtensionManagementError, ExtensionManagementErrorCode } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionManifest } from 'vs/platform/extensions/common/extensions'; +import { buffer, ExtractError } from '../../../base/node/zip.js'; +import { localize } from '../../../nls.js'; +import { toExtensionManagementError } from '../common/abstractExtensionManagementService.js'; +import { ExtensionManagementError, ExtensionManagementErrorCode } from '../common/extensionManagement.js'; +import { IExtensionManifest } from '../../extensions/common/extensions.js'; export function fromExtractError(e: Error): ExtensionManagementError { let errorCode = ExtensionManagementErrorCode.Extract; diff --git a/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts b/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts index cedabb0c126..e342fb4d2e2 100644 --- a/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts +++ b/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts @@ -3,15 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getErrorMessage } from 'vs/base/common/errors'; -import { IGalleryExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { TargetPlatform } from 'vs/platform/extensions/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService, LogLevel } from 'vs/platform/log/common/log'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { importAMDNodeModule } from '../../../amdX.js'; +import { getErrorMessage } from '../../../base/common/errors.js'; +import { TargetPlatform } from '../../extensions/common/extensions.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService, LogLevel } from '../../log/common/log.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { ExtensionSignatureVerificationCode } from '../common/extensionManagement.js'; export const IExtensionSignatureVerificationService = createDecorator('IExtensionSignatureVerificationService'); +export interface IExtensionSignatureVerificationResult { + readonly code: ExtensionSignatureVerificationCode; +} + /** * A service for verifying signed extensions. */ @@ -21,50 +26,18 @@ export interface IExtensionSignatureVerificationService { /** * Verifies an extension file (.vsix) against a signature archive file. * @param { string } extensionId The extension identifier. + * @param { string } version The extension version. * @param { string } vsixFilePath The extension file path. * @param { string } signatureArchiveFilePath The signature archive file path. - * @returns { Promise } A promise with `true` if the extension is validly signed and trusted; - * otherwise, `false` because verification is not enabled (e.g.: in the OSS version of VS Code). - * @throws { ExtensionSignatureVerificationError } An error with a code indicating the validity, integrity, or trust issue - * found during verification or a more fundamental issue (e.g.: a required dependency was not found). + * @returns { Promise } returns the verification result or undefined if the verification was not executed. */ - verify(extension: IGalleryExtension, vsixFilePath: string, signatureArchiveFilePath: string, clientTargetPlatform?: TargetPlatform): Promise; + verify(extensionId: string, version: string, vsixFilePath: string, signatureArchiveFilePath: string, clientTargetPlatform?: TargetPlatform): Promise; } declare module vsceSign { export function verify(vsixFilePath: string, signatureArchiveFilePath: string, verbose: boolean): Promise; } -export enum ExtensionSignatureVerificationCode { - 'Success' = 'Success', - 'RequiredArgumentMissing' = 'RequiredArgumentMissing', - 'InvalidArgument' = 'InvalidArgument', - 'PackageIsUnreadable' = 'PackageIsUnreadable', - 'UnhandledException' = 'UnhandledException', - 'SignatureManifestIsMissing' = 'SignatureManifestIsMissing', - 'SignatureManifestIsUnreadable' = 'SignatureManifestIsUnreadable', - 'SignatureIsMissing' = 'SignatureIsMissing', - 'SignatureIsUnreadable' = 'SignatureIsUnreadable', - 'CertificateIsUnreadable' = 'CertificateIsUnreadable', - 'SignatureArchiveIsUnreadable' = 'SignatureArchiveIsUnreadable', - 'FileAlreadyExists' = 'FileAlreadyExists', - 'SignatureArchiveIsInvalidZip' = 'SignatureArchiveIsInvalidZip', - 'SignatureArchiveHasSameSignatureFile' = 'SignatureArchiveHasSameSignatureFile', - - 'PackageIntegrityCheckFailed' = 'PackageIntegrityCheckFailed', - 'SignatureIsInvalid' = 'SignatureIsInvalid', - 'SignatureManifestIsInvalid' = 'SignatureManifestIsInvalid', - 'SignatureIntegrityCheckFailed' = 'SignatureIntegrityCheckFailed', - 'EntryIsMissing' = 'EntryIsMissing', - 'EntryIsTampered' = 'EntryIsTampered', - 'Untrusted' = 'Untrusted', - 'CertificateRevoked' = 'CertificateRevoked', - 'SignatureIsNotValid' = 'SignatureIsNotValid', - 'UnknownError' = 'UnknownError', - 'PackageIsInvalidZip' = 'PackageIsInvalidZip', - 'SignatureArchiveHasTooManyEntries' = 'SignatureArchiveHasTooManyEntries', -} - /** * Extension signature verification result */ @@ -75,14 +48,6 @@ export interface ExtensionSignatureVerificationResult { readonly output?: string; } -export class ExtensionSignatureVerificationError extends Error { - constructor( - public readonly code: ExtensionSignatureVerificationCode, - ) { - super(code); - } -} - export class ExtensionSignatureVerificationService implements IExtensionSignatureVerificationService { declare readonly _serviceBrand: undefined; @@ -95,29 +60,33 @@ export class ExtensionSignatureVerificationService implements IExtensionSignatur private vsceSign(): Promise { if (!this.moduleLoadingPromise) { - this.moduleLoadingPromise = new Promise( - (resolve, reject) => require( - ['@vscode/vsce-sign'], - async (obj) => { - const instance = obj; - - return resolve(instance); - }, reject)); + this.moduleLoadingPromise = this.resolveVsceSign(); } return this.moduleLoadingPromise; } - public async verify(extension: IGalleryExtension, vsixFilePath: string, signatureArchiveFilePath: string, clientTargetPlatform?: TargetPlatform): Promise { + private async resolveVsceSign(): Promise { + // ESM-uncomment-begin + if (typeof importAMDNodeModule === 'function') { /* fixes unused import, remove me */ } + const mod = '@vscode/vsce-sign'; + return import(mod); + // ESM-uncomment-end + + // ESM-comment-begin + // return importAMDNodeModule('@vscode/vsce-sign', 'src/main.js'); + // ESM-comment-end + } + + public async verify(extensionId: string, version: string, vsixFilePath: string, signatureArchiveFilePath: string, clientTargetPlatform?: TargetPlatform): Promise { let module: typeof vsceSign; - const extensionId = extension.identifier.id; try { module = await this.vsceSign(); } catch (error) { this.logService.error('Could not load vsce-sign module', getErrorMessage(error)); this.logService.info(`Extension signature verification is not done: ${extensionId}`); - return false; + return undefined; } const startTime = new Date().getTime(); @@ -161,7 +130,7 @@ export class ExtensionSignatureVerificationService implements IExtensionSignatur }; this.telemetryService.publicLog2('extensionsignature:verification', { extensionId, - extensionVersion: extension.version, + extensionVersion: version, code: result.code, internalCode: result.internalCode, duration, @@ -169,10 +138,6 @@ export class ExtensionSignatureVerificationService implements IExtensionSignatur clientTargetPlatform, }); - if (result.code === ExtensionSignatureVerificationCode.Success) { - return true; - } - - throw new ExtensionSignatureVerificationError(result.code); + return { code: result.code }; } } diff --git a/src/vs/platform/extensionManagement/node/extensionTipsService.ts b/src/vs/platform/extensionManagement/node/extensionTipsService.ts index fbdf3153403..40d86085ab6 100644 --- a/src/vs/platform/extensionManagement/node/extensionTipsService.ts +++ b/src/vs/platform/extensionManagement/node/extensionTipsService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IExtensionRecommendationNotificationService } from 'vs/platform/extensionRecommendations/common/extensionRecommendations'; -import { INativeHostService } from 'vs/platform/native/common/native'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { AbstractNativeExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionTipsService'; +import { IExtensionManagementService } from '../common/extensionManagement.js'; +import { IFileService } from '../../files/common/files.js'; +import { IProductService } from '../../product/common/productService.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { IExtensionRecommendationNotificationService } from '../../extensionRecommendations/common/extensionRecommendations.js'; +import { INativeHostService } from '../../native/common/native.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { AbstractNativeExtensionTipsService } from '../common/extensionTipsService.js'; export class ExtensionTipsService extends AbstractNativeExtensionTipsService { diff --git a/src/vs/platform/extensionManagement/node/extensionsManifestCache.ts b/src/vs/platform/extensionManagement/node/extensionsManifestCache.ts index cc5d48ee4e1..2825bbe0fa1 100644 --- a/src/vs/platform/extensionManagement/node/extensionsManifestCache.ts +++ b/src/vs/platform/extensionManagement/node/extensionsManifestCache.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { DidUninstallExtensionEvent, IExtensionManagementService, InstallExtensionResult } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { USER_MANIFEST_CACHE_FILE } from 'vs/platform/extensions/common/extensions'; -import { FileOperationResult, IFileService, toFileOperationResult } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { DidUninstallExtensionEvent, IExtensionManagementService, InstallExtensionResult } from '../common/extensionManagement.js'; +import { USER_MANIFEST_CACHE_FILE } from '../../extensions/common/extensions.js'; +import { FileOperationResult, IFileService, toFileOperationResult } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; export class ExtensionsManifestCache extends Disposable { diff --git a/src/vs/platform/extensionManagement/node/extensionsProfileScannerService.ts b/src/vs/platform/extensionManagement/node/extensionsProfileScannerService.ts index 7864019ad83..3f1e919161f 100644 --- a/src/vs/platform/extensionManagement/node/extensionsProfileScannerService.ts +++ b/src/vs/platform/extensionManagement/node/extensionsProfileScannerService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ILogService } from 'vs/platform/log/common/log'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { AbstractExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { URI } from 'vs/base/common/uri'; +import { ILogService } from '../../log/common/log.js'; +import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { AbstractExtensionsProfileScannerService } from '../common/extensionsProfileScannerService.js'; +import { IFileService } from '../../files/common/files.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { URI } from '../../../base/common/uri.js'; export class ExtensionsProfileScannerService extends AbstractExtensionsProfileScannerService { constructor( diff --git a/src/vs/platform/extensionManagement/node/extensionsScannerService.ts b/src/vs/platform/extensionManagement/node/extensionsScannerService.ts index 4f95fb924f2..349dcef361e 100644 --- a/src/vs/platform/extensionManagement/node/extensionsScannerService.ts +++ b/src/vs/platform/extensionManagement/node/extensionsScannerService.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { IExtensionsScannerService, NativeExtensionsScannerService, } from 'vs/platform/extensionManagement/common/extensionsScannerService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { URI } from '../../../base/common/uri.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { IExtensionsProfileScannerService } from '../common/extensionsProfileScannerService.js'; +import { IExtensionsScannerService, NativeExtensionsScannerService, } from '../common/extensionsScannerService.js'; +import { IFileService } from '../../files/common/files.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; export class ExtensionsScannerService extends NativeExtensionsScannerService implements IExtensionsScannerService { diff --git a/src/vs/platform/extensionManagement/node/extensionsWatcher.ts b/src/vs/platform/extensionManagement/node/extensionsWatcher.ts index ba8e026b893..d2b65eaea55 100644 --- a/src/vs/platform/extensionManagement/node/extensionsWatcher.ts +++ b/src/vs/platform/extensionManagement/node/extensionsWatcher.ts @@ -3,19 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { combinedDisposable, Disposable, DisposableMap } from 'vs/base/common/lifecycle'; -import { ResourceSet } from 'vs/base/common/map'; -import { URI } from 'vs/base/common/uri'; -import { getIdAndVersion } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { DidAddProfileExtensionsEvent, DidRemoveProfileExtensionsEvent, IExtensionsProfileScannerService, ProfileExtensionsEvent } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService'; -import { INativeServerExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; -import { ExtensionIdentifier, IExtension, IExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { FileChangesEvent, FileChangeType, IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { getErrorMessage } from '../../../base/common/errors.js'; +import { Emitter } from '../../../base/common/event.js'; +import { combinedDisposable, Disposable, DisposableMap } from '../../../base/common/lifecycle.js'; +import { ResourceSet } from '../../../base/common/map.js'; +import { URI } from '../../../base/common/uri.js'; +import { getIdAndVersion } from '../common/extensionManagementUtil.js'; +import { DidAddProfileExtensionsEvent, DidRemoveProfileExtensionsEvent, IExtensionsProfileScannerService, ProfileExtensionsEvent } from '../common/extensionsProfileScannerService.js'; +import { IExtensionsScannerService } from '../common/extensionsScannerService.js'; +import { INativeServerExtensionManagementService } from './extensionManagementService.js'; +import { ExtensionIdentifier, IExtension, IExtensionIdentifier } from '../../extensions/common/extensions.js'; +import { FileChangesEvent, FileChangeType, IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; export interface DidChangeProfileExtensionsEvent { readonly added?: { readonly extensions: readonly IExtensionIdentifier[]; readonly profileLocation: URI }; @@ -40,7 +41,7 @@ export class ExtensionsWatcher extends Disposable { private readonly logService: ILogService, ) { super(); - this.initialize().then(null, error => logService.error(error)); + this.initialize().then(null, error => logService.error('Error while initializing Extensions Watcher', getErrorMessage(error))); } private async initialize(): Promise { diff --git a/src/vs/platform/extensionManagement/test/common/configRemotes.test.ts b/src/vs/platform/extensionManagement/test/common/configRemotes.test.ts index 178293d8874..57348d9b965 100644 --- a/src/vs/platform/extensionManagement/test/common/configRemotes.test.ts +++ b/src/vs/platform/extensionManagement/test/common/configRemotes.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { getDomainsOfRemotes, getRemotes } from 'vs/platform/extensionManagement/common/configRemotes'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { getDomainsOfRemotes, getRemotes } from '../../common/configRemotes.js'; suite('Config Remotes', () => { diff --git a/src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts b/src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts index a4c9afd9c58..3fa0d8a0f4d 100644 --- a/src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts +++ b/src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts @@ -4,26 +4,26 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { isUUID } from 'vs/base/common/uuid'; -import { mock } from 'vs/base/test/common/mock'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IRawGalleryExtensionVersion, sortExtensionVersions } from 'vs/platform/extensionManagement/common/extensionGalleryService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { InMemoryFileSystemProvider } from 'vs/platform/files/common/inMemoryFilesystemProvider'; -import { NullLogService } from 'vs/platform/log/common/log'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { resolveMarketplaceHeaders } from 'vs/platform/externalServices/common/marketplace'; -import { InMemoryStorageService, IStorageService } from 'vs/platform/storage/common/storage'; -import { TelemetryConfiguration, TELEMETRY_SETTING_ID } from 'vs/platform/telemetry/common/telemetry'; -import { TargetPlatform } from 'vs/platform/extensions/common/extensions'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { joinPath } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { isUUID } from '../../../../base/common/uuid.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { IConfigurationService } from '../../../configuration/common/configuration.js'; +import { TestConfigurationService } from '../../../configuration/test/common/testConfigurationService.js'; +import { IEnvironmentService } from '../../../environment/common/environment.js'; +import { IRawGalleryExtensionVersion, sortExtensionVersions } from '../../common/extensionGalleryService.js'; +import { IFileService } from '../../../files/common/files.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { InMemoryFileSystemProvider } from '../../../files/common/inMemoryFilesystemProvider.js'; +import { NullLogService } from '../../../log/common/log.js'; +import product from '../../../product/common/product.js'; +import { IProductService } from '../../../product/common/productService.js'; +import { resolveMarketplaceHeaders } from '../../../externalServices/common/marketplace.js'; +import { InMemoryStorageService, IStorageService } from '../../../storage/common/storage.js'; +import { TelemetryConfiguration, TELEMETRY_SETTING_ID } from '../../../telemetry/common/telemetry.js'; +import { TargetPlatform } from '../../../extensions/common/extensions.js'; +import { NullTelemetryService } from '../../../telemetry/common/telemetryUtils.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; class EnvironmentServiceMock extends mock() { override readonly serviceMachineIdResource: URI; @@ -52,6 +52,7 @@ suite('Extension Gallery Service', () => { test('marketplace machine id', async () => { const headers = await resolveMarketplaceHeaders(product.version, productService, environmentService, configurationService, fileService, storageService, NullTelemetryService); + assert.ok(headers['X-Market-User-Id']); assert.ok(isUUID(headers['X-Market-User-Id'])); const headers2 = await resolveMarketplaceHeaders(product.version, productService, environmentService, configurationService, fileService, storageService, NullTelemetryService); assert.strictEqual(headers['X-Market-User-Id'], headers2['X-Market-User-Id']); diff --git a/src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts b/src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts index 1c3d62f7f0b..4c26d81b859 100644 --- a/src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts +++ b/src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { EXTENSION_IDENTIFIER_PATTERN } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionKey } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { TargetPlatform } from 'vs/platform/extensions/common/extensions'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { EXTENSION_IDENTIFIER_PATTERN } from '../../common/extensionManagement.js'; +import { ExtensionKey } from '../../common/extensionManagementUtil.js'; +import { TargetPlatform } from '../../../extensions/common/extensions.js'; suite('Extension Identifier Pattern', () => { diff --git a/src/vs/platform/extensionManagement/test/common/extensionNls.test.ts b/src/vs/platform/extensionManagement/test/common/extensionNls.test.ts index e23d69b9371..7eb71602c2c 100644 --- a/src/vs/platform/extensionManagement/test/common/extensionNls.test.ts +++ b/src/vs/platform/extensionManagement/test/common/extensionNls.test.ts @@ -4,12 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { deepClone } from 'vs/base/common/objects'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ILocalizedString } from 'vs/platform/action/common/action'; -import { localizeManifest } from 'vs/platform/extensionManagement/common/extensionNls'; -import { IExtensionManifest, IConfiguration } from 'vs/platform/extensions/common/extensions'; -import { NullLogger } from 'vs/platform/log/common/log'; +import { deepClone } from '../../../../base/common/objects.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ILocalizedString } from '../../../action/common/action.js'; +import { IConfigurationNode } from '../../../configuration/common/configurationRegistry.js'; +import { localizeManifest } from '../../common/extensionNls.js'; +import { IExtensionManifest } from '../../../extensions/common/extensions.js'; +import { NullLogger } from '../../../log/common/log.js'; const manifest: IExtensionManifest = { name: 'test', @@ -62,7 +63,7 @@ suite('Localize Manifest', () => { assert.strictEqual(localizedManifest.contributes?.commands?.[0].title, 'Test Command'); assert.strictEqual(localizedManifest.contributes?.commands?.[0].category, 'Test Category'); assert.strictEqual(localizedManifest.contributes?.authentication?.[0].label, 'Test Authentication'); - assert.strictEqual((localizedManifest.contributes?.configuration as IConfiguration).title, 'Test Configuration'); + assert.strictEqual((localizedManifest.contributes?.configuration as IConfigurationNode).title, 'Test Configuration'); }); test('replaces template strings with fallback if not found in translations', function () { @@ -81,7 +82,7 @@ suite('Localize Manifest', () => { assert.strictEqual(localizedManifest.contributes?.commands?.[0].title, 'Test Command'); assert.strictEqual(localizedManifest.contributes?.commands?.[0].category, 'Test Category'); assert.strictEqual(localizedManifest.contributes?.authentication?.[0].label, 'Test Authentication'); - assert.strictEqual((localizedManifest.contributes?.configuration as IConfiguration).title, 'Test Configuration'); + assert.strictEqual((localizedManifest.contributes?.configuration as IConfigurationNode).title, 'Test Configuration'); }); test('replaces template strings - command title & categories become ILocalizedString', function () { @@ -111,7 +112,7 @@ suite('Localize Manifest', () => { // Everything else stays as a string. assert.strictEqual(localizedManifest.contributes?.authentication?.[0].label, 'Testauthentifizierung'); - assert.strictEqual((localizedManifest.contributes?.configuration as IConfiguration).title, 'Testkonfiguration'); + assert.strictEqual((localizedManifest.contributes?.configuration as IConfigurationNode).title, 'Testkonfiguration'); }); test('replaces template strings - is best effort #164630', function () { diff --git a/src/vs/platform/extensionManagement/test/common/extensionsProfileScannerService.test.ts b/src/vs/platform/extensionManagement/test/common/extensionsProfileScannerService.test.ts index d94305a83fc..6c02f4be335 100644 --- a/src/vs/platform/extensionManagement/test/common/extensionsProfileScannerService.test.ts +++ b/src/vs/platform/extensionManagement/test/common/extensionsProfileScannerService.test.ts @@ -5,23 +5,23 @@ import assert from 'assert'; import * as sinon from 'sinon'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { AbstractExtensionsProfileScannerService, ProfileExtensionsEvent } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { ExtensionType, IExtension, IExtensionManifest, TargetPlatform } from 'vs/platform/extensions/common/extensions'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { InMemoryFileSystemProvider } from 'vs/platform/files/common/inMemoryFilesystemProvider'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { IUserDataProfilesService, UserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { joinPath } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IEnvironmentService } from '../../../environment/common/environment.js'; +import { AbstractExtensionsProfileScannerService, ProfileExtensionsEvent } from '../../common/extensionsProfileScannerService.js'; +import { ExtensionType, IExtension, IExtensionManifest, TargetPlatform } from '../../../extensions/common/extensions.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { IFileService } from '../../../files/common/files.js'; +import { InMemoryFileSystemProvider } from '../../../files/common/inMemoryFilesystemProvider.js'; +import { TestInstantiationService } from '../../../instantiation/test/common/instantiationServiceMock.js'; +import { ILogService, NullLogService } from '../../../log/common/log.js'; +import { ITelemetryService } from '../../../telemetry/common/telemetry.js'; +import { NullTelemetryService } from '../../../telemetry/common/telemetryUtils.js'; +import { IUriIdentityService } from '../../../uriIdentity/common/uriIdentity.js'; +import { UriIdentityService } from '../../../uriIdentity/common/uriIdentityService.js'; +import { IUserDataProfilesService, UserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; class TestObject extends AbstractExtensionsProfileScannerService { } diff --git a/src/vs/platform/extensionManagement/test/node/extensionDownloader.test.ts b/src/vs/platform/extensionManagement/test/node/extensionDownloader.test.ts index bae93bde803..aa437e000a6 100644 --- a/src/vs/platform/extensionManagement/test/node/extensionDownloader.test.ts +++ b/src/vs/platform/extensionManagement/test/node/extensionDownloader.test.ts @@ -4,27 +4,24 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { platform } from 'vs/base/common/platform'; -import { arch } from 'vs/base/common/process'; -import { joinPath } from 'vs/base/common/resources'; -import { isBoolean } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { getTargetPlatform, IExtensionGalleryService, IGalleryExtension, IGalleryExtensionAssets, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { ExtensionsDownloader } from 'vs/platform/extensionManagement/node/extensionDownloader'; -import { IExtensionSignatureVerificationService } from 'vs/platform/extensionManagement/node/extensionSignatureVerificationService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { InMemoryFileSystemProvider } from 'vs/platform/files/common/inMemoryFilesystemProvider'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { platform } from '../../../../base/common/platform.js'; +import { arch } from '../../../../base/common/process.js'; +import { joinPath } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { generateUuid } from '../../../../base/common/uuid.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { INativeEnvironmentService } from '../../../environment/common/environment.js'; +import { ExtensionSignatureVerificationCode, getTargetPlatform, IExtensionGalleryService, IGalleryExtension, IGalleryExtensionAssets, InstallOperation } from '../../common/extensionManagement.js'; +import { getGalleryExtensionId } from '../../common/extensionManagementUtil.js'; +import { ExtensionsDownloader } from '../../node/extensionDownloader.js'; +import { IExtensionSignatureVerificationResult, IExtensionSignatureVerificationService } from '../../node/extensionSignatureVerificationService.js'; +import { IFileService } from '../../../files/common/files.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { InMemoryFileSystemProvider } from '../../../files/common/inMemoryFilesystemProvider.js'; +import { TestInstantiationService } from '../../../instantiation/test/common/instantiationServiceMock.js'; +import { ILogService, NullLogService } from '../../../log/common/log.js'; const ROOT = URI.file('tests').with({ scheme: 'vscode-tests' }); @@ -35,13 +32,18 @@ class TestExtensionSignatureVerificationService extends mock { - if (isBoolean(this.verificationResult)) { - return this.verificationResult; + override async verify(): Promise { + if (this.verificationResult === true) { + return { + code: ExtensionSignatureVerificationCode.Success + }; } - const error = Error(this.verificationResult); - (error as any).code = this.verificationResult; - throw error; + if (this.verificationResult === false) { + return undefined; + } + return { + code: this.verificationResult as ExtensionSignatureVerificationCode, + }; } } @@ -76,33 +78,25 @@ suite('ExtensionDownloader Tests', () => { }); }); - test('download completes successfully if verification is disabled by setting set to false', async () => { - const testObject = aTestObject({ isSignatureVerificationEnabled: false, verificationResult: 'error' }); - - const actual = await testObject.download(aGalleryExtension('a', { isSigned: true }), InstallOperation.Install, true); - - assert.strictEqual(actual.verificationStatus, false); - }); - test('download completes successfully if verification is disabled by options', async () => { - const testObject = aTestObject({ isSignatureVerificationEnabled: true, verificationResult: 'error' }); + const testObject = aTestObject({ verificationResult: 'error' }); const actual = await testObject.download(aGalleryExtension('a', { isSigned: true }), InstallOperation.Install, false); - assert.strictEqual(actual.verificationStatus, false); + assert.strictEqual(actual.verificationStatus, undefined); }); test('download completes successfully if verification is disabled because the module is not loaded', async () => { - const testObject = aTestObject({ isSignatureVerificationEnabled: true, verificationResult: false }); + const testObject = aTestObject({ verificationResult: false }); const actual = await testObject.download(aGalleryExtension('a', { isSigned: true }), InstallOperation.Install, true); - assert.strictEqual(actual.verificationStatus, false); + assert.strictEqual(actual.verificationStatus, undefined); }); test('download completes successfully if verification fails to execute', async () => { const errorCode = 'ENOENT'; - const testObject = aTestObject({ isSignatureVerificationEnabled: true, verificationResult: errorCode }); + const testObject = aTestObject({ verificationResult: errorCode }); const actual = await testObject.download(aGalleryExtension('a', { isSigned: true }), InstallOperation.Install, true); @@ -111,7 +105,7 @@ suite('ExtensionDownloader Tests', () => { test('download completes successfully if verification fails ', async () => { const errorCode = 'IntegrityCheckFailed'; - const testObject = aTestObject({ isSignatureVerificationEnabled: true, verificationResult: errorCode }); + const testObject = aTestObject({ verificationResult: errorCode }); const actual = await testObject.download(aGalleryExtension('a', { isSigned: true }), InstallOperation.Install, true); @@ -119,31 +113,30 @@ suite('ExtensionDownloader Tests', () => { }); test('download completes successfully if verification succeeds', async () => { - const testObject = aTestObject({ isSignatureVerificationEnabled: true, verificationResult: true }); + const testObject = aTestObject({ verificationResult: true }); const actual = await testObject.download(aGalleryExtension('a', { isSigned: true }), InstallOperation.Install, true); - assert.strictEqual(actual.verificationStatus, true); + assert.strictEqual(actual.verificationStatus, ExtensionSignatureVerificationCode.Success); }); test('download completes successfully for unsigned extension', async () => { - const testObject = aTestObject({ isSignatureVerificationEnabled: true, verificationResult: true }); + const testObject = aTestObject({ verificationResult: true }); const actual = await testObject.download(aGalleryExtension('a', { isSigned: false }), InstallOperation.Install, true); - assert.strictEqual(actual.verificationStatus, false); + assert.strictEqual(actual.verificationStatus, undefined); }); test('download completes successfully for an unsigned extension even when signature verification throws error', async () => { - const testObject = aTestObject({ isSignatureVerificationEnabled: true, verificationResult: 'error' }); + const testObject = aTestObject({ verificationResult: 'error' }); const actual = await testObject.download(aGalleryExtension('a', { isSigned: false }), InstallOperation.Install, true); - assert.strictEqual(actual.verificationStatus, false); + assert.strictEqual(actual.verificationStatus, undefined); }); - function aTestObject(options: { isSignatureVerificationEnabled: boolean; verificationResult: boolean | string }): ExtensionsDownloader { - instantiationService.stub(IConfigurationService, new TestConfigurationService(isBoolean(options.isSignatureVerificationEnabled) ? { extensions: { verifySignature: options.isSignatureVerificationEnabled } } : undefined)); + function aTestObject(options: { verificationResult: boolean | string }): ExtensionsDownloader { instantiationService.stub(IExtensionSignatureVerificationService, new TestExtensionSignatureVerificationService(options.verificationResult)); return disposables.add(instantiationService.createInstance(TestExtensionDownloader)); } diff --git a/src/vs/platform/extensionManagement/test/node/extensionsScannerService.test.ts b/src/vs/platform/extensionManagement/test/node/extensionsScannerService.test.ts index 8c0569fe67b..74d3ffcd738 100644 --- a/src/vs/platform/extensionManagement/test/node/extensionsScannerService.test.ts +++ b/src/vs/platform/extensionManagement/test/node/extensionsScannerService.test.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { dirname, joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IExtensionsProfileScannerService, IProfileExtensionsScanOptions } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { AbstractExtensionsScannerService, ExtensionScannerInput, IExtensionsScannerService, IScannedExtensionManifest, Translations } from 'vs/platform/extensionManagement/common/extensionsScannerService'; -import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService'; -import { ExtensionType, IExtensionManifest, TargetPlatform } from 'vs/platform/extensions/common/extensions'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { InMemoryFileSystemProvider } from 'vs/platform/files/common/inMemoryFilesystemProvider'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { IUserDataProfilesService, UserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { dirname, joinPath } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { INativeEnvironmentService } from '../../../environment/common/environment.js'; +import { IExtensionsProfileScannerService, IProfileExtensionsScanOptions } from '../../common/extensionsProfileScannerService.js'; +import { AbstractExtensionsScannerService, ExtensionScannerInput, IExtensionsScannerService, IScannedExtensionManifest, Translations } from '../../common/extensionsScannerService.js'; +import { ExtensionsProfileScannerService } from '../../node/extensionsProfileScannerService.js'; +import { ExtensionType, IExtensionManifest, TargetPlatform } from '../../../extensions/common/extensions.js'; +import { IFileService } from '../../../files/common/files.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { InMemoryFileSystemProvider } from '../../../files/common/inMemoryFilesystemProvider.js'; +import { IInstantiationService } from '../../../instantiation/common/instantiation.js'; +import { TestInstantiationService } from '../../../instantiation/test/common/instantiationServiceMock.js'; +import { ILogService, NullLogService } from '../../../log/common/log.js'; +import { IProductService } from '../../../product/common/productService.js'; +import { NullTelemetryService } from '../../../telemetry/common/telemetryUtils.js'; +import { IUriIdentityService } from '../../../uriIdentity/common/uriIdentity.js'; +import { UriIdentityService } from '../../../uriIdentity/common/uriIdentityService.js'; +import { IUserDataProfilesService, UserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; let translations: Translations = Object.create(null); const ROOT = URI.file('/ROOT'); diff --git a/src/vs/platform/extensionRecommendations/common/extensionRecommendations.ts b/src/vs/platform/extensionRecommendations/common/extensionRecommendations.ts index 07639a7e7b6..fe258ed580c 100644 --- a/src/vs/platform/extensionRecommendations/common/extensionRecommendations.ts +++ b/src/vs/platform/extensionRecommendations/common/extensionRecommendations.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const enum RecommendationSource { FILE = 1, diff --git a/src/vs/platform/extensionRecommendations/common/extensionRecommendationsIpc.ts b/src/vs/platform/extensionRecommendations/common/extensionRecommendationsIpc.ts index 2298e4c2005..9cda9e8ec0e 100644 --- a/src/vs/platform/extensionRecommendations/common/extensionRecommendationsIpc.ts +++ b/src/vs/platform/extensionRecommendations/common/extensionRecommendationsIpc.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IExtensionRecommendationNotificationService, IExtensionRecommendations, RecommendationsNotificationResult } from 'vs/platform/extensionRecommendations/common/extensionRecommendations'; +import { Event } from '../../../base/common/event.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { IExtensionRecommendationNotificationService, IExtensionRecommendations, RecommendationsNotificationResult } from './extensionRecommendations.js'; export class ExtensionRecommendationNotificationServiceChannelClient implements IExtensionRecommendationNotificationService { diff --git a/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts b/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts index fdefc170db0..974a3061346 100644 --- a/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts +++ b/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileAccess, Schemas } from 'vs/base/common/network'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -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'; +import { URI } from '../../../base/common/uri.js'; +import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js'; +import { IFileService } from '../../files/common/files.js'; +import { FileAccess, Schemas } from '../../../base/common/network.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +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 { diff --git a/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts b/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts index f1660961c58..e73ec41aba9 100644 --- a/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts +++ b/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts @@ -3,21 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isWeb } from 'vs/base/common/platform'; -import { format2 } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { IHeaders } from 'vs/base/parts/request/common/request'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { getServiceMachineId } from 'vs/platform/externalServices/common/serviceMachineId'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; -import { RemoteAuthorities } from 'vs/base/common/network'; -import { TargetPlatform } from 'vs/platform/extensions/common/extensions'; +import { isWeb } from '../../../base/common/platform.js'; +import { format2 } from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IProductService } from '../../product/common/productService.js'; +import { getServiceMachineId } from '../../externalServices/common/serviceMachineId.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { TelemetryLevel } from '../../telemetry/common/telemetry.js'; +import { getTelemetryLevel, supportsTelemetry } from '../../telemetry/common/telemetryUtils.js'; +import { RemoteAuthorities } from '../../../base/common/network.js'; +import { TargetPlatform } from '../../extensions/common/extensions.js'; const WEB_EXTENSION_RESOURCE_END_POINT_SEGMENT = '/web-extension-resource/'; @@ -110,8 +109,8 @@ export abstract class AbstractExtensionResourceLoaderService implements IExtensi return !!this._extensionGalleryAuthority && this._extensionGalleryAuthority === this._getExtensionGalleryAuthority(uri); } - protected async getExtensionGalleryRequestHeaders(): Promise { - const headers: IHeaders = { + protected async getExtensionGalleryRequestHeaders(): Promise> { + const headers: Record = { 'X-Client-Name': `${this._productService.applicationName}${isWeb ? '-web' : ''}`, 'X-Client-Version': this._productService.version }; diff --git a/src/vs/platform/extensionResourceLoader/common/extensionResourceLoaderService.ts b/src/vs/platform/extensionResourceLoader/common/extensionResourceLoaderService.ts index c6e63dc3aec..72fccbcc52c 100644 --- a/src/vs/platform/extensionResourceLoader/common/extensionResourceLoaderService.ts +++ b/src/vs/platform/extensionResourceLoader/common/extensionResourceLoaderService.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { asTextOrError, IRequestService } from 'vs/platform/request/common/request'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { AbstractExtensionResourceLoaderService, IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader'; +import { URI } from '../../../base/common/uri.js'; +import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js'; +import { IFileService } from '../../files/common/files.js'; +import { IProductService } from '../../product/common/productService.js'; +import { asTextOrError, IRequestService } from '../../request/common/request.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { AbstractExtensionResourceLoaderService, IExtensionResourceLoaderService } from './extensionResourceLoader.js'; export class ExtensionResourceLoaderService extends AbstractExtensionResourceLoaderService { diff --git a/src/vs/platform/extensions/common/extensionHostStarter.ts b/src/vs/platform/extensions/common/extensionHostStarter.ts index 8a10562398c..1d0d3fe5878 100644 --- a/src/vs/platform/extensions/common/extensionHostStarter.ts +++ b/src/vs/platform/extensions/common/extensionHostStarter.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IExtensionHostStarter = createDecorator('extensionHostStarter'); diff --git a/src/vs/platform/extensions/common/extensionValidator.ts b/src/vs/platform/extensions/common/extensionValidator.ts index 08cb360de78..4a9d3295696 100644 --- a/src/vs/platform/extensions/common/extensionValidator.ts +++ b/src/vs/platform/extensions/common/extensionValidator.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isEqualOrParent, joinPath } from 'vs/base/common/resources'; -import Severity from 'vs/base/common/severity'; -import { URI } from 'vs/base/common/uri'; -import * as nls from 'vs/nls'; -import * as semver from 'vs/base/common/semver/semver'; -import { IExtensionManifest, parseApiProposals } from 'vs/platform/extensions/common/extensions'; -import { allApiProposals } from 'vs/platform/extensions/common/extensionsApiProposals'; +import { isEqualOrParent, joinPath } from '../../../base/common/resources.js'; +import Severity from '../../../base/common/severity.js'; +import { URI } from '../../../base/common/uri.js'; +import * as nls from '../../../nls.js'; +import * as semver from '../../../base/common/semver/semver.js'; +import { IExtensionManifest, parseApiProposals } from './extensions.js'; +import { allApiProposals } from './extensionsApiProposals.js'; export interface IParsedVersion { hasCaret: boolean; @@ -240,7 +240,7 @@ export function isValidVersion(_inputVersion: string | INormalizedVersion, _inpu type ProductDate = string | Date | undefined; -export function validateExtensionManifest(productVersion: string, productDate: ProductDate, extensionLocation: URI, extensionManifest: IExtensionManifest, extensionIsBuiltin: boolean): readonly [Severity, string][] { +export function validateExtensionManifest(productVersion: string, productDate: ProductDate, extensionLocation: URI, extensionManifest: IExtensionManifest, extensionIsBuiltin: boolean, validateApiVersion: boolean): readonly [Severity, string][] { const validations: [Severity, string][] = []; if (typeof extensionManifest.publisher !== 'undefined' && typeof extensionManifest.publisher !== 'string') { validations.push([Severity.Error, nls.localize('extensionDescription.publisher', "property publisher must be of type `string`.")]); @@ -322,7 +322,7 @@ export function validateExtensionManifest(productVersion: string, productDate: P } } - if (extensionManifest.enabledApiProposals?.length) { + if (validateApiVersion && extensionManifest.enabledApiProposals?.length) { const incompatibleNotices: string[] = []; if (!areApiProposalsCompatible([...extensionManifest.enabledApiProposals], incompatibleNotices)) { for (const notice of incompatibleNotices) { @@ -369,7 +369,7 @@ export function areApiProposalsCompatible(apiProposals: string[], arg1?: any): b continue; } if (existingProposal.version !== version) { - incompatibleNotices.push(nls.localize('apiProposalMismatch', "Extension is using an API proposal '{0}' that is not compatible with the current version of VS Code.", proposalName)); + incompatibleNotices.push(nls.localize('apiProposalMismatch', "This extension is using the API proposal '{0}' that is not compatible with the current version of VS Code.", proposalName)); } } notices?.push(...incompatibleNotices); diff --git a/src/vs/platform/extensions/common/extensions.ts b/src/vs/platform/extensions/common/extensions.ts index 4dd080da3ae..5973d4dcf12 100644 --- a/src/vs/platform/extensions/common/extensions.ts +++ b/src/vs/platform/extensions/common/extensions.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import Severity from 'vs/base/common/severity'; -import * as strings from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { ILocalizedString } from 'vs/platform/action/common/action'; -import { ExtensionKind } from 'vs/platform/environment/common/environment'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { getRemoteName } from 'vs/platform/remote/common/remoteHosts'; +import Severity from '../../../base/common/severity.js'; +import * as strings from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import { ILocalizedString } from '../../action/common/action.js'; +import { ExtensionKind } from '../../environment/common/environment.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { getRemoteName } from '../../remote/common/remoteHosts.js'; export const USER_MANIFEST_CACHE_FILE = 'extensions.user.cache'; export const BUILTIN_MANIFEST_CACHE_FILE = 'extensions.builtin.cache'; @@ -21,19 +21,6 @@ export interface ICommand { category?: string | ILocalizedString; } -export interface IConfigurationProperty { - description: string; - type: string | string[]; - default?: any; -} - -export interface IConfiguration { - id?: string; - order?: number; - title?: string; - properties: { [key: string]: IConfigurationProperty }; -} - export interface IDebugger { label?: string; type: string; @@ -182,7 +169,7 @@ export interface ILocalizationContribution { export interface IExtensionContributions { commands?: ICommand[]; - configuration?: IConfiguration | IConfiguration[]; + configuration?: any; debuggers?: IDebugger[]; grammars?: IGrammar[]; jsonValidation?: IJSONValidation[]; @@ -284,6 +271,7 @@ export interface IRelaxedExtensionManifest { contributes?: IExtensionContributions; repository?: { url: string }; bugs?: { url: string }; + originalEnabledApiProposals?: readonly string[]; enabledApiProposals?: readonly string[]; api?: string; scripts?: { [key: string]: string }; diff --git a/src/vs/platform/extensions/common/extensionsApiProposals.ts b/src/vs/platform/extensions/common/extensionsApiProposals.ts index 6aa50f0789c..e7a2eb1b9e5 100644 --- a/src/vs/platform/extensions/common/extensionsApiProposals.ts +++ b/src/vs/platform/extensions/common/extensionsApiProposals.ts @@ -15,11 +15,8 @@ const _allApiProposals = { aiTextSearchProvider: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts', }, - aideChatParticipant: { - proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aideChatParticipant.d.ts', - }, - aideChatVariableResolver: { - proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aideChatVariableResolver.d.ts', + aiTextSearchProviderNew: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProviderNew.d.ts', }, aideGetCodeLensProvider: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aideGetCodeLensProvider.d.ts', @@ -33,9 +30,6 @@ const _allApiProposals = { attributableCoverage: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts', }, - authGetSessions: { - proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authGetSessions.d.ts', - }, authLearnMore: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts', }, @@ -50,6 +44,7 @@ const _allApiProposals = { }, chatParticipantPrivate: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts', + version: 2 }, chatProvider: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts', @@ -87,6 +82,9 @@ const _allApiProposals = { contribAccessibilityHelpContent: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts', }, + contribChatParticipantDetection: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribChatParticipantDetection.d.ts', + }, contribCommentEditorActionsMenu: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts', }, @@ -99,6 +97,9 @@ const _allApiProposals = { contribCommentsViewThreadMenus: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts', }, + contribDebugCreateConfiguration: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDebugCreateConfiguration.d.ts', + }, contribDiffEditorGutterToolBarMenus: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts', }, @@ -132,12 +133,12 @@ const _allApiProposals = { contribShareMenu: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts', }, - contribSourceControlHistoryItemGroupMenu: { - proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts', - }, contribSourceControlHistoryItemMenu: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts', }, + contribSourceControlHistoryTitleMenu: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryTitleMenu.d.ts', + }, contribSourceControlInputBoxMenu: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts', }, @@ -147,6 +148,9 @@ const _allApiProposals = { contribStatusBarItems: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts', }, + contribViewContainerTitle: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewContainerTitle.d.ts', + }, contribViewsRemote: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts', }, @@ -210,12 +214,21 @@ const _allApiProposals = { fileSearchProvider: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts', }, + fileSearchProviderNew: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProviderNew.d.ts', + }, findFiles2: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts', }, + findFiles2New: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2New.d.ts', + }, findTextInFiles: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts', }, + findTextInFilesNew: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFilesNew.d.ts', + }, fsChunks: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts', }, @@ -245,7 +258,7 @@ const _allApiProposals = { }, lmTools: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.lmTools.d.ts', - version: 2 + version: 6 }, mappedEditsProvider: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts', @@ -286,6 +299,9 @@ const _allApiProposals = { notebookMime: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts', }, + notebookReplDocument: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookReplDocument.d.ts', + }, notebookVariableProvider: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts', }, @@ -298,6 +314,9 @@ const _allApiProposals = { quickDiffProvider: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts', }, + quickInputButtonLocation: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts', + }, quickPickItemTooltip: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts', }, @@ -361,15 +380,21 @@ const _allApiProposals = { terminalSelection: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts', }, - terminalShellIntegration: { - proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts', - }, testObserver: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts', }, + testRelatedCode: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testRelatedCode.d.ts', + }, + textSearchCompleteNew: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchCompleteNew.d.ts', + }, textSearchProvider: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts', }, + textSearchProviderNew: { + proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProviderNew.d.ts', + }, timeline: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts', }, diff --git a/src/vs/platform/extensions/electron-main/extensionHostStarter.ts b/src/vs/platform/extensions/electron-main/extensionHostStarter.ts index 106963ac0b5..46d22061ffc 100644 --- a/src/vs/platform/extensions/electron-main/extensionHostStarter.ts +++ b/src/vs/platform/extensions/electron-main/extensionHostStarter.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Promises } from 'vs/base/common/async'; -import { canceled } from 'vs/base/common/errors'; -import { Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { IExtensionHostProcessOptions, IExtensionHostStarter } from 'vs/platform/extensions/common/extensionHostStarter'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { WindowUtilityProcess } from 'vs/platform/utilityProcess/electron-main/utilityProcess'; -import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; +import { Promises } from '../../../base/common/async.js'; +import { canceled } from '../../../base/common/errors.js'; +import { Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { IExtensionHostProcessOptions, IExtensionHostStarter } from '../common/extensionHostStarter.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { WindowUtilityProcess } from '../../utilityProcess/electron-main/utilityProcess.js'; +import { IWindowsMainService } from '../../windows/electron-main/windows.js'; export class ExtensionHostStarter extends Disposable implements IDisposable, IExtensionHostStarter { @@ -113,6 +113,7 @@ export class ExtensionHostStarter extends Disposable implements IDisposable, IEx execArgv: opts.execArgv, allowLoadingUnsignedLibraries: true, forceAllocationsToV8Sandbox: true, + respondToAuthRequestsFromMainProcess: true, correlationId: id }); const pid = await Event.toPromise(extHost.onSpawn); diff --git a/src/vs/platform/extensions/test/common/extensionValidator.test.ts b/src/vs/platform/extensions/test/common/extensionValidator.test.ts index 6ac5821e08a..82c3cf0bf8a 100644 --- a/src/vs/platform/extensions/test/common/extensionValidator.test.ts +++ b/src/vs/platform/extensions/test/common/extensionValidator.test.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IExtensionManifest } from 'vs/platform/extensions/common/extensions'; -import { areApiProposalsCompatible, INormalizedVersion, IParsedVersion, isValidExtensionVersion, isValidVersion, isValidVersionStr, normalizeVersion, parseVersion } from 'vs/platform/extensions/common/extensionValidator'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IExtensionManifest } from '../../common/extensions.js'; +import { areApiProposalsCompatible, INormalizedVersion, IParsedVersion, isValidExtensionVersion, isValidVersion, isValidVersionStr, normalizeVersion, parseVersion } from '../../common/extensionValidator.js'; suite('Extension Version Validator', () => { diff --git a/src/vs/platform/extensions/test/common/extensions.test.ts b/src/vs/platform/extensions/test/common/extensions.test.ts index 7b81268b347..7dff0ffb781 100644 --- a/src/vs/platform/extensions/test/common/extensions.test.ts +++ b/src/vs/platform/extensions/test/common/extensions.test.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { parseEnabledApiProposalNames } from 'vs/platform/extensions/common/extensions'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { parseEnabledApiProposalNames } from '../../common/extensions.js'; suite('Parsing Enabled Api Proposals', () => { diff --git a/src/vs/platform/externalServices/common/marketplace.ts b/src/vs/platform/externalServices/common/marketplace.ts index abb5e379869..3ffab849d3f 100644 --- a/src/vs/platform/externalServices/common/marketplace.ts +++ b/src/vs/platform/externalServices/common/marketplace.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IHeaders } from 'vs/base/parts/request/common/request'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { getServiceMachineId } from 'vs/platform/externalServices/common/serviceMachineId'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; +import { IHeaders } from '../../../base/parts/request/common/request.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { getServiceMachineId } from './serviceMachineId.js'; +import { IFileService } from '../../files/common/files.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ITelemetryService, TelemetryLevel } from '../../telemetry/common/telemetry.js'; +import { getTelemetryLevel, supportsTelemetry } from '../../telemetry/common/telemetryUtils.js'; export async function resolveMarketplaceHeaders(version: string, productService: IProductService, diff --git a/src/vs/platform/externalServices/common/serviceMachineId.ts b/src/vs/platform/externalServices/common/serviceMachineId.ts index 6767e7d7225..8d564d63fb2 100644 --- a/src/vs/platform/externalServices/common/serviceMachineId.ts +++ b/src/vs/platform/externalServices/common/serviceMachineId.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { generateUuid, isUUID } from 'vs/base/common/uuid'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { generateUuid, isUUID } from '../../../base/common/uuid.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; export async function getServiceMachineId(environmentService: IEnvironmentService, fileService: IFileService, storageService: IStorageService | undefined): Promise { let uuid: string | null = storageService ? storageService.get('storage.serviceMachineId', StorageScope.APPLICATION) || null : null; diff --git a/src/vs/platform/externalTerminal/common/externalTerminal.ts b/src/vs/platform/externalTerminal/common/externalTerminal.ts index 6d8da336419..3c0e241828d 100644 --- a/src/vs/platform/externalTerminal/common/externalTerminal.ts +++ b/src/vs/platform/externalTerminal/common/externalTerminal.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ITerminalEnvironment } from 'vs/platform/terminal/common/terminal'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ITerminalEnvironment } from '../../terminal/common/terminal.js'; export const IExternalTerminalService = createDecorator('externalTerminal'); diff --git a/src/vs/platform/externalTerminal/electron-main/externalTerminal.ts b/src/vs/platform/externalTerminal/electron-main/externalTerminal.ts index af6925563c7..f31e4e616a3 100644 --- a/src/vs/platform/externalTerminal/electron-main/externalTerminal.ts +++ b/src/vs/platform/externalTerminal/electron-main/externalTerminal.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IExternalTerminalService } from 'vs/platform/externalTerminal/common/externalTerminal'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IExternalTerminalService } from '../common/externalTerminal.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IExternalTerminalMainService = createDecorator('externalTerminal'); diff --git a/src/vs/platform/externalTerminal/electron-sandbox/externalTerminalService.ts b/src/vs/platform/externalTerminal/electron-sandbox/externalTerminalService.ts index 209c24d072b..ef1fe8b73df 100644 --- a/src/vs/platform/externalTerminal/electron-sandbox/externalTerminalService.ts +++ b/src/vs/platform/externalTerminal/electron-sandbox/externalTerminalService.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IExternalTerminalService as ICommonExternalTerminalService } from 'vs/platform/externalTerminal/common/externalTerminal'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { registerMainProcessRemoteService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IExternalTerminalService as ICommonExternalTerminalService } from '../common/externalTerminal.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { registerMainProcessRemoteService } from '../../ipc/electron-sandbox/services.js'; export const IExternalTerminalService = createDecorator('externalTerminal'); diff --git a/src/vs/platform/externalTerminal/node/externalTerminalService.ts b/src/vs/platform/externalTerminal/node/externalTerminalService.ts index 5086c95a802..47c12711f8c 100644 --- a/src/vs/platform/externalTerminal/node/externalTerminalService.ts +++ b/src/vs/platform/externalTerminal/node/externalTerminalService.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import * as cp from 'child_process'; -import { memoize } from 'vs/base/common/decorators'; -import { FileAccess } from 'vs/base/common/network'; -import * as path from 'vs/base/common/path'; -import * as env from 'vs/base/common/platform'; -import { sanitizeProcessEnvironment } from 'vs/base/common/processes'; -import * as pfs from 'vs/base/node/pfs'; -import * as processes from 'vs/base/node/processes'; -import * as nls from 'vs/nls'; -import { DEFAULT_TERMINAL_OSX, IExternalTerminalService, IExternalTerminalSettings, ITerminalForPlatform } from 'vs/platform/externalTerminal/common/externalTerminal'; -import { ITerminalEnvironment } from 'vs/platform/terminal/common/terminal'; +import { memoize } from '../../../base/common/decorators.js'; +import { FileAccess } from '../../../base/common/network.js'; +import * as path from '../../../base/common/path.js'; +import * as env from '../../../base/common/platform.js'; +import { sanitizeProcessEnvironment } from '../../../base/common/processes.js'; +import * as pfs from '../../../base/node/pfs.js'; +import * as processes from '../../../base/node/processes.js'; +import * as nls from '../../../nls.js'; +import { DEFAULT_TERMINAL_OSX, IExternalTerminalService, IExternalTerminalSettings, ITerminalForPlatform } from '../common/externalTerminal.js'; +import { ITerminalEnvironment } from '../../terminal/common/terminal.js'; const TERMINAL_TITLE = nls.localize('console.title', "VS Code Console"); @@ -56,8 +56,9 @@ export class WindowsExternalTerminalService extends ExternalTerminalService impl const cmdArgs = ['/c', 'start', '/wait']; if (exec.indexOf(' ') >= 0) { // The "" argument is the window title. Without this, exec doesn't work when the path - // contains spaces - cmdArgs.push('""'); + // contains spaces. #6590 + // Title is Execution Path. #220129 + cmdArgs.push(exec); } cmdArgs.push(exec); // Add starting directory parameter for Windows Terminal (see #90734) diff --git a/src/vs/platform/externalTerminal/test/electron-main/externalTerminalService.test.ts b/src/vs/platform/externalTerminal/test/electron-main/externalTerminalService.test.ts index 3a71b5ba69b..601434fd803 100644 --- a/src/vs/platform/externalTerminal/test/electron-main/externalTerminalService.test.ts +++ b/src/vs/platform/externalTerminal/test/electron-main/externalTerminalService.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import { deepStrictEqual, strictEqual } from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { DEFAULT_TERMINAL_OSX, IExternalTerminalConfiguration } from 'vs/platform/externalTerminal/common/externalTerminal'; -import { LinuxExternalTerminalService, MacExternalTerminalService, WindowsExternalTerminalService } from 'vs/platform/externalTerminal/node/externalTerminalService'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { DEFAULT_TERMINAL_OSX, IExternalTerminalConfiguration } from '../../common/externalTerminal.js'; +import { LinuxExternalTerminalService, MacExternalTerminalService, WindowsExternalTerminalService } from '../../node/externalTerminalService.js'; const mockConfig = Object.freeze({ terminal: { diff --git a/src/vs/platform/files/browser/htmlFileSystemProvider.ts b/src/vs/platform/files/browser/htmlFileSystemProvider.ts index 382bb7a7e6c..9b519a19450 100644 --- a/src/vs/platform/files/browser/htmlFileSystemProvider.ts +++ b/src/vs/platform/files/browser/htmlFileSystemProvider.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { URI } from 'vs/base/common/uri'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { basename, extname, normalize } from 'vs/base/common/path'; -import { isLinux } from 'vs/base/common/platform'; -import { extUri, extUriIgnorePathCase } from 'vs/base/common/resources'; -import { newWriteableStream, ReadableStreamEvents } from 'vs/base/common/stream'; -import { createFileSystemProviderError, IFileDeleteOptions, IFileOverwriteOptions, IFileReadStreamOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IStat, IWatchOptions } from 'vs/platform/files/common/files'; -import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess'; -import { IndexedDB } from 'vs/base/browser/indexedDB'; -import { ILogService } from 'vs/platform/log/common/log'; +import { localize } from '../../../nls.js'; +import { URI } from '../../../base/common/uri.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { basename, extname, normalize } from '../../../base/common/path.js'; +import { isLinux } from '../../../base/common/platform.js'; +import { extUri, extUriIgnorePathCase } from '../../../base/common/resources.js'; +import { newWriteableStream, ReadableStreamEvents } from '../../../base/common/stream.js'; +import { createFileSystemProviderError, IFileDeleteOptions, IFileOverwriteOptions, IFileReadStreamOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IStat, IWatchOptions } from '../common/files.js'; +import { WebFileSystemAccess } from './webFileSystemAccess.js'; +import { IndexedDB } from '../../../base/browser/indexedDB.js'; +import { ILogService } from '../../log/common/log.js'; export class HTMLFileSystemProvider implements IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithFileReadStreamCapability { diff --git a/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts b/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts index a83c046c715..d2b0da2e857 100644 --- a/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts +++ b/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Throttler } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { ExtUri } from 'vs/base/common/resources'; -import { isString } from 'vs/base/common/types'; -import { URI, UriDto } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { createFileSystemProviderError, FileChangeType, IFileDeleteOptions, IFileOverwriteOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileChange, IFileSystemProviderWithFileReadWriteCapability, IStat, IWatchOptions } from 'vs/platform/files/common/files'; -import { DBClosedError, IndexedDB } from 'vs/base/browser/indexedDB'; -import { BroadcastDataChannel } from 'vs/base/browser/broadcast'; +import { Throttler } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { ExtUri } from '../../../base/common/resources.js'; +import { isString } from '../../../base/common/types.js'; +import { URI, UriDto } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { createFileSystemProviderError, FileChangeType, IFileDeleteOptions, IFileOverwriteOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileChange, IFileSystemProviderWithFileReadWriteCapability, IStat, IWatchOptions } from '../common/files.js'; +import { DBClosedError, IndexedDB } from '../../../base/browser/indexedDB.js'; +import { BroadcastDataChannel } from '../../../base/browser/broadcast.js'; export type IndexedDBFileSystemProviderErrorDataClassification = { owner: 'sandy081'; diff --git a/src/vs/platform/files/common/diskFileSystemProvider.ts b/src/vs/platform/files/common/diskFileSystemProvider.ts index 8e5d9e45e48..341d3fa32f1 100644 --- a/src/vs/platform/files/common/diskFileSystemProvider.ts +++ b/src/vs/platform/files/common/diskFileSystemProvider.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { insert } from 'vs/base/common/arrays'; -import { ThrottledDelayer } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter } from 'vs/base/common/event'; -import { removeTrailingPathSeparator } from 'vs/base/common/extpath'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { normalize } from 'vs/base/common/path'; -import { URI } from 'vs/base/common/uri'; -import { IFileChange, IFileSystemProvider, IWatchOptions } from 'vs/platform/files/common/files'; -import { AbstractNonRecursiveWatcherClient, AbstractUniversalWatcherClient, ILogMessage, INonRecursiveWatchRequest, IRecursiveWatcherOptions, isRecursiveWatchRequest, IUniversalWatchRequest, reviveFileChanges } from 'vs/platform/files/common/watcher'; -import { ILogService, LogLevel } from 'vs/platform/log/common/log'; +import { insert } from '../../../base/common/arrays.js'; +import { ThrottledDelayer } from '../../../base/common/async.js'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import { Emitter } from '../../../base/common/event.js'; +import { removeTrailingPathSeparator } from '../../../base/common/extpath.js'; +import { Disposable, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { normalize } from '../../../base/common/path.js'; +import { URI } from '../../../base/common/uri.js'; +import { IFileChange, IFileSystemProvider, IWatchOptions } from './files.js'; +import { AbstractNonRecursiveWatcherClient, AbstractUniversalWatcherClient, ILogMessage, INonRecursiveWatchRequest, IRecursiveWatcherOptions, isRecursiveWatchRequest, IUniversalWatchRequest, reviveFileChanges } from './watcher.js'; +import { ILogService, LogLevel } from '../../log/common/log.js'; export interface IDiskFileSystemProviderOptions { watcher?: { @@ -44,7 +44,7 @@ export abstract class AbstractDiskFileSystemProvider extends Disposable implemen constructor( protected readonly logService: ILogService, - private readonly options?: IDiskFileSystemProviderOptions + protected options?: IDiskFileSystemProviderOptions ) { super(); } @@ -71,16 +71,7 @@ export abstract class AbstractDiskFileSystemProvider extends Disposable implemen private readonly universalWatchRequestDelayer = this._register(new ThrottledDelayer(0)); private watchUniversal(resource: URI, opts: IWatchOptions): IDisposable { - - // Add to list of paths to watch universally - const request: IUniversalWatchRequest = { - path: this.toWatchPath(resource), - excludes: opts.excludes, - includes: opts.includes, - recursive: opts.recursive, - filter: opts.filter, - correlationId: opts.correlationId - }; + const request = this.toWatchRequest(resource, opts); const remove = insert(this.universalWatchRequests, request); // Trigger update @@ -96,6 +87,37 @@ export abstract class AbstractDiskFileSystemProvider extends Disposable implemen }); } + private toWatchRequest(resource: URI, opts: IWatchOptions): IUniversalWatchRequest { + const request: IUniversalWatchRequest = { + path: this.toWatchPath(resource), + excludes: opts.excludes, + includes: opts.includes, + recursive: opts.recursive, + filter: opts.filter, + correlationId: opts.correlationId + }; + + if (isRecursiveWatchRequest(request)) { + + // Adjust for polling + const usePolling = this.options?.watcher?.recursive?.usePolling; + if (usePolling === true) { + request.pollingInterval = this.options?.watcher?.recursive?.pollingInterval ?? 5000; + } else if (Array.isArray(usePolling)) { + if (usePolling.includes(request.path)) { + request.pollingInterval = this.options?.watcher?.recursive?.pollingInterval ?? 5000; + } + } + + // Adjust for next version + if (this.options?.watcher?.recursive?.useNext) { + request.useNext = true; + } + } + + return request; + } + private refreshUniversalWatchers(): void { // Buffer requests for universal watching to decide on right watcher @@ -121,24 +143,6 @@ export abstract class AbstractDiskFileSystemProvider extends Disposable implemen })); } - // Adjust for polling - const usePolling = this.options?.watcher?.recursive?.usePolling; - if (usePolling === true) { - for (const request of this.universalWatchRequests) { - if (isRecursiveWatchRequest(request)) { - request.pollingInterval = this.options?.watcher?.recursive?.pollingInterval ?? 5000; - } - } - } else if (Array.isArray(usePolling)) { - for (const request of this.universalWatchRequests) { - if (isRecursiveWatchRequest(request)) { - if (usePolling.includes(request.path)) { - request.pollingInterval = this.options?.watcher?.recursive?.pollingInterval ?? 5000; - } - } - } - } - // Ask to watch the provided paths return this.universalWatcher.watch(this.universalWatchRequests); } diff --git a/src/vs/platform/files/common/diskFileSystemProviderClient.ts b/src/vs/platform/files/common/diskFileSystemProviderClient.ts index d7f38517446..9bd3dcb353b 100644 --- a/src/vs/platform/files/common/diskFileSystemProviderClient.ts +++ b/src/vs/platform/files/common/diskFileSystemProviderClient.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { canceled } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { newWriteableStream, ReadableStreamEventPayload, ReadableStreamEvents } from 'vs/base/common/stream'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IChannel } from 'vs/base/parts/ipc/common/ipc'; -import { createFileSystemProviderError, IFileAtomicReadOptions, IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileReadStreamOptions, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileChange, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileCloneCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IStat, IWatchOptions, IFileSystemProviderError } from 'vs/platform/files/common/files'; -import { reviveFileChanges } from 'vs/platform/files/common/watcher'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { canceled } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { newWriteableStream, ReadableStreamEventPayload, ReadableStreamEvents } from '../../../base/common/stream.js'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { createFileSystemProviderError, IFileAtomicReadOptions, IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileReadStreamOptions, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileChange, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileCloneCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IStat, IWatchOptions, IFileSystemProviderError } from './files.js'; +import { reviveFileChanges } from './watcher.js'; export const LOCAL_FILE_SYSTEM_CHANNEL_NAME = 'localFilesystem'; diff --git a/src/vs/platform/files/common/fileService.ts b/src/vs/platform/files/common/fileService.ts index b353968540e..2c0bfe1369c 100644 --- a/src/vs/platform/files/common/fileService.ts +++ b/src/vs/platform/files/common/fileService.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce } from 'vs/base/common/arrays'; -import { Promises, ResourceQueue } from 'vs/base/common/async'; -import { bufferedStreamToBuffer, bufferToReadable, newWriteableBufferStream, readableToBuffer, streamToBuffer, VSBuffer, VSBufferReadable, VSBufferReadableBufferedStream, VSBufferReadableStream } from 'vs/base/common/buffer'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Emitter } from 'vs/base/common/event'; -import { hash } from 'vs/base/common/hash'; -import { Iterable } from 'vs/base/common/iterator'; -import { Disposable, DisposableStore, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { Schemas } from 'vs/base/common/network'; -import { mark } from 'vs/base/common/performance'; -import { extUri, extUriIgnorePathCase, IExtUri, isAbsolutePath } from 'vs/base/common/resources'; -import { consumeStream, isReadableBufferedStream, isReadableStream, listenStream, newWriteableStream, peekReadable, peekStream, transform } from 'vs/base/common/stream'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { ensureFileSystemProviderError, etag, ETAG_DISABLED, FileChangesEvent, IFileDeleteOptions, FileOperation, FileOperationError, FileOperationEvent, FileOperationResult, FilePermission, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, hasFileAtomicReadCapability, hasFileFolderCopyCapability, hasFileReadStreamCapability, hasOpenReadWriteCloseCapability, hasReadWriteCapability, ICreateFileOptions, IFileContent, IFileService, IFileStat, IFileStatWithMetadata, IFileStreamContent, IFileSystemProvider, IFileSystemProviderActivationEvent, IFileSystemProviderCapabilitiesChangeEvent, IFileSystemProviderRegistrationEvent, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IReadFileOptions, IReadFileStreamOptions, IResolveFileOptions, IFileStatResult, IFileStatResultWithMetadata, IResolveMetadataFileOptions, IStat, IFileStatWithPartialMetadata, IWatchOptions, IWriteFileOptions, NotModifiedSinceFileOperationError, toFileOperationResult, toFileSystemProviderErrorCode, hasFileCloneCapability, TooLargeFileOperationError, hasFileAtomicDeleteCapability, hasFileAtomicWriteCapability, IWatchOptionsWithCorrelation, IFileSystemWatcher, IWatchOptionsWithoutCorrelation } from 'vs/platform/files/common/files'; -import { readFileIntoStream } from 'vs/platform/files/common/io'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ErrorNoTelemetry } from 'vs/base/common/errors'; +import { coalesce } from '../../../base/common/arrays.js'; +import { Promises, ResourceQueue } from '../../../base/common/async.js'; +import { bufferedStreamToBuffer, bufferToReadable, newWriteableBufferStream, readableToBuffer, streamToBuffer, VSBuffer, VSBufferReadable, VSBufferReadableBufferedStream, VSBufferReadableStream } from '../../../base/common/buffer.js'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { Emitter } from '../../../base/common/event.js'; +import { hash } from '../../../base/common/hash.js'; +import { Iterable } from '../../../base/common/iterator.js'; +import { Disposable, DisposableStore, dispose, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { TernarySearchTree } from '../../../base/common/ternarySearchTree.js'; +import { Schemas } from '../../../base/common/network.js'; +import { mark } from '../../../base/common/performance.js'; +import { extUri, extUriIgnorePathCase, IExtUri, isAbsolutePath } from '../../../base/common/resources.js'; +import { consumeStream, isReadableBufferedStream, isReadableStream, listenStream, newWriteableStream, peekReadable, peekStream, transform } from '../../../base/common/stream.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { ensureFileSystemProviderError, etag, ETAG_DISABLED, FileChangesEvent, IFileDeleteOptions, FileOperation, FileOperationError, FileOperationEvent, FileOperationResult, FilePermission, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, hasFileAtomicReadCapability, hasFileFolderCopyCapability, hasFileReadStreamCapability, hasOpenReadWriteCloseCapability, hasReadWriteCapability, ICreateFileOptions, IFileContent, IFileService, IFileStat, IFileStatWithMetadata, IFileStreamContent, IFileSystemProvider, IFileSystemProviderActivationEvent, IFileSystemProviderCapabilitiesChangeEvent, IFileSystemProviderRegistrationEvent, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IReadFileOptions, IReadFileStreamOptions, IResolveFileOptions, IFileStatResult, IFileStatResultWithMetadata, IResolveMetadataFileOptions, IStat, IFileStatWithPartialMetadata, IWatchOptions, IWriteFileOptions, NotModifiedSinceFileOperationError, toFileOperationResult, toFileSystemProviderErrorCode, hasFileCloneCapability, TooLargeFileOperationError, hasFileAtomicDeleteCapability, hasFileAtomicWriteCapability, IWatchOptionsWithCorrelation, IFileSystemWatcher, IWatchOptionsWithoutCorrelation } from './files.js'; +import { readFileIntoStream } from './io.js'; +import { ILogService } from '../../log/common/log.js'; +import { ErrorNoTelemetry } from '../../../base/common/errors.js'; export class FileService extends Disposable implements IFileService { diff --git a/src/vs/platform/files/common/files.ts b/src/vs/platform/files/common/files.ts index 290a991a35d..b1bc8113abf 100644 --- a/src/vs/platform/files/common/files.ts +++ b/src/vs/platform/files/common/files.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer, VSBufferReadable, VSBufferReadableStream } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { IExpression, IRelativePattern } from 'vs/base/common/glob'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { sep } from 'vs/base/common/path'; -import { ReadableStreamEvents } from 'vs/base/common/stream'; -import { startsWithIgnoreCase } from 'vs/base/common/strings'; -import { isNumber } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { isWeb } from 'vs/base/common/platform'; -import { Schemas } from 'vs/base/common/network'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { Lazy } from 'vs/base/common/lazy'; +import { VSBuffer, VSBufferReadable, VSBufferReadableStream } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { IExpression, IRelativePattern } from '../../../base/common/glob.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { TernarySearchTree } from '../../../base/common/ternarySearchTree.js'; +import { sep } from '../../../base/common/path.js'; +import { ReadableStreamEvents } from '../../../base/common/stream.js'; +import { startsWithIgnoreCase } from '../../../base/common/strings.js'; +import { isNumber } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { isWeb } from '../../../base/common/platform.js'; +import { Schemas } from '../../../base/common/network.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { Lazy } from '../../../base/common/lazy.js'; //#region file service & providers @@ -1460,7 +1460,7 @@ export interface IGlobPatterns { } export interface IFilesConfiguration { - files: IFilesConfigurationNode; + files?: IFilesConfigurationNode; } export interface IFilesConfigurationNode { diff --git a/src/vs/platform/files/common/inMemoryFilesystemProvider.ts b/src/vs/platform/files/common/inMemoryFilesystemProvider.ts index f875c3be628..ecdebd131bc 100644 --- a/src/vs/platform/files/common/inMemoryFilesystemProvider.ts +++ b/src/vs/platform/files/common/inMemoryFilesystemProvider.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import * as resources from 'vs/base/common/resources'; -import { ReadableStreamEvents, newWriteableStream } from 'vs/base/common/stream'; -import { URI } from 'vs/base/common/uri'; -import { FileChangeType, IFileDeleteOptions, IFileOverwriteOptions, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileChange, IFileSystemProviderWithFileReadWriteCapability, IStat, IWatchOptions, createFileSystemProviderError, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileOpenOptions, IFileSystemProviderWithFileAtomicDeleteCapability, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileReadStreamCapability } from 'vs/platform/files/common/files'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import * as resources from '../../../base/common/resources.js'; +import { ReadableStreamEvents, newWriteableStream } from '../../../base/common/stream.js'; +import { URI } from '../../../base/common/uri.js'; +import { FileChangeType, IFileDeleteOptions, IFileOverwriteOptions, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileChange, IFileSystemProviderWithFileReadWriteCapability, IStat, IWatchOptions, createFileSystemProviderError, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileOpenOptions, IFileSystemProviderWithFileAtomicDeleteCapability, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileReadStreamCapability } from './files.js'; class File implements IStat { diff --git a/src/vs/platform/files/common/io.ts b/src/vs/platform/files/common/io.ts index b37b7a91fb5..cb3f3a54b4f 100644 --- a/src/vs/platform/files/common/io.ts +++ b/src/vs/platform/files/common/io.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { canceled } from 'vs/base/common/errors'; -import { IDataTransformer, IErrorTransformer, WriteableStream } from 'vs/base/common/stream'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { createFileSystemProviderError, ensureFileSystemProviderError, IFileReadStreamOptions, FileSystemProviderErrorCode, IFileSystemProviderWithOpenReadWriteCloseCapability } from 'vs/platform/files/common/files'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { canceled } from '../../../base/common/errors.js'; +import { IDataTransformer, IErrorTransformer, WriteableStream } from '../../../base/common/stream.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { createFileSystemProviderError, ensureFileSystemProviderError, IFileReadStreamOptions, FileSystemProviderErrorCode, IFileSystemProviderWithOpenReadWriteCloseCapability } from './files.js'; export interface ICreateReadStreamOptions extends IFileReadStreamOptions { diff --git a/src/vs/platform/files/common/watcher.ts b/src/vs/platform/files/common/watcher.ts index eef16ccfcb0..343ac19483f 100644 --- a/src/vs/platform/files/common/watcher.ts +++ b/src/vs/platform/files/common/watcher.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { GLOBSTAR, IRelativePattern, parse, ParsedPattern } from 'vs/base/common/glob'; -import { Disposable, DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { isAbsolute } from 'vs/base/common/path'; -import { isLinux } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { FileChangeFilter, FileChangeType, IFileChange, isParent } from 'vs/platform/files/common/files'; +import { Event } from '../../../base/common/event.js'; +import { GLOBSTAR, IRelativePattern, parse, ParsedPattern } from '../../../base/common/glob.js'; +import { Disposable, DisposableStore, IDisposable, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { isAbsolute } from '../../../base/common/path.js'; +import { isLinux } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { FileChangeFilter, FileChangeType, IFileChange, isParent } from './files.js'; interface IWatchRequest { @@ -80,6 +80,11 @@ export interface IRecursiveWatchRequest extends IWatchRequest { * be used in any other case. */ pollingInterval?: number; + + /** + * TODO@bpasero Temporary flag to test the new watcher implementation + */ + useNext?: boolean; } export function isRecursiveWatchRequest(request: IWatchRequest): request is IRecursiveWatchRequest { @@ -169,6 +174,11 @@ export interface IRecursiveWatcherOptions { * be used in any other case. */ readonly pollingInterval?: number; + + /** + * TODO@bpasero Temporary flag to test the new watcher implementation + */ + readonly useNext?: boolean; } export interface INonRecursiveWatcher extends IWatcher { diff --git a/src/vs/platform/files/electron-main/diskFileSystemProviderServer.ts b/src/vs/platform/files/electron-main/diskFileSystemProviderServer.ts index 64cbede2fd1..8ae6363af1b 100644 --- a/src/vs/platform/files/electron-main/diskFileSystemProviderServer.ts +++ b/src/vs/platform/files/electron-main/diskFileSystemProviderServer.ts @@ -4,26 +4,28 @@ *--------------------------------------------------------------------------------------------*/ import { shell } from 'electron'; -import { localize } from 'vs/nls'; -import { isWindows } from 'vs/base/common/platform'; -import { Emitter } from 'vs/base/common/event'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IFileDeleteOptions, IFileChange, IWatchOptions, createFileSystemProviderError, FileSystemProviderErrorCode } from 'vs/platform/files/common/files'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { basename, normalize } from 'vs/base/common/path'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ILogService } from 'vs/platform/log/common/log'; -import { AbstractDiskFileSystemProviderChannel, AbstractSessionFileWatcher, ISessionFileWatcher } from 'vs/platform/files/node/diskFileSystemProviderServer'; -import { DefaultURITransformer, IURITransformer } from 'vs/base/common/uriIpc'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; +import { localize } from '../../../nls.js'; +import { isWindows } from '../../../base/common/platform.js'; +import { Emitter } from '../../../base/common/event.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IFileDeleteOptions, IFileChange, IWatchOptions, createFileSystemProviderError, FileSystemProviderErrorCode } from '../common/files.js'; +import { DiskFileSystemProvider } from '../node/diskFileSystemProvider.js'; +import { basename, normalize } from '../../../base/common/path.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { ILogService } from '../../log/common/log.js'; +import { AbstractDiskFileSystemProviderChannel, AbstractSessionFileWatcher, ISessionFileWatcher } from '../node/diskFileSystemProviderServer.js'; +import { DefaultURITransformer, IURITransformer } from '../../../base/common/uriIpc.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; export class DiskFileSystemProviderChannel extends AbstractDiskFileSystemProviderChannel { constructor( provider: DiskFileSystemProvider, logService: ILogService, - private readonly environmentService: IEnvironmentService + private readonly environmentService: IEnvironmentService, + private readonly configurationService: IConfigurationService ) { super(provider, logService); } @@ -57,7 +59,7 @@ export class DiskFileSystemProviderChannel extends AbstractDiskFileSystemProvide //#region File Watching protected createSessionFileWatcher(uriTransformer: IURITransformer, emitter: Emitter): ISessionFileWatcher { - return new SessionFileWatcher(uriTransformer, emitter, this.logService, this.environmentService); + return new SessionFileWatcher(uriTransformer, emitter, this.logService, this.environmentService, this.configurationService); } //#endregion diff --git a/src/vs/platform/files/node/diskFileSystemProvider.ts b/src/vs/platform/files/node/diskFileSystemProvider.ts index 5e923bdfab5..4586709dd2c 100644 --- a/src/vs/platform/files/node/diskFileSystemProvider.ts +++ b/src/vs/platform/files/node/diskFileSystemProvider.ts @@ -3,28 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Stats } from 'fs'; -import { Barrier, retry } from 'vs/base/common/async'; -import { ResourceMap } from 'vs/base/common/map'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { isEqual } from 'vs/base/common/extpath'; -import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { basename, dirname, join } from 'vs/base/common/path'; -import { isLinux, isWindows } from 'vs/base/common/platform'; -import { extUriBiasedIgnorePathCase, joinPath, basename as resourcesBasename, dirname as resourcesDirname } from 'vs/base/common/resources'; -import { newWriteableStream, ReadableStreamEvents } from 'vs/base/common/stream'; -import { URI } from 'vs/base/common/uri'; -import { IDirent, Promises, RimRafMode, SymlinkSupport } from 'vs/base/node/pfs'; -import { localize } from 'vs/nls'; -import { createFileSystemProviderError, IFileAtomicReadOptions, IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileReadStreamOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileCloneCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, isFileOpenForWriteOptions, IStat, FilePermission, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileAtomicDeleteCapability, IFileChange } from 'vs/platform/files/common/files'; -import { readFileIntoStream } from 'vs/platform/files/common/io'; -import { AbstractNonRecursiveWatcherClient, AbstractUniversalWatcherClient, ILogMessage } from 'vs/platform/files/common/watcher'; -import { ILogService } from 'vs/platform/log/common/log'; -import { AbstractDiskFileSystemProvider, IDiskFileSystemProviderOptions } from 'vs/platform/files/common/diskFileSystemProvider'; -import { UniversalWatcherClient } from 'vs/platform/files/node/watcher/watcherClient'; -import { NodeJSWatcherClient } from 'vs/platform/files/node/watcher/nodejs/nodejsClient'; +import { Stats, promises } from 'fs'; +import { Barrier, retry } from '../../../base/common/async.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { isEqual } from '../../../base/common/extpath.js'; +import { DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { basename, dirname, join } from '../../../base/common/path.js'; +import { isLinux, isWindows } from '../../../base/common/platform.js'; +import { extUriBiasedIgnorePathCase, joinPath, basename as resourcesBasename, dirname as resourcesDirname } from '../../../base/common/resources.js'; +import { newWriteableStream, ReadableStreamEvents } from '../../../base/common/stream.js'; +import { URI } from '../../../base/common/uri.js'; +import { IDirent, Promises, RimRafMode, SymlinkSupport } from '../../../base/node/pfs.js'; +import { localize } from '../../../nls.js'; +import { createFileSystemProviderError, IFileAtomicReadOptions, IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileReadStreamOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileCloneCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, isFileOpenForWriteOptions, IStat, FilePermission, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileAtomicDeleteCapability, IFileChange } from '../common/files.js'; +import { readFileIntoStream } from '../common/io.js'; +import { AbstractNonRecursiveWatcherClient, AbstractUniversalWatcherClient, ILogMessage } from '../common/watcher.js'; +import { ILogService } from '../../log/common/log.js'; +import { AbstractDiskFileSystemProvider, IDiskFileSystemProviderOptions } from '../common/diskFileSystemProvider.js'; +import { UniversalWatcherClient } from './watcher/watcherClient.js'; +import { NodeJSWatcherClient } from './watcher/nodejs/nodejsClient.js'; export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider implements IFileSystemProviderWithFileReadWriteCapability, @@ -203,7 +203,7 @@ export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider imple const filePath = this.toFilePath(resource); - return await Promises.readFile(filePath); + return await promises.readFile(filePath); } catch (error) { throw this.toFileSystemProviderError(error); } finally { @@ -354,7 +354,7 @@ export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider imple try { const { stat } = await SymlinkSupport.stat(filePath); if (!(stat.mode & 0o200 /* File mode indicating writable by owner */)) { - await Promises.chmod(filePath, stat.mode | 0o200); + await promises.chmod(filePath, stat.mode | 0o200); } } catch (error) { if (error.code !== 'ENOENT') { @@ -373,7 +373,7 @@ export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider imple // by first truncating the file and then writing with r+ flag. This helps to save hidden files on Windows // (see https://github.com/microsoft/vscode/issues/931) and prevent removing alternate data streams // (see https://github.com/microsoft/vscode/issues/6363) - await Promises.truncate(filePath, 0); + await promises.truncate(filePath, 0); // After a successful truncate() the flag can be set to 'r+' which will not truncate. flags = 'r+'; @@ -595,7 +595,7 @@ export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider imple async mkdir(resource: URI): Promise { try { - await Promises.mkdir(this.toFilePath(resource)); + await promises.mkdir(this.toFilePath(resource)); } catch (error) { throw this.toFileSystemProviderError(error); } @@ -613,7 +613,7 @@ export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider imple await Promises.rm(filePath, RimRafMode.MOVE, rmMoveToPath); } else { try { - await Promises.unlink(filePath); + await promises.unlink(filePath); } catch (unlinkError) { // `fs.unlink` will throw when used on directories @@ -631,7 +631,7 @@ export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider imple } if (isDirectory) { - await Promises.rmdir(filePath); + await promises.rmdir(filePath); } else { throw unlinkError; } @@ -778,10 +778,10 @@ export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider imple locks.add(await this.createResourceLock(to)); if (mkdir) { - await Promises.mkdir(dirname(toFilePath), { recursive: true }); + await promises.mkdir(dirname(toFilePath), { recursive: true }); } - await Promises.copyFile(fromFilePath, toFilePath); + await promises.copyFile(fromFilePath, toFilePath); } catch (error) { if (error.code === 'ENOENT' && !mkdir) { return this.doCloneFile(from, to, true); diff --git a/src/vs/platform/files/node/diskFileSystemProviderServer.ts b/src/vs/platform/files/node/diskFileSystemProviderServer.ts index a6407715b10..31efeb9e2fe 100644 --- a/src/vs/platform/files/node/diskFileSystemProviderServer.ts +++ b/src/vs/platform/files/node/diskFileSystemProviderServer.ts @@ -3,19 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { Disposable, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { ReadableStreamEventPayload, listenStream } from 'vs/base/common/stream'; -import { IStat, IFileReadStreamOptions, IFileWriteOptions, IFileOpenOptions, IFileDeleteOptions, IFileOverwriteOptions, IFileChange, IWatchOptions, FileType, IFileAtomicReadOptions } from 'vs/platform/files/common/files'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { IRecursiveWatcherOptions } from 'vs/platform/files/common/watcher'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { DiskFileSystemProvider } from './diskFileSystemProvider.js'; +import { Disposable, dispose, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { ILogService } from '../../log/common/log.js'; +import { IURITransformer } from '../../../base/common/uriIpc.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { ReadableStreamEventPayload, listenStream } from '../../../base/common/stream.js'; +import { IStat, IFileReadStreamOptions, IFileWriteOptions, IFileOpenOptions, IFileDeleteOptions, IFileOverwriteOptions, IFileChange, IWatchOptions, FileType, IFileAtomicReadOptions } from '../common/files.js'; +import { CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { IRecursiveWatcherOptions } from '../common/watcher.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; export interface ISessionFileWatcher extends IDisposable { watch(req: number, resource: URI, opts: IWatchOptions): IDisposable; @@ -278,7 +279,8 @@ export abstract class AbstractSessionFileWatcher extends Disposable implements I private readonly uriTransformer: IURITransformer, sessionEmitter: Emitter, private readonly logService: ILogService, - private readonly environmentService: IEnvironmentService + private readonly environmentService: IEnvironmentService, + private readonly configurationService: IConfigurationService ) { super(); @@ -303,7 +305,11 @@ export abstract class AbstractSessionFileWatcher extends Disposable implements I } protected getRecursiveWatcherOptions(environmentService: IEnvironmentService): IRecursiveWatcherOptions | undefined { - return undefined; // subclasses can override + if (this.configurationService.getValue('files.experimentalWatcherNext') === true) { + return { useNext: true, usePolling: false }; + } + + return undefined; } protected getExtraExcludes(environmentService: IEnvironmentService): string[] | undefined { diff --git a/src/vs/platform/files/node/watcher/baseWatcher.ts b/src/vs/platform/files/node/watcher/baseWatcher.ts index c5665396da9..2f1658a705f 100644 --- a/src/vs/platform/files/node/watcher/baseWatcher.ts +++ b/src/vs/platform/files/node/watcher/baseWatcher.ts @@ -4,12 +4,19 @@ *--------------------------------------------------------------------------------------------*/ import { watchFile, unwatchFile, Stats } from 'fs'; -import { Disposable, DisposableMap, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { ILogMessage, IRecursiveWatcherWithSubscribe, IUniversalWatchRequest, IWatchRequestWithCorrelation, IWatcher, IWatcherErrorEvent, isWatchRequestWithCorrelation, requestFilterToString } from 'vs/platform/files/common/watcher'; -import { Emitter, Event } from 'vs/base/common/event'; -import { FileChangeType, IFileChange } from 'vs/platform/files/common/files'; -import { URI } from 'vs/base/common/uri'; -import { DeferredPromise, ThrottledDelayer } from 'vs/base/common/async'; +import { Disposable, DisposableMap, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js'; +import { ILogMessage, IRecursiveWatcherWithSubscribe, IUniversalWatchRequest, IWatchRequestWithCorrelation, IWatcher, IWatcherErrorEvent, isRecursiveWatchRequest, isWatchRequestWithCorrelation, requestFilterToString } from '../../common/watcher.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { FileChangeType, IFileChange } from '../../common/files.js'; +import { URI } from '../../../../base/common/uri.js'; +import { DeferredPromise, ThrottledDelayer } from '../../../../base/common/async.js'; +import { hash } from '../../../../base/common/hash.js'; + +interface ISuspendedWatchRequest { + readonly id: number; + readonly correlationId: number | undefined; + readonly path: string; +} export abstract class BaseWatcher extends Disposable implements IWatcher { @@ -22,11 +29,11 @@ export abstract class BaseWatcher extends Disposable implements IWatcher { protected readonly _onDidWatchFail = this._register(new Emitter()); private readonly onDidWatchFail = this._onDidWatchFail.event; - private readonly allNonCorrelatedWatchRequests = new Set(); - private readonly allCorrelatedWatchRequests = new Map(); + private readonly correlatedWatchRequests = new Map(); + private readonly nonCorrelatedWatchRequests = new Map(); - private readonly suspendedWatchRequests = this._register(new DisposableMap()); - private readonly suspendedWatchRequestsWithPolling = new Set(); + private readonly suspendedWatchRequests = this._register(new DisposableMap()); + private readonly suspendedWatchRequestsWithPolling = new Set(); private readonly updateWatchersDelayer = this._register(new ThrottledDelayer(this.getUpdateWatchersDelay())); @@ -37,32 +44,28 @@ export abstract class BaseWatcher extends Disposable implements IWatcher { constructor() { super(); - this._register(this.onDidWatchFail(request => this.handleDidWatchFail(request))); - } - - private handleDidWatchFail(request: IUniversalWatchRequest): void { - if (!this.isCorrelated(request)) { - - // For now, limit failed watch monitoring to requests with a correlationId - // to experiment with this feature in a controlled way. Monitoring requests - // requires us to install polling watchers (via `fs.watchFile()`) and thus - // should be used sparingly. - // - // TODO@bpasero revisit this in the future to have a more general approach - // for suspend/resume and drop the `legacyMonitorRequest` in parcel. - // One issue is that we need to be able to uniquely identify a request and - // without correlation that is actually harder... - - return; - } - - this.suspendWatchRequest(request); + this._register(this.onDidWatchFail(request => this.suspendWatchRequest({ + id: this.computeId(request), + correlationId: this.isCorrelated(request) ? request.correlationId : undefined, + path: request.path + }))); } protected isCorrelated(request: IUniversalWatchRequest): request is IWatchRequestWithCorrelation { return isWatchRequestWithCorrelation(request); } + private computeId(request: IUniversalWatchRequest): number { + if (this.isCorrelated(request)) { + return request.correlationId; + } else { + // Requests without correlation do not carry any unique identifier, so we have to + // come up with one based on the options of the request. This matches what the + // file service does (vs/platform/files/common/fileService.ts#L1178). + return hash(request); + } + } + async watch(requests: IUniversalWatchRequest[]): Promise { if (!this.joinWatch.isSettled) { this.joinWatch.complete(); @@ -70,23 +73,23 @@ export abstract class BaseWatcher extends Disposable implements IWatcher { this.joinWatch = new DeferredPromise(); try { - this.allCorrelatedWatchRequests.clear(); - this.allNonCorrelatedWatchRequests.clear(); + this.correlatedWatchRequests.clear(); + this.nonCorrelatedWatchRequests.clear(); // Figure out correlated vs. non-correlated requests for (const request of requests) { if (this.isCorrelated(request)) { - this.allCorrelatedWatchRequests.set(request.correlationId, request); + this.correlatedWatchRequests.set(request.correlationId, request); } else { - this.allNonCorrelatedWatchRequests.add(request); + this.nonCorrelatedWatchRequests.set(this.computeId(request), request); } } - // Remove all suspended correlated watch requests that are no longer watched - for (const [correlationId] of this.suspendedWatchRequests) { - if (!this.allCorrelatedWatchRequests.has(correlationId)) { - this.suspendedWatchRequests.deleteAndDispose(correlationId); - this.suspendedWatchRequestsWithPolling.delete(correlationId); + // Remove all suspended watch requests that are no longer watched + for (const [id] of this.suspendedWatchRequests) { + if (!this.nonCorrelatedWatchRequests.has(id) && !this.correlatedWatchRequests.has(id)) { + this.suspendedWatchRequests.deleteAndDispose(id); + this.suspendedWatchRequestsWithPolling.delete(id); } } @@ -97,10 +100,14 @@ export abstract class BaseWatcher extends Disposable implements IWatcher { } private updateWatchers(delayed: boolean): Promise { - return this.updateWatchersDelayer.trigger(() => this.doWatch([ - ...this.allNonCorrelatedWatchRequests, - ...Array.from(this.allCorrelatedWatchRequests.values()).filter(request => !this.suspendedWatchRequests.has(request.correlationId)) - ]), delayed ? this.getUpdateWatchersDelay() : 0); + const nonSuspendedRequests: IUniversalWatchRequest[] = []; + for (const [id, request] of [...this.nonCorrelatedWatchRequests, ...this.correlatedWatchRequests]) { + if (!this.suspendedWatchRequests.has(id)) { + nonSuspendedRequests.push(request); + } + } + + return this.updateWatchersDelayer.trigger(() => this.doWatch(nonSuspendedRequests), delayed ? this.getUpdateWatchersDelay() : 0); } protected getUpdateWatchersDelay(): number { @@ -108,20 +115,17 @@ export abstract class BaseWatcher extends Disposable implements IWatcher { } isSuspended(request: IUniversalWatchRequest): 'polling' | boolean { - if (typeof request.correlationId !== 'number') { - return false; - } - - return this.suspendedWatchRequestsWithPolling.has(request.correlationId) ? 'polling' : this.suspendedWatchRequests.has(request.correlationId); + const id = this.computeId(request); + return this.suspendedWatchRequestsWithPolling.has(id) ? 'polling' : this.suspendedWatchRequests.has(id); } - private async suspendWatchRequest(request: IWatchRequestWithCorrelation): Promise { - if (this.suspendedWatchRequests.has(request.correlationId)) { + private async suspendWatchRequest(request: ISuspendedWatchRequest): Promise { + if (this.suspendedWatchRequests.has(request.id)) { return; // already suspended } const disposables = new DisposableStore(); - this.suspendedWatchRequests.set(request.correlationId, disposables); + this.suspendedWatchRequests.set(request.id, disposables); // It is possible that a watch request fails right during watch() // phase while other requests succeed. To increase the chance of @@ -139,24 +143,24 @@ export abstract class BaseWatcher extends Disposable implements IWatcher { this.updateWatchers(true /* delay this call as we might accumulate many failing watch requests on startup */); } - private resumeWatchRequest(request: IWatchRequestWithCorrelation): void { - this.suspendedWatchRequests.deleteAndDispose(request.correlationId); - this.suspendedWatchRequestsWithPolling.delete(request.correlationId); + private resumeWatchRequest(request: ISuspendedWatchRequest): void { + this.suspendedWatchRequests.deleteAndDispose(request.id); + this.suspendedWatchRequestsWithPolling.delete(request.id); this.updateWatchers(false); } - private monitorSuspendedWatchRequest(request: IWatchRequestWithCorrelation, disposables: DisposableStore): void { + private monitorSuspendedWatchRequest(request: ISuspendedWatchRequest, disposables: DisposableStore): void { if (this.doMonitorWithExistingWatcher(request, disposables)) { this.trace(`reusing an existing recursive watcher to monitor ${request.path}`); - this.suspendedWatchRequestsWithPolling.delete(request.correlationId); + this.suspendedWatchRequestsWithPolling.delete(request.id); } else { this.doMonitorWithNodeJS(request, disposables); - this.suspendedWatchRequestsWithPolling.add(request.correlationId); + this.suspendedWatchRequestsWithPolling.add(request.id); } } - private doMonitorWithExistingWatcher(request: IWatchRequestWithCorrelation, disposables: DisposableStore): boolean { + private doMonitorWithExistingWatcher(request: ISuspendedWatchRequest, disposables: DisposableStore): boolean { const subscription = this.recursiveWatcher?.subscribe(request.path, (error, change) => { if (disposables.isDisposed) { return; // return early if already disposed @@ -178,7 +182,7 @@ export abstract class BaseWatcher extends Disposable implements IWatcher { return false; } - private doMonitorWithNodeJS(request: IWatchRequestWithCorrelation, disposables: DisposableStore): void { + private doMonitorWithNodeJS(request: ISuspendedWatchRequest, disposables: DisposableStore): void { let pathNotFound = false; const watchFileCallback: (curr: Stats, prev: Stats) => void = (curr, prev) => { @@ -215,7 +219,7 @@ export abstract class BaseWatcher extends Disposable implements IWatcher { })); } - private onMonitoredPathAdded(request: IWatchRequestWithCorrelation) { + private onMonitoredPathAdded(request: ISuspendedWatchRequest): void { this.trace(`detected ${request.path} exists again, resuming watcher (correlationId: ${request.correlationId})`); // Emit as event @@ -236,21 +240,21 @@ export abstract class BaseWatcher extends Disposable implements IWatcher { this.suspendedWatchRequestsWithPolling.clear(); } - protected traceEvent(event: IFileChange, request: IUniversalWatchRequest): void { + protected traceEvent(event: IFileChange, request: IUniversalWatchRequest | ISuspendedWatchRequest): void { if (this.verboseLogging) { const traceMsg = ` >> normalized ${event.type === FileChangeType.ADDED ? '[ADDED]' : event.type === FileChangeType.DELETED ? '[DELETED]' : '[CHANGED]'} ${event.resource.fsPath}`; this.traceWithCorrelation(traceMsg, request); } } - protected traceWithCorrelation(message: string, request: IUniversalWatchRequest): void { + protected traceWithCorrelation(message: string, request: IUniversalWatchRequest | ISuspendedWatchRequest): void { if (this.verboseLogging) { this.trace(`${message}${typeof request.correlationId === 'number' ? ` <${request.correlationId}> ` : ``}`); } } protected requestToString(request: IUniversalWatchRequest): string { - return `${request.path} (excludes: ${request.excludes.length > 0 ? request.excludes : ''}, includes: ${request.includes && request.includes.length > 0 ? JSON.stringify(request.includes) : ''}, filter: ${requestFilterToString(request.filter)}, correlationId: ${typeof request.correlationId === 'number' ? request.correlationId : ''})`; + return `${request.path} (excludes: ${request.excludes.length > 0 ? request.excludes : ''}, includes: ${request.includes && request.includes.length > 0 ? JSON.stringify(request.includes) : ''}, filter: ${requestFilterToString(request.filter)}, correlationId: ${typeof request.correlationId === 'number' ? request.correlationId : ''}${isRecursiveWatchRequest(request) ? `, useNext: ${request.useNext}` : ''})`; } protected abstract doWatch(requests: IUniversalWatchRequest[]): Promise; diff --git a/src/vs/platform/files/node/watcher/nodejs/nodejsClient.ts b/src/vs/platform/files/node/watcher/nodejs/nodejsClient.ts index 3a2f6446996..a10792b1dbf 100644 --- a/src/vs/platform/files/node/watcher/nodejs/nodejsClient.ts +++ b/src/vs/platform/files/node/watcher/nodejs/nodejsClient.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IFileChange } from 'vs/platform/files/common/files'; -import { ILogMessage, AbstractNonRecursiveWatcherClient, INonRecursiveWatcher } from 'vs/platform/files/common/watcher'; -import { NodeJSWatcher } from 'vs/platform/files/node/watcher/nodejs/nodejsWatcher'; +import { DisposableStore } from '../../../../../base/common/lifecycle.js'; +import { IFileChange } from '../../../common/files.js'; +import { ILogMessage, AbstractNonRecursiveWatcherClient, INonRecursiveWatcher } from '../../../common/watcher.js'; +import { NodeJSWatcher } from './nodejsWatcher.js'; export class NodeJSWatcherClient extends AbstractNonRecursiveWatcherClient { diff --git a/src/vs/platform/files/node/watcher/nodejs/nodejsWatcher.ts b/src/vs/platform/files/node/watcher/nodejs/nodejsWatcher.ts index 16f861668ac..0c60edd91a9 100644 --- a/src/vs/platform/files/node/watcher/nodejs/nodejsWatcher.ts +++ b/src/vs/platform/files/node/watcher/nodejs/nodejsWatcher.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { patternsEquals } from 'vs/base/common/glob'; -import { BaseWatcher } from 'vs/platform/files/node/watcher/baseWatcher'; -import { isLinux } from 'vs/base/common/platform'; -import { INonRecursiveWatchRequest, INonRecursiveWatcher, IRecursiveWatcherWithSubscribe } from 'vs/platform/files/common/watcher'; -import { NodeJSFileWatcherLibrary } from 'vs/platform/files/node/watcher/nodejs/nodejsWatcherLib'; -import { isEqual } from 'vs/base/common/extpath'; +import { Event } from '../../../../../base/common/event.js'; +import { patternsEquals } from '../../../../../base/common/glob.js'; +import { BaseWatcher } from '../baseWatcher.js'; +import { isLinux } from '../../../../../base/common/platform.js'; +import { INonRecursiveWatchRequest, INonRecursiveWatcher, IRecursiveWatcherWithSubscribe } from '../../../common/watcher.js'; +import { NodeJSFileWatcherLibrary } from './nodejsWatcherLib.js'; +import { isEqual } from '../../../../../base/common/extpath.js'; export interface INodeJSWatcherInstance { diff --git a/src/vs/platform/files/node/watcher/nodejs/nodejsWatcherLib.ts b/src/vs/platform/files/node/watcher/nodejs/nodejsWatcherLib.ts index c71f1581cf6..69792c99623 100644 --- a/src/vs/platform/files/node/watcher/nodejs/nodejsWatcherLib.ts +++ b/src/vs/platform/files/node/watcher/nodejs/nodejsWatcherLib.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { watch } from 'fs'; -import { RunOnceWorker, ThrottledWorker } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { isEqualOrParent } from 'vs/base/common/extpath'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { normalizeNFC } from 'vs/base/common/normalization'; -import { basename, dirname, join } from 'vs/base/common/path'; -import { isLinux, isMacintosh } from 'vs/base/common/platform'; -import { joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { realcase } from 'vs/base/node/extpath'; -import { Promises } from 'vs/base/node/pfs'; -import { FileChangeType, IFileChange } from 'vs/platform/files/common/files'; -import { ILogMessage, coalesceEvents, INonRecursiveWatchRequest, parseWatcherPatterns, IRecursiveWatcherWithSubscribe, isFiltered, isWatchRequestWithCorrelation } from 'vs/platform/files/common/watcher'; +import { watch, promises } from 'fs'; +import { RunOnceWorker, ThrottledWorker } from '../../../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../../base/common/cancellation.js'; +import { isEqualOrParent } from '../../../../../base/common/extpath.js'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../../base/common/lifecycle.js'; +import { normalizeNFC } from '../../../../../base/common/normalization.js'; +import { basename, dirname, join } from '../../../../../base/common/path.js'; +import { isLinux, isMacintosh } from '../../../../../base/common/platform.js'; +import { joinPath } from '../../../../../base/common/resources.js'; +import { URI } from '../../../../../base/common/uri.js'; +import { realcase } from '../../../../../base/node/extpath.js'; +import { Promises } from '../../../../../base/node/pfs.js'; +import { FileChangeType, IFileChange } from '../../../common/files.js'; +import { ILogMessage, coalesceEvents, INonRecursiveWatchRequest, parseWatcherPatterns, IRecursiveWatcherWithSubscribe, isFiltered, isWatchRequestWithCorrelation } from '../../../common/watcher.js'; export class NodeJSFileWatcherLibrary extends Disposable { @@ -51,7 +51,7 @@ export class NodeJSFileWatcherLibrary extends Disposable { private readonly excludes = parseWatcherPatterns(this.request.path, this.request.excludes); private readonly includes = this.request.includes ? parseWatcherPatterns(this.request.path, this.request.includes) : undefined; - private readonly filter = isWatchRequestWithCorrelation(this.request) ? this.request.filter : undefined; // TODO@bpasero filtering for now is only enabled when correlating because watchers are otherwise potentially reused + private readonly filter = isWatchRequestWithCorrelation(this.request) ? this.request.filter : undefined; // filtering is only enabled when correlating because watchers are otherwise potentially reused private readonly cts = new CancellationTokenSource(); @@ -82,7 +82,7 @@ export class NodeJSFileWatcherLibrary extends Disposable { return; } - const stat = await Promises.stat(realPath); + const stat = await promises.stat(realPath); if (this.cts.token.isCancellationRequested) { return; diff --git a/src/vs/platform/files/node/watcher/parcel/parcelWatcher.ts b/src/vs/platform/files/node/watcher/parcel/parcelWatcher.ts index 46d213c12e8..25817920c17 100644 --- a/src/vs/platform/files/node/watcher/parcel/parcelWatcher.ts +++ b/src/vs/platform/files/node/watcher/parcel/parcelWatcher.ts @@ -4,25 +4,25 @@ *--------------------------------------------------------------------------------------------*/ import * as parcelWatcher from '@parcel/watcher'; -import { existsSync, statSync, unlinkSync } from 'fs'; -import { tmpdir } from 'os'; -import { URI } from 'vs/base/common/uri'; -import { DeferredPromise, RunOnceScheduler, RunOnceWorker, ThrottledWorker } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { Emitter, Event } from 'vs/base/common/event'; -import { randomPath, isEqual, isEqualOrParent } from 'vs/base/common/extpath'; -import { GLOBSTAR, patternsEquals } from 'vs/base/common/glob'; -import { BaseWatcher } from 'vs/platform/files/node/watcher/baseWatcher'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { normalizeNFC } from 'vs/base/common/normalization'; -import { dirname, normalize } from 'vs/base/common/path'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { realcaseSync, realpathSync } from 'vs/base/node/extpath'; -import { NodeJSFileWatcherLibrary } from 'vs/platform/files/node/watcher/nodejs/nodejsWatcherLib'; -import { FileChangeType, IFileChange } from 'vs/platform/files/common/files'; -import { coalesceEvents, IRecursiveWatchRequest, parseWatcherPatterns, IRecursiveWatcherWithSubscribe, isFiltered, IWatcherErrorEvent } from 'vs/platform/files/common/watcher'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import * as parcelWatcher2 from '@bpasero/watcher'; +import { statSync, unlinkSync } from 'fs'; +import { tmpdir, homedir } from 'os'; +import { URI } from '../../../../../base/common/uri.js'; +import { DeferredPromise, RunOnceScheduler, RunOnceWorker, ThrottledWorker } from '../../../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../../base/common/cancellation.js'; +import { toErrorMessage } from '../../../../../base/common/errorMessage.js'; +import { Emitter, Event } from '../../../../../base/common/event.js'; +import { randomPath, isEqual, isEqualOrParent } from '../../../../../base/common/extpath.js'; +import { GLOBSTAR, patternsEquals } from '../../../../../base/common/glob.js'; +import { BaseWatcher } from '../baseWatcher.js'; +import { TernarySearchTree } from '../../../../../base/common/ternarySearchTree.js'; +import { normalizeNFC } from '../../../../../base/common/normalization.js'; +import { normalize, join } from '../../../../../base/common/path.js'; +import { isLinux, isMacintosh, isWindows } from '../../../../../base/common/platform.js'; +import { realcaseSync, realpathSync } from '../../../../../base/node/extpath.js'; +import { FileChangeType, IFileChange } from '../../../common/files.js'; +import { coalesceEvents, IRecursiveWatchRequest, parseWatcherPatterns, IRecursiveWatcherWithSubscribe, isFiltered, IWatcherErrorEvent } from '../../../common/watcher.js'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../../base/common/lifecycle.js'; export class ParcelWatcherInstance extends Disposable { @@ -145,6 +145,14 @@ export class ParcelWatcher extends BaseWatcher implements IRecursiveWatcherWithS ] ); + private static readonly PREDEFINED_EXCLUDES: { [platform: string]: string[] } = { + 'win32': [], + 'darwin': [ + join(homedir(), 'Library', 'Containers') // Triggers access dialog from macOS 14 (https://github.com/microsoft/vscode/issues/208105) + ], + 'linux': [] + }; + private static readonly PARCEL_WATCHER_BACKEND = isWindows ? 'windows' : isLinux ? 'inotify' : 'fs-events'; private readonly _onDidError = this._register(new Emitter()); @@ -281,7 +289,7 @@ export class ParcelWatcher extends BaseWatcher implements IRecursiveWatcherWithS // Path checks for symbolic links / wrong casing const { realPath, realPathDiffers, realPathLength } = this.normalizePath(request); - this.trace(`Started watching: '${realPath}' with polling interval '${pollingInterval}'`); + this.trace(`Started watching: '${realPath}' with polling interval '${pollingInterval}' and version '${request.useNext ? 'next' : 'stable'}'`); let counter = 0; @@ -293,8 +301,9 @@ export class ParcelWatcher extends BaseWatcher implements IRecursiveWatcherWithS } // We already ran before, check for events since + const parcelWatcherLib = request.useNext ? parcelWatcher2 : parcelWatcher; if (counter > 1) { - const parcelEvents = await parcelWatcher.getEventsSince(realPath, snapshotFile, { ignore: request.excludes, backend: ParcelWatcher.PARCEL_WATCHER_BACKEND }); + const parcelEvents = await parcelWatcherLib.getEventsSince(realPath, snapshotFile, { ignore: this.addPredefinedExcludes(request.excludes), backend: ParcelWatcher.PARCEL_WATCHER_BACKEND }); if (cts.token.isCancellationRequested) { return; @@ -305,7 +314,7 @@ export class ParcelWatcher extends BaseWatcher implements IRecursiveWatcherWithS } // Store a snapshot of files to the snapshot file - await parcelWatcher.writeSnapshot(realPath, snapshotFile, { ignore: request.excludes, backend: ParcelWatcher.PARCEL_WATCHER_BACKEND }); + await parcelWatcherLib.writeSnapshot(realPath, snapshotFile, { ignore: this.addPredefinedExcludes(request.excludes), backend: ParcelWatcher.PARCEL_WATCHER_BACKEND }); // Signal we are ready now when the first snapshot was written if (counter === 1) { @@ -350,7 +359,8 @@ export class ParcelWatcher extends BaseWatcher implements IRecursiveWatcherWithS const { realPath, realPathDiffers, realPathLength } = this.normalizePath(request); try { - const parcelWatcherInstance = await parcelWatcher.subscribe(realPath, (error, parcelEvents) => { + const parcelWatcherLib = request.useNext ? parcelWatcher2 : parcelWatcher; + const parcelWatcherInstance = await parcelWatcherLib.subscribe(realPath, (error, parcelEvents) => { if (watcher.token.isCancellationRequested) { return; // return early when disposed } @@ -367,10 +377,10 @@ export class ParcelWatcher extends BaseWatcher implements IRecursiveWatcherWithS this.onParcelEvents(parcelEvents, watcher, realPathDiffers, realPathLength); }, { backend: ParcelWatcher.PARCEL_WATCHER_BACKEND, - ignore: watcher.request.excludes + ignore: this.addPredefinedExcludes(watcher.request.excludes) }); - this.trace(`Started watching: '${realPath}' with backend '${ParcelWatcher.PARCEL_WATCHER_BACKEND}'`); + this.trace(`Started watching: '${realPath}' with backend '${ParcelWatcher.PARCEL_WATCHER_BACKEND}' and version '${request.useNext ? 'next' : 'stable'}'`); instance.complete(parcelWatcherInstance); } catch (error) { @@ -383,6 +393,21 @@ export class ParcelWatcher extends BaseWatcher implements IRecursiveWatcherWithS } } + private addPredefinedExcludes(initialExcludes: string[]): string[] { + const excludes = [...initialExcludes]; + + const predefinedExcludes = ParcelWatcher.PREDEFINED_EXCLUDES[process.platform]; + if (Array.isArray(predefinedExcludes)) { + for (const exclude of predefinedExcludes) { + if (!excludes.includes(exclude)) { + excludes.push(exclude); + } + } + } + + return excludes; + } + private onParcelEvents(parcelEvents: parcelWatcher.Event[], watcher: ParcelWatcherInstance, realPathDiffers: boolean, realPathLength: number): void { if (parcelEvents.length === 0) { return; @@ -516,7 +541,7 @@ export class ParcelWatcher extends BaseWatcher implements IRecursiveWatcherWithS const filteredEvents: IFileChange[] = []; let rootDeleted = false; - const filter = this.isCorrelated(watcher.request) ? watcher.request.filter : undefined; // TODO@bpasero filtering for now is only enabled when correlating because watchers are otherwise potentially reused + const filter = this.isCorrelated(watcher.request) ? watcher.request.filter : undefined; // filtering is only enabled when correlating because watchers are otherwise potentially reused for (const event of events) { // Emit to instance subscriptions if any before filtering @@ -526,20 +551,7 @@ export class ParcelWatcher extends BaseWatcher implements IRecursiveWatcherWithS // Filtering rootDeleted = event.type === FileChangeType.DELETED && isEqual(event.resource.fsPath, watcher.request.path, !isLinux); - if ( - isFiltered(event, filter) || - // Explicitly exclude changes to root if we have any - // to avoid VS Code closing all opened editors which - // can happen e.g. in case of network connectivity - // issues - // (https://github.com/microsoft/vscode/issues/136673) - // - // Update 2024: with the new correlated events, we - // really do not want to skip over file events any - // more, so we only ignore this event for non-correlated - // watch requests. - (rootDeleted && !this.isCorrelated(watcher.request)) - ) { + if (isFiltered(event, filter)) { if (this.verboseLogging) { this.traceWithCorrelation(` >> ignored (filtered) ${event.resource.fsPath}`, watcher.request); } @@ -559,54 +571,8 @@ export class ParcelWatcher extends BaseWatcher implements IRecursiveWatcherWithS private onWatchedPathDeleted(watcher: ParcelWatcherInstance): void { this.warn('Watcher shutdown because watched path got deleted', watcher); - let legacyMonitored = false; - if (!this.isCorrelated(watcher.request)) { - // Do monitoring of the request path parent unless this request - // can be handled via suspend/resume in the super class - legacyMonitored = this.legacyMonitorRequest(watcher); - } - - if (!legacyMonitored) { - watcher.notifyWatchFailed(); - this._onDidWatchFail.fire(watcher.request); - } - } - - private legacyMonitorRequest(watcher: ParcelWatcherInstance): boolean { - const parentPath = dirname(watcher.request.path); - if (existsSync(parentPath)) { - this.trace('Trying to watch on the parent path to restart the watcher...', watcher); - - const nodeWatcher = new NodeJSFileWatcherLibrary({ path: parentPath, excludes: [], recursive: false, correlationId: watcher.request.correlationId }, undefined, changes => { - if (watcher.token.isCancellationRequested) { - return; // return early when disposed - } - - // Watcher path came back! Restart watching... - for (const { resource, type } of changes) { - if (isEqual(resource.fsPath, watcher.request.path, !isLinux) && (type === FileChangeType.ADDED || type === FileChangeType.UPDATED)) { - if (this.isPathValid(watcher.request.path)) { - this.warn('Watcher restarts because watched path got created again', watcher); - - // Stop watching that parent folder - nodeWatcher.dispose(); - - // Restart the file watching - this.restartWatching(watcher); - - break; - } - } - } - }, undefined, msg => this._onDidLogMessage.fire(msg), this.verboseLogging); - - // Make sure to stop watching when the watcher is disposed - watcher.token.onCancellationRequested(() => nodeWatcher.dispose()); - - return true; - } - - return false; + watcher.notifyWatchFailed(); + this._onDidWatchFail.fire(watcher.request); } private onUnexpectedError(error: unknown, request?: IRecursiveWatchRequest): void { @@ -835,7 +801,7 @@ export class ParcelWatcher extends BaseWatcher implements IRecursiveWatcherWithS } private toMessage(message: string, request?: IRecursiveWatchRequest): string { - return request ? `[File Watcher (parcel)] ${message} (path: ${request.path})` : `[File Watcher (parcel)] ${message}`; + return request ? `[File Watcher (${request.useNext ? 'parcel-next' : 'parcel-classic'})] ${message} (path: ${request.path})` : `[File Watcher ('parcel')] ${message}`; } protected get recursiveWatcher() { return this; } diff --git a/src/vs/platform/files/node/watcher/watcher.ts b/src/vs/platform/files/node/watcher/watcher.ts index 3ea9fc61213..9ceab54f800 100644 --- a/src/vs/platform/files/node/watcher/watcher.ts +++ b/src/vs/platform/files/node/watcher/watcher.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { ILogMessage, IUniversalWatcher, IUniversalWatchRequest } from 'vs/platform/files/common/watcher'; -import { Emitter, Event } from 'vs/base/common/event'; -import { ParcelWatcher } from 'vs/platform/files/node/watcher/parcel/parcelWatcher'; -import { NodeJSWatcher } from 'vs/platform/files/node/watcher/nodejs/nodejsWatcher'; -import { Promises } from 'vs/base/common/async'; -import { computeStats } from 'vs/platform/files/node/watcher/watcherStats'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ILogMessage, isRecursiveWatchRequest, IUniversalWatcher, IUniversalWatchRequest } from '../../common/watcher.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { ParcelWatcher } from './parcel/parcelWatcher.js'; +import { NodeJSWatcher } from './nodejs/nodejsWatcher.js'; +import { Promises } from '../../../../base/common/async.js'; +import { computeStats } from './watcherStats.js'; export class UniversalWatcher extends Disposable implements IUniversalWatcher { @@ -23,9 +23,21 @@ export class UniversalWatcher extends Disposable implements IUniversalWatcher { readonly onDidLogMessage = Event.any(this._onDidLogMessage.event, this.recursiveWatcher.onDidLogMessage, this.nonRecursiveWatcher.onDidLogMessage); private requests: IUniversalWatchRequest[] = []; + private failedRecursiveRequests = 0; + + constructor() { + super(); + + this._register(this.recursiveWatcher.onDidError(e => { + if (e.request) { + this.failedRecursiveRequests++; + } + })); + } async watch(requests: IUniversalWatchRequest[]): Promise { this.requests = requests; + this.failedRecursiveRequests = 0; // Watch recursively first to give recursive watchers a chance // to step in for non-recursive watch requests, thus reducing @@ -33,13 +45,13 @@ export class UniversalWatcher extends Disposable implements IUniversalWatcher { let error: Error | undefined; try { - await this.recursiveWatcher.watch(requests.filter(request => request.recursive)); + await this.recursiveWatcher.watch(requests.filter(request => isRecursiveWatchRequest(request))); } catch (e) { error = e; } try { - await this.nonRecursiveWatcher.watch(requests.filter(request => !request.recursive)); + await this.nonRecursiveWatcher.watch(requests.filter(request => !isRecursiveWatchRequest(request))); } catch (e) { if (!error) { error = e; @@ -55,7 +67,7 @@ export class UniversalWatcher extends Disposable implements IUniversalWatcher { // Log stats if (enabled && this.requests.length > 0) { - this._onDidLogMessage.fire({ type: 'trace', message: computeStats(this.requests, this.recursiveWatcher, this.nonRecursiveWatcher) }); + this._onDidLogMessage.fire({ type: 'trace', message: computeStats(this.requests, this.failedRecursiveRequests, this.recursiveWatcher, this.nonRecursiveWatcher) }); } // Forward to watchers diff --git a/src/vs/platform/files/node/watcher/watcherClient.ts b/src/vs/platform/files/node/watcher/watcherClient.ts index f7b39b5f3a1..f14e8c4dd8e 100644 --- a/src/vs/platform/files/node/watcher/watcherClient.ts +++ b/src/vs/platform/files/node/watcher/watcherClient.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { FileAccess } from 'vs/base/common/network'; -import { getNextTickChannel, ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; -import { Client } from 'vs/base/parts/ipc/node/ipc.cp'; -import { IFileChange } from 'vs/platform/files/common/files'; -import { AbstractUniversalWatcherClient, ILogMessage, IUniversalWatcher } from 'vs/platform/files/common/watcher'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { FileAccess } from '../../../../base/common/network.js'; +import { getNextTickChannel, ProxyChannel } from '../../../../base/parts/ipc/common/ipc.js'; +import { Client } from '../../../../base/parts/ipc/node/ipc.cp.js'; +import { IFileChange } from '../../common/files.js'; +import { AbstractUniversalWatcherClient, ILogMessage, IUniversalWatcher } from '../../common/watcher.js'; export class UniversalWatcherClient extends AbstractUniversalWatcherClient { diff --git a/src/vs/platform/files/node/watcher/watcherMain.ts b/src/vs/platform/files/node/watcher/watcherMain.ts index 09f952c4f4a..82f77152dcd 100644 --- a/src/vs/platform/files/node/watcher/watcherMain.ts +++ b/src/vs/platform/files/node/watcher/watcherMain.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; -import { Server as ChildProcessServer } from 'vs/base/parts/ipc/node/ipc.cp'; -import { Server as UtilityProcessServer } from 'vs/base/parts/ipc/node/ipc.mp'; -import { isUtilityProcess } from 'vs/base/parts/sandbox/node/electronTypes'; -import { UniversalWatcher } from 'vs/platform/files/node/watcher/watcher'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ProxyChannel } from '../../../../base/parts/ipc/common/ipc.js'; +import { Server as ChildProcessServer } from '../../../../base/parts/ipc/node/ipc.cp.js'; +import { Server as UtilityProcessServer } from '../../../../base/parts/ipc/node/ipc.mp.js'; +import { isUtilityProcess } from '../../../../base/parts/sandbox/node/electronTypes.js'; +import { UniversalWatcher } from './watcher.js'; let server: ChildProcessServer | UtilityProcessServer; if (isUtilityProcess(process)) { diff --git a/src/vs/platform/files/node/watcher/watcherStats.ts b/src/vs/platform/files/node/watcher/watcherStats.ts index 861e6d24bf8..7d07a861ba2 100644 --- a/src/vs/platform/files/node/watcher/watcherStats.ts +++ b/src/vs/platform/files/node/watcher/watcherStats.ts @@ -3,18 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IUniversalWatchRequest, requestFilterToString } from 'vs/platform/files/common/watcher'; -import { INodeJSWatcherInstance, NodeJSWatcher } from 'vs/platform/files/node/watcher/nodejs/nodejsWatcher'; -import { ParcelWatcher, ParcelWatcherInstance } from 'vs/platform/files/node/watcher/parcel/parcelWatcher'; +import { INonRecursiveWatchRequest, IRecursiveWatchRequest, isRecursiveWatchRequest, IUniversalWatchRequest, requestFilterToString } from '../../common/watcher.js'; +import { INodeJSWatcherInstance, NodeJSWatcher } from './nodejs/nodejsWatcher.js'; +import { ParcelWatcher, ParcelWatcherInstance } from './parcel/parcelWatcher.js'; export function computeStats( requests: IUniversalWatchRequest[], + failedRecursiveRequests: number, recursiveWatcher: ParcelWatcher, nonRecursiveWatcher: NodeJSWatcher ): string { const lines: string[] = []; - const allRecursiveRequests = sortByPathPrefix(requests.filter(request => request.recursive)); + const allRecursiveRequests = sortByPathPrefix(requests.filter(request => isRecursiveWatchRequest(request))); const nonSuspendedRecursiveRequests = allRecursiveRequests.filter(request => recursiveWatcher.isSuspended(request) === false); const suspendedPollingRecursiveRequests = allRecursiveRequests.filter(request => recursiveWatcher.isSuspended(request) === 'polling'); const suspendedNonPollingRecursiveRequests = allRecursiveRequests.filter(request => recursiveWatcher.isSuspended(request) === true); @@ -22,7 +23,7 @@ export function computeStats( const recursiveRequestsStatus = computeRequestStatus(allRecursiveRequests, recursiveWatcher); const recursiveWatcherStatus = computeRecursiveWatchStatus(recursiveWatcher); - const allNonRecursiveRequests = sortByPathPrefix(requests.filter(request => !request.recursive)); + const allNonRecursiveRequests = sortByPathPrefix(requests.filter(request => !isRecursiveWatchRequest(request))); const nonSuspendedNonRecursiveRequests = allNonRecursiveRequests.filter(request => nonRecursiveWatcher.isSuspended(request) === false); const suspendedPollingNonRecursiveRequests = allNonRecursiveRequests.filter(request => nonRecursiveWatcher.isSuspended(request) === 'polling'); const suspendedNonPollingNonRecursiveRequests = allNonRecursiveRequests.filter(request => nonRecursiveWatcher.isSuspended(request) === true); @@ -31,7 +32,7 @@ export function computeStats( const nonRecursiveWatcherStatus = computeNonRecursiveWatchStatus(nonRecursiveWatcher); lines.push('[Summary]'); - lines.push(`- Recursive Requests: total: ${allRecursiveRequests.length}, suspended: ${recursiveRequestsStatus.suspended}, polling: ${recursiveRequestsStatus.polling}`); + lines.push(`- Recursive Requests: total: ${allRecursiveRequests.length}, suspended: ${recursiveRequestsStatus.suspended}, polling: ${recursiveRequestsStatus.polling}, failed: ${failedRecursiveRequests}`); lines.push(`- Non-Recursive Requests: total: ${allNonRecursiveRequests.length}, suspended: ${nonRecursiveRequestsStatus.suspended}, polling: ${nonRecursiveRequestsStatus.polling}`); lines.push(`- Recursive Watchers: total: ${recursiveWatcher.watchers.size}, active: ${recursiveWatcherStatus.active}, failed: ${recursiveWatcherStatus.failed}, stopped: ${recursiveWatcherStatus.stopped}`); lines.push(`- Non-Recursive Watchers: total: ${nonRecursiveWatcher.watchers.size}, active: ${nonRecursiveWatcherStatus.active}, failed: ${nonRecursiveWatcherStatus.failed}, reusing: ${nonRecursiveWatcherStatus.reusing}`); @@ -59,7 +60,7 @@ export function computeStats( fillNonRecursiveWatcherStats(nonRecursiveWatcheLines, nonRecursiveWatcher); lines.push(...alignTextColumns(nonRecursiveWatcheLines)); - return `\n\n[File Watcher] request stats:\n\n${lines.join('\n')}\n\n`; + return allRecursiveRequests.some(r => r.useNext) ? `\n\n[File Watcher NEXT] request stats:\n\n${lines.join('\n')}\n\n` : `\n\n[File Watcher CLASSIC] request stats:\n\n${lines.join('\n')}\n\n`; } function alignTextColumns(lines: string[]) { @@ -140,6 +141,8 @@ function computeNonRecursiveWatchStatus(nonRecursiveWatcher: NodeJSWatcher): { a return { active, failed, reusing }; } +function sortByPathPrefix(requests: IRecursiveWatchRequest[]): IRecursiveWatchRequest[]; +function sortByPathPrefix(requests: INonRecursiveWatchRequest[]): INonRecursiveWatchRequest[]; function sortByPathPrefix(requests: IUniversalWatchRequest[]): IUniversalWatchRequest[]; function sortByPathPrefix(requests: INodeJSWatcherInstance[]): INodeJSWatcherInstance[]; function sortByPathPrefix(requests: ParcelWatcherInstance[]): ParcelWatcherInstance[]; @@ -182,7 +185,7 @@ function fillRequestStats(lines: string[], request: IUniversalWatchRequest, watc } function requestDetailsToString(request: IUniversalWatchRequest): string { - return `excludes: ${request.excludes.length > 0 ? request.excludes : ''}, includes: ${request.includes && request.includes.length > 0 ? JSON.stringify(request.includes) : ''}, filter: ${requestFilterToString(request.filter)}, correlationId: ${typeof request.correlationId === 'number' ? request.correlationId : ''}`; + return `excludes: ${request.excludes.length > 0 ? request.excludes : ''}, includes: ${request.includes && request.includes.length > 0 ? JSON.stringify(request.includes) : ''}, filter: ${requestFilterToString(request.filter)}, correlationId: ${typeof request.correlationId === 'number' ? request.correlationId : ''}${isRecursiveWatchRequest(request) ? `, useNext: ${request.useNext}` : ''}`; } function fillRecursiveWatcherStats(lines: string[], recursiveWatcher: ParcelWatcher): void { diff --git a/src/vs/platform/files/test/browser/fileService.test.ts b/src/vs/platform/files/test/browser/fileService.test.ts index 166cf549688..0f7e6055026 100644 --- a/src/vs/platform/files/test/browser/fileService.test.ts +++ b/src/vs/platform/files/test/browser/fileService.test.ts @@ -4,19 +4,19 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DeferredPromise, timeout } from 'vs/base/common/async'; -import { bufferToReadable, bufferToStream, VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { isEqual } from 'vs/base/common/resources'; -import { consumeStream, newWriteableStream, ReadableStreamEvents } from 'vs/base/common/stream'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IFileOpenOptions, IFileReadStreamOptions, FileSystemProviderCapabilities, FileType, IFileSystemProviderCapabilitiesChangeEvent, IFileSystemProviderRegistrationEvent, IStat, IFileAtomicReadOptions, IFileAtomicWriteOptions, IFileAtomicDeleteOptions, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileAtomicDeleteCapability, IFileSystemProviderWithFileAtomicWriteCapability, IFileAtomicOptions, IFileChange, isFileSystemWatcher, FileChangesEvent, FileChangeType } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { NullFileSystemProvider } from 'vs/platform/files/test/common/nullFileSystemProvider'; -import { NullLogService } from 'vs/platform/log/common/log'; +import { DeferredPromise, timeout } from '../../../../base/common/async.js'; +import { bufferToReadable, bufferToStream, VSBuffer } from '../../../../base/common/buffer.js'; +import { CancellationToken, CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { isEqual } from '../../../../base/common/resources.js'; +import { consumeStream, newWriteableStream, ReadableStreamEvents } from '../../../../base/common/stream.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IFileOpenOptions, IFileReadStreamOptions, FileSystemProviderCapabilities, FileType, IFileSystemProviderCapabilitiesChangeEvent, IFileSystemProviderRegistrationEvent, IStat, IFileAtomicReadOptions, IFileAtomicWriteOptions, IFileAtomicDeleteOptions, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileAtomicDeleteCapability, IFileSystemProviderWithFileAtomicWriteCapability, IFileAtomicOptions, IFileChange, isFileSystemWatcher, FileChangesEvent, FileChangeType } from '../../common/files.js'; +import { FileService } from '../../common/fileService.js'; +import { NullFileSystemProvider } from '../common/nullFileSystemProvider.js'; +import { NullLogService } from '../../../log/common/log.js'; suite('File Service', () => { diff --git a/src/vs/platform/files/test/browser/indexedDBFileService.integrationTest.ts b/src/vs/platform/files/test/browser/indexedDBFileService.integrationTest.ts index c5f542918ba..fe30a71f5df 100644 --- a/src/vs/platform/files/test/browser/indexedDBFileService.integrationTest.ts +++ b/src/vs/platform/files/test/browser/indexedDBFileService.integrationTest.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { IndexedDB } from 'vs/base/browser/indexedDB'; -import { bufferToReadable, bufferToStream, VSBuffer, VSBufferReadable, VSBufferReadableStream } from 'vs/base/common/buffer'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { basename, joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { flakySuite } from 'vs/base/test/common/testUtils'; -import { IndexedDBFileSystemProvider } from 'vs/platform/files/browser/indexedDBFileSystemProvider'; -import { FileOperation, FileOperationError, FileOperationEvent, FileOperationResult, FileSystemProviderError, FileSystemProviderErrorCode, FileType } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { NullLogService } from 'vs/platform/log/common/log'; +import { IndexedDB } from '../../../../base/browser/indexedDB.js'; +import { bufferToReadable, bufferToStream, VSBuffer, VSBufferReadable, VSBufferReadableStream } from '../../../../base/common/buffer.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { basename, joinPath } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { flakySuite } from '../../../../base/test/common/testUtils.js'; +import { IndexedDBFileSystemProvider } from '../../browser/indexedDBFileSystemProvider.js'; +import { FileOperation, FileOperationError, FileOperationEvent, FileOperationResult, FileSystemProviderError, FileSystemProviderErrorCode, FileType } from '../../common/files.js'; +import { FileService } from '../../common/fileService.js'; +import { NullLogService } from '../../../log/common/log.js'; flakySuite('IndexedDBFileSystemProvider', function () { @@ -189,7 +189,7 @@ flakySuite('IndexedDBFileSystemProvider', function () { assert.strictEqual(value.mtime, undefined); assert.strictEqual(value.ctime, undefined); } else { - assert.ok(!'Unexpected value ' + basename(value.resource)); + assert.fail('Unexpected value ' + basename(value.resource)); } }); }); diff --git a/src/vs/platform/files/test/common/files.test.ts b/src/vs/platform/files/test/common/files.test.ts index 245d2222b9d..b057324b217 100644 --- a/src/vs/platform/files/test/common/files.test.ts +++ b/src/vs/platform/files/test/common/files.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { isEqual, isEqualOrParent } from 'vs/base/common/extpath'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite, toResource } from 'vs/base/test/common/utils'; -import { FileChangesEvent, FileChangeType, IFileChange, isParent } from 'vs/platform/files/common/files'; +import { isEqual, isEqualOrParent } from '../../../../base/common/extpath.js'; +import { isLinux, isMacintosh, isWindows } from '../../../../base/common/platform.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite, toResource } from '../../../../base/test/common/utils.js'; +import { FileChangesEvent, FileChangeType, IFileChange, isParent } from '../../common/files.js'; suite('Files', () => { diff --git a/src/vs/platform/files/test/common/nullFileSystemProvider.ts b/src/vs/platform/files/test/common/nullFileSystemProvider.ts index 59862eaf63f..a0cbe43ae64 100644 --- a/src/vs/platform/files/test/common/nullFileSystemProvider.ts +++ b/src/vs/platform/files/test/common/nullFileSystemProvider.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { ReadableStreamEvents } from 'vs/base/common/stream'; -import { URI } from 'vs/base/common/uri'; -import { IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, FileSystemProviderCapabilities, FileType, IFileWriteOptions, IFileChange, IFileSystemProvider, IStat, IWatchOptions, IFileReadStreamOptions } from 'vs/platform/files/common/files'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../../base/common/lifecycle.js'; +import { ReadableStreamEvents } from '../../../../base/common/stream.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, FileSystemProviderCapabilities, FileType, IFileWriteOptions, IFileChange, IFileSystemProvider, IStat, IWatchOptions, IFileReadStreamOptions } from '../../common/files.js'; export class NullFileSystemProvider implements IFileSystemProvider { diff --git a/src/vs/platform/files/test/common/watcher.test.ts b/src/vs/platform/files/test/common/watcher.test.ts index 6d7bb7f3b83..f526d150463 100644 --- a/src/vs/platform/files/test/common/watcher.test.ts +++ b/src/vs/platform/files/test/common/watcher.test.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { isLinux, isWindows } from 'vs/base/common/platform'; -import { isEqual } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { FileChangeFilter, FileChangesEvent, FileChangeType, IFileChange } from 'vs/platform/files/common/files'; -import { coalesceEvents, reviveFileChanges, parseWatcherPatterns, isFiltered } from 'vs/platform/files/common/watcher'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { isLinux, isWindows } from '../../../../base/common/platform.js'; +import { isEqual } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { FileChangeFilter, FileChangesEvent, FileChangeType, IFileChange } from '../../common/files.js'; +import { coalesceEvents, reviveFileChanges, parseWatcherPatterns, isFiltered } from '../../common/watcher.js'; class TestFileWatcher extends Disposable { private readonly _onDidFilesChange: Emitter<{ raw: IFileChange[]; event: FileChangesEvent }>; diff --git a/src/vs/platform/files/test/node/diskFileService.integrationTest.ts b/src/vs/platform/files/test/node/diskFileService.integrationTest.ts index fc2f28ffa97..84f4a01c3af 100644 --- a/src/vs/platform/files/test/node/diskFileService.integrationTest.ts +++ b/src/vs/platform/files/test/node/diskFileService.integrationTest.ts @@ -4,22 +4,23 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { createReadStream, existsSync, readdirSync, readFileSync, statSync, writeFileSync } from 'fs'; +import { createReadStream, existsSync, readdirSync, readFileSync, statSync, writeFileSync, promises } from 'fs'; import { tmpdir } from 'os'; -import { timeout } from 'vs/base/common/async'; -import { bufferToReadable, bufferToStream, streamToBuffer, streamToBufferReadableStream, VSBuffer, VSBufferReadable, VSBufferReadableStream } from 'vs/base/common/buffer'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { FileAccess, Schemas } from 'vs/base/common/network'; -import { basename, dirname, join, posix } from 'vs/base/common/path'; -import { isLinux, isWindows } from 'vs/base/common/platform'; -import { joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { Promises } from 'vs/base/node/pfs'; -import { flakySuite, getRandomTestPath } from 'vs/base/test/node/testUtils'; -import { etag, IFileAtomicReadOptions, FileOperation, FileOperationError, FileOperationEvent, FileOperationResult, FilePermission, FileSystemProviderCapabilities, hasFileAtomicReadCapability, hasOpenReadWriteCloseCapability, IFileStat, IFileStatWithMetadata, IReadFileOptions, IStat, NotModifiedSinceFileOperationError, TooLargeFileOperationError, IFileAtomicOptions } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { NullLogService } from 'vs/platform/log/common/log'; +import { timeout } from '../../../../base/common/async.js'; +import { bufferToReadable, bufferToStream, streamToBuffer, streamToBufferReadableStream, VSBuffer, VSBufferReadable, VSBufferReadableStream } from '../../../../base/common/buffer.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { FileAccess, Schemas } from '../../../../base/common/network.js'; +import { basename, dirname, join, posix } from '../../../../base/common/path.js'; +import { isLinux, isWindows } from '../../../../base/common/platform.js'; +import { joinPath } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { Promises } from '../../../../base/node/pfs.js'; +import { flakySuite, getRandomTestPath } from '../../../../base/test/node/testUtils.js'; +import { etag, IFileAtomicReadOptions, FileOperation, FileOperationError, FileOperationEvent, FileOperationResult, FilePermission, FileSystemProviderCapabilities, hasFileAtomicReadCapability, hasOpenReadWriteCloseCapability, IFileStat, IFileStatWithMetadata, IReadFileOptions, IStat, NotModifiedSinceFileOperationError, TooLargeFileOperationError, IFileAtomicOptions } from '../../common/files.js'; +import { FileService } from '../../common/fileService.js'; +import { DiskFileSystemProvider } from '../../node/diskFileSystemProvider.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { isESM } from '../../../../base/common/amd.js'; function getByName(root: IFileStat, name: string): IFileStat | undefined { if (root.children === undefined) { @@ -131,7 +132,7 @@ export class TestDiskFileSystemProvider extends DiskFileSystemProvider { DiskFileSystemProvider.configureFlushOnWrite(false); // speed up all unit tests by disabling flush on write -flakySuite('Disk File Service', function () { +(!isESM ? suite.skip : flakySuite /* somehow fails in AMD with ENOENT for fixtures dir */)('Disk File Service', function () { const testSchema = 'test'; @@ -273,7 +274,7 @@ flakySuite('Disk File Service', function () { assert.strictEqual(value.mtime, undefined); assert.strictEqual(value.ctime, undefined); } else { - assert.ok(!'Unexpected value ' + basename(value.resource.fsPath)); + assert.fail('Unexpected value ' + basename(value.resource.fsPath)); } }); }); @@ -317,7 +318,7 @@ flakySuite('Disk File Service', function () { assert.ok(value.mtime > 0); assert.ok(value.ctime > 0); } else { - assert.ok(!'Unexpected value ' + basename(value.resource.fsPath)); + assert.fail('Unexpected value ' + basename(value.resource.fsPath)); } }); }); @@ -429,7 +430,7 @@ flakySuite('Disk File Service', function () { test('resolve - folder symbolic link', async () => { const link = URI.file(join(testDir, 'deep-link')); - await Promises.symlink(join(testDir, 'deep'), link.fsPath, 'junction'); + await promises.symlink(join(testDir, 'deep'), link.fsPath, 'junction'); const resolved = await service.resolve(link); assert.strictEqual(resolved.children!.length, 4); @@ -439,7 +440,7 @@ flakySuite('Disk File Service', function () { (isWindows ? test.skip /* windows: cannot create file symbolic link without elevated context */ : test)('resolve - file symbolic link', async () => { const link = URI.file(join(testDir, 'lorem.txt-linked')); - await Promises.symlink(join(testDir, 'lorem.txt'), link.fsPath); + await promises.symlink(join(testDir, 'lorem.txt'), link.fsPath); const resolved = await service.resolve(link); assert.strictEqual(resolved.isDirectory, false); @@ -447,7 +448,7 @@ flakySuite('Disk File Service', function () { }); test('resolve - symbolic link pointing to nonexistent file does not break', async () => { - await Promises.symlink(join(testDir, 'foo'), join(testDir, 'bar'), 'junction'); + await promises.symlink(join(testDir, 'foo'), join(testDir, 'bar'), 'junction'); const resolved = await service.resolve(URI.file(testDir)); assert.strictEqual(resolved.isDirectory, true); @@ -530,7 +531,7 @@ flakySuite('Disk File Service', function () { (isWindows ? test.skip /* windows: cannot create file symbolic link without elevated context */ : test)('deleteFile - symbolic link (exists)', async () => { const target = URI.file(join(testDir, 'lorem.txt')); const link = URI.file(join(testDir, 'lorem.txt-linked')); - await Promises.symlink(target.fsPath, link.fsPath); + await promises.symlink(target.fsPath, link.fsPath); const source = await service.resolve(link); @@ -552,7 +553,7 @@ flakySuite('Disk File Service', function () { (isWindows ? test.skip /* windows: cannot create file symbolic link without elevated context */ : test)('deleteFile - symbolic link (pointing to nonexistent file)', async () => { const target = URI.file(join(testDir, 'foo')); const link = URI.file(join(testDir, 'bar')); - await Promises.symlink(target.fsPath, link.fsPath); + await promises.symlink(target.fsPath, link.fsPath); let event: FileOperationEvent; disposables.add(service.onDidRunOperation(e => event = e)); @@ -1692,7 +1693,7 @@ flakySuite('Disk File Service', function () { (isWindows ? test.skip /* windows: cannot create file symbolic link without elevated context */ : test)('readFile - dangling symbolic link - https://github.com/microsoft/vscode/issues/116049', async () => { const link = URI.file(join(testDir, 'small.js-link')); - await Promises.symlink(join(testDir, 'small.js'), link.fsPath); + await promises.symlink(join(testDir, 'small.js'), link.fsPath); let error: FileOperationError | undefined = undefined; try { @@ -1833,7 +1834,7 @@ flakySuite('Disk File Service', function () { (isWindows ? test.skip /* windows: cannot create file symbolic link without elevated context */ : test)('writeFile - atomic writing does not break symlinks', async () => { const link = URI.file(join(testDir, 'lorem.txt-linked')); - await Promises.symlink(join(testDir, 'lorem.txt'), link.fsPath); + await promises.symlink(join(testDir, 'lorem.txt'), link.fsPath); const content = 'Updates to the lorem file'; await service.writeFile(link, VSBuffer.fromString(content), { atomic: { postfix: '.vsctmp' } }); @@ -2006,7 +2007,7 @@ flakySuite('Disk File Service', function () { // Here since `close` is not called, all other writes are // waiting on the barrier to release, so doing a readFile // should give us a consistent view of the file contents - assert.strictEqual((await Promises.readFile(resource.fsPath)).toString(), content); + assert.strictEqual((await promises.readFile(resource.fsPath)).toString(), content); } finally { await provider.close(fd); } @@ -2030,10 +2031,10 @@ flakySuite('Disk File Service', function () { try { await provider.write(fd1, 0, VSBuffer.fromString(newContent).buffer, 0, VSBuffer.fromString(newContent).buffer.byteLength); - assert.strictEqual((await Promises.readFile(resource1.fsPath)).toString(), newContent); + assert.strictEqual((await promises.readFile(resource1.fsPath)).toString(), newContent); await provider.write(fd2, 0, VSBuffer.fromString(newContent).buffer, 0, VSBuffer.fromString(newContent).buffer.byteLength); - assert.strictEqual((await Promises.readFile(resource2.fsPath)).toString(), newContent); + assert.strictEqual((await promises.readFile(resource2.fsPath)).toString(), newContent); } finally { await Promise.allSettled([ await provider.close(fd1), @@ -2059,7 +2060,7 @@ flakySuite('Disk File Service', function () { assert.ok(error); // expected because `new-folder` does not exist - await Promises.mkdir(newFolder); + await promises.mkdir(newFolder); const content = readFileSync(URI.file(join(testDir, 'lorem.txt')).fsPath); const newContent = content.toString() + content.toString(); @@ -2069,7 +2070,7 @@ flakySuite('Disk File Service', function () { try { await provider.write(fd, 0, newContentBuffer, 0, newContentBuffer.byteLength); - assert.strictEqual((await Promises.readFile(newResource.fsPath)).toString(), newContent); + assert.strictEqual((await promises.readFile(newResource.fsPath)).toString(), newContent); } finally { await provider.close(fd); } @@ -2291,8 +2292,8 @@ flakySuite('Disk File Service', function () { const content = await service.writeFile(lockedFile, VSBuffer.fromString('Locked File')); assert.strictEqual(content.locked, false); - const stats = await Promises.stat(lockedFile.fsPath); - await Promises.chmod(lockedFile.fsPath, stats.mode & ~0o200); + const stats = await promises.stat(lockedFile.fsPath); + await promises.chmod(lockedFile.fsPath, stats.mode & ~0o200); let stat = await service.stat(lockedFile); assert.strictEqual(stat.locked, true); diff --git a/src/vs/platform/files/test/node/nodejsWatcher.integrationTest.ts b/src/vs/platform/files/test/node/nodejsWatcher.test.ts similarity index 88% rename from src/vs/platform/files/test/node/nodejsWatcher.integrationTest.ts rename to src/vs/platform/files/test/node/nodejsWatcher.test.ts index 77b3946042d..4b42b0b0900 100644 --- a/src/vs/platform/files/test/node/nodejsWatcher.integrationTest.ts +++ b/src/vs/platform/files/test/node/nodejsWatcher.test.ts @@ -3,33 +3,38 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'fs'; import assert from 'assert'; import { tmpdir } from 'os'; -import { basename, dirname, join } from 'vs/base/common/path'; -import { Promises, RimRafMode } from 'vs/base/node/pfs'; -import { flakySuite, getRandomTestPath } from 'vs/base/test/node/testUtils'; -import { FileChangeFilter, FileChangeType } from 'vs/platform/files/common/files'; -import { INonRecursiveWatchRequest, IRecursiveWatcherWithSubscribe } from 'vs/platform/files/common/watcher'; -import { watchFileContents } from 'vs/platform/files/node/watcher/nodejs/nodejsWatcherLib'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { getDriveLetter } from 'vs/base/common/extpath'; -import { ltrim } from 'vs/base/common/strings'; -import { DeferredPromise, timeout } from 'vs/base/common/async'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { NodeJSWatcher } from 'vs/platform/files/node/watcher/nodejs/nodejsWatcher'; -import { FileAccess } from 'vs/base/common/network'; -import { extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { addUNCHostToAllowlist } from 'vs/base/node/unc'; -import { Emitter, Event } from 'vs/base/common/event'; -import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.integrationTest'; +import { basename, dirname, join } from '../../../../base/common/path.js'; +import { Promises, RimRafMode } from '../../../../base/node/pfs.js'; +import { getRandomTestPath } from '../../../../base/test/node/testUtils.js'; +import { FileChangeFilter, FileChangeType } from '../../common/files.js'; +import { INonRecursiveWatchRequest, IRecursiveWatcherWithSubscribe } from '../../common/watcher.js'; +import { watchFileContents } from '../../node/watcher/nodejs/nodejsWatcherLib.js'; +import { isLinux, isMacintosh, isWindows } from '../../../../base/common/platform.js'; +import { getDriveLetter } from '../../../../base/common/extpath.js'; +import { ltrim } from '../../../../base/common/strings.js'; +import { DeferredPromise, timeout } from '../../../../base/common/async.js'; +import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { NodeJSWatcher } from '../../node/watcher/nodejs/nodejsWatcher.js'; +import { FileAccess } from '../../../../base/common/network.js'; +import { extUriBiasedIgnorePathCase } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { addUNCHostToAllowlist } from '../../../../base/node/unc.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { TestParcelWatcher } from './parcelWatcher.test.js'; // this suite has shown flaky runs in Azure pipelines where // tasks would just hang and timeout after a while (not in // mocha but generally). as such they will run only on demand // whenever we update the watcher library. -((process.env['BUILD_SOURCEVERSION'] || process.env['CI']) ? suite.skip : flakySuite)('File Watcher (node.js)', () => { +/* eslint-disable local/code-ensure-no-disposables-leak-in-test */ + +suite.skip('File Watcher (node.js)', function () { + + this.timeout(10000); class TestNodeJSWatcher extends NodeJSWatcher { @@ -64,7 +69,7 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int watcher?.setVerboseLogging(enable); } - enableLogging(false); + enableLogging(loggingEnabled); setup(async () => { await createWatcher(undefined); @@ -158,7 +163,7 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int // New folder const newFolderPath = join(testDir, 'New Folder'); changeFuture = awaitEvent(watcher, newFolderPath, FileChangeType.ADDED); - await Promises.mkdir(newFolderPath); + await fs.promises.mkdir(newFolderPath); await changeFuture; // Rename file @@ -220,7 +225,7 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int // Copy file const copiedFilepath = join(testDir, 'copiedFile.txt'); changeFuture = awaitEvent(watcher, copiedFilepath, FileChangeType.ADDED); - await Promises.copyFile(movedFilepath, copiedFilepath); + await fs.promises.copyFile(movedFilepath, copiedFilepath); await changeFuture; // Copy folder @@ -242,12 +247,12 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int // Delete file changeFuture = awaitEvent(watcher, copiedFilepath, FileChangeType.DELETED); - await Promises.unlink(copiedFilepath); + await fs.promises.unlink(copiedFilepath); await changeFuture; // Delete folder changeFuture = awaitEvent(watcher, copiedFolderpath, FileChangeType.DELETED); - await Promises.rmdir(copiedFolderpath); + await fs.promises.rmdir(copiedFolderpath); await changeFuture; watcher.dispose(); @@ -270,7 +275,7 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int // Delete file changeFuture = awaitEvent(watcher, filePath, FileChangeType.DELETED); - await Promises.unlink(filePath); + await fs.promises.unlink(filePath); await changeFuture; // Recreate watcher @@ -290,7 +295,7 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int // Delete + Recreate file const newFilePath = join(testDir, 'lorem.txt'); const changeFuture: Promise = awaitEvent(watcher, newFilePath, FileChangeType.UPDATED); - await Promises.unlink(newFilePath); + await fs.promises.unlink(newFilePath); Promises.writeFile(newFilePath, 'Hello Atomic World'); await changeFuture; }); @@ -302,7 +307,7 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int // Delete + Recreate file const newFilePath = join(filePath); const changeFuture: Promise = awaitEvent(watcher, newFilePath, FileChangeType.UPDATED); - await Promises.unlink(newFilePath); + await fs.promises.unlink(newFilePath); Promises.writeFile(newFilePath, 'Hello Atomic World'); await changeFuture; }); @@ -363,9 +368,9 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int const deleteFuture3: Promise = awaitEvent(watcher, newFilePath3, FileChangeType.DELETED); await Promise.all([ - await Promises.unlink(newFilePath1), - await Promises.unlink(newFilePath2), - await Promises.unlink(newFilePath3) + await fs.promises.unlink(newFilePath1), + await fs.promises.unlink(newFilePath2), + await fs.promises.unlink(newFilePath3) ]); await Promise.all([deleteFuture1, deleteFuture2, deleteFuture3]); @@ -444,7 +449,7 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int (isWindows /* windows: cannot create file symbolic link without elevated context */ ? test.skip : test)('symlink support (folder watch)', async function () { const link = join(testDir, 'deep-linked'); const linkTarget = join(testDir, 'deep'); - await Promises.symlink(linkTarget, link); + await fs.promises.symlink(linkTarget, link); await watcher.watch([{ path: link, excludes: [], recursive: false }]); @@ -471,14 +476,14 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int // Delete file changeFuture = awaitEvent(watcher, filePath, FileChangeType.DELETED, correlationId, expectedCount); - await Promises.unlink(await Promises.realpath(filePath)); // support symlinks + await fs.promises.unlink(await Promises.realpath(filePath)); // support symlinks await changeFuture; } (isWindows /* windows: cannot create file symbolic link without elevated context */ ? test.skip : test)('symlink support (file watch)', async function () { const link = join(testDir, 'lorem.txt-linked'); const linkTarget = join(testDir, 'lorem.txt'); - await Promises.symlink(linkTarget, link); + await fs.promises.symlink(linkTarget, link); await watcher.watch([{ path: link, excludes: [], recursive: false }]); @@ -583,7 +588,7 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int const onDidWatchFail = Event.toPromise(watcher.onWatchFail); const changeFuture = awaitEvent(watcher, filePath, FileChangeType.DELETED, 1); - Promises.unlink(filePath); + fs.promises.unlink(filePath); await onDidWatchFail; await changeFuture; assert.strictEqual(instance.failed, true); @@ -601,89 +606,89 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int await changeFuture; }); - test('correlated watch requests support suspend/resume (file, does not exist in beginning)', async function () { + test('watch requests support suspend/resume (file, does not exist in beginning)', async function () { const filePath = join(testDir, 'not-found.txt'); const onDidWatchFail = Event.toPromise(watcher.onWatchFail); - const request = { path: filePath, excludes: [], recursive: false, correlationId: 1 }; + const request = { path: filePath, excludes: [], recursive: false }; await watcher.watch([request]); await onDidWatchFail; assert.strictEqual(watcher.isSuspended(request), 'polling'); - await basicCrudTest(filePath, undefined, 1, undefined, true); - await basicCrudTest(filePath, undefined, 1, undefined, true); + await basicCrudTest(filePath, undefined, null, undefined, true); + await basicCrudTest(filePath, undefined, null, undefined, true); }); - test('correlated watch requests support suspend/resume (file, exists in beginning)', async function () { + test('watch requests support suspend/resume (file, exists in beginning)', async function () { const filePath = join(testDir, 'lorem.txt'); - const request = { path: filePath, excludes: [], recursive: false, correlationId: 1 }; + const request = { path: filePath, excludes: [], recursive: false }; await watcher.watch([request]); const onDidWatchFail = Event.toPromise(watcher.onWatchFail); - await basicCrudTest(filePath, true, 1); + await basicCrudTest(filePath, true); await onDidWatchFail; assert.strictEqual(watcher.isSuspended(request), 'polling'); - await basicCrudTest(filePath, undefined, 1, undefined, true); + await basicCrudTest(filePath, undefined, null, undefined, true); }); - test('correlated watch requests support suspend/resume (folder, does not exist in beginning)', async function () { + test('watch requests support suspend/resume (folder, does not exist in beginning)', async function () { let onDidWatchFail = Event.toPromise(watcher.onWatchFail); const folderPath = join(testDir, 'not-found'); - const request = { path: folderPath, excludes: [], recursive: false, correlationId: 1 }; + const request = { path: folderPath, excludes: [], recursive: false }; await watcher.watch([request]); await onDidWatchFail; assert.strictEqual(watcher.isSuspended(request), 'polling'); - let changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED, 1); + let changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED); let onDidWatch = Event.toPromise(watcher.onDidWatch); - await Promises.mkdir(folderPath); + await fs.promises.mkdir(folderPath); await changeFuture; await onDidWatch; assert.strictEqual(watcher.isSuspended(request), false); - const filePath = join(folderPath, 'newFile.txt'); - await basicCrudTest(filePath, undefined, 1); + if (isWindows) { // somehow failing on macOS/Linux + const filePath = join(folderPath, 'newFile.txt'); + await basicCrudTest(filePath); - if (!isMacintosh) { // macOS does not report DELETE events for folders onDidWatchFail = Event.toPromise(watcher.onWatchFail); - await Promises.rmdir(folderPath); + await fs.promises.rmdir(folderPath); await onDidWatchFail; - changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED, 1); + changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED); onDidWatch = Event.toPromise(watcher.onDidWatch); - await Promises.mkdir(folderPath); + await fs.promises.mkdir(folderPath); await changeFuture; await onDidWatch; await timeout(500); // somehow needed on Linux - await basicCrudTest(filePath, undefined, 1); + await basicCrudTest(filePath); } }); - (isMacintosh /* macOS: does not seem to report this */ ? test.skip : test)('correlated watch requests support suspend/resume (folder, exists in beginning)', async function () { + (isMacintosh /* macOS: does not seem to report this */ ? test.skip : test)('watch requests support suspend/resume (folder, exists in beginning)', async function () { const folderPath = join(testDir, 'deep'); - await watcher.watch([{ path: folderPath, excludes: [], recursive: false, correlationId: 1 }]); + await watcher.watch([{ path: folderPath, excludes: [], recursive: false }]); const filePath = join(folderPath, 'newFile.txt'); - await basicCrudTest(filePath, undefined, 1); + await basicCrudTest(filePath); const onDidWatchFail = Event.toPromise(watcher.onWatchFail); await Promises.rm(folderPath); await onDidWatchFail; - const changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED, 1); + const changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED); const onDidWatch = Event.toPromise(watcher.onDidWatch); - await Promises.mkdir(folderPath); + await fs.promises.mkdir(folderPath); await changeFuture; await onDidWatch; await timeout(500); // somehow needed on Linux - await basicCrudTest(filePath, undefined, 1); + await basicCrudTest(filePath); }); test('parcel watcher reused when present for non-recursive file watching (uncorrelated)', function () { @@ -744,7 +749,7 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int assert.strictEqual(instance.isReusingRecursiveWatcher, false); } - test('correlated watch requests support suspend/resume (file, does not exist in beginning, parcel watcher reused)', async function () { + test('watch requests support suspend/resume (file, does not exist in beginning, parcel watcher reused)', async function () { const recursiveWatcher = createParcelWatcher(); await recursiveWatcher.watch([{ path: testDir, excludes: [], recursive: true }]); @@ -753,12 +758,12 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int const filePath = join(testDir, 'not-found-2.txt'); const onDidWatchFail = Event.toPromise(watcher.onWatchFail); - const request = { path: filePath, excludes: [], recursive: false, correlationId: 1 }; + const request = { path: filePath, excludes: [], recursive: false }; await watcher.watch([request]); await onDidWatchFail; assert.strictEqual(watcher.isSuspended(request), true); - const changeFuture = awaitEvent(watcher, filePath, FileChangeType.ADDED, 1); + const changeFuture = awaitEvent(watcher, filePath, FileChangeType.ADDED); await Promises.writeFile(filePath, 'Hello World'); await changeFuture; @@ -777,7 +782,7 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int // Delete file changeFuture = awaitEvent(watcher, filePath, FileChangeType.DELETED, 1); - await Promises.unlink(filePath); + await fs.promises.unlink(filePath); await changeFuture; }); @@ -793,7 +798,7 @@ import { TestParcelWatcher } from 'vs/platform/files/test/node/parcelWatcher.int // Delete file changeFuture = awaitEvent(watcher, filePath, FileChangeType.DELETED, 1); - await Promises.unlink(filePath); + await fs.promises.unlink(filePath); await changeFuture; }); }); diff --git a/src/vs/platform/files/test/node/parcelWatcher.integrationTest.ts b/src/vs/platform/files/test/node/parcelWatcher.test.ts similarity index 90% rename from src/vs/platform/files/test/node/parcelWatcher.integrationTest.ts rename to src/vs/platform/files/test/node/parcelWatcher.test.ts index 341edbff2a1..c25c061fbed 100644 --- a/src/vs/platform/files/test/node/parcelWatcher.integrationTest.ts +++ b/src/vs/platform/files/test/node/parcelWatcher.test.ts @@ -4,24 +4,24 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { realpathSync } from 'fs'; +import { realpathSync, promises } from 'fs'; import { tmpdir } from 'os'; -import { timeout } from 'vs/base/common/async'; -import { dirname, join } from 'vs/base/common/path'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { Promises, RimRafMode } from 'vs/base/node/pfs'; -import { flakySuite, getRandomTestPath } from 'vs/base/test/node/testUtils'; -import { FileChangeFilter, FileChangeType, IFileChange } from 'vs/platform/files/common/files'; -import { ParcelWatcher } from 'vs/platform/files/node/watcher/parcel/parcelWatcher'; -import { IRecursiveWatchRequest } from 'vs/platform/files/common/watcher'; -import { getDriveLetter } from 'vs/base/common/extpath'; -import { ltrim } from 'vs/base/common/strings'; -import { FileAccess } from 'vs/base/common/network'; -import { extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { addUNCHostToAllowlist } from 'vs/base/node/unc'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; +import { timeout } from '../../../../base/common/async.js'; +import { dirname, join } from '../../../../base/common/path.js'; +import { isLinux, isMacintosh, isWindows } from '../../../../base/common/platform.js'; +import { Promises, RimRafMode } from '../../../../base/node/pfs.js'; +import { getRandomTestPath } from '../../../../base/test/node/testUtils.js'; +import { FileChangeFilter, FileChangeType, IFileChange } from '../../common/files.js'; +import { ParcelWatcher } from '../../node/watcher/parcel/parcelWatcher.js'; +import { IRecursiveWatchRequest } from '../../common/watcher.js'; +import { getDriveLetter } from '../../../../base/common/extpath.js'; +import { ltrim } from '../../../../base/common/strings.js'; +import { FileAccess } from '../../../../base/common/network.js'; +import { extUriBiasedIgnorePathCase } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { addUNCHostToAllowlist } from '../../../../base/node/unc.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; export class TestParcelWatcher extends ParcelWatcher { @@ -65,7 +65,11 @@ export class TestParcelWatcher extends ParcelWatcher { // mocha but generally). as such they will run only on demand // whenever we update the watcher library. -((process.env['BUILD_SOURCEVERSION'] || process.env['CI']) ? suite.skip : flakySuite)('File Watcher (parcel)', () => { +/* eslint-disable local/code-ensure-no-disposables-leak-in-test */ + +suite.skip('File Watcher (parcel)', function () { + + this.timeout(10000); let testDir: string; let watcher: TestParcelWatcher; @@ -77,7 +81,7 @@ export class TestParcelWatcher extends ParcelWatcher { watcher?.setVerboseLogging(enable); } - enableLogging(false); + enableLogging(loggingEnabled); setup(async () => { watcher = new TestParcelWatcher(); @@ -220,7 +224,7 @@ export class TestParcelWatcher extends ParcelWatcher { assert.strictEqual(instance.include(newFolderPath), true); assert.strictEqual(instance.exclude(newFolderPath), false); changeFuture = awaitEvent(watcher, newFolderPath, FileChangeType.ADDED); - await Promises.mkdir(newFolderPath); + await promises.mkdir(newFolderPath); await changeFuture; assert.strictEqual(subscriptions1.get(newFolderPath), FileChangeType.ADDED); assert.strictEqual(subscriptions2.has(newFolderPath), false /* subscription was disposed before the event */); @@ -290,7 +294,7 @@ export class TestParcelWatcher extends ParcelWatcher { // Copy file const copiedFilepath = join(testDir, 'deep', 'copiedFile.txt'); changeFuture = awaitEvent(watcher, copiedFilepath, FileChangeType.ADDED); - await Promises.copyFile(movedFilepath, copiedFilepath); + await promises.copyFile(movedFilepath, copiedFilepath); await changeFuture; // Copy folder @@ -312,30 +316,30 @@ export class TestParcelWatcher extends ParcelWatcher { // Read file does not emit event changeFuture = awaitEvent(watcher, anotherNewFilePath, FileChangeType.UPDATED, 'unexpected-event-from-read-file'); - await Promises.readFile(anotherNewFilePath); + await promises.readFile(anotherNewFilePath); await Promise.race([timeout(100), changeFuture]); // Stat file does not emit event changeFuture = awaitEvent(watcher, anotherNewFilePath, FileChangeType.UPDATED, 'unexpected-event-from-stat'); - await Promises.stat(anotherNewFilePath); + await promises.stat(anotherNewFilePath); await Promise.race([timeout(100), changeFuture]); // Stat folder does not emit event changeFuture = awaitEvent(watcher, copiedFolderpath, FileChangeType.UPDATED, 'unexpected-event-from-stat'); - await Promises.stat(copiedFolderpath); + await promises.stat(copiedFolderpath); await Promise.race([timeout(100), changeFuture]); // Delete file changeFuture = awaitEvent(watcher, copiedFilepath, FileChangeType.DELETED); disposables.add(instance.subscribe(copiedFilepath, change => subscriptions1.set(change.resource.fsPath, change.type))); - await Promises.unlink(copiedFilepath); + await promises.unlink(copiedFilepath); await changeFuture; assert.strictEqual(subscriptions1.get(copiedFilepath), FileChangeType.DELETED); // Delete folder changeFuture = awaitEvent(watcher, copiedFolderpath, FileChangeType.DELETED); disposables.add(instance.subscribe(copiedFolderpath, change => subscriptions1.set(change.resource.fsPath, change.type))); - await Promises.rmdir(copiedFolderpath); + await promises.rmdir(copiedFolderpath); await changeFuture; assert.strictEqual(subscriptions1.get(copiedFolderpath), FileChangeType.DELETED); @@ -348,7 +352,7 @@ export class TestParcelWatcher extends ParcelWatcher { // Delete + Recreate file const newFilePath = join(testDir, 'deep', 'conway.js'); const changeFuture = awaitEvent(watcher, newFilePath, FileChangeType.UPDATED); - await Promises.unlink(newFilePath); + await promises.unlink(newFilePath); Promises.writeFile(newFilePath, 'Hello Atomic World'); await changeFuture; }); @@ -373,13 +377,13 @@ export class TestParcelWatcher extends ParcelWatcher { // Delete file changeFuture = awaitEvent(watcher, filePath, FileChangeType.DELETED, undefined, correlationId, expectedCount); - await Promises.unlink(filePath); + await promises.unlink(filePath); await changeFuture; } test('multiple events', async function () { await watcher.watch([{ path: testDir, excludes: [], recursive: true }]); - await Promises.mkdir(join(testDir, 'deep-multiple')); + await promises.mkdir(join(testDir, 'deep-multiple')); // multiple add @@ -449,12 +453,12 @@ export class TestParcelWatcher extends ParcelWatcher { const deleteFuture6 = awaitEvent(watcher, newFilePath6, FileChangeType.DELETED); await Promise.all([ - await Promises.unlink(newFilePath1), - await Promises.unlink(newFilePath2), - await Promises.unlink(newFilePath3), - await Promises.unlink(newFilePath4), - await Promises.unlink(newFilePath5), - await Promises.unlink(newFilePath6) + await promises.unlink(newFilePath1), + await promises.unlink(newFilePath2), + await promises.unlink(newFilePath3), + await promises.unlink(newFilePath4), + await promises.unlink(newFilePath5), + await promises.unlink(newFilePath6) ]); await Promise.all([deleteFuture1, deleteFuture2, deleteFuture3, deleteFuture4, deleteFuture5, deleteFuture6]); @@ -563,7 +567,7 @@ export class TestParcelWatcher extends ParcelWatcher { (isWindows /* windows: cannot create file symbolic link without elevated context */ ? test.skip : test)('symlink support (root)', async function () { const link = join(testDir, 'deep-linked'); const linkTarget = join(testDir, 'deep'); - await Promises.symlink(linkTarget, link); + await promises.symlink(linkTarget, link); await watcher.watch([{ path: link, excludes: [], recursive: true }]); @@ -573,7 +577,7 @@ export class TestParcelWatcher extends ParcelWatcher { (isWindows /* windows: cannot create file symbolic link without elevated context */ ? test.skip : test)('symlink support (via extra watch)', async function () { const link = join(testDir, 'deep-linked'); const linkTarget = join(testDir, 'deep'); - await Promises.symlink(linkTarget, link); + await promises.symlink(linkTarget, link); await watcher.watch([{ path: testDir, excludes: [], recursive: true }, { path: link, excludes: [], recursive: true }]); @@ -617,7 +621,7 @@ export class TestParcelWatcher extends ParcelWatcher { // Restore watched path await timeout(1500); // node.js watcher used for monitoring folder restore is async - await Promises.mkdir(watchedPath); + await promises.mkdir(watchedPath); await timeout(1500); // restart is delayed await watcher.whenReady(); @@ -743,15 +747,15 @@ export class TestParcelWatcher extends ParcelWatcher { assert.strictEqual(instance.failed, true); }); - test('correlated watch requests support suspend/resume (folder, does not exist in beginning, not reusing watcher)', async () => { - await testCorrelatedWatchFolderDoesNotExist(false); + test('watch requests support suspend/resume (folder, does not exist in beginning, not reusing watcher)', async () => { + await testWatchFolderDoesNotExist(false); }); - (!isMacintosh /* Linux/Windows: times out for some reason */ ? test.skip : test)('correlated watch requests support suspend/resume (folder, does not exist in beginning, reusing watcher)', async () => { - await testCorrelatedWatchFolderDoesNotExist(true); + (!isMacintosh /* Linux/Windows: times out for some reason */ ? test.skip : test)('watch requests support suspend/resume (folder, does not exist in beginning, reusing watcher)', async () => { + await testWatchFolderDoesNotExist(true); }); - async function testCorrelatedWatchFolderDoesNotExist(reuseExistingWatcher: boolean) { + async function testWatchFolderDoesNotExist(reuseExistingWatcher: boolean) { let onDidWatchFail = Event.toPromise(watcher.onWatchFail); const folderPath = join(testDir, 'not-found'); @@ -762,7 +766,7 @@ export class TestParcelWatcher extends ParcelWatcher { await watcher.watch(requests); } - const request: IRecursiveWatchRequest = { path: folderPath, excludes: [], recursive: true, correlationId: 1 }; + const request: IRecursiveWatchRequest = { path: folderPath, excludes: [], recursive: true }; requests.push(request); await watcher.watch(requests); @@ -774,42 +778,42 @@ export class TestParcelWatcher extends ParcelWatcher { assert.strictEqual(watcher.isSuspended(request), 'polling'); } - let changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED, undefined, 1); + let changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED); let onDidWatch = Event.toPromise(watcher.onDidWatch); - await Promises.mkdir(folderPath); + await promises.mkdir(folderPath); await changeFuture; await onDidWatch; assert.strictEqual(watcher.isSuspended(request), false); const filePath = join(folderPath, 'newFile.txt'); - await basicCrudTest(filePath, 1); + await basicCrudTest(filePath); onDidWatchFail = Event.toPromise(watcher.onWatchFail); await Promises.rm(folderPath); await onDidWatchFail; - changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED, undefined, 1); + changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED); onDidWatch = Event.toPromise(watcher.onDidWatch); - await Promises.mkdir(folderPath); + await promises.mkdir(folderPath); await changeFuture; await onDidWatch; - await basicCrudTest(filePath, 1); + await basicCrudTest(filePath); } - test('correlated watch requests support suspend/resume (folder, exist in beginning, not reusing watcher)', async () => { - await testCorrelatedWatchFolderExists(false); + test('watch requests support suspend/resume (folder, exist in beginning, not reusing watcher)', async () => { + await testWatchFolderExists(false); }); - (!isMacintosh /* Linux/Windows: times out for some reason */ ? test.skip : test)('correlated watch requests support suspend/resume (folder, exist in beginning, reusing watcher)', async () => { - await testCorrelatedWatchFolderExists(true); + (!isMacintosh /* Linux/Windows: times out for some reason */ ? test.skip : test)('watch requests support suspend/resume (folder, exist in beginning, reusing watcher)', async () => { + await testWatchFolderExists(true); }); - async function testCorrelatedWatchFolderExists(reuseExistingWatcher: boolean) { + async function testWatchFolderExists(reuseExistingWatcher: boolean) { const folderPath = join(testDir, 'deep'); - const requests: IRecursiveWatchRequest[] = [{ path: folderPath, excludes: [], recursive: true, correlationId: 1 }]; + const requests: IRecursiveWatchRequest[] = [{ path: folderPath, excludes: [], recursive: true }]; if (reuseExistingWatcher) { requests.push({ path: testDir, excludes: [], recursive: true }); } @@ -817,19 +821,19 @@ export class TestParcelWatcher extends ParcelWatcher { await watcher.watch(requests); const filePath = join(folderPath, 'newFile.txt'); - await basicCrudTest(filePath, 1); + await basicCrudTest(filePath); const onDidWatchFail = Event.toPromise(watcher.onWatchFail); await Promises.rm(folderPath); await onDidWatchFail; - const changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED, undefined, 1); + const changeFuture = awaitEvent(watcher, folderPath, FileChangeType.ADDED); const onDidWatch = Event.toPromise(watcher.onDidWatch); - await Promises.mkdir(folderPath); + await promises.mkdir(folderPath); await changeFuture; await onDidWatch; - await basicCrudTest(filePath, 1); + await basicCrudTest(filePath); } test('watch request reuses another recursive watcher even when requests are coming in at the same time', async function () { @@ -864,7 +868,7 @@ export class TestParcelWatcher extends ParcelWatcher { // Delete file changeFuture = awaitEvent(watcher, filePath, FileChangeType.DELETED, undefined, 1); - await Promises.unlink(filePath); + await promises.unlink(filePath); await changeFuture; }); }); diff --git a/src/vs/platform/history/browser/contextScopedHistoryWidget.ts b/src/vs/platform/history/browser/contextScopedHistoryWidget.ts index a1ba7444f2e..4c401062680 100644 --- a/src/vs/platform/history/browser/contextScopedHistoryWidget.ts +++ b/src/vs/platform/history/browser/contextScopedHistoryWidget.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IHistoryNavigationWidget } from 'vs/base/browser/history'; -import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview'; -import { FindInput, IFindInputOptions } from 'vs/base/browser/ui/findinput/findInput'; -import { IReplaceInputOptions, ReplaceInput } from 'vs/base/browser/ui/findinput/replaceInput'; -import { HistoryInputBox, IHistoryInputOptions } from 'vs/base/browser/ui/inputbox/inputBox'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { localize } from 'vs/nls'; -import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { isActiveElement } from 'vs/base/browser/dom'; +import { IHistoryNavigationWidget } from '../../../base/browser/history.js'; +import { IContextViewProvider } from '../../../base/browser/ui/contextview/contextview.js'; +import { FindInput, IFindInputOptions } from '../../../base/browser/ui/findinput/findInput.js'; +import { IReplaceInputOptions, ReplaceInput } from '../../../base/browser/ui/findinput/replaceInput.js'; +import { HistoryInputBox, IHistoryInputOptions } from '../../../base/browser/ui/inputbox/inputBox.js'; +import { KeyCode, KeyMod } from '../../../base/common/keyCodes.js'; +import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from '../../contextkey/common/contextkey.js'; +import { KeybindingsRegistry, KeybindingWeight } from '../../keybinding/common/keybindingsRegistry.js'; +import { localize } from '../../../nls.js'; +import { DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { isActiveElement } from '../../../base/browser/dom.js'; export const historyNavigationVisible = new RawContextKey('suggestWidgetVisible', false, localize('suggestWidgetVisible', "Whether suggestion are visible")); diff --git a/src/vs/platform/history/browser/historyWidgetKeybindingHint.ts b/src/vs/platform/history/browser/historyWidgetKeybindingHint.ts index bef0f5efec8..ab56b565780 100644 --- a/src/vs/platform/history/browser/historyWidgetKeybindingHint.ts +++ b/src/vs/platform/history/browser/historyWidgetKeybindingHint.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; export function showHistoryKeybindingHint(keybindingService: IKeybindingService): boolean { return keybindingService.lookupKeybinding('history.showPrevious')?.getElectronAccelerator() === 'Up' && keybindingService.lookupKeybinding('history.showNext')?.getElectronAccelerator() === 'Down'; diff --git a/src/vs/platform/hover/browser/hover.ts b/src/vs/platform/hover/browser/hover.ts index 51ead712fcb..779a4598fbc 100644 --- a/src/vs/platform/hover/browser/hover.ts +++ b/src/vs/platform/hover/browser/hover.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { IHoverDelegate, IHoverDelegateOptions } from 'vs/base/browser/ui/hover/hoverDelegate'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { addStandardDisposableListener, isHTMLElement } from 'vs/base/browser/dom'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import type { IHoverDelegate2, IHoverOptions, IHoverWidget } from 'vs/base/browser/ui/hover/hover'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { IHoverDelegate, IHoverDelegateOptions } from '../../../base/browser/ui/hover/hoverDelegate.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { addStandardDisposableListener, isHTMLElement } from '../../../base/browser/dom.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import type { IHoverDelegate2, IHoverOptions, IHoverWidget } from '../../../base/browser/ui/hover/hover.js'; export const IHoverService = createDecorator('hoverService'); diff --git a/src/vs/platform/hover/test/browser/nullHoverService.ts b/src/vs/platform/hover/test/browser/nullHoverService.ts index 44c73f8a0a6..a4266ef7c93 100644 --- a/src/vs/platform/hover/test/browser/nullHoverService.ts +++ b/src/vs/platform/hover/test/browser/nullHoverService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import type { IHoverService } from 'vs/platform/hover/browser/hover'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import type { IHoverService } from '../../browser/hover.js'; export const NullHoverService: IHoverService = { _serviceBrand: undefined, diff --git a/src/vs/platform/instantiation/common/extensions.ts b/src/vs/platform/instantiation/common/extensions.ts index fd60abf4011..517a8cc2a3a 100644 --- a/src/vs/platform/instantiation/common/extensions.ts +++ b/src/vs/platform/instantiation/common/extensions.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SyncDescriptor } from './descriptors'; -import { BrandedService, ServiceIdentifier } from './instantiation'; +import { SyncDescriptor } from './descriptors.js'; +import { BrandedService, ServiceIdentifier } from './instantiation.js'; const _registry: [ServiceIdentifier, SyncDescriptor][] = []; diff --git a/src/vs/platform/instantiation/common/instantiation.ts b/src/vs/platform/instantiation/common/instantiation.ts index c1ce6565271..693e904fbe7 100644 --- a/src/vs/platform/instantiation/common/instantiation.ts +++ b/src/vs/platform/instantiation/common/instantiation.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore } from 'vs/base/common/lifecycle'; -import * as descriptors from './descriptors'; -import { ServiceCollection } from './serviceCollection'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import * as descriptors from './descriptors.js'; +import { ServiceCollection } from './serviceCollection.js'; // ------ internal util diff --git a/src/vs/platform/instantiation/common/instantiationService.ts b/src/vs/platform/instantiation/common/instantiationService.ts index 4b313ed32eb..c4169840864 100644 --- a/src/vs/platform/instantiation/common/instantiationService.ts +++ b/src/vs/platform/instantiation/common/instantiationService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { GlobalIdleValue } from 'vs/base/common/async'; -import { Event } from 'vs/base/common/event'; -import { illegalState } from 'vs/base/common/errors'; -import { DisposableStore, dispose, IDisposable, isDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { SyncDescriptor, SyncDescriptor0 } from 'vs/platform/instantiation/common/descriptors'; -import { Graph } from 'vs/platform/instantiation/common/graph'; -import { GetLeadingNonServiceArgs, IInstantiationService, ServiceIdentifier, ServicesAccessor, _util } from 'vs/platform/instantiation/common/instantiation'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { LinkedList } from 'vs/base/common/linkedList'; +import { GlobalIdleValue } from '../../../base/common/async.js'; +import { Event } from '../../../base/common/event.js'; +import { illegalState } from '../../../base/common/errors.js'; +import { DisposableStore, dispose, IDisposable, isDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { SyncDescriptor, SyncDescriptor0 } from './descriptors.js'; +import { Graph } from './graph.js'; +import { GetLeadingNonServiceArgs, IInstantiationService, ServiceIdentifier, ServicesAccessor, _util } from './instantiation.js'; +import { ServiceCollection } from './serviceCollection.js'; +import { LinkedList } from '../../../base/common/linkedList.js'; // TRACING const _enableAllTracing = false @@ -216,8 +216,15 @@ export class InstantiationService implements IInstantiationService { let cycleCount = 0; const stack = [{ id, desc, _trace }]; + const seen = new Set(); while (stack.length) { const item = stack.pop()!; + + if (seen.has(String(item.id))) { + continue; + } + seen.add(String(item.id)); + graph.lookupOrInsertNode(item); // a weak but working heuristic for cycle checks diff --git a/src/vs/platform/instantiation/common/serviceCollection.ts b/src/vs/platform/instantiation/common/serviceCollection.ts index 4f33e7e75e5..13c489e8325 100644 --- a/src/vs/platform/instantiation/common/serviceCollection.ts +++ b/src/vs/platform/instantiation/common/serviceCollection.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; -import { SyncDescriptor } from './descriptors'; +import { ServiceIdentifier } from './instantiation.js'; +import { SyncDescriptor } from './descriptors.js'; export class ServiceCollection { diff --git a/src/vs/platform/instantiation/test/common/graph.test.ts b/src/vs/platform/instantiation/test/common/graph.test.ts index 99e8e0e75a0..36777f910b6 100644 --- a/src/vs/platform/instantiation/test/common/graph.test.ts +++ b/src/vs/platform/instantiation/test/common/graph.test.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { Graph } from 'vs/platform/instantiation/common/graph'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { Graph } from '../../common/graph.js'; suite('Graph', () => { diff --git a/src/vs/platform/instantiation/test/common/instantiationService.test.ts b/src/vs/platform/instantiation/test/common/instantiationService.test.ts index 70718ba712d..a4d07c1b2b6 100644 --- a/src/vs/platform/instantiation/test/common/instantiationService.test.ts +++ b/src/vs/platform/instantiation/test/common/instantiationService.test.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Emitter, Event } from 'vs/base/common/event'; -import { dispose } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { createDecorator, IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { dispose } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { SyncDescriptor } from '../../common/descriptors.js'; +import { createDecorator, IInstantiationService, ServicesAccessor } from '../../common/instantiation.js'; +import { InstantiationService } from '../../common/instantiationService.js'; +import { ServiceCollection } from '../../common/serviceCollection.js'; const IService1 = createDecorator('service1'); diff --git a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts index a7c52175e9d..0e90a07d1ca 100644 --- a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts +++ b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import * as sinon from 'sinon'; -import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; -import { InstantiationService, Trace } from 'vs/platform/instantiation/common/instantiationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; +import { DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { SyncDescriptor } from '../../common/descriptors.js'; +import { ServiceIdentifier } from '../../common/instantiation.js'; +import { InstantiationService, Trace } from '../../common/instantiationService.js'; +import { ServiceCollection } from '../../common/serviceCollection.js'; interface IServiceMock { id: ServiceIdentifier; diff --git a/src/vs/platform/ipc/common/mainProcessService.ts b/src/vs/platform/ipc/common/mainProcessService.ts index a9e67cbd5a6..3caec1ebd45 100644 --- a/src/vs/platform/ipc/common/mainProcessService.ts +++ b/src/vs/platform/ipc/common/mainProcessService.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IChannel, IPCServer, IServerChannel, StaticRouter } from 'vs/base/parts/ipc/common/ipc'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IRemoteService } from 'vs/platform/ipc/common/services'; +import { IChannel, IPCServer, IServerChannel, StaticRouter } from '../../../base/parts/ipc/common/ipc.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IRemoteService } from './services.js'; export const IMainProcessService = createDecorator('mainProcessService'); diff --git a/src/vs/platform/ipc/common/services.ts b/src/vs/platform/ipc/common/services.ts index 08a1ffea09d..ae6de92a98f 100644 --- a/src/vs/platform/ipc/common/services.ts +++ b/src/vs/platform/ipc/common/services.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; export interface IRemoteService { diff --git a/src/vs/platform/ipc/electron-sandbox/mainProcessService.ts b/src/vs/platform/ipc/electron-sandbox/mainProcessService.ts index 423919570cd..8707d26a237 100644 --- a/src/vs/platform/ipc/electron-sandbox/mainProcessService.ts +++ b/src/vs/platform/ipc/electron-sandbox/mainProcessService.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { Client as IPCElectronClient } from 'vs/base/parts/ipc/electron-sandbox/ipc.electron'; -import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { Client as IPCElectronClient } from '../../../base/parts/ipc/electron-sandbox/ipc.electron.js'; +import { IMainProcessService } from '../common/mainProcessService.js'; /** * An implementation of `IMainProcessService` that leverages Electron's IPC. diff --git a/src/vs/platform/ipc/electron-sandbox/services.ts b/src/vs/platform/ipc/electron-sandbox/services.ts index 060ef30d96d..b03e23621d9 100644 --- a/src/vs/platform/ipc/electron-sandbox/services.ts +++ b/src/vs/platform/ipc/electron-sandbox/services.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IChannel, ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator, IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; -import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; -import { IRemoteService } from 'vs/platform/ipc/common/services'; +import { IChannel, ProxyChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { SyncDescriptor } from '../../instantiation/common/descriptors.js'; +import { registerSingleton } from '../../instantiation/common/extensions.js'; +import { createDecorator, IInstantiationService, ServiceIdentifier } from '../../instantiation/common/instantiation.js'; +import { IMainProcessService } from '../common/mainProcessService.js'; +import { IRemoteService } from '../common/services.js'; type ChannelClientCtor = { new(channel: IChannel, ...args: any[]): T }; type Remote = { getChannel(channelName: string): IChannel }; diff --git a/src/vs/platform/issue/common/issue.ts b/src/vs/platform/issue/common/issue.ts index 856c58c1873..3fc9e76e852 100644 --- a/src/vs/platform/issue/common/issue.ts +++ b/src/vs/platform/issue/common/issue.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { UriComponents } from 'vs/base/common/uri'; -import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes'; -import { PerformanceInfo, SystemInfo } from 'vs/platform/diagnostics/common/diagnostics'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { UriComponents } from '../../../base/common/uri.js'; +import { ISandboxConfiguration } from '../../../base/parts/sandbox/common/sandboxTypes.js'; +import { PerformanceInfo, SystemInfo } from '../../diagnostics/common/diagnostics.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; // Since data sent through the service is serialized to JSON, functions will be lost, so Color objects // should not be sent as their 'toString' method will be stripped. Instead convert to strings before sending. @@ -19,7 +19,7 @@ export interface WindowData { zoomLevel: number; } -export const enum IssueType { +export const enum OldIssueType { Bug, PerformanceIssue, FeatureRequest @@ -31,7 +31,7 @@ export enum IssueSource { Marketplace = 'marketplace' } -export interface IssueReporterStyles extends WindowStyles { +export interface OldIssueReporterStyles extends WindowStyles { textLinkColor?: string; textLinkActiveForeground?: string; inputBackground?: string; @@ -49,7 +49,7 @@ export interface IssueReporterStyles extends WindowStyles { sliderActiveColor?: string; } -export interface IssueReporterExtensionData { +export interface OldIssueReporterExtensionData { name: string; publisher: string | undefined; version: string; @@ -65,10 +65,10 @@ export interface IssueReporterExtensionData { uri?: UriComponents; } -export interface IssueReporterData extends WindowData { - styles: IssueReporterStyles; - enabledExtensions: IssueReporterExtensionData[]; - issueType?: IssueType; +export interface OldIssueReporterData extends WindowData { + styles: OldIssueReporterStyles; + enabledExtensions: OldIssueReporterExtensionData[]; + issueType?: OldIssueType; issueSource?: IssueSource; extensionId?: string; experiments?: string; @@ -109,9 +109,9 @@ export interface ProcessExplorerData extends WindowData { applicationName: string; } -export interface IssueReporterWindowConfiguration extends ISandboxConfiguration { +export interface OldIssueReporterWindowConfiguration extends ISandboxConfiguration { disableExtensions: boolean; - data: IssueReporterData; + data: OldIssueReporterData; os: { type: string; arch: string; @@ -127,13 +127,12 @@ export const IIssueMainService = createDecorator('issueServic export interface IIssueMainService { readonly _serviceBrand: undefined; - // Used by the issue reporter - openReporter(data: IssueReporterData): Promise; + openReporter(data: OldIssueReporterData): Promise; $reloadWithExtensionsDisabled(): Promise; $showConfirmCloseDialog(): Promise; $showClipboardDialog(): Promise; - $sendReporterMenu(extensionId: string, extensionName: string): Promise; + $sendReporterMenu(extensionId: string, extensionName: string): Promise; $closeReporter(): Promise; } diff --git a/src/vs/platform/issue/common/issueReporterUtil.ts b/src/vs/platform/issue/common/issueReporterUtil.ts index da2b397ba94..3a2266e308e 100644 --- a/src/vs/platform/issue/common/issueReporterUtil.ts +++ b/src/vs/platform/issue/common/issueReporterUtil.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { rtrim } from 'vs/base/common/strings'; +import { rtrim } from '../../../base/common/strings.js'; export function normalizeGitHubUrl(url: string): string { // If the url has a .git suffix, remove it diff --git a/src/vs/platform/issue/electron-main/issueMainService.ts b/src/vs/platform/issue/electron-main/issueMainService.ts index 40f1df2e7be..00a203c2d41 100644 --- a/src/vs/platform/issue/electron-main/issueMainService.ts +++ b/src/vs/platform/issue/electron-main/issueMainService.ts @@ -5,23 +5,25 @@ import { BrowserWindow, BrowserWindowConstructorOptions, Display, screen } from 'electron'; import { arch, release, type } from 'os'; -import { raceTimeout } from 'vs/base/common/async'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { FileAccess } from 'vs/base/common/network'; -import { IProcessEnvironment, isMacintosh } from 'vs/base/common/platform'; -import { validatedIpcMain } from 'vs/base/parts/ipc/electron-main/ipcMain'; -import { localize } from 'vs/nls'; -import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMainService'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { IIssueMainService, IssueReporterData, IssueReporterWindowConfiguration } from 'vs/platform/issue/common/issue'; -import { ILogService } from 'vs/platform/log/common/log'; -import { INativeHostMainService } from 'vs/platform/native/electron-main/nativeHostMainService'; -import product from 'vs/platform/product/common/product'; -import { IIPCObjectUrl, IProtocolMainService } from 'vs/platform/protocol/electron-main/protocol'; -import { zoomLevelToZoomFactor } from 'vs/platform/window/common/window'; -import { ICodeWindow, IWindowState } from 'vs/platform/window/electron-main/window'; -import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; +import { raceTimeout } from '../../../base/common/async.js'; +import { CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { FileAccess } from '../../../base/common/network.js'; +import { IProcessEnvironment, isMacintosh } from '../../../base/common/platform.js'; +import { validatedIpcMain } from '../../../base/parts/ipc/electron-main/ipcMain.js'; +import { getNLSLanguage, getNLSMessages, localize } from '../../../nls.js'; +import { IDialogMainService } from '../../dialogs/electron-main/dialogMainService.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { IIssueMainService, OldIssueReporterData, OldIssueReporterWindowConfiguration } from '../common/issue.js'; +import { ILogService } from '../../log/common/log.js'; +import { INativeHostMainService } from '../../native/electron-main/nativeHostMainService.js'; +import product from '../../product/common/product.js'; +import { IIPCObjectUrl, IProtocolMainService } from '../../protocol/electron-main/protocol.js'; +import { zoomLevelToZoomFactor } from '../../window/common/window.js'; +import { ICodeWindow, IWindowState } from '../../window/electron-main/window.js'; +import { IWindowsMainService } from '../../windows/electron-main/windows.js'; +import { isESM } from '../../../base/common/amd.js'; +import { ICSSDevelopmentService } from '../../cssDev/node/cssDevService.js'; interface IBrowserWindowOptions { backgroundColor: string | undefined; @@ -49,17 +51,18 @@ export class IssueMainService implements IIssueMainService { @INativeHostMainService private readonly nativeHostMainService: INativeHostMainService, @IProtocolMainService private readonly protocolMainService: IProtocolMainService, @IWindowsMainService private readonly windowsMainService: IWindowsMainService, + @ICSSDevelopmentService private readonly cssDevelopmentService: ICSSDevelopmentService, ) { } //#region Used by renderer - async openReporter(data: IssueReporterData): Promise { + async openReporter(data: OldIssueReporterData): Promise { if (!this.issueReporterWindow) { this.issueReporterParentWindow = BrowserWindow.getFocusedWindow(); if (this.issueReporterParentWindow) { const issueReporterDisposables = new DisposableStore(); - const issueReporterWindowConfigUrl = issueReporterDisposables.add(this.protocolMainService.createIPCObjectUrl()); + const issueReporterWindowConfigUrl = issueReporterDisposables.add(this.protocolMainService.createIPCObjectUrl()); const position = this.getWindowPosition(this.issueReporterParentWindow, 700, 800); this.issueReporterWindow = this.createBrowserWindow(position, issueReporterWindowConfigUrl, { @@ -81,11 +84,16 @@ export class IssueMainService implements IIssueMainService { arch: arch(), release: release(), }, - product + product, + nls: { + messages: getNLSMessages(), + language: getNLSLanguage() + }, + cssModules: this.cssDevelopmentService.isEnabled ? await this.cssDevelopmentService.getCssModules() : undefined }); this.issueReporterWindow.loadURL( - FileAccess.asBrowserUri(`vs/workbench/contrib/issue/electron-sandbox/issueReporter${this.environmentMainService.isBuilt ? '' : '-dev'}.html`).toString(true) + FileAccess.asBrowserUri(`vs/workbench/contrib/issue/electron-sandbox/issueReporter${this.environmentMainService.isBuilt ? '' : '-dev'}.${isESM ? 'esm.' : ''}html`).toString(true) ); this.issueReporterWindow.on('close', () => { @@ -169,16 +177,16 @@ export class IssueMainService implements IIssueMainService { return window; } - async $sendReporterMenu(extensionId: string, extensionName: string): Promise { + async $sendReporterMenu(extensionId: string, extensionName: string): Promise { const window = this.issueReporterWindowCheck(); const replyChannel = `vscode:triggerReporterMenu`; const cts = new CancellationTokenSource(); window.sendWhenReady(replyChannel, cts.token, { replyChannel, extensionId, extensionName }); - const result = await raceTimeout(new Promise(resolve => validatedIpcMain.once(`vscode:triggerReporterMenuResponse:${extensionId}`, (_: unknown, data: IssueReporterData | undefined) => resolve(data))), 5000, () => { + const result = await raceTimeout(new Promise(resolve => validatedIpcMain.once(`vscode:triggerReporterMenuResponse:${extensionId}`, (_: unknown, data: OldIssueReporterData | undefined) => resolve(data))), 5000, () => { this.logService.error(`Error: Extension ${extensionId} timed out waiting for menu response`); cts.cancel(); }); - return result as IssueReporterData | undefined; + return result as OldIssueReporterData | undefined; } async $closeReporter(): Promise { diff --git a/src/vs/platform/issue/electron-main/processMainService.ts b/src/vs/platform/issue/electron-main/processMainService.ts index 9e2cc9d0fd3..dd2a275ee10 100644 --- a/src/vs/platform/issue/electron-main/processMainService.ts +++ b/src/vs/platform/issue/electron-main/processMainService.ts @@ -4,27 +4,29 @@ *--------------------------------------------------------------------------------------------*/ import { BrowserWindow, BrowserWindowConstructorOptions, contentTracing, Display, IpcMainEvent, screen } from 'electron'; -import { randomPath } from 'vs/base/common/extpath'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { FileAccess } from 'vs/base/common/network'; -import { IProcessEnvironment, isMacintosh } from 'vs/base/common/platform'; -import { listProcesses } from 'vs/base/node/ps'; -import { validatedIpcMain } from 'vs/base/parts/ipc/electron-main/ipcMain'; -import { localize } from 'vs/nls'; -import { IDiagnosticsService, isRemoteDiagnosticError, PerformanceInfo, SystemInfo } from 'vs/platform/diagnostics/common/diagnostics'; -import { IDiagnosticsMainService } from 'vs/platform/diagnostics/electron-main/diagnosticsMainService'; -import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMainService'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { IProcessMainService, ProcessExplorerData, ProcessExplorerWindowConfiguration } from 'vs/platform/issue/common/issue'; -import { ILogService } from 'vs/platform/log/common/log'; -import { INativeHostMainService } from 'vs/platform/native/electron-main/nativeHostMainService'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IIPCObjectUrl, IProtocolMainService } from 'vs/platform/protocol/electron-main/protocol'; -import { IStateService } from 'vs/platform/state/node/state'; -import { UtilityProcess } from 'vs/platform/utilityProcess/electron-main/utilityProcess'; -import { zoomLevelToZoomFactor } from 'vs/platform/window/common/window'; -import { IWindowState } from 'vs/platform/window/electron-main/window'; +import { randomPath } from '../../../base/common/extpath.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { FileAccess } from '../../../base/common/network.js'; +import { IProcessEnvironment, isMacintosh } from '../../../base/common/platform.js'; +import { listProcesses } from '../../../base/node/ps.js'; +import { validatedIpcMain } from '../../../base/parts/ipc/electron-main/ipcMain.js'; +import { getNLSLanguage, getNLSMessages, localize } from '../../../nls.js'; +import { IDiagnosticsService, isRemoteDiagnosticError, PerformanceInfo, SystemInfo } from '../../diagnostics/common/diagnostics.js'; +import { IDiagnosticsMainService } from '../../diagnostics/electron-main/diagnosticsMainService.js'; +import { IDialogMainService } from '../../dialogs/electron-main/dialogMainService.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { ICSSDevelopmentService } from '../../cssDev/node/cssDevService.js'; +import { IProcessMainService, ProcessExplorerData, ProcessExplorerWindowConfiguration } from '../common/issue.js'; +import { ILogService } from '../../log/common/log.js'; +import { INativeHostMainService } from '../../native/electron-main/nativeHostMainService.js'; +import product from '../../product/common/product.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IIPCObjectUrl, IProtocolMainService } from '../../protocol/electron-main/protocol.js'; +import { IStateService } from '../../state/node/state.js'; +import { UtilityProcess } from '../../utilityProcess/electron-main/utilityProcess.js'; +import { zoomLevelToZoomFactor } from '../../window/common/window.js'; +import { IWindowState } from '../../window/electron-main/window.js'; +import { isESM } from '../../../base/common/amd.js'; const processExplorerWindowState = 'issue.processExplorerWindowState'; @@ -57,6 +59,7 @@ export class ProcessMainService implements IProcessMainService { @IProtocolMainService private readonly protocolMainService: IProtocolMainService, @IProductService private readonly productService: IProductService, @IStateService private readonly stateService: IStateService, + @ICSSDevelopmentService private readonly cssDevelopmentService: ICSSDevelopmentService ) { this.registerListeners(); } @@ -153,11 +156,16 @@ export class ProcessMainService implements IProcessMainService { windowId: this.processExplorerWindow.id, userEnv: this.userEnv, data, - product + product, + nls: { + messages: getNLSMessages(), + language: getNLSLanguage() + }, + cssModules: this.cssDevelopmentService.isEnabled ? await this.cssDevelopmentService.getCssModules() : undefined }); this.processExplorerWindow.loadURL( - FileAccess.asBrowserUri(`vs/code/electron-sandbox/processExplorer/processExplorer${this.environmentMainService.isBuilt ? '' : '-dev'}.html`).toString(true) + FileAccess.asBrowserUri(`vs/code/electron-sandbox/processExplorer/processExplorer${this.environmentMainService.isBuilt ? '' : '-dev'}.${isESM ? 'esm.' : ''}html`).toString(true) ); this.processExplorerWindow.on('close', () => { diff --git a/src/vs/platform/jsonschemas/common/jsonContributionRegistry.ts b/src/vs/platform/jsonschemas/common/jsonContributionRegistry.ts index 08322db2bb6..72b231f4e03 100644 --- a/src/vs/platform/jsonschemas/common/jsonContributionRegistry.ts +++ b/src/vs/platform/jsonschemas/common/jsonContributionRegistry.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import * as platform from 'vs/platform/registry/common/platform'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { getCompressedContent, IJSONSchema } from '../../../base/common/jsonSchema.js'; +import * as platform from '../../registry/common/platform.js'; export const Extensions = { JSONContribution: 'base.contributions.json' @@ -35,6 +35,18 @@ export interface IJSONContributionRegistry { * Get all schemas */ getSchemaContributions(): ISchemaContributions; + + /** + * Gets the (compressed) content of the schema with the given schema ID (if any) + * @param uri The id of the schema + */ + getSchemaContent(uri: string): string | undefined; + + /** + * Returns true if there's a schema that matches the given schema ID + * @param uri The id of the schema + */ + hasSchemaContent(uri: string): boolean; } @@ -74,6 +86,15 @@ class JSONContributionRegistry implements IJSONContributionRegistry { }; } + public getSchemaContent(uri: string): string | undefined { + const schema = this.schemasById[uri]; + return schema ? getCompressedContent(schema) : undefined; + } + + public hasSchemaContent(uri: string): boolean { + return !!this.schemasById[uri]; + } + } const jsonContributionRegistry = new JSONContributionRegistry(); diff --git a/src/vs/platform/keybinding/common/abstractKeybindingService.ts b/src/vs/platform/keybinding/common/abstractKeybindingService.ts index 40e5567ab00..22f1d343790 100644 --- a/src/vs/platform/keybinding/common/abstractKeybindingService.ts +++ b/src/vs/platform/keybinding/common/abstractKeybindingService.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions'; -import * as arrays from 'vs/base/common/arrays'; -import { IntervalTimer, TimeoutTimer } from 'vs/base/common/async'; -import { illegalState } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IME } from 'vs/base/common/ime'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { Keybinding, ResolvedChord, ResolvedKeybinding, SingleModifierChord } from 'vs/base/common/keybindings'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import * as nls from 'vs/nls'; - -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IContextKeyService, IContextKeyServiceTarget } from 'vs/platform/contextkey/common/contextkey'; -import { IKeybindingService, IKeyboardEvent, KeybindingsSchemaContribution } from 'vs/platform/keybinding/common/keybinding'; -import { ResolutionResult, KeybindingResolver, ResultKind, NoMatchingKb } from 'vs/platform/keybinding/common/keybindingResolver'; -import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; -import { ILogService } from 'vs/platform/log/common/log'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js'; +import * as arrays from '../../../base/common/arrays.js'; +import { IntervalTimer, TimeoutTimer } from '../../../base/common/async.js'; +import { illegalState } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IME } from '../../../base/common/ime.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { Keybinding, ResolvedChord, ResolvedKeybinding, SingleModifierChord } from '../../../base/common/keybindings.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import * as nls from '../../../nls.js'; + +import { ICommandService } from '../../commands/common/commands.js'; +import { IContextKeyService, IContextKeyServiceTarget } from '../../contextkey/common/contextkey.js'; +import { IKeybindingService, IKeyboardEvent, KeybindingsSchemaContribution } from './keybinding.js'; +import { ResolutionResult, KeybindingResolver, ResultKind, NoMatchingKb } from './keybindingResolver.js'; +import { ResolvedKeybindingItem } from './resolvedKeybindingItem.js'; +import { ILogService } from '../../log/common/log.js'; +import { INotificationService } from '../../notification/common/notification.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; interface CurrentChord { keypress: string; diff --git a/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts b/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts index 4584188d98e..96b56234d7f 100644 --- a/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts +++ b/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { illegalArgument } from 'vs/base/common/errors'; -import { AriaLabelProvider, ElectronAcceleratorLabelProvider, UILabelProvider, UserSettingsLabelProvider } from 'vs/base/common/keybindingLabels'; -import { Chord, SingleModifierChord, ResolvedKeybinding, ResolvedChord } from 'vs/base/common/keybindings'; -import { OperatingSystem } from 'vs/base/common/platform'; +import { illegalArgument } from '../../../base/common/errors.js'; +import { AriaLabelProvider, ElectronAcceleratorLabelProvider, UILabelProvider, UserSettingsLabelProvider } from '../../../base/common/keybindingLabels.js'; +import { Chord, SingleModifierChord, ResolvedKeybinding, ResolvedChord } from '../../../base/common/keybindings.js'; +import { OperatingSystem } from '../../../base/common/platform.js'; export abstract class BaseResolvedKeybinding extends ResolvedKeybinding { diff --git a/src/vs/platform/keybinding/common/keybinding.ts b/src/vs/platform/keybinding/common/keybinding.ts index 5a8c2b5dcec..f41ac90b7c6 100644 --- a/src/vs/platform/keybinding/common/keybinding.ts +++ b/src/vs/platform/keybinding/common/keybinding.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { ResolvedKeybinding, Keybinding } from 'vs/base/common/keybindings'; -import { IContextKeyService, IContextKeyServiceTarget } from 'vs/platform/contextkey/common/contextkey'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ResolutionResult } from 'vs/platform/keybinding/common/keybindingResolver'; -import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; +import { Event } from '../../../base/common/event.js'; +import { IJSONSchema } from '../../../base/common/jsonSchema.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { ResolvedKeybinding, Keybinding } from '../../../base/common/keybindings.js'; +import { IContextKeyService, IContextKeyServiceTarget } from '../../contextkey/common/contextkey.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ResolutionResult } from './keybindingResolver.js'; +import { ResolvedKeybindingItem } from './resolvedKeybindingItem.js'; export interface IUserFriendlyKeybinding { key: string; diff --git a/src/vs/platform/keybinding/common/keybindingResolver.ts b/src/vs/platform/keybinding/common/keybindingResolver.ts index f337eea0157..eeace6fa5b8 100644 --- a/src/vs/platform/keybinding/common/keybindingResolver.ts +++ b/src/vs/platform/keybinding/common/keybindingResolver.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { implies, ContextKeyExpression, ContextKeyExprType, IContext, IContextKeyService, expressionsAreEqualWithConstantSubstitution } from 'vs/platform/contextkey/common/contextkey'; -import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; +import { implies, ContextKeyExpression, ContextKeyExprType, IContext, IContextKeyService, expressionsAreEqualWithConstantSubstitution } from '../../contextkey/common/contextkey.js'; +import { ResolvedKeybindingItem } from './resolvedKeybindingItem.js'; //#region resolution-result diff --git a/src/vs/platform/keybinding/common/keybindingsRegistry.ts b/src/vs/platform/keybinding/common/keybindingsRegistry.ts index 6c88451dff6..eeabcc5578c 100644 --- a/src/vs/platform/keybinding/common/keybindingsRegistry.ts +++ b/src/vs/platform/keybinding/common/keybindingsRegistry.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { decodeKeybinding, Keybinding } from 'vs/base/common/keybindings'; -import { OperatingSystem, OS } from 'vs/base/common/platform'; -import { CommandsRegistry, ICommandHandler, ICommandMetadata } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { combinedDisposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { LinkedList } from 'vs/base/common/linkedList'; +import { decodeKeybinding, Keybinding } from '../../../base/common/keybindings.js'; +import { OperatingSystem, OS } from '../../../base/common/platform.js'; +import { CommandsRegistry, ICommandHandler, ICommandMetadata } from '../../commands/common/commands.js'; +import { ContextKeyExpression } from '../../contextkey/common/contextkey.js'; +import { Registry } from '../../registry/common/platform.js'; +import { combinedDisposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { LinkedList } from '../../../base/common/linkedList.js'; export interface IKeybindingItem { keybinding: Keybinding | null; diff --git a/src/vs/platform/keybinding/common/resolvedKeybindingItem.ts b/src/vs/platform/keybinding/common/resolvedKeybindingItem.ts index c12893f4098..76a5e8ccb64 100644 --- a/src/vs/platform/keybinding/common/resolvedKeybindingItem.ts +++ b/src/vs/platform/keybinding/common/resolvedKeybindingItem.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from 'vs/base/common/charCode'; -import { ResolvedKeybinding } from 'vs/base/common/keybindings'; -import { ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey'; +import { CharCode } from '../../../base/common/charCode.js'; +import { ResolvedKeybinding } from '../../../base/common/keybindings.js'; +import { ContextKeyExpression } from '../../contextkey/common/contextkey.js'; export class ResolvedKeybindingItem { _resolvedKeybindingItemBrand: void = undefined; diff --git a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts index de345edf238..5ea9a5ba515 100644 --- a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts +++ b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE, ScanCode } from 'vs/base/common/keyCodes'; -import { SingleModifierChord, Chord, KeyCodeChord, Keybinding } from 'vs/base/common/keybindings'; -import { OperatingSystem } from 'vs/base/common/platform'; -import { BaseResolvedKeybinding } from 'vs/platform/keybinding/common/baseResolvedKeybinding'; -import { toEmptyArrayIfContainsNull } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; +import { KeyCode, KeyCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE, ScanCode } from '../../../base/common/keyCodes.js'; +import { SingleModifierChord, Chord, KeyCodeChord, Keybinding } from '../../../base/common/keybindings.js'; +import { OperatingSystem } from '../../../base/common/platform.js'; +import { BaseResolvedKeybinding } from './baseResolvedKeybinding.js'; +import { toEmptyArrayIfContainsNull } from './resolvedKeybindingItem.js'; /** * Do not instantiate. Use KeybindingService to get a ResolvedKeybinding seeded with information about the current kb layout. diff --git a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts index 88aa86a05d3..4a5f4c83407 100644 --- a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts +++ b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { createSimpleKeybinding, ResolvedKeybinding, KeyCodeChord, Keybinding } from 'vs/base/common/keybindings'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { OS } from 'vs/base/common/platform'; -import Severity from 'vs/base/common/severity'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpr, ContextKeyExpression, IContext, IContextKeyService, IContextKeyServiceTarget } from 'vs/platform/contextkey/common/contextkey'; -import { AbstractKeybindingService } from 'vs/platform/keybinding/common/abstractKeybindingService'; -import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; -import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver'; -import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; -import { createUSLayoutResolvedKeybinding } from 'vs/platform/keybinding/test/common/keybindingsTestUtils'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { INotification, INotificationService, IPromptChoice, IPromptOptions, IStatusMessageOptions, NoOpNotification } from 'vs/platform/notification/common/notification'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { createSimpleKeybinding, ResolvedKeybinding, KeyCodeChord, Keybinding } from '../../../../base/common/keybindings.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { OS } from '../../../../base/common/platform.js'; +import Severity from '../../../../base/common/severity.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ICommandService } from '../../../commands/common/commands.js'; +import { ContextKeyExpr, ContextKeyExpression, IContext, IContextKeyService, IContextKeyServiceTarget } from '../../../contextkey/common/contextkey.js'; +import { AbstractKeybindingService } from '../../common/abstractKeybindingService.js'; +import { IKeyboardEvent } from '../../common/keybinding.js'; +import { KeybindingResolver } from '../../common/keybindingResolver.js'; +import { ResolvedKeybindingItem } from '../../common/resolvedKeybindingItem.js'; +import { USLayoutResolvedKeybinding } from '../../common/usLayoutResolvedKeybinding.js'; +import { createUSLayoutResolvedKeybinding } from './keybindingsTestUtils.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { INotification, INotificationService, IPromptChoice, IPromptOptions, IStatusMessageOptions, NoOpNotification } from '../../../notification/common/notification.js'; +import { NullTelemetryService } from '../../../telemetry/common/telemetryUtils.js'; function createContext(ctx: any) { return { diff --git a/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts b/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts index b88a747e454..3d1e238d896 100644 --- a/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts +++ b/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { OperatingSystem } from 'vs/base/common/platform'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { createUSLayoutResolvedKeybinding } from 'vs/platform/keybinding/test/common/keybindingsTestUtils'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { OperatingSystem } from '../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { createUSLayoutResolvedKeybinding } from './keybindingsTestUtils.js'; suite('KeybindingLabels', () => { diff --git a/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts b/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts index 3fccf387540..ccd5b6dff59 100644 --- a/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts +++ b/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { decodeKeybinding, createSimpleKeybinding, KeyCodeChord } from 'vs/base/common/keybindings'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { OS } from 'vs/base/common/platform'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ContextKeyExpr, ContextKeyExpression, IContext } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingResolver, ResultKind } from 'vs/platform/keybinding/common/keybindingResolver'; -import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; -import { createUSLayoutResolvedKeybinding } from 'vs/platform/keybinding/test/common/keybindingsTestUtils'; +import { decodeKeybinding, createSimpleKeybinding, KeyCodeChord } from '../../../../base/common/keybindings.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { OS } from '../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ContextKeyExpr, ContextKeyExpression, IContext } from '../../../contextkey/common/contextkey.js'; +import { KeybindingResolver, ResultKind } from '../../common/keybindingResolver.js'; +import { ResolvedKeybindingItem } from '../../common/resolvedKeybindingItem.js'; +import { USLayoutResolvedKeybinding } from '../../common/usLayoutResolvedKeybinding.js'; +import { createUSLayoutResolvedKeybinding } from './keybindingsTestUtils.js'; function createContext(ctx: any) { return { diff --git a/src/vs/platform/keybinding/test/common/keybindingsTestUtils.ts b/src/vs/platform/keybinding/test/common/keybindingsTestUtils.ts index d0b338d9691..e9c700e4b5f 100644 --- a/src/vs/platform/keybinding/test/common/keybindingsTestUtils.ts +++ b/src/vs/platform/keybinding/test/common/keybindingsTestUtils.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { decodeKeybinding, ResolvedKeybinding } from 'vs/base/common/keybindings'; -import { OperatingSystem } from 'vs/base/common/platform'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; +import { decodeKeybinding, ResolvedKeybinding } from '../../../../base/common/keybindings.js'; +import { OperatingSystem } from '../../../../base/common/platform.js'; +import { USLayoutResolvedKeybinding } from '../../common/usLayoutResolvedKeybinding.js'; export function createUSLayoutResolvedKeybinding(encodedKeybinding: number | number[], OS: OperatingSystem): ResolvedKeybinding | undefined { if (encodedKeybinding === 0) { diff --git a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts index 9991b85f24b..477ccb95290 100644 --- a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts +++ b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { ResolvedKeybinding, KeyCodeChord, Keybinding } from 'vs/base/common/keybindings'; -import { OS } from 'vs/base/common/platform'; -import { ContextKeyExpression, ContextKeyValue, IContextKey, IContextKeyChangeEvent, IContextKeyService, IContextKeyServiceTarget, IScopedContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IKeybindingService, IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; -import { NoMatchingKb, ResolutionResult } from 'vs/platform/keybinding/common/keybindingResolver'; -import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; +import { Event } from '../../../../base/common/event.js'; +import { ResolvedKeybinding, KeyCodeChord, Keybinding } from '../../../../base/common/keybindings.js'; +import { OS } from '../../../../base/common/platform.js'; +import { ContextKeyExpression, ContextKeyValue, IContextKey, IContextKeyChangeEvent, IContextKeyService, IContextKeyServiceTarget, IScopedContextKeyService } from '../../../contextkey/common/contextkey.js'; +import { IKeybindingService, IKeyboardEvent } from '../../common/keybinding.js'; +import { NoMatchingKb, ResolutionResult } from '../../common/keybindingResolver.js'; +import { ResolvedKeybindingItem } from '../../common/resolvedKeybindingItem.js'; +import { USLayoutResolvedKeybinding } from '../../common/usLayoutResolvedKeybinding.js'; class MockKeybindingContextKey implements IContextKey { private _defaultValue: T | undefined; diff --git a/src/vs/platform/keyboardLayout/common/keyboardConfig.ts b/src/vs/platform/keyboardLayout/common/keyboardConfig.ts index e9e83dcd70f..67be262ced3 100644 --- a/src/vs/platform/keyboardLayout/common/keyboardConfig.ts +++ b/src/vs/platform/keyboardLayout/common/keyboardConfig.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { OS, OperatingSystem } from 'vs/base/common/platform'; -import { ConfigurationScope, Extensions as ConfigExtensions, IConfigurationNode, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/registry/common/platform'; +import * as nls from '../../../nls.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { OS, OperatingSystem } from '../../../base/common/platform.js'; +import { ConfigurationScope, Extensions as ConfigExtensions, IConfigurationNode, IConfigurationRegistry } from '../../configuration/common/configurationRegistry.js'; +import { Registry } from '../../registry/common/platform.js'; export const enum DispatchConfig { Code, diff --git a/src/vs/platform/keyboardLayout/common/keyboardLayout.ts b/src/vs/platform/keyboardLayout/common/keyboardLayout.ts index ee6c1d89461..a1db5be9f32 100644 --- a/src/vs/platform/keyboardLayout/common/keyboardLayout.ts +++ b/src/vs/platform/keyboardLayout/common/keyboardLayout.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { ScanCode, ScanCodeUtils } from 'vs/base/common/keyCodes'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; -import { IKeyboardMapper } from 'vs/platform/keyboardLayout/common/keyboardMapper'; +import { Event } from '../../../base/common/event.js'; +import { ScanCode, ScanCodeUtils } from '../../../base/common/keyCodes.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IKeyboardEvent } from '../../keybinding/common/keybinding.js'; +import { IKeyboardMapper } from './keyboardMapper.js'; export const IKeyboardLayoutService = createDecorator('keyboardLayoutService'); diff --git a/src/vs/platform/keyboardLayout/common/keyboardLayoutService.ts b/src/vs/platform/keyboardLayout/common/keyboardLayoutService.ts index 640cc960c71..e72c088769a 100644 --- a/src/vs/platform/keyboardLayout/common/keyboardLayoutService.ts +++ b/src/vs/platform/keyboardLayout/common/keyboardLayoutService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IKeyboardLayoutInfo, IKeyboardMapping } from 'vs/platform/keyboardLayout/common/keyboardLayout'; +import { Event } from '../../../base/common/event.js'; +import { IKeyboardLayoutInfo, IKeyboardMapping } from './keyboardLayout.js'; export interface IKeyboardLayoutData { keyboardLayoutInfo: IKeyboardLayoutInfo; diff --git a/src/vs/platform/keyboardLayout/common/keyboardMapper.ts b/src/vs/platform/keyboardLayout/common/keyboardMapper.ts index 71528e16e8a..c9478927b76 100644 --- a/src/vs/platform/keyboardLayout/common/keyboardMapper.ts +++ b/src/vs/platform/keyboardLayout/common/keyboardMapper.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ResolvedKeybinding, Keybinding } from 'vs/base/common/keybindings'; -import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; +import { ResolvedKeybinding, Keybinding } from '../../../base/common/keybindings.js'; +import { IKeyboardEvent } from '../../keybinding/common/keybinding.js'; export interface IKeyboardMapper { dumpDebugInfo(): string; diff --git a/src/vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService.ts b/src/vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService.ts index 1d17e4c709e..8950ce2184a 100644 --- a/src/vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService.ts +++ b/src/vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import type * as nativeKeymap from 'native-keymap'; -import * as platform from 'vs/base/common/platform'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IKeyboardLayoutData, INativeKeyboardLayoutService } from 'vs/platform/keyboardLayout/common/keyboardLayoutService'; -import { ILifecycleMainService, LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; +import * as platform from '../../../base/common/platform.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IKeyboardLayoutData, INativeKeyboardLayoutService } from '../common/keyboardLayoutService.js'; +import { ILifecycleMainService, LifecycleMainPhase } from '../../lifecycle/electron-main/lifecycleMainService.js'; export const IKeyboardLayoutMainService = createDecorator('keyboardLayoutMainService'); diff --git a/src/vs/platform/label/common/label.ts b/src/vs/platform/label/common/label.ts index 60d6acb858a..e920d9a1c21 100644 --- a/src/vs/platform/label/common/label.ts +++ b/src/vs/platform/label/common/label.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IWorkspace, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { Event } from '../../../base/common/event.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IWorkspace, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from '../../workspace/common/workspace.js'; export const ILabelService = createDecorator('labelService'); diff --git a/src/vs/platform/languagePacks/browser/languagePacks.ts b/src/vs/platform/languagePacks/browser/languagePacks.ts index 62dedb2242a..af82787b888 100644 --- a/src/vs/platform/languagePacks/browser/languagePacks.ts +++ b/src/vs/platform/languagePacks/browser/languagePacks.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { URI } from 'vs/base/common/uri'; -import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader'; -import { ILanguagePackItem, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks'; -import { ILogService } from 'vs/platform/log/common/log'; +import { CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { URI } from '../../../base/common/uri.js'; +import { IExtensionGalleryService } from '../../extensionManagement/common/extensionManagement.js'; +import { IExtensionResourceLoaderService } from '../../extensionResourceLoader/common/extensionResourceLoader.js'; +import { ILanguagePackItem, LanguagePackBaseService } from '../common/languagePacks.js'; +import { ILogService } from '../../log/common/log.js'; export class WebLanguagePacksService extends LanguagePackBaseService { constructor( diff --git a/src/vs/platform/languagePacks/common/languagePacks.ts b/src/vs/platform/languagePacks/common/languagePacks.ts index f682e997d8c..28fa2ccd356 100644 --- a/src/vs/platform/languagePacks/common/languagePacks.ts +++ b/src/vs/platform/languagePacks/common/languagePacks.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { language } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { localize } from 'vs/nls'; -import { IExtensionGalleryService, IGalleryExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { language } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { IQuickPickItem } from '../../quickinput/common/quickInput.js'; +import { localize } from '../../../nls.js'; +import { IExtensionGalleryService, IGalleryExtension } from '../../extensionManagement/common/extensionManagement.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export function getLocale(extension: IGalleryExtension): string | undefined { return extension.tags.find(t => t.startsWith('lp-'))?.split('lp-')[1]; diff --git a/src/vs/platform/languagePacks/common/localizedStrings.ts b/src/vs/platform/languagePacks/common/localizedStrings.ts index 5432fbcb609..614b0dfb0f7 100644 --- a/src/vs/platform/languagePacks/common/localizedStrings.ts +++ b/src/vs/platform/languagePacks/common/localizedStrings.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../nls.js'; /** * These are some predefined strings that we test during smoke testing that they are localized diff --git a/src/vs/platform/languagePacks/node/languagePacks.ts b/src/vs/platform/languagePacks/node/languagePacks.ts index 3a7df771bc2..9527de9f2c3 100644 --- a/src/vs/platform/languagePacks/node/languagePacks.ts +++ b/src/vs/platform/languagePacks/node/languagePacks.ts @@ -3,20 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'fs'; import { createHash } from 'crypto'; -import { equals } from 'vs/base/common/arrays'; -import { Queue } from 'vs/base/common/async'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { join } from 'vs/base/common/path'; -import { Promises } from 'vs/base/node/pfs'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IExtensionGalleryService, IExtensionIdentifier, IExtensionManagementService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ILocalizationContribution } from 'vs/platform/extensions/common/extensions'; -import { ILanguagePackItem, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks'; -import { URI } from 'vs/base/common/uri'; +import { equals } from '../../../base/common/arrays.js'; +import { Queue } from '../../../base/common/async.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { join } from '../../../base/common/path.js'; +import { Promises } from '../../../base/node/pfs.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { IExtensionGalleryService, IExtensionIdentifier, IExtensionManagementService, ILocalExtension } from '../../extensionManagement/common/extensionManagement.js'; +import { areSameExtensions } from '../../extensionManagement/common/extensionManagementUtil.js'; +import { ILogService } from '../../log/common/log.js'; +import { ILocalizationContribution } from '../../extensions/common/extensions.js'; +import { ILanguagePackItem, LanguagePackBaseService } from '../common/languagePacks.js'; +import { URI } from '../../../base/common/uri.js'; interface ILanguagePack { hash: string; @@ -180,7 +181,7 @@ class LanguagePacksCache extends Disposable { private withLanguagePacks(fn: (languagePacks: { [language: string]: ILanguagePack }) => T | null = () => null): Promise { return this.languagePacksFileLimiter.queue(() => { let result: T | null = null; - return Promises.readFile(this.languagePacksFilePath, 'utf8') + return fs.promises.readFile(this.languagePacksFilePath, 'utf8') .then(undefined, err => err.code === 'ENOENT' ? Promise.resolve('{}') : Promise.reject(err)) .then<{ [language: string]: ILanguagePack }>(raw => { try { return JSON.parse(raw); } catch (e) { return {}; } }) .then(languagePacks => { result = fn(languagePacks); return languagePacks; }) diff --git a/src/vs/platform/launch/electron-main/launchMainService.ts b/src/vs/platform/launch/electron-main/launchMainService.ts index 1fcb947305d..36020f52cfc 100644 --- a/src/vs/platform/launch/electron-main/launchMainService.ts +++ b/src/vs/platform/launch/electron-main/launchMainService.ts @@ -4,20 +4,20 @@ *--------------------------------------------------------------------------------------------*/ import { app } from 'electron'; -import { coalesce, firstOrDefault } from 'vs/base/common/arrays'; -import { IProcessEnvironment, isMacintosh } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { whenDeleted } from 'vs/base/node/pfs'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { isLaunchedFromCli } from 'vs/platform/environment/node/argvHelper'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IURLService } from 'vs/platform/url/common/url'; -import { ICodeWindow } from 'vs/platform/window/electron-main/window'; -import { IWindowSettings } from 'vs/platform/window/common/window'; -import { IOpenConfiguration, IWindowsMainService, OpenContext } from 'vs/platform/windows/electron-main/windows'; -import { IProtocolUrl } from 'vs/platform/url/electron-main/url'; +import { coalesce } from '../../../base/common/arrays.js'; +import { IProcessEnvironment, isMacintosh } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { whenDeleted } from '../../../base/node/pfs.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { NativeParsedArgs } from '../../environment/common/argv.js'; +import { isLaunchedFromCli } from '../../environment/node/argvHelper.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IURLService } from '../../url/common/url.js'; +import { ICodeWindow } from '../../window/electron-main/window.js'; +import { IWindowSettings } from '../../window/common/window.js'; +import { IOpenConfiguration, IWindowsMainService, OpenContext } from '../../windows/electron-main/windows.js'; +import { IProtocolUrl } from '../../url/electron-main/url.js'; export const ID = 'launchMainService'; export const ILaunchMainService = createDecorator(ID); @@ -70,7 +70,7 @@ export class LaunchMainService implements ILaunchMainService { // Create a window if there is none if (this.windowsMainService.getWindowCount() === 0) { - const window = firstOrDefault(await this.windowsMainService.openEmptyWindow({ context: OpenContext.DESKTOP })); + const window = (await this.windowsMainService.openEmptyWindow({ context: OpenContext.DESKTOP })).at(0); if (window) { whenWindowReady = window.ready(); } diff --git a/src/vs/platform/layout/browser/layoutService.ts b/src/vs/platform/layout/browser/layoutService.ts index 65de0312451..8f5ecfb47ce 100644 --- a/src/vs/platform/layout/browser/layoutService.ts +++ b/src/vs/platform/layout/browser/layoutService.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDimension } from 'vs/base/browser/dom'; -import { Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IDimension } from '../../../base/browser/dom.js'; +import { Event } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const ILayoutService = createDecorator('layoutService'); diff --git a/src/vs/platform/layout/browser/zIndexRegistry.ts b/src/vs/platform/layout/browser/zIndexRegistry.ts index c8e4e9cf837..671eb7754ec 100644 --- a/src/vs/platform/layout/browser/zIndexRegistry.ts +++ b/src/vs/platform/layout/browser/zIndexRegistry.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { clearNode, createCSSRule, createStyleSheet } from 'vs/base/browser/dom'; -import { RunOnceScheduler } from 'vs/base/common/async'; +import { clearNode, createCSSRule, createStyleSheet } from '../../../base/browser/dom.js'; +import { RunOnceScheduler } from '../../../base/common/async.js'; export enum ZIndex { Base = 0, diff --git a/src/vs/platform/lifecycle/common/lifecycle.ts b/src/vs/platform/lifecycle/common/lifecycle.ts index d79ae9d5063..0a27c275eac 100644 --- a/src/vs/platform/lifecycle/common/lifecycle.ts +++ b/src/vs/platform/lifecycle/common/lifecycle.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isThenable, Promises } from 'vs/base/common/async'; +import { isThenable, Promises } from '../../../base/common/async.js'; // Shared veto handling across main and renderer export function handleVetos(vetos: (boolean | Promise)[], onError: (error: Error) => void): Promise { diff --git a/src/vs/platform/lifecycle/electron-main/lifecycleMainService.ts b/src/vs/platform/lifecycle/electron-main/lifecycleMainService.ts index 7dfc46d0a3b..0016baac80f 100644 --- a/src/vs/platform/lifecycle/electron-main/lifecycleMainService.ts +++ b/src/vs/platform/lifecycle/electron-main/lifecycleMainService.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { app, BrowserWindow, Event as ElectronEvent } from 'electron'; -import { validatedIpcMain } from 'vs/base/parts/ipc/electron-main/ipcMain'; -import { Barrier, Promises, timeout } from 'vs/base/common/async'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { isMacintosh, isWindows } from 'vs/base/common/platform'; -import { cwd } from 'vs/base/common/process'; -import { assertIsDefined } from 'vs/base/common/types'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStateService } from 'vs/platform/state/node/state'; -import { ICodeWindow, LoadReason, UnloadReason } from 'vs/platform/window/electron-main/window'; -import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { IAuxiliaryWindow } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow'; +import electron from 'electron'; +import { validatedIpcMain } from '../../../base/parts/ipc/electron-main/ipcMain.js'; +import { Barrier, Promises, timeout } from '../../../base/common/async.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { cwd } from '../../../base/common/process.js'; +import { assertIsDefined } from '../../../base/common/types.js'; +import { NativeParsedArgs } from '../../environment/common/argv.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IStateService } from '../../state/node/state.js'; +import { ICodeWindow, LoadReason, UnloadReason } from '../../window/electron-main/window.js'; +import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { IAuxiliaryWindow } from '../../auxiliaryWindow/electron-main/auxiliaryWindow.js'; export const ILifecycleMainService = createDecorator('lifecycleMainService'); @@ -294,7 +294,7 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe this.fireOnWillShutdown(ShutdownReason.QUIT); } }; - app.addListener('before-quit', beforeQuitListener); + electron.app.addListener('before-quit', beforeQuitListener); // window-all-closed: an event that only fires when the last window // was closed. We override this event to be in charge if app.quit() @@ -305,14 +305,14 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe // Windows/Linux: we quit when all windows have closed // Mac: we only quit when quit was requested if (this._quitRequested || !isMacintosh) { - app.quit(); + electron.app.quit(); } }; - app.addListener('window-all-closed', windowAllClosedListener); + electron.app.addListener('window-all-closed', windowAllClosedListener); // will-quit: an event that is fired after all windows have been // closed, but before actually quitting. - app.once('will-quit', e => { + electron.app.once('will-quit', e => { this.trace('Lifecycle#app.on(will-quit) - begin'); // Prevent the quit until the shutdown promise was resolved @@ -332,12 +332,12 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe // will-quit listener is only installed "once". Also // remove any listener we have that is no longer needed - app.removeListener('before-quit', beforeQuitListener); - app.removeListener('window-all-closed', windowAllClosedListener); + electron.app.removeListener('before-quit', beforeQuitListener); + electron.app.removeListener('window-all-closed', windowAllClosedListener); this.trace('Lifecycle#app.on(will-quit) - calling app.quit()'); - app.quit(); + electron.app.quit(); }); }); } @@ -428,7 +428,7 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe // Window Before Closing: Main -> Renderer const win = assertIsDefined(window.win); - windowListeners.add(Event.fromNodeEventEmitter(win, 'close')(e => { + windowListeners.add(Event.fromNodeEventEmitter(win, 'close')(e => { // The window already acknowledged to be closed const windowId = window.id; @@ -458,7 +458,7 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe window.close(); }); })); - windowListeners.add(Event.fromNodeEventEmitter(win, 'closed')(() => { + windowListeners.add(Event.fromNodeEventEmitter(win, 'closed')(() => { this.trace(`Lifecycle#window.on('closed') - window ID ${window.id}`); // update window count @@ -480,7 +480,7 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe const win = assertIsDefined(auxWindow.win); const windowListeners = new DisposableStore(); - windowListeners.add(Event.fromNodeEventEmitter(win, 'close')(e => { + windowListeners.add(Event.fromNodeEventEmitter(win, 'close')(e => { this.trace(`Lifecycle#auxWindow.on('close') - window ID ${auxWindow.id}`); if (this._quitRequested) { @@ -499,7 +499,7 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe e.preventDefault(); } })); - windowListeners.add(Event.fromNodeEventEmitter(win, 'closed')(() => { + windowListeners.add(Event.fromNodeEventEmitter(win, 'closed')(() => { this.trace(`Lifecycle#auxWindow.on('closed') - window ID ${auxWindow.id}`); windowListeners.dispose(); @@ -652,7 +652,7 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe // Calling app.quit() will trigger the close handlers of each opened window // and only if no window vetoed the shutdown, we will get the will-quit event this.trace('Lifecycle#quit() - calling app.quit()'); - app.quit(); + electron.app.quit(); }); return this.pendingQuitPromise; @@ -690,16 +690,16 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe const quitListener = () => { if (!this.relaunchHandler?.handleRelaunch(options)) { this.trace('Lifecycle#relaunch() - calling app.relaunch()'); - app.relaunch({ args }); + electron.app.relaunch({ args }); } }; - app.once('quit', quitListener); + electron.app.once('quit', quitListener); // `app.relaunch()` does not quit automatically, so we quit first, // check for vetoes and then relaunch from the `app.on('quit')` event const veto = await this.quit(true /* will restart */); if (veto) { - app.removeListener('quit', quitListener); + electron.app.removeListener('quit', quitListener); } } @@ -727,7 +727,7 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe // to a participant within the window. this is not wanted when we // are asked to kill the application. (async () => { - for (const window of BrowserWindow.getAllWindows()) { + for (const window of electron.BrowserWindow.getAllWindows()) { if (window && !window.isDestroyed()) { let whenWindowClosed: Promise; if (window.webContents && !window.webContents.isDestroyed()) { @@ -744,6 +744,6 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe ]); // Now exit either after 1s or all windows destroyed - app.exit(code); + electron.app.exit(code); } } diff --git a/src/vs/platform/lifecycle/node/sharedProcessLifecycleService.ts b/src/vs/platform/lifecycle/node/sharedProcessLifecycleService.ts index f3c6d0d4021..3c033c77097 100644 --- a/src/vs/platform/lifecycle/node/sharedProcessLifecycleService.ts +++ b/src/vs/platform/lifecycle/node/sharedProcessLifecycleService.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; export const ISharedProcessLifecycleService = createDecorator('sharedProcessLifecycleService'); diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 6857531cb66..7a03fcb4bab 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -3,32 +3,32 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createStyleSheet, isActiveElement, isKeyboardEvent } from 'vs/base/browser/dom'; -import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview'; -import { IListMouseEvent, IListRenderer, IListTouchEvent, IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; -import { IPagedListOptions, IPagedRenderer, PagedList } from 'vs/base/browser/ui/list/listPaging'; -import { DefaultStyleController, IKeyboardNavigationEventFilter, IListAccessibilityProvider, IListOptions, IListOptionsUpdate, IListStyles, IMultipleSelectionController, isSelectionRangeChangeEvent, isSelectionSingleChangeEvent, List, TypeNavigationMode } from 'vs/base/browser/ui/list/listWidget'; -import { ITableColumn, ITableRenderer, ITableVirtualDelegate } from 'vs/base/browser/ui/table/table'; -import { ITableOptions, ITableOptionsUpdate, ITableStyles, Table } from 'vs/base/browser/ui/table/tableWidget'; -import { TreeFindMode, IAbstractTreeOptions, IAbstractTreeOptionsUpdate, RenderIndentGuides, TreeFindMatchType } from 'vs/base/browser/ui/tree/abstractTree'; -import { AsyncDataTree, CompressibleAsyncDataTree, IAsyncDataTreeOptions, IAsyncDataTreeOptionsUpdate, ICompressibleAsyncDataTreeOptions, ICompressibleAsyncDataTreeOptionsUpdate, ITreeCompressionDelegate } from 'vs/base/browser/ui/tree/asyncDataTree'; -import { DataTree, IDataTreeOptions } from 'vs/base/browser/ui/tree/dataTree'; -import { CompressibleObjectTree, ICompressibleObjectTreeOptions, ICompressibleObjectTreeOptionsUpdate, ICompressibleTreeRenderer, IObjectTreeOptions, ObjectTree } from 'vs/base/browser/ui/tree/objectTree'; -import { IAsyncDataSource, IDataSource, ITreeEvent, ITreeRenderer } from 'vs/base/browser/ui/tree/tree'; -import { Emitter, Event } from 'vs/base/common/event'; -import { combinedDisposable, Disposable, DisposableStore, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { localize } from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { ContextKeyExpr, IContextKey, IContextKeyService, IScopedContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { InputFocusedContextKey } from 'vs/platform/contextkey/common/contextkeys'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { IEditorOptions } from 'vs/platform/editor/common/editor'; -import { createDecorator, IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IStyleOverride, defaultFindWidgetStyles, defaultListStyles, getListStyles } from 'vs/platform/theme/browser/defaultStyles'; +import { isActiveElement, isKeyboardEvent } from '../../../base/browser/dom.js'; +import { IContextViewProvider } from '../../../base/browser/ui/contextview/contextview.js'; +import { IListMouseEvent, IListRenderer, IListTouchEvent, IListVirtualDelegate } from '../../../base/browser/ui/list/list.js'; +import { IPagedListOptions, IPagedRenderer, PagedList } from '../../../base/browser/ui/list/listPaging.js'; +import { IKeyboardNavigationEventFilter, IListAccessibilityProvider, IListOptions, IListOptionsUpdate, IListStyles, IMultipleSelectionController, isSelectionRangeChangeEvent, isSelectionSingleChangeEvent, List, TypeNavigationMode } from '../../../base/browser/ui/list/listWidget.js'; +import { ITableColumn, ITableRenderer, ITableVirtualDelegate } from '../../../base/browser/ui/table/table.js'; +import { ITableOptions, ITableOptionsUpdate, ITableStyles, Table } from '../../../base/browser/ui/table/tableWidget.js'; +import { IAbstractTreeOptions, IAbstractTreeOptionsUpdate, RenderIndentGuides, TreeFindMatchType, TreeFindMode } from '../../../base/browser/ui/tree/abstractTree.js'; +import { AsyncDataTree, CompressibleAsyncDataTree, IAsyncDataTreeOptions, IAsyncDataTreeOptionsUpdate, ICompressibleAsyncDataTreeOptions, ICompressibleAsyncDataTreeOptionsUpdate, ITreeCompressionDelegate } from '../../../base/browser/ui/tree/asyncDataTree.js'; +import { DataTree, IDataTreeOptions } from '../../../base/browser/ui/tree/dataTree.js'; +import { CompressibleObjectTree, ICompressibleObjectTreeOptions, ICompressibleObjectTreeOptionsUpdate, ICompressibleTreeRenderer, IObjectTreeOptions, ObjectTree } from '../../../base/browser/ui/tree/objectTree.js'; +import { IAsyncDataSource, IDataSource, ITreeEvent, ITreeRenderer } from '../../../base/browser/ui/tree/tree.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { combinedDisposable, Disposable, DisposableStore, dispose, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { localize } from '../../../nls.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from '../../configuration/common/configurationRegistry.js'; +import { ContextKeyExpr, IContextKey, IContextKeyService, IScopedContextKeyService, RawContextKey } from '../../contextkey/common/contextkey.js'; +import { InputFocusedContextKey } from '../../contextkey/common/contextkeys.js'; +import { IContextViewService } from '../../contextview/browser/contextView.js'; +import { IEditorOptions } from '../../editor/common/editor.js'; +import { createDecorator, IInstantiationService, ServicesAccessor } from '../../instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import { ResultKind } from '../../keybinding/common/keybindingResolver.js'; +import { Registry } from '../../registry/common/platform.js'; +import { defaultFindWidgetStyles, defaultListStyles, getListStyles, IStyleOverride } from '../../theme/browser/defaultStyles.js'; export type ListWidget = List | PagedList | ObjectTree | DataTree | AsyncDataTree | Table; export type WorkbenchListWidget = WorkbenchList | WorkbenchPagedList | WorkbenchObjectTree | WorkbenchCompressibleObjectTree | WorkbenchDataTree | WorkbenchAsyncDataTree | WorkbenchCompressibleAsyncDataTree | WorkbenchTable; @@ -57,7 +57,6 @@ export class ListService implements IListService { private readonly disposables = new DisposableStore(); private lists: IRegisteredList[] = []; private _lastFocusedWidget: WorkbenchListWidget | undefined = undefined; - private _hasCreatedStyleController: boolean = false; get lastFocusedList(): WorkbenchListWidget | undefined { return this._lastFocusedWidget; @@ -76,13 +75,6 @@ export class ListService implements IListService { } register(widget: WorkbenchListWidget, extraContextKeys?: (IContextKey)[]): IDisposable { - if (!this._hasCreatedStyleController) { - this._hasCreatedStyleController = true; - // create a shared default tree style sheet for performance reasons - const styleController = new DefaultStyleController(createStyleSheet(), ''); - styleController.style(defaultListStyles); - } - if (this.lists.some(l => l.widget === widget)) { throw new Error('Cannot register the same widget multiple times'); } @@ -1490,7 +1482,7 @@ configurationRegistry.registerConfiguration({ type: 'number', minimum: 1, default: 7, - markdownDescription: localize('sticky scroll maximum items', "Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled."), + markdownDescription: localize('sticky scroll maximum items', "Controls the number of sticky elements displayed in the tree when {0} is enabled.", '`#workbench.tree.enableStickyScroll#`'), }, [typeNavigationModeSettingKey]: { type: 'string', diff --git a/src/vs/platform/log/browser/log.ts b/src/vs/platform/log/browser/log.ts index 0abfdaa677b..d7fcff9149b 100644 --- a/src/vs/platform/log/browser/log.ts +++ b/src/vs/platform/log/browser/log.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { mainWindow } from 'vs/base/browser/window'; -import { relativePath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { AdapterLogger, DEFAULT_LOG_LEVEL, ILogger, LogLevel } from 'vs/platform/log/common/log'; +import { mainWindow } from '../../../base/browser/window.js'; +import { relativePath } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { AdapterLogger, DEFAULT_LOG_LEVEL, ILogger, LogLevel } from '../common/log.js'; export interface IAutomatedWindow { codeAutomationLog(type: string, args: any[]): void; diff --git a/src/vs/platform/log/common/bufferLog.ts b/src/vs/platform/log/common/bufferLog.ts index 0eb3660744e..d0db55ec56b 100644 --- a/src/vs/platform/log/common/bufferLog.ts +++ b/src/vs/platform/log/common/bufferLog.ts @@ -3,7 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AbstractMessageLogger, DEFAULT_LOG_LEVEL, ILogger, log, LogLevel } from 'vs/platform/log/common/log'; +import { MutableDisposable } from '../../../base/common/lifecycle.js'; +import { AbstractMessageLogger, DEFAULT_LOG_LEVEL, ILogger, log, LogLevel } from './log.js'; interface ILog { level: LogLevel; @@ -15,17 +16,17 @@ export class BufferLogger extends AbstractMessageLogger { declare readonly _serviceBrand: undefined; private buffer: ILog[] = []; private _logger: ILogger | undefined = undefined; + private readonly _logLevelDisposable = this._register(new MutableDisposable()); constructor(logLevel: LogLevel = DEFAULT_LOG_LEVEL) { super(); this.setLevel(logLevel); - this._register(this.onDidChangeLogLevel(level => { - this._logger?.setLevel(level); - })); } set logger(logger: ILogger) { this._logger = logger; + this.setLevel(logger.getLevel()); + this._logLevelDisposable.value = logger.onDidChangeLogLevel(this.setLevel, this); for (const { level, message } of this.buffer) { log(logger, level, message); diff --git a/src/vs/platform/log/common/fileLog.ts b/src/vs/platform/log/common/fileLog.ts index 05d6579338d..a0d97a36c86 100644 --- a/src/vs/platform/log/common/fileLog.ts +++ b/src/vs/platform/log/common/fileLog.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ThrottledDelayer } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { basename, dirname, joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { ByteSize, FileOperationError, FileOperationResult, IFileService, whenProviderRegistered } from 'vs/platform/files/common/files'; -import { BufferLogger } from 'vs/platform/log/common/bufferLog'; -import { AbstractLoggerService, AbstractMessageLogger, ILogger, ILoggerOptions, ILoggerService, LogLevel } from 'vs/platform/log/common/log'; +import { ThrottledDelayer } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { basename, dirname, joinPath } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { ByteSize, FileOperationError, FileOperationResult, IFileService, whenProviderRegistered } from '../../files/common/files.js'; +import { BufferLogger } from './bufferLog.js'; +import { AbstractLoggerService, AbstractMessageLogger, ILogger, ILoggerOptions, ILoggerService, LogLevel } from './log.js'; const MAX_FILE_SIZE = 5 * ByteSize.MB; diff --git a/src/vs/platform/log/common/log.ts b/src/vs/platform/log/common/log.ts index 28fc419bbaf..2471e0573d8 100644 --- a/src/vs/platform/log/common/log.ts +++ b/src/vs/platform/log/common/log.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { Emitter, Event } from 'vs/base/common/event'; -import { hash } from 'vs/base/common/hash'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { ResourceMap } from 'vs/base/common/map'; -import { isWindows } from 'vs/base/common/platform'; -import { joinPath } from 'vs/base/common/resources'; -import { Mutable, isNumber, isString } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { ILocalizedString } from 'vs/platform/action/common/action'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import * as nls from '../../../nls.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { hash } from '../../../base/common/hash.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { isWindows } from '../../../base/common/platform.js'; +import { joinPath } from '../../../base/common/resources.js'; +import { Mutable, isNumber, isString } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { ILocalizedString } from '../../action/common/action.js'; +import { RawContextKey } from '../../contextkey/common/contextkey.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const ILogService = createDecorator('logService'); export const ILoggerService = createDecorator('loggerService'); diff --git a/src/vs/platform/log/common/logIpc.ts b/src/vs/platform/log/common/logIpc.ts index 996d680b241..4a767070d98 100644 --- a/src/vs/platform/log/common/logIpc.ts +++ b/src/vs/platform/log/common/logIpc.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { Event } from 'vs/base/common/event'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { AbstractLoggerService, AbstractMessageLogger, AdapterLogger, DidChangeLoggersEvent, ILogger, ILoggerOptions, ILoggerResource, ILoggerService, isLogLevel, LogLevel } from 'vs/platform/log/common/log'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IURITransformer } from 'vs/base/common/uriIpc'; +import { URI } from '../../../base/common/uri.js'; +import { Event } from '../../../base/common/event.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { AbstractLoggerService, AbstractMessageLogger, AdapterLogger, DidChangeLoggersEvent, ILogger, ILoggerOptions, ILoggerResource, ILoggerService, isLogLevel, LogLevel } from './log.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IURITransformer } from '../../../base/common/uriIpc.js'; export class LoggerChannelClient extends AbstractLoggerService implements ILoggerService { diff --git a/src/vs/platform/log/common/logService.ts b/src/vs/platform/log/common/logService.ts index 095d8b931e3..e76c4c30d7a 100644 --- a/src/vs/platform/log/common/logService.ts +++ b/src/vs/platform/log/common/logService.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { Event } from 'vs/base/common/event'; -import { ILogger, ILogService, LogLevel, MultiplexLogger } from 'vs/platform/log/common/log'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Event } from '../../../base/common/event.js'; +import { ILogger, ILogService, LogLevel, MultiplexLogger } from './log.js'; export class LogService extends Disposable implements ILogService { diff --git a/src/vs/platform/log/electron-main/logIpc.ts b/src/vs/platform/log/electron-main/logIpc.ts index 6ff3362ee91..2caf2b72d7a 100644 --- a/src/vs/platform/log/electron-main/logIpc.ts +++ b/src/vs/platform/log/electron-main/logIpc.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { ResourceMap } from 'vs/base/common/map'; -import { URI } from 'vs/base/common/uri'; -import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { ILogger, ILoggerOptions, isLogLevel, log, LogLevel } from 'vs/platform/log/common/log'; -import { ILoggerMainService } from 'vs/platform/log/electron-main/loggerService'; +import { Event } from '../../../base/common/event.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { URI } from '../../../base/common/uri.js'; +import { IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { ILogger, ILoggerOptions, isLogLevel, log, LogLevel } from '../common/log.js'; +import { ILoggerMainService } from './loggerService.js'; export class LoggerChannel implements IServerChannel { diff --git a/src/vs/platform/log/electron-main/loggerService.ts b/src/vs/platform/log/electron-main/loggerService.ts index c191d7e7c17..5d569519f79 100644 --- a/src/vs/platform/log/electron-main/loggerService.ts +++ b/src/vs/platform/log/electron-main/loggerService.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ResourceMap } from 'vs/base/common/map'; -import { URI } from 'vs/base/common/uri'; -import { Event } from 'vs/base/common/event'; -import { refineServiceDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { DidChangeLoggersEvent, ILogger, ILoggerOptions, ILoggerResource, ILoggerService, LogLevel, isLogLevel } from 'vs/platform/log/common/log'; -import { LoggerService } from 'vs/platform/log/node/loggerService'; +import { ResourceMap } from '../../../base/common/map.js'; +import { URI } from '../../../base/common/uri.js'; +import { Event } from '../../../base/common/event.js'; +import { refineServiceDecorator } from '../../instantiation/common/instantiation.js'; +import { DidChangeLoggersEvent, ILogger, ILoggerOptions, ILoggerResource, ILoggerService, LogLevel, isLogLevel } from '../common/log.js'; +import { LoggerService } from '../node/loggerService.js'; export const ILoggerMainService = refineServiceDecorator(ILoggerService); diff --git a/src/vs/platform/log/node/loggerService.ts b/src/vs/platform/log/node/loggerService.ts index 9624ac363e6..ab034fdaf55 100644 --- a/src/vs/platform/log/node/loggerService.ts +++ b/src/vs/platform/log/node/loggerService.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { AbstractLoggerService, ILogger, ILoggerOptions, ILoggerService, LogLevel } from 'vs/platform/log/common/log'; -import { SpdLogLogger } from 'vs/platform/log/node/spdlogLog'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { AbstractLoggerService, ILogger, ILoggerOptions, ILoggerService, LogLevel } from '../common/log.js'; +import { SpdLogLogger } from './spdlogLog.js'; export class LoggerService extends AbstractLoggerService implements ILoggerService { diff --git a/src/vs/platform/log/node/spdlogLog.ts b/src/vs/platform/log/node/spdlogLog.ts index 5c38b748e1c..ef99c32831a 100644 --- a/src/vs/platform/log/node/spdlogLog.ts +++ b/src/vs/platform/log/node/spdlogLog.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import type * as spdlog from '@vscode/spdlog'; -import { ByteSize } from 'vs/platform/files/common/files'; -import { AbstractMessageLogger, ILogger, LogLevel } from 'vs/platform/log/common/log'; +import { ByteSize } from '../../files/common/files.js'; +import { AbstractMessageLogger, ILogger, LogLevel } from '../common/log.js'; enum SpdLogLevel { Trace, diff --git a/src/vs/platform/markers/common/markerService.ts b/src/vs/platform/markers/common/markerService.ts index 692f6ba5cb7..8e9968a94c9 100644 --- a/src/vs/platform/markers/common/markerService.ts +++ b/src/vs/platform/markers/common/markerService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isFalsyOrEmpty, isNonEmptyArray } from 'vs/base/common/arrays'; -import { DebounceEmitter } from 'vs/base/common/event'; -import { Iterable } from 'vs/base/common/iterator'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ResourceMap } from 'vs/base/common/map'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { IMarker, IMarkerData, IMarkerService, IResourceMarker, MarkerSeverity, MarkerStatistics } from './markers'; +import { isFalsyOrEmpty, isNonEmptyArray } from '../../../base/common/arrays.js'; +import { DebounceEmitter } from '../../../base/common/event.js'; +import { Iterable } from '../../../base/common/iterator.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import { IMarker, IMarkerData, IMarkerService, IResourceMarker, MarkerSeverity, MarkerStatistics } from './markers.js'; export const unsupportedSchemas = new Set([ Schemas.inMemory, @@ -18,7 +18,6 @@ export const unsupportedSchemas = new Set([ Schemas.walkThrough, Schemas.walkThroughSnippet, Schemas.vscodeChatCodeBlock, - Schemas.vscodeCopilotBackingChatCodeBlock, ]); class DoubleResourceMap { diff --git a/src/vs/platform/markers/common/markers.ts b/src/vs/platform/markers/common/markers.ts index 8b68c4f80f3..73cb120869a 100644 --- a/src/vs/platform/markers/common/markers.ts +++ b/src/vs/platform/markers/common/markers.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import Severity from 'vs/base/common/severity'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import Severity from '../../../base/common/severity.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export interface IMarkerService { readonly _serviceBrand: undefined; diff --git a/src/vs/platform/markers/test/common/markerService.test.ts b/src/vs/platform/markers/test/common/markerService.test.ts index 1b9916a8adf..b3d1ff9a2ad 100644 --- a/src/vs/platform/markers/test/common/markerService.test.ts +++ b/src/vs/platform/markers/test/common/markerService.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; -import * as markerService from 'vs/platform/markers/common/markerService'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IMarkerData, MarkerSeverity } from '../../common/markers.js'; +import * as markerService from '../../common/markerService.js'; function randomMarkerData(severity = MarkerSeverity.Error): IMarkerData { return { diff --git a/src/vs/platform/menubar/common/menubar.ts b/src/vs/platform/menubar/common/menubar.ts index 6f8d45d8c40..581f4e48171 100644 --- a/src/vs/platform/menubar/common/menubar.ts +++ b/src/vs/platform/menubar/common/menubar.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; +import { URI } from '../../../base/common/uri.js'; export interface ICommonMenubarService { updateMenubar(windowId: number, menuData: IMenubarData): Promise; diff --git a/src/vs/platform/menubar/electron-main/menubar.ts b/src/vs/platform/menubar/electron-main/menubar.ts index d7449e94541..3ff82f22991 100644 --- a/src/vs/platform/menubar/electron-main/menubar.ts +++ b/src/vs/platform/menubar/electron-main/menubar.ts @@ -4,28 +4,28 @@ *--------------------------------------------------------------------------------------------*/ import { app, BrowserWindow, KeyboardEvent, Menu, MenuItem, MenuItemConstructorOptions, WebContents } from 'electron'; -import { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { mnemonicMenuLabel } from 'vs/base/common/labels'; -import { isMacintosh, language } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import * as nls from 'vs/nls'; -import { IAuxiliaryWindowsMainService } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindows'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IMenubarData, IMenubarKeybinding, IMenubarMenu, IMenubarMenuRecentItemAction, isMenubarMenuItemAction, isMenubarMenuItemRecentAction, isMenubarMenuItemSeparator, isMenubarMenuItemSubmenu, MenubarMenuItem } from 'vs/platform/menubar/common/menubar'; -import { INativeHostMainService } from 'vs/platform/native/electron-main/nativeHostMainService'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IStateService } from 'vs/platform/state/node/state'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUpdateService, StateType } from 'vs/platform/update/common/update'; -import { INativeRunActionInWindowRequest, INativeRunKeybindingInWindowRequest, IWindowOpenable, hasNativeTitlebar } from 'vs/platform/window/common/window'; -import { IWindowsCountChangedEvent, IWindowsMainService, OpenContext } from 'vs/platform/windows/electron-main/windows'; -import { IWorkspacesHistoryMainService } from 'vs/platform/workspaces/electron-main/workspacesHistoryMainService'; -import { Disposable } from 'vs/base/common/lifecycle'; +import { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { mnemonicMenuLabel } from '../../../base/common/labels.js'; +import { isMacintosh, language } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import * as nls from '../../../nls.js'; +import { IAuxiliaryWindowsMainService } from '../../auxiliaryWindow/electron-main/auxiliaryWindows.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { IMenubarData, IMenubarKeybinding, IMenubarMenu, IMenubarMenuRecentItemAction, isMenubarMenuItemAction, isMenubarMenuItemRecentAction, isMenubarMenuItemSeparator, isMenubarMenuItemSubmenu, MenubarMenuItem } from '../common/menubar.js'; +import { INativeHostMainService } from '../../native/electron-main/nativeHostMainService.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IStateService } from '../../state/node/state.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUpdateService, StateType } from '../../update/common/update.js'; +import { INativeRunActionInWindowRequest, INativeRunKeybindingInWindowRequest, IWindowOpenable, hasNativeTitlebar } from '../../window/common/window.js'; +import { IWindowsCountChangedEvent, IWindowsMainService, OpenContext } from '../../windows/electron-main/windows.js'; +import { IWorkspacesHistoryMainService } from '../../workspaces/electron-main/workspacesHistoryMainService.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; const telemetryFrom = 'menu'; diff --git a/src/vs/platform/menubar/electron-main/menubarMainService.ts b/src/vs/platform/menubar/electron-main/menubarMainService.ts index 731070e4f50..a80966d417a 100644 --- a/src/vs/platform/menubar/electron-main/menubarMainService.ts +++ b/src/vs/platform/menubar/electron-main/menubarMainService.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILifecycleMainService, LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ICommonMenubarService, IMenubarData } from 'vs/platform/menubar/common/menubar'; -import { Menubar } from 'vs/platform/menubar/electron-main/menubar'; -import { Disposable } from 'vs/base/common/lifecycle'; +import { createDecorator, IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { ILifecycleMainService, LifecycleMainPhase } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { ICommonMenubarService, IMenubarData } from '../common/menubar.js'; +import { Menubar } from './menubar.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; export const IMenubarMainService = createDecorator('menubarMainService'); diff --git a/src/vs/platform/menubar/electron-sandbox/menubar.ts b/src/vs/platform/menubar/electron-sandbox/menubar.ts index 77f60e85e9a..93ae4885778 100644 --- a/src/vs/platform/menubar/electron-sandbox/menubar.ts +++ b/src/vs/platform/menubar/electron-sandbox/menubar.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ICommonMenubarService } from 'vs/platform/menubar/common/menubar'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ICommonMenubarService } from '../common/menubar.js'; export const IMenubarService = createDecorator('menubarService'); diff --git a/src/vs/platform/native/common/native.ts b/src/vs/platform/native/common/native.ts index 4c035680fb7..cfc47da4a24 100644 --- a/src/vs/platform/native/common/native.ts +++ b/src/vs/platform/native/common/native.ts @@ -3,16 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { Event } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { MessageBoxOptions, MessageBoxReturnValue, OpenDevToolsOptions, OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue } from 'vs/base/parts/sandbox/common/electronTypes'; -import { ISerializableCommandAction } from 'vs/platform/action/common/action'; -import { INativeOpenDialogOptions } from 'vs/platform/dialogs/common/dialogs'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IV8Profile } from 'vs/platform/profiling/common/profiling'; -import { IPartsSplash } from 'vs/platform/theme/common/themeService'; -import { IColorScheme, IOpenedAuxiliaryWindow, IOpenedMainWindow, IOpenEmptyWindowOptions, IOpenWindowOptions, IPoint, IRectangle, IWindowOpenable } from 'vs/platform/window/common/window'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Event } from '../../../base/common/event.js'; +import { URI } from '../../../base/common/uri.js'; +import { MessageBoxOptions, MessageBoxReturnValue, OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue } from '../../../base/parts/sandbox/common/electronTypes.js'; +import { ISerializableCommandAction } from '../../action/common/action.js'; +import { INativeOpenDialogOptions } from '../../dialogs/common/dialogs.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IV8Profile } from '../../profiling/common/profiling.js'; +import { AuthInfo, Credentials } from '../../request/common/request.js'; +import { IPartsSplash } from '../../theme/common/themeService.js'; +import { IColorScheme, IOpenedAuxiliaryWindow, IOpenedMainWindow, IOpenEmptyWindowOptions, IOpenWindowOptions, IPoint, IRectangle, IWindowOpenable } from '../../window/common/window.js'; export interface ICPUProperties { model: string; @@ -73,6 +74,7 @@ export interface ICommonNativeHostService { getWindows(options: { includeAuxiliaryWindows: false }): Promise>; getWindowCount(): Promise; getActiveWindowId(): Promise; + getActiveWindowPosition(): Promise; openWindow(options?: IOpenEmptyWindowOptions): Promise; openWindow(toOpen: IWindowOpenable[], options?: IOpenWindowOptions): Promise; @@ -126,7 +128,7 @@ export interface ICommonNativeHostService { showItemInFolder(path: string): Promise; setRepresentedFilename(path: string, options?: INativeHostOptions): Promise; setDocumentEdited(edited: boolean, options?: INativeHostOptions): Promise; - openExternal(url: string): Promise; + openExternal(url: string, defaultApplication?: string): Promise; moveItemToTrash(fullPath: string): Promise; isAdmin(): Promise; @@ -176,7 +178,7 @@ export interface ICommonNativeHostService { exit(code: number): Promise; // Development - openDevTools(options?: Partial & INativeHostOptions): Promise; + openDevTools(options?: INativeHostOptions): Promise; toggleDevTools(options?: INativeHostOptions): Promise; // Perf Introspection @@ -184,6 +186,8 @@ export interface ICommonNativeHostService { // Connectivity resolveProxy(url: string): Promise; + lookupAuthorization(authInfo: AuthInfo): Promise; + lookupKerberosAuthorization(url: string): Promise; loadCertificates(): Promise; findFreePort(startPort: number, giveUpAfter: number, timeout: number, stride?: number): Promise; diff --git a/src/vs/platform/native/common/nativeHostService.ts b/src/vs/platform/native/common/nativeHostService.ts index c99768ed82a..7d16cba7c66 100644 --- a/src/vs/platform/native/common/nativeHostService.ts +++ b/src/vs/platform/native/common/nativeHostService.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; -import { INativeHostService } from 'vs/platform/native/common/native'; +import { ProxyChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { IMainProcessService } from '../../ipc/common/mainProcessService.js'; +import { INativeHostService } from './native.js'; // @ts-ignore: interface is implemented via proxy export class NativeHostService implements INativeHostService { diff --git a/src/vs/platform/native/electron-main/auth.ts b/src/vs/platform/native/electron-main/auth.ts new file mode 100644 index 00000000000..34adcc69f69 --- /dev/null +++ b/src/vs/platform/native/electron-main/auth.ts @@ -0,0 +1,316 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { app, AuthenticationResponseDetails, AuthInfo as ElectronAuthInfo, Event as ElectronEvent, WebContents } from 'electron'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { hash } from '../../../base/common/hash.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEncryptionMainService } from '../../encryption/common/encryptionService.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { AuthInfo, Credentials } from '../../request/common/request.js'; +import { StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { IApplicationStorageMainService } from '../../storage/electron-main/storageMainService.js'; +import { IWindowsMainService } from '../../windows/electron-main/windows.js'; + +interface ElectronAuthenticationResponseDetails extends AuthenticationResponseDetails { + firstAuthAttempt?: boolean; // https://github.com/electron/electron/blob/84a42a050e7d45225e69df5bd2d2bf9f1037ea41/shell/browser/login_handler.cc#L70 +} + +type LoginEvent = { + event?: ElectronEvent; + authInfo: AuthInfo; + callback?: (username?: string, password?: string) => void; +}; + +export const IProxyAuthService = createDecorator('proxyAuthService'); + +export interface IProxyAuthService { + lookupAuthorization(authInfo: AuthInfo): Promise; +} + +export class ProxyAuthService extends Disposable implements IProxyAuthService { + + declare readonly _serviceBrand: undefined; + + private readonly PROXY_CREDENTIALS_SERVICE_KEY = 'proxy-credentials://'; + + private pendingProxyResolves = new Map>(); + private currentDialog: Promise | undefined = undefined; + + private cancelledAuthInfoHashes = new Set(); + + private sessionCredentials = new Map(); + + constructor( + @ILogService private readonly logService: ILogService, + @IWindowsMainService private readonly windowsMainService: IWindowsMainService, + @IEncryptionMainService private readonly encryptionMainService: IEncryptionMainService, + @IApplicationStorageMainService private readonly applicationStorageMainService: IApplicationStorageMainService, + @IConfigurationService private readonly configurationService: IConfigurationService, + @IEnvironmentMainService private readonly environmentMainService: IEnvironmentMainService, + ) { + super(); + + this.registerListeners(); + } + + private registerListeners(): void { + const onLogin = Event.fromNodeEventEmitter(app, 'login', (event: ElectronEvent, _webContents: WebContents, req: ElectronAuthenticationResponseDetails, authInfo: ElectronAuthInfo, callback) => ({ event, authInfo: { ...authInfo, attempt: req.firstAuthAttempt ? 1 : 2 }, callback } satisfies LoginEvent)); + this._register(onLogin(this.onLogin, this)); + } + + async lookupAuthorization(authInfo: AuthInfo): Promise { + return this.onLogin({ authInfo }); + } + + private async onLogin({ event, authInfo, callback }: LoginEvent): Promise { + if (!authInfo.isProxy) { + return; // only for proxy + } + + // Signal we handle this event on our own, otherwise + // Electron will ignore our provided credentials. + event?.preventDefault(); + + // Compute a hash over the authentication info to be used + // with the credentials store to return the right credentials + // given the properties of the auth request + // (see https://github.com/microsoft/vscode/issues/109497) + const authInfoHash = String(hash({ scheme: authInfo.scheme, host: authInfo.host, port: authInfo.port })); + + let credentials: Credentials | undefined = undefined; + let pendingProxyResolve = this.pendingProxyResolves.get(authInfoHash); + if (!pendingProxyResolve) { + this.logService.trace('auth#onLogin (proxy) - no pending proxy handling found, starting new'); + + pendingProxyResolve = this.resolveProxyCredentials(authInfo, authInfoHash); + this.pendingProxyResolves.set(authInfoHash, pendingProxyResolve); + try { + credentials = await pendingProxyResolve; + } finally { + this.pendingProxyResolves.delete(authInfoHash); + } + } else { + this.logService.trace('auth#onLogin (proxy) - pending proxy handling found'); + + credentials = await pendingProxyResolve; + } + + // According to Electron docs, it is fine to call back without + // username or password to signal that the authentication was handled + // by us, even though without having credentials received: + // + // > If `callback` is called without a username or password, the authentication + // > request will be cancelled and the authentication error will be returned to the + // > page. + callback?.(credentials?.username, credentials?.password); + return credentials; + } + + private async resolveProxyCredentials(authInfo: AuthInfo, authInfoHash: string): Promise { + this.logService.trace('auth#resolveProxyCredentials (proxy) - enter'); + + try { + const credentials = await this.doResolveProxyCredentials(authInfo, authInfoHash); + if (credentials) { + this.logService.trace('auth#resolveProxyCredentials (proxy) - got credentials'); + + return credentials; + } else { + this.logService.trace('auth#resolveProxyCredentials (proxy) - did not get credentials'); + } + } finally { + this.logService.trace('auth#resolveProxyCredentials (proxy) - exit'); + } + + return undefined; + } + + private async doResolveProxyCredentials(authInfo: AuthInfo, authInfoHash: string): Promise { + this.logService.trace('auth#doResolveProxyCredentials - enter', authInfo); + + // For testing. + if (this.environmentMainService.extensionTestsLocationURI) { + const credentials = this.configurationService.getValue('integration-test.http.proxyAuth'); + if (credentials) { + const j = credentials.indexOf(':'); + if (j !== -1) { + return { + username: credentials.substring(0, j), + password: credentials.substring(j + 1) + }; + } else { + return { + username: credentials, + password: '' + }; + } + } + return undefined; + } + + // Reply with manually supplied credentials. Fail if they are wrong. + const newHttpProxy = (this.configurationService.getValue('http.proxy') || '').trim() + || (process.env['https_proxy'] || process.env['HTTPS_PROXY'] || process.env['http_proxy'] || process.env['HTTP_PROXY'] || '').trim() + || undefined; + + if (newHttpProxy?.indexOf('@') !== -1) { + const uri = URI.parse(newHttpProxy!); + const i = uri.authority.indexOf('@'); + if (i !== -1) { + if (authInfo.attempt > 1) { + this.logService.trace('auth#doResolveProxyCredentials (proxy) - exit - ignoring previously used config/envvar credentials'); + return undefined; // We tried already, let the user handle it. + } + this.logService.trace('auth#doResolveProxyCredentials (proxy) - exit - found config/envvar credentials to use'); + const credentials = uri.authority.substring(0, i); + const j = credentials.indexOf(':'); + if (j !== -1) { + return { + username: credentials.substring(0, j), + password: credentials.substring(j + 1) + }; + } else { + return { + username: credentials, + password: '' + }; + } + } + } + + // Reply with session credentials unless we used them already. + // In that case we need to show a login dialog again because + // they seem invalid. + const sessionCredentials = authInfo.attempt === 1 && this.sessionCredentials.get(authInfoHash); + if (sessionCredentials) { + this.logService.trace('auth#doResolveProxyCredentials (proxy) - exit - found session credentials to use'); + + const { username, password } = sessionCredentials; + return { username, password }; + } + + let storedUsername: string | undefined; + let storedPassword: string | undefined; + try { + // Try to find stored credentials for the given auth info + const encryptedValue = this.applicationStorageMainService.get(this.PROXY_CREDENTIALS_SERVICE_KEY + authInfoHash, StorageScope.APPLICATION); + if (encryptedValue) { + const credentials: Credentials = JSON.parse(await this.encryptionMainService.decrypt(encryptedValue)); + storedUsername = credentials.username; + storedPassword = credentials.password; + } + } catch (error) { + this.logService.error(error); // handle errors by asking user for login via dialog + } + + // Reply with stored credentials unless we used them already. + // In that case we need to show a login dialog again because + // they seem invalid. + if (authInfo.attempt === 1 && typeof storedUsername === 'string' && typeof storedPassword === 'string') { + this.logService.trace('auth#doResolveProxyCredentials (proxy) - exit - found stored credentials to use'); + + this.sessionCredentials.set(authInfoHash, { username: storedUsername, password: storedPassword }); + return { username: storedUsername, password: storedPassword }; + } + + const previousDialog = this.currentDialog; + const currentDialog = this.currentDialog = (async () => { + await previousDialog; + const credentials = await this.showProxyCredentialsDialog(authInfo, authInfoHash, storedUsername, storedPassword); + if (this.currentDialog === currentDialog!) { + this.currentDialog = undefined; + } + return credentials; + })(); + return currentDialog; + } + + private async showProxyCredentialsDialog(authInfo: AuthInfo, authInfoHash: string, storedUsername: string | undefined, storedPassword: string | undefined): Promise { + if (this.cancelledAuthInfoHashes.has(authInfoHash)) { + this.logService.trace('auth#doResolveProxyCredentials (proxy) - exit - login dialog was cancelled before, not showing again'); + + return undefined; + } + + // Find suitable window to show dialog: prefer to show it in the + // active window because any other network request will wait on + // the credentials and we want the user to present the dialog. + const window = this.windowsMainService.getFocusedWindow() || this.windowsMainService.getLastActiveWindow(); + if (!window) { + this.logService.trace('auth#doResolveProxyCredentials (proxy) - exit - no opened window found to show dialog in'); + + return undefined; // unexpected + } + + this.logService.trace(`auth#doResolveProxyCredentials (proxy) - asking window ${window.id} to handle proxy login`); + + // Open proxy dialog + const sessionCredentials = this.sessionCredentials.get(authInfoHash); + const payload = { + authInfo, + username: sessionCredentials?.username ?? storedUsername, // prefer to show already used username (if any) over stored + password: sessionCredentials?.password ?? storedPassword, // prefer to show already used password (if any) over stored + replyChannel: `vscode:proxyAuthResponse:${generateUuid()}` + }; + window.sendWhenReady('vscode:openProxyAuthenticationDialog', CancellationToken.None, payload); + + // Handle reply + const loginDialogCredentials = await new Promise(resolve => { + const proxyAuthResponseHandler = async (event: ElectronEvent, channel: string, reply: Credentials & { remember: boolean } | undefined /* canceled */) => { + if (channel === payload.replyChannel) { + this.logService.trace(`auth#doResolveProxyCredentials - exit - received credentials from window ${window.id}`); + window.win?.webContents.off('ipc-message', proxyAuthResponseHandler); + + // We got credentials from the window + if (reply) { + const credentials: Credentials = { username: reply.username, password: reply.password }; + + // Update stored credentials based on `remember` flag + try { + if (reply.remember) { + const encryptedSerializedCredentials = await this.encryptionMainService.encrypt(JSON.stringify(credentials)); + this.applicationStorageMainService.store( + this.PROXY_CREDENTIALS_SERVICE_KEY + authInfoHash, + encryptedSerializedCredentials, + StorageScope.APPLICATION, + // Always store in machine scope because we do not want these values to be synced + StorageTarget.MACHINE + ); + } else { + this.applicationStorageMainService.remove(this.PROXY_CREDENTIALS_SERVICE_KEY + authInfoHash, StorageScope.APPLICATION); + } + } catch (error) { + this.logService.error(error); // handle gracefully + } + + resolve({ username: credentials.username, password: credentials.password }); + } + + // We did not get any credentials from the window (e.g. cancelled) + else { + this.cancelledAuthInfoHashes.add(authInfoHash); + resolve(undefined); + } + } + }; + + window.win?.webContents.on('ipc-message', proxyAuthResponseHandler); + }); + + // Remember credentials for the session in case + // the credentials are wrong and we show the dialog + // again + this.sessionCredentials.set(authInfoHash, loginDialogCredentials); + + return loginDialogCredentials; + } +} diff --git a/src/vs/platform/native/electron-main/nativeHostMainService.ts b/src/vs/platform/native/electron-main/nativeHostMainService.ts index c7c6cf552ae..31b01e5a21c 100644 --- a/src/vs/platform/native/electron-main/nativeHostMainService.ts +++ b/src/vs/platform/native/electron-main/nativeHostMainService.ts @@ -3,46 +3,50 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'fs'; import { exec } from 'child_process'; -import { app, BrowserWindow, clipboard, Display, Menu, MessageBoxOptions, MessageBoxReturnValue, OpenDevToolsOptions, OpenDialogOptions, OpenDialogReturnValue, powerMonitor, SaveDialogOptions, SaveDialogReturnValue, screen, shell, webContents } from 'electron'; +import { app, BrowserWindow, clipboard, Display, Menu, MessageBoxOptions, MessageBoxReturnValue, OpenDialogOptions, OpenDialogReturnValue, powerMonitor, SaveDialogOptions, SaveDialogReturnValue, screen, shell, webContents } from 'electron'; import { arch, cpus, freemem, loadavg, platform, release, totalmem, type } from 'os'; import { promisify } from 'util'; -import { memoize } from 'vs/base/common/decorators'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { dirname, join, resolve } from 'vs/base/common/path'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { AddFirstParameterToFunctions } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { realpath } from 'vs/base/node/extpath'; -import { virtualMachineHint } from 'vs/base/node/id'; -import { Promises, SymlinkSupport } from 'vs/base/node/pfs'; -import { findFreePort } from 'vs/base/node/ports'; -import { localize } from 'vs/nls'; -import { ISerializableCommandAction } from 'vs/platform/action/common/action'; -import { INativeOpenDialogOptions } from 'vs/platform/dialogs/common/dialogs'; -import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMainService'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILifecycleMainService, IRelaunchOptions } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ICommonNativeHostService, INativeHostOptions, IOSProperties, IOSStatistics } from 'vs/platform/native/common/native'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IPartsSplash } from 'vs/platform/theme/common/themeService'; -import { IThemeMainService } from 'vs/platform/theme/electron-main/themeMainService'; -import { ICodeWindow } from 'vs/platform/window/electron-main/window'; -import { IColorScheme, IOpenedAuxiliaryWindow, IOpenedMainWindow, IOpenEmptyWindowOptions, IOpenWindowOptions, IPoint, IRectangle, IWindowOpenable } from 'vs/platform/window/common/window'; -import { IWindowsMainService, OpenContext } from 'vs/platform/windows/electron-main/windows'; -import { isWorkspaceIdentifier, toWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { IWorkspacesManagementMainService } from 'vs/platform/workspaces/electron-main/workspacesManagementMainService'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { hasWSLFeatureInstalled } from 'vs/platform/remote/node/wsl'; -import { WindowProfiler } from 'vs/platform/profiling/electron-main/windowProfiling'; -import { IV8Profile } from 'vs/platform/profiling/common/profiling'; -import { IAuxiliaryWindowsMainService } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindows'; -import { IAuxiliaryWindow } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow'; -import { CancellationError } from 'vs/base/common/errors'; +import { memoize } from '../../../base/common/decorators.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { matchesSomeScheme, Schemas } from '../../../base/common/network.js'; +import { dirname, join, posix, resolve, win32 } from '../../../base/common/path.js'; +import { isLinux, isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { AddFirstParameterToFunctions } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { realpath } from '../../../base/node/extpath.js'; +import { virtualMachineHint } from '../../../base/node/id.js'; +import { Promises, SymlinkSupport } from '../../../base/node/pfs.js'; +import { findFreePort } from '../../../base/node/ports.js'; +import { localize } from '../../../nls.js'; +import { ISerializableCommandAction } from '../../action/common/action.js'; +import { INativeOpenDialogOptions } from '../../dialogs/common/dialogs.js'; +import { IDialogMainService } from '../../dialogs/electron-main/dialogMainService.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILifecycleMainService, IRelaunchOptions } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { ICommonNativeHostService, INativeHostOptions, IOSProperties, IOSStatistics } from '../common/native.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IPartsSplash } from '../../theme/common/themeService.js'; +import { IThemeMainService } from '../../theme/electron-main/themeMainService.js'; +import { ICodeWindow } from '../../window/electron-main/window.js'; +import { IColorScheme, IOpenedAuxiliaryWindow, IOpenedMainWindow, IOpenEmptyWindowOptions, IOpenWindowOptions, IPoint, IRectangle, IWindowOpenable, useWindowControlsOverlay } from '../../window/common/window.js'; +import { IWindowsMainService, OpenContext } from '../../windows/electron-main/windows.js'; +import { isWorkspaceIdentifier, toWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { IWorkspacesManagementMainService } from '../../workspaces/electron-main/workspacesManagementMainService.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { hasWSLFeatureInstalled } from '../../remote/node/wsl.js'; +import { WindowProfiler } from '../../profiling/electron-main/windowProfiling.js'; +import { IV8Profile } from '../../profiling/common/profiling.js'; +import { IAuxiliaryWindowsMainService } from '../../auxiliaryWindow/electron-main/auxiliaryWindows.js'; +import { IAuxiliaryWindow } from '../../auxiliaryWindow/electron-main/auxiliaryWindow.js'; +import { CancellationError } from '../../../base/common/errors.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IProxyAuthService } from './auth.js'; +import { AuthInfo, Credentials, IRequestService } from '../../request/common/request.js'; export interface INativeHostMainService extends AddFirstParameterToFunctions /* only methods, not events */, number | undefined /* window ID */> { } @@ -61,7 +65,10 @@ export class NativeHostMainService extends Disposable implements INativeHostMain @ILogService private readonly logService: ILogService, @IProductService private readonly productService: IProductService, @IThemeMainService private readonly themeMainService: IThemeMainService, - @IWorkspacesManagementMainService private readonly workspacesManagementMainService: IWorkspacesManagementMainService + @IWorkspacesManagementMainService private readonly workspacesManagementMainService: IWorkspacesManagementMainService, + @IConfigurationService private readonly configurationService: IConfigurationService, + @IRequestService private readonly requestService: IRequestService, + @IProxyAuthService private readonly proxyAuthService: IProxyAuthService ) { super(); } @@ -172,6 +179,14 @@ export class NativeHostMainService extends Disposable implements INativeHostMain return undefined; } + async getActiveWindowPosition(): Promise { + const activeWindow = this.windowsMainService.getFocusedWindow() || this.windowsMainService.getLastActiveWindow(); + if (activeWindow) { + return activeWindow.getBounds(); + } + return undefined; + } + openWindow(windowId: number | undefined, options?: IOpenEmptyWindowOptions): Promise; openWindow(windowId: number | undefined, toOpen: IWindowOpenable[], options?: IOpenWindowOptions): Promise; openWindow(windowId: number | undefined, arg1?: IOpenEmptyWindowOptions | IWindowOpenable[], arg2?: IOpenWindowOptions): Promise { @@ -322,7 +337,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain } // Different source, delete it first - await Promises.unlink(source); + await fs.promises.unlink(source); } catch (error) { if (error.code !== 'ENOENT') { throw error; // throw on any error but file not found @@ -330,7 +345,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain } try { - await Promises.symlink(target, source); + await fs.promises.symlink(target, source); } catch (error) { if (error.code !== 'EACCES' && error.code !== 'ENOENT') { throw error; @@ -362,7 +377,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain const { source } = await this.getShellCommandLink(); try { - await Promises.unlink(source); + await fs.promises.unlink(source); } catch (error) { switch (error.code) { case 'EACCES': { @@ -485,14 +500,56 @@ export class NativeHostMainService extends Disposable implements INativeHostMain window?.setDocumentEdited(edited); } - async openExternal(windowId: number | undefined, url: string): Promise { + async openExternal(windowId: number | undefined, url: string, defaultApplication?: string): Promise { this.environmentMainService.unsetSnapExportedVariables(); - shell.openExternal(url); - this.environmentMainService.restoreSnapExportedVariables(); + try { + if (matchesSomeScheme(url, Schemas.http, Schemas.https)) { + this.openExternalBrowser(url, defaultApplication); + } else { + shell.openExternal(url); + } + } finally { + this.environmentMainService.restoreSnapExportedVariables(); + } return true; } + private async openExternalBrowser(url: string, defaultApplication?: string): Promise { + const configuredBrowser = defaultApplication ?? this.configurationService.getValue('workbench.externalBrowser'); + if (!configuredBrowser) { + return shell.openExternal(url); + } + + if (configuredBrowser.includes(posix.sep) || configuredBrowser.includes(win32.sep)) { + const browserPathExists = await Promises.exists(configuredBrowser); + if (!browserPathExists) { + this.logService.error(`Configured external browser path does not exist: ${configuredBrowser}`); + return shell.openExternal(url); + } + } + + try { + const { default: open } = await import('open'); + const res = await open(url, { + app: { + // Use `open.apps` helper to allow cross-platform browser + // aliases to be looked up properly. Fallback to the + // configured value if not found. + name: Object.hasOwn(open.apps, configuredBrowser) ? open.apps[(configuredBrowser as keyof typeof open['apps'])] : configuredBrowser + } + }); + + res.stderr?.once('data', (data: Buffer) => { + this.logService.error(`Error openening external URL '${url}' using browser '${configuredBrowser}': ${data.toString()}`); + return shell.openExternal(url); + }); + } catch (error) { + this.logService.error(`Unable to open external URL '${url}' using browser '${configuredBrowser}' due to ${error}.`); + return shell.openExternal(url); + } + } + moveItemToTrash(windowId: number | undefined, fullPath: string): Promise { return shell.trashItem(fullPath); } @@ -765,15 +822,28 @@ export class NativeHostMainService extends Disposable implements INativeHostMain //#region Connectivity async resolveProxy(windowId: number | undefined, url: string): Promise { + if (this.environmentMainService.extensionTestsLocationURI) { + const testProxy = this.configurationService.getValue('integration-test.http.proxy'); + if (testProxy) { + return testProxy; + } + } const window = this.codeWindowById(windowId); const session = window?.win?.webContents?.session; return session?.resolveProxy(url); } + async lookupAuthorization(_windowId: number | undefined, authInfo: AuthInfo): Promise { + return this.proxyAuthService.lookupAuthorization(authInfo); + } + + async lookupKerberosAuthorization(_windowId: number | undefined, url: string): Promise { + return this.requestService.lookupKerberosAuthorization(url); + } + async loadCertificates(_windowId: number | undefined): Promise { - const proxyAgent = await import('@vscode/proxy-agent'); - return proxyAgent.loadSystemCertificates({ log: this.logService }); + return this.requestService.loadCertificates(); } findFreePort(windowId: number | undefined, startPort: number, giveUpAfter: number, timeout: number, stride = 1): Promise { @@ -785,14 +855,28 @@ export class NativeHostMainService extends Disposable implements INativeHostMain //#region Development - async openDevTools(windowId: number | undefined, options?: Partial & INativeHostOptions): Promise { + async openDevTools(windowId: number | undefined, options?: INativeHostOptions): Promise { const window = this.windowById(options?.targetWindowId, windowId); - window?.win?.webContents.openDevTools(options?.mode ? { mode: options.mode, activate: options.activate } : undefined); + + let mode: 'bottom' | undefined = undefined; + if (isLinux && useWindowControlsOverlay(this.configurationService)) { + mode = 'bottom'; // TODO@bpasero WCO and devtools collide with default option 'right' + } + window?.win?.webContents.openDevTools(mode ? { mode } : undefined); } async toggleDevTools(windowId: number | undefined, options?: INativeHostOptions): Promise { const window = this.windowById(options?.targetWindowId, windowId); - window?.win?.webContents.toggleDevTools(); + const webContents = window?.win?.webContents; + if (!webContents) { + return; + } + + if (isLinux && useWindowControlsOverlay(this.configurationService) && !webContents.isDevToolsOpened()) { + webContents.openDevTools({ mode: 'bottom' }); // TODO@bpasero WCO and devtools collide with default option 'right' + } else { + webContents.toggleDevTools(); + } } //#endregion diff --git a/src/vs/platform/notification/common/notification.ts b/src/vs/platform/notification/common/notification.ts index 8506385b01c..f573e788fb3 100644 --- a/src/vs/platform/notification/common/notification.ts +++ b/src/vs/platform/notification/common/notification.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -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 { 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 { createDecorator } from '../../instantiation/common/instantiation.js'; export import Severity = BaseSeverity; diff --git a/src/vs/platform/notification/test/common/testNotificationService.ts b/src/vs/platform/notification/test/common/testNotificationService.ts index 7868f3d4072..f016e186cf5 100644 --- a/src/vs/platform/notification/test/common/testNotificationService.ts +++ b/src/vs/platform/notification/test/common/testNotificationService.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { INotification, INotificationHandle, INotificationService, INotificationSource, INotificationSourceFilter, IPromptChoice, IPromptOptions, IStatusMessageOptions, NoOpNotification, NotificationsFilter, Severity } from 'vs/platform/notification/common/notification'; +import { Event } from '../../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../../base/common/lifecycle.js'; +import { INotification, INotificationHandle, INotificationService, INotificationSource, INotificationSourceFilter, IPromptChoice, IPromptOptions, IStatusMessageOptions, NoOpNotification, NotificationsFilter, Severity } from '../../common/notification.js'; export class TestNotificationService implements INotificationService { diff --git a/src/vs/platform/observable/common/platformObservableUtils.ts b/src/vs/platform/observable/common/platformObservableUtils.ts index 2e886ef6540..225357badc9 100644 --- a/src/vs/platform/observable/common/platformObservableUtils.ts +++ b/src/vs/platform/observable/common/platformObservableUtils.ts @@ -3,11 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { autorunOpts, IObservable, IReader } from 'vs/base/common/observable'; -import { observableFromEventOpts } from 'vs/base/common/observableInternal/utils'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyValue, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { autorunOpts, IObservable, IReader, observableFromEventOpts } from '../../../base/common/observable.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { ContextKeyValue, IContextKeyService, RawContextKey } from '../../contextkey/common/contextkey.js'; /** Creates an observable update when a configuration key updates. */ export function observableConfigValue(key: string, defaultValue: T, configurationService: IConfigurationService): IObservable { diff --git a/src/vs/platform/observable/common/wrapInReloadableClass.ts b/src/vs/platform/observable/common/wrapInReloadableClass.ts new file mode 100644 index 00000000000..2bb37d1f401 --- /dev/null +++ b/src/vs/platform/observable/common/wrapInReloadableClass.ts @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { isHotReloadEnabled } from '../../../base/common/hotReload.js'; +import { readHotReloadableExport } from '../../../base/common/hotReloadHelpers.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { autorunWithStore } from '../../../base/common/observable.js'; +import { BrandedService, GetLeadingNonServiceArgs, IInstantiationService } from '../../instantiation/common/instantiation.js'; + +/** + * Wrap a class in a reloadable wrapper. + * When the wrapper is created, the original class is created. + * When the original class changes, the instance is re-created. +*/ +export function wrapInReloadableClass0(getClass: () => Result): Result> { + return !isHotReloadEnabled() ? getClass() : createWrapper(getClass, BaseClass0); +} + +type Result = new (...args: TArgs) => IDisposable; + +class BaseClass { + constructor( + public readonly instantiationService: IInstantiationService, + ) { } + + public init(...params: any[]): void { } +} + +function createWrapper(getClass: () => any, B: new (...args: T) => BaseClass) { + return (class ReloadableWrapper extends B { + private _autorun: IDisposable | undefined = undefined; + + override init(...params: any[]) { + this._autorun = autorunWithStore((reader, store) => { + const clazz = readHotReloadableExport(getClass(), reader); + store.add(this.instantiationService.createInstance(clazz as any, ...params) as IDisposable); + }); + } + + dispose(): void { + this._autorun?.dispose(); + } + }) as any; +} + +class BaseClass0 extends BaseClass { + constructor(@IInstantiationService i: IInstantiationService) { super(i); this.init(); } +} + +/** + * Wrap a class in a reloadable wrapper. + * When the wrapper is created, the original class is created. + * When the original class changes, the instance is re-created. +*/ +export function wrapInReloadableClass1(getClass: () => Result): Result> { + return !isHotReloadEnabled() ? getClass() as any : createWrapper(getClass, BaseClass1); +} + +class BaseClass1 extends BaseClass { + constructor(param1: any, @IInstantiationService i: IInstantiationService,) { super(i); this.init(param1); } +} diff --git a/src/vs/platform/opener/browser/link.ts b/src/vs/platform/opener/browser/link.ts index eb93b66a122..ff830dc05f2 100644 --- a/src/vs/platform/opener/browser/link.ts +++ b/src/vs/platform/opener/browser/link.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { $, append, EventHelper, EventLike, clearNode } from 'vs/base/browser/dom'; -import { DomEmitter } from 'vs/base/browser/event'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { EventType as TouchEventType, Gesture } from 'vs/base/browser/touch'; -import { Event } from 'vs/base/common/event'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import 'vs/css!./link'; -import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; -import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate'; -import type { IManagedHover } from 'vs/base/browser/ui/hover/hover'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; +import { $, append, EventHelper, EventLike, clearNode } from '../../../base/browser/dom.js'; +import { DomEmitter } from '../../../base/browser/event.js'; +import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { EventType as TouchEventType, Gesture } from '../../../base/browser/touch.js'; +import { Event } from '../../../base/common/event.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IOpenerService } from '../common/opener.js'; +import './link.css'; +import { getDefaultHoverDelegate } from '../../../base/browser/ui/hover/hoverDelegateFactory.js'; +import { IHoverDelegate } from '../../../base/browser/ui/hover/hoverDelegate.js'; +import type { IManagedHover } from '../../../base/browser/ui/hover/hover.js'; +import { IHoverService } from '../../hover/browser/hover.js'; export interface ILinkDescriptor { readonly label: string | HTMLElement; diff --git a/src/vs/platform/opener/common/opener.ts b/src/vs/platform/opener/common/opener.ts index 1f4d1d96b13..eb8074255a6 100644 --- a/src/vs/platform/opener/common/opener.ts +++ b/src/vs/platform/opener/common/opener.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { IEditorOptions, ITextEditorSelection } from 'vs/platform/editor/common/editor'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { IEditorOptions, ITextEditorSelection } from '../../editor/common/editor.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IOpenerService = createDecorator('openerService'); diff --git a/src/vs/platform/opener/test/common/nullOpenerService.ts b/src/vs/platform/opener/test/common/nullOpenerService.ts index e5d5a3a0540..f5c0473d7c4 100644 --- a/src/vs/platform/opener/test/common/nullOpenerService.ts +++ b/src/vs/platform/opener/test/common/nullOpenerService.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { IOpenerService } from '../../common/opener'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IOpenerService } from '../../common/opener.js'; export const NullOpenerService = Object.freeze({ _serviceBrand: undefined, diff --git a/src/vs/platform/opener/test/common/opener.test.ts b/src/vs/platform/opener/test/common/opener.test.ts index 93ee50f9901..b75a268ecb7 100644 --- a/src/vs/platform/opener/test/common/opener.test.ts +++ b/src/vs/platform/opener/test/common/opener.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { extractSelection, withSelection } from 'vs/platform/opener/common/opener'; +import { URI } from '../../../../base/common/uri.js'; +import { extractSelection, withSelection } from '../../common/opener.js'; suite('extractSelection', () => { diff --git a/src/vs/platform/policy/common/filePolicyService.ts b/src/vs/platform/policy/common/filePolicyService.ts index 3d3a1531e92..40d13159b9a 100644 --- a/src/vs/platform/policy/common/filePolicyService.ts +++ b/src/vs/platform/policy/common/filePolicyService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ThrottledDelayer } from 'vs/base/common/async'; -import { Event } from 'vs/base/common/event'; -import { Iterable } from 'vs/base/common/iterator'; -import { isObject } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { AbstractPolicyService, IPolicyService, PolicyName, PolicyValue } from 'vs/platform/policy/common/policy'; +import { ThrottledDelayer } from '../../../base/common/async.js'; +import { Event } from '../../../base/common/event.js'; +import { Iterable } from '../../../base/common/iterator.js'; +import { isObject } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { FileOperationError, FileOperationResult, IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { AbstractPolicyService, IPolicyService, PolicyName, PolicyValue } from './policy.js'; function keysDiff(a: Map, b: Map): string[] { const result: string[] = []; diff --git a/src/vs/platform/policy/common/policy.ts b/src/vs/platform/policy/common/policy.ts index 74b3a0dc35e..5da12a2a56a 100644 --- a/src/vs/platform/policy/common/policy.ts +++ b/src/vs/platform/policy/common/policy.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IStringDictionary } from 'vs/base/common/collections'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Iterable } from 'vs/base/common/iterator'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Iterable } from '../../../base/common/iterator.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export type PolicyName = string; export type PolicyValue = string | number; diff --git a/src/vs/platform/policy/common/policyIpc.ts b/src/vs/platform/policy/common/policyIpc.ts index 33a0ddf1cc4..c95719592bc 100644 --- a/src/vs/platform/policy/common/policyIpc.ts +++ b/src/vs/platform/policy/common/policyIpc.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IStringDictionary } from 'vs/base/common/collections'; -import { Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { AbstractPolicyService, IPolicyService, PolicyDefinition, PolicyName, PolicyValue } from 'vs/platform/policy/common/policy'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Event } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { AbstractPolicyService, IPolicyService, PolicyDefinition, PolicyName, PolicyValue } from './policy.js'; export class PolicyChannel implements IServerChannel { diff --git a/src/vs/platform/policy/node/nativePolicyService.ts b/src/vs/platform/policy/node/nativePolicyService.ts index 747177ae7e9..67f7892e72f 100644 --- a/src/vs/platform/policy/node/nativePolicyService.ts +++ b/src/vs/platform/policy/node/nativePolicyService.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AbstractPolicyService, IPolicyService, PolicyDefinition } from 'vs/platform/policy/common/policy'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Throttler } from 'vs/base/common/async'; +import { AbstractPolicyService, IPolicyService, PolicyDefinition } from '../common/policy.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Throttler } from '../../../base/common/async.js'; import type { PolicyUpdate, Watcher } from '@vscode/policy-watcher'; -import { MutableDisposable } from 'vs/base/common/lifecycle'; -import { ILogService } from 'vs/platform/log/common/log'; +import { MutableDisposable } from '../../../base/common/lifecycle.js'; +import { ILogService } from '../../log/common/log.js'; export class NativePolicyService extends AbstractPolicyService implements IPolicyService { diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts index 9d3f34e443d..a98043f554a 100644 --- a/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { env } from 'vs/base/common/process'; -import { IProductConfiguration } from 'vs/base/common/product'; -import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes'; +import { env } from '../../../base/common/process.js'; +import { IProductConfiguration } from '../../../base/common/product.js'; +import { ISandboxConfiguration } from '../../../base/parts/sandbox/common/sandboxTypes.js'; /** * @deprecated You MUST use `IProductService` if possible. @@ -53,12 +53,12 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) { else { // Built time configuration (do NOT modify) - product = { /*BUILD->INSERT_PRODUCT_CONFIGURATION*/ } as IProductConfiguration; + product = { /*BUILD->INSERT_PRODUCT_CONFIGURATION*/ } as any; // Running out of sources if (Object.keys(product).length === 0) { Object.assign(product, { - version: '1.91.0-dev', + version: '1.94.0-dev', nameShort: 'Code - OSS Dev', nameLong: 'Code - OSS Dev', applicationName: 'code-oss', diff --git a/src/vs/platform/product/common/productService.ts b/src/vs/platform/product/common/productService.ts index 4e8561e3b2e..fbcccb4f00f 100644 --- a/src/vs/platform/product/common/productService.ts +++ b/src/vs/platform/product/common/productService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IProductConfiguration } from 'vs/base/common/product'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IProductConfiguration } from '../../../base/common/product.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IProductService = createDecorator('productService'); diff --git a/src/vs/platform/profiling/common/profiling.ts b/src/vs/platform/profiling/common/profiling.ts index f4b4a302750..79f9612d4d1 100644 --- a/src/vs/platform/profiling/common/profiling.ts +++ b/src/vs/platform/profiling/common/profiling.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { basename, isAbsolute, join } from 'vs/base/common/path'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { basename, isAbsolute, join } from '../../../base/common/path.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export interface IV8Profile { nodes: IV8ProfileNode[]; diff --git a/src/vs/platform/profiling/common/profilingModel.ts b/src/vs/platform/profiling/common/profilingModel.ts index 82202203388..a1c491c509c 100644 --- a/src/vs/platform/profiling/common/profilingModel.ts +++ b/src/vs/platform/profiling/common/profilingModel.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import type { IV8Profile, IV8ProfileNode } from 'vs/platform/profiling/common/profiling'; +import type { IV8Profile, IV8ProfileNode } from './profiling.js'; // #region // https://github.com/microsoft/vscode-js-profile-visualizer/blob/6e7401128ee860be113a916f80fcfe20ac99418e/packages/vscode-js-profile-core/src/cpu/model.ts#L4 diff --git a/src/vs/platform/profiling/common/profilingTelemetrySpec.ts b/src/vs/platform/profiling/common/profilingTelemetrySpec.ts index 316b6321f34..d6f8fd92b77 100644 --- a/src/vs/platform/profiling/common/profilingTelemetrySpec.ts +++ b/src/vs/platform/profiling/common/profilingTelemetrySpec.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ILogService } from 'vs/platform/log/common/log'; -import { BottomUpSample } from 'vs/platform/profiling/common/profilingModel'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { errorHandler } from 'vs/base/common/errors'; +import { ILogService } from '../../log/common/log.js'; +import { BottomUpSample } from './profilingModel.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { errorHandler } from '../../../base/common/errors.js'; type TelemetrySampleData = { selfTime: number; diff --git a/src/vs/platform/profiling/electron-main/windowProfiling.ts b/src/vs/platform/profiling/electron-main/windowProfiling.ts index c9ac6756b3d..222fe9c0f75 100644 --- a/src/vs/platform/profiling/electron-main/windowProfiling.ts +++ b/src/vs/platform/profiling/electron-main/windowProfiling.ts @@ -5,9 +5,9 @@ import type { ProfileResult } from 'v8-inspect-profiler'; import { BrowserWindow } from 'electron'; -import { timeout } from 'vs/base/common/async'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IV8Profile } from 'vs/platform/profiling/common/profiling'; +import { timeout } from '../../../base/common/async.js'; +import { ILogService } from '../../log/common/log.js'; +import { IV8Profile } from '../common/profiling.js'; export class WindowProfiler { diff --git a/src/vs/platform/profiling/electron-sandbox/profileAnalysisWorker.esm.ts b/src/vs/platform/profiling/electron-sandbox/profileAnalysisWorker.esm.ts new file mode 100644 index 00000000000..bab4ec0dc5d --- /dev/null +++ b/src/vs/platform/profiling/electron-sandbox/profileAnalysisWorker.esm.ts @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { create } from './profileAnalysisWorker.js'; +import { bootstrapSimpleWorker } from '../../../base/common/worker/simpleWorkerBootstrap.js'; + +bootstrapSimpleWorker(create); diff --git a/src/vs/platform/profiling/electron-sandbox/profileAnalysisWorker.ts b/src/vs/platform/profiling/electron-sandbox/profileAnalysisWorker.ts index 14d6a473c09..50acc3353a5 100644 --- a/src/vs/platform/profiling/electron-sandbox/profileAnalysisWorker.ts +++ b/src/vs/platform/profiling/electron-sandbox/profileAnalysisWorker.ts @@ -3,15 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { basename } from 'vs/base/common/path'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { URI } from 'vs/base/common/uri'; -import { IRequestHandler } from 'vs/base/common/worker/simpleWorker'; -import { IV8Profile, Utils } from 'vs/platform/profiling/common/profiling'; -import { IProfileModel, BottomUpSample, buildModel, BottomUpNode, processNode, CdpCallFrame } from 'vs/platform/profiling/common/profilingModel'; -import { BottomUpAnalysis, IProfileAnalysisWorker, ProfilingOutput } from 'vs/platform/profiling/electron-sandbox/profileAnalysisWorkerService'; - -export function create(): IRequestHandler { +import { basename } from '../../../base/common/path.js'; +import { TernarySearchTree } from '../../../base/common/ternarySearchTree.js'; +import { URI } from '../../../base/common/uri.js'; +import { IRequestHandler, IWorkerServer } from '../../../base/common/worker/simpleWorker.js'; +import { IV8Profile, Utils } from '../common/profiling.js'; +import { IProfileModel, BottomUpSample, buildModel, BottomUpNode, processNode, CdpCallFrame } from '../common/profilingModel.js'; +import { BottomUpAnalysis, IProfileAnalysisWorker, ProfilingOutput } from './profileAnalysisWorkerService.js'; + +/** + * Defines the worker entry point. Must be exported and named `create`. + * @skipMangle + */ +export function create(workerServer: IWorkerServer): IRequestHandler { return new ProfileAnalysisWorker(); } @@ -19,7 +23,7 @@ class ProfileAnalysisWorker implements IRequestHandler, IProfileAnalysisWorker { _requestHandlerBrand: any; - analyseBottomUp(profile: IV8Profile): BottomUpAnalysis { + $analyseBottomUp(profile: IV8Profile): BottomUpAnalysis { if (!Utils.isValidProfile(profile)) { return { kind: ProfilingOutput.Irrelevant, samples: [] }; } @@ -37,7 +41,7 @@ class ProfileAnalysisWorker implements IRequestHandler, IProfileAnalysisWorker { return { kind: ProfilingOutput.Interesting, samples }; } - analyseByUrlCategory(profile: IV8Profile, categories: [url: URI, category: string][]): [category: string, aggregated: number][] { + $analyseByUrlCategory(profile: IV8Profile, categories: [url: URI, category: string][]): [category: string, aggregated: number][] { // build search tree const searchTree = TernarySearchTree.forUris(); diff --git a/src/vs/platform/profiling/electron-sandbox/profileAnalysisWorkerService.ts b/src/vs/platform/profiling/electron-sandbox/profileAnalysisWorkerService.ts index ad6a25cd679..164bafa0242 100644 --- a/src/vs/platform/profiling/electron-sandbox/profileAnalysisWorkerService.ts +++ b/src/vs/platform/profiling/electron-sandbox/profileAnalysisWorkerService.ts @@ -4,17 +4,16 @@ *--------------------------------------------------------------------------------------------*/ -import { DefaultWorkerFactory } from 'vs/base/browser/defaultWorkerFactory'; -import { URI } from 'vs/base/common/uri'; -import { SimpleWorkerClient } from 'vs/base/common/worker/simpleWorker'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IV8Profile } from 'vs/platform/profiling/common/profiling'; -import { BottomUpSample } from 'vs/platform/profiling/common/profilingModel'; -import { reportSample } from 'vs/platform/profiling/common/profilingTelemetrySpec'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; - +import { createWebWorker } from '../../../base/browser/defaultWorkerFactory.js'; +import { URI } from '../../../base/common/uri.js'; +import { Proxied } from '../../../base/common/worker/simpleWorker.js'; +import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IV8Profile } from '../common/profiling.js'; +import { BottomUpSample } from '../common/profilingModel.js'; +import { reportSample } from '../common/profilingTelemetrySpec.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; export const enum ProfilingOutput { Failure, @@ -41,8 +40,6 @@ class ProfileAnalysisWorkerService implements IProfileAnalysisWorkerService { declare _serviceBrand: undefined; - private readonly _workerFactory = new DefaultWorkerFactory('CpuProfileAnalysis'); - constructor( @ITelemetryService private readonly _telemetryService: ITelemetryService, @ILogService private readonly _logService: ILogService, @@ -50,14 +47,13 @@ class ProfileAnalysisWorkerService implements IProfileAnalysisWorkerService { private async _withWorker(callback: (worker: Proxied) => Promise): Promise { - const worker = new SimpleWorkerClient, {}>( - this._workerFactory, + const worker = createWebWorker( 'vs/platform/profiling/electron-sandbox/profileAnalysisWorker', - { /* host */ } + 'CpuProfileAnalysisWorker' ); try { - const r = await callback(await worker.getProxyObject()); + const r = await callback(worker.proxy); return r; } finally { worker.dispose(); @@ -66,7 +62,7 @@ class ProfileAnalysisWorkerService implements IProfileAnalysisWorkerService { async analyseBottomUp(profile: IV8Profile, callFrameClassifier: IScriptUrlClassifier, perfBaseline: number, sendAsErrorTelemtry: boolean): Promise { return this._withWorker(async worker => { - const result = await worker.analyseBottomUp(profile); + const result = await worker.$analyseBottomUp(profile); if (result.kind === ProfilingOutput.Interesting) { for (const sample of result.samples) { reportSample({ @@ -82,7 +78,7 @@ class ProfileAnalysisWorkerService implements IProfileAnalysisWorkerService { async analyseByLocation(profile: IV8Profile, locations: [location: URI, id: string][]): Promise<[category: string, aggregated: number][]> { return this._withWorker(async worker => { - const result = await worker.analyseByUrlCategory(profile, locations); + const result = await worker.$analyseByUrlCategory(profile, locations); return result; }); } @@ -103,15 +99,8 @@ export interface CategoryAnalysis { } export interface IProfileAnalysisWorker { - analyseBottomUp(profile: IV8Profile): BottomUpAnalysis; - analyseByUrlCategory(profile: IV8Profile, categories: [url: URI, category: string][]): [category: string, aggregated: number][]; + $analyseBottomUp(profile: IV8Profile): BottomUpAnalysis; + $analyseByUrlCategory(profile: IV8Profile, categories: [url: URI, category: string][]): [category: string, aggregated: number][]; } -// TODO@jrieken move into worker logic -type Proxied = { [K in keyof T]: T[K] extends (...args: infer A) => infer R - ? (...args: A) => Promise> - : never -}; - - registerSingleton(IProfileAnalysisWorkerService, ProfileAnalysisWorkerService, InstantiationType.Delayed); diff --git a/src/vs/platform/profiling/electron-sandbox/profilingService.ts b/src/vs/platform/profiling/electron-sandbox/profilingService.ts index 7e26d8a5ec7..ffb1e47edf1 100644 --- a/src/vs/platform/profiling/electron-sandbox/profilingService.ts +++ b/src/vs/platform/profiling/electron-sandbox/profilingService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSharedProcessRemoteService } from 'vs/platform/ipc/electron-sandbox/services'; -import { IV8InspectProfilingService } from 'vs/platform/profiling/common/profiling'; +import { registerSharedProcessRemoteService } from '../../ipc/electron-sandbox/services.js'; +import { IV8InspectProfilingService } from '../common/profiling.js'; registerSharedProcessRemoteService(IV8InspectProfilingService, 'v8InspectProfiling'); diff --git a/src/vs/platform/profiling/node/profilingService.ts b/src/vs/platform/profiling/node/profilingService.ts index c3f218d047c..e1b199d3856 100644 --- a/src/vs/platform/profiling/node/profilingService.ts +++ b/src/vs/platform/profiling/node/profilingService.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import type { ProfilingSession } from 'v8-inspect-profiler'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IV8InspectProfilingService, IV8Profile } from 'vs/platform/profiling/common/profiling'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IV8InspectProfilingService, IV8Profile } from '../common/profiling.js'; export class InspectProfilingService implements IV8InspectProfilingService { diff --git a/src/vs/platform/progress/common/progress.ts b/src/vs/platform/progress/common/progress.ts index 2a1c7349aae..a2bdb893ff3 100644 --- a/src/vs/platform/progress/common/progress.ts +++ b/src/vs/platform/progress/common/progress.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IAction } from 'vs/base/common/actions'; -import { DeferredPromise } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { INotificationSource, NotificationPriority } from 'vs/platform/notification/common/notification'; +import { IAction } from '../../../base/common/actions.js'; +import { DeferredPromise } from '../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { Disposable, DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { INotificationSource, NotificationPriority } from '../../notification/common/notification.js'; export const IProgressService = createDecorator('progressService'); diff --git a/src/vs/platform/progress/test/common/progress.test.ts b/src/vs/platform/progress/test/common/progress.test.ts index 24c2ddb78de..b3be8cf8064 100644 --- a/src/vs/platform/progress/test/common/progress.test.ts +++ b/src/vs/platform/progress/test/common/progress.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { AsyncProgress } from 'vs/platform/progress/common/progress'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { AsyncProgress } from '../../common/progress.js'; suite('Progress', () => { diff --git a/src/vs/platform/protocol/electron-main/protocol.ts b/src/vs/platform/protocol/electron-main/protocol.ts index eaf83cbdfff..e180f1b1a19 100644 --- a/src/vs/platform/protocol/electron-main/protocol.ts +++ b/src/vs/platform/protocol/electron-main/protocol.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IProtocolMainService = createDecorator('protocolMainService'); diff --git a/src/vs/platform/protocol/electron-main/protocolMainService.ts b/src/vs/platform/protocol/electron-main/protocolMainService.ts index 8b6fd7b5868..840b936d376 100644 --- a/src/vs/platform/protocol/electron-main/protocolMainService.ts +++ b/src/vs/platform/protocol/electron-main/protocolMainService.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import { session } from 'electron'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { COI, FileAccess, Schemas } from 'vs/base/common/network'; -import { basename, extname, normalize } from 'vs/base/common/path'; -import { isLinux } from 'vs/base/common/platform'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { validatedIpcMain } from 'vs/base/parts/ipc/electron-main/ipcMain'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IIPCObjectUrl, IProtocolMainService } from 'vs/platform/protocol/electron-main/protocol'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { Disposable, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { COI, FileAccess, Schemas } from '../../../base/common/network.js'; +import { basename, extname, normalize } from '../../../base/common/path.js'; +import { isLinux } from '../../../base/common/platform.js'; +import { TernarySearchTree } from '../../../base/common/ternarySearchTree.js'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { validatedIpcMain } from '../../../base/parts/ipc/electron-main/ipcMain.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { ILogService } from '../../log/common/log.js'; +import { IIPCObjectUrl, IProtocolMainService } from './protocol.js'; +import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; type ProtocolCallback = { (result: string | Electron.FilePathWithHeaders | { error: number }): void }; @@ -96,7 +96,8 @@ export class ProtocolMainService extends Disposable implements IProtocolMainServ let headers: Record | undefined; if (this.environmentService.crossOriginIsolated) { - if (basename(path) === 'workbench.html' || basename(path) === 'workbench-dev.html') { + const pathBasename = basename(path); + if (pathBasename === 'workbench.html' || pathBasename === 'workbench-dev.html' || pathBasename === 'workbench.esm.html' || pathBasename === 'workbench-dev.esm.html') { headers = COI.CoopAndCoep; } else { headers = COI.getHeadersFromQuery(request.url); diff --git a/src/vs/platform/quickinput/browser/commandsQuickAccess.ts b/src/vs/platform/quickinput/browser/commandsQuickAccess.ts index feb47bd2f62..513641b4da5 100644 --- a/src/vs/platform/quickinput/browser/commandsQuickAccess.ts +++ b/src/vs/platform/quickinput/browser/commandsQuickAccess.ts @@ -3,28 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { isCancellationError } from 'vs/base/common/errors'; -import { matchesContiguousSubString, matchesPrefix, matchesWords, or } from 'vs/base/common/filters'; -import { createSingleCallFunction } from 'vs/base/common/functional'; -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { LRUCache } from 'vs/base/common/map'; -import { TfIdfCalculator, normalizeTfIdfScores } from 'vs/base/common/tfIdf'; -import { localize } from 'vs/nls'; -import { ILocalizedString } from 'vs/platform/action/common/action'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ILogService } from 'vs/platform/log/common/log'; -import { FastAndSlowPicks, IPickerQuickAccessItem, IPickerQuickAccessProviderOptions, PickerQuickAccessProvider, Picks } from 'vs/platform/quickinput/browser/pickerQuickAccess'; -import { IQuickAccessProviderRunOptions } from 'vs/platform/quickinput/common/quickAccess'; -import { IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput'; -import { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { isCancellationError } from '../../../base/common/errors.js'; +import { matchesContiguousSubString, matchesPrefix, matchesWords, or } from '../../../base/common/filters.js'; +import { createSingleCallFunction } from '../../../base/common/functional.js'; +import { Disposable, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { LRUCache } from '../../../base/common/map.js'; +import { TfIdfCalculator, normalizeTfIdfScores } from '../../../base/common/tfIdf.js'; +import { localize } from '../../../nls.js'; +import { ILocalizedString } from '../../action/common/action.js'; +import { ICommandService } from '../../commands/common/commands.js'; +import { IConfigurationChangeEvent, IConfigurationService } from '../../configuration/common/configuration.js'; +import { IDialogService } from '../../dialogs/common/dialogs.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import { ILogService } from '../../log/common/log.js'; +import { FastAndSlowPicks, IPickerQuickAccessItem, IPickerQuickAccessProviderOptions, PickerQuickAccessProvider, Picks } from './pickerQuickAccess.js'; +import { IQuickAccessProviderRunOptions } from '../common/quickAccess.js'; +import { IQuickPickSeparator } from '../common/quickInput.js'; +import { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; export interface ICommandQuickPick extends IPickerQuickAccessItem { readonly commandId: string; diff --git a/src/vs/platform/quickinput/browser/helpQuickAccess.ts b/src/vs/platform/quickinput/browser/helpQuickAccess.ts index 0346fc0b856..6cb51c86933 100644 --- a/src/vs/platform/quickinput/browser/helpQuickAccess.ts +++ b/src/vs/platform/quickinput/browser/helpQuickAccess.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { Extensions, IQuickAccessProvider, IQuickAccessProviderDescriptor, IQuickAccessRegistry } from 'vs/platform/quickinput/common/quickAccess'; -import { IQuickInputService, IQuickPick, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; +import { localize } from '../../../nls.js'; +import { Registry } from '../../registry/common/platform.js'; +import { DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { IKeybindingService } from '../../keybinding/common/keybinding.js'; +import { Extensions, IQuickAccessProvider, IQuickAccessProviderDescriptor, IQuickAccessRegistry } from '../common/quickAccess.js'; +import { IQuickInputService, IQuickPick, IQuickPickItem } from '../common/quickInput.js'; interface IHelpQuickAccessPickItem extends IQuickPickItem { readonly prefix: string; @@ -25,7 +25,7 @@ export class HelpQuickAccessProvider implements IQuickAccessProvider { @IKeybindingService private readonly keybindingService: IKeybindingService ) { } - provide(picker: IQuickPick): IDisposable { + provide(picker: IQuickPick): IDisposable { const disposables = new DisposableStore(); // Open a picker with the selected value if picked diff --git a/src/vs/platform/quickinput/browser/media/quickInput.css b/src/vs/platform/quickinput/browser/media/quickInput.css index d6b83ef6213..802e7e2fea2 100644 --- a/src/vs/platform/quickinput/browser/media/quickInput.css +++ b/src/vs/platform/quickinput/browser/media/quickInput.css @@ -53,7 +53,8 @@ .quick-input-titlebar { display: flex; align-items: center; - border-radius: inherit; + border-top-right-radius: 5px; + border-top-left-radius: 5px; } .quick-input-left-action-bar { @@ -62,6 +63,10 @@ flex: 1; } +.quick-input-inline-action-bar { + margin: 2px 0 0 5px; +} + .quick-input-title { padding: 3px 0px; text-align: center; @@ -209,7 +214,6 @@ box-sizing: border-box; overflow: hidden; display: flex; - height: 100%; padding: 0 6px; } @@ -332,7 +336,7 @@ .quick-input-list .quick-input-list-entry-action-bar .action-label.codicon { margin-right: 4px; - padding: 0px 2px 2px 2px; + padding: 2px; } .quick-input-list .quick-input-list-entry-action-bar { diff --git a/src/vs/platform/quickinput/browser/pickerQuickAccess.ts b/src/vs/platform/quickinput/browser/pickerQuickAccess.ts index 0613c557abc..b356304dab2 100644 --- a/src/vs/platform/quickinput/browser/pickerQuickAccess.ts +++ b/src/vs/platform/quickinput/browser/pickerQuickAccess.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { timeout } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Disposable, DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { IKeyMods, IQuickPickDidAcceptEvent, IQuickPickSeparator, IQuickPick, IQuickPickItem, IQuickInputButton } from 'vs/platform/quickinput/common/quickInput'; -import { IQuickAccessProvider, IQuickAccessProviderRunOptions } from 'vs/platform/quickinput/common/quickAccess'; -import { isFunction } from 'vs/base/common/types'; +import { timeout } from '../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { Disposable, DisposableStore, IDisposable, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { IKeyMods, IQuickPickDidAcceptEvent, IQuickPickSeparator, IQuickPick, IQuickPickItem, IQuickInputButton } from '../common/quickInput.js'; +import { IQuickAccessProvider, IQuickAccessProviderRunOptions } from '../common/quickAccess.js'; +import { isFunction } from '../../../base/common/types.js'; export enum TriggerAction { @@ -133,7 +133,7 @@ export abstract class PickerQuickAccessProvider, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable { + provide(picker: IQuickPick, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable { const disposables = new DisposableStore(); // Apply options if any diff --git a/src/vs/platform/quickinput/browser/quickAccess.ts b/src/vs/platform/quickinput/browser/quickAccess.ts index 7cccc352393..0ab3fd4614d 100644 --- a/src/vs/platform/quickinput/browser/quickAccess.ts +++ b/src/vs/platform/quickinput/browser/quickAccess.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DeferredPromise } from 'vs/base/common/async'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { DefaultQuickAccessFilterValue, Extensions, IQuickAccessController, IQuickAccessOptions, IQuickAccessProvider, IQuickAccessProviderDescriptor, IQuickAccessRegistry } from 'vs/platform/quickinput/common/quickAccess'; -import { IQuickInputService, IQuickPick, IQuickPickItem, ItemActivation } from 'vs/platform/quickinput/common/quickInput'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { DeferredPromise } from '../../../base/common/async.js'; +import { CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { DefaultQuickAccessFilterValue, Extensions, IQuickAccessController, IQuickAccessOptions, IQuickAccessProvider, IQuickAccessProviderDescriptor, IQuickAccessRegistry } from '../common/quickAccess.js'; +import { IQuickInputService, IQuickPick, IQuickPickItem, ItemActivation } from '../common/quickInput.js'; +import { Registry } from '../../registry/common/platform.js'; export class QuickAccessController extends Disposable implements IQuickAccessController { @@ -20,7 +20,7 @@ export class QuickAccessController extends Disposable implements IQuickAccessCon private readonly lastAcceptedPickerValues = new Map(); private visibleQuickAccess: { - readonly picker: IQuickPick; + readonly picker: IQuickPick; readonly descriptor: IQuickAccessProviderDescriptor | undefined; readonly value: string; } | undefined = undefined; @@ -99,7 +99,7 @@ export class QuickAccessController extends Disposable implements IQuickAccessCon // Create a picker for the provider to use with the initial value // and adjust the filtering to exclude the prefix from filtering const disposables = new DisposableStore(); - const picker = disposables.add(this.quickInputService.createQuickPick()); + const picker = disposables.add(this.quickInputService.createQuickPick({ useSeparators: true })); picker.value = value; this.adjustValueSelection(picker, descriptor, options); picker.placeholder = options?.placeholder ?? descriptor?.placeholder; @@ -163,7 +163,7 @@ export class QuickAccessController extends Disposable implements IQuickAccessCon } } - private adjustValueSelection(picker: IQuickPick, descriptor?: IQuickAccessProviderDescriptor, options?: IQuickAccessOptions): void { + private adjustValueSelection(picker: IQuickPick, descriptor?: IQuickAccessProviderDescriptor, options?: IQuickAccessOptions): void { let valueSelection: [number, number]; // Preserve: just always put the cursor at the end @@ -180,7 +180,7 @@ export class QuickAccessController extends Disposable implements IQuickAccessCon } private registerPickerListeners( - picker: IQuickPick, + picker: IQuickPick, provider: IQuickAccessProvider | undefined, descriptor: IQuickAccessProviderDescriptor | undefined, value: string, diff --git a/src/vs/platform/quickinput/browser/quickInput.ts b/src/vs/platform/quickinput/browser/quickInput.ts index 4c6dfbe6b7d..6d7096e85ea 100644 --- a/src/vs/platform/quickinput/browser/quickInput.ts +++ b/src/vs/platform/quickinput/browser/quickInput.ts @@ -3,37 +3,36 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { Button, IButtonStyles } from 'vs/base/browser/ui/button/button'; -import { CountBadge, ICountBadgeStyles } from 'vs/base/browser/ui/countBadge/countBadge'; -import { IHoverDelegate, IHoverDelegateOptions } from 'vs/base/browser/ui/hover/hoverDelegate'; -import { IInputBoxStyles } from 'vs/base/browser/ui/inputbox/inputBox'; -import { IKeybindingLabelStyles } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; -import { IListStyles } from 'vs/base/browser/ui/list/listWidget'; -import { IProgressBarStyles, ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar'; -import { IToggleStyles, Toggle } from 'vs/base/browser/ui/toggle/toggle'; -import { equals } from 'vs/base/common/arrays'; -import { TimeoutTimer } from 'vs/base/common/async'; -import { Codicon } from 'vs/base/common/codicons'; -import { Emitter, Event, EventBufferer } from 'vs/base/common/event'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { isIOS } from 'vs/base/common/platform'; -import Severity from 'vs/base/common/severity'; -import { ThemeIcon } from 'vs/base/common/themables'; -import 'vs/css!./media/quickInput'; -import { localize } from 'vs/nls'; -import { IInputBox, IKeyMods, IQuickInput, IQuickInputButton, IQuickInputHideEvent, IQuickInputToggle, IQuickNavigateConfiguration, IQuickPick, IQuickPickDidAcceptEvent, IQuickPickItem, IQuickPickItemButtonEvent, IQuickPickSeparator, IQuickPickSeparatorButtonEvent, IQuickPickWillAcceptEvent, IQuickWidget, ItemActivation, NO_KEY_MODS, QuickInputHideReason, QuickInputType } from 'vs/platform/quickinput/common/quickInput'; -import { QuickInputBox } from './quickInputBox'; -import { quickInputButtonToAction, renderQuickInputDescription } from './quickInputUtils'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IHoverService, WorkbenchHoverDelegate } from 'vs/platform/hover/browser/hover'; -import { QuickInputTree } from 'vs/platform/quickinput/browser/quickInputTree'; -import { QuickPickFocus } from '../common/quickInput'; -import type { IHoverOptions } from 'vs/base/browser/ui/hover/hover'; -import { ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; +import * as dom from '../../../base/browser/dom.js'; +import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { ActionBar } from '../../../base/browser/ui/actionbar/actionbar.js'; +import { Button, IButtonStyles } from '../../../base/browser/ui/button/button.js'; +import { CountBadge, ICountBadgeStyles } from '../../../base/browser/ui/countBadge/countBadge.js'; +import { IHoverDelegate, IHoverDelegateOptions } from '../../../base/browser/ui/hover/hoverDelegate.js'; +import { IInputBoxStyles } from '../../../base/browser/ui/inputbox/inputBox.js'; +import { IKeybindingLabelStyles } from '../../../base/browser/ui/keybindingLabel/keybindingLabel.js'; +import { IListStyles } from '../../../base/browser/ui/list/listWidget.js'; +import { IProgressBarStyles, ProgressBar } from '../../../base/browser/ui/progressbar/progressbar.js'; +import { IToggleStyles, Toggle } from '../../../base/browser/ui/toggle/toggle.js'; +import { equals } from '../../../base/common/arrays.js'; +import { TimeoutTimer } from '../../../base/common/async.js'; +import { Codicon } from '../../../base/common/codicons.js'; +import { Emitter, Event, EventBufferer } from '../../../base/common/event.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { isIOS } from '../../../base/common/platform.js'; +import Severity from '../../../base/common/severity.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import './media/quickInput.css'; +import { localize } from '../../../nls.js'; +import { IInputBox, IKeyMods, IQuickInput, IQuickInputButton, IQuickInputHideEvent, IQuickInputToggle, IQuickNavigateConfiguration, IQuickPick, IQuickPickDidAcceptEvent, IQuickPickItem, IQuickPickItemButtonEvent, IQuickPickSeparator, IQuickPickSeparatorButtonEvent, IQuickPickWillAcceptEvent, IQuickWidget, ItemActivation, NO_KEY_MODS, QuickInputButtonLocation, QuickInputHideReason, QuickInputType, QuickPickFocus } from '../common/quickInput.js'; +import { QuickInputBox } from './quickInputBox.js'; +import { quickInputButtonToAction, renderQuickInputDescription } from './quickInputUtils.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IHoverService, WorkbenchHoverDelegate } from '../../hover/browser/hover.js'; +import { QuickInputTree } from './quickInputTree.js'; +import type { IHoverOptions } from '../../../base/browser/ui/hover/hover.js'; +import { ContextKeyExpr, RawContextKey } from '../../contextkey/common/contextkey.js'; export const inQuickInputContextKeyValue = 'inQuickInput'; export const InQuickInputContextKey = new RawContextKey(inQuickInputContextKeyValue, false, localize('inQuickInput', "Whether keyboard focus is inside the quick input control")); @@ -100,6 +99,7 @@ export interface QuickInputUI { description2: HTMLElement; widget: HTMLElement; rightActionBar: ActionBar; + inlineActionBar: ActionBar; checkAll: HTMLInputElement; inputContainer: HTMLElement; filterContainer: HTMLElement; @@ -157,7 +157,9 @@ abstract class QuickInput extends Disposable implements IQuickInput { private _contextKey: string | undefined; private _busy = false; private _ignoreFocusOut = false; - private _buttons: IQuickInputButton[] = []; + private _leftButtons: IQuickInputButton[] = []; + private _rightButtons: IQuickInputButton[] = []; + private _inlineButtons: IQuickInputButton[] = []; private buttonsUpdated = false; private _toggles: IQuickInputToggle[] = []; private togglesUpdated = false; @@ -273,12 +275,24 @@ abstract class QuickInput extends Disposable implements IQuickInput { } } + protected get titleButtons() { + return this._leftButtons.length + ? [...this._leftButtons, this._rightButtons] + : this._rightButtons; + } + get buttons() { - return this._buttons; + return [ + ...this._leftButtons, + ...this._rightButtons, + ...this._inlineButtons + ]; } set buttons(buttons: IQuickInputButton[]) { - this._buttons = buttons; + this._leftButtons = buttons.filter(b => b === backButton); + this._rightButtons = buttons.filter(b => b !== backButton && b.location !== QuickInputButtonLocation.Inline); + this._inlineButtons = buttons.filter(b => b.location === QuickInputButtonLocation.Inline); this.buttonsUpdated = true; this.update(); } @@ -407,8 +421,7 @@ abstract class QuickInput extends Disposable implements IQuickInput { if (this.buttonsUpdated) { this.buttonsUpdated = false; this.ui.leftActionBar.clear(); - const leftButtons = this.buttons - .filter(button => button === backButton) + const leftButtons = this._leftButtons .map((button, index) => quickInputButtonToAction( button, `id-${index}`, @@ -416,14 +429,21 @@ abstract class QuickInput extends Disposable implements IQuickInput { )); this.ui.leftActionBar.push(leftButtons, { icon: true, label: false }); this.ui.rightActionBar.clear(); - const rightButtons = this.buttons - .filter(button => button !== backButton) + const rightButtons = this._rightButtons .map((button, index) => quickInputButtonToAction( button, `id-${index}`, async () => this.onDidTriggerButtonEmitter.fire(button) )); this.ui.rightActionBar.push(rightButtons, { icon: true, label: false }); + this.ui.inlineActionBar.clear(); + const inlineButtons = this._inlineButtons + .map((button, index) => quickInputButtonToAction( + button, + `id-${index}`, + async () => this.onDidTriggerButtonEmitter.fire(button) + )); + this.ui.inlineActionBar.push(inlineButtons, { icon: true, label: false }); } if (this.togglesUpdated) { this.togglesUpdated = false; @@ -507,7 +527,7 @@ abstract class QuickInput extends Disposable implements IQuickInput { } } -export class QuickPick extends QuickInput implements IQuickPick { +export class QuickPick extends QuickInput implements IQuickPick { private static readonly DEFAULT_ARIA_LABEL = localize('quickInputBox.ariaLabel', "Type to narrow down results."); @@ -518,7 +538,7 @@ export class QuickPick extends QuickInput implements I private readonly onWillAcceptEmitter = this._register(new Emitter()); private readonly onDidAcceptEmitter = this._register(new Emitter()); private readonly onDidCustomEmitter = this._register(new Emitter()); - private _items: Array = []; + private _items: O extends { useSeparators: true } ? Array : Array = []; private itemsUpdated = false; private _canSelectMany = false; private _canAcceptInBackground = false; @@ -625,7 +645,7 @@ export class QuickPick extends QuickInput implements I this.ui.list.scrollTop = scrollTop; } - set items(items: Array) { + set items(items: O extends { useSeparators: true } ? Array : Array) { this._items = items; this.itemsUpdated = true; this.update(); @@ -895,7 +915,7 @@ export class QuickPick extends QuickInput implements I } })); this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(checkedItems => { - if (!this.canSelectMany) { + if (!this.canSelectMany || !this.visible) { return; } if (this.selectedItemsToConfirm !== this._selectedItems && equals(checkedItems, this._selectedItems, (a, b) => a === b)) { @@ -986,7 +1006,7 @@ export class QuickPick extends QuickInput implements I const scrollTopBefore = this.keepScrollPosition ? this.scrollTop : 0; const hasDescription = !!this.description; const visibilities: Visibilities = { - title: !!this.title || !!this.step || !!this.buttons.length, + title: !!this.title || !!this.step || !!this.titleButtons.length, description: hasDescription, checkAll: this.canSelectMany && !this._hideCheckAll, checkBox: this.canSelectMany, @@ -1036,9 +1056,6 @@ export class QuickPick extends QuickInput implements I // We want focus to exist in the list if there are items so that space can be used to toggle this.ui.list.shouldLoop = !this.canSelectMany; this.ui.list.filter(this.filterValue(this.ui.inputBox.value)); - this.ui.checkAll.checked = this.ui.list.getAllVisibleChecked(); - this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()); - this.ui.count.setCount(this.ui.list.getCheckedCount()); switch (this._itemActivation) { case ItemActivation.NONE: this._itemActivation = ItemActivation.FIRST; // only valid once, then unset @@ -1216,7 +1233,7 @@ export class InputBox extends QuickInput implements IInputBox { this.ui.container.classList.remove('hidden-input'); const visibilities: Visibilities = { - title: !!this.title || !!this.step || !!this.buttons.length, + title: !!this.title || !!this.step || !!this.titleButtons.length, description: !!this.description || !!this.step, inputBox: true, message: true, @@ -1250,7 +1267,7 @@ export class QuickWidget extends QuickInput implements IQuickWidget { } const visibilities: Visibilities = { - title: !!this.title || !!this.step || !!this.buttons.length, + title: !!this.title || !!this.step || !!this.titleButtons.length, description: !!this.description || !!this.step }; diff --git a/src/vs/platform/quickinput/browser/quickInputActions.ts b/src/vs/platform/quickinput/browser/quickInputActions.ts index 5efaf793645..bf6ca7c731b 100644 --- a/src/vs/platform/quickinput/browser/quickInputActions.ts +++ b/src/vs/platform/quickinput/browser/quickInputActions.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { isMacintosh } from 'vs/base/common/platform'; -import { PartialExcept } from 'vs/base/common/types'; -import { localize } from 'vs/nls'; -import { ICommandHandler } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { InputFocusedContext } from 'vs/platform/contextkey/common/contextkeys'; -import { ICommandAndKeybindingRule, KeybindingWeight, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { endOfQuickInputBoxContext, inQuickInputContext, quickInputTypeContextKeyValue } from 'vs/platform/quickinput/browser/quickInput'; -import { IQuickInputService, IQuickPick, QuickInputType, QuickPickFocus } from 'vs/platform/quickinput/common/quickInput'; +import { KeyCode, KeyMod } from '../../../base/common/keyCodes.js'; +import { isMacintosh } from '../../../base/common/platform.js'; +import { PartialExcept } from '../../../base/common/types.js'; +import { localize } from '../../../nls.js'; +import { ICommandHandler } from '../../commands/common/commands.js'; +import { ContextKeyExpr } from '../../contextkey/common/contextkey.js'; +import { InputFocusedContext } from '../../contextkey/common/contextkeys.js'; +import { ICommandAndKeybindingRule, KeybindingWeight, KeybindingsRegistry } from '../../keybinding/common/keybindingsRegistry.js'; +import { endOfQuickInputBoxContext, inQuickInputContext, quickInputTypeContextKeyValue } from './quickInput.js'; +import { IQuickInputService, IQuickPick, QuickInputType, QuickPickFocus } from '../common/quickInput.js'; const defaultCommandAndKeybindingRule = { weight: KeybindingWeight.WorkbenchContrib, diff --git a/src/vs/platform/quickinput/browser/quickInputBox.ts b/src/vs/platform/quickinput/browser/quickInputBox.ts index 9ee1440a91a..e7868b89316 100644 --- a/src/vs/platform/quickinput/browser/quickInputBox.ts +++ b/src/vs/platform/quickinput/browser/quickInputBox.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { FindInput } from 'vs/base/browser/ui/findinput/findInput'; -import { IInputBoxStyles, IRange, MessageType } from 'vs/base/browser/ui/inputbox/inputBox'; -import { IToggleStyles, Toggle } from 'vs/base/browser/ui/toggle/toggle'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import Severity from 'vs/base/common/severity'; -import 'vs/css!./media/quickInput'; +import * as dom from '../../../base/browser/dom.js'; +import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js'; +import { FindInput } from '../../../base/browser/ui/findinput/findInput.js'; +import { IInputBoxStyles, IRange, MessageType } from '../../../base/browser/ui/inputbox/inputBox.js'; +import { IToggleStyles, Toggle } from '../../../base/browser/ui/toggle/toggle.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import Severity from '../../../base/common/severity.js'; +import './media/quickInput.css'; const $ = dom.$; diff --git a/src/vs/platform/quickinput/browser/quickInputController.ts b/src/vs/platform/quickinput/browser/quickInputController.ts index 5c8286031c9..5276e69c2a1 100644 --- a/src/vs/platform/quickinput/browser/quickInputController.ts +++ b/src/vs/platform/quickinput/browser/quickInputController.ts @@ -3,31 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems'; -import { Button } from 'vs/base/browser/ui/button/button'; -import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; -import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { Disposable, DisposableStore, dispose } from 'vs/base/common/lifecycle'; -import Severity from 'vs/base/common/severity'; -import { isString } from 'vs/base/common/types'; -import { localize } from 'vs/nls'; -import { IInputBox, IInputOptions, IKeyMods, IPickOptions, IQuickInput, IQuickInputButton, IQuickNavigateConfiguration, IQuickPick, IQuickPickItem, IQuickWidget, QuickInputHideReason, QuickPickInput } from 'vs/platform/quickinput/common/quickInput'; -import { QuickInputBox } from 'vs/platform/quickinput/browser/quickInputBox'; -import { QuickInputUI, Writeable, IQuickInputStyles, IQuickInputOptions, QuickPick, backButton, InputBox, Visibilities, QuickWidget, InQuickInputContextKey, QuickInputTypeContextKey, EndOfQuickInputBoxContextKey } from 'vs/platform/quickinput/browser/quickInput'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { mainWindow } from 'vs/base/browser/window'; -import { isDark } from 'vs/platform/theme/common/theme'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { QuickInputTree } from 'vs/platform/quickinput/browser/quickInputTree'; -import { QuickPickFocus } from '../common/quickInput'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import 'vs/platform/quickinput/browser/quickInputActions'; +import * as dom from '../../../base/browser/dom.js'; +import { ActionBar } from '../../../base/browser/ui/actionbar/actionbar.js'; +import { ActionViewItem } from '../../../base/browser/ui/actionbar/actionViewItems.js'; +import { Button } from '../../../base/browser/ui/button/button.js'; +import { CountBadge } from '../../../base/browser/ui/countBadge/countBadge.js'; +import { ProgressBar } from '../../../base/browser/ui/progressbar/progressbar.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { Disposable, DisposableStore, dispose } from '../../../base/common/lifecycle.js'; +import Severity from '../../../base/common/severity.js'; +import { isString } from '../../../base/common/types.js'; +import { localize } from '../../../nls.js'; +import { IInputBox, IInputOptions, IKeyMods, IPickOptions, IQuickInput, IQuickInputButton, IQuickNavigateConfiguration, IQuickPick, IQuickPickItem, IQuickWidget, QuickInputHideReason, QuickPickInput, QuickPickFocus } from '../common/quickInput.js'; +import { QuickInputBox } from './quickInputBox.js'; +import { QuickInputUI, Writeable, IQuickInputStyles, IQuickInputOptions, QuickPick, backButton, InputBox, Visibilities, QuickWidget, InQuickInputContextKey, QuickInputTypeContextKey, EndOfQuickInputBoxContextKey } from './quickInput.js'; +import { ILayoutService } from '../../layout/browser/layoutService.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { QuickInputTree } from './quickInputTree.js'; +import { IContextKeyService } from '../../contextkey/common/contextkey.js'; +import './quickInputActions.js'; +import { IThemeService } from '../../theme/common/themeService.js'; +import { isDark } from '../../theme/common/theme.js'; const $ = dom.$; @@ -160,6 +159,9 @@ export class QuickInputController extends Disposable { countContainer.setAttribute('aria-live', 'polite'); const count = new CountBadge(countContainer, { countFormat: localize({ key: 'quickInput.countSelected', comment: ['This tells the user how many items are selected in a list of items to select from. The items can be anything.'] }, "{0} Selected") }, this.styles.countBadge); + const inlineActionBar = this._register(new ActionBar(headerContainer, { hoverDelegate: this.options.hoverDelegate })); + inlineActionBar.domNode.classList.add('quick-input-inline-action-bar'); + const okContainer = dom.append(headerContainer, $('.quick-input-action')); const ok = this._register(new Button(okContainer, this.styles.button)); ok.label = localize('ok', "OK"); @@ -278,7 +280,7 @@ export class QuickInputController extends Disposable { } else { selectors.push('input[type=text]'); } - if (this.getUI().list.isDisplayed()) { + if (this.getUI().list.displayed) { selectors.push('.monaco-list'); } // focus links if there are any @@ -324,6 +326,7 @@ export class QuickInputController extends Disposable { description2, widget, rightActionBar, + inlineActionBar, checkAll, inputContainer, filterContainer, @@ -362,7 +365,7 @@ export class QuickInputController extends Disposable { } } - pick>(picks: Promise[]> | QuickPickInput[], options: O = {}, token: CancellationToken = CancellationToken.None): Promise<(O extends { canPickMany: true } ? T[] : T) | undefined> { + pick>(picks: Promise[]> | QuickPickInput[], options: IPickOptions = {}, token: CancellationToken = CancellationToken.None): Promise<(O extends { canPickMany: true } ? T[] : T) | undefined> { type R = (O extends { canPickMany: true } ? T[] : T) | undefined; return new Promise((doResolve, reject) => { let resolve = (result: R) => { @@ -374,7 +377,7 @@ export class QuickInputController extends Disposable { resolve(undefined); return; } - const input = this.createQuickPick(); + const input = this.createQuickPick({ useSeparators: true }); let activeItem: T | undefined; const disposables = [ input, @@ -438,6 +441,9 @@ export class QuickInputController extends Disposable { }), ]; input.title = options.title; + if (options.value) { + input.value = options.value; + } input.canSelectMany = !!options.canPickMany; input.placeholder = options.placeHolder; input.ignoreFocusOut = !!options.ignoreFocusLost; @@ -545,9 +551,11 @@ export class QuickInputController extends Disposable { backButton = backButton; - createQuickPick(): IQuickPick { + createQuickPick(options: { useSeparators: true }): IQuickPick; + createQuickPick(options?: { useSeparators: boolean }): IQuickPick; + createQuickPick(options: { useSeparators: boolean } = { useSeparators: false }): IQuickPick { const ui = this.getUI(true); - return new QuickPick(ui); + return new QuickPick(ui); } createInputBox(): IInputBox { @@ -574,6 +582,7 @@ export class QuickInputController extends Disposable { ui.description2.textContent = ''; dom.reset(ui.widget); ui.rightActionBar.clear(); + ui.inlineActionBar.clear(); ui.checkAll.checked = false; // ui.inputBox.value = ''; Avoid triggering an event. ui.inputBox.placeholder = ''; @@ -618,7 +627,7 @@ export class QuickInputController extends Disposable { ui.customButtonContainer.style.display = visibilities.customButton ? '' : 'none'; ui.message.style.display = visibilities.message ? '' : 'none'; ui.progressBar.getContainer().style.display = visibilities.progressBar ? '' : 'none'; - ui.list.display(!!visibilities.list); + ui.list.displayed = !!visibilities.list; ui.container.classList.toggle('show-checkboxes', !!visibilities.checkBox); ui.container.classList.toggle('hidden-input', !visibilities.inputBox && !visibilities.description); this.updateLayout(); // TODO @@ -687,7 +696,7 @@ export class QuickInputController extends Disposable { } navigate(next: boolean, quickNavigate?: IQuickNavigateConfiguration) { - if (this.isVisible() && this.getUI().list.isDisplayed()) { + if (this.isVisible() && this.getUI().list.displayed) { this.getUI().list.focus(next ? QuickPickFocus.Next : QuickPickFocus.Previous); if (quickNavigate && this.controller instanceof QuickPick) { this.controller.quickNavigate = quickNavigate; diff --git a/src/vs/platform/quickinput/browser/quickInputService.ts b/src/vs/platform/quickinput/browser/quickInputService.ts index 6cbdcdb4029..62042b674b0 100644 --- a/src/vs/platform/quickinput/browser/quickInputService.ts +++ b/src/vs/platform/quickinput/browser/quickInputService.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Color } from 'vs/base/common/color'; -import { Emitter } from 'vs/base/common/event'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { QuickAccessController } from 'vs/platform/quickinput/browser/quickAccess'; -import { IQuickAccessController } from 'vs/platform/quickinput/common/quickAccess'; -import { IInputBox, IInputOptions, IKeyMods, IPickOptions, IQuickInputButton, IQuickInputService, IQuickNavigateConfiguration, IQuickPick, IQuickPickItem, IQuickWidget, QuickPickInput } from 'vs/platform/quickinput/common/quickInput'; -import { defaultButtonStyles, defaultCountBadgeStyles, defaultInputBoxStyles, defaultKeybindingLabelStyles, defaultProgressBarStyles, defaultToggleStyles, getListStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { activeContrastBorder, asCssVariable, listFocusBackground, pickerGroupBorder, pickerGroupForeground, quickInputBackground, quickInputForeground, quickInputListFocusBackground, quickInputListFocusForeground, quickInputListFocusIconForeground, quickInputTitleBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry'; -import { IThemeService, Themable } from 'vs/platform/theme/common/themeService'; -import { IQuickInputOptions, IQuickInputStyles, QuickInputHoverDelegate } from './quickInput'; -import { QuickInputController, IQuickInputControllerHost } from 'vs/platform/quickinput/browser/quickInputController'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { getWindow } from 'vs/base/browser/dom'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter } from '../../../base/common/event.js'; +import { IContextKey, IContextKeyService, RawContextKey } from '../../contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { ILayoutService } from '../../layout/browser/layoutService.js'; +import { IOpenerService } from '../../opener/common/opener.js'; +import { QuickAccessController } from './quickAccess.js'; +import { IQuickAccessController } from '../common/quickAccess.js'; +import { IInputBox, IInputOptions, IKeyMods, IPickOptions, IQuickInputButton, IQuickInputService, IQuickNavigateConfiguration, IQuickPick, IQuickPickItem, IQuickWidget, QuickPickInput } from '../common/quickInput.js'; +import { defaultButtonStyles, defaultCountBadgeStyles, defaultInputBoxStyles, defaultKeybindingLabelStyles, defaultProgressBarStyles, defaultToggleStyles, getListStyles } from '../../theme/browser/defaultStyles.js'; +import { activeContrastBorder, asCssVariable, listFocusBackground, pickerGroupBorder, pickerGroupForeground, quickInputBackground, quickInputForeground, quickInputListFocusBackground, quickInputListFocusForeground, quickInputListFocusIconForeground, quickInputTitleBackground, widgetShadow } from '../../theme/common/colorRegistry.js'; +import { IThemeService, Themable } from '../../theme/common/themeService.js'; +import { IQuickInputOptions, IQuickInputStyles, QuickInputHoverDelegate } from './quickInput.js'; +import { QuickInputController, IQuickInputControllerHost } from './quickInputController.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { getWindow } from '../../../base/browser/dom.js'; +import { Color } from '../../../base/common/color.js'; export class QuickInputService extends Themable implements IQuickInputService { @@ -150,7 +150,7 @@ export class QuickInputService extends Themable implements IQuickInputService { }); } - pick>(picks: Promise[]> | QuickPickInput[], options: O = {}, token: CancellationToken = CancellationToken.None): Promise<(O extends { canPickMany: true } ? T[] : T) | undefined> { + pick>(picks: Promise[]> | QuickPickInput[], options?: O, token: CancellationToken = CancellationToken.None): Promise<(O extends { canPickMany: true } ? T[] : T) | undefined> { return this.controller.pick(picks, options, token); } @@ -158,8 +158,10 @@ export class QuickInputService extends Themable implements IQuickInputService { return this.controller.input(options, token); } - createQuickPick(): IQuickPick { - return this.controller.createQuickPick(); + createQuickPick(options: { useSeparators: true }): IQuickPick; + createQuickPick(options?: { useSeparators: boolean }): IQuickPick; + createQuickPick(options: { useSeparators: boolean } = { useSeparators: false }): IQuickPick { + return this.controller.createQuickPick(options); } createInputBox(): IInputBox { diff --git a/src/vs/platform/quickinput/browser/quickInputTree.ts b/src/vs/platform/quickinput/browser/quickInputTree.ts index c65ad7ef4d7..a4641a71831 100644 --- a/src/vs/platform/quickinput/browser/quickInputTree.ts +++ b/src/vs/platform/quickinput/browser/quickInputTree.ts @@ -3,42 +3,43 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { Emitter, Event, IValueWithChangeEvent } from 'vs/base/common/event'; -import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate'; -import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; -import { IObjectTreeElement, ITreeNode, ITreeRenderer } from 'vs/base/browser/ui/tree/tree'; -import { localize } from 'vs/nls'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { WorkbenchObjectTree } from 'vs/platform/list/browser/listService'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { IQuickPickItem, IQuickPickItemButtonEvent, IQuickPickSeparator, IQuickPickSeparatorButtonEvent, QuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { IMatch } from 'vs/base/common/filters'; -import { IListAccessibilityProvider, IListStyles } from 'vs/base/browser/ui/list/listWidget'; -import { AriaRole } from 'vs/base/browser/ui/aria/aria'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { OS } from 'vs/base/common/platform'; -import { memoize } from 'vs/base/common/decorators'; -import { IIconLabelValueOptions, IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel'; -import { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { isDark } from 'vs/platform/theme/common/theme'; -import { URI } from 'vs/base/common/uri'; -import { quickInputButtonToAction } from 'vs/platform/quickinput/browser/quickInputUtils'; -import { Lazy } from 'vs/base/common/lazy'; -import { IParsedLabelWithIcons, getCodiconAriaLabel, matchesFuzzyIconAware, parseLabelWithIcons } from 'vs/base/common/iconLabels'; -import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget'; -import { compareAnything } from 'vs/base/common/comparers'; -import { ltrim } from 'vs/base/common/strings'; -import { RenderIndentGuides } from 'vs/base/browser/ui/tree/abstractTree'; -import { ThrottledDelayer } from 'vs/base/common/async'; -import { isCancellationError } from 'vs/base/common/errors'; -import type { IHoverWidget, IManagedHoverTooltipMarkdownString } from 'vs/base/browser/ui/hover/hover'; -import { QuickPickFocus } from '../common/quickInput'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; +import * as dom from '../../../base/browser/dom.js'; +import { Emitter, Event, EventBufferer, IValueWithChangeEvent } from '../../../base/common/event.js'; +import { IHoverDelegate } from '../../../base/browser/ui/hover/hoverDelegate.js'; +import { IListVirtualDelegate } from '../../../base/browser/ui/list/list.js'; +import { IObjectTreeElement, ITreeNode, ITreeRenderer, TreeVisibility } from '../../../base/browser/ui/tree/tree.js'; +import { localize } from '../../../nls.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { WorkbenchObjectTree } from '../../list/browser/listService.js'; +import { IThemeService } from '../../theme/common/themeService.js'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { IQuickPickItem, IQuickPickItemButtonEvent, IQuickPickSeparator, IQuickPickSeparatorButtonEvent, QuickPickItem, QuickPickFocus } from '../common/quickInput.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { IMatch } from '../../../base/common/filters.js'; +import { IListAccessibilityProvider, IListStyles } from '../../../base/browser/ui/list/listWidget.js'; +import { AriaRole } from '../../../base/browser/ui/aria/aria.js'; +import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { OS } from '../../../base/common/platform.js'; +import { memoize } from '../../../base/common/decorators.js'; +import { IIconLabelValueOptions, IconLabel } from '../../../base/browser/ui/iconLabel/iconLabel.js'; +import { KeybindingLabel } from '../../../base/browser/ui/keybindingLabel/keybindingLabel.js'; +import { ActionBar } from '../../../base/browser/ui/actionbar/actionbar.js'; +import { isDark } from '../../theme/common/theme.js'; +import { URI } from '../../../base/common/uri.js'; +import { quickInputButtonToAction } from './quickInputUtils.js'; +import { Lazy } from '../../../base/common/lazy.js'; +import { IParsedLabelWithIcons, getCodiconAriaLabel, matchesFuzzyIconAware, parseLabelWithIcons } from '../../../base/common/iconLabels.js'; +import { HoverPosition } from '../../../base/browser/ui/hover/hoverWidget.js'; +import { compareAnything } from '../../../base/common/comparers.js'; +import { ltrim } from '../../../base/common/strings.js'; +import { RenderIndentGuides } from '../../../base/browser/ui/tree/abstractTree.js'; +import { ThrottledDelayer } from '../../../base/common/async.js'; +import { isCancellationError } from '../../../base/common/errors.js'; +import type { IHoverWidget, IManagedHoverTooltipMarkdownString } from '../../../base/browser/ui/hover/hover.js'; +import { IAccessibilityService } from '../../accessibility/common/accessibility.js'; +import { observableValue, observableValueOpts, transaction } from '../../../base/common/observable.js'; +import { equals } from '../../../base/common/arrays.js'; const $ = dom.$; @@ -552,6 +553,12 @@ class QuickPickSeparatorElementRenderer extends BaseQuickInputListRenderer, index: number, data: IQuickInputItemTemplateData): void { const element = node.element; data.element = element; @@ -656,6 +663,8 @@ class QuickPickSeparatorElementRenderer extends BaseQuickInputListRenderer(); /** * Event that is fired when the tree receives a keydown. @@ -668,17 +677,17 @@ export class QuickInputTree extends Disposable { */ readonly onLeave: Event = this._onLeave.event; - private readonly _onChangedAllVisibleChecked = new Emitter(); - onChangedAllVisibleChecked: Event = this._onChangedAllVisibleChecked.event; + private readonly _visibleCountObservable = observableValue('VisibleCount', 0); + onChangedVisibleCount: Event = Event.fromObservable(this._visibleCountObservable, this._store); - private readonly _onChangedCheckedCount = new Emitter(); - onChangedCheckedCount: Event = this._onChangedCheckedCount.event; + private readonly _allVisibleCheckedObservable = observableValue('AllVisibleChecked', false); + onChangedAllVisibleChecked: Event = Event.fromObservable(this._allVisibleCheckedObservable, this._store); - private readonly _onChangedVisibleCount = new Emitter(); - onChangedVisibleCount: Event = this._onChangedVisibleCount.event; + private readonly _checkedCountObservable = observableValue('CheckedCount', 0); + onChangedCheckedCount: Event = Event.fromObservable(this._checkedCountObservable, this._store); - private readonly _onChangedCheckedElements = new Emitter(); - onChangedCheckedElements: Event = this._onChangedCheckedElements.event; + private readonly _checkedElementsObservable = observableValueOpts({ equalsFn: equals }, new Array()); + onChangedCheckedElements: Event = Event.fromObservable(this._checkedElementsObservable, this._store); private readonly _onButtonTriggered = new Emitter>(); onButtonTriggered = this._onButtonTriggered.event; @@ -686,21 +695,24 @@ export class QuickInputTree extends Disposable { private readonly _onSeparatorButtonTriggered = new Emitter(); onSeparatorButtonTriggered = this._onSeparatorButtonTriggered.event; + private readonly _elementChecked = new Emitter<{ element: IQuickPickElement; checked: boolean }>(); + private readonly _elementCheckedEventBufferer = new EventBufferer(); + + //#endregion + + private _hasCheckboxes = false; + private readonly _container: HTMLElement; private readonly _tree: WorkbenchObjectTree; private readonly _separatorRenderer: QuickPickSeparatorElementRenderer; private readonly _itemRenderer: QuickPickItemElementRenderer; - private readonly _elementChecked = new Emitter<{ element: IQuickPickElement; checked: boolean }>(); private _inputElements = new Array(); private _elementTree = new Array(); private _itemElements = new Array(); // Elements that apply to the current set of elements private readonly _elementDisposable = this._register(new DisposableStore()); private _lastHover: IHoverWidget | undefined; - // This is used to prevent setting the checked state of a single element from firing the checked events - // so that we can batch them together. This can probably be improved by handling events differently, - // but this works for now. An observable would probably be ideal for this. - private _shouldFireCheckedEvents = true; + private _lastQueryString: string | undefined; constructor( private parent: HTMLElement, @@ -721,6 +733,24 @@ export class QuickInputTree extends Disposable { new QuickInputItemDelegate(), [this._itemRenderer, this._separatorRenderer], { + filter: { + filter(element) { + return element.hidden + ? TreeVisibility.Hidden + : element instanceof QuickPickSeparatorElement + ? TreeVisibility.Recurse + : TreeVisibility.Visible; + }, + }, + sorter: { + compare: (element, otherElement) => { + if (!this.sortByLabel || !this._lastQueryString) { + return 0; + } + const normalizedSearchValue = this._lastQueryString.toLowerCase(); + return compareEntries(element, otherElement, normalizedSearchValue); + }, + }, accessibilityProvider: new QuickInputAccessibilityProvider(), setRowLineHeight: false, multipleSelectionSupport: false, @@ -743,7 +773,8 @@ export class QuickInputTree extends Disposable { get onDidChangeFocus() { return Event.map( this._tree.onDidChangeFocus, - e => e.elements.filter((e): e is QuickPickItemElement => e instanceof QuickPickItemElement).map(e => e.item) + e => e.elements.filter((e): e is QuickPickItemElement => e instanceof QuickPickItemElement).map(e => e.item), + this._store ); } @@ -754,10 +785,19 @@ export class QuickInputTree extends Disposable { e => ({ items: e.elements.filter((e): e is QuickPickItemElement => e instanceof QuickPickItemElement).map(e => e.item), event: e.browserEvent - }) + }), + this._store ); } + get displayed() { + return this._container.style.display !== 'none'; + } + + set displayed(value: boolean) { + this._container.style.display = value ? '' : 'none'; + } + get scrollTop() { return this._tree.scrollTop; } @@ -842,6 +882,7 @@ export class QuickInputTree extends Disposable { this._registerOnKeyDown(); this._registerOnContainerClick(); this._registerOnMouseMiddleClick(); + this._registerOnTreeModelChanged(); this._registerOnElementChecked(); this._registerOnContextMenu(); this._registerHoverListeners(); @@ -879,8 +920,19 @@ export class QuickInputTree extends Disposable { })); } + private _registerOnTreeModelChanged() { + this._register(this._tree.onDidChangeModel(() => { + const visibleCount = this._itemElements.filter(e => !e.hidden).length; + this._visibleCountObservable.set(visibleCount, undefined); + if (this._hasCheckboxes) { + this._updateCheckedObservables(); + } + })); + } + private _registerOnElementChecked() { - this._register(this._elementChecked.event(_ => this._fireCheckedEvents())); + // Only fire the last event when buffered + this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event, (_, e) => e)(_ => this._updateCheckedObservables())); } private _registerOnContextMenu() { @@ -1015,37 +1067,22 @@ export class QuickInputTree extends Disposable { //#region public methods - getAllVisibleChecked() { - return this._allVisibleChecked(this._itemElements, false); - } - - getCheckedCount() { - return this._itemElements.filter(element => element.checked).length; - } - - getVisibleCount() { - return this._itemElements.filter(e => !e.hidden).length; - } - setAllVisibleChecked(checked: boolean) { - try { - this._shouldFireCheckedEvents = false; + this._elementCheckedEventBufferer.bufferEvents(() => { this._itemElements.forEach(element => { if (!element.hidden && !element.checkboxDisabled) { - // Would fire an event if we didn't have the flag set + // Would fire an event if we didn't beffer the events element.checked = checked; } }); - } finally { - this._shouldFireCheckedEvents = true; - this._fireCheckedEvents(); - } + }); } setElements(inputElements: QuickPickItem[]): void { this._elementDisposable.clear(); + this._lastQueryString = undefined; this._inputElements = inputElements; - const hasCheckbox = this.parent.classList.contains('show-checkboxes'); + this._hasCheckboxes = this.parent.classList.contains('show-checkboxes'); let currentSeparatorElement: QuickPickSeparatorElement | undefined; this._itemElements = new Array(); this._elementTree = inputElements.reduce((result, item, index) => { @@ -1057,7 +1094,7 @@ export class QuickInputTree extends Disposable { } currentSeparatorElement = new QuickPickSeparatorElement( index, - (event: IQuickPickSeparatorButtonEvent) => this.fireSeparatorButtonTriggered(event), + e => this._onSeparatorButtonTriggered.fire(e), item ); element = currentSeparatorElement; @@ -1071,8 +1108,8 @@ export class QuickInputTree extends Disposable { } const qpi = new QuickPickItemElement( index, - hasCheckbox, - (event: IQuickPickItemButtonEvent) => this.fireButtonTriggered(event), + this._hasCheckboxes, + e => this._onButtonTriggered.fire(e), this._elementChecked, item, separator, @@ -1090,32 +1127,7 @@ export class QuickInputTree extends Disposable { return result; }, new Array()); - const elements = new Array>(); - let visibleCount = 0; - for (const element of this._elementTree) { - if (element instanceof QuickPickSeparatorElement) { - elements.push({ - element, - collapsible: false, - collapsed: false, - children: element.children.map(e => ({ - element: e, - collapsible: false, - collapsed: false, - })), - }); - visibleCount += element.children.length + 1; // +1 for the separator itself; - } else { - elements.push({ - element, - collapsible: false, - collapsed: false, - }); - visibleCount++; - } - } - this._tree.setChildren(null, elements); - this._onChangedVisibleCount.fire(visibleCount); + this._setElementsToTree(this._elementTree); // Accessibility hack, unfortunately on next tick // https://github.com/microsoft/vscode/issues/211976 @@ -1132,20 +1144,10 @@ export class QuickInputTree extends Disposable { } } - getElementsCount(): number { - return this._inputElements.length; - } - - getFocusedElements() { - return this._tree.getFocus() - .filter((e): e is IQuickPickElement => !!e) - .map(e => e.item) - .filter((e): e is IQuickPickItem => !!e); - } - setFocusedElements(items: IQuickPickItem[]) { const elements = items.map(item => this._itemElements.find(e => e.item === item)) - .filter((e): e is QuickPickItemElement => !!e); + .filter((e): e is QuickPickItemElement => !!e) + .filter(e => !e.hidden); this._tree.setFocus(elements); if (items.length > 0) { const focused = this._tree.getFocus()[0]; @@ -1159,12 +1161,6 @@ export class QuickInputTree extends Disposable { return this._tree.getHTMLElement().getAttribute('aria-activedescendant'); } - getSelectedElements() { - return this._tree.getSelection() - .filter((e): e is IQuickPickElement => !!e && !!(e as QuickPickItemElement).item) - .map(e => e.item); - } - setSelectedElements(items: IQuickPickItem[]) { const elements = items.map(item => this._itemElements.find(e => e.item === item)) .filter((e): e is QuickPickItemElement => !!e); @@ -1177,20 +1173,16 @@ export class QuickInputTree extends Disposable { } setCheckedElements(items: IQuickPickItem[]) { - try { - this._shouldFireCheckedEvents = false; + this._elementCheckedEventBufferer.bufferEvents(() => { const checked = new Set(); for (const item of items) { checked.add(item); } for (const element of this._itemElements) { - // Would fire an event if we didn't have the flag set + // Would fire an event if we didn't beffer the events element.checked = checked.has(element.item); } - } finally { - this._shouldFireCheckedEvents = true; - this._fireCheckedEvents(); - } + }); } focus(what: QuickPickFocus): void { @@ -1207,13 +1199,24 @@ export class QuickInputTree extends Disposable { this._tree.scrollTop = 0; this._tree.focusFirst(undefined, (e) => e.element instanceof QuickPickItemElement); break; - case QuickPickFocus.Second: + case QuickPickFocus.Second: { this._tree.scrollTop = 0; - this._tree.setFocus([this._itemElements[1]]); + let isSecondItem = false; + this._tree.focusFirst(undefined, (e) => { + if (!(e.element instanceof QuickPickItemElement)) { + return false; + } + if (isSecondItem) { + return true; + } + isSecondItem = !isSecondItem; + return false; + }); break; + } case QuickPickFocus.Last: this._tree.scrollTop = this._tree.scrollHeight; - this._tree.setFocus([this._itemElements[this._itemElements.length - 1]]); + this._tree.focusLast(undefined, (e) => e.element instanceof QuickPickItemElement); break; case QuickPickFocus.Next: { const prevFocus = this._tree.getFocus(); @@ -1315,7 +1318,7 @@ export class QuickInputTree extends Disposable { // If we didn't move, then we should just move to the end // of the list. this._tree.scrollTop = this._tree.scrollHeight; - this._tree.setFocus([this._itemElements[this._itemElements.length - 1]]); + this._tree.focusLast(undefined, (e) => e.element instanceof QuickPickItemElement); } break; } @@ -1385,6 +1388,7 @@ export class QuickInputTree extends Disposable { } filter(query: string): boolean { + this._lastQueryString = query; if (!(this._sortByLabel || this._matchOnLabel || this._matchOnDescription || this._matchOnDetail)) { this._tree.layout(); return false; @@ -1410,7 +1414,7 @@ export class QuickInputTree extends Disposable { // Filter by value (since we support icons in labels, use $(..) aware fuzzy matching) else { let currentSeparator: IQuickPickSeparator | undefined; - this._elementTree.forEach(element => { + this._itemElements.forEach(element => { let labelHighlights: IMatch[] | undefined; if (this.matchOnLabelMode === 'fuzzy') { labelHighlights = this.matchOnLabel ? matchesFuzzyIconAware(query, parseLabelWithIcons(element.saneLabel)) ?? undefined : undefined; @@ -1441,8 +1445,10 @@ export class QuickInputTree extends Disposable { // we can show the separator unless the list gets sorted by match if (!this.sortByLabel) { - const previous = element.index && this._inputElements[element.index - 1]; - currentSeparator = previous && previous.type === 'separator' ? previous : currentSeparator; + const previous = element.index && this._inputElements[element.index - 1] || undefined; + if (previous?.type === 'separator' && !previous.buttons) { + currentSeparator = previous; + } if (currentSeparator && !element.hidden) { element.separator = currentSeparator; currentSeparator = undefined; @@ -1451,65 +1457,18 @@ export class QuickInputTree extends Disposable { }); } - const shownElements = this._elementTree.filter(element => !element.hidden); - - // Sort by value - if (this.sortByLabel && query) { - const normalizedSearchValue = query.toLowerCase(); - shownElements.sort((a, b) => { - return compareEntries(a, b, normalizedSearchValue); - }); - } - - let currentSeparator: QuickPickSeparatorElement | undefined; - const finalElements = shownElements.reduce((result, element, index) => { - if (element instanceof QuickPickItemElement) { - if (currentSeparator) { - currentSeparator.children.push(element); - } else { - result.push(element); - } - } else if (element instanceof QuickPickSeparatorElement) { - element.children = []; - currentSeparator = element; - result.push(element); - } - return result; - }, new Array()); - - const elements = new Array>(); - for (const element of finalElements) { - if (element instanceof QuickPickSeparatorElement) { - elements.push({ - element, - collapsible: false, - collapsed: false, - children: element.children.map(e => ({ - element: e, - collapsible: false, - collapsed: false, - })), - }); - } else { - elements.push({ - element, - collapsible: false, - collapsed: false, - }); - } - } - this._tree.setChildren(null, elements); + this._setElementsToTree(this._sortByLabel && query + // We don't render any separators if we're sorting so just render the elements + ? this._itemElements + // Render the full tree + : this._elementTree + ); this._tree.layout(); - - this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()); - this._onChangedVisibleCount.fire(shownElements.length); - return true; } toggleCheckbox() { - try { - this._shouldFireCheckedEvents = false; + this._elementCheckedEventBufferer.bufferEvents(() => { const elements = this._tree.getFocus().filter((e): e is QuickPickItemElement => e instanceof QuickPickItemElement); const allChecked = this._allVisibleChecked(elements); for (const element of elements) { @@ -1518,18 +1477,7 @@ export class QuickInputTree extends Disposable { element.checked = !allChecked; } } - } finally { - this._shouldFireCheckedEvents = true; - this._fireCheckedEvents(); - } - } - - display(display: boolean) { - this._container.style.display = display ? '' : 'none'; - } - - isDisplayed() { - return this._container.style.display !== 'none'; + }); } style(styles: IListStyles) { @@ -1566,6 +1514,31 @@ export class QuickInputTree extends Disposable { //#region private methods + private _setElementsToTree(elements: IQuickPickElement[]) { + const treeElements = new Array>(); + for (const element of elements) { + if (element instanceof QuickPickSeparatorElement) { + treeElements.push({ + element, + collapsible: false, + collapsed: false, + children: element.children.map(e => ({ + element: e, + collapsible: false, + collapsed: false, + })), + }); + } else { + treeElements.push({ + element, + collapsible: false, + collapsed: false, + }); + } + } + this._tree.setChildren(null, treeElements); + } + private _allVisibleChecked(elements: QuickPickItemElement[], whenNoneVisible = true) { for (let i = 0, n = elements.length; i < n; i++) { const element = elements[i]; @@ -1580,21 +1553,13 @@ export class QuickInputTree extends Disposable { return whenNoneVisible; } - private _fireCheckedEvents() { - if (!this._shouldFireCheckedEvents) { - return; - } - this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()); - this._onChangedCheckedCount.fire(this.getCheckedCount()); - this._onChangedCheckedElements.fire(this.getCheckedElements()); - } - - private fireButtonTriggered(event: IQuickPickItemButtonEvent) { - this._onButtonTriggered.fire(event); - } - - private fireSeparatorButtonTriggered(event: IQuickPickSeparatorButtonEvent) { - this._onSeparatorButtonTriggered.fire(event); + private _updateCheckedObservables() { + transaction((tx) => { + this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements, false), tx); + const checkedCount = this._itemElements.filter(element => element.checked).length; + this._checkedCountObservable.set(checkedCount, tx); + this._checkedElementsObservable.set(this.getCheckedElements(), tx); + }); } /** diff --git a/src/vs/platform/quickinput/browser/quickInputUtils.ts b/src/vs/platform/quickinput/browser/quickInputUtils.ts index cfa7e231a23..cbb78a52873 100644 --- a/src/vs/platform/quickinput/browser/quickInputUtils.ts +++ b/src/vs/platform/quickinput/browser/quickInputUtils.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { DomEmitter } from 'vs/base/browser/event'; -import { Event } from 'vs/base/common/event'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { Gesture, EventType as GestureEventType } from 'vs/base/browser/touch'; -import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels'; -import { IdGenerator } from 'vs/base/common/idGenerator'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { parseLinkedText } from 'vs/base/common/linkedText'; -import { URI } from 'vs/base/common/uri'; -import 'vs/css!./media/quickInput'; -import { localize } from 'vs/nls'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IQuickInputButton } from 'vs/platform/quickinput/common/quickInput'; -import { IAction } from 'vs/base/common/actions'; +import * as dom from '../../../base/browser/dom.js'; +import { DomEmitter } from '../../../base/browser/event.js'; +import { Event } from '../../../base/common/event.js'; +import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { Gesture, EventType as GestureEventType } from '../../../base/browser/touch.js'; +import { renderLabelWithIcons } from '../../../base/browser/ui/iconLabel/iconLabels.js'; +import { IdGenerator } from '../../../base/common/idGenerator.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { parseLinkedText } from '../../../base/common/linkedText.js'; +import { URI } from '../../../base/common/uri.js'; +import './media/quickInput.css'; +import { localize } from '../../../nls.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { IQuickInputButton } from '../common/quickInput.js'; +import { IAction } from '../../../base/common/actions.js'; const iconPathToClass: Record = {}; const iconClassGenerator = new IdGenerator('quick-input-button-icon-'); diff --git a/src/vs/platform/quickinput/browser/quickPickPin.ts b/src/vs/platform/quickinput/browser/quickPickPin.ts index 51c8b25d467..e7c2cb9adbc 100644 --- a/src/vs/platform/quickinput/browser/quickPickPin.ts +++ b/src/vs/platform/quickinput/browser/quickPickPin.ts @@ -3,11 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Codicon } from 'vs/base/common/codicons'; -import { localize } from 'vs/nls'; -import { IQuickPick, IQuickPickItem, QuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { ThemeIcon } from 'vs/base/common/themables'; +import { Codicon } from '../../../base/common/codicons.js'; +import { localize } from '../../../nls.js'; +import { IQuickPick, IQuickPickItem, QuickPickItem } from '../common/quickInput.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; const pinButtonClass = ThemeIcon.asClassName(Codicon.pin); const pinnedButtonClass = ThemeIcon.asClassName(Codicon.pinned); @@ -18,30 +19,32 @@ const buttonClasses = [pinButtonClass, pinnedButtonClass]; * be removed if @param filterDupliates has been provided. Pin and pinned button events trigger updates to the underlying storage. * Shows the quickpick once formatted. */ -export async function showWithPinnedItems(storageService: IStorageService, storageKey: string, quickPick: IQuickPick, filterDuplicates?: boolean): Promise { +export function showWithPinnedItems(storageService: IStorageService, storageKey: string, quickPick: IQuickPick, filterDuplicates?: boolean): IDisposable { const itemsWithoutPinned = quickPick.items; let itemsWithPinned = _formatPinnedItems(storageKey, quickPick, storageService, undefined, filterDuplicates); - quickPick.onDidTriggerItemButton(async buttonEvent => { + const disposables = new DisposableStore(); + disposables.add(quickPick.onDidTriggerItemButton(async buttonEvent => { const expectedButton = buttonEvent.button.iconClass && buttonClasses.includes(buttonEvent.button.iconClass); if (expectedButton) { quickPick.items = itemsWithoutPinned; itemsWithPinned = _formatPinnedItems(storageKey, quickPick, storageService, buttonEvent.item, filterDuplicates); quickPick.items = quickPick.value ? itemsWithoutPinned : itemsWithPinned; } - }); - quickPick.onDidChangeValue(async value => { + })); + disposables.add(quickPick.onDidChangeValue(async value => { if (quickPick.items === itemsWithPinned && value) { quickPick.items = itemsWithoutPinned; } else if (quickPick.items === itemsWithoutPinned && !value) { quickPick.items = itemsWithPinned; } - }); + })); quickPick.items = quickPick.value ? itemsWithoutPinned : itemsWithPinned; quickPick.show(); + return disposables; } -function _formatPinnedItems(storageKey: string, quickPick: IQuickPick, storageService: IStorageService, changedItem?: IQuickPickItem, filterDuplicates?: boolean): QuickPickItem[] { +function _formatPinnedItems(storageKey: string, quickPick: IQuickPick, storageService: IStorageService, changedItem?: IQuickPickItem, filterDuplicates?: boolean): QuickPickItem[] { const formattedItems: QuickPickItem[] = []; let pinnedItems; if (changedItem) { diff --git a/src/vs/platform/quickinput/common/quickAccess.ts b/src/vs/platform/quickinput/common/quickAccess.ts index 12b7afa785e..ad4a674c5df 100644 --- a/src/vs/platform/quickinput/common/quickAccess.ts +++ b/src/vs/platform/quickinput/common/quickAccess.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce } from 'vs/base/common/arrays'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ItemActivation, IQuickNavigateConfiguration, IQuickPick, IQuickPickItem, QuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { coalesce } from '../../../base/common/arrays.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { ItemActivation, IQuickNavigateConfiguration, IQuickPick, IQuickPickItem, QuickPickItem } from './quickInput.js'; +import { Registry } from '../../registry/common/platform.js'; /** * Provider specific options for this particular showing of the @@ -129,7 +129,7 @@ export interface IQuickAccessProvider { * @return a disposable that will automatically be disposed when the picker * closes or is replaced by another picker. */ - provide(picker: IQuickPick, token: CancellationToken, options?: IQuickAccessProviderRunOptions): IDisposable; + provide(picker: IQuickPick, token: CancellationToken, options?: IQuickAccessProviderRunOptions): IDisposable; } export interface IQuickAccessProviderHelp { diff --git a/src/vs/platform/quickinput/common/quickInput.ts b/src/vs/platform/quickinput/common/quickInput.ts index f893e58fbe6..8f2e1c0ac9b 100644 --- a/src/vs/platform/quickinput/common/quickInput.ts +++ b/src/vs/platform/quickinput/common/quickInput.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IQuickAccessController } from 'vs/platform/quickinput/common/quickAccess'; -import { IMatch } from 'vs/base/common/filters'; -import { IItemAccessor } from 'vs/base/common/fuzzyScorer'; -import { ResolvedKeybinding } from 'vs/base/common/keybindings'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import Severity from 'vs/base/common/severity'; -import { URI } from 'vs/base/common/uri'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IQuickAccessController } from './quickAccess.js'; +import { IMatch } from '../../../base/common/filters.js'; +import { IItemAccessor } from '../../../base/common/fuzzyScorer.js'; +import { ResolvedKeybinding } from '../../../base/common/keybindings.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import Severity from '../../../base/common/severity.js'; +import { URI } from '../../../base/common/uri.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; export interface IQuickPickItemHighlights { label?: IMatch[]; @@ -81,6 +81,11 @@ export interface IPickOptions { */ title?: string; + /** + * the value to prefill in the input box + */ + value?: string; + /** * an optional string to show as placeholder in the input box to guide the user what she picks on */ @@ -418,7 +423,7 @@ export enum QuickPickFocus { /** * Represents a quick pick control that allows the user to select an item from a list of options. */ -export interface IQuickPick extends IQuickInput { +export interface IQuickPick extends IQuickInput { /** * The type of the quick input. @@ -505,7 +510,7 @@ export interface IQuickPick extends IQuickInput { /** * The items to be displayed in the quick pick. */ - items: ReadonlyArray; + items: O extends { useSeparators: true } ? ReadonlyArray : ReadonlyArray; /** * Whether multiple items can be selected. If so, checkboxes will be rendered. @@ -705,6 +710,18 @@ export interface IInputBox extends IQuickInput { severity: Severity; } +export enum QuickInputButtonLocation { + /** + * In the title bar. + */ + Title = 1, + + /** + * To the right of the input box. + */ + Inline = 2 +} + /** * Represents a button in the quick input UI. */ @@ -728,6 +745,11 @@ export interface IQuickInputButton { * By default, buttons are only visible when hovering over them with the mouse. */ alwaysVisible?: boolean; + /** + * Where the button should be rendered. The default is {@link QuickInputButtonLocation.Title}. + * @note This property is ignored if the button was added to a QuickPickItem. + */ + location?: QuickInputButtonLocation; } /** @@ -854,7 +876,8 @@ export interface IQuickInputService { /** * Provides raw access to the quick pick controller. */ - createQuickPick(): IQuickPick; + createQuickPick(options: { useSeparators: true }): IQuickPick; + createQuickPick(options?: { useSeparators: boolean }): IQuickPick; /** * Provides raw access to the input box controller. diff --git a/src/vs/platform/quickinput/test/browser/quickinput.test.ts b/src/vs/platform/quickinput/test/browser/quickinput.test.ts index 328c43d72fb..f33759e20e3 100644 --- a/src/vs/platform/quickinput/test/browser/quickinput.test.ts +++ b/src/vs/platform/quickinput/test/browser/quickinput.test.ts @@ -4,36 +4,36 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { unthemedInboxStyles } from 'vs/base/browser/ui/inputbox/inputBox'; -import { unthemedButtonStyles } from 'vs/base/browser/ui/button/button'; -import { unthemedListStyles } from 'vs/base/browser/ui/list/listWidget'; -import { unthemedToggleStyles } from 'vs/base/browser/ui/toggle/toggle'; -import { Event } from 'vs/base/common/event'; -import { raceTimeout } from 'vs/base/common/async'; -import { unthemedCountStyles } from 'vs/base/browser/ui/countBadge/countBadge'; -import { unthemedKeybindingLabelOptions } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; -import { unthemedProgressBarOptions } from 'vs/base/browser/ui/progressbar/progressbar'; -import { QuickInputController } from 'vs/platform/quickinput/browser/quickInputController'; -import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import { mainWindow } from 'vs/base/browser/window'; -import { QuickPick } from 'vs/platform/quickinput/browser/quickInput'; -import { IQuickPickItem, ItemActivation } from 'vs/platform/quickinput/common/quickInput'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { IListService, ListService } from 'vs/platform/list/browser/listService'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService'; -import { NoMatchingKb } from 'vs/platform/keybinding/common/keybindingResolver'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { TestAccessibilityService } from 'vs/platform/accessibility/test/common/testAccessibilityService'; +import { unthemedInboxStyles } from '../../../../base/browser/ui/inputbox/inputBox.js'; +import { unthemedButtonStyles } from '../../../../base/browser/ui/button/button.js'; +import { unthemedListStyles } from '../../../../base/browser/ui/list/listWidget.js'; +import { unthemedToggleStyles } from '../../../../base/browser/ui/toggle/toggle.js'; +import { Event } from '../../../../base/common/event.js'; +import { raceTimeout } from '../../../../base/common/async.js'; +import { unthemedCountStyles } from '../../../../base/browser/ui/countBadge/countBadge.js'; +import { unthemedKeybindingLabelOptions } from '../../../../base/browser/ui/keybindingLabel/keybindingLabel.js'; +import { unthemedProgressBarOptions } from '../../../../base/browser/ui/progressbar/progressbar.js'; +import { QuickInputController } from '../../browser/quickInputController.js'; +import { TestThemeService } from '../../../theme/test/common/testThemeService.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { toDisposable } from '../../../../base/common/lifecycle.js'; +import { mainWindow } from '../../../../base/browser/window.js'; +import { QuickPick } from '../../browser/quickInput.js'; +import { IQuickPickItem, ItemActivation } from '../../common/quickInput.js'; +import { TestInstantiationService } from '../../../instantiation/test/common/instantiationServiceMock.js'; +import { IThemeService } from '../../../theme/common/themeService.js'; +import { IConfigurationService } from '../../../configuration/common/configuration.js'; +import { TestConfigurationService } from '../../../configuration/test/common/testConfigurationService.js'; +import { ILayoutService } from '../../../layout/browser/layoutService.js'; +import { IContextViewService } from '../../../contextview/browser/contextView.js'; +import { IListService, ListService } from '../../../list/browser/listService.js'; +import { IContextKeyService } from '../../../contextkey/common/contextkey.js'; +import { ContextKeyService } from '../../../contextkey/browser/contextKeyService.js'; +import { NoMatchingKb } from '../../../keybinding/common/keybindingResolver.js'; +import { IKeybindingService } from '../../../keybinding/common/keybinding.js'; +import { ContextViewService } from '../../../contextview/browser/contextViewService.js'; +import { IAccessibilityService } from '../../../accessibility/common/accessibility.js'; +import { TestAccessibilityService } from '../../../accessibility/test/common/testAccessibilityService.js'; // Sets up an `onShow` listener to allow us to wait until the quick pick is shown (useful when triggering an `accept()` right after launching a quick pick) // kick this off before you launch the picker and then await the promise returned after you launch the picker. diff --git a/src/vs/platform/registry/common/platform.ts b/src/vs/platform/registry/common/platform.ts index 99ef2e35a37..b4a9bdd775e 100644 --- a/src/vs/platform/registry/common/platform.ts +++ b/src/vs/platform/registry/common/platform.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as Assert from 'vs/base/common/assert'; -import * as Types from 'vs/base/common/types'; +import * as Assert from '../../../base/common/assert.js'; +import * as Types from '../../../base/common/types.js'; export interface IRegistry { diff --git a/src/vs/platform/registry/test/common/platform.test.ts b/src/vs/platform/registry/test/common/platform.test.ts index 8ec965d503b..8724f574906 100644 --- a/src/vs/platform/registry/test/common/platform.test.ts +++ b/src/vs/platform/registry/test/common/platform.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { isFunction } from 'vs/base/common/types'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { isFunction } from '../../../../base/common/types.js'; +import { Registry } from '../../common/platform.js'; suite('Platform / Registry', () => { diff --git a/src/vs/platform/remote/browser/browserSocketFactory.ts b/src/vs/platform/remote/browser/browserSocketFactory.ts index e8d40cb8ecc..7aea766301a 100644 --- a/src/vs/platform/remote/browser/browserSocketFactory.ts +++ b/src/vs/platform/remote/browser/browserSocketFactory.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { ISocket, SocketCloseEvent, SocketCloseEventType, SocketDiagnostics, SocketDiagnosticsEventType } from 'vs/base/parts/ipc/common/ipc.net'; -import { ISocketFactory } from 'vs/platform/remote/common/remoteSocketFactoryService'; -import { RemoteAuthorityResolverError, RemoteAuthorityResolverErrorCode, RemoteConnectionType, WebSocketRemoteConnection } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { mainWindow } from 'vs/base/browser/window'; +import * as dom from '../../../base/browser/dom.js'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { ISocket, SocketCloseEvent, SocketCloseEventType, SocketDiagnostics, SocketDiagnosticsEventType } from '../../../base/parts/ipc/common/ipc.net.js'; +import { ISocketFactory } from '../common/remoteSocketFactoryService.js'; +import { RemoteAuthorityResolverError, RemoteAuthorityResolverErrorCode, RemoteConnectionType, WebSocketRemoteConnection } from '../common/remoteAuthorityResolver.js'; +import { mainWindow } from '../../../base/browser/window.js'; export interface IWebSocketFactory { create(url: string, debugLabel: string): IWebSocket; diff --git a/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts b/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts index 8b85c237151..ca6361ffa60 100644 --- a/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts +++ b/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { mainWindow } from 'vs/base/browser/window'; -import { DeferredPromise } from 'vs/base/common/async'; -import * as errors from 'vs/base/common/errors'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { RemoteAuthorities } from 'vs/base/common/network'; -import * as performance from 'vs/base/common/performance'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { URI } from 'vs/base/common/uri'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IRemoteAuthorityResolverService, IRemoteConnectionData, RemoteConnectionType, ResolvedAuthority, ResolvedOptions, ResolverResult, WebSocketRemoteConnection, getRemoteAuthorityPrefix } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { parseAuthorityWithOptionalPort } from 'vs/platform/remote/common/remoteHosts'; +import { mainWindow } from '../../../base/browser/window.js'; +import { DeferredPromise } from '../../../base/common/async.js'; +import * as errors from '../../../base/common/errors.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { RemoteAuthorities } from '../../../base/common/network.js'; +import * as performance from '../../../base/common/performance.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { URI } from '../../../base/common/uri.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IRemoteAuthorityResolverService, IRemoteConnectionData, RemoteConnectionType, ResolvedAuthority, ResolvedOptions, ResolverResult, WebSocketRemoteConnection, getRemoteAuthorityPrefix } from '../common/remoteAuthorityResolver.js'; +import { parseAuthorityWithOptionalPort } from '../common/remoteHosts.js'; export class RemoteAuthorityResolverService extends Disposable implements IRemoteAuthorityResolverService { diff --git a/src/vs/platform/remote/common/electronRemoteResources.ts b/src/vs/platform/remote/common/electronRemoteResources.ts index a5d2f372251..e8e0fa86892 100644 --- a/src/vs/platform/remote/common/electronRemoteResources.ts +++ b/src/vs/platform/remote/common/electronRemoteResources.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { UriComponents } from 'vs/base/common/uri'; -import { Client, IClientRouter, IConnectionHub } from 'vs/base/parts/ipc/common/ipc'; +import { UriComponents } from '../../../base/common/uri.js'; +import { Client, IClientRouter, IConnectionHub } from '../../../base/parts/ipc/common/ipc.js'; export const NODE_REMOTE_RESOURCE_IPC_METHOD_NAME = 'request'; diff --git a/src/vs/platform/remote/common/managedSocket.ts b/src/vs/platform/remote/common/managedSocket.ts index 0f55617264d..d5d6ba7516d 100644 --- a/src/vs/platform/remote/common/managedSocket.ts +++ b/src/vs/platform/remote/common/managedSocket.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer, encodeBase64 } from 'vs/base/common/buffer'; -import { Emitter, Event, PauseableEmitter } from 'vs/base/common/event'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { ISocket, SocketCloseEvent, SocketDiagnostics, SocketDiagnosticsEventType } from 'vs/base/parts/ipc/common/ipc.net'; +import { VSBuffer, encodeBase64 } from '../../../base/common/buffer.js'; +import { Emitter, Event, PauseableEmitter } from '../../../base/common/event.js'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { ISocket, SocketCloseEvent, SocketDiagnostics, SocketDiagnosticsEventType } from '../../../base/parts/ipc/common/ipc.net.js'; export const makeRawSocketHeaders = (path: string, query: string, deubgLabel: string) => { // https://tools.ietf.org/html/rfc6455#section-4 diff --git a/src/vs/platform/remote/common/remoteAgentConnection.ts b/src/vs/platform/remote/common/remoteAgentConnection.ts index 45ebbe8df04..e89c0076878 100644 --- a/src/vs/platform/remote/common/remoteAgentConnection.ts +++ b/src/vs/platform/remote/common/remoteAgentConnection.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise, promiseWithResolvers } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { isCancellationError, onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { RemoteAuthorities } from 'vs/base/common/network'; -import * as performance from 'vs/base/common/performance'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IIPCLogger } from 'vs/base/parts/ipc/common/ipc'; -import { Client, ISocket, PersistentProtocol, SocketCloseEventType } from 'vs/base/parts/ipc/common/ipc.net'; -import { ILogService } from 'vs/platform/log/common/log'; -import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment'; -import { RemoteAuthorityResolverError, RemoteConnection } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { IRemoteSocketFactoryService } from 'vs/platform/remote/common/remoteSocketFactoryService'; -import { ISignService } from 'vs/platform/sign/common/sign'; +import { CancelablePromise, createCancelablePromise, promiseWithResolvers } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { isCancellationError, onUnexpectedError } from '../../../base/common/errors.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { RemoteAuthorities } from '../../../base/common/network.js'; +import * as performance from '../../../base/common/performance.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IIPCLogger } from '../../../base/parts/ipc/common/ipc.js'; +import { Client, ISocket, PersistentProtocol, SocketCloseEventType } from '../../../base/parts/ipc/common/ipc.net.js'; +import { ILogService } from '../../log/common/log.js'; +import { RemoteAgentConnectionContext } from './remoteAgentEnvironment.js'; +import { RemoteAuthorityResolverError, RemoteConnection } from './remoteAuthorityResolver.js'; +import { IRemoteSocketFactoryService } from './remoteSocketFactoryService.js'; +import { ISignService } from '../../sign/common/sign.js'; const RECONNECT_TIMEOUT = 30 * 1000 /* 30s */; diff --git a/src/vs/platform/remote/common/remoteAgentEnvironment.ts b/src/vs/platform/remote/common/remoteAgentEnvironment.ts index de9a7559ad1..e56ea739e64 100644 --- a/src/vs/platform/remote/common/remoteAgentEnvironment.ts +++ b/src/vs/platform/remote/common/remoteAgentEnvironment.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as performance from 'vs/base/common/performance'; -import { OperatingSystem } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; +import * as performance from '../../../base/common/performance.js'; +import { OperatingSystem } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { IUserDataProfile } from '../../userDataProfile/common/userDataProfile.js'; export interface IRemoteAgentEnvironment { pid: number; diff --git a/src/vs/platform/remote/common/remoteAuthorityResolver.ts b/src/vs/platform/remote/common/remoteAuthorityResolver.ts index 14aa2b1a256..938bbd80c48 100644 --- a/src/vs/platform/remote/common/remoteAuthorityResolver.ts +++ b/src/vs/platform/remote/common/remoteAuthorityResolver.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ErrorNoTelemetry } from 'vs/base/common/errors'; -import { Event } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { ErrorNoTelemetry } from '../../../base/common/errors.js'; +import { Event } from '../../../base/common/event.js'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IRemoteAuthorityResolverService = createDecorator('remoteAuthorityResolverService'); diff --git a/src/vs/platform/remote/common/remoteExtensionsScanner.ts b/src/vs/platform/remote/common/remoteExtensionsScanner.ts index a26de9d171b..10959aad509 100644 --- a/src/vs/platform/remote/common/remoteExtensionsScanner.ts +++ b/src/vs/platform/remote/common/remoteExtensionsScanner.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IExtensionDescription } from '../../extensions/common/extensions.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IRemoteExtensionsScannerService = createDecorator('IRemoteExtensionsScannerService'); diff --git a/src/vs/platform/remote/common/remoteHosts.ts b/src/vs/platform/remote/common/remoteHosts.ts index ccf58f9accb..9583e30f1f0 100644 --- a/src/vs/platform/remote/common/remoteHosts.ts +++ b/src/vs/platform/remote/common/remoteHosts.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; +import { Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; export function getRemoteAuthority(uri: URI): string | undefined { return uri.scheme === Schemas.vscodeRemote ? uri.authority : undefined; diff --git a/src/vs/platform/remote/common/remoteSocketFactoryService.ts b/src/vs/platform/remote/common/remoteSocketFactoryService.ts index 6d6eacfc854..4c07701d623 100644 --- a/src/vs/platform/remote/common/remoteSocketFactoryService.ts +++ b/src/vs/platform/remote/common/remoteSocketFactoryService.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ISocket } from 'vs/base/parts/ipc/common/ipc.net'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { RemoteConnectionOfType, RemoteConnectionType, RemoteConnection } from 'vs/platform/remote/common/remoteAuthorityResolver'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { ISocket } from '../../../base/parts/ipc/common/ipc.net.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { RemoteConnectionOfType, RemoteConnectionType, RemoteConnection } from './remoteAuthorityResolver.js'; export const IRemoteSocketFactoryService = createDecorator('remoteSocketFactoryService'); diff --git a/src/vs/platform/remote/common/sharedProcessTunnelService.ts b/src/vs/platform/remote/common/sharedProcessTunnelService.ts index 2062f774c8a..3b676c9ccf8 100644 --- a/src/vs/platform/remote/common/sharedProcessTunnelService.ts +++ b/src/vs/platform/remote/common/sharedProcessTunnelService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IAddress } from 'vs/platform/remote/common/remoteAgentConnection'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IAddress } from './remoteAgentConnection.js'; export const ISharedProcessTunnelService = createDecorator('sharedProcessTunnelService'); diff --git a/src/vs/platform/remote/electron-sandbox/electronRemoteResourceLoader.ts b/src/vs/platform/remote/electron-sandbox/electronRemoteResourceLoader.ts index 3462f2a0017..e57d0122a52 100644 --- a/src/vs/platform/remote/electron-sandbox/electronRemoteResourceLoader.ts +++ b/src/vs/platform/remote/electron-sandbox/electronRemoteResourceLoader.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer, encodeBase64 } from 'vs/base/common/buffer'; -import { Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { getMediaOrTextMime } from 'vs/base/common/mime'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { FileOperationError, FileOperationResult, IFileContent, IFileService } from 'vs/platform/files/common/files'; -import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; -import { NODE_REMOTE_RESOURCE_CHANNEL_NAME, NODE_REMOTE_RESOURCE_IPC_METHOD_NAME, NodeRemoteResourceResponse } from 'vs/platform/remote/common/electronRemoteResources'; +import { VSBuffer, encodeBase64 } from '../../../base/common/buffer.js'; +import { Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { getMediaOrTextMime } from '../../../base/common/mime.js'; +import { Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import { IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { FileOperationError, FileOperationResult, IFileContent, IFileService } from '../../files/common/files.js'; +import { IMainProcessService } from '../../ipc/common/mainProcessService.js'; +import { NODE_REMOTE_RESOURCE_CHANNEL_NAME, NODE_REMOTE_RESOURCE_IPC_METHOD_NAME, NodeRemoteResourceResponse } from '../common/electronRemoteResources.js'; export class ElectronRemoteResourceLoader extends Disposable { constructor( diff --git a/src/vs/platform/remote/electron-sandbox/remoteAuthorityResolverService.ts b/src/vs/platform/remote/electron-sandbox/remoteAuthorityResolverService.ts index 9948495f898..99157f24fa6 100644 --- a/src/vs/platform/remote/electron-sandbox/remoteAuthorityResolverService.ts +++ b/src/vs/platform/remote/electron-sandbox/remoteAuthorityResolverService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // -import { DeferredPromise } from 'vs/base/common/async'; -import * as errors from 'vs/base/common/errors'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { RemoteAuthorities } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IRemoteAuthorityResolverService, IRemoteConnectionData, RemoteConnectionType, ResolvedAuthority, ResolvedOptions, ResolverResult } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { ElectronRemoteResourceLoader } from 'vs/platform/remote/electron-sandbox/electronRemoteResourceLoader'; +import { DeferredPromise } from '../../../base/common/async.js'; +import * as errors from '../../../base/common/errors.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { RemoteAuthorities } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IRemoteAuthorityResolverService, IRemoteConnectionData, RemoteConnectionType, ResolvedAuthority, ResolvedOptions, ResolverResult } from '../common/remoteAuthorityResolver.js'; +import { ElectronRemoteResourceLoader } from './electronRemoteResourceLoader.js'; export class RemoteAuthorityResolverService extends Disposable implements IRemoteAuthorityResolverService { diff --git a/src/vs/platform/remote/electron-sandbox/sharedProcessTunnelService.ts b/src/vs/platform/remote/electron-sandbox/sharedProcessTunnelService.ts index 725b03005c9..81c04b34fcb 100644 --- a/src/vs/platform/remote/electron-sandbox/sharedProcessTunnelService.ts +++ b/src/vs/platform/remote/electron-sandbox/sharedProcessTunnelService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSharedProcessRemoteService } from 'vs/platform/ipc/electron-sandbox/services'; -import { ISharedProcessTunnelService, ipcSharedProcessTunnelChannelName } from 'vs/platform/remote/common/sharedProcessTunnelService'; +import { registerSharedProcessRemoteService } from '../../ipc/electron-sandbox/services.js'; +import { ISharedProcessTunnelService, ipcSharedProcessTunnelChannelName } from '../common/sharedProcessTunnelService.js'; registerSharedProcessRemoteService(ISharedProcessTunnelService, ipcSharedProcessTunnelChannelName); diff --git a/src/vs/platform/remote/node/nodeSocketFactory.ts b/src/vs/platform/remote/node/nodeSocketFactory.ts index 4641791946a..4ed634e3d96 100644 --- a/src/vs/platform/remote/node/nodeSocketFactory.ts +++ b/src/vs/platform/remote/node/nodeSocketFactory.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import * as net from 'net'; -import { ISocket } from 'vs/base/parts/ipc/common/ipc.net'; -import { NodeSocket } from 'vs/base/parts/ipc/node/ipc.net'; -import { makeRawSocketHeaders } from 'vs/platform/remote/common/managedSocket'; -import { RemoteConnectionType, WebSocketRemoteConnection } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { ISocketFactory } from 'vs/platform/remote/common/remoteSocketFactoryService'; +import { ISocket } from '../../../base/parts/ipc/common/ipc.net.js'; +import { NodeSocket } from '../../../base/parts/ipc/node/ipc.net.js'; +import { makeRawSocketHeaders } from '../common/managedSocket.js'; +import { RemoteConnectionType, WebSocketRemoteConnection } from '../common/remoteAuthorityResolver.js'; +import { ISocketFactory } from '../common/remoteSocketFactoryService.js'; export const nodeSocketFactory = new class implements ISocketFactory { diff --git a/src/vs/platform/remote/node/wsl.ts b/src/vs/platform/remote/node/wsl.ts index 3ba33f74b96..637ccff4fb0 100644 --- a/src/vs/platform/remote/node/wsl.ts +++ b/src/vs/platform/remote/node/wsl.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'fs'; import * as os from 'os'; import * as cp from 'child_process'; -import { Promises } from 'vs/base/node/pfs'; import * as path from 'path'; let hasWSLFeaturePromise: Promise | undefined; @@ -26,14 +26,18 @@ async function testWSLFeatureInstalled(): Promise { const wslExePath = getWSLExecutablePath(); if (wslExePath) { return new Promise(s => { - cp.execFile(wslExePath, ['--status'], err => s(!err)); + try { + cp.execFile(wslExePath, ['--status'], err => s(!err)); + } catch (e) { + s(false); + } }); } } else { const dllPath = getLxssManagerDllPath(); if (dllPath) { try { - if ((await Promises.stat(dllPath)).isFile()) { + if ((await fs.promises.stat(dllPath)).isFile()) { return true; } } catch (e) { diff --git a/src/vs/platform/remote/test/common/remoteHosts.test.ts b/src/vs/platform/remote/test/common/remoteHosts.test.ts index ed564551df9..4fe2f34e7b8 100644 --- a/src/vs/platform/remote/test/common/remoteHosts.test.ts +++ b/src/vs/platform/remote/test/common/remoteHosts.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { parseAuthorityWithOptionalPort, parseAuthorityWithPort } from 'vs/platform/remote/common/remoteHosts'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { parseAuthorityWithOptionalPort, parseAuthorityWithPort } from '../../common/remoteHosts.js'; suite('remoteHosts', () => { diff --git a/src/vs/platform/remote/test/electron-sandbox/remoteAuthorityResolverService.test.ts b/src/vs/platform/remote/test/electron-sandbox/remoteAuthorityResolverService.test.ts index 67790a807c6..ebf023ac49c 100644 --- a/src/vs/platform/remote/test/electron-sandbox/remoteAuthorityResolverService.test.ts +++ b/src/vs/platform/remote/test/electron-sandbox/remoteAuthorityResolverService.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { RemoteAuthorityResolverError, RemoteAuthorityResolverErrorCode } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { RemoteAuthorityResolverService } from 'vs/platform/remote/electron-sandbox/remoteAuthorityResolverService'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import product from '../../../product/common/product.js'; +import { IProductService } from '../../../product/common/productService.js'; +import { RemoteAuthorityResolverError, RemoteAuthorityResolverErrorCode } from '../../common/remoteAuthorityResolver.js'; +import { RemoteAuthorityResolverService } from '../../electron-sandbox/remoteAuthorityResolverService.js'; suite('RemoteAuthorityResolverService', () => { diff --git a/src/vs/platform/remoteTunnel/common/remoteTunnel.ts b/src/vs/platform/remoteTunnel/common/remoteTunnel.ts index d50077ee508..1d25eccd524 100644 --- a/src/vs/platform/remoteTunnel/common/remoteTunnel.ts +++ b/src/vs/platform/remoteTunnel/common/remoteTunnel.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { Event } from 'vs/base/common/event'; -import { localize } from 'vs/nls'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { Event } from '../../../base/common/event.js'; +import { localize } from '../../../nls.js'; export interface IRemoteTunnelSession { readonly providerId: string; diff --git a/src/vs/platform/remoteTunnel/electron-sandbox/remoteTunnelService.ts b/src/vs/platform/remoteTunnel/electron-sandbox/remoteTunnelService.ts index 4d626c9de47..7aa3657e2a5 100644 --- a/src/vs/platform/remoteTunnel/electron-sandbox/remoteTunnelService.ts +++ b/src/vs/platform/remoteTunnel/electron-sandbox/remoteTunnelService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSharedProcessRemoteService } from 'vs/platform/ipc/electron-sandbox/services'; -import { IRemoteTunnelService } from 'vs/platform/remoteTunnel/common/remoteTunnel'; +import { registerSharedProcessRemoteService } from '../../ipc/electron-sandbox/services.js'; +import { IRemoteTunnelService } from '../common/remoteTunnel.js'; registerSharedProcessRemoteService(IRemoteTunnelService, 'remoteTunnel'); diff --git a/src/vs/platform/remoteTunnel/node/remoteTunnelService.ts b/src/vs/platform/remoteTunnel/node/remoteTunnelService.ts index d0d433a33e6..6c3306c010f 100644 --- a/src/vs/platform/remoteTunnel/node/remoteTunnelService.ts +++ b/src/vs/platform/remoteTunnel/node/remoteTunnelService.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CONFIGURATION_KEY_HOST_NAME, CONFIGURATION_KEY_PREVENT_SLEEP, ConnectionInfo, IRemoteTunnelSession, IRemoteTunnelService, LOGGER_NAME, LOG_ID, TunnelStates, TunnelStatus, TunnelMode, INACTIVE_TUNNEL_MODE, ActiveTunnelMode } from 'vs/platform/remoteTunnel/common/remoteTunnel'; -import { Emitter } from 'vs/base/common/event'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ILogger, ILoggerService, LogLevelToString } from 'vs/platform/log/common/log'; -import { dirname, join } from 'vs/base/common/path'; +import { CONFIGURATION_KEY_HOST_NAME, CONFIGURATION_KEY_PREVENT_SLEEP, ConnectionInfo, IRemoteTunnelSession, IRemoteTunnelService, LOGGER_NAME, LOG_ID, TunnelStates, TunnelStatus, TunnelMode, INACTIVE_TUNNEL_MODE, ActiveTunnelMode } from '../common/remoteTunnel.js'; +import { Emitter } from '../../../base/common/event.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { ILogger, ILoggerService, LogLevelToString } from '../../log/common/log.js'; +import { dirname, join } from '../../../base/common/path.js'; import { ChildProcess, StdioOptions, spawn } from 'child_process'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { isMacintosh, isWindows } from 'vs/base/common/platform'; -import { CancelablePromise, createCancelablePromise, Delayer } from 'vs/base/common/async'; -import { ISharedProcessLifecycleService } from 'vs/platform/lifecycle/node/sharedProcessLifecycleService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { localize } from 'vs/nls'; +import { IProductService } from '../../product/common/productService.js'; +import { isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { CancelablePromise, createCancelablePromise, Delayer } from '../../../base/common/async.js'; +import { ISharedProcessLifecycleService } from '../../lifecycle/node/sharedProcessLifecycleService.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { localize } from '../../../nls.js'; import { hostname, homedir } from 'os'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { isString } from 'vs/base/common/types'; -import { StreamSplitter } from 'vs/base/node/nodeStreams'; -import { joinPath } from 'vs/base/common/resources'; +import { IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { isString } from '../../../base/common/types.js'; +import { StreamSplitter } from '../../../base/node/nodeStreams.js'; +import { joinPath } from '../../../base/common/resources.js'; type RemoteTunnelEnablementClassification = { owner: 'aeschli'; diff --git a/src/vs/platform/request/browser/requestService.ts b/src/vs/platform/request/browser/requestService.ts deleted file mode 100644 index f0fc3d68790..00000000000 --- a/src/vs/platform/request/browser/requestService.ts +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { CancellationToken } from 'vs/base/common/cancellation'; -import { request } from 'vs/base/parts/request/browser/request'; -import { IRequestContext, IRequestOptions } from 'vs/base/parts/request/common/request'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILoggerService } from 'vs/platform/log/common/log'; -import { AbstractRequestService, IRequestService } from 'vs/platform/request/common/request'; - -/** - * This service exposes the `request` API, while using the global - * or configured proxy settings. - */ -export class RequestService extends AbstractRequestService implements IRequestService { - - declare readonly _serviceBrand: undefined; - - constructor( - @IConfigurationService private readonly configurationService: IConfigurationService, - @ILoggerService loggerService: ILoggerService - ) { - super(loggerService); - } - - async request(options: IRequestOptions, token: CancellationToken): Promise { - if (!options.proxyAuthorization) { - options.proxyAuthorization = this.configurationService.getValue('http.proxyAuthorization'); - } - return this.logAndRequest('browser', options, () => request(options, token)); - } - - async resolveProxy(url: string): Promise { - return undefined; // not implemented in the web - } - - async loadCertificates(): Promise { - return []; // not implemented in the web - } -} diff --git a/src/vs/platform/request/common/request.ts b/src/vs/platform/request/common/request.ts index 289ad6740e0..46a78f000ba 100644 --- a/src/vs/platform/request/common/request.ts +++ b/src/vs/platform/request/common/request.ts @@ -3,25 +3,41 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { streamToBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { getErrorMessage } from 'vs/base/common/errors'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IHeaders, IRequestContext, IRequestOptions } from 'vs/base/parts/request/common/request'; -import { localize } from 'vs/nls'; -import { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { CONTEXT_LOG_LEVEL, ILogger, ILoggerService, LogLevel, LogLevelToString } from 'vs/platform/log/common/log'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { streamToBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { getErrorMessage } from '../../../base/common/errors.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IHeaders, IRequestContext, IRequestOptions } from '../../../base/parts/request/common/request.js'; +import { localize } from '../../../nls.js'; +import { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationRegistry } from '../../configuration/common/configurationRegistry.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { Registry } from '../../registry/common/platform.js'; export const IRequestService = createDecorator('requestService'); +export interface AuthInfo { + isProxy: boolean; + scheme: string; + host: string; + port: number; + realm: string; + attempt: number; +} + +export interface Credentials { + username: string; + password: string; +} + export interface IRequestService { readonly _serviceBrand: undefined; request(options: IRequestOptions, token: CancellationToken): Promise; resolveProxy(url: string): Promise; + lookupAuthorization(authInfo: AuthInfo): Promise; + lookupKerberosAuthorization(url: string): Promise; loadCertificates(): Promise; } @@ -52,34 +68,29 @@ export abstract class AbstractRequestService extends Disposable implements IRequ declare readonly _serviceBrand: undefined; - protected readonly logger: ILogger; private counter = 0; - constructor( - loggerService: ILoggerService - ) { + constructor(protected readonly logService: ILogService) { super(); - this.logger = loggerService.createLogger('network', { - name: localize('request', "Network Requests"), - when: CONTEXT_LOG_LEVEL.isEqualTo(LogLevelToString(LogLevel.Trace)).serialize() - }); } - protected async logAndRequest(stack: string, options: IRequestOptions, request: () => Promise): Promise { - const prefix = `${stack} #${++this.counter}: ${options.url}`; - this.logger.trace(`${prefix} - begin`, options.type, new LoggableHeaders(options.headers ?? {})); + protected async logAndRequest(options: IRequestOptions, request: () => Promise): Promise { + const prefix = `[network] #${++this.counter}: ${options.url}`; + this.logService.trace(`${prefix} - begin`, options.type, new LoggableHeaders(options.headers ?? {})); try { const result = await request(); - this.logger.trace(`${prefix} - end`, options.type, result.res.statusCode, result.res.headers); + this.logService.trace(`${prefix} - end`, options.type, result.res.statusCode, result.res.headers); return result; } catch (error) { - this.logger.error(`${prefix} - error`, options.type, getErrorMessage(error)); + this.logService.error(`${prefix} - error`, options.type, getErrorMessage(error)); throw error; } } abstract request(options: IRequestOptions, token: CancellationToken): Promise; abstract resolveProxy(url: string): Promise; + abstract lookupAuthorization(authInfo: AuthInfo): Promise; + abstract lookupKerberosAuthorization(url: string): Promise; abstract loadCertificates(): Promise; } @@ -155,6 +166,12 @@ function registerProxyConfigurations(scope: ConfigurationScope): void { markdownDescription: localize('proxyKerberosServicePrincipal', "Overrides the principal service name for Kerberos authentication with the HTTP proxy. A default based on the proxy hostname is used when this is not set."), restricted: true }, + 'http.noProxy': { + type: 'array', + items: { type: 'string' }, + markdownDescription: localize('noProxy', "Specifies domain names for which proxy settings should be ignored for HTTP/HTTPS requests."), + restricted: true + }, 'http.proxyAuthorization': { type: ['null', 'string'], default: null, diff --git a/src/vs/platform/request/common/requestIpc.ts b/src/vs/platform/request/common/requestIpc.ts index 421106ebff6..0b3aff1a886 100644 --- a/src/vs/platform/request/common/requestIpc.ts +++ b/src/vs/platform/request/common/requestIpc.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { bufferToStream, streamToBuffer, VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IHeaders, IRequestContext, IRequestOptions } from 'vs/base/parts/request/common/request'; -import { IRequestService } from 'vs/platform/request/common/request'; +import { bufferToStream, streamToBuffer, VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { IHeaders, IRequestContext, IRequestOptions } from '../../../base/parts/request/common/request.js'; +import { AuthInfo, Credentials, IRequestService } from './request.js'; type RequestResponse = [ { @@ -34,6 +34,8 @@ export class RequestChannel implements IServerChannel { return [{ statusCode: res.statusCode, headers: res.headers }, buffer]; }); case 'resolveProxy': return this.service.resolveProxy(args[0]); + case 'lookupAuthorization': return this.service.lookupAuthorization(args[0]); + case 'lookupKerberosAuthorization': return this.service.lookupKerberosAuthorization(args[0]); case 'loadCertificates': return this.service.loadCertificates(); } throw new Error('Invalid call'); @@ -55,6 +57,14 @@ export class RequestChannelClient implements IRequestService { return this.channel.call('resolveProxy', [url]); } + async lookupAuthorization(authInfo: AuthInfo): Promise { + return this.channel.call<{ username: string; password: string } | undefined>('lookupAuthorization', [authInfo]); + } + + async lookupKerberosAuthorization(url: string): Promise { + return this.channel.call('lookupKerberosAuthorization', [url]); + } + async loadCertificates(): Promise { return this.channel.call('loadCertificates'); } diff --git a/src/vs/platform/request/electron-main/requestMainService.ts b/src/vs/platform/request/electron-utility/requestService.ts similarity index 74% rename from src/vs/platform/request/electron-main/requestMainService.ts rename to src/vs/platform/request/electron-utility/requestService.ts index 7589efa675f..f92a2450c3e 100644 --- a/src/vs/platform/request/electron-main/requestMainService.ts +++ b/src/vs/platform/request/electron-utility/requestService.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import { net } from 'electron'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IRequestContext, IRequestOptions } from 'vs/base/parts/request/common/request'; -import { IRawRequestFunction, RequestService as NodeRequestService } from 'vs/platform/request/node/requestService'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IRequestContext, IRequestOptions } from '../../../base/parts/request/common/request.js'; +import { IRawRequestFunction, RequestService as NodeRequestService } from '../node/requestService.js'; function getRawRequest(options: IRequestOptions): IRawRequestFunction { return net.request as any as IRawRequestFunction; } -export class RequestMainService extends NodeRequestService { +export class RequestService extends NodeRequestService { override request(options: IRequestOptions, token: CancellationToken): Promise { return super.request({ ...(options || {}), getRawRequest, isChromiumNetwork: true }, token); diff --git a/src/vs/platform/request/node/proxy.ts b/src/vs/platform/request/node/proxy.ts index db448e06cc1..5f1d40109a2 100644 --- a/src/vs/platform/request/node/proxy.ts +++ b/src/vs/platform/request/node/proxy.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { parse as parseUrl, Url } from 'url'; -import { isBoolean } from 'vs/base/common/types'; +import { isBoolean } from '../../../base/common/types.js'; export type Agent = any; @@ -44,7 +44,21 @@ export async function getProxyAgent(rawRequestURL: string, env: typeof process.e rejectUnauthorized: isBoolean(options.strictSSL) ? options.strictSSL : true, }; - return requestURL.protocol === 'http:' - ? new (await import('http-proxy-agent')).HttpProxyAgent(proxyURL, opts) - : new (await import('https-proxy-agent')).HttpsProxyAgent(proxyURL, opts); + if (requestURL.protocol === 'http:') { + // ESM-comment-begin + // const mod = await import('http-proxy-agent'); + // ESM-comment-end + // ESM-uncomment-begin + const { default: mod } = await import('http-proxy-agent'); + // ESM-uncomment-end + return new mod.HttpProxyAgent(proxyURL, opts); + } else { + // ESM-comment-begin + // const mod = await import('https-proxy-agent'); + // ESM-comment-end + // ESM-uncomment-begin + const { default: mod } = await import('https-proxy-agent'); + // ESM-uncomment-end + return new mod.HttpsProxyAgent(proxyURL, opts); + } } diff --git a/src/vs/platform/request/node/requestService.ts b/src/vs/platform/request/node/requestService.ts index 23f8f0d44c8..010acda0546 100644 --- a/src/vs/platform/request/node/requestService.ts +++ b/src/vs/platform/request/node/requestService.ts @@ -6,19 +6,19 @@ import * as http from 'http'; import * as https from 'https'; import { parse as parseUrl } from 'url'; -import { Promises } from 'vs/base/common/async'; -import { streamToBufferReadableStream } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { CancellationError, getErrorMessage } from 'vs/base/common/errors'; -import * as streams from 'vs/base/common/stream'; -import { isBoolean, isNumber } from 'vs/base/common/types'; -import { IRequestContext, IRequestOptions } from 'vs/base/parts/request/common/request'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { getResolvedShellEnv } from 'vs/platform/shell/node/shellEnv'; -import { ILogService, ILoggerService } from 'vs/platform/log/common/log'; -import { AbstractRequestService, IRequestService } from 'vs/platform/request/common/request'; -import { Agent, getProxyAgent } from 'vs/platform/request/node/proxy'; +import { Promises } from '../../../base/common/async.js'; +import { streamToBufferReadableStream } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { CancellationError, getErrorMessage } from '../../../base/common/errors.js'; +import * as streams from '../../../base/common/stream.js'; +import { isBoolean, isNumber } from '../../../base/common/types.js'; +import { IRequestContext, IRequestOptions } from '../../../base/parts/request/common/request.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { getResolvedShellEnv } from '../../shell/node/shellEnv.js'; +import { ILogService } from '../../log/common/log.js'; +import { AbstractRequestService, AuthInfo, Credentials, IRequestService } from '../common/request.js'; +import { Agent, getProxyAgent } from './proxy.js'; import { createGunzip } from 'zlib'; interface IHTTPConfiguration { @@ -54,10 +54,9 @@ export class RequestService extends AbstractRequestService implements IRequestSe constructor( @IConfigurationService private readonly configurationService: IConfigurationService, @INativeEnvironmentService private readonly environmentService: INativeEnvironmentService, - @ILogService private readonly logService: ILogService, - @ILoggerService loggerService: ILoggerService + @ILogService logService: ILogService, ) { - super(loggerService); + super(logService); this.configure(); this._register(configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration('http')) { @@ -103,13 +102,33 @@ export class RequestService extends AbstractRequestService implements IRequestSe }; } - return this.logAndRequest(options.isChromiumNetwork ? 'electron' : 'node', options, () => nodeRequest(options, token)); + return this.logAndRequest(options, () => nodeRequest(options, token)); } async resolveProxy(url: string): Promise { return undefined; // currently not implemented in node } + async lookupAuthorization(authInfo: AuthInfo): Promise { + return undefined; // currently not implemented in node + } + + async lookupKerberosAuthorization(urlStr: string): Promise { + try { + const kerberos = await import('kerberos'); + const url = new URL(urlStr); + const spn = this.configurationService.getValue('http.proxyKerberosServicePrincipal') + || (process.platform === 'win32' ? `HTTP/${url.hostname}` : `HTTP@${url.hostname}`); + this.logService.debug('RequestService#lookupKerberosAuthorization Kerberos authentication lookup', `proxyURL:${url}`, `spn:${spn}`); + const client = await kerberos.initializeClient(spn); + const response = await client.step(''); + return 'Negotiate ' + response; + } catch (err) { + this.logService.debug('RequestService#lookupKerberosAuthorization Kerberos authentication failed', err); + return undefined; + } + } + async loadCertificates(): Promise { const proxyAgent = await import('@vscode/proxy-agent'); return proxyAgent.loadSystemCertificates({ log: this.logService }); @@ -165,7 +184,7 @@ export async function nodeRequest(options: NodeRequestOptions, token: Cancellati stream = res.pipe(createGunzip()); } - resolve({ res, stream: streamToBufferReadableStream(stream) } as IRequestContext); + resolve({ res, stream: streamToBufferReadableStream(stream) } satisfies IRequestContext); } }); diff --git a/src/vs/platform/secrets/common/secrets.ts b/src/vs/platform/secrets/common/secrets.ts index 7bba894a909..c13e030eeed 100644 --- a/src/vs/platform/secrets/common/secrets.ts +++ b/src/vs/platform/secrets/common/secrets.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SequencerByKey } from 'vs/base/common/async'; -import { IEncryptionService } from 'vs/platform/encryption/common/encryptionService'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IStorageService, InMemoryStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { Emitter, Event } from 'vs/base/common/event'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { Lazy } from 'vs/base/common/lazy'; +import { SequencerByKey } from '../../../base/common/async.js'; +import { IEncryptionService } from '../../encryption/common/encryptionService.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IStorageService, InMemoryStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { ILogService } from '../../log/common/log.js'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { Lazy } from '../../../base/common/lazy.js'; export const ISecretStorageService = createDecorator('secretStorageService'); diff --git a/src/vs/platform/secrets/test/common/secrets.test.ts b/src/vs/platform/secrets/test/common/secrets.test.ts index 50def3a9a92..e1603df791f 100644 --- a/src/vs/platform/secrets/test/common/secrets.test.ts +++ b/src/vs/platform/secrets/test/common/secrets.test.ts @@ -5,11 +5,11 @@ import assert from 'assert'; import * as sinon from 'sinon'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IEncryptionService, KnownStorageProvider } from 'vs/platform/encryption/common/encryptionService'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { BaseSecretStorageService } from 'vs/platform/secrets/common/secrets'; -import { InMemoryStorageService } from 'vs/platform/storage/common/storage'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IEncryptionService, KnownStorageProvider } from '../../../encryption/common/encryptionService.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { BaseSecretStorageService } from '../../common/secrets.js'; +import { InMemoryStorageService } from '../../../storage/common/storage.js'; class TestEncryptionService implements IEncryptionService { _serviceBrand: undefined; diff --git a/src/vs/platform/severityIcon/browser/severityIcon.ts b/src/vs/platform/severityIcon/browser/severityIcon.ts index 2ecb17404fb..73bfe9c2da1 100644 --- a/src/vs/platform/severityIcon/browser/severityIcon.ts +++ b/src/vs/platform/severityIcon/browser/severityIcon.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/severityIcon'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import Severity from 'vs/base/common/severity'; +import './media/severityIcon.css'; +import { Codicon } from '../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import Severity from '../../../base/common/severity.js'; export namespace SeverityIcon { diff --git a/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts b/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts index 5cb80e342cc..054f3b7419d 100644 --- a/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts +++ b/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts @@ -4,22 +4,22 @@ *--------------------------------------------------------------------------------------------*/ import { IpcMainEvent, MessagePortMain } from 'electron'; -import { validatedIpcMain } from 'vs/base/parts/ipc/electron-main/ipcMain'; -import { Barrier, DeferredPromise } from 'vs/base/common/async'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ISharedProcessConfiguration } from 'vs/platform/sharedProcess/node/sharedProcess'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IPolicyService } from 'vs/platform/policy/common/policy'; -import { ILoggerMainService } from 'vs/platform/log/electron-main/loggerService'; -import { UtilityProcess } from 'vs/platform/utilityProcess/electron-main/utilityProcess'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { parseSharedProcessDebugPort } from 'vs/platform/environment/node/environmentService'; -import { assertIsDefined } from 'vs/base/common/types'; -import { SharedProcessChannelConnection, SharedProcessRawConnection, SharedProcessLifecycle } from 'vs/platform/sharedProcess/common/sharedProcess'; -import { Emitter } from 'vs/base/common/event'; +import { validatedIpcMain } from '../../../base/parts/ipc/electron-main/ipcMain.js'; +import { Barrier, DeferredPromise } from '../../../base/common/async.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { ISharedProcessConfiguration } from '../node/sharedProcess.js'; +import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { IPolicyService } from '../../policy/common/policy.js'; +import { ILoggerMainService } from '../../log/electron-main/loggerService.js'; +import { UtilityProcess } from '../../utilityProcess/electron-main/utilityProcess.js'; +import { NullTelemetryService } from '../../telemetry/common/telemetryUtils.js'; +import { parseSharedProcessDebugPort } from '../../environment/node/environmentService.js'; +import { assertIsDefined } from '../../../base/common/types.js'; +import { SharedProcessChannelConnection, SharedProcessRawConnection, SharedProcessLifecycle } from '../common/sharedProcess.js'; +import { Emitter } from '../../../base/common/event.js'; export class SharedProcess extends Disposable { @@ -169,8 +169,9 @@ export class SharedProcess extends Disposable { this.utilityProcess.start({ type: 'shared-process', - entryPoint: 'vs/code/node/sharedProcess/sharedProcessMain', + entryPoint: 'vs/code/electron-utility/sharedProcess/sharedProcessMain', payload: this.createSharedProcessConfiguration(), + respondToAuthRequestsFromMainProcess: true, execArgv }); diff --git a/src/vs/platform/sharedProcess/node/sharedProcess.ts b/src/vs/platform/sharedProcess/node/sharedProcess.ts index 0c0e49c3a0b..d7ce3f00f7d 100644 --- a/src/vs/platform/sharedProcess/node/sharedProcess.ts +++ b/src/vs/platform/sharedProcess/node/sharedProcess.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IStringDictionary } from 'vs/base/common/collections'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { ILoggerResource, LogLevel } from 'vs/platform/log/common/log'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { PolicyDefinition, PolicyValue } from 'vs/platform/policy/common/policy'; -import { UriComponents, UriDto } from 'vs/base/common/uri'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { NativeParsedArgs } from '../../environment/common/argv.js'; +import { ILoggerResource, LogLevel } from '../../log/common/log.js'; +import { IUserDataProfile } from '../../userDataProfile/common/userDataProfile.js'; +import { PolicyDefinition, PolicyValue } from '../../policy/common/policy.js'; +import { UriComponents, UriDto } from '../../../base/common/uri.js'; export interface ISharedProcessConfiguration { readonly machineId: string; diff --git a/src/vs/platform/shell/node/shellEnv.ts b/src/vs/platform/shell/node/shellEnv.ts index b956c37aa2a..2d3ef3ead0d 100644 --- a/src/vs/platform/shell/node/shellEnv.ts +++ b/src/vs/platform/shell/node/shellEnv.ts @@ -4,20 +4,20 @@ *--------------------------------------------------------------------------------------------*/ import { spawn } from 'child_process'; -import { basename } from 'vs/base/common/path'; -import { localize } from 'vs/nls'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { CancellationError, isCancellationError } from 'vs/base/common/errors'; -import { IProcessEnvironment, isWindows, OS } from 'vs/base/common/platform'; -import { generateUuid } from 'vs/base/common/uuid'; -import { getSystemShell } from 'vs/base/node/shell'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { isLaunchedFromCli } from 'vs/platform/environment/node/argvHelper'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Promises } from 'vs/base/common/async'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { clamp } from 'vs/base/common/numbers'; +import { basename } from '../../../base/common/path.js'; +import { localize } from '../../../nls.js'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { CancellationError, isCancellationError } from '../../../base/common/errors.js'; +import { IProcessEnvironment, isWindows, OS } from '../../../base/common/platform.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { getSystemShell } from '../../../base/node/shell.js'; +import { NativeParsedArgs } from '../../environment/common/argv.js'; +import { isLaunchedFromCli } from '../../environment/node/argvHelper.js'; +import { ILogService } from '../../log/common/log.js'; +import { Promises } from '../../../base/common/async.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { clamp } from '../../../base/common/numbers.js'; let unixShellEnvPromise: Promise | undefined = undefined; diff --git a/src/vs/platform/sign/browser/signService.ts b/src/vs/platform/sign/browser/signService.ts index a9d699bf3b2..f2621541987 100644 --- a/src/vs/platform/sign/browser/signService.ts +++ b/src/vs/platform/sign/browser/signService.ts @@ -3,13 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { WindowIntervalTimer } from 'vs/base/browser/dom'; -import { mainWindow } from 'vs/base/browser/window'; -import { memoize } from 'vs/base/common/decorators'; -import { FileAccess } from 'vs/base/common/network'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { AbstractSignService, IVsdaValidator } from 'vs/platform/sign/common/abstractSignService'; -import { ISignService } from 'vs/platform/sign/common/sign'; +import { importAMDNodeModule, resolveAmdNodeModulePath } from '../../../amdX.js'; +import { WindowIntervalTimer } from '../../../base/browser/dom.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { isESM } from '../../../base/common/amd.js'; +import { memoize } from '../../../base/common/decorators.js'; +import { FileAccess } from '../../../base/common/network.js'; +import { IProductService } from '../../product/common/productService.js'; +import { AbstractSignService, IVsdaValidator } from '../common/abstractSignService.js'; +import { ISignService } from '../common/sign.js'; declare module vsdaWeb { export function sign(salted_message: string): string; @@ -62,7 +64,7 @@ export class SignService extends AbstractSignService implements ISignService { let [wasm] = await Promise.all([ this.getWasmBytes(), new Promise((resolve, reject) => { - require(['vsda'], resolve, reject); + importAMDNodeModule('vsda', 'rust/web/vsda.js').then(() => resolve(), reject); // todo@connor4312: there seems to be a bug(?) in vscode-loader with // require() not resolving in web once the script loads, so check manually @@ -74,7 +76,6 @@ export class SignService extends AbstractSignService implements ISignService { }).finally(() => checkInterval.dispose()), ]); - const keyBytes = new TextEncoder().encode(this.productService.serverLicense?.join('\n') || ''); for (let i = 0; i + STEP_SIZE < keyBytes.length; i += STEP_SIZE) { const key = await crypto.subtle.importKey('raw', keyBytes.slice(i + IV_SIZE, i + IV_SIZE + KEY_SIZE), { name: 'AES-CBC' }, false, ['decrypt']); @@ -87,7 +88,10 @@ export class SignService extends AbstractSignService implements ISignService { } private async getWasmBytes(): Promise { - const response = await fetch(FileAccess.asBrowserUri('vsda/../vsda_bg.wasm').toString(true)); + const url = isESM + ? resolveAmdNodeModulePath('vsda', 'rust/web/vsda_bg.wasm') + : FileAccess.asBrowserUri('vsda/../vsda_bg.wasm').toString(true); + const response = await fetch(url); if (!response.ok) { throw new Error('error loading vsda'); } diff --git a/src/vs/platform/sign/common/abstractSignService.ts b/src/vs/platform/sign/common/abstractSignService.ts index 6f7c91ba958..b49a8ea7bea 100644 --- a/src/vs/platform/sign/common/abstractSignService.ts +++ b/src/vs/platform/sign/common/abstractSignService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IMessage, ISignService } from 'vs/platform/sign/common/sign'; +import { IMessage, ISignService } from './sign.js'; export interface IVsdaSigner { sign(arg: string): string; diff --git a/src/vs/platform/sign/common/sign.ts b/src/vs/platform/sign/common/sign.ts index e760b314fc8..c26ffad73af 100644 --- a/src/vs/platform/sign/common/sign.ts +++ b/src/vs/platform/sign/common/sign.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const SIGN_SERVICE_ID = 'signService'; export const ISignService = createDecorator(SIGN_SERVICE_ID); diff --git a/src/vs/platform/sign/node/signService.ts b/src/vs/platform/sign/node/signService.ts index d07ba9cfbe9..a89a45edcb3 100644 --- a/src/vs/platform/sign/node/signService.ts +++ b/src/vs/platform/sign/node/signService.ts @@ -3,8 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AbstractSignService, IVsdaValidator } from 'vs/platform/sign/common/abstractSignService'; -import { ISignService } from 'vs/platform/sign/common/sign'; +import { importAMDNodeModule } from '../../../amdX.js'; +import { AbstractSignService, IVsdaValidator } from '../common/abstractSignService.js'; +import { ISignService } from '../common/sign.js'; declare module vsda { // the signer is a native module that for historical reasons uses a lower case class name @@ -28,7 +29,16 @@ export class SignService extends AbstractSignService implements ISignService { return this.vsda().then(vsda => new vsda.signer().sign(arg)); } - private vsda(): Promise { - return new Promise((resolve, reject) => require(['vsda'], resolve, reject)); + private async vsda(): Promise { + // ESM-uncomment-begin + if (typeof importAMDNodeModule === 'function') { /* fixes unused import, remove me */ } + const mod = 'vsda'; + const { default: vsda } = await import(mod); + return vsda; + // ESM-uncomment-end + + // ESM-comment-begin + // return importAMDNodeModule('vsda', 'index.js'); + // ESM-comment-end } } diff --git a/src/vs/platform/state/node/state.ts b/src/vs/platform/state/node/state.ts index a125c9955b9..d409432cf50 100644 --- a/src/vs/platform/state/node/state.ts +++ b/src/vs/platform/state/node/state.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IStateReadService = createDecorator('stateReadService'); export interface IStateReadService { diff --git a/src/vs/platform/state/node/stateService.ts b/src/vs/platform/state/node/stateService.ts index 46dd2baa43e..77f7c45bc11 100644 --- a/src/vs/platform/state/node/stateService.ts +++ b/src/vs/platform/state/node/stateService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ThrottledDelayer } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { isUndefined, isUndefinedOrNull } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStateReadService, IStateService } from 'vs/platform/state/node/state'; +import { ThrottledDelayer } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { isUndefined, isUndefinedOrNull } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { FileOperationError, FileOperationResult, IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { IStateReadService, IStateService } from './state.js'; type StorageDatabase = { [key: string]: unknown }; diff --git a/src/vs/platform/state/test/node/state.test.ts b/src/vs/platform/state/test/node/state.test.ts index acce49d3e9c..d9971ee560e 100644 --- a/src/vs/platform/state/test/node/state.test.ts +++ b/src/vs/platform/state/test/node/state.test.ts @@ -4,20 +4,20 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { readFileSync } from 'fs'; +import { readFileSync, promises } from 'fs'; import { tmpdir } from 'os'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { join } from 'vs/base/common/path'; -import { URI } from 'vs/base/common/uri'; -import { Promises, writeFileSync } from 'vs/base/node/pfs'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { flakySuite, getRandomTestPath } from 'vs/base/test/node/testUtils'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { FileStorage, SaveStrategy } from 'vs/platform/state/node/stateService'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { join } from '../../../../base/common/path.js'; +import { URI } from '../../../../base/common/uri.js'; +import { Promises, writeFileSync } from '../../../../base/node/pfs.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { flakySuite, getRandomTestPath } from '../../../../base/test/node/testUtils.js'; +import { IFileService } from '../../../files/common/files.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { DiskFileSystemProvider } from '../../../files/node/diskFileSystemProvider.js'; +import { ILogService, NullLogService } from '../../../log/common/log.js'; +import { FileStorage, SaveStrategy } from '../../node/stateService.js'; flakySuite('StateService', () => { @@ -37,7 +37,7 @@ flakySuite('StateService', () => { diskFileSystemProvider = disposables.add(new DiskFileSystemProvider(logService)); disposables.add(fileService.registerProvider(Schemas.file, diskFileSystemProvider)); - return Promises.mkdir(testDir, { recursive: true }); + return promises.mkdir(testDir, { recursive: true }); }); teardown(() => { diff --git a/src/vs/platform/storage/common/storage.ts b/src/vs/platform/storage/common/storage.ts index fe730ff5cda..b120f38a296 100644 --- a/src/vs/platform/storage/common/storage.ts +++ b/src/vs/platform/storage/common/storage.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Promises, RunOnceScheduler, runWhenGlobalIdle } from 'vs/base/common/async'; -import { Emitter, Event, PauseableEmitter } from 'vs/base/common/event'; -import { Disposable, DisposableStore, dispose, MutableDisposable } from 'vs/base/common/lifecycle'; -import { mark } from 'vs/base/common/performance'; -import { isUndefinedOrNull } from 'vs/base/common/types'; -import { InMemoryStorageDatabase, IStorage, IStorageChangeEvent, Storage, StorageHint, StorageValue } from 'vs/base/parts/storage/common/storage'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { isUserDataProfile, IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { Promises, RunOnceScheduler, runWhenGlobalIdle } from '../../../base/common/async.js'; +import { Emitter, Event, PauseableEmitter } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, dispose, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { mark } from '../../../base/common/performance.js'; +import { isUndefinedOrNull } from '../../../base/common/types.js'; +import { InMemoryStorageDatabase, IStorage, IStorageChangeEvent, Storage, StorageHint, StorageValue } from '../../../base/parts/storage/common/storage.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { isUserDataProfile, IUserDataProfile } from '../../userDataProfile/common/userDataProfile.js'; +import { IAnyWorkspaceIdentifier } from '../../workspace/common/workspace.js'; export const IS_NEW_KEY = '__$__isNewStorageMarker'; export const TARGET_KEY = '__$__targetStorageMarker'; diff --git a/src/vs/platform/storage/common/storageIpc.ts b/src/vs/platform/storage/common/storageIpc.ts index 7abbec236c6..117052ea26c 100644 --- a/src/vs/platform/storage/common/storageIpc.ts +++ b/src/vs/platform/storage/common/storageIpc.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { UriDto } from 'vs/base/common/uri'; -import { IChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IStorageDatabase, IStorageItemsChangeEvent, IUpdateRequest } from 'vs/base/parts/storage/common/storage'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { ISerializedSingleFolderWorkspaceIdentifier, ISerializedWorkspaceIdentifier, IEmptyWorkspaceIdentifier, IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { UriDto } from '../../../base/common/uri.js'; +import { IChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { IStorageDatabase, IStorageItemsChangeEvent, IUpdateRequest } from '../../../base/parts/storage/common/storage.js'; +import { IUserDataProfile } from '../../userDataProfile/common/userDataProfile.js'; +import { ISerializedSingleFolderWorkspaceIdentifier, ISerializedWorkspaceIdentifier, IEmptyWorkspaceIdentifier, IAnyWorkspaceIdentifier } from '../../workspace/common/workspace.js'; export type Key = string; export type Value = string; diff --git a/src/vs/platform/storage/common/storageService.ts b/src/vs/platform/storage/common/storageService.ts index 4cfe09ec6d4..c7181a89705 100644 --- a/src/vs/platform/storage/common/storageService.ts +++ b/src/vs/platform/storage/common/storageService.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Promises } from 'vs/base/common/async'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { joinPath } from 'vs/base/common/resources'; -import { IStorage, Storage } from 'vs/base/parts/storage/common/storage'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IRemoteService } from 'vs/platform/ipc/common/services'; -import { AbstractStorageService, isProfileUsingDefaultStorage, StorageScope, WillSaveStateReason } from 'vs/platform/storage/common/storage'; -import { ApplicationStorageDatabaseClient, ProfileStorageDatabaseClient, WorkspaceStorageDatabaseClient } from 'vs/platform/storage/common/storageIpc'; -import { isUserDataProfile, IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { Promises } from '../../../base/common/async.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { joinPath } from '../../../base/common/resources.js'; +import { IStorage, Storage } from '../../../base/parts/storage/common/storage.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IRemoteService } from '../../ipc/common/services.js'; +import { AbstractStorageService, isProfileUsingDefaultStorage, StorageScope, WillSaveStateReason } from './storage.js'; +import { ApplicationStorageDatabaseClient, ProfileStorageDatabaseClient, WorkspaceStorageDatabaseClient } from './storageIpc.js'; +import { isUserDataProfile, IUserDataProfile } from '../../userDataProfile/common/userDataProfile.js'; +import { IAnyWorkspaceIdentifier } from '../../workspace/common/workspace.js'; export class RemoteStorageService extends AbstractStorageService { diff --git a/src/vs/platform/storage/electron-main/storageIpc.ts b/src/vs/platform/storage/electron-main/storageIpc.ts index 95c1d083aca..153856a170c 100644 --- a/src/vs/platform/storage/electron-main/storageIpc.ts +++ b/src/vs/platform/storage/electron-main/storageIpc.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { revive } from 'vs/base/common/marshalling'; -import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IBaseSerializableStorageRequest, ISerializableItemsChangeEvent, ISerializableUpdateRequest, Key, Value } from 'vs/platform/storage/common/storageIpc'; -import { IStorageChangeEvent, IStorageMain } from 'vs/platform/storage/electron-main/storageMain'; -import { IStorageMainService } from 'vs/platform/storage/electron-main/storageMainService'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { reviveIdentifier, IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { ILogService } from '../../log/common/log.js'; +import { IBaseSerializableStorageRequest, ISerializableItemsChangeEvent, ISerializableUpdateRequest, Key, Value } from '../common/storageIpc.js'; +import { IStorageChangeEvent, IStorageMain } from './storageMain.js'; +import { IStorageMainService } from './storageMainService.js'; +import { IUserDataProfile } from '../../userDataProfile/common/userDataProfile.js'; +import { reviveIdentifier, IAnyWorkspaceIdentifier } from '../../workspace/common/workspace.js'; export class StorageDatabaseChannel extends Disposable implements IServerChannel { diff --git a/src/vs/platform/storage/electron-main/storageMain.ts b/src/vs/platform/storage/electron-main/storageMain.ts index c110f28015b..8c945fe6019 100644 --- a/src/vs/platform/storage/electron-main/storageMain.ts +++ b/src/vs/platform/storage/electron-main/storageMain.ts @@ -3,24 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { top } from 'vs/base/common/arrays'; -import { DeferredPromise } from 'vs/base/common/async'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { join } from 'vs/base/common/path'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { URI } from 'vs/base/common/uri'; -import { Promises } from 'vs/base/node/pfs'; -import { InMemoryStorageDatabase, IStorage, Storage, StorageHint, StorageState } from 'vs/base/parts/storage/common/storage'; -import { ISQLiteStorageDatabaseLoggingOptions, SQLiteStorageDatabase } from 'vs/base/parts/storage/node/storage'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { ILogService, LogLevel } from 'vs/platform/log/common/log'; -import { IS_NEW_KEY } from 'vs/platform/storage/common/storage'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { currentSessionDateStorageKey, firstSessionDateStorageKey, lastSessionDateStorageKey } from 'vs/platform/telemetry/common/telemetry'; -import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { Schemas } from 'vs/base/common/network'; +import * as fs from 'fs'; +import { top } from '../../../base/common/arrays.js'; +import { DeferredPromise } from '../../../base/common/async.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { join } from '../../../base/common/path.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { URI } from '../../../base/common/uri.js'; +import { Promises } from '../../../base/node/pfs.js'; +import { InMemoryStorageDatabase, IStorage, Storage, StorageHint, StorageState } from '../../../base/parts/storage/common/storage.js'; +import { ISQLiteStorageDatabaseLoggingOptions, SQLiteStorageDatabase } from '../../../base/parts/storage/node/storage.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { ILogService, LogLevel } from '../../log/common/log.js'; +import { IS_NEW_KEY } from '../common/storage.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { currentSessionDateStorageKey, firstSessionDateStorageKey, lastSessionDateStorageKey } from '../../telemetry/common/telemetry.js'; +import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IAnyWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { Schemas } from '../../../base/common/network.js'; export interface IStorageMainOptions { @@ -403,7 +404,7 @@ export class WorkspaceStorageMain extends BaseStorageMain { } // Ensure storage folder exists - await Promises.mkdir(workspaceStorageFolderPath, { recursive: true }); + await fs.promises.mkdir(workspaceStorageFolderPath, { recursive: true }); // Write metadata into folder (but do not await) this.ensureWorkspaceStorageFolderMeta(workspaceStorageFolderPath); diff --git a/src/vs/platform/storage/electron-main/storageMainService.ts b/src/vs/platform/storage/electron-main/storageMainService.ts index 569327c095d..94664c7eaef 100644 --- a/src/vs/platform/storage/electron-main/storageMainService.ts +++ b/src/vs/platform/storage/electron-main/storageMainService.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IStorage } from 'vs/base/parts/storage/common/storage'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILifecycleMainService, LifecycleMainPhase, ShutdownReason } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { AbstractStorageService, isProfileUsingDefaultStorage, IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { ApplicationStorageMain, ProfileStorageMain, InMemoryStorageMain, IStorageMain, IStorageMainOptions, WorkspaceStorageMain, IStorageChangeEvent } from 'vs/platform/storage/electron-main/storageMain'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IUserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile'; -import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { Schemas } from 'vs/base/common/network'; +import { URI } from '../../../base/common/uri.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IStorage } from '../../../base/parts/storage/common/storage.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILifecycleMainService, LifecycleMainPhase, ShutdownReason } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { AbstractStorageService, isProfileUsingDefaultStorage, IStorageService, StorageScope, StorageTarget } from '../common/storage.js'; +import { ApplicationStorageMain, ProfileStorageMain, InMemoryStorageMain, IStorageMain, IStorageMainOptions, WorkspaceStorageMain, IStorageChangeEvent } from './storageMain.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { IUserDataProfilesMainService } from '../../userDataProfile/electron-main/userDataProfile.js'; +import { IAnyWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { Schemas } from '../../../base/common/network.js'; //#region Storage Main Service (intent: make application, profile and workspace storage accessible to windows from main process) diff --git a/src/vs/platform/storage/test/common/storageService.test.ts b/src/vs/platform/storage/test/common/storageService.test.ts index d781cf027e6..f3cb3e5c999 100644 --- a/src/vs/platform/storage/test/common/storageService.test.ts +++ b/src/vs/platform/storage/test/common/storageService.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import { deepStrictEqual, ok, strictEqual } from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { InMemoryStorageService, IStorageService, IStorageTargetChangeEvent, IStorageValueChangeEvent, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { InMemoryStorageService, IStorageService, IStorageTargetChangeEvent, IStorageValueChangeEvent, StorageScope, StorageTarget } from '../../common/storage.js'; export function createSuite(params: { setup: () => Promise; teardown: (service: T) => Promise }): void { diff --git a/src/vs/platform/storage/test/electron-main/storageMainService.test.ts b/src/vs/platform/storage/test/electron-main/storageMainService.test.ts index 1553ad0b405..8285d2790b9 100644 --- a/src/vs/platform/storage/test/electron-main/storageMainService.test.ts +++ b/src/vs/platform/storage/test/electron-main/storageMainService.test.ts @@ -4,28 +4,28 @@ *--------------------------------------------------------------------------------------------*/ import { notStrictEqual, strictEqual } from 'assert'; -import { Schemas } from 'vs/base/common/network'; -import { joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { OPTIONS, parseArgs } from 'vs/platform/environment/node/argv'; -import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { NullLogService } from 'vs/platform/log/common/log'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { SaveStrategy, StateService } from 'vs/platform/state/node/stateService'; -import { IS_NEW_KEY, StorageScope } from 'vs/platform/storage/common/storage'; -import { IStorageChangeEvent, IStorageMain, IStorageMainOptions } from 'vs/platform/storage/electron-main/storageMain'; -import { StorageMainService } from 'vs/platform/storage/electron-main/storageMainService'; -import { currentSessionDateStorageKey, firstSessionDateStorageKey } from 'vs/platform/telemetry/common/telemetry'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { UserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile'; -import { TestLifecycleMainService } from 'vs/platform/test/electron-main/workbenchTestServices'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { DisposableStore } from 'vs/base/common/lifecycle'; +import { Schemas } from '../../../../base/common/network.js'; +import { joinPath } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { generateUuid } from '../../../../base/common/uuid.js'; +import { OPTIONS, parseArgs } from '../../../environment/node/argv.js'; +import { NativeEnvironmentService } from '../../../environment/node/environmentService.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { ILifecycleMainService } from '../../../lifecycle/electron-main/lifecycleMainService.js'; +import { NullLogService } from '../../../log/common/log.js'; +import product from '../../../product/common/product.js'; +import { IProductService } from '../../../product/common/productService.js'; +import { SaveStrategy, StateService } from '../../../state/node/stateService.js'; +import { IS_NEW_KEY, StorageScope } from '../../common/storage.js'; +import { IStorageChangeEvent, IStorageMain, IStorageMainOptions } from '../../electron-main/storageMain.js'; +import { StorageMainService } from '../../electron-main/storageMainService.js'; +import { currentSessionDateStorageKey, firstSessionDateStorageKey } from '../../../telemetry/common/telemetry.js'; +import { UriIdentityService } from '../../../uriIdentity/common/uriIdentityService.js'; +import { IUserDataProfile } from '../../../userDataProfile/common/userDataProfile.js'; +import { UserDataProfilesMainService } from '../../../userDataProfile/electron-main/userDataProfile.js'; +import { TestLifecycleMainService } from '../../../test/electron-main/workbenchTestServices.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; suite('StorageMainService', function () { diff --git a/src/vs/platform/telemetry/browser/1dsAppender.ts b/src/vs/platform/telemetry/browser/1dsAppender.ts index 2857c030813..99792303d01 100644 --- a/src/vs/platform/telemetry/browser/1dsAppender.ts +++ b/src/vs/platform/telemetry/browser/1dsAppender.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AbstractOneDataSystemAppender, IAppInsightsCore } from 'vs/platform/telemetry/common/1dsAppender'; +import { AbstractOneDataSystemAppender, IAppInsightsCore } from '../common/1dsAppender.js'; export class OneDataSystemWebAppender extends AbstractOneDataSystemAppender { diff --git a/src/vs/platform/telemetry/browser/errorTelemetry.ts b/src/vs/platform/telemetry/browser/errorTelemetry.ts index 61e5836f539..964ef588d5d 100644 --- a/src/vs/platform/telemetry/browser/errorTelemetry.ts +++ b/src/vs/platform/telemetry/browser/errorTelemetry.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { mainWindow } from 'vs/base/browser/window'; -import { ErrorNoTelemetry } from 'vs/base/common/errors'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import BaseErrorTelemetry, { ErrorEvent } from 'vs/platform/telemetry/common/errorTelemetry'; +import { mainWindow } from '../../../base/browser/window.js'; +import { ErrorNoTelemetry } from '../../../base/common/errors.js'; +import { toDisposable } from '../../../base/common/lifecycle.js'; +import BaseErrorTelemetry, { ErrorEvent } from '../common/errorTelemetry.js'; export default class ErrorTelemetry extends BaseErrorTelemetry { protected override installErrorListeners(): void { diff --git a/src/vs/platform/telemetry/common/1dsAppender.ts b/src/vs/platform/telemetry/common/1dsAppender.ts index c54187f89c9..5d32d93687d 100644 --- a/src/vs/platform/telemetry/common/1dsAppender.ts +++ b/src/vs/platform/telemetry/common/1dsAppender.ts @@ -5,10 +5,11 @@ 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 { 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. // Allows us to more easily build mock objects for testing as the interface is quite large and we only need a few properties. @@ -22,8 +23,18 @@ const endpointUrl = 'https://mobile.events.data.microsoft.com/OneCollector/1.0'; const endpointHealthUrl = 'https://mobile.events.data.microsoft.com/ping'; async function getClient(instrumentationKey: string, addInternalFlag?: boolean, xhrOverride?: IXHROverride): Promise { - 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-begin + // if (isWeb) { /* fix the import warning */ } + // const oneDs = await importAMDNodeModule('@microsoft/1ds-core-js', 'dist/ms.core.js'); + // const postPlugin = await importAMDNodeModule('@microsoft/1ds-post-js', 'dist/ms.post.js'); + // ESM-comment-end + // ESM-uncomment-begin + // eslint-disable-next-line local/code-amd-node-module + const oneDs = isWeb ? await importAMDNodeModule('@microsoft/1ds-core-js', 'bundle/ms.core.min.js') : await import('@microsoft/1ds-core-js'); + // eslint-disable-next-line local/code-amd-node-module + const postPlugin = isWeb ? await importAMDNodeModule('@microsoft/1ds-post-js', 'bundle/ms.post.min.js') : await import('@microsoft/1ds-post-js'); + // ESM-uncomment-end + const appInsightsCore = new oneDs.AppInsightsCore(); const collectorChannelPlugin: PostChannel = new postPlugin.PostChannel(); // Configure the app insights core to send to collector++ and disable logging of debug info diff --git a/src/vs/platform/telemetry/common/commonProperties.ts b/src/vs/platform/telemetry/common/commonProperties.ts index b649cb80775..4ec0cf87037 100644 --- a/src/vs/platform/telemetry/common/commonProperties.ts +++ b/src/vs/platform/telemetry/common/commonProperties.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isLinuxSnap, platform, Platform, PlatformToString } from 'vs/base/common/platform'; -import { env, platform as nodePlatform } from 'vs/base/common/process'; -import { generateUuid } from 'vs/base/common/uuid'; -import { ICommonProperties } from 'vs/platform/telemetry/common/telemetry'; +import { isLinuxSnap, platform, Platform, PlatformToString } from '../../../base/common/platform.js'; +import { env, platform as nodePlatform } from '../../../base/common/process.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { ICommonProperties } from './telemetry.js'; function getPlatformDetail(hostname: string): string | undefined { if (platform === Platform.Linux && /^penguin(\.|$)/i.test(hostname)) { diff --git a/src/vs/platform/telemetry/common/errorTelemetry.ts b/src/vs/platform/telemetry/common/errorTelemetry.ts index a872cbb4dee..93216349c14 100644 --- a/src/vs/platform/telemetry/common/errorTelemetry.ts +++ b/src/vs/platform/telemetry/common/errorTelemetry.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { binarySearch } from 'vs/base/common/arrays'; -import { errorHandler, ErrorNoTelemetry } from 'vs/base/common/errors'; -import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { safeStringify } from 'vs/base/common/objects'; -import { FileOperationError } from 'vs/platform/files/common/files'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { binarySearch } from '../../../base/common/arrays.js'; +import { errorHandler, ErrorNoTelemetry } from '../../../base/common/errors.js'; +import { DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { safeStringify } from '../../../base/common/objects.js'; +import { FileOperationError } from '../../files/common/files.js'; +import { ITelemetryService } from './telemetry.js'; type ErrorEventFragment = { owner: 'lramos15, sbatten'; diff --git a/src/vs/platform/telemetry/common/remoteTelemetryChannel.ts b/src/vs/platform/telemetry/common/remoteTelemetryChannel.ts index 97fb3ec4989..8f6e27e28a8 100644 --- a/src/vs/platform/telemetry/common/remoteTelemetryChannel.ts +++ b/src/vs/platform/telemetry/common/remoteTelemetryChannel.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { ITelemetryAppender } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IServerTelemetryService } from 'vs/platform/telemetry/common/serverTelemetryService'; +import { Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { TelemetryLevel } from './telemetry.js'; +import { ITelemetryAppender } from './telemetryUtils.js'; +import { IServerTelemetryService } from './serverTelemetryService.js'; export class ServerTelemetryChannel extends Disposable implements IServerChannel { constructor( diff --git a/src/vs/platform/telemetry/common/serverTelemetryService.ts b/src/vs/platform/telemetry/common/serverTelemetryService.ts index 9581af7e0f9..f6fc225ab84 100644 --- a/src/vs/platform/telemetry/common/serverTelemetryService.ts +++ b/src/vs/platform/telemetry/common/serverTelemetryService.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { refineServiceDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings'; -import { ITelemetryData, ITelemetryService, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { ITelemetryServiceConfig, TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; -import { NullTelemetryServiceShape } from 'vs/platform/telemetry/common/telemetryUtils'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { refineServiceDecorator } from '../../instantiation/common/instantiation.js'; +import { IProductService } from '../../product/common/productService.js'; +import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from './gdprTypings.js'; +import { ITelemetryData, ITelemetryService, TelemetryLevel } from './telemetry.js'; +import { ITelemetryServiceConfig, TelemetryService } from './telemetryService.js'; +import { NullTelemetryServiceShape } from './telemetryUtils.js'; export interface IServerTelemetryService extends ITelemetryService { updateInjectedTelemetryLevel(telemetryLevel: TelemetryLevel): Promise; diff --git a/src/vs/platform/telemetry/common/telemetry.ts b/src/vs/platform/telemetry/common/telemetry.ts index d6b4179b71f..6bfcb9159cd 100644 --- a/src/vs/platform/telemetry/common/telemetry.ts +++ b/src/vs/platform/telemetry/common/telemetry.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from './gdprTypings.js'; export const ITelemetryService = createDecorator('telemetryService'); diff --git a/src/vs/platform/telemetry/common/telemetryIpc.ts b/src/vs/platform/telemetry/common/telemetryIpc.ts index 2c4b9b87569..64eaed7d289 100644 --- a/src/vs/platform/telemetry/common/telemetryIpc.ts +++ b/src/vs/platform/telemetry/common/telemetryIpc.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { ITelemetryAppender } from 'vs/platform/telemetry/common/telemetryUtils'; +import { Event } from '../../../base/common/event.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { ITelemetryAppender } from './telemetryUtils.js'; export interface ITelemetryLog { eventName: string; diff --git a/src/vs/platform/telemetry/common/telemetryLogAppender.ts b/src/vs/platform/telemetry/common/telemetryLogAppender.ts index ba49e5a64e4..5d0d830b362 100644 --- a/src/vs/platform/telemetry/common/telemetryLogAppender.ts +++ b/src/vs/platform/telemetry/common/telemetryLogAppender.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { localize } from 'vs/nls'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ILogService, ILogger, ILoggerService, LogLevel } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ITelemetryAppender, isLoggingOnly, supportsTelemetry, telemetryLogId, validateTelemetryData } from 'vs/platform/telemetry/common/telemetryUtils'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { localize } from '../../../nls.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { ILogService, ILogger, ILoggerService, LogLevel } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { ITelemetryAppender, isLoggingOnly, supportsTelemetry, telemetryLogId, validateTelemetryData } from './telemetryUtils.js'; export class TelemetryLogAppender extends Disposable implements ITelemetryAppender { diff --git a/src/vs/platform/telemetry/common/telemetryService.ts b/src/vs/platform/telemetry/common/telemetryService.ts index 245bb41b5d8..51fbb8fa753 100644 --- a/src/vs/platform/telemetry/common/telemetryService.ts +++ b/src/vs/platform/telemetry/common/telemetryService.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { mixin } from 'vs/base/common/objects'; -import { isWeb } from 'vs/base/common/platform'; -import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import { localize } from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ConfigurationScope, Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings'; -import { ITelemetryData, ITelemetryService, TelemetryConfiguration, TelemetryLevel, TELEMETRY_CRASH_REPORTER_SETTING_ID, TELEMETRY_OLD_SETTING_ID, TELEMETRY_SECTION_ID, TELEMETRY_SETTING_ID, ICommonProperties } from 'vs/platform/telemetry/common/telemetry'; -import { cleanData, getTelemetryLevel, ITelemetryAppender } from 'vs/platform/telemetry/common/telemetryUtils'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { mixin } from '../../../base/common/objects.js'; +import { isWeb } from '../../../base/common/platform.js'; +import { escapeRegExpCharacters } from '../../../base/common/strings.js'; +import { localize } from '../../../nls.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { ConfigurationScope, Extensions, IConfigurationRegistry } from '../../configuration/common/configurationRegistry.js'; +import product from '../../product/common/product.js'; +import { IProductService } from '../../product/common/productService.js'; +import { Registry } from '../../registry/common/platform.js'; +import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from './gdprTypings.js'; +import { ITelemetryData, ITelemetryService, TelemetryConfiguration, TelemetryLevel, TELEMETRY_CRASH_REPORTER_SETTING_ID, TELEMETRY_OLD_SETTING_ID, TELEMETRY_SECTION_ID, TELEMETRY_SETTING_ID, ICommonProperties } from './telemetry.js'; +import { cleanData, getTelemetryLevel, ITelemetryAppender } from './telemetryUtils.js'; export interface ITelemetryServiceConfig { appenders: ITelemetryAppender[]; diff --git a/src/vs/platform/telemetry/common/telemetryUtils.ts b/src/vs/platform/telemetry/common/telemetryUtils.ts index ec72e1a0829..4c0ab8943d6 100644 --- a/src/vs/platform/telemetry/common/telemetryUtils.ts +++ b/src/vs/platform/telemetry/common/telemetryUtils.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { cloneAndChange, safeStringify } from 'vs/base/common/objects'; -import { isObject } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { getRemoteName } from 'vs/platform/remote/common/remoteHosts'; -import { verifyMicrosoftInternalDomain } from 'vs/platform/telemetry/common/commonProperties'; -import { ICustomEndpointTelemetryService, ITelemetryData, ITelemetryEndpoint, ITelemetryService, TelemetryConfiguration, TelemetryLevel, TELEMETRY_CRASH_REPORTER_SETTING_ID, TELEMETRY_OLD_SETTING_ID, TELEMETRY_SETTING_ID } from 'vs/platform/telemetry/common/telemetry'; +import { cloneAndChange, safeStringify } from '../../../base/common/objects.js'; +import { isObject } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IProductService } from '../../product/common/productService.js'; +import { getRemoteName } from '../../remote/common/remoteHosts.js'; +import { verifyMicrosoftInternalDomain } from './commonProperties.js'; +import { ICustomEndpointTelemetryService, ITelemetryData, ITelemetryEndpoint, ITelemetryService, TelemetryConfiguration, TelemetryLevel, TELEMETRY_CRASH_REPORTER_SETTING_ID, TELEMETRY_OLD_SETTING_ID, TELEMETRY_SETTING_ID } from './telemetry.js'; /** * A special class used to denoting a telemetry value which should not be clean. diff --git a/src/vs/platform/telemetry/electron-main/telemetryUtils.ts b/src/vs/platform/telemetry/electron-main/telemetryUtils.ts index 95e993f8462..bf16f18b9a7 100644 --- a/src/vs/platform/telemetry/electron-main/telemetryUtils.ts +++ b/src/vs/platform/telemetry/electron-main/telemetryUtils.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ILogService } from 'vs/platform/log/common/log'; -import { IStateService } from 'vs/platform/state/node/state'; -import { machineIdKey, sqmIdKey, devDeviceIdKey } from 'vs/platform/telemetry/common/telemetry'; -import { resolveMachineId as resolveNodeMachineId, resolveSqmId as resolveNodeSqmId, resolvedevDeviceId as resolveNodedevDeviceId } from 'vs/platform/telemetry/node/telemetryUtils'; +import { ILogService } from '../../log/common/log.js'; +import { IStateService } from '../../state/node/state.js'; +import { machineIdKey, sqmIdKey, devDeviceIdKey } from '../common/telemetry.js'; +import { resolveMachineId as resolveNodeMachineId, resolveSqmId as resolveNodeSqmId, resolvedevDeviceId as resolveNodedevDeviceId } from '../node/telemetryUtils.js'; export async function resolveMachineId(stateService: IStateService, logService: ILogService): Promise { // Call the node layers implementation to avoid code duplication diff --git a/src/vs/platform/telemetry/electron-sandbox/customEndpointTelemetryService.ts b/src/vs/platform/telemetry/electron-sandbox/customEndpointTelemetryService.ts index a54bbdf6901..97a41b21d5b 100644 --- a/src/vs/platform/telemetry/electron-sandbox/customEndpointTelemetryService.ts +++ b/src/vs/platform/telemetry/electron-sandbox/customEndpointTelemetryService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSharedProcessRemoteService } from 'vs/platform/ipc/electron-sandbox/services'; -import { ICustomEndpointTelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { registerSharedProcessRemoteService } from '../../ipc/electron-sandbox/services.js'; +import { ICustomEndpointTelemetryService } from '../common/telemetry.js'; registerSharedProcessRemoteService(ICustomEndpointTelemetryService, 'customEndpointTelemetry'); diff --git a/src/vs/platform/telemetry/node/1dsAppender.ts b/src/vs/platform/telemetry/node/1dsAppender.ts index 63805143d49..08be57db219 100644 --- a/src/vs/platform/telemetry/node/1dsAppender.ts +++ b/src/vs/platform/telemetry/node/1dsAppender.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import type { IPayloadData, IXHROverride } from '@microsoft/1ds-post-js'; -import { streamToBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IRequestOptions } from 'vs/base/parts/request/common/request'; -import { IRequestService } from 'vs/platform/request/common/request'; +import { streamToBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IRequestOptions } from '../../../base/parts/request/common/request.js'; +import { IRequestService } from '../../request/common/request.js'; import * as https from 'https'; -import { AbstractOneDataSystemAppender, IAppInsightsCore } from 'vs/platform/telemetry/common/1dsAppender'; +import { AbstractOneDataSystemAppender, IAppInsightsCore } from '../common/1dsAppender.js'; type OnCompleteFunc = (status: number, headers: { [headerName: string]: string }, response?: string) => void; diff --git a/src/vs/platform/telemetry/node/customEndpointTelemetryService.ts b/src/vs/platform/telemetry/node/customEndpointTelemetryService.ts index d697c46cbf3..894ff8cca30 100644 --- a/src/vs/platform/telemetry/node/customEndpointTelemetryService.ts +++ b/src/vs/platform/telemetry/node/customEndpointTelemetryService.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { FileAccess } from 'vs/base/common/network'; -import { Client as TelemetryClient } from 'vs/base/parts/ipc/node/ipc.cp'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ILogService, ILoggerService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ICustomEndpointTelemetryService, ITelemetryData, ITelemetryEndpoint, ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { TelemetryAppenderClient } from 'vs/platform/telemetry/common/telemetryIpc'; -import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender'; -import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; +import { FileAccess } from '../../../base/common/network.js'; +import { Client as TelemetryClient } from '../../../base/parts/ipc/node/ipc.cp.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { ILogService, ILoggerService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { ICustomEndpointTelemetryService, ITelemetryData, ITelemetryEndpoint, ITelemetryService } from '../common/telemetry.js'; +import { TelemetryAppenderClient } from '../common/telemetryIpc.js'; +import { TelemetryLogAppender } from '../common/telemetryLogAppender.js'; +import { TelemetryService } from '../common/telemetryService.js'; export class CustomEndpointTelemetryService implements ICustomEndpointTelemetryService { declare readonly _serviceBrand: undefined; diff --git a/src/vs/platform/telemetry/node/errorTelemetry.ts b/src/vs/platform/telemetry/node/errorTelemetry.ts index 7564814317c..933182f0dfb 100644 --- a/src/vs/platform/telemetry/node/errorTelemetry.ts +++ b/src/vs/platform/telemetry/node/errorTelemetry.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isCancellationError, isSigPipeError, onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors'; -import BaseErrorTelemetry from 'vs/platform/telemetry/common/errorTelemetry'; +import { isCancellationError, isSigPipeError, onUnexpectedError, setUnexpectedErrorHandler } from '../../../base/common/errors.js'; +import BaseErrorTelemetry from '../common/errorTelemetry.js'; export default class ErrorTelemetry extends BaseErrorTelemetry { protected override installErrorListeners(): void { diff --git a/src/vs/platform/telemetry/node/telemetry.ts b/src/vs/platform/telemetry/node/telemetry.ts index 72f87dddf35..21fc5856d79 100644 --- a/src/vs/platform/telemetry/node/telemetry.ts +++ b/src/vs/platform/telemetry/node/telemetry.ts @@ -3,8 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { join } from 'vs/base/common/path'; -import { Promises } from 'vs/base/node/pfs'; +import * as fs from 'fs'; +import { join } from '../../../base/common/path.js'; +import { Promises } from '../../../base/node/pfs.js'; export async function buildTelemetryMessage(appRoot: string, extensionsPath?: string): Promise { const mergedTelemetry = Object.create(null); @@ -21,7 +22,7 @@ export async function buildTelemetryMessage(appRoot: string, extensionsPath?: st const files = await Promises.readdir(extensionsPath); for (const file of files) { try { - const fileStat = await Promises.stat(join(extensionsPath, file)); + const fileStat = await fs.promises.stat(join(extensionsPath, file)); if (fileStat.isDirectory()) { dirs.push(file); } @@ -39,15 +40,15 @@ export async function buildTelemetryMessage(appRoot: string, extensionsPath?: st } for (const folder of telemetryJsonFolders) { - const contents = (await Promises.readFile(join(extensionsPath, folder, 'telemetry.json'))).toString(); + const contents = (await fs.promises.readFile(join(extensionsPath, folder, 'telemetry.json'))).toString(); mergeTelemetry(contents, folder); } } - let contents = (await Promises.readFile(join(appRoot, 'telemetry-core.json'))).toString(); + let contents = (await fs.promises.readFile(join(appRoot, 'telemetry-core.json'))).toString(); mergeTelemetry(contents, 'vscode-core'); - contents = (await Promises.readFile(join(appRoot, 'telemetry-extensions.json'))).toString(); + contents = (await fs.promises.readFile(join(appRoot, 'telemetry-extensions.json'))).toString(); mergeTelemetry(contents, 'vscode-extensions'); return JSON.stringify(mergedTelemetry, null, 4); diff --git a/src/vs/platform/telemetry/node/telemetryUtils.ts b/src/vs/platform/telemetry/node/telemetryUtils.ts index 4f8fa8c8a5b..faca66149bc 100644 --- a/src/vs/platform/telemetry/node/telemetryUtils.ts +++ b/src/vs/platform/telemetry/node/telemetryUtils.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isMacintosh } from 'vs/base/common/platform'; -import { getMachineId, getSqmMachineId, getdevDeviceId } from 'vs/base/node/id'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStateReadService } from 'vs/platform/state/node/state'; -import { machineIdKey, sqmIdKey, devDeviceIdKey } from 'vs/platform/telemetry/common/telemetry'; +import { isMacintosh } from '../../../base/common/platform.js'; +import { getMachineId, getSqmMachineId, getdevDeviceId } from '../../../base/node/id.js'; +import { ILogService } from '../../log/common/log.js'; +import { IStateReadService } from '../../state/node/state.js'; +import { machineIdKey, sqmIdKey, devDeviceIdKey } from '../common/telemetry.js'; export async function resolveMachineId(stateService: IStateReadService, logService: ILogService): Promise { diff --git a/src/vs/platform/telemetry/test/browser/1dsAppender.test.ts b/src/vs/platform/telemetry/test/browser/1dsAppender.test.ts index 33a22c391b2..29acc962b7f 100644 --- a/src/vs/platform/telemetry/test/browser/1dsAppender.test.ts +++ b/src/vs/platform/telemetry/test/browser/1dsAppender.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import type { ITelemetryItem, ITelemetryUnloadState } from '@microsoft/1ds-core-js'; import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { OneDataSystemWebAppender } from 'vs/platform/telemetry/browser/1dsAppender'; -import { IAppInsightsCore } from 'vs/platform/telemetry/common/1dsAppender'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { OneDataSystemWebAppender } from '../../browser/1dsAppender.js'; +import { IAppInsightsCore } from '../../common/1dsAppender.js'; class AppInsightsCoreMock implements IAppInsightsCore { pluginVersionString: string = 'Test Runner'; diff --git a/src/vs/platform/telemetry/test/browser/telemetryService.test.ts b/src/vs/platform/telemetry/test/browser/telemetryService.test.ts index bc75667e949..08c430e020c 100644 --- a/src/vs/platform/telemetry/test/browser/telemetryService.test.ts +++ b/src/vs/platform/telemetry/test/browser/telemetryService.test.ts @@ -5,17 +5,17 @@ import assert from 'assert'; import * as sinon from 'sinon'; import sinonTest from 'sinon-test'; -import { mainWindow } from 'vs/base/browser/window'; -import * as Errors from 'vs/base/common/errors'; -import { Emitter } from 'vs/base/common/event'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import ErrorTelemetry from 'vs/platform/telemetry/browser/errorTelemetry'; -import { TelemetryConfiguration, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { ITelemetryServiceConfig, TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; -import { ITelemetryAppender, NullAppender } from 'vs/platform/telemetry/common/telemetryUtils'; +import { mainWindow } from '../../../../base/browser/window.js'; +import * as Errors from '../../../../base/common/errors.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { TestConfigurationService } from '../../../configuration/test/common/testConfigurationService.js'; +import product from '../../../product/common/product.js'; +import { IProductService } from '../../../product/common/productService.js'; +import ErrorTelemetry from '../../browser/errorTelemetry.js'; +import { TelemetryConfiguration, TelemetryLevel } from '../../common/telemetry.js'; +import { ITelemetryServiceConfig, TelemetryService } from '../../common/telemetryService.js'; +import { ITelemetryAppender, NullAppender } from '../../common/telemetryUtils.js'; const sinonTestFn = sinonTest(sinon); diff --git a/src/vs/platform/telemetry/test/common/telemetryLogAppender.test.ts b/src/vs/platform/telemetry/test/common/telemetryLogAppender.test.ts index 2fe9b7a6477..91721dc7bd5 100644 --- a/src/vs/platform/telemetry/test/common/telemetryLogAppender.test.ts +++ b/src/vs/platform/telemetry/test/common/telemetryLogAppender.test.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Event } from 'vs/base/common/event'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { AbstractLogger, DEFAULT_LOG_LEVEL, ILogger, ILoggerService, LogLevel, NullLogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender'; +import { Event } from '../../../../base/common/event.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IEnvironmentService } from '../../../environment/common/environment.js'; +import { TestInstantiationService } from '../../../instantiation/test/common/instantiationServiceMock.js'; +import { AbstractLogger, DEFAULT_LOG_LEVEL, ILogger, ILoggerService, LogLevel, NullLogService } from '../../../log/common/log.js'; +import { IProductService } from '../../../product/common/productService.js'; +import { TelemetryLogAppender } from '../../common/telemetryLogAppender.js'; class TestTelemetryLogger extends AbstractLogger implements ILogger { diff --git a/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.ts b/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.ts index 64399227a90..dc2c8819170 100644 --- a/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.ts +++ b/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.ts @@ -3,11 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IBufferMarkCapability, TerminalCapability, IMarkProperties } from 'vs/platform/terminal/common/capabilities/capabilities'; -// Importing types is safe in any layer -// eslint-disable-next-line local/code-import-patterns +import { Emitter } from '../../../../base/common/event.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { IBufferMarkCapability, TerminalCapability, IMarkProperties } from './capabilities.js'; import type { IMarker, Terminal } from '@xterm/headless'; /** diff --git a/src/vs/platform/terminal/common/capabilities/capabilities.ts b/src/vs/platform/terminal/common/capabilities/capabilities.ts index 5cd3d9be955..b6d91be1408 100644 --- a/src/vs/platform/terminal/common/capabilities/capabilities.ts +++ b/src/vs/platform/terminal/common/capabilities/capabilities.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import type { IPromptInputModel, ISerializedPromptInputModel } from 'vs/platform/terminal/common/capabilities/commandDetection/promptInputModel'; -import { ICurrentPartialCommand } from 'vs/platform/terminal/common/capabilities/commandDetection/terminalCommand'; -import { ITerminalOutputMatch, ITerminalOutputMatcher } from 'vs/platform/terminal/common/terminal'; -import { ReplayEntry } from 'vs/platform/terminal/common/terminalProcess'; +import { Event } from '../../../../base/common/event.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import type { IPromptInputModel, ISerializedPromptInputModel } from './commandDetection/promptInputModel.js'; +import { ICurrentPartialCommand } from './commandDetection/terminalCommand.js'; +import { ITerminalOutputMatch, ITerminalOutputMatcher } from '../terminal.js'; +import { ReplayEntry } from '../terminalProcess.js'; interface IEvent { (listener: (arg1: T, arg2: U) => any): IDisposable; diff --git a/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.ts b/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.ts index dbce8f54458..50ff706be7f 100644 --- a/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.ts +++ b/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.ts @@ -3,14 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ILogService, LogLevel } from 'vs/platform/log/common/log'; -import type { ITerminalCommand } from 'vs/platform/terminal/common/capabilities/capabilities'; -import { throttle } from 'vs/base/common/decorators'; - -// Importing types is safe in any layer -// eslint-disable-next-line local/code-import-patterns +import { Emitter, Event } from '../../../../../base/common/event.js'; +import { Disposable } from '../../../../../base/common/lifecycle.js'; +import { ILogService, LogLevel } from '../../../../log/common/log.js'; +import type { ITerminalCommand } from '../capabilities.js'; +import { throttle } from '../../../../../base/common/decorators.js'; + import type { Terminal, IMarker, IBufferCell, IBufferLine, IBuffer } from '@xterm/headless'; const enum PromptInputState { @@ -23,7 +21,7 @@ const enum PromptInputState { * A model of the prompt input state using shell integration and analyzing the terminal buffer. This * may not be 100% accurate but provides a best guess. */ -export interface IPromptInputModel { +export interface IPromptInputModel extends IPromptInputModelState { readonly onDidStartInput: Event; readonly onDidChangeInput: Event; readonly onDidFinishInput: Event; @@ -32,10 +30,6 @@ export interface IPromptInputModel { */ readonly onDidInterrupt: Event; - readonly value: string; - readonly cursorIndex: number; - readonly ghostTextIndex: number; - /** * Gets the prompt input as a user-friendly string where `|` is the cursor position and `[` and * `]` wrap any ghost text. @@ -44,8 +38,26 @@ export interface IPromptInputModel { } export interface IPromptInputModelState { + /** + * The full prompt input include ghost text. + */ readonly value: string; + /** + * The prompt input up to the cursor index, this will always exclude the ghost text. + */ + readonly prefix: string; + /** + * The prompt input from the cursor to the end, this _does not_ include ghost text. + */ + readonly suffix: string; + /** + * The index of the cursor in {@link value}. + */ readonly cursorIndex: number; + /** + * The index of the start of ghost text in {@link value}. This is -1 when there is no ghost + * text. + */ readonly ghostTextIndex: number; } @@ -69,6 +81,8 @@ export class PromptInputModel extends Disposable implements IPromptInputModel { private _value: string = ''; get value() { return this._value; } + get prefix() { return this._value.substring(0, this._cursorIndex); } + get suffix() { return this._value.substring(this._cursorIndex, this._ghostTextIndex === -1 ? undefined : this._ghostTextIndex); } private _cursorIndex: number = 0; get cursorIndex() { return this._cursorIndex; } @@ -462,6 +476,8 @@ export class PromptInputModel extends Disposable implements IPromptInputModel { private _createStateObject(): IPromptInputModelState { return Object.freeze({ value: this._value, + prefix: this.prefix, + suffix: this.suffix, cursorIndex: this._cursorIndex, ghostTextIndex: this._ghostTextIndex }); diff --git a/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.ts b/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.ts index b0ecb408155..fc8c7655d5e 100644 --- a/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.ts +++ b/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.ts @@ -3,11 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IMarkProperties, IMarker, ISerializedTerminalCommand, ITerminalCommand, IXtermMarker } from 'vs/platform/terminal/common/capabilities/capabilities'; -import { ITerminalOutputMatcher, ITerminalOutputMatch } from 'vs/platform/terminal/common/terminal'; - -// Importing types is safe in any layer -// eslint-disable-next-line local/code-import-patterns +import { IMarkProperties, IMarker, ISerializedTerminalCommand, ITerminalCommand, IXtermMarker } from '../capabilities.js'; +import { ITerminalOutputMatcher, ITerminalOutputMatch } from '../../terminal.js'; import type { IBuffer, IBufferLine, Terminal } from '@xterm/headless'; export interface ITerminalCommandProperties { diff --git a/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts b/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts index bef121fbff5..fa4f13707ec 100644 --- a/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts +++ b/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts @@ -3,18 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { debounce } from 'vs/base/common/decorators'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, MandatoryMutableDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { ILogService } from 'vs/platform/log/common/log'; -import { CommandInvalidationReason, ICommandDetectionCapability, ICommandInvalidationRequest, IHandleCommandOptions, ISerializedCommandDetectionCapability, ISerializedTerminalCommand, ITerminalCommand, IXtermMarker, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; -import { ITerminalOutputMatcher } from 'vs/platform/terminal/common/terminal'; -import { ICurrentPartialCommand, PartialTerminalCommand, TerminalCommand } from 'vs/platform/terminal/common/capabilities/commandDetection/terminalCommand'; -import { PromptInputModel, type IPromptInputModel } from 'vs/platform/terminal/common/capabilities/commandDetection/promptInputModel'; - -// Importing types is safe in any layer -// eslint-disable-next-line local/code-import-patterns +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { debounce } from '../../../../base/common/decorators.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { Disposable, MandatoryMutableDisposable, MutableDisposable } from '../../../../base/common/lifecycle.js'; +import { ILogService } from '../../../log/common/log.js'; +import { CommandInvalidationReason, ICommandDetectionCapability, ICommandInvalidationRequest, IHandleCommandOptions, ISerializedCommandDetectionCapability, ISerializedTerminalCommand, ITerminalCommand, IXtermMarker, TerminalCapability } from './capabilities.js'; +import { ITerminalOutputMatcher } from '../terminal.js'; +import { ICurrentPartialCommand, PartialTerminalCommand, TerminalCommand } from './commandDetection/terminalCommand.js'; +import { PromptInputModel, type IPromptInputModel } from './commandDetection/promptInputModel.js'; import type { IBuffer, IDisposable, IMarker, Terminal } from '@xterm/headless'; interface ITerminalDimensions { @@ -149,6 +146,9 @@ export class CommandDetectionCapability extends Disposable implements ICommandDe @debounce(500) private _handleCursorMove() { + if (this._store.isDisposed) { + return; + } // Early versions of conpty do not have real support for an alt buffer, in addition certain // commands such as tsc watch will write to the top of the normal buffer. The following // checks when the cursor has moved while the normal buffer is empty and if it is above the diff --git a/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.ts b/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.ts index 96417aca6fc..56f52a43072 100644 --- a/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.ts +++ b/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ICwdDetectionCapability, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; +import { Emitter } from '../../../../base/common/event.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ICwdDetectionCapability, TerminalCapability } from './capabilities.js'; export class CwdDetectionCapability extends Disposable implements ICwdDetectionCapability { readonly type = TerminalCapability.CwdDetection; diff --git a/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.ts b/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.ts index daab3687d42..1bb91995c39 100644 --- a/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.ts +++ b/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { ITerminalChildProcess } from 'vs/platform/terminal/common/terminal'; -import { TerminalCapability, INaiveCwdDetectionCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; +import { Emitter } from '../../../../base/common/event.js'; +import { ITerminalChildProcess } from '../terminal.js'; +import { TerminalCapability, INaiveCwdDetectionCapability } from './capabilities.js'; export class NaiveCwdDetectionCapability implements INaiveCwdDetectionCapability { constructor(private readonly _process: ITerminalChildProcess) { } diff --git a/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.ts b/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.ts index 07e2ad6b20f..6c5399225b5 100644 --- a/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.ts +++ b/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.ts @@ -3,11 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IPartialCommandDetectionCapability, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; -// Importing types is safe in any layer -// eslint-disable-next-line local/code-import-patterns +import { Emitter } from '../../../../base/common/event.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { IPartialCommandDetectionCapability, TerminalCapability } from './capabilities.js'; import type { IMarker, Terminal } from '@xterm/headless'; const enum Constants { diff --git a/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.ts b/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.ts index 501ce1a78f3..dfa008c0653 100644 --- a/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.ts +++ b/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ITerminalCapabilityImplMap, ITerminalCapabilityStore, TerminalCapability, TerminalCapabilityChangeEvent } from 'vs/platform/terminal/common/capabilities/capabilities'; +import { Emitter } from '../../../../base/common/event.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { ITerminalCapabilityImplMap, ITerminalCapabilityStore, TerminalCapability, TerminalCapabilityChangeEvent } from './capabilities.js'; export class TerminalCapabilityStore extends Disposable implements ITerminalCapabilityStore { private _map: Map = new Map(); diff --git a/src/vs/platform/terminal/common/environmentVariable.ts b/src/vs/platform/terminal/common/environmentVariable.ts index 919c5c7b07d..7db558bc488 100644 --- a/src/vs/platform/terminal/common/environmentVariable.ts +++ b/src/vs/platform/terminal/common/environmentVariable.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IProcessEnvironment } from 'vs/base/common/platform'; -import { IWorkspaceFolderData } from 'vs/platform/workspace/common/workspace'; +import { IProcessEnvironment } from '../../../base/common/platform.js'; +import { IWorkspaceFolderData } from '../../workspace/common/workspace.js'; export enum EnvironmentVariableMutatorType { Replace = 1, diff --git a/src/vs/platform/terminal/common/environmentVariableCollection.ts b/src/vs/platform/terminal/common/environmentVariableCollection.ts index c9dcd52c172..66115b56923 100644 --- a/src/vs/platform/terminal/common/environmentVariableCollection.ts +++ b/src/vs/platform/terminal/common/environmentVariableCollection.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IProcessEnvironment, isWindows } from 'vs/base/common/platform'; -import { EnvironmentVariableMutatorType, EnvironmentVariableScope, IEnvironmentVariableCollection, IExtensionOwnedEnvironmentDescriptionMutator, IExtensionOwnedEnvironmentVariableMutator, IMergedEnvironmentVariableCollection, IMergedEnvironmentVariableCollectionDiff } from 'vs/platform/terminal/common/environmentVariable'; +import { IProcessEnvironment, isWindows } from '../../../base/common/platform.js'; +import { EnvironmentVariableMutatorType, EnvironmentVariableScope, IEnvironmentVariableCollection, IExtensionOwnedEnvironmentDescriptionMutator, IExtensionOwnedEnvironmentVariableMutator, IMergedEnvironmentVariableCollection, IMergedEnvironmentVariableCollectionDiff } from './environmentVariable.js'; type VariableResolver = (str: string) => Promise; diff --git a/src/vs/platform/terminal/common/environmentVariableShared.ts b/src/vs/platform/terminal/common/environmentVariableShared.ts index 8d9ea66fe57..d782d50f3b0 100644 --- a/src/vs/platform/terminal/common/environmentVariableShared.ts +++ b/src/vs/platform/terminal/common/environmentVariableShared.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IEnvironmentVariableCollectionDescription, IEnvironmentVariableCollection, IEnvironmentVariableMutator, ISerializableEnvironmentDescriptionMap as ISerializableEnvironmentDescriptionMap, ISerializableEnvironmentVariableCollection, ISerializableEnvironmentVariableCollections } from 'vs/platform/terminal/common/environmentVariable'; +import { IEnvironmentVariableCollectionDescription, IEnvironmentVariableCollection, IEnvironmentVariableMutator, ISerializableEnvironmentDescriptionMap as ISerializableEnvironmentDescriptionMap, ISerializableEnvironmentVariableCollection, ISerializableEnvironmentVariableCollections } from './environmentVariable.js'; // This file is shared between the renderer and extension host diff --git a/src/vs/platform/terminal/common/requestStore.ts b/src/vs/platform/terminal/common/requestStore.ts index 62ad1c641e8..d3ad4f6b68a 100644 --- a/src/vs/platform/terminal/common/requestStore.ts +++ b/src/vs/platform/terminal/common/requestStore.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { timeout } from 'vs/base/common/async'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ILogService } from 'vs/platform/log/common/log'; +import { timeout } from '../../../base/common/async.js'; +import { CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable, dispose, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { ILogService } from '../../log/common/log.js'; /** * A helper class to track requests that have replies. Using this it's easy to implement an event diff --git a/src/vs/platform/terminal/common/terminal.ts b/src/vs/platform/terminal/common/terminal.ts index f8e502eb908..a821d841916 100644 --- a/src/vs/platform/terminal/common/terminal.ts +++ b/src/vs/platform/terminal/common/terminal.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { 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 { IPtyHostProcessReplayEvent, ISerializedCommandDetectionCapability, ITerminalCapabilityStore } from 'vs/platform/terminal/common/capabilities/capabilities'; -import { IGetTerminalLayoutInfoArgs, IProcessDetails, ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { ISerializableEnvironmentVariableCollections } from 'vs/platform/terminal/common/environmentVariable'; -import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { Registry } from 'vs/platform/registry/common/platform'; -import type * as performance from 'vs/base/common/performance'; -import { ILogService } from 'vs/platform/log/common/log'; +import { 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'; +import { IPtyHostProcessReplayEvent, ISerializedCommandDetectionCapability, ITerminalCapabilityStore } from './capabilities/capabilities.js'; +import { IGetTerminalLayoutInfoArgs, IProcessDetails, ISetTerminalLayoutInfoArgs } from './terminalProcess.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { ISerializableEnvironmentVariableCollections } from './environmentVariable.js'; +import { RawContextKey } from '../../contextkey/common/contextkey.js'; +import { IWorkspaceFolder } from '../../workspace/common/workspace.js'; +import { Registry } from '../../registry/common/platform.js'; +import type * as performance from '../../../base/common/performance.js'; +import { ILogService } from '../../log/common/log.js'; export const terminalTabFocusModeContextKey = new RawContextKey('terminalTabFocusMode', false, true); @@ -90,6 +90,7 @@ export const enum TerminalSettingId { EnvWindows = 'terminal.integrated.env.windows', EnvironmentChangesIndicator = 'terminal.integrated.environmentChangesIndicator', EnvironmentChangesRelaunch = 'terminal.integrated.environmentChangesRelaunch', + ExperimentalWindowsUseConptyDll = 'terminal.integrated.experimental.windowsUseConptyDll', ShowExitAlert = 'terminal.integrated.showExitAlert', SplitCwd = 'terminal.integrated.splitCwd', WindowsEnableConpty = 'terminal.integrated.windowsEnableConpty', @@ -127,23 +128,27 @@ export const enum TerminalSettingId { } export const enum PosixShellType { - PowerShell = 'pwsh', Bash = 'bash', Fish = 'fish', Sh = 'sh', Csh = 'csh', Ksh = 'ksh', Zsh = 'zsh', - Python = 'python' + } export const enum WindowsShellType { CommandPrompt = 'cmd', - PowerShell = 'pwsh', Wsl = 'wsl', GitBash = 'gitbash', - Python = 'python' } -export type TerminalShellType = PosixShellType | WindowsShellType; + +export const enum GeneralShellType { + PowerShell = 'pwsh', + Python = 'python', + Julia = 'julia', + NuShell = 'nu' +} +export type TerminalShellType = PosixShellType | WindowsShellType | GeneralShellType; export interface IRawTerminalInstanceLayoutInfo { relativeSize: number; @@ -661,6 +666,7 @@ export interface ITerminalProcessOptions { nonce: string; }; windowsEnableConpty: boolean; + windowsUseConptyDll: boolean; environmentVariableCollections: ISerializableEnvironmentVariableCollections | undefined; workspaceFolder: IWorkspaceFolder | undefined; } diff --git a/src/vs/platform/terminal/common/terminalAutoResponder.ts b/src/vs/platform/terminal/common/terminalAutoResponder.ts index 51c801d9693..c8429ae4cbf 100644 --- a/src/vs/platform/terminal/common/terminalAutoResponder.ts +++ b/src/vs/platform/terminal/common/terminalAutoResponder.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { timeout } from 'vs/base/common/async'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { isWindows } from 'vs/base/common/platform'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ITerminalChildProcess } from 'vs/platform/terminal/common/terminal'; +import { timeout } from '../../../base/common/async.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { isWindows } from '../../../base/common/platform.js'; +import { ILogService } from '../../log/common/log.js'; +import { ITerminalChildProcess } from './terminal.js'; /** * Tracks a terminal process's data stream and responds immediately when a matching string is diff --git a/src/vs/platform/terminal/common/terminalDataBuffering.ts b/src/vs/platform/terminal/common/terminalDataBuffering.ts index 276b01c5467..980edce5d7e 100644 --- a/src/vs/platform/terminal/common/terminalDataBuffering.ts +++ b/src/vs/platform/terminal/common/terminalDataBuffering.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IProcessDataEvent } from 'vs/platform/terminal/common/terminal'; +import { Event } from '../../../base/common/event.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { IProcessDataEvent } from './terminal.js'; interface TerminalDataBuffer extends IDisposable { data: string[]; diff --git a/src/vs/platform/terminal/common/terminalEnvironment.ts b/src/vs/platform/terminal/common/terminalEnvironment.ts index 5ddf2aa71d6..dbc6de1d0a5 100644 --- a/src/vs/platform/terminal/common/terminalEnvironment.ts +++ b/src/vs/platform/terminal/common/terminalEnvironment.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { OperatingSystem, OS } from 'vs/base/common/platform'; -import type { IShellLaunchConfig } from 'vs/platform/terminal/common/terminal'; +import { OperatingSystem, OS } from '../../../base/common/platform.js'; +import type { IShellLaunchConfig } from './terminal.js'; /** * Aggressively escape non-windows paths to prepare for being sent to a shell. This will do some diff --git a/src/vs/platform/terminal/common/terminalLogService.ts b/src/vs/platform/terminal/common/terminalLogService.ts index fe5e621ff89..c536b084517 100644 --- a/src/vs/platform/terminal/common/terminalLogService.ts +++ b/src/vs/platform/terminal/common/terminalLogService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { Event } from 'vs/base/common/event'; -import { localize } from 'vs/nls'; -import { ILogger, ILoggerService, LogLevel } from 'vs/platform/log/common/log'; -import { ITerminalLogService } from 'vs/platform/terminal/common/terminal'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { joinPath } from 'vs/base/common/resources'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Event } from '../../../base/common/event.js'; +import { localize } from '../../../nls.js'; +import { ILogger, ILoggerService, LogLevel } from '../../log/common/log.js'; +import { ITerminalLogService } from './terminal.js'; +import { IWorkspaceContextService } from '../../workspace/common/workspace.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { joinPath } from '../../../base/common/resources.js'; export class TerminalLogService extends Disposable implements ITerminalLogService { declare _serviceBrand: undefined; diff --git a/src/vs/platform/terminal/common/terminalPlatformConfiguration.ts b/src/vs/platform/terminal/common/terminalPlatformConfiguration.ts index 2c15a096423..7d8d78ba4fe 100644 --- a/src/vs/platform/terminal/common/terminalPlatformConfiguration.ts +++ b/src/vs/platform/terminal/common/terminalPlatformConfiguration.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getAllCodicons } from 'vs/base/common/codicons'; -import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema'; -import { OperatingSystem, Platform, PlatformToString } from 'vs/base/common/platform'; -import { localize } from 'vs/nls'; -import { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IExtensionTerminalProfile, ITerminalProfile, TerminalSettingId } from 'vs/platform/terminal/common/terminal'; -import { createProfileSchemaEnums } from 'vs/platform/terminal/common/terminalProfiles'; +import { getAllCodicons } from '../../../base/common/codicons.js'; +import { IJSONSchema, IJSONSchemaMap } from '../../../base/common/jsonSchema.js'; +import { OperatingSystem, Platform, PlatformToString } from '../../../base/common/platform.js'; +import { localize } from '../../../nls.js'; +import { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationRegistry } from '../../configuration/common/configurationRegistry.js'; +import { Registry } from '../../registry/common/platform.js'; +import { IExtensionTerminalProfile, ITerminalProfile, TerminalSettingId } from './terminal.js'; +import { createProfileSchemaEnums } from './terminalProfiles.js'; export const terminalColorSchema: IJSONSchema = { type: ['string', 'null'], diff --git a/src/vs/platform/terminal/common/terminalProcess.ts b/src/vs/platform/terminal/common/terminalProcess.ts index a56d78ee9cc..cb8f03bc286 100644 --- a/src/vs/platform/terminal/common/terminalProcess.ts +++ b/src/vs/platform/terminal/common/terminalProcess.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { UriComponents } from 'vs/base/common/uri'; -import { ISerializableEnvironmentVariableCollection, ISerializableEnvironmentVariableCollections } from 'vs/platform/terminal/common/environmentVariable'; -import { IFixedTerminalDimensions, IRawTerminalTabLayoutInfo, IReconnectionProperties, ITerminalEnvironment, ITerminalTabLayoutInfoById, TerminalIcon, TerminalType, TitleEventSource, WaitOnExitValue } from 'vs/platform/terminal/common/terminal'; +import { UriComponents } from '../../../base/common/uri.js'; +import { ISerializableEnvironmentVariableCollection, ISerializableEnvironmentVariableCollections } from './environmentVariable.js'; +import { IFixedTerminalDimensions, IRawTerminalTabLayoutInfo, IReconnectionProperties, ITerminalEnvironment, ITerminalTabLayoutInfoById, TerminalIcon, TerminalType, TitleEventSource, WaitOnExitValue } from './terminal.js'; export interface ISingleTerminalConfiguration { userValue: T | undefined; diff --git a/src/vs/platform/terminal/common/terminalProfiles.ts b/src/vs/platform/terminal/common/terminalProfiles.ts index 45e838f3543..a41257542b0 100644 --- a/src/vs/platform/terminal/common/terminalProfiles.ts +++ b/src/vs/platform/terminal/common/terminalProfiles.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Codicon } from 'vs/base/common/codicons'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { IExtensionTerminalProfile, ITerminalProfile, TerminalIcon } from 'vs/platform/terminal/common/terminal'; -import { ThemeIcon } from 'vs/base/common/themables'; +import { Codicon } from '../../../base/common/codicons.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { IExtensionTerminalProfile, ITerminalProfile, TerminalIcon } from './terminal.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; export function createProfileSchemaEnums(detectedProfiles: ITerminalProfile[], extensionProfiles?: readonly IExtensionTerminalProfile[]): { values: (string | null)[] | undefined; diff --git a/src/vs/platform/terminal/common/terminalRecorder.ts b/src/vs/platform/terminal/common/terminalRecorder.ts index 417527a976f..18026ca1ad7 100644 --- a/src/vs/platform/terminal/common/terminalRecorder.ts +++ b/src/vs/platform/terminal/common/terminalRecorder.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IPtyHostProcessReplayEvent } from 'vs/platform/terminal/common/capabilities/capabilities'; -import { ReplayEntry } from 'vs/platform/terminal/common/terminalProcess'; +import { IPtyHostProcessReplayEvent } from './capabilities/capabilities.js'; +import { ReplayEntry } from './terminalProcess.js'; const enum Constants { MaxRecorderDataSize = 10 * 1024 * 1024 // 10MB diff --git a/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts b/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts index d335e2c27cd..8221ad5c282 100644 --- a/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts +++ b/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts @@ -3,25 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IShellIntegration, ShellIntegrationStatus } from 'vs/platform/terminal/common/terminal'; -import { Disposable, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { TerminalCapabilityStore } from 'vs/platform/terminal/common/capabilities/terminalCapabilityStore'; -import { CommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/commandDetectionCapability'; -import { CwdDetectionCapability } from 'vs/platform/terminal/common/capabilities/cwdDetectionCapability'; -import { IBufferMarkCapability, ICommandDetectionCapability, ICwdDetectionCapability, ISerializedCommandDetectionCapability, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; -import { PartialCommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/partialCommandDetectionCapability'; -import { ILogService } from 'vs/platform/log/common/log'; -// Importing types is safe in any layer -// eslint-disable-next-line local/code-import-patterns -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { Emitter } from 'vs/base/common/event'; -import { BufferMarkCapability } from 'vs/platform/terminal/common/capabilities/bufferMarkCapability'; -// Importing types is safe in any layer -// eslint-disable-next-line local/code-import-patterns +import { IShellIntegration, ShellIntegrationStatus } from '../terminal.js'; +import { Disposable, dispose, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { TerminalCapabilityStore } from '../capabilities/terminalCapabilityStore.js'; +import { CommandDetectionCapability } from '../capabilities/commandDetectionCapability.js'; +import { CwdDetectionCapability } from '../capabilities/cwdDetectionCapability.js'; +import { IBufferMarkCapability, ICommandDetectionCapability, ICwdDetectionCapability, ISerializedCommandDetectionCapability, TerminalCapability } from '../capabilities/capabilities.js'; +import { PartialCommandDetectionCapability } from '../capabilities/partialCommandDetectionCapability.js'; +import { ILogService } from '../../../log/common/log.js'; +import { ITelemetryService } from '../../../telemetry/common/telemetry.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { BufferMarkCapability } from '../capabilities/bufferMarkCapability.js'; import type { ITerminalAddon, Terminal } from '@xterm/headless'; -import { URI } from 'vs/base/common/uri'; -import { sanitizeCwd } from 'vs/platform/terminal/common/terminalEnvironment'; -import { removeAnsiEscapeCodesFromPrompt } from 'vs/base/common/strings'; +import { URI } from '../../../../base/common/uri.js'; +import { sanitizeCwd } from '../terminalEnvironment.js'; +import { removeAnsiEscapeCodesFromPrompt } from '../../../../base/common/strings.js'; /** diff --git a/src/vs/platform/terminal/electron-main/electronPtyHostStarter.ts b/src/vs/platform/terminal/electron-main/electronPtyHostStarter.ts index ebd0331692e..607bd9b3a37 100644 --- a/src/vs/platform/terminal/electron-main/electronPtyHostStarter.ts +++ b/src/vs/platform/terminal/electron-main/electronPtyHostStarter.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { parsePtyHostDebugPort } from 'vs/platform/environment/node/environmentService'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IReconnectConstants, TerminalSettingId } from 'vs/platform/terminal/common/terminal'; -import { IPtyHostConnection, IPtyHostStarter } from 'vs/platform/terminal/node/ptyHost'; -import { UtilityProcess } from 'vs/platform/utilityProcess/electron-main/utilityProcess'; -import { Client as MessagePortClient } from 'vs/base/parts/ipc/electron-main/ipc.mp'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { parsePtyHostDebugPort } from '../../environment/node/environmentService.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { NullTelemetryService } from '../../telemetry/common/telemetryUtils.js'; +import { IReconnectConstants, TerminalSettingId } from '../common/terminal.js'; +import { IPtyHostConnection, IPtyHostStarter } from '../node/ptyHost.js'; +import { UtilityProcess } from '../../utilityProcess/electron-main/utilityProcess.js'; +import { Client as MessagePortClient } from '../../../base/parts/ipc/electron-main/ipc.mp.js'; import { IpcMainEvent } from 'electron'; -import { validatedIpcMain } from 'vs/base/parts/ipc/electron-main/ipcMain'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { Emitter } from 'vs/base/common/event'; -import { deepClone } from 'vs/base/common/objects'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { Schemas } from 'vs/base/common/network'; +import { validatedIpcMain } from '../../../base/parts/ipc/electron-main/ipcMain.js'; +import { Disposable, DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { Emitter } from '../../../base/common/event.js'; +import { deepClone } from '../../../base/common/objects.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { Schemas } from '../../../base/common/network.js'; export class ElectronPtyHostStarter extends Disposable implements IPtyHostStarter { diff --git a/src/vs/platform/terminal/node/childProcessMonitor.ts b/src/vs/platform/terminal/node/childProcessMonitor.ts index 9586353a96a..40ac2d23050 100644 --- a/src/vs/platform/terminal/node/childProcessMonitor.ts +++ b/src/vs/platform/terminal/node/childProcessMonitor.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { parse } from 'vs/base/common/path'; -import { debounce, throttle } from 'vs/base/common/decorators'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ProcessItem } from 'vs/base/common/processes'; -import { listProcesses } from 'vs/base/node/ps'; -import { ILogService } from 'vs/platform/log/common/log'; +import { parse } from '../../../base/common/path.js'; +import { debounce, throttle } from '../../../base/common/decorators.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { ProcessItem } from '../../../base/common/processes.js'; +import { listProcesses } from '../../../base/node/ps.js'; +import { ILogService } from '../../log/common/log.js'; const enum Constants { /** diff --git a/src/vs/platform/terminal/node/heartbeatService.ts b/src/vs/platform/terminal/node/heartbeatService.ts index 3a414958afd..0aa17838c89 100644 --- a/src/vs/platform/terminal/node/heartbeatService.ts +++ b/src/vs/platform/terminal/node/heartbeatService.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { HeartbeatConstants, IHeartbeatService } from 'vs/platform/terminal/common/terminal'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { HeartbeatConstants, IHeartbeatService } from '../common/terminal.js'; export class HeartbeatService extends Disposable implements IHeartbeatService { private readonly _onBeat = this._register(new Emitter()); diff --git a/src/vs/platform/terminal/node/nodePtyHostStarter.ts b/src/vs/platform/terminal/node/nodePtyHostStarter.ts index d5a1a43724a..bc78aa5d8a6 100644 --- a/src/vs/platform/terminal/node/nodePtyHostStarter.ts +++ b/src/vs/platform/terminal/node/nodePtyHostStarter.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { FileAccess, Schemas } from 'vs/base/common/network'; -import { Client, IIPCOptions } from 'vs/base/parts/ipc/node/ipc.cp'; -import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { parsePtyHostDebugPort } from 'vs/platform/environment/node/environmentService'; -import { IReconnectConstants } from 'vs/platform/terminal/common/terminal'; -import { IPtyHostConnection, IPtyHostStarter } from 'vs/platform/terminal/node/ptyHost'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { FileAccess, Schemas } from '../../../base/common/network.js'; +import { Client, IIPCOptions } from '../../../base/parts/ipc/node/ipc.cp.js'; +import { IEnvironmentService, INativeEnvironmentService } from '../../environment/common/environment.js'; +import { parsePtyHostDebugPort } from '../../environment/node/environmentService.js'; +import { IReconnectConstants } from '../common/terminal.js'; +import { IPtyHostConnection, IPtyHostStarter } from './ptyHost.js'; export class NodePtyHostStarter extends Disposable implements IPtyHostStarter { constructor( diff --git a/src/vs/platform/terminal/node/ptyHost.ts b/src/vs/platform/terminal/node/ptyHost.ts index 7c8b7318a67..7900f8c8ec4 100644 --- a/src/vs/platform/terminal/node/ptyHost.ts +++ b/src/vs/platform/terminal/node/ptyHost.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { IChannelClient } from 'vs/base/parts/ipc/common/ipc'; +import { Event } from '../../../base/common/event.js'; +import { DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { IChannelClient } from '../../../base/parts/ipc/common/ipc.js'; export interface IPtyHostConnection { readonly client: IChannelClient; diff --git a/src/vs/platform/terminal/node/ptyHostMain.ts b/src/vs/platform/terminal/node/ptyHostMain.ts index f3693acbda3..0a1d14ea076 100644 --- a/src/vs/platform/terminal/node/ptyHostMain.ts +++ b/src/vs/platform/terminal/node/ptyHostMain.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DefaultURITransformer } from 'vs/base/common/uriIpc'; -import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; -import { Server as ChildProcessServer } from 'vs/base/parts/ipc/node/ipc.cp'; -import { Server as UtilityProcessServer } from 'vs/base/parts/ipc/node/ipc.mp'; -import { localize } from 'vs/nls'; -import { OPTIONS, parseArgs } from 'vs/platform/environment/node/argv'; -import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService'; -import { getLogLevel } from 'vs/platform/log/common/log'; -import { LoggerChannel } from 'vs/platform/log/common/logIpc'; -import { LogService } from 'vs/platform/log/common/logService'; -import { LoggerService } from 'vs/platform/log/node/loggerService'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IReconnectConstants, TerminalIpcChannels } from 'vs/platform/terminal/common/terminal'; -import { HeartbeatService } from 'vs/platform/terminal/node/heartbeatService'; -import { PtyService } from 'vs/platform/terminal/node/ptyService'; -import { isUtilityProcess } from 'vs/base/parts/sandbox/node/electronTypes'; -import { timeout } from 'vs/base/common/async'; -import { DisposableStore } from 'vs/base/common/lifecycle'; +import { DefaultURITransformer } from '../../../base/common/uriIpc.js'; +import { ProxyChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { Server as ChildProcessServer } from '../../../base/parts/ipc/node/ipc.cp.js'; +import { Server as UtilityProcessServer } from '../../../base/parts/ipc/node/ipc.mp.js'; +import { localize } from '../../../nls.js'; +import { OPTIONS, parseArgs } from '../../environment/node/argv.js'; +import { NativeEnvironmentService } from '../../environment/node/environmentService.js'; +import { getLogLevel } from '../../log/common/log.js'; +import { LoggerChannel } from '../../log/common/logIpc.js'; +import { LogService } from '../../log/common/logService.js'; +import { LoggerService } from '../../log/node/loggerService.js'; +import product from '../../product/common/product.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IReconnectConstants, TerminalIpcChannels } from '../common/terminal.js'; +import { HeartbeatService } from './heartbeatService.js'; +import { PtyService } from './ptyService.js'; +import { isUtilityProcess } from '../../../base/parts/sandbox/node/electronTypes.js'; +import { timeout } from '../../../base/common/async.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; startPtyHost(); diff --git a/src/vs/platform/terminal/node/ptyHostService.ts b/src/vs/platform/terminal/node/ptyHostService.ts index 402dcc7b723..2c3617de94d 100644 --- a/src/vs/platform/terminal/node/ptyHostService.ts +++ b/src/vs/platform/terminal/node/ptyHostService.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IProcessEnvironment, OS, OperatingSystem, isWindows } from 'vs/base/common/platform'; -import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILogService, ILoggerService, LogLevel } from 'vs/platform/log/common/log'; -import { RemoteLoggerChannelClient } from 'vs/platform/log/common/logIpc'; -import { getResolvedShellEnv } from 'vs/platform/shell/node/shellEnv'; -import { IPtyHostProcessReplayEvent } from 'vs/platform/terminal/common/capabilities/capabilities'; -import { RequestStore } from 'vs/platform/terminal/common/requestStore'; -import { HeartbeatConstants, IHeartbeatService, IProcessDataEvent, IProcessProperty, IProcessPropertyMap, IProcessReadyEvent, IPtyHostLatencyMeasurement, IPtyHostService, IPtyService, IRequestResolveVariablesEvent, ISerializedTerminalState, IShellLaunchConfig, ITerminalLaunchError, ITerminalProcessOptions, ITerminalProfile, ITerminalsLayoutInfo, ProcessPropertyType, TerminalIcon, TerminalIpcChannels, TerminalSettingId, TitleEventSource } from 'vs/platform/terminal/common/terminal'; -import { registerTerminalPlatformConfiguration } from 'vs/platform/terminal/common/terminalPlatformConfiguration'; -import { IGetTerminalLayoutInfoArgs, IProcessDetails, ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess'; -import { IPtyHostConnection, IPtyHostStarter } from 'vs/platform/terminal/node/ptyHost'; -import { detectAvailableProfiles } from 'vs/platform/terminal/node/terminalProfiles'; -import * as performance from 'vs/base/common/performance'; -import { getSystemShell } from 'vs/base/node/shell'; -import { StopWatch } from 'vs/base/common/stopwatch'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { IProcessEnvironment, OS, OperatingSystem, isWindows } from '../../../base/common/platform.js'; +import { ProxyChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { ILogService, ILoggerService, LogLevel } from '../../log/common/log.js'; +import { RemoteLoggerChannelClient } from '../../log/common/logIpc.js'; +import { getResolvedShellEnv } from '../../shell/node/shellEnv.js'; +import { IPtyHostProcessReplayEvent } from '../common/capabilities/capabilities.js'; +import { RequestStore } from '../common/requestStore.js'; +import { HeartbeatConstants, IHeartbeatService, IProcessDataEvent, IProcessProperty, IProcessPropertyMap, IProcessReadyEvent, IPtyHostLatencyMeasurement, IPtyHostService, IPtyService, IRequestResolveVariablesEvent, ISerializedTerminalState, IShellLaunchConfig, ITerminalLaunchError, ITerminalProcessOptions, ITerminalProfile, ITerminalsLayoutInfo, ProcessPropertyType, TerminalIcon, TerminalIpcChannels, TerminalSettingId, TitleEventSource } from '../common/terminal.js'; +import { registerTerminalPlatformConfiguration } from '../common/terminalPlatformConfiguration.js'; +import { IGetTerminalLayoutInfoArgs, IProcessDetails, ISetTerminalLayoutInfoArgs } from '../common/terminalProcess.js'; +import { IPtyHostConnection, IPtyHostStarter } from './ptyHost.js'; +import { detectAvailableProfiles } from './terminalProfiles.js'; +import * as performance from '../../../base/common/performance.js'; +import { getSystemShell } from '../../../base/node/shell.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; enum Constants { MaxRestarts = 5 diff --git a/src/vs/platform/terminal/node/ptyService.ts b/src/vs/platform/terminal/node/ptyService.ts index ec8182b3c1d..53dcb687104 100644 --- a/src/vs/platform/terminal/node/ptyService.ts +++ b/src/vs/platform/terminal/node/ptyService.ts @@ -4,34 +4,41 @@ *--------------------------------------------------------------------------------------------*/ import { execFile, exec } from 'child_process'; -import { AutoOpenBarrier, ProcessTimeRunOnceScheduler, Promises, Queue, timeout } from 'vs/base/common/async'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IProcessEnvironment, isWindows, OperatingSystem, OS } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { getSystemShell } from 'vs/base/node/shell'; -import { ILogService, LogLevel } from 'vs/platform/log/common/log'; -import { RequestStore } from 'vs/platform/terminal/common/requestStore'; -import { IProcessDataEvent, IProcessReadyEvent, IPtyService, IRawTerminalInstanceLayoutInfo, IReconnectConstants, IShellLaunchConfig, ITerminalInstanceLayoutInfoById, ITerminalLaunchError, ITerminalsLayoutInfo, ITerminalTabLayoutInfoById, TerminalIcon, IProcessProperty, TitleEventSource, ProcessPropertyType, IProcessPropertyMap, IFixedTerminalDimensions, IPersistentTerminalProcessLaunchConfig, ICrossVersionSerializedTerminalState, ISerializedTerminalState, ITerminalProcessOptions, IPtyHostLatencyMeasurement } from 'vs/platform/terminal/common/terminal'; -import { TerminalDataBufferer } from 'vs/platform/terminal/common/terminalDataBuffering'; -import { escapeNonWindowsPath } from 'vs/platform/terminal/common/terminalEnvironment'; -import { Terminal as XtermTerminal } from '@xterm/headless'; +import { AutoOpenBarrier, ProcessTimeRunOnceScheduler, Promises, Queue, timeout } from '../../../base/common/async.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { IProcessEnvironment, isWindows, OperatingSystem, OS } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { getSystemShell } from '../../../base/node/shell.js'; +import { ILogService, LogLevel } from '../../log/common/log.js'; +import { RequestStore } from '../common/requestStore.js'; +import { IProcessDataEvent, IProcessReadyEvent, IPtyService, IRawTerminalInstanceLayoutInfo, IReconnectConstants, IShellLaunchConfig, ITerminalInstanceLayoutInfoById, ITerminalLaunchError, ITerminalsLayoutInfo, ITerminalTabLayoutInfoById, TerminalIcon, IProcessProperty, TitleEventSource, ProcessPropertyType, IProcessPropertyMap, IFixedTerminalDimensions, IPersistentTerminalProcessLaunchConfig, ICrossVersionSerializedTerminalState, ISerializedTerminalState, ITerminalProcessOptions, IPtyHostLatencyMeasurement } from '../common/terminal.js'; +import { TerminalDataBufferer } from '../common/terminalDataBuffering.js'; +import { escapeNonWindowsPath } from '../common/terminalEnvironment.js'; import type { ISerializeOptions, SerializeAddon as XtermSerializeAddon } from '@xterm/addon-serialize'; import type { Unicode11Addon as XtermUnicode11Addon } from '@xterm/addon-unicode11'; -import { IGetTerminalLayoutInfoArgs, IProcessDetails, ISetTerminalLayoutInfoArgs, ITerminalTabLayoutInfoDto } from 'vs/platform/terminal/common/terminalProcess'; -import { getWindowsBuildNumber } from 'vs/platform/terminal/node/terminalEnvironment'; -import { TerminalProcess } from 'vs/platform/terminal/node/terminalProcess'; -import { localize } from 'vs/nls'; -import { ignoreProcessNames } from 'vs/platform/terminal/node/childProcessMonitor'; -import { TerminalAutoResponder } from 'vs/platform/terminal/common/terminalAutoResponder'; -import { ErrorNoTelemetry } from 'vs/base/common/errors'; -import { ShellIntegrationAddon } from 'vs/platform/terminal/common/xterm/shellIntegrationAddon'; -import { formatMessageForTerminal } from 'vs/platform/terminal/common/terminalStrings'; -import { IPtyHostProcessReplayEvent } from 'vs/platform/terminal/common/capabilities/capabilities'; -import { IProductService } from 'vs/platform/product/common/productService'; +import { IGetTerminalLayoutInfoArgs, IProcessDetails, ISetTerminalLayoutInfoArgs, ITerminalTabLayoutInfoDto } from '../common/terminalProcess.js'; +import { getWindowsBuildNumber } from './terminalEnvironment.js'; +import { TerminalProcess } from './terminalProcess.js'; +import { localize } from '../../../nls.js'; +import { ignoreProcessNames } from './childProcessMonitor.js'; +import { TerminalAutoResponder } from '../common/terminalAutoResponder.js'; +import { ErrorNoTelemetry } from '../../../base/common/errors.js'; +import { ShellIntegrationAddon } from '../common/xterm/shellIntegrationAddon.js'; +import { formatMessageForTerminal } from '../common/terminalStrings.js'; +import { IPtyHostProcessReplayEvent } from '../common/capabilities/capabilities.js'; +import { IProductService } from '../../product/common/productService.js'; import { join } from 'path'; -import { memoize } from 'vs/base/common/decorators'; -import * as performance from 'vs/base/common/performance'; +import { memoize } from '../../../base/common/decorators.js'; +import * as performance from '../../../base/common/performance.js'; +// ESM-comment-begin +// import { Terminal as XtermTerminal } from '@xterm/headless'; +// ESM-comment-end +// ESM-uncomment-begin +import pkg from '@xterm/headless'; +type XtermTerminal = pkg.Terminal; +const { Terminal: XtermTerminal } = pkg; +// ESM-uncomment-end export function traceRpc(_target: any, key: string, descriptor: any) { if (typeof descriptor.value !== 'function') { @@ -600,7 +607,7 @@ export class PtyService extends Disposable implements IPtyService { private _throwIfNoPty(id: number): PersistentTerminalProcess { const pty = this._ptys.get(id); if (!pty) { - throw new ErrorNoTelemetry(`Could not find pty on pty host`); + throw new ErrorNoTelemetry(`Could not find pty ${id} on pty host`); } return pty; } diff --git a/src/vs/platform/terminal/node/terminalEnvironment.ts b/src/vs/platform/terminal/node/terminalEnvironment.ts index 7349ac1e9db..500d527006c 100644 --- a/src/vs/platform/terminal/node/terminalEnvironment.ts +++ b/src/vs/platform/terminal/node/terminalEnvironment.ts @@ -4,20 +4,20 @@ *--------------------------------------------------------------------------------------------*/ import * as os from 'os'; -import { FileAccess } from 'vs/base/common/network'; -import { getCaseInsensitive } from 'vs/base/common/objects'; -import * as path from 'vs/base/common/path'; -import { IProcessEnvironment, isMacintosh, isWindows } from 'vs/base/common/platform'; -import * as process from 'vs/base/common/process'; -import { format } from 'vs/base/common/strings'; -import { isString } from 'vs/base/common/types'; -import * as pfs from 'vs/base/node/pfs'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IShellLaunchConfig, ITerminalEnvironment, ITerminalProcessOptions } from 'vs/platform/terminal/common/terminal'; -import { EnvironmentVariableMutatorType } from 'vs/platform/terminal/common/environmentVariable'; -import { deserializeEnvironmentVariableCollections } from 'vs/platform/terminal/common/environmentVariableShared'; -import { MergedEnvironmentVariableCollection } from 'vs/platform/terminal/common/environmentVariableCollection'; +import { FileAccess } from '../../../base/common/network.js'; +import { getCaseInsensitive } from '../../../base/common/objects.js'; +import * as path from '../../../base/common/path.js'; +import { IProcessEnvironment, isMacintosh, isWindows } from '../../../base/common/platform.js'; +import * as process from '../../../base/common/process.js'; +import { format } from '../../../base/common/strings.js'; +import { isString } from '../../../base/common/types.js'; +import * as pfs from '../../../base/node/pfs.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IShellLaunchConfig, ITerminalEnvironment, ITerminalProcessOptions } from '../common/terminal.js'; +import { EnvironmentVariableMutatorType } from '../common/environmentVariable.js'; +import { deserializeEnvironmentVariableCollections } from '../common/environmentVariableShared.js'; +import { MergedEnvironmentVariableCollection } from '../common/environmentVariableCollection.js'; export function getWindowsBuildNumber(): number { const osVersion = (/(\d+)\.(\d+)\.(\d+)/g).exec(os.release()); @@ -204,7 +204,7 @@ export function getShellIntegrationInjection( // The injection mechanism used for fish is to add a custom dir to $XDG_DATA_DIRS which // is similar to $ZDOTDIR in zsh but contains a list of directories to run from. const oldDataDirs = env?.XDG_DATA_DIRS ?? '/usr/local/share:/usr/share'; - const newDataDir = path.join(appRoot, 'out/vs/workbench/contrib/terminal/browser/media/fish_xdg_data'); + const newDataDir = path.join(appRoot, 'out/vs/workbench/contrib/terminal/common/scripts/fish_xdg_data'); envMixin['XDG_DATA_DIRS'] = `${oldDataDirs}:${newDataDir}`; addEnvMixinPathPrefix(options, envMixin); return { newArgs: undefined, envMixin }; @@ -254,19 +254,19 @@ export function getShellIntegrationInjection( envMixin['USER_ZDOTDIR'] = userZdotdir; const filesToCopy: IShellIntegrationConfigInjection['filesToCopy'] = []; filesToCopy.push({ - source: path.join(appRoot, 'out/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh'), + source: path.join(appRoot, 'out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-rc.zsh'), dest: path.join(zdotdir, '.zshrc') }); filesToCopy.push({ - source: path.join(appRoot, 'out/vs/workbench/contrib/terminal/browser/media/shellIntegration-profile.zsh'), + source: path.join(appRoot, 'out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-profile.zsh'), dest: path.join(zdotdir, '.zprofile') }); filesToCopy.push({ - source: path.join(appRoot, 'out/vs/workbench/contrib/terminal/browser/media/shellIntegration-env.zsh'), + source: path.join(appRoot, 'out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-env.zsh'), dest: path.join(zdotdir, '.zshenv') }); filesToCopy.push({ - source: path.join(appRoot, 'out/vs/workbench/contrib/terminal/browser/media/shellIntegration-login.zsh'), + source: path.join(appRoot, 'out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-login.zsh'), dest: path.join(zdotdir, '.zlogin') }); return { newArgs, envMixin, filesToCopy }; @@ -321,13 +321,13 @@ enum ShellIntegrationExecutable { const shellIntegrationArgs: Map = new Map(); // The try catch swallows execution policy errors in the case of the archive distributable -shellIntegrationArgs.set(ShellIntegrationExecutable.WindowsPwsh, ['-noexit', '-command', 'try { . \"{0}\\out\\vs\\workbench\\contrib\\terminal\\browser\\media\\shellIntegration.ps1\" } catch {}{1}']); -shellIntegrationArgs.set(ShellIntegrationExecutable.WindowsPwshLogin, ['-l', '-noexit', '-command', 'try { . \"{0}\\out\\vs\\workbench\\contrib\\terminal\\browser\\media\\shellIntegration.ps1\" } catch {}{1}']); -shellIntegrationArgs.set(ShellIntegrationExecutable.Pwsh, ['-noexit', '-command', '. "{0}/out/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1"{1}']); -shellIntegrationArgs.set(ShellIntegrationExecutable.PwshLogin, ['-l', '-noexit', '-command', '. "{0}/out/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1"']); +shellIntegrationArgs.set(ShellIntegrationExecutable.WindowsPwsh, ['-noexit', '-command', 'try { . \"{0}\\out\\vs\\workbench\\contrib\\terminal\\common\\scripts\\shellIntegration.ps1\" } catch {}{1}']); +shellIntegrationArgs.set(ShellIntegrationExecutable.WindowsPwshLogin, ['-l', '-noexit', '-command', 'try { . \"{0}\\out\\vs\\workbench\\contrib\\terminal\\common\\scripts\\shellIntegration.ps1\" } catch {}{1}']); +shellIntegrationArgs.set(ShellIntegrationExecutable.Pwsh, ['-noexit', '-command', '. "{0}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration.ps1"{1}']); +shellIntegrationArgs.set(ShellIntegrationExecutable.PwshLogin, ['-l', '-noexit', '-command', '. "{0}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration.ps1"']); shellIntegrationArgs.set(ShellIntegrationExecutable.Zsh, ['-i']); shellIntegrationArgs.set(ShellIntegrationExecutable.ZshLogin, ['-il']); -shellIntegrationArgs.set(ShellIntegrationExecutable.Bash, ['--init-file', '{0}/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh']); +shellIntegrationArgs.set(ShellIntegrationExecutable.Bash, ['--init-file', '{0}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh']); const pwshLoginArgs = ['-login', '-l']; const shLoginArgs = ['--login', '-l']; const shInteractiveArgs = ['-i', '--interactive']; diff --git a/src/vs/platform/terminal/node/terminalProcess.ts b/src/vs/platform/terminal/node/terminalProcess.ts index a799870b548..3435742e5f5 100644 --- a/src/vs/platform/terminal/node/terminalProcess.ts +++ b/src/vs/platform/terminal/node/terminalProcess.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'fs'; import { exec } from 'child_process'; -import { timeout } from 'vs/base/common/async'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import * as path from 'vs/base/common/path'; -import { IProcessEnvironment, isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { Promises } from 'vs/base/node/pfs'; -import { localize } from 'vs/nls'; -import { ILogService, LogLevel } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { FlowControlConstants, IShellLaunchConfig, ITerminalChildProcess, ITerminalLaunchError, IProcessProperty, IProcessPropertyMap as IProcessPropertyMap, ProcessPropertyType, TerminalShellType, IProcessReadyEvent, ITerminalProcessOptions, PosixShellType, IProcessReadyWindowsPty } from 'vs/platform/terminal/common/terminal'; -import { ChildProcessMonitor } from 'vs/platform/terminal/node/childProcessMonitor'; -import { findExecutable, getShellIntegrationInjection, getWindowsBuildNumber, IShellIntegrationConfigInjection } from 'vs/platform/terminal/node/terminalEnvironment'; -import { WindowsShellHelper } from 'vs/platform/terminal/node/windowsShellHelper'; +import { timeout } from '../../../base/common/async.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, toDisposable } from '../../../base/common/lifecycle.js'; +import * as path from '../../../base/common/path.js'; +import { IProcessEnvironment, isLinux, isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { ILogService, LogLevel } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { FlowControlConstants, IShellLaunchConfig, ITerminalChildProcess, ITerminalLaunchError, IProcessProperty, IProcessPropertyMap as IProcessPropertyMap, ProcessPropertyType, TerminalShellType, IProcessReadyEvent, ITerminalProcessOptions, PosixShellType, IProcessReadyWindowsPty, GeneralShellType } from '../common/terminal.js'; +import { ChildProcessMonitor } from './childProcessMonitor.js'; +import { findExecutable, getShellIntegrationInjection, getWindowsBuildNumber, IShellIntegrationConfigInjection } from './terminalEnvironment.js'; +import { WindowsShellHelper } from './windowsShellHelper.js'; import { IPty, IPtyForkOptions, IWindowsPtyForkOptions, spawn } from 'node-pty'; -import { chunkInput } from 'vs/platform/terminal/common/terminalProcess'; +import { chunkInput } from '../common/terminalProcess.js'; const enum ShutdownConstants { /** @@ -72,11 +72,16 @@ const posixShellTypeMap = new Map([ ['fish', PosixShellType.Fish], ['ksh', PosixShellType.Ksh], ['sh', PosixShellType.Sh], - ['pwsh', PosixShellType.PowerShell], - ['python', PosixShellType.Python], ['zsh', PosixShellType.Zsh] ]); +const generalShellTypeMap = new Map([ + ['pwsh', GeneralShellType.PowerShell], + ['python', GeneralShellType.Python], + ['julia', GeneralShellType.Julia], + ['nu', GeneralShellType.NuShell], + +]); export class TerminalProcess extends Disposable implements ITerminalChildProcess { readonly id = 0; readonly shouldPersist = false; @@ -114,7 +119,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess get exitMessage(): string | undefined { return this._exitMessage; } get currentTitle(): string { return this._windowsShellHelper?.shellTitle || this._currentTitle; } - get shellType(): TerminalShellType | undefined { return isWindows ? this._windowsShellHelper?.shellType : posixShellTypeMap.get(this._currentTitle); } + get shellType(): TerminalShellType | undefined { return isWindows ? this._windowsShellHelper?.shellType : posixShellTypeMap.get(this._currentTitle) || generalShellTypeMap.get(this._currentTitle); } get hasChildProcesses(): boolean { return this._childProcessMonitor?.hasChildProcesses || false; } private readonly _onProcessData = this._register(new Emitter()); @@ -153,6 +158,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess this._properties[ProcessPropertyType.InitialCwd] = this._initialCwd; this._properties[ProcessPropertyType.Cwd] = this._initialCwd; const useConpty = this._options.windowsEnableConpty && process.platform === 'win32' && getWindowsBuildNumber() >= 18309; + const useConptyDll = useConpty && this._options.windowsUseConptyDll; this._ptyOptions = { name, cwd, @@ -161,6 +167,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess cols, rows, useConpty, + useConptyDll, // This option will force conpty to not redraw the whole viewport on launch conptyInheritCursor: useConpty && !!shellLaunchConfig.initialText }; @@ -211,9 +218,9 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess } if (injection.filesToCopy) { for (const f of injection.filesToCopy) { - await Promises.mkdir(path.dirname(f.dest), { recursive: true }); try { - await Promises.copyFile(f.source, f.dest); + await fs.promises.mkdir(path.dirname(f.dest), { recursive: true }); + await fs.promises.copyFile(f.source, f.dest); } catch { // Swallow error, this should only happen when multiple users are on the same // machine. Since the shell integration scripts rarely change, plus the other user @@ -241,7 +248,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess private async _validateCwd(): Promise { try { - const result = await Promises.stat(this._initialCwd); + const result = await fs.promises.stat(this._initialCwd); if (!result.isDirectory()) { return { message: localize('launchFail.cwdNotDirectory', "Starting directory (cwd) \"{0}\" is not a directory", this._initialCwd.toString()) }; } @@ -268,7 +275,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess } try { - const result = await Promises.stat(executable); + const result = await fs.promises.stat(executable); if (!result.isFile() && !result.isSymbolicLink()) { return { message: localize('launchFail.executableIsNotFileOrSymlink', "Path to shell executable \"{0}\" is not a file or a symlink", slc.executable) }; } @@ -401,15 +408,19 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess if (this._store.isDisposed) { return; } - this._currentTitle = ptyProcess.process; + // HACK: The node-pty API can return undefined somehow https://github.com/microsoft/vscode/issues/222323 + this._currentTitle = (ptyProcess.process ?? ''); this._onDidChangeProperty.fire({ type: ProcessPropertyType.Title, value: this._currentTitle }); // If fig is installed it may change the title of the process const sanitizedTitle = this.currentTitle.replace(/ \(figterm\)$/g, ''); if (sanitizedTitle.toLowerCase().startsWith('python')) { - this._onDidChangeProperty.fire({ type: ProcessPropertyType.ShellType, value: PosixShellType.Python }); + this._onDidChangeProperty.fire({ type: ProcessPropertyType.ShellType, value: GeneralShellType.Python }); + } else if (sanitizedTitle.toLowerCase().startsWith('julia')) { + this._onDidChangeProperty.fire({ type: ProcessPropertyType.ShellType, value: GeneralShellType.Julia }); } else { - this._onDidChangeProperty.fire({ type: ProcessPropertyType.ShellType, value: posixShellTypeMap.get(sanitizedTitle) }); + const shellTypeValue = posixShellTypeMap.get(sanitizedTitle) || generalShellTypeMap.get(sanitizedTitle); + this._onDidChangeProperty.fire({ type: ProcessPropertyType.ShellType, value: shellTypeValue }); } } @@ -608,7 +619,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess } this._logService.trace('node-pty.IPty#pid'); try { - return await Promises.readlink(`/proc/${this._ptyProcess.pid}/cwd`); + return await fs.promises.readlink(`/proc/${this._ptyProcess.pid}/cwd`); } catch (error) { return this._initialCwd; } diff --git a/src/vs/platform/terminal/node/terminalProfiles.ts b/src/vs/platform/terminal/node/terminalProfiles.ts index e289fbc34fc..76e77d9174c 100644 --- a/src/vs/platform/terminal/node/terminalProfiles.ts +++ b/src/vs/platform/terminal/node/terminalProfiles.ts @@ -3,19 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'fs'; import * as cp from 'child_process'; -import { Codicon } from 'vs/base/common/codicons'; -import { basename, delimiter, normalize } from 'vs/base/common/path'; -import { isLinux, isWindows } from 'vs/base/common/platform'; -import { isString } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import * as pfs from 'vs/base/node/pfs'; -import { enumeratePowerShellInstallations } from 'vs/base/node/powershell'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ITerminalEnvironment, ITerminalExecutable, ITerminalProfile, ITerminalProfileSource, ITerminalUnsafePath, ProfileSource, TerminalIcon, TerminalSettingId } from 'vs/platform/terminal/common/terminal'; -import { findExecutable, getWindowsBuildNumber } from 'vs/platform/terminal/node/terminalEnvironment'; -import { ThemeIcon } from 'vs/base/common/themables'; +import { Codicon } from '../../../base/common/codicons.js'; +import { basename, delimiter, normalize } from '../../../base/common/path.js'; +import { isLinux, isWindows } from '../../../base/common/platform.js'; +import { isString } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import * as pfs from '../../../base/node/pfs.js'; +import { enumeratePowerShellInstallations } from '../../../base/node/powershell.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { ILogService } from '../../log/common/log.js'; +import { ITerminalEnvironment, ITerminalExecutable, ITerminalProfile, ITerminalProfileSource, ITerminalUnsafePath, ProfileSource, TerminalIcon, TerminalSettingId } from '../common/terminal.js'; +import { findExecutable, getWindowsBuildNumber } from './terminalEnvironment.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; import { dirname, resolve } from 'path'; const enum Constants { @@ -38,7 +39,7 @@ export function detectAvailableProfiles( ): Promise { fsProvider = fsProvider || { existsFile: pfs.SymlinkSupport.existsFile, - readFile: pfs.Promises.readFile + readFile: fs.promises.readFile }; if (isWindows) { return detectAvailableWindowsProfiles( diff --git a/src/vs/platform/terminal/node/windowsShellHelper.ts b/src/vs/platform/terminal/node/windowsShellHelper.ts index e9fcb6f8130..2d63433bbdc 100644 --- a/src/vs/platform/terminal/node/windowsShellHelper.ts +++ b/src/vs/platform/terminal/node/windowsShellHelper.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { timeout } from 'vs/base/common/async'; -import { debounce } from 'vs/base/common/decorators'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { isWindows, platform } from 'vs/base/common/platform'; -import { TerminalShellType, WindowsShellType } from 'vs/platform/terminal/common/terminal'; +import { timeout } from '../../../base/common/async.js'; +import { debounce } from '../../../base/common/decorators.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { isWindows, platform } from '../../../base/common/platform.js'; +import { GeneralShellType, TerminalShellType, WindowsShellType } from '../common/terminal.js'; import type * as WindowsProcessTreeType from '@vscode/windows-process-tree'; export interface IWindowsShellHelper extends IDisposable { @@ -139,10 +139,14 @@ export class WindowsShellHelper extends Disposable implements IWindowsShellHelpe return WindowsShellType.CommandPrompt; case 'powershell.exe': case 'pwsh.exe': - return WindowsShellType.PowerShell; + return GeneralShellType.PowerShell; case 'bash.exe': case 'git-cmd.exe': return WindowsShellType.GitBash; + case 'julialauncher.exe': + return GeneralShellType.Julia; + case 'nu.exe': + return GeneralShellType.NuShell; case 'wsl.exe': case 'ubuntu.exe': case 'ubuntu1804.exe': @@ -153,7 +157,7 @@ export class WindowsShellHelper extends Disposable implements IWindowsShellHelpe return WindowsShellType.Wsl; default: if (executable.match(/python(\d(\.\d{0,2})?)?\.exe/)) { - return WindowsShellType.Python; + return GeneralShellType.Python; } return undefined; } diff --git a/src/vs/platform/terminal/test/common/capabilities/commandDetection/promptInputModel.test.ts b/src/vs/platform/terminal/test/common/capabilities/commandDetection/promptInputModel.test.ts index 18f410a147f..4b7b06f41fe 100644 --- a/src/vs/platform/terminal/test/common/capabilities/commandDetection/promptInputModel.test.ts +++ b/src/vs/platform/terminal/test/common/capabilities/commandDetection/promptInputModel.test.ts @@ -2,20 +2,17 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -// HACK: Ignore warnings, technically this requires browser/ but it's run on renderer.html anyway so -// it's fine in tests. Importing @xterm/headless appears to prevent `yarn test-browser` from running -// at all. -// eslint-disable-next-line local/code-import-patterns, local/code-amd-node-module -import { Terminal } from '@xterm/xterm'; - -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { PromptInputModel, type IPromptInputModelState } from 'vs/platform/terminal/common/capabilities/commandDetection/promptInputModel'; -import { Emitter } from 'vs/base/common/event'; -import type { ITerminalCommand } from 'vs/platform/terminal/common/capabilities/capabilities'; +/* eslint-disable local/code-import-patterns */ + +import type { Terminal } from '@xterm/xterm'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../../base/test/common/utils.js'; +import { NullLogService } from '../../../../../log/common/log.js'; +import { PromptInputModel, type IPromptInputModelState } from '../../../../common/capabilities/commandDetection/promptInputModel.js'; +import { Emitter } from '../../../../../../base/common/event.js'; +import type { ITerminalCommand } from '../../../../common/capabilities/capabilities.js'; import { notDeepStrictEqual, strictEqual } from 'assert'; -import { timeout } from 'vs/base/common/async'; +import { timeout } from '../../../../../../base/common/async.js'; +import { importAMDNodeModule } from '../../../../../../amdX.js'; suite('PromptInputModel', () => { const store = ensureNoDisposablesAreLeakedInTestSuite(); @@ -61,8 +58,9 @@ suite('PromptInputModel', () => { strictEqual(promptInputModel.cursorIndex, cursorIndex, `value=${promptInputModel.value}`); } - setup(() => { - xterm = store.add(new Terminal({ allowProposedApi: true })); + setup(async () => { + const TerminalCtor = (await importAMDNodeModule('@xterm/xterm', 'lib/xterm.js')).Terminal; + xterm = store.add(new TerminalCtor({ allowProposedApi: true })); onCommandStart = store.add(new Emitter()); onCommandExecuted = store.add(new Emitter()); promptInputModel = store.add(new PromptInputModel(xterm, onCommandStart.event, onCommandExecuted.event, new NullLogService)); diff --git a/src/vs/platform/terminal/test/common/requestStore.test.ts b/src/vs/platform/terminal/test/common/requestStore.test.ts index 7488c32cd8c..2431a6285eb 100644 --- a/src/vs/platform/terminal/test/common/requestStore.test.ts +++ b/src/vs/platform/terminal/test/common/requestStore.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { fail, strictEqual } from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { ConsoleLogger, ILogService } from 'vs/platform/log/common/log'; -import { LogService } from 'vs/platform/log/common/logService'; -import { RequestStore } from 'vs/platform/terminal/common/requestStore'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { TestInstantiationService } from '../../../instantiation/test/common/instantiationServiceMock.js'; +import { ConsoleLogger, ILogService } from '../../../log/common/log.js'; +import { LogService } from '../../../log/common/logService.js'; +import { RequestStore } from '../../common/requestStore.js'; suite('RequestStore', () => { let instantiationService: TestInstantiationService; diff --git a/src/vs/platform/terminal/test/common/terminalEnvironment.test.ts b/src/vs/platform/terminal/test/common/terminalEnvironment.test.ts index a6e8eb4f95a..7effc77a25d 100644 --- a/src/vs/platform/terminal/test/common/terminalEnvironment.test.ts +++ b/src/vs/platform/terminal/test/common/terminalEnvironment.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import { strictEqual } from 'assert'; -import { OperatingSystem, OS } from 'vs/base/common/platform'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { collapseTildePath, sanitizeCwd } from 'vs/platform/terminal/common/terminalEnvironment'; +import { OperatingSystem, OS } from '../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { collapseTildePath, sanitizeCwd } from '../../common/terminalEnvironment.js'; suite('terminalEnvironment', () => { ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/platform/terminal/test/common/terminalProcess.test.ts b/src/vs/platform/terminal/test/common/terminalProcess.test.ts index e408d1a0d67..4d4ef97709c 100644 --- a/src/vs/platform/terminal/test/common/terminalProcess.test.ts +++ b/src/vs/platform/terminal/test/common/terminalProcess.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { deepStrictEqual } from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { chunkInput } from 'vs/platform/terminal/common/terminalProcess'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { chunkInput } from '../../common/terminalProcess.js'; suite('platform - terminalProcess', () => { ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/platform/terminal/test/common/terminalProfiles.test.ts b/src/vs/platform/terminal/test/common/terminalProfiles.test.ts index 789fe9821bb..036f9fe4b35 100644 --- a/src/vs/platform/terminal/test/common/terminalProfiles.test.ts +++ b/src/vs/platform/terminal/test/common/terminalProfiles.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import { deepStrictEqual } from 'assert'; -import { Codicon } from 'vs/base/common/codicons'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ITerminalProfile } from 'vs/platform/terminal/common/terminal'; -import { createProfileSchemaEnums } from 'vs/platform/terminal/common/terminalProfiles'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ITerminalProfile } from '../../common/terminal.js'; +import { createProfileSchemaEnums } from '../../common/terminalProfiles.js'; suite('terminalProfiles', () => { ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/platform/terminal/test/common/terminalRecorder.test.ts b/src/vs/platform/terminal/test/common/terminalRecorder.test.ts index 66b317c468b..b8aa1203f0b 100644 --- a/src/vs/platform/terminal/test/common/terminalRecorder.test.ts +++ b/src/vs/platform/terminal/test/common/terminalRecorder.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ReplayEntry } from 'vs/platform/terminal/common/terminalProcess'; -import { TerminalRecorder } from 'vs/platform/terminal/common/terminalRecorder'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ReplayEntry } from '../../common/terminalProcess.js'; +import { TerminalRecorder } from '../../common/terminalRecorder.js'; async function eventsEqual(recorder: TerminalRecorder, expected: ReplayEntry[]) { const actual = (await recorder.generateReplayEvent()).events; diff --git a/src/vs/platform/terminal/test/node/terminalEnvironment.test.ts b/src/vs/platform/terminal/test/node/terminalEnvironment.test.ts index dd4e198d7d4..6248f83003d 100644 --- a/src/vs/platform/terminal/test/node/terminalEnvironment.test.ts +++ b/src/vs/platform/terminal/test/node/terminalEnvironment.test.ts @@ -5,22 +5,29 @@ import { deepStrictEqual, ok, strictEqual } from 'assert'; import { homedir, userInfo } from 'os'; -import { isWindows } from 'vs/base/common/platform'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ITerminalProcessOptions } from 'vs/platform/terminal/common/terminal'; -import { getShellIntegrationInjection, getWindowsBuildNumber, IShellIntegrationConfigInjection } from 'vs/platform/terminal/node/terminalEnvironment'; +import { isWindows } from '../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { IProductService } from '../../../product/common/productService.js'; +import { ITerminalProcessOptions } from '../../common/terminal.js'; +import { getShellIntegrationInjection, getWindowsBuildNumber, IShellIntegrationConfigInjection } from '../../node/terminalEnvironment.js'; -const enabledProcessOptions: ITerminalProcessOptions = { shellIntegration: { enabled: true, suggestEnabled: false, nonce: '' }, windowsEnableConpty: true, environmentVariableCollections: undefined, workspaceFolder: undefined }; -const disabledProcessOptions: ITerminalProcessOptions = { shellIntegration: { enabled: false, suggestEnabled: false, nonce: '' }, windowsEnableConpty: true, environmentVariableCollections: undefined, workspaceFolder: undefined }; -const winptyProcessOptions: ITerminalProcessOptions = { shellIntegration: { enabled: true, suggestEnabled: false, nonce: '' }, windowsEnableConpty: false, environmentVariableCollections: undefined, workspaceFolder: undefined }; +const enabledProcessOptions: ITerminalProcessOptions = { shellIntegration: { enabled: true, suggestEnabled: false, nonce: '' }, windowsEnableConpty: true, windowsUseConptyDll: false, environmentVariableCollections: undefined, workspaceFolder: undefined }; +const disabledProcessOptions: ITerminalProcessOptions = { shellIntegration: { enabled: false, suggestEnabled: false, nonce: '' }, windowsEnableConpty: true, windowsUseConptyDll: false, environmentVariableCollections: undefined, workspaceFolder: undefined }; +const winptyProcessOptions: ITerminalProcessOptions = { shellIntegration: { enabled: true, suggestEnabled: false, nonce: '' }, windowsEnableConpty: false, windowsUseConptyDll: false, environmentVariableCollections: undefined, workspaceFolder: undefined }; const pwshExe = process.platform === 'win32' ? 'pwsh.exe' : 'pwsh'; const repoRoot = process.platform === 'win32' ? process.cwd()[0].toLowerCase() + process.cwd().substring(1) : process.cwd(); const logService = new NullLogService(); const productService = { applicationName: 'vscode' } as IProductService; const defaultEnvironment = {}; +function deepStrictEqualIgnoreStableVar(actual: IShellIntegrationConfigInjection | undefined, expected: IShellIntegrationConfigInjection) { + if (actual?.envMixin) { + delete actual.envMixin['VSCODE_STABLE']; + } + deepStrictEqual(actual, expected); +} + suite('platform - terminalEnvironment', () => { ensureNoDisposablesAreLeakedInTestSuite(); suite('getShellIntegrationInjection', () => { @@ -40,8 +47,8 @@ suite('platform - terminalEnvironment', () => { // These tests are only expected to work on Windows 10 build 18309 and above (getWindowsBuildNumber() < 18309 ? suite.skip : suite)('pwsh', () => { const expectedPs1 = process.platform === 'win32' - ? `try { . "${repoRoot}\\out\\vs\\workbench\\contrib\\terminal\\browser\\media\\shellIntegration.ps1" } catch {}` - : `. "${repoRoot}/out/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1"`; + ? `try { . "${repoRoot}\\out\\vs\\workbench\\contrib\\terminal\\common\\scripts\\shellIntegration.ps1" } catch {}` + : `. "${repoRoot}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration.ps1"`; suite('should override args', () => { const enabledExpectedResult = Object.freeze({ newArgs: [ @@ -54,21 +61,21 @@ suite('platform - terminalEnvironment', () => { } }); test('when undefined, []', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: [] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: undefined }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: [] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: undefined }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); suite('when no logo', () => { test('array - case insensitive', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-NoLogo'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-NOLOGO'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-nol'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-NOL'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: ['-NoLogo'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: ['-NOLOGO'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: ['-nol'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: ['-NOL'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); test('string - case insensitive', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-NoLogo' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-NOLOGO' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-nol' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-NOL' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: '-NoLogo' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: '-NOLOGO' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: '-nol' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: '-NOL' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); }); }); @@ -85,10 +92,10 @@ suite('platform - terminalEnvironment', () => { } }); test('when array contains no logo and login', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-l', '-NoLogo'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: ['-l', '-NoLogo'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); test('when string', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-l' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: pwshExe, args: '-l' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); }); suite('should not modify args', () => { @@ -119,10 +126,10 @@ suite('platform - terminalEnvironment', () => { new RegExp(`.+\\/${username}-vscode-zsh\\/\\.zlogin`) ]; const expectedSources = [ - /.+\/out\/vs\/workbench\/contrib\/terminal\/browser\/media\/shellIntegration-rc.zsh/, - /.+\/out\/vs\/workbench\/contrib\/terminal\/browser\/media\/shellIntegration-profile.zsh/, - /.+\/out\/vs\/workbench\/contrib\/terminal\/browser\/media\/shellIntegration-env.zsh/, - /.+\/out\/vs\/workbench\/contrib\/terminal\/browser\/media\/shellIntegration-login.zsh/ + /.+\/out\/vs\/workbench\/contrib\/terminal\/common\/scripts\/shellIntegration-rc.zsh/, + /.+\/out\/vs\/workbench\/contrib\/terminal\/common\/scripts\/shellIntegration-profile.zsh/, + /.+\/out\/vs\/workbench\/contrib\/terminal\/common\/scripts\/shellIntegration-env.zsh/, + /.+\/out\/vs\/workbench\/contrib\/terminal\/common\/scripts\/shellIntegration-login.zsh/ ]; function assertIsEnabled(result: IShellIntegrationConfigInjection, globalZdotdir = homedir()) { strictEqual(Object.keys(result.envMixin!).length, 3); @@ -183,31 +190,29 @@ suite('platform - terminalEnvironment', () => { const enabledExpectedResult = Object.freeze({ newArgs: [ '--init-file', - `${repoRoot}/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh` + `${repoRoot}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh` ], envMixin: { - VSCODE_INJECTION: '1', - VSCODE_STABLE: '0' + VSCODE_INJECTION: '1' } }); - deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: [] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: '' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: undefined }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: 'bash', args: [] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: 'bash', args: '' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: 'bash', args: undefined }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); suite('should set login env variable and not modify args', () => { const enabledExpectedResult = Object.freeze({ newArgs: [ '--init-file', - `${repoRoot}/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh` + `${repoRoot}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh` ], envMixin: { VSCODE_INJECTION: '1', - VSCODE_SHELL_LOGIN: '1', - VSCODE_STABLE: '0' + VSCODE_SHELL_LOGIN: '1' } }); test('when array', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: ['-l'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqualIgnoreStableVar(getShellIntegrationInjection({ executable: 'bash', args: ['-l'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); }); suite('should not modify args', () => { diff --git a/src/vs/platform/test/electron-main/workbenchTestServices.ts b/src/vs/platform/test/electron-main/workbenchTestServices.ts index 65beabd3b2a..1a56d22f06c 100644 --- a/src/vs/platform/test/electron-main/workbenchTestServices.ts +++ b/src/vs/platform/test/electron-main/workbenchTestServices.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Promises } from 'vs/base/common/async'; -import { Event, Emitter } from 'vs/base/common/event'; -import { IAuxiliaryWindow } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { ILifecycleMainService, IRelaunchHandler, LifecycleMainPhase, ShutdownEvent, ShutdownReason } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { IStateService } from 'vs/platform/state/node/state'; -import { ICodeWindow, UnloadReason } from 'vs/platform/window/electron-main/window'; +import { Promises } from '../../../base/common/async.js'; +import { Event, Emitter } from '../../../base/common/event.js'; +import { IAuxiliaryWindow } from '../../auxiliaryWindow/electron-main/auxiliaryWindow.js'; +import { NativeParsedArgs } from '../../environment/common/argv.js'; +import { ILifecycleMainService, IRelaunchHandler, LifecycleMainPhase, ShutdownEvent, ShutdownReason } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { IStateService } from '../../state/node/state.js'; +import { ICodeWindow, UnloadReason } from '../../window/electron-main/window.js'; export class TestLifecycleMainService implements ILifecycleMainService { diff --git a/src/vs/platform/theme/browser/defaultStyles.ts b/src/vs/platform/theme/browser/defaultStyles.ts index 871178faf38..4acc69f667f 100644 --- a/src/vs/platform/theme/browser/defaultStyles.ts +++ b/src/vs/platform/theme/browser/defaultStyles.ts @@ -2,20 +2,21 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IButtonStyles } from 'vs/base/browser/ui/button/button'; -import { IKeybindingLabelStyles } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; -import { ColorIdentifier, keybindingLabelBackground, keybindingLabelBorder, keybindingLabelBottomBorder, keybindingLabelForeground, asCssVariable, widgetShadow, buttonForeground, buttonSeparator, buttonBackground, buttonHoverBackground, buttonSecondaryForeground, buttonSecondaryBackground, buttonSecondaryHoverBackground, buttonBorder, progressBarBackground, inputActiveOptionBorder, inputActiveOptionForeground, inputActiveOptionBackground, editorWidgetBackground, editorWidgetForeground, contrastBorder, checkboxBorder, checkboxBackground, checkboxForeground, problemsErrorIconForeground, problemsWarningIconForeground, problemsInfoIconForeground, inputBackground, inputForeground, inputBorder, textLinkForeground, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationInfoForeground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationWarningForeground, inputValidationErrorBorder, inputValidationErrorBackground, inputValidationErrorForeground, listFilterWidgetBackground, listFilterWidgetNoMatchesOutline, listFilterWidgetOutline, listFilterWidgetShadow, badgeBackground, badgeForeground, breadcrumbsBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, activeContrastBorder, listActiveSelectionBackground, listActiveSelectionForeground, listActiveSelectionIconForeground, listDropOverBackground, listFocusAndSelectionOutline, listFocusBackground, listFocusForeground, listFocusOutline, listHoverBackground, listHoverForeground, listInactiveFocusBackground, listInactiveFocusOutline, listInactiveSelectionBackground, listInactiveSelectionForeground, listInactiveSelectionIconForeground, tableColumnsBorder, tableOddRowsBackgroundColor, treeIndentGuidesStroke, asCssVariableWithDefault, editorWidgetBorder, focusBorder, pickerGroupForeground, quickInputListFocusBackground, quickInputListFocusForeground, quickInputListFocusIconForeground, selectBackground, selectBorder, selectForeground, selectListBackground, treeInactiveIndentGuidesStroke, menuBorder, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuSeparatorBackground, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, listDropBetweenBackground } from 'vs/platform/theme/common/colorRegistry'; -import { IProgressBarStyles } from 'vs/base/browser/ui/progressbar/progressbar'; -import { ICheckboxStyles, IToggleStyles } from 'vs/base/browser/ui/toggle/toggle'; -import { IDialogStyles } from 'vs/base/browser/ui/dialog/dialog'; -import { IInputBoxStyles } from 'vs/base/browser/ui/inputbox/inputBox'; -import { IFindWidgetStyles } from 'vs/base/browser/ui/tree/abstractTree'; -import { ICountBadgeStyles } from 'vs/base/browser/ui/countBadge/countBadge'; -import { IBreadcrumbsWidgetStyles } from 'vs/base/browser/ui/breadcrumbs/breadcrumbsWidget'; -import { IListStyles } from 'vs/base/browser/ui/list/listWidget'; -import { ISelectBoxStyles } from 'vs/base/browser/ui/selectBox/selectBox'; -import { Color } from 'vs/base/common/color'; -import { IMenuStyles } from 'vs/base/browser/ui/menu/menu'; +import { IButtonStyles } from '../../../base/browser/ui/button/button.js'; +import { IKeybindingLabelStyles } from '../../../base/browser/ui/keybindingLabel/keybindingLabel.js'; +import { ColorIdentifier, keybindingLabelBackground, keybindingLabelBorder, keybindingLabelBottomBorder, keybindingLabelForeground, asCssVariable, widgetShadow, buttonForeground, buttonSeparator, buttonBackground, buttonHoverBackground, buttonSecondaryForeground, buttonSecondaryBackground, buttonSecondaryHoverBackground, buttonBorder, progressBarBackground, inputActiveOptionBorder, inputActiveOptionForeground, inputActiveOptionBackground, editorWidgetBackground, editorWidgetForeground, contrastBorder, checkboxBorder, checkboxBackground, checkboxForeground, problemsErrorIconForeground, problemsWarningIconForeground, problemsInfoIconForeground, inputBackground, inputForeground, inputBorder, textLinkForeground, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationInfoForeground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationWarningForeground, inputValidationErrorBorder, inputValidationErrorBackground, inputValidationErrorForeground, listFilterWidgetBackground, listFilterWidgetNoMatchesOutline, listFilterWidgetOutline, listFilterWidgetShadow, badgeBackground, badgeForeground, breadcrumbsBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, activeContrastBorder, listActiveSelectionBackground, listActiveSelectionForeground, listActiveSelectionIconForeground, listDropOverBackground, listFocusAndSelectionOutline, listFocusBackground, listFocusForeground, listFocusOutline, listHoverBackground, listHoverForeground, listInactiveFocusBackground, listInactiveFocusOutline, listInactiveSelectionBackground, listInactiveSelectionForeground, listInactiveSelectionIconForeground, tableColumnsBorder, tableOddRowsBackgroundColor, treeIndentGuidesStroke, asCssVariableWithDefault, editorWidgetBorder, focusBorder, pickerGroupForeground, quickInputListFocusBackground, quickInputListFocusForeground, quickInputListFocusIconForeground, selectBackground, selectBorder, selectForeground, selectListBackground, treeInactiveIndentGuidesStroke, menuBorder, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuSeparatorBackground, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, listDropBetweenBackground, radioActiveBackground, radioActiveForeground, radioInactiveBackground, radioInactiveForeground, radioInactiveBorder, radioInactiveHoverBackground, radioActiveBorder } from '../common/colorRegistry.js'; +import { IProgressBarStyles } from '../../../base/browser/ui/progressbar/progressbar.js'; +import { ICheckboxStyles, IToggleStyles } from '../../../base/browser/ui/toggle/toggle.js'; +import { IDialogStyles } from '../../../base/browser/ui/dialog/dialog.js'; +import { IInputBoxStyles } from '../../../base/browser/ui/inputbox/inputBox.js'; +import { IFindWidgetStyles } from '../../../base/browser/ui/tree/abstractTree.js'; +import { ICountBadgeStyles } from '../../../base/browser/ui/countBadge/countBadge.js'; +import { IBreadcrumbsWidgetStyles } from '../../../base/browser/ui/breadcrumbs/breadcrumbsWidget.js'; +import { IListStyles } from '../../../base/browser/ui/list/listWidget.js'; +import { ISelectBoxStyles } from '../../../base/browser/ui/selectBox/selectBox.js'; +import { Color } from '../../../base/common/color.js'; +import { IMenuStyles } from '../../../base/browser/ui/menu/menu.js'; +import { IRadioStyles } from '../../../base/browser/ui/radio/radio.js'; export type IStyleOverride = { [P in keyof T]?: ColorIdentifier | undefined; @@ -41,6 +42,7 @@ export const defaultKeybindingLabelStyles: IKeybindingLabelStyles = { export function getKeybindingLabelStyles(override: IStyleOverride): IKeybindingLabelStyles { return overrideStyles(override, defaultKeybindingLabelStyles); } + export const defaultButtonStyles: IButtonStyles = { buttonForeground: asCssVariable(buttonForeground), buttonSeparator: asCssVariable(buttonSeparator), @@ -70,6 +72,16 @@ export const defaultToggleStyles: IToggleStyles = { inputActiveOptionBackground: asCssVariable(inputActiveOptionBackground) }; +export const defaultRadioStyles: IRadioStyles = { + activeForeground: asCssVariable(radioActiveForeground), + activeBackground: asCssVariable(radioActiveBackground), + activeBorder: asCssVariable(radioActiveBorder), + inactiveForeground: asCssVariable(radioInactiveForeground), + inactiveBackground: asCssVariable(radioInactiveBackground), + inactiveBorder: asCssVariable(radioInactiveBorder), + inactiveHoverBackground: asCssVariable(radioInactiveHoverBackground), +}; + export function getToggleStyles(override: IStyleOverride): IToggleStyles { return overrideStyles(override, defaultToggleStyles); } @@ -176,7 +188,7 @@ export const defaultListStyles: IListStyles = { treeInactiveIndentGuidesStroke: asCssVariable(treeInactiveIndentGuidesStroke), treeStickyScrollBackground: undefined, treeStickyScrollBorder: undefined, - treeStickyScrollShadow: undefined, + treeStickyScrollShadow: asCssVariable(scrollbarShadow), tableColumnsBorder: asCssVariable(tableColumnsBorder), tableOddRowsBackgroundColor: asCssVariable(tableOddRowsBackgroundColor), }; diff --git a/src/vs/platform/theme/browser/iconsStyleSheet.ts b/src/vs/platform/theme/browser/iconsStyleSheet.ts index 96ec62103aa..6cc55b3b192 100644 --- a/src/vs/platform/theme/browser/iconsStyleSheet.ts +++ b/src/vs/platform/theme/browser/iconsStyleSheet.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { asCSSPropertyValue, asCSSUrl } from 'vs/base/browser/dom'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { getIconRegistry, IconContribution, IconFontDefinition } from 'vs/platform/theme/common/iconRegistry'; -import { IProductIconTheme, IThemeService } from 'vs/platform/theme/common/themeService'; +import { asCSSPropertyValue, asCSSUrl } from '../../../base/browser/dom.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { getIconRegistry, IconContribution, IconFontDefinition } from '../common/iconRegistry.js'; +import { IProductIconTheme, IThemeService } from '../common/themeService.js'; export interface IIconsStyleSheet extends IDisposable { getCSS(): string; diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index 82b65f7a795..bc0b044b534 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -export * from 'vs/platform/theme/common/colorUtils'; +export * from './colorUtils.js'; // Make sure all color files are exported -export * from 'vs/platform/theme/common/colors/baseColors'; -export * from 'vs/platform/theme/common/colors/chartsColors'; -export * from 'vs/platform/theme/common/colors/editorColors'; -export * from 'vs/platform/theme/common/colors/inputColors'; -export * from 'vs/platform/theme/common/colors/listColors'; -export * from 'vs/platform/theme/common/colors/menuColors'; -export * from 'vs/platform/theme/common/colors/minimapColors'; -export * from 'vs/platform/theme/common/colors/miscColors'; -export * from 'vs/platform/theme/common/colors/quickpickColors'; -export * from 'vs/platform/theme/common/colors/searchColors'; +export * from './colors/baseColors.js'; +export * from './colors/chartsColors.js'; +export * from './colors/editorColors.js'; +export * from './colors/inputColors.js'; +export * from './colors/listColors.js'; +export * from './colors/menuColors.js'; +export * from './colors/minimapColors.js'; +export * from './colors/miscColors.js'; +export * from './colors/quickpickColors.js'; +export * from './colors/searchColors.js'; diff --git a/src/vs/platform/theme/common/colorUtils.ts b/src/vs/platform/theme/common/colorUtils.ts index 0f21708a437..684be5f3d6b 100644 --- a/src/vs/platform/theme/common/colorUtils.ts +++ b/src/vs/platform/theme/common/colorUtils.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { assertNever } from 'vs/base/common/assert'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { Color } from 'vs/base/common/color'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IJSONSchema, IJSONSchemaSnippet } from 'vs/base/common/jsonSchema'; -import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import * as platform from 'vs/platform/registry/common/platform'; -import { IColorTheme } from 'vs/platform/theme/common/themeService'; -import * as nls from 'vs/nls'; +import { assertNever } from '../../../base/common/assert.js'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { Color } from '../../../base/common/color.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IJSONSchema, IJSONSchemaSnippet } from '../../../base/common/jsonSchema.js'; +import { IJSONContributionRegistry, Extensions as JSONExtensions } from '../../jsonschemas/common/jsonContributionRegistry.js'; +import * as platform from '../../registry/common/platform.js'; +import { IColorTheme } from './themeService.js'; +import * as nls from '../../../nls.js'; // ------ API types @@ -20,7 +20,7 @@ export type ColorIdentifier = string; export interface ColorContribution { readonly id: ColorIdentifier; readonly description: string; - readonly defaults: ColorDefaults | null; + readonly defaults: ColorDefaults | ColorValue | null; readonly needsTransparency: boolean; readonly deprecationMessage: string | undefined; } @@ -62,10 +62,6 @@ export type ColorTransform = | { op: ColorTransformType.LessProminent; value: ColorValue; background: ColorValue; factor: number; transparency: number } | { op: ColorTransformType.IfDefinedThenElse; if: ColorIdentifier; then: ColorValue; else: ColorValue }; -export function isColorTransform(value: unknown): value is ColorTransform { - return typeof value === 'object' && !!value && 'op' in value && typeof value.op === 'number'; -} - export interface ColorDefaults { light: ColorValue | null; dark: ColorValue | null; @@ -73,16 +69,15 @@ export interface ColorDefaults { hcLight: ColorValue | null; } +export function isColorDefaults(value: unknown): value is ColorDefaults { + return value !== null && typeof value === 'object' && 'light' in value && 'dark' in value; +} /** * A Color Value is either a color literal, a reference to an other color or a derived color */ export type ColorValue = Color | string | ColorIdentifier | ColorTransform; -export function isColorValue(value: unknown): value is ColorValue { - return typeof value === 'string' || value instanceof Color || isColorTransform(value); -} - // color registry export const Extensions = { ColorContribution: 'base.contributions.colors' @@ -161,10 +156,10 @@ class ColorRegistry implements IColorRegistry { this._onDidChangeSchema.fire(); } - public registerColor(id: string, defaults: ColorDefaults | null, description: string, needsTransparency = false, deprecationMessage?: string): ColorIdentifier { + public registerColor(id: string, defaults: ColorDefaults | ColorValue | null, description: string, needsTransparency = false, deprecationMessage?: string): ColorIdentifier { const colorContribution: ColorContribution = { id, description, defaults, needsTransparency, deprecationMessage }; this.colorsById[id] = colorContribution; - const propertySchema: IJSONSchemaWithSnippets = { type: 'string', description, format: 'color-hex', defaultSnippets: [{ body: '${1:#ff0000}' }] }; + const propertySchema: IJSONSchemaWithSnippets = { type: 'string', format: 'color-hex', defaultSnippets: [{ body: '${1:#ff0000}' }] }; if (deprecationMessage) { propertySchema.deprecationMessage = deprecationMessage; } @@ -173,6 +168,7 @@ class ColorRegistry implements IColorRegistry { propertySchema.patternErrorMessage = nls.localize('transparecyRequired', 'This color must be transparent or it will obscure content'); } this.colorSchema.properties[id] = { + description, oneOf: [ propertySchema, { type: 'string', const: DEFAULT_COLOR_CONFIG_VALUE, description: nls.localize('useDefault', 'Use the default color.') } @@ -203,8 +199,8 @@ class ColorRegistry implements IColorRegistry { public resolveDefaultColor(id: ColorIdentifier, theme: IColorTheme): Color | undefined { const colorDesc = this.colorsById[id]; - if (colorDesc && colorDesc.defaults) { - const colorValue = colorDesc.defaults[theme.type]; + if (colorDesc?.defaults) { + const colorValue = isColorDefaults(colorDesc.defaults) ? colorDesc.defaults[theme.type] : colorDesc.defaults; return resolveColorValue(colorValue, theme); } return undefined; @@ -238,14 +234,6 @@ platform.Registry.add(Extensions.ColorContribution, colorRegistry); export function registerColor(id: string, defaults: ColorDefaults | ColorValue | null, description: string, needsTransparency?: boolean, deprecationMessage?: string): ColorIdentifier { - if (isColorValue(defaults)) { - defaults = { - dark: defaults, - light: defaults, - hcDark: defaults, - hcLight: defaults - } satisfies ColorDefaults; - } return colorRegistry.registerColor(id, defaults, description, needsTransparency, deprecationMessage); } diff --git a/src/vs/platform/theme/common/colors/baseColors.ts b/src/vs/platform/theme/common/colors/baseColors.ts index 1d19b3adc1f..514fdc8a4e9 100644 --- a/src/vs/platform/theme/common/colors/baseColors.ts +++ b/src/vs/platform/theme/common/colors/baseColors.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../../nls.js'; // Import the effects we need -import { Color } from 'vs/base/common/color'; -import { registerColor, transparent } from 'vs/platform/theme/common/colorUtils'; +import { Color } from '../../../../base/common/color.js'; +import { registerColor, transparent } from '../colorUtils.js'; export const foreground = registerColor('foreground', @@ -43,7 +43,7 @@ export const activeContrastBorder = registerColor('contrastActiveBorder', nls.localize('activeContrastBorder', "An extra border around active elements to separate them from others for greater contrast.")); export const selectionBackground = registerColor('selection.background', - { light: null, dark: null, hcDark: null, hcLight: null }, + null, nls.localize('selectionBackground', "The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.")); diff --git a/src/vs/platform/theme/common/colors/chartsColors.ts b/src/vs/platform/theme/common/colors/chartsColors.ts index eb63b602234..c12b947e755 100644 --- a/src/vs/platform/theme/common/colors/chartsColors.ts +++ b/src/vs/platform/theme/common/colors/chartsColors.ts @@ -3,36 +3,36 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { registerColor, transparent } from 'vs/platform/theme/common/colorUtils'; +import * as nls from '../../../../nls.js'; +import { registerColor, transparent } from '../colorUtils.js'; -import { foreground } from 'vs/platform/theme/common/colors/baseColors'; -import { editorErrorForeground, editorInfoForeground, editorWarningForeground } from 'vs/platform/theme/common/colors/editorColors'; -import { minimapFindMatch } from 'vs/platform/theme/common/colors/minimapColors'; +import { foreground } from './baseColors.js'; +import { editorErrorForeground, editorInfoForeground, editorWarningForeground } from './editorColors.js'; +import { minimapFindMatch } from './minimapColors.js'; export const chartsForeground = registerColor('charts.foreground', - { dark: foreground, light: foreground, hcDark: foreground, hcLight: foreground }, + foreground, nls.localize('chartsForeground', "The foreground color used in charts.")); export const chartsLines = registerColor('charts.lines', - { dark: transparent(foreground, .5), light: transparent(foreground, .5), hcDark: transparent(foreground, .5), hcLight: transparent(foreground, .5) }, + transparent(foreground, .5), nls.localize('chartsLines', "The color used for horizontal lines in charts.")); export const chartsRed = registerColor('charts.red', - { dark: editorErrorForeground, light: editorErrorForeground, hcDark: editorErrorForeground, hcLight: editorErrorForeground }, + editorErrorForeground, nls.localize('chartsRed', "The red color used in chart visualizations.")); export const chartsBlue = registerColor('charts.blue', - { dark: editorInfoForeground, light: editorInfoForeground, hcDark: editorInfoForeground, hcLight: editorInfoForeground }, + editorInfoForeground, nls.localize('chartsBlue', "The blue color used in chart visualizations.")); export const chartsYellow = registerColor('charts.yellow', - { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningForeground, hcLight: editorWarningForeground }, + editorWarningForeground, nls.localize('chartsYellow', "The yellow color used in chart visualizations.")); export const chartsOrange = registerColor('charts.orange', - { dark: minimapFindMatch, light: minimapFindMatch, hcDark: minimapFindMatch, hcLight: minimapFindMatch }, + minimapFindMatch, nls.localize('chartsOrange', "The orange color used in chart visualizations.")); export const chartsGreen = registerColor('charts.green', diff --git a/src/vs/platform/theme/common/colors/editorColors.ts b/src/vs/platform/theme/common/colors/editorColors.ts index a57b85e2c29..567343b0055 100644 --- a/src/vs/platform/theme/common/colors/editorColors.ts +++ b/src/vs/platform/theme/common/colors/editorColors.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../../nls.js'; // Import the effects we need -import { Color, RGBA } from 'vs/base/common/color'; -import { registerColor, transparent, lessProminent, darken, lighten } from 'vs/platform/theme/common/colorUtils'; +import { Color, RGBA } from '../../../../base/common/color.js'; +import { registerColor, transparent, lessProminent, darken, lighten } from '../colorUtils.js'; // Import the colors we need -import { foreground, contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colors/baseColors'; -import { scrollbarShadow, badgeBackground } from 'vs/platform/theme/common/colors/miscColors'; +import { foreground, contrastBorder, activeContrastBorder } from './baseColors.js'; +import { scrollbarShadow, badgeBackground } from './miscColors.js'; // ----- editor @@ -26,7 +26,7 @@ export const editorForeground = registerColor('editor.foreground', export const editorStickyScrollBackground = registerColor('editorStickyScroll.background', - { light: editorBackground, dark: editorBackground, hcDark: editorBackground, hcLight: editorBackground }, + editorBackground, nls.localize('editorStickyScrollBackground', "Background color of sticky scroll in the editor")); export const editorStickyScrollHoverBackground = registerColor('editorStickyScrollHover.background', @@ -38,7 +38,7 @@ export const editorStickyScrollBorder = registerColor('editorStickyScroll.border nls.localize('editorStickyScrollBorder', "Border color of sticky scroll in the editor")); export const editorStickyScrollShadow = registerColor('editorStickyScroll.shadow', - { dark: scrollbarShadow, light: scrollbarShadow, hcDark: scrollbarShadow, hcLight: scrollbarShadow }, + scrollbarShadow, nls.localize('editorStickyScrollShadow', " Shadow color of sticky scroll in the editor")); @@ -47,7 +47,7 @@ export const editorWidgetBackground = registerColor('editorWidget.background', nls.localize('editorWidgetBackground', 'Background color of editor widgets, such as find/replace.')); export const editorWidgetForeground = registerColor('editorWidget.foreground', - { dark: foreground, light: foreground, hcDark: foreground, hcLight: foreground }, + foreground, nls.localize('editorWidgetForeground', 'Foreground color of editor widgets, such as find/replace.')); export const editorWidgetBorder = registerColor('editorWidget.border', @@ -55,12 +55,12 @@ export const editorWidgetBorder = registerColor('editorWidget.border', nls.localize('editorWidgetBorder', 'Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.')); export const editorWidgetResizeBorder = registerColor('editorWidget.resizeBorder', - { light: null, dark: null, hcDark: null, hcLight: null }, + null, nls.localize('editorWidgetResizeBorder', "Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")); export const editorErrorBackground = registerColor('editorError.background', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('editorError.background', 'Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations.'), true); export const editorErrorForeground = registerColor('editorError.foreground', @@ -73,7 +73,7 @@ export const editorErrorBorder = registerColor('editorError.border', export const editorWarningBackground = registerColor('editorWarning.background', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('editorWarning.background', 'Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations.'), true); export const editorWarningForeground = registerColor('editorWarning.foreground', @@ -86,7 +86,7 @@ export const editorWarningBorder = registerColor('editorWarning.border', export const editorInfoBackground = registerColor('editorInfo.background', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('editorInfo.background', 'Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations.'), true); export const editorInfoForeground = registerColor('editorInfo.foreground', @@ -142,7 +142,7 @@ export const editorFindMatch = registerColor('editor.findMatchBackground', nls.localize('editorFindMatch', "Color of the current search match.")); export const editorFindMatchForeground = registerColor('editor.findMatchForeground', - { light: null, dark: null, hcDark: null, hcLight: null }, + null, nls.localize('editorFindMatchForeground', "Text color of the current search match.")); export const editorFindMatchHighlight = registerColor('editor.findMatchHighlightBackground', @@ -150,7 +150,7 @@ export const editorFindMatchHighlight = registerColor('editor.findMatchHighlight nls.localize('findMatchHighlight', "Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."), true); export const editorFindMatchHighlightForeground = registerColor('editor.findMatchHighlightForeground', - { light: null, dark: null, hcDark: null, hcLight: null }, + null, nls.localize('findMatchHighlightForeground', "Foreground color of the other search matches."), true); export const editorFindRangeHighlight = registerColor('editor.findRangeHighlightBackground', @@ -177,15 +177,15 @@ export const editorHoverHighlight = registerColor('editor.hoverHighlightBackgrou nls.localize('hoverHighlight', 'Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations.'), true); export const editorHoverBackground = registerColor('editorHoverWidget.background', - { light: editorWidgetBackground, dark: editorWidgetBackground, hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, + editorWidgetBackground, nls.localize('hoverBackground', 'Background color of the editor hover.')); export const editorHoverForeground = registerColor('editorHoverWidget.foreground', - { light: editorWidgetForeground, dark: editorWidgetForeground, hcDark: editorWidgetForeground, hcLight: editorWidgetForeground }, + editorWidgetForeground, nls.localize('hoverForeground', 'Foreground color of the editor hover.')); export const editorHoverBorder = registerColor('editorHoverWidget.border', - { light: editorWidgetBorder, dark: editorWidgetBorder, hcDark: editorWidgetBorder, hcLight: editorWidgetBorder }, + editorWidgetBorder, nls.localize('hoverBorder', 'Border color of the editor hover.')); export const editorHoverStatusBarBackground = registerColor('editorHoverWidget.statusBarBackground', @@ -204,19 +204,19 @@ export const editorInlayHintBackground = registerColor('editorInlayHint.backgrou nls.localize('editorInlayHintBackground', 'Background color of inline hints')); export const editorInlayHintTypeForeground = registerColor('editorInlayHint.typeForeground', - { dark: editorInlayHintForeground, light: editorInlayHintForeground, hcDark: editorInlayHintForeground, hcLight: editorInlayHintForeground }, + editorInlayHintForeground, nls.localize('editorInlayHintForegroundTypes', 'Foreground color of inline hints for types')); export const editorInlayHintTypeBackground = registerColor('editorInlayHint.typeBackground', - { dark: editorInlayHintBackground, light: editorInlayHintBackground, hcDark: editorInlayHintBackground, hcLight: editorInlayHintBackground }, + editorInlayHintBackground, nls.localize('editorInlayHintBackgroundTypes', 'Background color of inline hints for types')); export const editorInlayHintParameterForeground = registerColor('editorInlayHint.parameterForeground', - { dark: editorInlayHintForeground, light: editorInlayHintForeground, hcDark: editorInlayHintForeground, hcLight: editorInlayHintForeground }, + editorInlayHintForeground, nls.localize('editorInlayHintForegroundParameter', 'Foreground color of inline hints for parameters')); export const editorInlayHintParameterBackground = registerColor('editorInlayHint.parameterBackground', - { dark: editorInlayHintBackground, light: editorInlayHintBackground, hcDark: editorInlayHintBackground, hcLight: editorInlayHintBackground }, + editorInlayHintBackground, nls.localize('editorInlayHintBackgroundParameter', 'Background color of inline hints for parameters')); @@ -231,7 +231,7 @@ export const editorLightBulbAutoFixForeground = registerColor('editorLightBulbAu nls.localize('editorLightBulbAutoFixForeground', "The color used for the lightbulb auto fix actions icon.")); export const editorLightBulbAiForeground = registerColor('editorLightBulbAi.foreground', - { dark: editorLightBulbForeground, light: editorLightBulbForeground, hcDark: editorLightBulbForeground, hcLight: editorLightBulbForeground }, + editorLightBulbForeground, nls.localize('editorLightBulbAiForeground', "The color used for the lightbulb AI icon.")); @@ -242,11 +242,11 @@ export const snippetTabstopHighlightBackground = registerColor('editor.snippetTa nls.localize('snippetTabstopHighlightBackground', "Highlight background color of a snippet tabstop.")); export const snippetTabstopHighlightBorder = registerColor('editor.snippetTabstopHighlightBorder', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('snippetTabstopHighlightBorder', "Highlight border color of a snippet tabstop.")); export const snippetFinalTabstopHighlightBackground = registerColor('editor.snippetFinalTabstopHighlightBackground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('snippetFinalTabstopHighlightBackground', "Highlight background color of the final tabstop of a snippet.")); export const snippetFinalTabstopHighlightBorder = registerColor('editor.snippetFinalTabstopHighlightBorder', @@ -278,20 +278,20 @@ export const diffRemovedLine = registerColor('diffEditor.removedLineBackground', export const diffInsertedLineGutter = registerColor('diffEditorGutter.insertedLineBackground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('diffEditorInsertedLineGutter', 'Background color for the margin where lines got inserted.')); export const diffRemovedLineGutter = registerColor('diffEditorGutter.removedLineBackground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('diffEditorRemovedLineGutter', 'Background color for the margin where lines got removed.')); export const diffOverviewRulerInserted = registerColor('diffEditorOverview.insertedForeground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('diffEditorOverviewInserted', 'Diff overview ruler foreground for inserted content.')); export const diffOverviewRulerRemoved = registerColor('diffEditorOverview.removedForeground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('diffEditorOverviewRemoved', 'Diff overview ruler foreground for removed content.')); @@ -314,11 +314,11 @@ export const diffDiagonalFill = registerColor('diffEditor.diagonalFill', export const diffUnchangedRegionBackground = registerColor('diffEditor.unchangedRegionBackground', - { dark: 'sideBar.background', light: 'sideBar.background', hcDark: 'sideBar.background', hcLight: 'sideBar.background' }, + 'sideBar.background', nls.localize('diffEditor.unchangedRegionBackground', "The background color of unchanged blocks in the diff editor.")); export const diffUnchangedRegionForeground = registerColor('diffEditor.unchangedRegionForeground', - { dark: 'foreground', light: 'foreground', hcDark: 'foreground', hcLight: 'foreground' }, + 'foreground', nls.localize('diffEditor.unchangedRegionForeground', "The foreground color of unchanged blocks in the diff editor.")); export const diffUnchangedTextBackground = registerColor('diffEditor.unchangedCodeBackground', @@ -355,11 +355,11 @@ export const toolbarActiveBackground = registerColor('toolbar.activeBackground', // ----- breadcumbs export const breadcrumbsForeground = registerColor('breadcrumb.foreground', - { light: transparent(foreground, 0.8), dark: transparent(foreground, 0.8), hcDark: transparent(foreground, 0.8), hcLight: transparent(foreground, 0.8) }, + transparent(foreground, 0.8), nls.localize('breadcrumbsFocusForeground', "Color of focused breadcrumb items.")); export const breadcrumbsBackground = registerColor('breadcrumb.background', - { light: editorBackground, dark: editorBackground, hcDark: editorBackground, hcLight: editorBackground }, + editorBackground, nls.localize('breadcrumbsBackground', "Background color of breadcrumb items.")); export const breadcrumbsFocusForeground = registerColor('breadcrumb.focusForeground', @@ -371,7 +371,7 @@ export const breadcrumbsActiveSelectionForeground = registerColor('breadcrumb.ac nls.localize('breadcrumbsSelectedForeground', "Color of selected breadcrumb items.")); export const breadcrumbsPickerBackground = registerColor('breadcrumbPicker.background', - { light: editorWidgetBackground, dark: editorWidgetBackground, hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, + editorWidgetBackground, nls.localize('breadcrumbsSelectedBackground', "Background color of breadcrumb item picker.")); @@ -389,7 +389,7 @@ export const mergeCurrentHeaderBackground = registerColor('merge.currentHeaderBa nls.localize('mergeCurrentHeaderBackground', 'Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true); export const mergeCurrentContentBackground = registerColor('merge.currentContentBackground', - { dark: transparent(mergeCurrentHeaderBackground, contentTransparency), light: transparent(mergeCurrentHeaderBackground, contentTransparency), hcDark: transparent(mergeCurrentHeaderBackground, contentTransparency), hcLight: transparent(mergeCurrentHeaderBackground, contentTransparency) }, + transparent(mergeCurrentHeaderBackground, contentTransparency), nls.localize('mergeCurrentContentBackground', 'Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true); export const mergeIncomingHeaderBackground = registerColor('merge.incomingHeaderBackground', @@ -397,7 +397,7 @@ export const mergeIncomingHeaderBackground = registerColor('merge.incomingHeader nls.localize('mergeIncomingHeaderBackground', 'Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true); export const mergeIncomingContentBackground = registerColor('merge.incomingContentBackground', - { dark: transparent(mergeIncomingHeaderBackground, contentTransparency), light: transparent(mergeIncomingHeaderBackground, contentTransparency), hcDark: transparent(mergeIncomingHeaderBackground, contentTransparency), hcLight: transparent(mergeIncomingHeaderBackground, contentTransparency) }, + transparent(mergeIncomingHeaderBackground, contentTransparency), nls.localize('mergeIncomingContentBackground', 'Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true); export const mergeCommonHeaderBackground = registerColor('merge.commonHeaderBackground', @@ -405,7 +405,7 @@ export const mergeCommonHeaderBackground = registerColor('merge.commonHeaderBack nls.localize('mergeCommonHeaderBackground', 'Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true); export const mergeCommonContentBackground = registerColor('merge.commonContentBackground', - { dark: transparent(mergeCommonHeaderBackground, contentTransparency), light: transparent(mergeCommonHeaderBackground, contentTransparency), hcDark: transparent(mergeCommonHeaderBackground, contentTransparency), hcLight: transparent(mergeCommonHeaderBackground, contentTransparency) }, + transparent(mergeCommonHeaderBackground, contentTransparency), nls.localize('mergeCommonContentBackground', 'Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true); export const mergeBorder = registerColor('merge.border', @@ -426,24 +426,24 @@ export const overviewRulerCommonContentForeground = registerColor('editorOvervie nls.localize('overviewRulerCommonContentForeground', 'Common ancestor overview ruler foreground for inline merge-conflicts.')); export const overviewRulerFindMatchForeground = registerColor('editorOverviewRuler.findMatchForeground', - { dark: '#d186167e', light: '#d186167e', hcDark: '#AB5A00', hcLight: '' }, + { dark: '#d186167e', light: '#d186167e', hcDark: '#AB5A00', hcLight: '#AB5A00' }, nls.localize('overviewRulerFindMatchForeground', 'Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations.'), true); export const overviewRulerSelectionHighlightForeground = registerColor('editorOverviewRuler.selectionHighlightForeground', - { dark: '#A0A0A0CC', light: '#A0A0A0CC', hcDark: '#A0A0A0CC', hcLight: '#A0A0A0CC' }, + '#A0A0A0CC', nls.localize('overviewRulerSelectionHighlightForeground', 'Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations.'), true); // ----- problems export const problemsErrorIconForeground = registerColor('problemsErrorIcon.foreground', - { dark: editorErrorForeground, light: editorErrorForeground, hcDark: editorErrorForeground, hcLight: editorErrorForeground }, + editorErrorForeground, nls.localize('problemsErrorIconForeground', "The color used for the problems error icon.")); export const problemsWarningIconForeground = registerColor('problemsWarningIcon.foreground', - { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningForeground, hcLight: editorWarningForeground }, + editorWarningForeground, nls.localize('problemsWarningIconForeground', "The color used for the problems warning icon.")); export const problemsInfoIconForeground = registerColor('problemsInfoIcon.foreground', - { dark: editorInfoForeground, light: editorInfoForeground, hcDark: editorInfoForeground, hcLight: editorInfoForeground }, + editorInfoForeground, nls.localize('problemsInfoIconForeground', "The color used for the problems info icon.")); diff --git a/src/vs/platform/theme/common/colors/inputColors.ts b/src/vs/platform/theme/common/colors/inputColors.ts index dc38222d402..1cf5a83e85a 100644 --- a/src/vs/platform/theme/common/colors/inputColors.ts +++ b/src/vs/platform/theme/common/colors/inputColors.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../../nls.js'; // Import the effects we need -import { Color, RGBA } from 'vs/base/common/color'; -import { registerColor, transparent, lighten, darken } from 'vs/platform/theme/common/colorUtils'; +import { Color, RGBA } from '../../../../base/common/color.js'; +import { registerColor, transparent, lighten, darken } from '../colorUtils.js'; // Import the colors we need -import { foreground, contrastBorder, focusBorder, iconForeground } from 'vs/platform/theme/common/colors/baseColors'; -import { editorWidgetBackground } from 'vs/platform/theme/common/colors/editorColors'; +import { foreground, contrastBorder, focusBorder, iconForeground } from './baseColors.js'; +import { editorWidgetBackground } from './editorColors.js'; // ----- input @@ -21,7 +21,7 @@ export const inputBackground = registerColor('input.background', nls.localize('inputBoxBackground', "Input box background.")); export const inputForeground = registerColor('input.foreground', - { dark: foreground, light: foreground, hcDark: foreground, hcLight: foreground }, + foreground, nls.localize('inputBoxForeground', "Input box foreground.")); export const inputBorder = registerColor('input.border', @@ -110,11 +110,11 @@ export const selectBorder = registerColor('dropdown.border', // ------ button export const buttonForeground = registerColor('button.foreground', - { dark: Color.white, light: Color.white, hcDark: Color.white, hcLight: Color.white }, + Color.white, nls.localize('buttonForeground', "Button foreground color.")); export const buttonSeparator = registerColor('button.separator', - { dark: transparent(buttonForeground, .4), light: transparent(buttonForeground, .4), hcDark: transparent(buttonForeground, .4), hcLight: transparent(buttonForeground, .4) }, + transparent(buttonForeground, .4), nls.localize('buttonSeparator', "Button separator color.")); export const buttonBackground = registerColor('button.background', @@ -126,7 +126,7 @@ export const buttonHoverBackground = registerColor('button.hoverBackground', nls.localize('buttonHoverBackground', "Button background color when hovering.")); export const buttonBorder = registerColor('button.border', - { dark: contrastBorder, light: contrastBorder, hcDark: contrastBorder, hcLight: contrastBorder }, + contrastBorder, nls.localize('buttonBorder', "Button border color.")); export const buttonSecondaryForeground = registerColor('button.secondaryForeground', @@ -141,27 +141,56 @@ export const buttonSecondaryHoverBackground = registerColor('button.secondaryHov { dark: lighten(buttonSecondaryBackground, 0.2), light: darken(buttonSecondaryBackground, 0.2), hcDark: null, hcLight: null }, nls.localize('buttonSecondaryHoverBackground', "Secondary button background color when hovering.")); +// ------ radio + +export const radioActiveForeground = registerColor('radio.activeForeground', + inputActiveOptionForeground, + nls.localize('radioActiveForeground', "Foreground color of active radio option.")); + +export const radioActiveBackground = registerColor('radio.activeBackground', + inputActiveOptionBackground, + nls.localize('radioBackground', "Background color of active radio option.")); + +export const radioActiveBorder = registerColor('radio.activeBorder', + inputActiveOptionBorder, + nls.localize('radioActiveBorder', "Border color of the active radio option.")); + +export const radioInactiveForeground = registerColor('radio.inactiveForeground', + null, + nls.localize('radioInactiveForeground', "Foreground color of inactive radio option.")); + +export const radioInactiveBackground = registerColor('radio.inactiveBackground', + null, + nls.localize('radioInactiveBackground', "Background color of inactive radio option.")); + +export const radioInactiveBorder = registerColor('radio.inactiveBorder', + { light: transparent(radioActiveForeground, .2), dark: transparent(radioActiveForeground, .2), hcDark: transparent(radioActiveForeground, .4), hcLight: transparent(radioActiveForeground, .2) }, + nls.localize('radioInactiveBorder', "Border color of the inactive radio option.")); + +export const radioInactiveHoverBackground = registerColor('radio.inactiveHoverBackground', + inputActiveOptionHoverBackground, + nls.localize('radioHoverBackground', "Background color of inactive active radio option when hovering.")); // ------ checkbox export const checkboxBackground = registerColor('checkbox.background', - { dark: selectBackground, light: selectBackground, hcDark: selectBackground, hcLight: selectBackground }, + selectBackground, nls.localize('checkbox.background', "Background color of checkbox widget.")); export const checkboxSelectBackground = registerColor('checkbox.selectBackground', - { dark: editorWidgetBackground, light: editorWidgetBackground, hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, + editorWidgetBackground, nls.localize('checkbox.select.background', "Background color of checkbox widget when the element it's in is selected.")); export const checkboxForeground = registerColor('checkbox.foreground', - { dark: selectForeground, light: selectForeground, hcDark: selectForeground, hcLight: selectForeground }, + selectForeground, nls.localize('checkbox.foreground', "Foreground color of checkbox widget.")); export const checkboxBorder = registerColor('checkbox.border', - { dark: selectBorder, light: selectBorder, hcDark: selectBorder, hcLight: selectBorder }, + selectBorder, nls.localize('checkbox.border', "Border color of checkbox widget.")); export const checkboxSelectBorder = registerColor('checkbox.selectBorder', - { dark: iconForeground, light: iconForeground, hcDark: iconForeground, hcLight: iconForeground }, + iconForeground, nls.localize('checkbox.select.border', "Border color of checkbox widget when the element it's in is selected.")); diff --git a/src/vs/platform/theme/common/colors/listColors.ts b/src/vs/platform/theme/common/colors/listColors.ts index b6f51e3696b..8e345ded0db 100644 --- a/src/vs/platform/theme/common/colors/listColors.ts +++ b/src/vs/platform/theme/common/colors/listColors.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../../nls.js'; // Import the effects we need -import { Color } from 'vs/base/common/color'; -import { registerColor, darken, lighten, transparent, ifDefinedThenElse } from 'vs/platform/theme/common/colorUtils'; +import { Color } from '../../../../base/common/color.js'; +import { registerColor, darken, lighten, transparent, ifDefinedThenElse } from '../colorUtils.js'; // Import the colors we need -import { foreground, contrastBorder, activeContrastBorder, focusBorder, iconForeground } from 'vs/platform/theme/common/colors/baseColors'; -import { editorWidgetBackground, editorFindMatchHighlightBorder, editorFindMatchHighlight, widgetShadow } from 'vs/platform/theme/common/colors/editorColors'; +import { foreground, contrastBorder, activeContrastBorder, focusBorder, iconForeground } from './baseColors.js'; +import { editorWidgetBackground, editorFindMatchHighlightBorder, editorFindMatchHighlight, widgetShadow, editorWidgetForeground } from './editorColors.js'; export const listFocusBackground = registerColor('list.focusBackground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('listFocusBackground', "List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); export const listFocusForeground = registerColor('list.focusForeground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('listFocusForeground', "List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); export const listFocusOutline = registerColor('list.focusOutline', @@ -27,7 +27,7 @@ export const listFocusOutline = registerColor('list.focusOutline', nls.localize('listFocusOutline', "List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); export const listFocusAndSelectionOutline = registerColor('list.focusAndSelectionOutline', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('listFocusAndSelectionOutline', "List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")); export const listActiveSelectionBackground = registerColor('list.activeSelectionBackground', @@ -39,7 +39,7 @@ export const listActiveSelectionForeground = registerColor('list.activeSelection nls.localize('listActiveSelectionForeground', "List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); export const listActiveSelectionIconForeground = registerColor('list.activeSelectionIconForeground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('listActiveSelectionIconForeground', "List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); export const listInactiveSelectionBackground = registerColor('list.inactiveSelectionBackground', @@ -47,19 +47,19 @@ export const listInactiveSelectionBackground = registerColor('list.inactiveSelec nls.localize('listInactiveSelectionBackground', "List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); export const listInactiveSelectionForeground = registerColor('list.inactiveSelectionForeground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('listInactiveSelectionForeground', "List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); export const listInactiveSelectionIconForeground = registerColor('list.inactiveSelectionIconForeground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('listInactiveSelectionIconForeground', "List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); export const listInactiveFocusBackground = registerColor('list.inactiveFocusBackground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('listInactiveFocusBackground', "List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); export const listInactiveFocusOutline = registerColor('list.inactiveFocusOutline', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('listInactiveFocusOutline', "List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); export const listHoverBackground = registerColor('list.hoverBackground', @@ -67,7 +67,7 @@ export const listHoverBackground = registerColor('list.hoverBackground', nls.localize('listHoverBackground', "List/Tree background when hovering over items using the mouse.")); export const listHoverForeground = registerColor('list.hoverForeground', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('listHoverForeground', "List/Tree foreground when hovering over items using the mouse.")); export const listDropOverBackground = registerColor('list.dropBackground', @@ -109,7 +109,7 @@ export const listFilterWidgetNoMatchesOutline = registerColor('listFilterWidget. nls.localize('listFilterWidgetNoMatchesOutline', 'Outline color of the type filter widget in lists and trees, when there are no matches.')); export const listFilterWidgetShadow = registerColor('listFilterWidget.shadow', - { dark: widgetShadow, light: widgetShadow, hcDark: widgetShadow, hcLight: widgetShadow }, + widgetShadow, nls.localize('listFilterWidgetShadow', 'Shadow color of the type filter widget in lists and trees.')); export const listFilterMatchHighlight = registerColor('list.filterMatchBackground', @@ -132,7 +132,7 @@ export const treeIndentGuidesStroke = registerColor('tree.indentGuidesStroke', nls.localize('treeIndentGuidesStroke', "Tree stroke color for the indentation guides.")); export const treeInactiveIndentGuidesStroke = registerColor('tree.inactiveIndentGuidesStroke', - { dark: transparent(treeIndentGuidesStroke, 0.4), light: transparent(treeIndentGuidesStroke, 0.4), hcDark: transparent(treeIndentGuidesStroke, 0.4), hcLight: transparent(treeIndentGuidesStroke, 0.4) }, + transparent(treeIndentGuidesStroke, 0.4), nls.localize('treeInactiveIndentGuidesStroke', "Tree stroke color for the indentation guides that are not active.")); @@ -145,3 +145,21 @@ export const tableColumnsBorder = registerColor('tree.tableColumnsBorder', export const tableOddRowsBackgroundColor = registerColor('tree.tableOddRowsBackground', { dark: transparent(foreground, 0.04), light: transparent(foreground, 0.04), hcDark: null, hcLight: null }, nls.localize('tableOddRowsBackgroundColor', "Background color for odd table rows.")); + +// ------ action list + +export const editorActionListBackground = registerColor('editorActionList.background', + editorWidgetBackground, + nls.localize('editorActionListBackground', "Action List background color.")); + +export const editorActionListForeground = registerColor('editorActionList.foreground', + editorWidgetForeground, + nls.localize('editorActionListForeground', "Action List foreground color.")); + +export const editorActionListFocusForeground = registerColor('editorActionList.focusForeground', + listActiveSelectionForeground, + nls.localize('editorActionListFocusForeground', "Action List foreground color for the focused item.")); + +export const editorActionListFocusBackground = registerColor('editorActionList.focusBackground', + listActiveSelectionBackground, + nls.localize('editorActionListFocusBackground', "Action List background color for the focused item.")); diff --git a/src/vs/platform/theme/common/colors/menuColors.ts b/src/vs/platform/theme/common/colors/menuColors.ts index 6fa9a0ec326..116a293aa07 100644 --- a/src/vs/platform/theme/common/colors/menuColors.ts +++ b/src/vs/platform/theme/common/colors/menuColors.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../../nls.js'; // Import the effects we need -import { registerColor } from 'vs/platform/theme/common/colorUtils'; +import { registerColor } from '../colorUtils.js'; // Import the colors we need -import { contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colors/baseColors'; -import { selectForeground, selectBackground } from 'vs/platform/theme/common/colors/inputColors'; -import { listActiveSelectionBackground, listActiveSelectionForeground } from 'vs/platform/theme/common/colors/listColors'; +import { contrastBorder, activeContrastBorder } from './baseColors.js'; +import { selectForeground, selectBackground } from './inputColors.js'; +import { listActiveSelectionBackground, listActiveSelectionForeground } from './listColors.js'; export const menuBorder = registerColor('menu.border', @@ -19,19 +19,19 @@ export const menuBorder = registerColor('menu.border', nls.localize('menuBorder', "Border color of menus.")); export const menuForeground = registerColor('menu.foreground', - { dark: selectForeground, light: selectForeground, hcDark: selectForeground, hcLight: selectForeground }, + selectForeground, nls.localize('menuForeground', "Foreground color of menu items.")); export const menuBackground = registerColor('menu.background', - { dark: selectBackground, light: selectBackground, hcDark: selectBackground, hcLight: selectBackground }, + selectBackground, nls.localize('menuBackground', "Background color of menu items.")); export const menuSelectionForeground = registerColor('menu.selectionForeground', - { dark: listActiveSelectionForeground, light: listActiveSelectionForeground, hcDark: listActiveSelectionForeground, hcLight: listActiveSelectionForeground }, + listActiveSelectionForeground, nls.localize('menuSelectionForeground', "Foreground color of the selected menu item in menus.")); export const menuSelectionBackground = registerColor('menu.selectionBackground', - { dark: listActiveSelectionBackground, light: listActiveSelectionBackground, hcDark: listActiveSelectionBackground, hcLight: listActiveSelectionBackground }, + listActiveSelectionBackground, nls.localize('menuSelectionBackground', "Background color of the selected menu item in menus.")); export const menuSelectionBorder = registerColor('menu.selectionBorder', diff --git a/src/vs/platform/theme/common/colors/minimapColors.ts b/src/vs/platform/theme/common/colors/minimapColors.ts index 0b051994d09..3ac33997731 100644 --- a/src/vs/platform/theme/common/colors/minimapColors.ts +++ b/src/vs/platform/theme/common/colors/minimapColors.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../../nls.js'; // Import the effects we need -import { Color, RGBA } from 'vs/base/common/color'; -import { registerColor, transparent } from 'vs/platform/theme/common/colorUtils'; +import { Color, RGBA } from '../../../../base/common/color.js'; +import { registerColor, transparent } from '../colorUtils.js'; // Import the colors we need -import { editorInfoForeground, editorWarningForeground, editorWarningBorder, editorInfoBorder } from 'vs/platform/theme/common/colors/editorColors'; -import { scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground } from 'vs/platform/theme/common/colors/miscColors'; +import { editorInfoForeground, editorWarningForeground, editorWarningBorder, editorInfoBorder } from './editorColors.js'; +import { scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground } from './miscColors.js'; export const minimapFindMatch = registerColor('minimap.findMatchHighlight', @@ -39,21 +39,21 @@ export const minimapError = registerColor('minimap.errorHighlight', nls.localize('minimapError', 'Minimap marker color for errors.')); export const minimapBackground = registerColor('minimap.background', - { dark: null, light: null, hcDark: null, hcLight: null }, + null, nls.localize('minimapBackground', "Minimap background color.")); export const minimapForegroundOpacity = registerColor('minimap.foregroundOpacity', - { dark: Color.fromHex('#000f'), light: Color.fromHex('#000f'), hcDark: Color.fromHex('#000f'), hcLight: Color.fromHex('#000f') }, + Color.fromHex('#000f'), nls.localize('minimapForegroundOpacity', 'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')); export const minimapSliderBackground = registerColor('minimapSlider.background', - { light: transparent(scrollbarSliderBackground, 0.5), dark: transparent(scrollbarSliderBackground, 0.5), hcDark: transparent(scrollbarSliderBackground, 0.5), hcLight: transparent(scrollbarSliderBackground, 0.5) }, + transparent(scrollbarSliderBackground, 0.5), nls.localize('minimapSliderBackground', "Minimap slider background color.")); export const minimapSliderHoverBackground = registerColor('minimapSlider.hoverBackground', - { light: transparent(scrollbarSliderHoverBackground, 0.5), dark: transparent(scrollbarSliderHoverBackground, 0.5), hcDark: transparent(scrollbarSliderHoverBackground, 0.5), hcLight: transparent(scrollbarSliderHoverBackground, 0.5) }, + transparent(scrollbarSliderHoverBackground, 0.5), nls.localize('minimapSliderHoverBackground', "Minimap slider background color when hovering.")); export const minimapSliderActiveBackground = registerColor('minimapSlider.activeBackground', - { light: transparent(scrollbarSliderActiveBackground, 0.5), dark: transparent(scrollbarSliderActiveBackground, 0.5), hcDark: transparent(scrollbarSliderActiveBackground, 0.5), hcLight: transparent(scrollbarSliderActiveBackground, 0.5) }, + transparent(scrollbarSliderActiveBackground, 0.5), nls.localize('minimapSliderActiveBackground', "Minimap slider background color when clicked on.")); diff --git a/src/vs/platform/theme/common/colors/miscColors.ts b/src/vs/platform/theme/common/colors/miscColors.ts index 5a2ea49b702..7be17f5c44e 100644 --- a/src/vs/platform/theme/common/colors/miscColors.ts +++ b/src/vs/platform/theme/common/colors/miscColors.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../../nls.js'; // Import the effects we need -import { Color } from 'vs/base/common/color'; -import { registerColor, transparent } from 'vs/platform/theme/common/colorUtils'; +import { Color } from '../../../../base/common/color.js'; +import { registerColor, transparent } from '../colorUtils.js'; // Import the colors we need -import { contrastBorder, focusBorder } from 'vs/platform/theme/common/colors/baseColors'; +import { contrastBorder, focusBorder } from './baseColors.js'; // ----- sash export const sashHoverBorder = registerColor('sash.hoverBorder', - { dark: focusBorder, light: focusBorder, hcDark: focusBorder, hcLight: focusBorder }, + focusBorder, nls.localize('sashActiveBorder', "Border color of active sashes.")); diff --git a/src/vs/platform/theme/common/colors/quickpickColors.ts b/src/vs/platform/theme/common/colors/quickpickColors.ts index 7f8fc271a6e..96e9b2a1f2c 100644 --- a/src/vs/platform/theme/common/colors/quickpickColors.ts +++ b/src/vs/platform/theme/common/colors/quickpickColors.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../../nls.js'; // Import the effects we need -import { Color, RGBA } from 'vs/base/common/color'; -import { registerColor, oneOf } from 'vs/platform/theme/common/colorUtils'; +import { Color, RGBA } from '../../../../base/common/color.js'; +import { registerColor, oneOf } from '../colorUtils.js'; // Import the colors we need -import { editorWidgetBackground, editorWidgetForeground } from 'vs/platform/theme/common/colors/editorColors'; -import { listActiveSelectionBackground, listActiveSelectionForeground, listActiveSelectionIconForeground } from 'vs/platform/theme/common/colors/listColors'; +import { editorWidgetBackground, editorWidgetForeground } from './editorColors.js'; +import { listActiveSelectionBackground, listActiveSelectionForeground, listActiveSelectionIconForeground } from './listColors.js'; export const quickInputBackground = registerColor('quickInput.background', - { dark: editorWidgetBackground, light: editorWidgetBackground, hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, + editorWidgetBackground, nls.localize('pickerBackground', "Quick picker background color. The quick picker widget is the container for pickers like the command palette.")); export const quickInputForeground = registerColor('quickInput.foreground', - { dark: editorWidgetForeground, light: editorWidgetForeground, hcDark: editorWidgetForeground, hcLight: editorWidgetForeground }, + editorWidgetForeground, nls.localize('pickerForeground', "Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")); export const quickInputTitleBackground = registerColor('quickInputTitle.background', @@ -35,15 +35,15 @@ export const pickerGroupBorder = registerColor('pickerGroup.border', nls.localize('pickerGroupBorder', "Quick picker color for grouping borders.")); export const _deprecatedQuickInputListFocusBackground = registerColor('quickInput.list.focusBackground', - { dark: null, light: null, hcDark: null, hcLight: null }, '', undefined, + null, '', undefined, nls.localize('quickInput.list.focusBackground deprecation', "Please use quickInputList.focusBackground instead")); export const quickInputListFocusForeground = registerColor('quickInputList.focusForeground', - { dark: listActiveSelectionForeground, light: listActiveSelectionForeground, hcDark: listActiveSelectionForeground, hcLight: listActiveSelectionForeground }, + listActiveSelectionForeground, nls.localize('quickInput.listFocusForeground', "Quick picker foreground color for the focused item.")); export const quickInputListFocusIconForeground = registerColor('quickInputList.focusIconForeground', - { dark: listActiveSelectionIconForeground, light: listActiveSelectionIconForeground, hcDark: listActiveSelectionIconForeground, hcLight: listActiveSelectionIconForeground }, + listActiveSelectionIconForeground, nls.localize('quickInput.listFocusIconForeground', "Quick picker icon foreground color for the focused item.")); export const quickInputListFocusBackground = registerColor('quickInputList.focusBackground', diff --git a/src/vs/platform/theme/common/colors/searchColors.ts b/src/vs/platform/theme/common/colors/searchColors.ts index 8f10c53ab0e..7937f76d080 100644 --- a/src/vs/platform/theme/common/colors/searchColors.ts +++ b/src/vs/platform/theme/common/colors/searchColors.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../../nls.js'; // Import the effects we need -import { registerColor, transparent } from 'vs/platform/theme/common/colorUtils'; +import { registerColor, transparent } from '../colorUtils.js'; // Import the colors we need -import { foreground } from 'vs/platform/theme/common/colors/baseColors'; -import { editorFindMatchHighlight, editorFindMatchHighlightBorder } from 'vs/platform/theme/common/colors/editorColors'; +import { foreground } from './baseColors.js'; +import { editorFindMatchHighlight, editorFindMatchHighlightBorder } from './editorColors.js'; export const searchResultsInfoForeground = registerColor('search.resultsInfoForeground', diff --git a/src/vs/platform/theme/common/iconRegistry.ts b/src/vs/platform/theme/common/iconRegistry.ts index 214f4846dcc..279b30ba113 100644 --- a/src/vs/platform/theme/common/iconRegistry.ts +++ b/src/vs/platform/theme/common/iconRegistry.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { Codicon } from 'vs/base/common/codicons'; -import { getCodiconFontCharacters } from 'vs/base/common/codiconsUtil'; -import { ThemeIcon, IconIdentifier } from 'vs/base/common/themables'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema'; -import { isString } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import * as platform from 'vs/platform/registry/common/platform'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { Codicon } from '../../../base/common/codicons.js'; +import { getCodiconFontCharacters } from '../../../base/common/codiconsUtil.js'; +import { ThemeIcon, IconIdentifier } from '../../../base/common/themables.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IJSONSchema, IJSONSchemaMap } from '../../../base/common/jsonSchema.js'; +import { isString } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { Extensions as JSONExtensions, IJSONContributionRegistry } from '../../jsonschemas/common/jsonContributionRegistry.js'; +import * as platform from '../../registry/common/platform.js'; // ------ API types diff --git a/src/vs/platform/theme/common/themeService.ts b/src/vs/platform/theme/common/themeService.ts index f89940c9f1e..cf850e7726e 100644 --- a/src/vs/platform/theme/common/themeService.ts +++ b/src/vs/platform/theme/common/themeService.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Codicon } from 'vs/base/common/codicons'; -import { Color } from 'vs/base/common/color'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import * as platform from 'vs/platform/registry/common/platform'; -import { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; -import { IconContribution, IconDefinition } from 'vs/platform/theme/common/iconRegistry'; -import { ColorScheme } from 'vs/platform/theme/common/theme'; +import { Codicon } from '../../../base/common/codicons.js'; +import { Color } from '../../../base/common/color.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import * as platform from '../../registry/common/platform.js'; +import { ColorIdentifier } from './colorRegistry.js'; +import { IconContribution, IconDefinition } from './iconRegistry.js'; +import { ColorScheme } from './theme.js'; export const IThemeService = createDecorator('themeService'); @@ -214,9 +214,13 @@ export interface IPartsSplash { foreground: string | undefined; editorBackground: string | undefined; titleBarBackground: string | undefined; + titleBarBorder: string | undefined; activityBarBackground: string | undefined; + activityBarBorder: string | undefined; sideBarBackground: string | undefined; + sideBarBorder: string | undefined; statusBarBackground: string | undefined; + statusBarBorder: string | undefined; statusBarNoFolderBackground: string | undefined; windowBorder: string | undefined; }; diff --git a/src/vs/platform/theme/common/tokenClassificationRegistry.ts b/src/vs/platform/theme/common/tokenClassificationRegistry.ts index b95a89a1435..6b7e07ce8f3 100644 --- a/src/vs/platform/theme/common/tokenClassificationRegistry.ts +++ b/src/vs/platform/theme/common/tokenClassificationRegistry.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { Color } from 'vs/base/common/color'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema'; -import * as nls from 'vs/nls'; -import { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import * as platform from 'vs/platform/registry/common/platform'; -import { IColorTheme } from 'vs/platform/theme/common/themeService'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { Color } from '../../../base/common/color.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IJSONSchema, IJSONSchemaMap } from '../../../base/common/jsonSchema.js'; +import * as nls from '../../../nls.js'; +import { Extensions as JSONExtensions, IJSONContributionRegistry } from '../../jsonschemas/common/jsonContributionRegistry.js'; +import * as platform from '../../registry/common/platform.js'; +import { IColorTheme } from './themeService.js'; const TOKEN_TYPE_WILDCARD = '*'; const TOKEN_CLASSIFIER_LANGUAGE_SEPARATOR = ':'; diff --git a/src/vs/platform/theme/electron-main/themeMainService.ts b/src/vs/platform/theme/electron-main/themeMainService.ts index caef715f2da..aea7ebbb82b 100644 --- a/src/vs/platform/theme/electron-main/themeMainService.ts +++ b/src/vs/platform/theme/electron-main/themeMainService.ts @@ -3,18 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BrowserWindow, nativeTheme } from 'electron'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IStateService } from 'vs/platform/state/node/state'; -import { IPartsSplash } from 'vs/platform/theme/common/themeService'; -import { IColorScheme } from 'vs/platform/window/common/window'; - +import electron from 'electron'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { isLinux, isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IStateService } from '../../state/node/state.js'; +import { IPartsSplash } from '../common/themeService.js'; +import { IColorScheme } from '../../window/common/window.js'; + +// These default colors match our default themes +// editor background color ("Dark Modern", etc...) const DEFAULT_BG_LIGHT = '#FFFFFF'; -const DEFAULT_BG_DARK = '#1E1E1E'; +const DEFAULT_BG_DARK = '#1F1F1F'; const DEFAULT_BG_HC_BLACK = '#000000'; const DEFAULT_BG_HC_LIGHT = '#FFFFFF'; @@ -64,30 +66,30 @@ export class ThemeMainService extends Disposable implements IThemeMainService { this.updateSystemColorTheme(); // Color Scheme changes - this._register(Event.fromNodeEventEmitter(nativeTheme, 'updated')(() => this._onDidChangeColorScheme.fire(this.getColorScheme()))); + this._register(Event.fromNodeEventEmitter(electron.nativeTheme, 'updated')(() => this._onDidChangeColorScheme.fire(this.getColorScheme()))); } private updateSystemColorTheme(): void { if (isLinux || this.configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME)) { // only with `system` we can detect the system color scheme - nativeTheme.themeSource = 'system'; + electron.nativeTheme.themeSource = 'system'; } else { switch (this.configurationService.getValue<'default' | 'auto' | 'light' | 'dark'>(ThemeSettings.SYSTEM_COLOR_THEME)) { case 'dark': - nativeTheme.themeSource = 'dark'; + electron.nativeTheme.themeSource = 'dark'; break; case 'light': - nativeTheme.themeSource = 'light'; + electron.nativeTheme.themeSource = 'light'; break; case 'auto': switch (this.getBaseTheme()) { - case 'vs': nativeTheme.themeSource = 'light'; break; - case 'vs-dark': nativeTheme.themeSource = 'dark'; break; - default: nativeTheme.themeSource = 'system'; + case 'vs': electron.nativeTheme.themeSource = 'light'; break; + case 'vs-dark': electron.nativeTheme.themeSource = 'dark'; break; + default: electron.nativeTheme.themeSource = 'system'; } break; default: - nativeTheme.themeSource = 'system'; + electron.nativeTheme.themeSource = 'system'; break; } @@ -97,23 +99,23 @@ export class ThemeMainService extends Disposable implements IThemeMainService { getColorScheme(): IColorScheme { if (isWindows) { // high contrast is refelected by the shouldUseInvertedColorScheme property - if (nativeTheme.shouldUseHighContrastColors) { + if (electron.nativeTheme.shouldUseHighContrastColors) { // shouldUseInvertedColorScheme is dark, !shouldUseInvertedColorScheme is light - return { dark: nativeTheme.shouldUseInvertedColorScheme, highContrast: true }; + return { dark: electron.nativeTheme.shouldUseInvertedColorScheme, highContrast: true }; } } else if (isMacintosh) { // high contrast is set if one of shouldUseInvertedColorScheme or shouldUseHighContrastColors is set, reflecting the 'Invert colours' and `Increase contrast` settings in MacOS - if (nativeTheme.shouldUseInvertedColorScheme || nativeTheme.shouldUseHighContrastColors) { - return { dark: nativeTheme.shouldUseDarkColors, highContrast: true }; + if (electron.nativeTheme.shouldUseInvertedColorScheme || electron.nativeTheme.shouldUseHighContrastColors) { + return { dark: electron.nativeTheme.shouldUseDarkColors, highContrast: true }; } } else if (isLinux) { // ubuntu gnome seems to have 3 states, light dark and high contrast - if (nativeTheme.shouldUseHighContrastColors) { + if (electron.nativeTheme.shouldUseHighContrastColors) { return { dark: true, highContrast: true }; } } return { - dark: nativeTheme.shouldUseDarkColors, + dark: electron.nativeTheme.shouldUseDarkColors, highContrast: false }; } @@ -134,10 +136,6 @@ export class ThemeMainService extends Disposable implements IThemeMainService { } } - if (isMacintosh && background.toUpperCase() === DEFAULT_BG_DARK) { - background = '#171717'; // https://github.com/electron/electron/issues/5150 - } - return background; } @@ -170,7 +168,7 @@ export class ThemeMainService extends Disposable implements IThemeMainService { } private updateBackgroundColor(windowId: number, splash: IPartsSplash): void { - for (const window of BrowserWindow.getAllWindows()) { + for (const window of electron.BrowserWindow.getAllWindows()) { if (window.id === windowId) { window.setBackgroundColor(splash.colorInfo.background); break; diff --git a/src/vs/platform/theme/test/common/testThemeService.ts b/src/vs/platform/theme/test/common/testThemeService.ts index 5109b055e4c..8ee388d4dbd 100644 --- a/src/vs/platform/theme/test/common/testThemeService.ts +++ b/src/vs/platform/theme/test/common/testThemeService.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Color } from 'vs/base/common/color'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IconContribution } from 'vs/platform/theme/common/iconRegistry'; -import { ColorScheme } from 'vs/platform/theme/common/theme'; -import { IColorTheme, IFileIconTheme, IProductIconTheme, IThemeService, ITokenStyle } from 'vs/platform/theme/common/themeService'; +import { Color } from '../../../../base/common/color.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { IconContribution } from '../../common/iconRegistry.js'; +import { ColorScheme } from '../../common/theme.js'; +import { IColorTheme, IFileIconTheme, IProductIconTheme, IThemeService, ITokenStyle } from '../../common/themeService.js'; export class TestColorTheme implements IColorTheme { diff --git a/src/vs/platform/tunnel/common/tunnel.ts b/src/vs/platform/tunnel/common/tunnel.ts index b1433f2e745..1b0592103ac 100644 --- a/src/vs/platform/tunnel/common/tunnel.ts +++ b/src/vs/platform/tunnel/common/tunnel.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; -import { OperatingSystem } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IAddressProvider } from 'vs/platform/remote/common/remoteAgentConnection'; -import { TunnelPrivacy } from 'vs/platform/remote/common/remoteAuthorityResolver'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IDisposable, Disposable } from '../../../base/common/lifecycle.js'; +import { OperatingSystem } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IAddressProvider } from '../../remote/common/remoteAgentConnection.js'; +import { TunnelPrivacy } from '../../remote/common/remoteAuthorityResolver.js'; export const ITunnelService = createDecorator('tunnelService'); export const ISharedTunnelsService = createDecorator('sharedTunnelsService'); diff --git a/src/vs/platform/tunnel/node/sharedProcessTunnelService.ts b/src/vs/platform/tunnel/node/sharedProcessTunnelService.ts index 4dbb881b3c1..46500cf661b 100644 --- a/src/vs/platform/tunnel/node/sharedProcessTunnelService.ts +++ b/src/vs/platform/tunnel/node/sharedProcessTunnelService.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ILogService } from 'vs/platform/log/common/log'; -import { ISharedProcessTunnel, ISharedProcessTunnelService } from 'vs/platform/remote/common/sharedProcessTunnelService'; -import { ISharedTunnelsService, RemoteTunnel } from 'vs/platform/tunnel/common/tunnel'; -import { IAddress, IAddressProvider } from 'vs/platform/remote/common/remoteAgentConnection'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { canceled } from 'vs/base/common/errors'; -import { DeferredPromise } from 'vs/base/common/async'; +import { ILogService } from '../../log/common/log.js'; +import { ISharedProcessTunnel, ISharedProcessTunnelService } from '../../remote/common/sharedProcessTunnelService.js'; +import { ISharedTunnelsService, RemoteTunnel } from '../common/tunnel.js'; +import { IAddress, IAddressProvider } from '../../remote/common/remoteAgentConnection.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { canceled } from '../../../base/common/errors.js'; +import { DeferredPromise } from '../../../base/common/async.js'; class TunnelData extends Disposable implements IAddressProvider { diff --git a/src/vs/platform/tunnel/node/tunnelService.ts b/src/vs/platform/tunnel/node/tunnelService.ts index f28dc9e2271..3554ea785d7 100644 --- a/src/vs/platform/tunnel/node/tunnelService.ts +++ b/src/vs/platform/tunnel/node/tunnelService.ts @@ -5,21 +5,21 @@ import * as net from 'net'; import * as os from 'os'; -import { BROWSER_RESTRICTED_PORTS, findFreePortFaster } from 'vs/base/node/ports'; -import { NodeSocket } from 'vs/base/parts/ipc/node/ipc.net'; - -import { Barrier } from 'vs/base/common/async'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { OS } from 'vs/base/common/platform'; -import { ISocket } from 'vs/base/parts/ipc/common/ipc.net'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IAddressProvider, IConnectionOptions, connectRemoteAgentTunnel } from 'vs/platform/remote/common/remoteAgentConnection'; -import { IRemoteSocketFactoryService } from 'vs/platform/remote/common/remoteSocketFactoryService'; -import { ISignService } from 'vs/platform/sign/common/sign'; -import { AbstractTunnelService, ISharedTunnelsService, ITunnelProvider, ITunnelService, RemoteTunnel, TunnelPrivacyId, isAllInterfaces, isLocalhost, isPortPrivileged, isTunnelProvider } from 'vs/platform/tunnel/common/tunnel'; -import { VSBuffer } from 'vs/base/common/buffer'; +import { BROWSER_RESTRICTED_PORTS, findFreePortFaster } from '../../../base/node/ports.js'; +import { NodeSocket } from '../../../base/parts/ipc/node/ipc.net.js'; + +import { Barrier } from '../../../base/common/async.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { OS } from '../../../base/common/platform.js'; +import { ISocket } from '../../../base/parts/ipc/common/ipc.net.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IAddressProvider, IConnectionOptions, connectRemoteAgentTunnel } from '../../remote/common/remoteAgentConnection.js'; +import { IRemoteSocketFactoryService } from '../../remote/common/remoteSocketFactoryService.js'; +import { ISignService } from '../../sign/common/sign.js'; +import { AbstractTunnelService, ISharedTunnelsService, ITunnelProvider, ITunnelService, RemoteTunnel, TunnelPrivacyId, isAllInterfaces, isLocalhost, isPortPrivileged, isTunnelProvider } from '../common/tunnel.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; async function createRemoteTunnel(options: IConnectionOptions, defaultTunnelHost: string, tunnelRemoteHost: string, tunnelRemotePort: number, tunnelLocalPort?: number): Promise { let readyTunnel: NodeRemoteTunnel | undefined; diff --git a/src/vs/platform/tunnel/test/common/tunnel.test.ts b/src/vs/platform/tunnel/test/common/tunnel.test.ts index ae32707eb30..2a243f48e05 100644 --- a/src/vs/platform/tunnel/test/common/tunnel.test.ts +++ b/src/vs/platform/tunnel/test/common/tunnel.test.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; +import { URI } from '../../../../base/common/uri.js'; import { extractLocalHostUriMetaDataForPortMapping, extractQueryLocalHostUriMetaDataForPortMapping -} from 'vs/platform/tunnel/common/tunnel'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +} from '../../common/tunnel.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('Tunnel', () => { diff --git a/src/vs/platform/undoRedo/common/undoRedo.ts b/src/vs/platform/undoRedo/common/undoRedo.ts index a667ae9f8f9..bff14d68aee 100644 --- a/src/vs/platform/undoRedo/common/undoRedo.ts +++ b/src/vs/platform/undoRedo/common/undoRedo.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IUndoRedoService = createDecorator('undoRedoService'); diff --git a/src/vs/platform/undoRedo/common/undoRedoService.ts b/src/vs/platform/undoRedo/common/undoRedoService.ts index 2fc97616747..52be006cc5a 100644 --- a/src/vs/platform/undoRedo/common/undoRedoService.ts +++ b/src/vs/platform/undoRedo/common/undoRedoService.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposable, IDisposable, isDisposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import Severity from 'vs/base/common/severity'; -import { URI } from 'vs/base/common/uri'; -import * as nls from 'vs/nls'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IPastFutureElements, IResourceUndoRedoElement, IUndoRedoElement, IUndoRedoService, IWorkspaceUndoRedoElement, ResourceEditStackSnapshot, UndoRedoElementType, UndoRedoGroup, UndoRedoSource, UriComparisonKeyComputer } from 'vs/platform/undoRedo/common/undoRedo'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import { Disposable, IDisposable, isDisposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import Severity from '../../../base/common/severity.js'; +import { URI } from '../../../base/common/uri.js'; +import * as nls from '../../../nls.js'; +import { IDialogService } from '../../dialogs/common/dialogs.js'; +import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js'; +import { INotificationService } from '../../notification/common/notification.js'; +import { IPastFutureElements, IResourceUndoRedoElement, IUndoRedoElement, IUndoRedoService, IWorkspaceUndoRedoElement, ResourceEditStackSnapshot, UndoRedoElementType, UndoRedoGroup, UndoRedoSource, UriComparisonKeyComputer } from './undoRedo.js'; const DEBUG = false; diff --git a/src/vs/platform/undoRedo/test/common/undoRedoService.test.ts b/src/vs/platform/undoRedo/test/common/undoRedoService.test.ts index 32d33a7d23c..5348387272f 100644 --- a/src/vs/platform/undoRedo/test/common/undoRedoService.test.ts +++ b/src/vs/platform/undoRedo/test/common/undoRedoService.test.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IDialogService, IPrompt } from 'vs/platform/dialogs/common/dialogs'; -import { TestDialogService } from 'vs/platform/dialogs/test/common/testDialogService'; -import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; -import { IUndoRedoElement, UndoRedoElementType, UndoRedoGroup } from 'vs/platform/undoRedo/common/undoRedo'; -import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService'; +import { URI } from '../../../../base/common/uri.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IDialogService, IPrompt } from '../../../dialogs/common/dialogs.js'; +import { TestDialogService } from '../../../dialogs/test/common/testDialogService.js'; +import { TestNotificationService } from '../../../notification/test/common/testNotificationService.js'; +import { IUndoRedoElement, UndoRedoElementType, UndoRedoGroup } from '../../common/undoRedo.js'; +import { UndoRedoService } from '../../common/undoRedoService.js'; suite('UndoRedoService', () => { diff --git a/src/vs/platform/update/common/update.config.contribution.ts b/src/vs/platform/update/common/update.config.contribution.ts index 4134233def6..d96926b5578 100644 --- a/src/vs/platform/update/common/update.config.contribution.ts +++ b/src/vs/platform/update/common/update.config.contribution.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isWeb, isWindows } from 'vs/base/common/platform'; -import { localize } from 'vs/nls'; -import { ConfigurationScope, Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { isWeb, isWindows } from '../../../base/common/platform.js'; +import { localize } from '../../../nls.js'; +import { ConfigurationScope, Extensions as ConfigurationExtensions, IConfigurationRegistry } from '../../configuration/common/configurationRegistry.js'; +import { Registry } from '../../registry/common/platform.js'; const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); configurationRegistry.registerConfiguration({ diff --git a/src/vs/platform/update/common/update.ts b/src/vs/platform/update/common/update.ts index 18cafc9196d..2b0253285aa 100644 --- a/src/vs/platform/update/common/update.ts +++ b/src/vs/platform/update/common/update.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export interface IUpdate { // Windows and Linux: 9a19815253d91900be5ec1016e0ecc7cc9a6950 (Commit Hash). Mac: 1.54.0 (Product Version) diff --git a/src/vs/platform/update/common/updateIpc.ts b/src/vs/platform/update/common/updateIpc.ts index 735ea9526dd..1c9490312fe 100644 --- a/src/vs/platform/update/common/updateIpc.ts +++ b/src/vs/platform/update/common/updateIpc.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IUpdateService, State } from 'vs/platform/update/common/update'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { IUpdateService, State } from './update.js'; export class UpdateChannel implements IServerChannel { diff --git a/src/vs/platform/update/electron-main/abstractUpdateService.ts b/src/vs/platform/update/electron-main/abstractUpdateService.ts index ea18f4ab5a6..48638aa12f7 100644 --- a/src/vs/platform/update/electron-main/abstractUpdateService.ts +++ b/src/vs/platform/update/electron-main/abstractUpdateService.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { timeout } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { ILifecycleMainService, LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { AvailableForDownload, DisablementReason, IUpdateService, State, StateType, UpdateType } from 'vs/platform/update/common/update'; +import { timeout } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { ILifecycleMainService, LifecycleMainPhase } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IRequestService } from '../../request/common/request.js'; +import { AvailableForDownload, DisablementReason, IUpdateService, State, StateType, UpdateType } from '../common/update.js'; export function createUpdateURL(platform: string, quality: string, productService: IProductService): string { return `${productService.updateUrl}/api/update/${platform}/${quality}/${productService.commit}`; diff --git a/src/vs/platform/update/electron-main/updateService.darwin.ts b/src/vs/platform/update/electron-main/updateService.darwin.ts index 183c69da906..d3f27d3711e 100644 --- a/src/vs/platform/update/electron-main/updateService.darwin.ts +++ b/src/vs/platform/update/electron-main/updateService.darwin.ts @@ -4,19 +4,19 @@ *--------------------------------------------------------------------------------------------*/ import * as electron from 'electron'; -import { memoize } from 'vs/base/common/decorators'; -import { Event } from 'vs/base/common/event'; -import { hash } from 'vs/base/common/hash'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { ILifecycleMainService, IRelaunchHandler, IRelaunchOptions } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUpdate, State, StateType, UpdateType } from 'vs/platform/update/common/update'; -import { AbstractUpdateService, createUpdateURL, UpdateErrorClassification, UpdateNotAvailableClassification } from 'vs/platform/update/electron-main/abstractUpdateService'; +import { memoize } from '../../../base/common/decorators.js'; +import { Event } from '../../../base/common/event.js'; +import { hash } from '../../../base/common/hash.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { ILifecycleMainService, IRelaunchHandler, IRelaunchOptions } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IRequestService } from '../../request/common/request.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUpdate, State, StateType, UpdateType } from '../common/update.js'; +import { AbstractUpdateService, createUpdateURL, UpdateErrorClassification, UpdateNotAvailableClassification } from './abstractUpdateService.js'; export class DarwinUpdateService extends AbstractUpdateService implements IRelaunchHandler { diff --git a/src/vs/platform/update/electron-main/updateService.linux.ts b/src/vs/platform/update/electron-main/updateService.linux.ts index c0f18ba9a8c..6e076c72ed8 100644 --- a/src/vs/platform/update/electron-main/updateService.linux.ts +++ b/src/vs/platform/update/electron-main/updateService.linux.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { INativeHostMainService } from 'vs/platform/native/electron-main/nativeHostMainService'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { asJson, IRequestService } from 'vs/platform/request/common/request'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { AvailableForDownload, IUpdate, State, UpdateType } from 'vs/platform/update/common/update'; -import { AbstractUpdateService, createUpdateURL, UpdateNotAvailableClassification } from 'vs/platform/update/electron-main/abstractUpdateService'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { INativeHostMainService } from '../../native/electron-main/nativeHostMainService.js'; +import { IProductService } from '../../product/common/productService.js'; +import { asJson, IRequestService } from '../../request/common/request.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { AvailableForDownload, IUpdate, State, UpdateType } from '../common/update.js'; +import { AbstractUpdateService, createUpdateURL, UpdateNotAvailableClassification } from './abstractUpdateService.js'; export class LinuxUpdateService extends AbstractUpdateService { diff --git a/src/vs/platform/update/electron-main/updateService.snap.ts b/src/vs/platform/update/electron-main/updateService.snap.ts index c20ce198e0c..78bcf9d7a45 100644 --- a/src/vs/platform/update/electron-main/updateService.snap.ts +++ b/src/vs/platform/update/electron-main/updateService.snap.ts @@ -5,15 +5,15 @@ import { spawn } from 'child_process'; import { realpath, watch } from 'fs'; -import { timeout } from 'vs/base/common/async'; -import { Emitter, Event } from 'vs/base/common/event'; -import * as path from 'vs/base/common/path'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { AvailableForDownload, IUpdateService, State, StateType, UpdateType } from 'vs/platform/update/common/update'; -import { UpdateNotAvailableClassification } from 'vs/platform/update/electron-main/abstractUpdateService'; +import { timeout } from '../../../base/common/async.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import * as path from '../../../base/common/path.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { AvailableForDownload, IUpdateService, State, StateType, UpdateType } from '../common/update.js'; +import { UpdateNotAvailableClassification } from './abstractUpdateService.js'; abstract class AbstractUpdateService implements IUpdateService { diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts index 4c49a758185..fa514dff311 100644 --- a/src/vs/platform/update/electron-main/updateService.win32.ts +++ b/src/vs/platform/update/electron-main/updateService.win32.ts @@ -6,25 +6,25 @@ import { spawn } from 'child_process'; import * as fs from 'fs'; import { tmpdir } from 'os'; -import { timeout } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { memoize } from 'vs/base/common/decorators'; -import { hash } from 'vs/base/common/hash'; -import * as path from 'vs/base/common/path'; -import { URI } from 'vs/base/common/uri'; -import { checksum } from 'vs/base/node/crypto'; -import * as pfs from 'vs/base/node/pfs'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { ILifecycleMainService, IRelaunchHandler, IRelaunchOptions } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { INativeHostMainService } from 'vs/platform/native/electron-main/nativeHostMainService'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { asJson, IRequestService } from 'vs/platform/request/common/request'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { AvailableForDownload, DisablementReason, IUpdate, State, StateType, UpdateType } from 'vs/platform/update/common/update'; -import { AbstractUpdateService, createUpdateURL, UpdateErrorClassification, UpdateNotAvailableClassification } from 'vs/platform/update/electron-main/abstractUpdateService'; +import { timeout } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { memoize } from '../../../base/common/decorators.js'; +import { hash } from '../../../base/common/hash.js'; +import * as path from '../../../base/common/path.js'; +import { URI } from '../../../base/common/uri.js'; +import { checksum } from '../../../base/node/crypto.js'; +import * as pfs from '../../../base/node/pfs.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { IFileService } from '../../files/common/files.js'; +import { ILifecycleMainService, IRelaunchHandler, IRelaunchOptions } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { INativeHostMainService } from '../../native/electron-main/nativeHostMainService.js'; +import { IProductService } from '../../product/common/productService.js'; +import { asJson, IRequestService } from '../../request/common/request.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { AvailableForDownload, DisablementReason, IUpdate, State, StateType, UpdateType } from '../common/update.js'; +import { AbstractUpdateService, createUpdateURL, UpdateErrorClassification, UpdateNotAvailableClassification } from './abstractUpdateService.js'; async function pollUntil(fn: () => boolean, millis = 1000): Promise { while (!fn()) { @@ -55,7 +55,7 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun @memoize get cachePath(): Promise { const result = path.join(tmpdir(), `vscode-${this.productService.quality}-${this.productService.target}-${process.arch}`); - return pfs.Promises.mkdir(result, { recursive: true }).then(() => result); + return fs.promises.mkdir(result, { recursive: true }).then(() => result); } constructor( @@ -197,7 +197,7 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun const promises = versions.filter(filter).map(async one => { try { - await pfs.Promises.unlink(path.join(cachePath, one)); + await fs.promises.unlink(path.join(cachePath, one)); } catch (err) { // ignore } diff --git a/src/vs/platform/uriIdentity/common/uriIdentity.ts b/src/vs/platform/uriIdentity/common/uriIdentity.ts index f01d6ccf0f4..8bd6be7dfed 100644 --- a/src/vs/platform/uriIdentity/common/uriIdentity.ts +++ b/src/vs/platform/uriIdentity/common/uriIdentity.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtUri } from 'vs/base/common/resources'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IExtUri } from '../../../base/common/resources.js'; export const IUriIdentityService = createDecorator('IUriIdentityService'); diff --git a/src/vs/platform/uriIdentity/common/uriIdentityService.ts b/src/vs/platform/uriIdentity/common/uriIdentityService.ts index c9ffebe311c..ba9ca5b7ae8 100644 --- a/src/vs/platform/uriIdentity/common/uriIdentityService.ts +++ b/src/vs/platform/uriIdentity/common/uriIdentityService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { URI } from 'vs/base/common/uri'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IFileService, FileSystemProviderCapabilities, IFileSystemProviderCapabilitiesChangeEvent, IFileSystemProviderRegistrationEvent } from 'vs/platform/files/common/files'; -import { ExtUri, IExtUri, normalizePath } from 'vs/base/common/resources'; -import { SkipList } from 'vs/base/common/skipList'; -import { Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; +import { IUriIdentityService } from './uriIdentity.js'; +import { URI } from '../../../base/common/uri.js'; +import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js'; +import { IFileService, FileSystemProviderCapabilities, IFileSystemProviderCapabilitiesChangeEvent, IFileSystemProviderRegistrationEvent } from '../../files/common/files.js'; +import { ExtUri, IExtUri, normalizePath } from '../../../base/common/resources.js'; +import { SkipList } from '../../../base/common/skipList.js'; +import { Event } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; class Entry { static _clock = 0; diff --git a/src/vs/platform/uriIdentity/test/common/uriIdentityService.test.ts b/src/vs/platform/uriIdentity/test/common/uriIdentityService.test.ts index 339e86bf938..bb0a791f378 100644 --- a/src/vs/platform/uriIdentity/test/common/uriIdentityService.test.ts +++ b/src/vs/platform/uriIdentity/test/common/uriIdentityService.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { mock } from 'vs/base/test/common/mock'; -import { IFileService, FileSystemProviderCapabilities } from 'vs/platform/files/common/files'; -import { URI } from 'vs/base/common/uri'; -import { Event } from 'vs/base/common/event'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { UriIdentityService } from '../../common/uriIdentityService.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { IFileService, FileSystemProviderCapabilities } from '../../../files/common/files.js'; +import { URI } from '../../../../base/common/uri.js'; +import { Event } from '../../../../base/common/event.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('URI Identity', function () { diff --git a/src/vs/platform/url/common/url.ts b/src/vs/platform/url/common/url.ts index b5079b04ce2..e5e95a109f7 100644 --- a/src/vs/platform/url/common/url.ts +++ b/src/vs/platform/url/common/url.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IURLService = createDecorator('urlService'); diff --git a/src/vs/platform/url/common/urlIpc.ts b/src/vs/platform/url/common/urlIpc.ts index aac9e632468..8121918852f 100644 --- a/src/vs/platform/url/common/urlIpc.ts +++ b/src/vs/platform/url/common/urlIpc.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { Client, IChannel, IClientRouter, IConnectionHub, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IOpenURLOptions, IURLHandler } from 'vs/platform/url/common/url'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { URI } from '../../../base/common/uri.js'; +import { Client, IChannel, IClientRouter, IConnectionHub, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { ILogService } from '../../log/common/log.js'; +import { IOpenURLOptions, IURLHandler } from './url.js'; export class URLHandlerChannel implements IServerChannel { diff --git a/src/vs/platform/url/common/urlService.ts b/src/vs/platform/url/common/urlService.ts index fcc833bf00b..12d980e2287 100644 --- a/src/vs/platform/url/common/urlService.ts +++ b/src/vs/platform/url/common/urlService.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { first } from 'vs/base/common/async'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IOpenURLOptions, IURLHandler, IURLService } from 'vs/platform/url/common/url'; +import { first } from '../../../base/common/async.js'; +import { Disposable, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IOpenURLOptions, IURLHandler, IURLService } from './url.js'; export abstract class AbstractURLService extends Disposable implements IURLService { diff --git a/src/vs/platform/url/electron-main/electronUrlListener.ts b/src/vs/platform/url/electron-main/electronUrlListener.ts index ffe2f5bb188..ece5401ddf7 100644 --- a/src/vs/platform/url/electron-main/electronUrlListener.ts +++ b/src/vs/platform/url/electron-main/electronUrlListener.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import { app, Event as ElectronEvent } from 'electron'; -import { disposableTimeout } from 'vs/base/common/async'; -import { Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { isWindows } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IURLService } from 'vs/platform/url/common/url'; -import { IProtocolUrl } from 'vs/platform/url/electron-main/url'; -import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; +import { disposableTimeout } from '../../../base/common/async.js'; +import { Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { isWindows } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IURLService } from '../common/url.js'; +import { IProtocolUrl } from './url.js'; +import { IWindowsMainService } from '../../windows/electron-main/windows.js'; /** * A listener for URLs that are opened from the OS and handled by VSCode. diff --git a/src/vs/platform/url/electron-main/url.ts b/src/vs/platform/url/electron-main/url.ts index 56ac7aa644b..e287787b6aa 100644 --- a/src/vs/platform/url/electron-main/url.ts +++ b/src/vs/platform/url/electron-main/url.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { IWindowOpenable } from 'vs/platform/window/common/window'; +import { URI } from '../../../base/common/uri.js'; +import { IWindowOpenable } from '../../window/common/window.js'; export interface IProtocolUrl { diff --git a/src/vs/platform/userData/common/fileUserDataProvider.ts b/src/vs/platform/userData/common/fileUserDataProvider.ts index 822cfe698eb..7c8fae49589 100644 --- a/src/vs/platform/userData/common/fileUserDataProvider.ts +++ b/src/vs/platform/userData/common/fileUserDataProvider.ts @@ -2,17 +2,17 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IFileSystemProviderWithFileReadWriteCapability, IFileChange, IWatchOptions, IStat, IFileOverwriteOptions, FileType, IFileWriteOptions, IFileDeleteOptions, FileSystemProviderCapabilities, IFileSystemProviderWithFileReadStreamCapability, IFileReadStreamOptions, IFileSystemProviderWithFileAtomicReadCapability, hasFileFolderCopyCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileOpenOptions, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileAtomicDeleteCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileCloneCapability, hasFileCloneCapability, IFileAtomicReadOptions, IFileAtomicOptions } from 'vs/platform/files/common/files'; -import { URI } from 'vs/base/common/uri'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { ReadableStreamEvents } from 'vs/base/common/stream'; -import { ILogService } from 'vs/platform/log/common/log'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { ResourceSet } from 'vs/base/common/map'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { IFileSystemProviderWithFileReadWriteCapability, IFileChange, IWatchOptions, IStat, IFileOverwriteOptions, FileType, IFileWriteOptions, IFileDeleteOptions, FileSystemProviderCapabilities, IFileSystemProviderWithFileReadStreamCapability, IFileReadStreamOptions, IFileSystemProviderWithFileAtomicReadCapability, hasFileFolderCopyCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileOpenOptions, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileAtomicDeleteCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileCloneCapability, hasFileCloneCapability, IFileAtomicReadOptions, IFileAtomicOptions } from '../../files/common/files.js'; +import { URI } from '../../../base/common/uri.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { ReadableStreamEvents } from '../../../base/common/stream.js'; +import { ILogService } from '../../log/common/log.js'; +import { TernarySearchTree } from '../../../base/common/ternarySearchTree.js'; +import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { ResourceSet } from '../../../base/common/map.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; /** * This is a wrapper on top of the local filesystem provider which will diff --git a/src/vs/platform/userData/test/browser/fileUserDataProvider.test.ts b/src/vs/platform/userData/test/browser/fileUserDataProvider.test.ts index 8f0c5641d9f..44877acd46e 100644 --- a/src/vs/platform/userData/test/browser/fileUserDataProvider.test.ts +++ b/src/vs/platform/userData/test/browser/fileUserDataProvider.test.ts @@ -4,25 +4,25 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { dirname, isEqual, joinPath } from 'vs/base/common/resources'; -import { ReadableStreamEvents } from 'vs/base/common/stream'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { AbstractNativeEnvironmentService } from 'vs/platform/environment/common/environmentService'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { FileChangeType, FileSystemProviderCapabilities, FileType, IFileChange, IFileOpenOptions, IFileReadStreamOptions, IFileService, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IStat } from 'vs/platform/files/common/files'; -import { InMemoryFileSystemProvider } from 'vs/platform/files/common/inMemoryFilesystemProvider'; -import { NullLogService } from 'vs/platform/log/common/log'; -import product from 'vs/platform/product/common/product'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { FileUserDataProvider } from 'vs/platform/userData/common/fileUserDataProvider'; -import { IUserDataProfilesService, UserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../../base/common/lifecycle.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { dirname, isEqual, joinPath } from '../../../../base/common/resources.js'; +import { ReadableStreamEvents } from '../../../../base/common/stream.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IEnvironmentService } from '../../../environment/common/environment.js'; +import { AbstractNativeEnvironmentService } from '../../../environment/common/environmentService.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { FileChangeType, FileSystemProviderCapabilities, FileType, IFileChange, IFileOpenOptions, IFileReadStreamOptions, IFileService, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IStat } from '../../../files/common/files.js'; +import { InMemoryFileSystemProvider } from '../../../files/common/inMemoryFilesystemProvider.js'; +import { NullLogService } from '../../../log/common/log.js'; +import product from '../../../product/common/product.js'; +import { UriIdentityService } from '../../../uriIdentity/common/uriIdentityService.js'; +import { FileUserDataProvider } from '../../common/fileUserDataProvider.js'; +import { IUserDataProfilesService, UserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; const ROOT = URI.file('tests').with({ scheme: 'vscode-tests' }); diff --git a/src/vs/platform/userDataProfile/browser/userDataProfile.ts b/src/vs/platform/userDataProfile/browser/userDataProfile.ts index 7af957185d2..f5da3f21f6f 100644 --- a/src/vs/platform/userDataProfile/browser/userDataProfile.ts +++ b/src/vs/platform/userDataProfile/browser/userDataProfile.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BroadcastDataChannel } from 'vs/base/browser/broadcast'; -import { revive } from 'vs/base/common/marshalling'; -import { UriDto } from 'vs/base/common/uri'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { DidChangeProfilesEvent, IUserDataProfile, IUserDataProfilesService, reviveProfile, StoredProfileAssociations, StoredUserDataProfile, UserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { BroadcastDataChannel } from '../../../base/browser/broadcast.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { UriDto } from '../../../base/common/uri.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { DidChangeProfilesEvent, IUserDataProfile, IUserDataProfilesService, reviveProfile, StoredProfileAssociations, StoredUserDataProfile, UserDataProfilesService } from '../common/userDataProfile.js'; type BroadcastedProfileChanges = UriDto>; diff --git a/src/vs/platform/userDataProfile/common/userDataProfile.ts b/src/vs/platform/userDataProfile/common/userDataProfile.ts index 9fee5a548f6..1fbce7f3db8 100644 --- a/src/vs/platform/userDataProfile/common/userDataProfile.ts +++ b/src/vs/platform/userDataProfile/common/userDataProfile.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { hash } from 'vs/base/common/hash'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { basename, joinPath } from 'vs/base/common/resources'; -import { URI, UriDto } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { FileOperationResult, IFileService, toFileOperationResult } from 'vs/platform/files/common/files'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IAnyWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { ResourceMap } from 'vs/base/common/map'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { Promises } from 'vs/base/common/async'; -import { generateUuid } from 'vs/base/common/uuid'; -import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import { isString } from 'vs/base/common/types'; +import { hash } from '../../../base/common/hash.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { basename, joinPath } from '../../../base/common/resources.js'; +import { URI, UriDto } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { FileOperationResult, IFileService, toFileOperationResult } from '../../files/common/files.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IAnyWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { Promises } from '../../../base/common/async.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { escapeRegExpCharacters } from '../../../base/common/strings.js'; +import { isString } from '../../../base/common/types.js'; export const enum ProfileResourceType { Settings = 'settings', diff --git a/src/vs/platform/userDataProfile/common/userDataProfileIpc.ts b/src/vs/platform/userDataProfile/common/userDataProfileIpc.ts index ceaa5ec8fc8..642aa857322 100644 --- a/src/vs/platform/userDataProfile/common/userDataProfileIpc.ts +++ b/src/vs/platform/userDataProfile/common/userDataProfileIpc.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { URI, UriDto } from 'vs/base/common/uri'; -import { DidChangeProfilesEvent, IUserDataProfile, IUserDataProfileOptions, IUserDataProfilesService, IUserDataProfileUpdateOptions, reviveProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { IURITransformer, transformIncomingURIs, transformOutgoingURIs } from 'vs/base/common/uriIpc'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { URI, UriDto } from '../../../base/common/uri.js'; +import { DidChangeProfilesEvent, IUserDataProfile, IUserDataProfileOptions, IUserDataProfilesService, IUserDataProfileUpdateOptions, reviveProfile } from './userDataProfile.js'; +import { IAnyWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { IURITransformer, transformIncomingURIs, transformOutgoingURIs } from '../../../base/common/uriIpc.js'; export class RemoteUserDataProfilesServiceChannel implements IServerChannel { diff --git a/src/vs/platform/userDataProfile/common/userDataProfileStorageService.ts b/src/vs/platform/userDataProfile/common/userDataProfileStorageService.ts index a9a7b3771c7..14af8ede3c0 100644 --- a/src/vs/platform/userDataProfile/common/userDataProfileStorageService.ts +++ b/src/vs/platform/userDataProfile/common/userDataProfileStorageService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, DisposableMap, MutableDisposable, isDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IStorage, IStorageDatabase, Storage } from 'vs/base/parts/storage/common/storage'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { AbstractStorageService, IStorageService, IStorageValueChangeEvent, StorageScope, StorageTarget, isProfileUsingDefaultStorage } from 'vs/platform/storage/common/storage'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IRemoteService } from 'vs/platform/ipc/common/services'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ApplicationStorageDatabaseClient, ProfileStorageDatabaseClient } from 'vs/platform/storage/common/storageIpc'; -import { IUserDataProfile, IUserDataProfilesService, reviveProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { Disposable, DisposableMap, MutableDisposable, isDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { IStorage, IStorageDatabase, Storage } from '../../../base/parts/storage/common/storage.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { AbstractStorageService, IStorageService, IStorageValueChangeEvent, StorageScope, StorageTarget, isProfileUsingDefaultStorage } from '../../storage/common/storage.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IRemoteService } from '../../ipc/common/services.js'; +import { ILogService } from '../../log/common/log.js'; +import { ApplicationStorageDatabaseClient, ProfileStorageDatabaseClient } from '../../storage/common/storageIpc.js'; +import { IUserDataProfile, IUserDataProfilesService, reviveProfile } from './userDataProfile.js'; export interface IProfileStorageValueChanges { readonly profile: IUserDataProfile; diff --git a/src/vs/platform/userDataProfile/electron-main/userDataProfile.ts b/src/vs/platform/userDataProfile/electron-main/userDataProfile.ts index 95348d22d24..84d81036dd1 100644 --- a/src/vs/platform/userDataProfile/electron-main/userDataProfile.ts +++ b/src/vs/platform/userDataProfile/electron-main/userDataProfile.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { refineServiceDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfilesService, WillCreateProfileEvent, WillRemoveProfileEvent, IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { UserDataProfilesService } from 'vs/platform/userDataProfile/node/userDataProfile'; -import { IAnyWorkspaceIdentifier, IEmptyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { IStateService } from 'vs/platform/state/node/state'; +import { Event } from '../../../base/common/event.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { refineServiceDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfilesService, WillCreateProfileEvent, WillRemoveProfileEvent, IUserDataProfile } from '../common/userDataProfile.js'; +import { UserDataProfilesService } from '../node/userDataProfile.js'; +import { IAnyWorkspaceIdentifier, IEmptyWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { IStateService } from '../../state/node/state.js'; export const IUserDataProfilesMainService = refineServiceDecorator(IUserDataProfilesService); export interface IUserDataProfilesMainService extends IUserDataProfilesService { diff --git a/src/vs/platform/userDataProfile/electron-main/userDataProfileStorageIpc.ts b/src/vs/platform/userDataProfile/electron-main/userDataProfileStorageIpc.ts index 457dac8e1d4..fb6c7e258fc 100644 --- a/src/vs/platform/userDataProfile/electron-main/userDataProfileStorageIpc.ts +++ b/src/vs/platform/userDataProfile/electron-main/userDataProfileStorageIpc.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProfileStorageChanges, IProfileStorageValueChanges } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; -import { loadKeyTargets, StorageScope, TARGET_KEY } from 'vs/platform/storage/common/storage'; -import { IBaseSerializableStorageRequest } from 'vs/platform/storage/common/storageIpc'; -import { IStorageMain } from 'vs/platform/storage/electron-main/storageMain'; -import { IStorageMainService } from 'vs/platform/storage/electron-main/storageMainService'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, IDisposable, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProfileStorageChanges, IProfileStorageValueChanges } from '../common/userDataProfileStorageService.js'; +import { loadKeyTargets, StorageScope, TARGET_KEY } from '../../storage/common/storage.js'; +import { IBaseSerializableStorageRequest } from '../../storage/common/storageIpc.js'; +import { IStorageMain } from '../../storage/electron-main/storageMain.js'; +import { IStorageMainService } from '../../storage/electron-main/storageMainService.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../common/userDataProfile.js'; export class ProfileStorageChangesListenerChannel extends Disposable implements IServerChannel { diff --git a/src/vs/platform/userDataProfile/electron-main/userDataProfilesHandler.ts b/src/vs/platform/userDataProfile/electron-main/userDataProfilesHandler.ts index ce4d4446438..4531f380e84 100644 --- a/src/vs/platform/userDataProfile/electron-main/userDataProfilesHandler.ts +++ b/src/vs/platform/userDataProfile/electron-main/userDataProfilesHandler.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { ILifecycleMainService, } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ICodeWindow, LoadReason } from 'vs/platform/window/electron-main/window'; -import { IUserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile'; -import { IAnyWorkspaceIdentifier, toWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { ILifecycleMainService, } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ICodeWindow, LoadReason } from '../../window/electron-main/window.js'; +import { IUserDataProfilesMainService } from './userDataProfile.js'; +import { IAnyWorkspaceIdentifier, toWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { IWindowsMainService } from '../../windows/electron-main/windows.js'; export class UserDataProfilesHandler extends Disposable { diff --git a/src/vs/platform/userDataProfile/electron-sandbox/userDataProfileStorageService.ts b/src/vs/platform/userDataProfile/electron-sandbox/userDataProfileStorageService.ts index 313bedc9bff..4eb4318c71e 100644 --- a/src/vs/platform/userDataProfile/electron-sandbox/userDataProfileStorageService.ts +++ b/src/vs/platform/userDataProfile/electron-sandbox/userDataProfileStorageService.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IUserDataProfileStorageService, RemoteUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; +import { IUserDataProfileStorageService, RemoteUserDataProfileStorageService } from '../common/userDataProfileStorageService.js'; +import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ILogService } from '../../log/common/log.js'; +import { IUserDataProfilesService } from '../common/userDataProfile.js'; +import { IMainProcessService } from '../../ipc/common/mainProcessService.js'; export class NativeUserDataProfileStorageService extends RemoteUserDataProfileStorageService { diff --git a/src/vs/platform/userDataProfile/node/userDataProfile.ts b/src/vs/platform/userDataProfile/node/userDataProfile.ts index b5fc85922e9..24165365965 100644 --- a/src/vs/platform/userDataProfile/node/userDataProfile.ts +++ b/src/vs/platform/userDataProfile/node/userDataProfile.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI, UriComponents, UriDto } from 'vs/base/common/uri'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStateReadService, IStateService } from 'vs/platform/state/node/state'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfilesService, UserDataProfilesService as BaseUserDataProfilesService, StoredUserDataProfile, StoredProfileAssociations } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { isString } from 'vs/base/common/types'; -import { SaveStrategy, StateService } from 'vs/platform/state/node/stateService'; +import { URI, UriComponents, UriDto } from '../../../base/common/uri.js'; +import { INativeEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { IStateReadService, IStateService } from '../../state/node/state.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfilesService, UserDataProfilesService as BaseUserDataProfilesService, StoredUserDataProfile, StoredProfileAssociations } from '../common/userDataProfile.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { isString } from '../../../base/common/types.js'; +import { SaveStrategy, StateService } from '../../state/node/stateService.js'; type StoredUserDataProfileState = StoredUserDataProfile & { location: URI | string }; @@ -93,7 +93,7 @@ export class UserDataProfilesService extends UserDataProfilesReadonlyService imp result[URI.revive(workspace).toString()] = URI.revive(profile).toString(); return result; }, {}); - this.stateService.setItem(UserDataProfilesService.PROFILE_ASSOCIATIONS_KEY, { workspaces }); + this.stateService.setItem(UserDataProfilesService.PROFILE_ASSOCIATIONS_KEY, { workspaces } satisfies StoredProfileAssociations); } const associations = super.getStoredProfileAssociations(); if (!this.stateService.getItem(UserDataProfilesService.PROFILE_ASSOCIATIONS_MIGRATION_KEY, false)) { diff --git a/src/vs/platform/userDataProfile/node/userDataProfileStorageService.ts b/src/vs/platform/userDataProfile/node/userDataProfileStorageService.ts index 703011c9d60..233360af85e 100644 --- a/src/vs/platform/userDataProfile/node/userDataProfileStorageService.ts +++ b/src/vs/platform/userDataProfile/node/userDataProfileStorageService.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; -import { RemoteUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ILogService } from '../../log/common/log.js'; +import { IUserDataProfilesService } from '../common/userDataProfile.js'; +import { IMainProcessService } from '../../ipc/common/mainProcessService.js'; +import { RemoteUserDataProfileStorageService } from '../common/userDataProfileStorageService.js'; export class SharedProcessUserDataProfileStorageService extends RemoteUserDataProfileStorageService { diff --git a/src/vs/platform/userDataProfile/test/common/userDataProfileService.test.ts b/src/vs/platform/userDataProfile/test/common/userDataProfileService.test.ts index 0f017f50891..8ee80c9860c 100644 --- a/src/vs/platform/userDataProfile/test/common/userDataProfileService.test.ts +++ b/src/vs/platform/userDataProfile/test/common/userDataProfileService.test.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { joinPath } from 'vs/base/common/resources'; -import { InMemoryFileSystemProvider } from 'vs/platform/files/common/inMemoryFilesystemProvider'; -import { AbstractNativeEnvironmentService } from 'vs/platform/environment/common/environmentService'; -import product from 'vs/platform/product/common/product'; -import { InMemoryUserDataProfilesService, UserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { FileService } from '../../../files/common/fileService.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { URI } from '../../../../base/common/uri.js'; +import { joinPath } from '../../../../base/common/resources.js'; +import { InMemoryFileSystemProvider } from '../../../files/common/inMemoryFilesystemProvider.js'; +import { AbstractNativeEnvironmentService } from '../../../environment/common/environmentService.js'; +import product from '../../../product/common/product.js'; +import { InMemoryUserDataProfilesService, UserDataProfilesService } from '../../common/userDataProfile.js'; +import { UriIdentityService } from '../../../uriIdentity/common/uriIdentityService.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; const ROOT = URI.file('tests').with({ scheme: 'vscode-tests' }); diff --git a/src/vs/platform/userDataProfile/test/common/userDataProfileStorageService.test.ts b/src/vs/platform/userDataProfile/test/common/userDataProfileStorageService.test.ts index 36cfb4efce5..3e17c72ba91 100644 --- a/src/vs/platform/userDataProfile/test/common/userDataProfileStorageService.test.ts +++ b/src/vs/platform/userDataProfile/test/common/userDataProfileStorageService.test.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Emitter, Event } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { InMemoryStorageDatabase, IStorageItemsChangeEvent, IUpdateRequest, Storage } from 'vs/base/parts/storage/common/storage'; -import { AbstractUserDataProfileStorageService, IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; -import { InMemoryStorageService, loadKeyTargets, StorageTarget, TARGET_KEY } from 'vs/platform/storage/common/storage'; -import { IUserDataProfile, toUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { URI } from '../../../../base/common/uri.js'; +import { InMemoryStorageDatabase, IStorageItemsChangeEvent, IUpdateRequest, Storage } from '../../../../base/parts/storage/common/storage.js'; +import { AbstractUserDataProfileStorageService, IUserDataProfileStorageService } from '../../common/userDataProfileStorageService.js'; +import { InMemoryStorageService, loadKeyTargets, StorageTarget, TARGET_KEY } from '../../../storage/common/storage.js'; +import { IUserDataProfile, toUserDataProfile } from '../../common/userDataProfile.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; class TestStorageDatabase extends InMemoryStorageDatabase { diff --git a/src/vs/platform/userDataProfile/test/electron-main/userDataProfileMainService.test.ts b/src/vs/platform/userDataProfile/test/electron-main/userDataProfileMainService.test.ts index 8797fafc6c4..ce4bf693483 100644 --- a/src/vs/platform/userDataProfile/test/electron-main/userDataProfileMainService.test.ts +++ b/src/vs/platform/userDataProfile/test/electron-main/userDataProfileMainService.test.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { joinPath } from 'vs/base/common/resources'; -import { InMemoryFileSystemProvider } from 'vs/platform/files/common/inMemoryFilesystemProvider'; -import { AbstractNativeEnvironmentService } from 'vs/platform/environment/common/environmentService'; -import product from 'vs/platform/product/common/product'; -import { UserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile'; -import { SaveStrategy, StateService } from 'vs/platform/state/node/stateService'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { FileService } from '../../../files/common/fileService.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { URI } from '../../../../base/common/uri.js'; +import { joinPath } from '../../../../base/common/resources.js'; +import { InMemoryFileSystemProvider } from '../../../files/common/inMemoryFilesystemProvider.js'; +import { AbstractNativeEnvironmentService } from '../../../environment/common/environmentService.js'; +import product from '../../../product/common/product.js'; +import { UserDataProfilesMainService } from '../../electron-main/userDataProfile.js'; +import { SaveStrategy, StateService } from '../../../state/node/stateService.js'; +import { UriIdentityService } from '../../../uriIdentity/common/uriIdentityService.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; const ROOT = URI.file('tests').with({ scheme: 'vscode-tests' }); diff --git a/src/vs/platform/userDataSync/common/abstractSynchronizer.ts b/src/vs/platform/userDataSync/common/abstractSynchronizer.ts index 9f52f0fd29e..5f40daba148 100644 --- a/src/vs/platform/userDataSync/common/abstractSynchronizer.ts +++ b/src/vs/platform/userDataSync/common/abstractSynchronizer.ts @@ -3,31 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { equals } from 'vs/base/common/arrays'; -import { CancelablePromise, createCancelablePromise, ThrottledDelayer } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Emitter, Event } from 'vs/base/common/event'; -import { parse, ParseError } from 'vs/base/common/json'; -import { FormattingOptions } from 'vs/base/common/jsonFormatter'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IExtUri } from 'vs/base/common/resources'; -import { uppercaseFirstLetter } from 'vs/base/common/strings'; -import { isUndefined } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { IHeaders } from 'vs/base/parts/request/common/request'; -import { localize } from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { FileChangesEvent, FileOperationError, FileOperationResult, IFileContent, IFileService, toFileOperationResult } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { getServiceMachineId } from 'vs/platform/externalServices/common/serviceMachineId'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { Change, getLastSyncResourceUri, IRemoteUserData, IResourcePreview as IBaseResourcePreview, ISyncData, IUserDataSyncResourcePreview as IBaseSyncResourcePreview, IUserData, IUserDataSyncResourceInitializer, IUserDataSyncLocalStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, IUserDataSyncUtilService, MergeState, PREVIEW_DIR_NAME, SyncResource, SyncStatus, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_CONFIGURATION_SCOPE, USER_DATA_SYNC_SCHEME, IUserDataResourceManifest, getPathSegments, IUserDataSyncResourceConflicts, IUserDataSyncResource } from 'vs/platform/userDataSync/common/userDataSync'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { equals } from '../../../base/common/arrays.js'; +import { CancelablePromise, createCancelablePromise, ThrottledDelayer } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { parse, ParseError } from '../../../base/common/json.js'; +import { FormattingOptions } from '../../../base/common/jsonFormatter.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IExtUri } from '../../../base/common/resources.js'; +import { uppercaseFirstLetter } from '../../../base/common/strings.js'; +import { isUndefined } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { IHeaders } from '../../../base/parts/request/common/request.js'; +import { localize } from '../../../nls.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { FileChangesEvent, FileOperationError, FileOperationResult, IFileContent, IFileService, toFileOperationResult } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { getServiceMachineId } from '../../externalServices/common/serviceMachineId.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { Change, getLastSyncResourceUri, IRemoteUserData, IResourcePreview as IBaseResourcePreview, ISyncData, IUserDataSyncResourcePreview as IBaseSyncResourcePreview, IUserData, IUserDataSyncResourceInitializer, IUserDataSyncLocalStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, IUserDataSyncUtilService, MergeState, PREVIEW_DIR_NAME, SyncResource, SyncStatus, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_CONFIGURATION_SCOPE, USER_DATA_SYNC_SCHEME, IUserDataResourceManifest, getPathSegments, IUserDataSyncResourceConflicts, IUserDataSyncResource } from './userDataSync.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; type IncompatibleSyncSourceClassification = { owner: 'sandy081'; @@ -592,7 +592,7 @@ export abstract class AbstractSynchroniser extends Disposable implements IUserDa return { syncResource: this.resource, profile: this.syncResource.profile, remoteUserData, lastSyncUserData, resourcePreviews, isLastSyncFromCurrentMachine: isRemoteDataFromCurrentMachine }; } - async getLastSyncUserData(): Promise { + async getLastSyncUserData(): Promise { let storedLastSyncUserDataStateContent = this.getStoredLastSyncUserDataStateContent(); if (!storedLastSyncUserDataStateContent) { storedLastSyncUserDataStateContent = await this.migrateLastSyncUserData(); @@ -664,7 +664,7 @@ export abstract class AbstractSynchroniser extends Disposable implements IUserDa return { ...lastSyncUserDataState, syncData, - } as T; + }; } protected async updateLastSyncUserData(lastSyncRemoteUserData: IRemoteUserData, additionalProps: IStringDictionary = {}): Promise { diff --git a/src/vs/platform/userDataSync/common/content.ts b/src/vs/platform/userDataSync/common/content.ts index 5dd3d97a427..77a6f04dffa 100644 --- a/src/vs/platform/userDataSync/common/content.ts +++ b/src/vs/platform/userDataSync/common/content.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { JSONPath } from 'vs/base/common/json'; -import { setProperty } from 'vs/base/common/jsonEdit'; -import { FormattingOptions } from 'vs/base/common/jsonFormatter'; +import { JSONPath } from '../../../base/common/json.js'; +import { setProperty } from '../../../base/common/jsonEdit.js'; +import { FormattingOptions } from '../../../base/common/jsonFormatter.js'; export function edit(content: string, originalPath: JSONPath, value: any, formattingOptions: FormattingOptions): string { diff --git a/src/vs/platform/userDataSync/common/extensionsMerge.ts b/src/vs/platform/userDataSync/common/extensionsMerge.ts index 98204d9b488..f3eeaba274c 100644 --- a/src/vs/platform/userDataSync/common/extensionsMerge.ts +++ b/src/vs/platform/userDataSync/common/extensionsMerge.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IStringDictionary } from 'vs/base/common/collections'; -import { deepClone, equals } from 'vs/base/common/objects'; -import * as semver from 'vs/base/common/semver/semver'; -import { assertIsDefined } from 'vs/base/common/types'; -import { IExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { ILocalSyncExtension, IRemoteSyncExtension, ISyncExtension } from 'vs/platform/userDataSync/common/userDataSync'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { deepClone, equals } from '../../../base/common/objects.js'; +import * as semver from '../../../base/common/semver/semver.js'; +import { assertIsDefined } from '../../../base/common/types.js'; +import { IExtensionIdentifier } from '../../extensions/common/extensions.js'; +import { ILocalSyncExtension, IRemoteSyncExtension, ISyncExtension } from './userDataSync.js'; export interface IMergeResult { readonly local: { added: ISyncExtension[]; removed: IExtensionIdentifier[]; updated: ISyncExtension[] }; diff --git a/src/vs/platform/userDataSync/common/extensionsSync.ts b/src/vs/platform/userDataSync/common/extensionsSync.ts index 7af2df9134a..c917d7ac871 100644 --- a/src/vs/platform/userDataSync/common/extensionsSync.ts +++ b/src/vs/platform/userDataSync/common/extensionsSync.ts @@ -3,35 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Promises } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { getErrorMessage } from 'vs/base/common/errors'; -import { Event } from 'vs/base/common/event'; -import { toFormattedString } from 'vs/base/common/jsonFormatter'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { compare } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { GlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService'; -import { IExtensionGalleryService, IExtensionManagementService, IGlobalExtensionEnablementService, ILocalExtension, ExtensionManagementError, ExtensionManagementErrorCode, IGalleryExtension, DISABLED_EXTENSIONS_STORAGE_PATH, EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT, EXTENSION_INSTALL_SOURCE_CONTEXT, InstallExtensionInfo, ExtensionInstallSource } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { ExtensionStorageService, IExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage'; -import { ExtensionType, IExtensionIdentifier, isApplicationScopedExtension } from 'vs/platform/extensions/common/extensions'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractInitializer, AbstractSynchroniser, getSyncResourceLogLabel, IAcceptResult, IMergeResult, IResourcePreview } from 'vs/platform/userDataSync/common/abstractSynchronizer'; -import { IMergeResult as IExtensionMergeResult, merge } from 'vs/platform/userDataSync/common/extensionsMerge'; -import { IIgnoredExtensionsManagementService } from 'vs/platform/userDataSync/common/ignoredExtensions'; -import { Change, IRemoteUserData, ISyncData, ISyncExtension, IUserDataSyncLocalStoreService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, USER_DATA_SYNC_SCHEME, ILocalSyncExtension } from 'vs/platform/userDataSync/common/userDataSync'; -import { IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; +import { Promises } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { getErrorMessage } from '../../../base/common/errors.js'; +import { Event } from '../../../base/common/event.js'; +import { toFormattedString } from '../../../base/common/jsonFormatter.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { compare } from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { GlobalExtensionEnablementService } from '../../extensionManagement/common/extensionEnablementService.js'; +import { IExtensionGalleryService, IExtensionManagementService, IGlobalExtensionEnablementService, ILocalExtension, ExtensionManagementError, ExtensionManagementErrorCode, IGalleryExtension, DISABLED_EXTENSIONS_STORAGE_PATH, EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT, EXTENSION_INSTALL_SOURCE_CONTEXT, InstallExtensionInfo, ExtensionInstallSource } from '../../extensionManagement/common/extensionManagement.js'; +import { areSameExtensions } from '../../extensionManagement/common/extensionManagementUtil.js'; +import { ExtensionStorageService, IExtensionStorageService } from '../../extensionManagement/common/extensionStorage.js'; +import { ExtensionType, IExtensionIdentifier, isApplicationScopedExtension } from '../../extensions/common/extensions.js'; +import { IFileService } from '../../files/common/files.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { ServiceCollection } from '../../instantiation/common/serviceCollection.js'; +import { ILogService } from '../../log/common/log.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { AbstractInitializer, AbstractSynchroniser, getSyncResourceLogLabel, IAcceptResult, IMergeResult, IResourcePreview } from './abstractSynchronizer.js'; +import { IMergeResult as IExtensionMergeResult, merge } from './extensionsMerge.js'; +import { IIgnoredExtensionsManagementService } from './ignoredExtensions.js'; +import { Change, IRemoteUserData, ISyncData, ISyncExtension, IUserDataSyncLocalStoreService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, USER_DATA_SYNC_SCHEME, ILocalSyncExtension } from './userDataSync.js'; +import { IUserDataProfileStorageService } from '../../userDataProfile/common/userDataProfileStorageService.js'; type IExtensionResourceMergeResult = IAcceptResult & IExtensionMergeResult; diff --git a/src/vs/platform/userDataSync/common/globalStateMerge.ts b/src/vs/platform/userDataSync/common/globalStateMerge.ts index 527ec93660f..4e53698147d 100644 --- a/src/vs/platform/userDataSync/common/globalStateMerge.ts +++ b/src/vs/platform/userDataSync/common/globalStateMerge.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IStringDictionary } from 'vs/base/common/collections'; -import * as objects from 'vs/base/common/objects'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStorageValue, SYNC_SERVICE_URL_TYPE } from 'vs/platform/userDataSync/common/userDataSync'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import * as objects from '../../../base/common/objects.js'; +import { ILogService } from '../../log/common/log.js'; +import { IStorageValue, SYNC_SERVICE_URL_TYPE } from './userDataSync.js'; export interface IMergeResult { local: { added: IStringDictionary; removed: string[]; updated: IStringDictionary }; diff --git a/src/vs/platform/userDataSync/common/globalStateSync.ts b/src/vs/platform/userDataSync/common/globalStateSync.ts index 4c698553970..75ea2446438 100644 --- a/src/vs/platform/userDataSync/common/globalStateSync.ts +++ b/src/vs/platform/userDataSync/common/globalStateSync.ts @@ -3,33 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { getErrorMessage } from 'vs/base/common/errors'; -import { Event } from 'vs/base/common/event'; -import { parse } from 'vs/base/common/json'; -import { toFormattedString } from 'vs/base/common/jsonFormatter'; -import { isWeb } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IHeaders } from 'vs/base/parts/request/common/request'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { getServiceMachineId } from 'vs/platform/externalServices/common/serviceMachineId'; -import { IStorageEntry, IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { AbstractInitializer, AbstractSynchroniser, getSyncResourceLogLabel, IAcceptResult, IMergeResult, IResourcePreview, isSyncData } from 'vs/platform/userDataSync/common/abstractSynchronizer'; -import { edit } from 'vs/platform/userDataSync/common/content'; -import { merge } from 'vs/platform/userDataSync/common/globalStateMerge'; -import { ALL_SYNC_RESOURCES, Change, createSyncHeaders, getEnablementKey, IGlobalState, IRemoteUserData, IStorageValue, ISyncData, IUserData, IUserDataSyncLocalStoreService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, SYNC_SERVICE_URL_TYPE, UserDataSyncError, UserDataSyncErrorCode, UserDataSyncStoreType, USER_DATA_SYNC_SCHEME } from 'vs/platform/userDataSync/common/userDataSync'; -import { UserDataSyncStoreClient } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { getErrorMessage } from '../../../base/common/errors.js'; +import { Event } from '../../../base/common/event.js'; +import { parse } from '../../../base/common/json.js'; +import { toFormattedString } from '../../../base/common/jsonFormatter.js'; +import { isWeb } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IHeaders } from '../../../base/parts/request/common/request.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { getServiceMachineId } from '../../externalServices/common/serviceMachineId.js'; +import { IStorageEntry, IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { AbstractInitializer, AbstractSynchroniser, getSyncResourceLogLabel, IAcceptResult, IMergeResult, IResourcePreview, isSyncData } from './abstractSynchronizer.js'; +import { edit } from './content.js'; +import { merge } from './globalStateMerge.js'; +import { ALL_SYNC_RESOURCES, Change, createSyncHeaders, getEnablementKey, IGlobalState, IRemoteUserData, IStorageValue, ISyncData, IUserData, IUserDataSyncLocalStoreService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, SYNC_SERVICE_URL_TYPE, UserDataSyncError, UserDataSyncErrorCode, UserDataSyncStoreType, USER_DATA_SYNC_SCHEME } from './userDataSync.js'; +import { UserDataSyncStoreClient } from './userDataSyncStoreService.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { IUserDataProfileStorageService } from '../../userDataProfile/common/userDataProfileStorageService.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; const argvStoragePrefx = 'globalState.argv.'; const argvProperties: string[] = ['locale']; @@ -244,7 +244,7 @@ export class GlobalStateSynchroniser extends AbstractSynchroniser implements IUs if (remoteChange !== Change.None) { // update remote this.logService.trace(`${this.syncResourceLogLabel}: Updating remote ui state...`); - const content = JSON.stringify({ storage: remote.all }); + const content = JSON.stringify({ storage: remote.all }); remoteUserData = await this.updateRemoteUserData(content, force ? null : remoteUserData.ref); this.logService.info(`${this.syncResourceLogLabel}: Updated remote ui state.${remote.added.length ? ` Added: ${remote.added}.` : ''}${remote.updated.length ? ` Updated: ${remote.updated}.` : ''}${remote.removed.length ? ` Removed: ${remote.removed}.` : ''}`); } diff --git a/src/vs/platform/userDataSync/common/ignoredExtensions.ts b/src/vs/platform/userDataSync/common/ignoredExtensions.ts index d0e9c6c9871..309cb745382 100644 --- a/src/vs/platform/userDataSync/common/ignoredExtensions.ts +++ b/src/vs/platform/userDataSync/common/ignoredExtensions.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { distinct } from 'vs/base/common/arrays'; -import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { distinct } from '../../../base/common/arrays.js'; +import { ConfigurationTarget, IConfigurationService } from '../../configuration/common/configuration.js'; +import { ILocalExtension } from '../../extensionManagement/common/extensionManagement.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IIgnoredExtensionsManagementService = createDecorator('IIgnoredExtensionsManagementService'); export interface IIgnoredExtensionsManagementService { diff --git a/src/vs/platform/userDataSync/common/keybindingsMerge.ts b/src/vs/platform/userDataSync/common/keybindingsMerge.ts index fc1b93f5551..054e4e74787 100644 --- a/src/vs/platform/userDataSync/common/keybindingsMerge.ts +++ b/src/vs/platform/userDataSync/common/keybindingsMerge.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { equals } from 'vs/base/common/arrays'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { parse } from 'vs/base/common/json'; -import { FormattingOptions } from 'vs/base/common/jsonFormatter'; -import * as objects from 'vs/base/common/objects'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding'; -import * as contentUtil from 'vs/platform/userDataSync/common/content'; -import { IUserDataSyncUtilService } from 'vs/platform/userDataSync/common/userDataSync'; +import { equals } from '../../../base/common/arrays.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { parse } from '../../../base/common/json.js'; +import { FormattingOptions } from '../../../base/common/jsonFormatter.js'; +import * as objects from '../../../base/common/objects.js'; +import { ContextKeyExpr } from '../../contextkey/common/contextkey.js'; +import { IUserFriendlyKeybinding } from '../../keybinding/common/keybinding.js'; +import * as contentUtil from './content.js'; +import { IUserDataSyncUtilService } from './userDataSync.js'; interface ICompareResult { added: Set; diff --git a/src/vs/platform/userDataSync/common/keybindingsSync.ts b/src/vs/platform/userDataSync/common/keybindingsSync.ts index 715707a19cc..08eedc3ba2b 100644 --- a/src/vs/platform/userDataSync/common/keybindingsSync.ts +++ b/src/vs/platform/userDataSync/common/keybindingsSync.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { parse } from 'vs/base/common/json'; -import { OperatingSystem, OS } from 'vs/base/common/platform'; -import { isUndefined } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractInitializer, AbstractJsonFileSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; -import { merge } from 'vs/platform/userDataSync/common/keybindingsMerge'; -import { Change, IRemoteUserData, IUserDataSyncLocalStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, IUserDataSyncUtilService, SyncResource, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_SCHEME, CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM } from 'vs/platform/userDataSync/common/userDataSync'; +import { isNonEmptyArray } from '../../../base/common/arrays.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { parse } from '../../../base/common/json.js'; +import { OperatingSystem, OS } from '../../../base/common/platform.js'; +import { isUndefined } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { FileOperationError, FileOperationResult, IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { AbstractInitializer, AbstractJsonFileSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from './abstractSynchronizer.js'; +import { merge } from './keybindingsMerge.js'; +import { Change, IRemoteUserData, IUserDataSyncLocalStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, IUserDataSyncUtilService, SyncResource, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_SCHEME, CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM } from './userDataSync.js'; interface ISyncContent { mac?: string; diff --git a/src/vs/platform/userDataSync/common/modelSelectionMerge.ts b/src/vs/platform/userDataSync/common/modelSelectionMerge.ts index baf44ddd865..9e7095cc18c 100644 --- a/src/vs/platform/userDataSync/common/modelSelectionMerge.ts +++ b/src/vs/platform/userDataSync/common/modelSelectionMerge.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { FormattingOptions } from 'vs/base/common/jsonFormatter'; -import { IUserDataSyncUtilService } from 'vs/platform/userDataSync/common/userDataSync'; +import { FormattingOptions } from '../../../base/common/jsonFormatter.js'; +import { IUserDataSyncUtilService } from './userDataSync.js'; export async function merge(localContent: string, remoteContent: string, baseContent: string | null, formattingOptions: FormattingOptions, userDataSyncUtilService: IUserDataSyncUtilService): Promise<{ mergeContent: string; hasChanges: boolean; hasConflicts: boolean }> { return { mergeContent: localContent, hasChanges: false, hasConflicts: false }; diff --git a/src/vs/platform/userDataSync/common/modelSelectionSync.ts b/src/vs/platform/userDataSync/common/modelSelectionSync.ts index bd5032fcf4f..e7a4bba72bd 100644 --- a/src/vs/platform/userDataSync/common/modelSelectionSync.ts +++ b/src/vs/platform/userDataSync/common/modelSelectionSync.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { parse } from 'vs/base/common/json'; -import { isUndefined } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractInitializer, AbstractJsonFileSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; -import { merge } from 'vs/platform/userDataSync/common/modelSelectionMerge'; -import { Change, IRemoteUserData, IUserDataSyncConfiguration, IUserDataSyncEnablementService, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncStoreService, IUserDataSyncUtilService, IUserDataSynchroniser, SyncResource, USER_DATA_SYNC_SCHEME, UserDataSyncError, UserDataSyncErrorCode } from 'vs/platform/userDataSync/common/userDataSync'; +import { isNonEmptyArray } from '../../../base/common/arrays.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { parse } from '../../../base/common/json.js'; +import { isUndefined } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { FileOperationError, FileOperationResult, IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { AbstractInitializer, AbstractJsonFileSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from './abstractSynchronizer.js'; +import { merge } from './modelSelectionMerge.js'; +import { Change, IRemoteUserData, IUserDataSyncConfiguration, IUserDataSyncEnablementService, IUserDataSynchroniser, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncStoreService, IUserDataSyncUtilService, SyncResource, USER_DATA_SYNC_SCHEME, UserDataSyncError, UserDataSyncErrorCode } from './userDataSync.js'; interface ISyncContent { modelSelection?: string; diff --git a/src/vs/platform/userDataSync/common/settingsMerge.ts b/src/vs/platform/userDataSync/common/settingsMerge.ts index fdda70dfc8c..a05ae53ff86 100644 --- a/src/vs/platform/userDataSync/common/settingsMerge.ts +++ b/src/vs/platform/userDataSync/common/settingsMerge.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { distinct } from 'vs/base/common/arrays'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { JSONVisitor, parse, visit } from 'vs/base/common/json'; -import { applyEdits, setProperty, withFormatting } from 'vs/base/common/jsonEdit'; -import { Edit, FormattingOptions, getEOL } from 'vs/base/common/jsonFormatter'; -import * as objects from 'vs/base/common/objects'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import * as contentUtil from 'vs/platform/userDataSync/common/content'; -import { getDisallowedIgnoredSettings, IConflictSetting } from 'vs/platform/userDataSync/common/userDataSync'; +import { distinct } from '../../../base/common/arrays.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { JSONVisitor, parse, visit } from '../../../base/common/json.js'; +import { applyEdits, setProperty, withFormatting } from '../../../base/common/jsonEdit.js'; +import { Edit, FormattingOptions, getEOL } from '../../../base/common/jsonFormatter.js'; +import * as objects from '../../../base/common/objects.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import * as contentUtil from './content.js'; +import { getDisallowedIgnoredSettings, IConflictSetting } from './userDataSync.js'; export interface IMergeResult { localContent: string | null; diff --git a/src/vs/platform/userDataSync/common/settingsSync.ts b/src/vs/platform/userDataSync/common/settingsSync.ts index b1c7523e8ef..9819dd97d4b 100644 --- a/src/vs/platform/userDataSync/common/settingsSync.ts +++ b/src/vs/platform/userDataSync/common/settingsSync.ts @@ -3,23 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ConfigurationModelParser } from 'vs/platform/configuration/common/configurationModels'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractInitializer, AbstractJsonFileSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; -import { getIgnoredSettings, isEmpty, merge, updateIgnoredSettings } from 'vs/platform/userDataSync/common/settingsMerge'; -import { Change, IRemoteUserData, IUserDataSyncLocalStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, IUserDataSyncUtilService, SyncResource, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_CONFIGURATION_SCOPE, USER_DATA_SYNC_SCHEME, IUserDataResourceManifest } from 'vs/platform/userDataSync/common/userDataSync'; +import { distinct } from '../../../base/common/arrays.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { ConfigurationTarget, IConfigurationService } from '../../configuration/common/configuration.js'; +import { ConfigurationModelParser } from '../../configuration/common/configurationModels.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IExtensionManagementService } from '../../extensionManagement/common/extensionManagement.js'; +import { ExtensionType } from '../../extensions/common/extensions.js'; +import { FileOperationError, FileOperationResult, IFileService } from '../../files/common/files.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { AbstractInitializer, AbstractJsonFileSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from './abstractSynchronizer.js'; +import { getIgnoredSettings, isEmpty, merge, updateIgnoredSettings } from './settingsMerge.js'; +import { Change, IRemoteUserData, IUserDataSyncLocalStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, IUserDataSyncUtilService, SyncResource, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_CONFIGURATION_SCOPE, USER_DATA_SYNC_SCHEME, IUserDataResourceManifest, getIgnoredSettingsForExtension } from './userDataSync.js'; interface ISettingsResourcePreview extends IFileResourcePreview { previewResult: IMergeResult; @@ -51,7 +53,7 @@ export class SettingsSynchroniser extends AbstractJsonFileSynchroniser implement readonly acceptedResource: URI = this.previewResource.with({ scheme: USER_DATA_SYNC_SCHEME, authority: 'accepted' }); constructor( - profile: IUserDataProfile, + private readonly profile: IUserDataProfile, collection: string | undefined, @IFileService fileService: IFileService, @IEnvironmentService environmentService: IEnvironmentService, @@ -315,21 +317,39 @@ export class SettingsSynchroniser extends AbstractJsonFileSynchroniser implement return { settings }; } - private _defaultIgnoredSettings: Promise | undefined = undefined; + private coreIgnoredSettings: Promise | undefined = undefined; + private systemExtensionsIgnoredSettings: Promise | undefined = undefined; + private userExtensionsIgnoredSettings: Promise | undefined = undefined; private async getIgnoredSettings(content?: string): Promise { - if (!this._defaultIgnoredSettings) { - this._defaultIgnoredSettings = this.userDataSyncUtilService.resolveDefaultIgnoredSettings(); + if (!this.coreIgnoredSettings) { + this.coreIgnoredSettings = this.userDataSyncUtilService.resolveDefaultCoreIgnoredSettings(); + } + if (!this.systemExtensionsIgnoredSettings) { + this.systemExtensionsIgnoredSettings = this.getIgnoredSettingForSystemExtensions(); + } + if (!this.userExtensionsIgnoredSettings) { + this.userExtensionsIgnoredSettings = this.getIgnoredSettingForUserExtensions(); const disposable = this._register(Event.any( Event.filter(this.extensionManagementService.onDidInstallExtensions, (e => e.some(({ local }) => !!local))), Event.filter(this.extensionManagementService.onDidUninstallExtension, (e => !e.error)))(() => { disposable.dispose(); - this._defaultIgnoredSettings = undefined; + this.userExtensionsIgnoredSettings = undefined; })); } - const defaultIgnoredSettings = await this._defaultIgnoredSettings; + const defaultIgnoredSettings = (await Promise.all([this.coreIgnoredSettings, this.systemExtensionsIgnoredSettings, this.userExtensionsIgnoredSettings])).flat(); return getIgnoredSettings(defaultIgnoredSettings, this.configurationService, content); } + private async getIgnoredSettingForSystemExtensions(): Promise { + const systemExtensions = await this.extensionManagementService.getInstalled(ExtensionType.System); + return distinct(systemExtensions.map(e => getIgnoredSettingsForExtension(e.manifest)).flat()); + } + + private async getIgnoredSettingForUserExtensions(): Promise { + const userExtensions = await this.extensionManagementService.getInstalled(ExtensionType.User, this.profile.extensionsResource); + return distinct(userExtensions.map(e => getIgnoredSettingsForExtension(e.manifest)).flat()); + } + private validateContent(content: string): void { if (this.hasErrors(content, false)) { throw new UserDataSyncError(localize('errorInvalidSettings', "Unable to sync settings as there are errors/warning in settings file."), UserDataSyncErrorCode.LocalInvalidContent, this.resource); diff --git a/src/vs/platform/userDataSync/common/snippetsMerge.ts b/src/vs/platform/userDataSync/common/snippetsMerge.ts index 4dd6a879757..92666590450 100644 --- a/src/vs/platform/userDataSync/common/snippetsMerge.ts +++ b/src/vs/platform/userDataSync/common/snippetsMerge.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IStringDictionary } from 'vs/base/common/collections'; +import { IStringDictionary } from '../../../base/common/collections.js'; export interface IMergeResult { local: { diff --git a/src/vs/platform/userDataSync/common/snippetsSync.ts b/src/vs/platform/userDataSync/common/snippetsSync.ts index a538e9e7af4..abf3eb63207 100644 --- a/src/vs/platform/userDataSync/common/snippetsSync.ts +++ b/src/vs/platform/userDataSync/common/snippetsSync.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Event } from 'vs/base/common/event'; -import { deepClone } from 'vs/base/common/objects'; -import { URI } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { FileOperationError, FileOperationResult, IFileContent, IFileService, IFileStat } from 'vs/platform/files/common/files'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractInitializer, AbstractSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; -import { areSame, IMergeResult as ISnippetsMergeResult, merge } from 'vs/platform/userDataSync/common/snippetsMerge'; -import { Change, IRemoteUserData, ISyncData, IUserDataSyncLocalStoreService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, USER_DATA_SYNC_SCHEME } from 'vs/platform/userDataSync/common/userDataSync'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Event } from '../../../base/common/event.js'; +import { deepClone } from '../../../base/common/objects.js'; +import { URI } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { FileOperationError, FileOperationResult, IFileContent, IFileService, IFileStat } from '../../files/common/files.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { AbstractInitializer, AbstractSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from './abstractSynchronizer.js'; +import { areSame, IMergeResult as ISnippetsMergeResult, merge } from './snippetsMerge.js'; +import { Change, IRemoteUserData, ISyncData, IUserDataSyncLocalStoreService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, USER_DATA_SYNC_SCHEME } from './userDataSync.js'; interface ISnippetsResourcePreview extends IFileResourcePreview { previewResult: IMergeResult; diff --git a/src/vs/platform/userDataSync/common/tasksSync.ts b/src/vs/platform/userDataSync/common/tasksSync.ts index 3c764f33bdd..088c29044ac 100644 --- a/src/vs/platform/userDataSync/common/tasksSync.ts +++ b/src/vs/platform/userDataSync/common/tasksSync.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { URI } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractFileSynchroniser, AbstractInitializer, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; -import { Change, IRemoteUserData, IUserDataSyncLocalStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, USER_DATA_SYNC_SCHEME } from 'vs/platform/userDataSync/common/userDataSync'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { URI } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { ILogService } from '../../log/common/log.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { AbstractFileSynchroniser, AbstractInitializer, IAcceptResult, IFileResourcePreview, IMergeResult } from './abstractSynchronizer.js'; +import { Change, IRemoteUserData, IUserDataSyncLocalStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, USER_DATA_SYNC_SCHEME } from './userDataSync.js'; interface ITasksSyncContent { tasks?: string; diff --git a/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts b/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts index f6ebd219402..f868cccd7e3 100644 --- a/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts +++ b/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise, disposableTimeout, ThrottledDelayer, timeout } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toLocalISOString } from 'vs/base/common/date'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { isCancellationError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { isWeb } from 'vs/base/common/platform'; -import { isEqual } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUserDataSyncTask, IUserDataAutoSyncService, IUserDataManifest, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService, UserDataAutoSyncError, UserDataSyncError, UserDataSyncErrorCode } from 'vs/platform/userDataSync/common/userDataSync'; -import { IUserDataSyncAccountService } from 'vs/platform/userDataSync/common/userDataSyncAccount'; -import { IUserDataSyncMachinesService } from 'vs/platform/userDataSync/common/userDataSyncMachines'; +import { CancelablePromise, createCancelablePromise, disposableTimeout, ThrottledDelayer, timeout } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { toLocalISOString } from '../../../base/common/date.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { isCancellationError } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, IDisposable, MutableDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { isWeb } from '../../../base/common/platform.js'; +import { isEqual } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUserDataSyncTask, IUserDataAutoSyncService, IUserDataManifest, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService, UserDataAutoSyncError, UserDataSyncError, UserDataSyncErrorCode } from './userDataSync.js'; +import { IUserDataSyncAccountService } from './userDataSyncAccount.js'; +import { IUserDataSyncMachinesService } from './userDataSyncMachines.js'; type AutoSyncClassification = { owner: 'sandy081'; diff --git a/src/vs/platform/userDataSync/common/userDataProfilesManifestMerge.ts b/src/vs/platform/userDataSync/common/userDataProfilesManifestMerge.ts index a6957351fc5..6e5b0108065 100644 --- a/src/vs/platform/userDataSync/common/userDataProfilesManifestMerge.ts +++ b/src/vs/platform/userDataSync/common/userDataProfilesManifestMerge.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { equals } from 'vs/base/common/objects'; -import { IUserDataProfile, UseDefaultProfileFlags } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { ISyncUserDataProfile } from 'vs/platform/userDataSync/common/userDataSync'; +import { equals } from '../../../base/common/objects.js'; +import { IUserDataProfile, UseDefaultProfileFlags } from '../../userDataProfile/common/userDataProfile.js'; +import { ISyncUserDataProfile } from './userDataSync.js'; interface IRelaxedMergeResult { local: { added: ISyncUserDataProfile[]; removed: IUserDataProfile[]; updated: ISyncUserDataProfile[] }; diff --git a/src/vs/platform/userDataSync/common/userDataProfilesManifestSync.ts b/src/vs/platform/userDataSync/common/userDataProfilesManifestSync.ts index 13b099ee13e..2f72b653ba6 100644 --- a/src/vs/platform/userDataSync/common/userDataProfilesManifestSync.ts +++ b/src/vs/platform/userDataSync/common/userDataProfilesManifestSync.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toFormattedString } from 'vs/base/common/jsonFormatter'; -import { URI } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractSynchroniser, IAcceptResult, IMergeResult, IResourcePreview } from 'vs/platform/userDataSync/common/abstractSynchronizer'; -import { merge } from 'vs/platform/userDataSync/common/userDataProfilesManifestMerge'; -import { Change, IRemoteUserData, IUserDataSyncLocalStoreService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, USER_DATA_SYNC_SCHEME, ISyncUserDataProfile, ISyncData, IUserDataResourceManifest, UserDataSyncError, UserDataSyncErrorCode } from 'vs/platform/userDataSync/common/userDataSync'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { toFormattedString } from '../../../base/common/jsonFormatter.js'; +import { URI } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { AbstractSynchroniser, IAcceptResult, IMergeResult, IResourcePreview } from './abstractSynchronizer.js'; +import { merge } from './userDataProfilesManifestMerge.js'; +import { Change, IRemoteUserData, IUserDataSyncLocalStoreService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, USER_DATA_SYNC_SCHEME, ISyncUserDataProfile, ISyncData, IUserDataResourceManifest, UserDataSyncError, UserDataSyncErrorCode } from './userDataSync.js'; interface IUserDataProfileManifestResourceMergeResult extends IAcceptResult { readonly local: { added: ISyncUserDataProfile[]; removed: IUserDataProfile[]; updated: ISyncUserDataProfile[] }; diff --git a/src/vs/platform/userDataSync/common/userDataSync.ts b/src/vs/platform/userDataSync/common/userDataSync.ts index a080bfbe7ec..a57fcb05c90 100644 --- a/src/vs/platform/userDataSync/common/userDataSync.ts +++ b/src/vs/platform/userDataSync/common/userDataSync.ts @@ -3,39 +3,68 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { distinct } from 'vs/base/common/arrays'; -import { VSBufferReadableStream } from 'vs/base/common/buffer'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Event } from 'vs/base/common/event'; -import { FormattingOptions } from 'vs/base/common/jsonFormatter'; -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IExtUri } from 'vs/base/common/resources'; -import { isObject, isString } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { IHeaders } from 'vs/base/parts/request/common/request'; -import { localize } from 'vs/nls'; -import { allSettings, ConfigurationScope, Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { EXTENSION_IDENTIFIER_PATTERN, IExtensionIdentifier } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IUserDataProfile, UseDefaultProfileFlags } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IUserDataSyncMachine } from 'vs/platform/userDataSync/common/userDataSyncMachines'; +import { distinct } from '../../../base/common/arrays.js'; +import { VSBufferReadableStream } from '../../../base/common/buffer.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Event } from '../../../base/common/event.js'; +import { FormattingOptions } from '../../../base/common/jsonFormatter.js'; +import { IJSONSchema } from '../../../base/common/jsonSchema.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { IExtUri } from '../../../base/common/resources.js'; +import { isObject, isString } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { IHeaders } from '../../../base/parts/request/common/request.js'; +import { localize } from '../../../nls.js'; +import { allSettings, ConfigurationScope, Extensions as ConfigurationExtensions, IConfigurationRegistry, IRegisteredConfigurationPropertySchema, getAllConfigurationProperties, parseScope } from '../../configuration/common/configurationRegistry.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { EXTENSION_IDENTIFIER_PATTERN, IExtensionIdentifier } from '../../extensionManagement/common/extensionManagement.js'; +import { IExtensionManifest } from '../../extensions/common/extensions.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { Extensions as JSONExtensions, IJSONContributionRegistry } from '../../jsonschemas/common/jsonContributionRegistry.js'; +import { ILogService } from '../../log/common/log.js'; +import { Registry } from '../../registry/common/platform.js'; +import { IUserDataProfile, UseDefaultProfileFlags } from '../../userDataProfile/common/userDataProfile.js'; +import { IUserDataSyncMachine } from './userDataSyncMachines.js'; export function getDisallowedIgnoredSettings(): string[] { const allSettings = Registry.as(ConfigurationExtensions.Configuration).getConfigurationProperties(); return Object.keys(allSettings).filter(setting => !!allSettings[setting].disallowSyncIgnore); } -export function getDefaultIgnoredSettings(): string[] { +export function getDefaultIgnoredSettings(excludeExtensions: boolean = false): string[] { const allSettings = Registry.as(ConfigurationExtensions.Configuration).getConfigurationProperties(); - const ignoreSyncSettings = Object.keys(allSettings).filter(setting => !!allSettings[setting].ignoreSync); - const machineSettings = Object.keys(allSettings).filter(setting => allSettings[setting].scope === ConfigurationScope.MACHINE || allSettings[setting].scope === ConfigurationScope.MACHINE_OVERRIDABLE); + const ignoredSettings = getIgnoredSettings(allSettings, excludeExtensions); const disallowedSettings = getDisallowedIgnoredSettings(); - return distinct([...ignoreSyncSettings, ...machineSettings, ...disallowedSettings]); + return distinct([...ignoredSettings, ...disallowedSettings]); +} + +export function getIgnoredSettingsForExtension(manifest: IExtensionManifest): string[] { + if (!manifest.contributes?.configuration) { + return []; + } + const configurations = Array.isArray(manifest.contributes.configuration) ? manifest.contributes.configuration : [manifest.contributes.configuration]; + if (!configurations.length) { + return []; + } + const properties = getAllConfigurationProperties(configurations); + return getIgnoredSettings(properties, false); +} + +function getIgnoredSettings(properties: IStringDictionary, excludeExtensions: boolean): string[] { + const ignoredSettings = new Set(); + for (const key in properties) { + if (excludeExtensions && !!properties[key].source) { + continue; + } + const scope = isString(properties[key].scope) ? parseScope(properties[key].scope) : properties[key].scope; + if (properties[key].ignoreSync + || scope === ConfigurationScope.MACHINE + || scope === ConfigurationScope.MACHINE_OVERRIDABLE + ) { + ignoredSettings.add(key); + } + } + return [...ignoredSettings.values()]; } export const USER_DATA_SYNC_CONFIGURATION_SCOPE = 'settingsSync'; @@ -592,7 +621,7 @@ export interface IUserDataSyncUtilService { readonly _serviceBrand: undefined; resolveUserBindings(userbindings: string[]): Promise>; resolveFormattingOptions(resource: URI): Promise; - resolveDefaultIgnoredSettings(): Promise; + resolveDefaultCoreIgnoredSettings(): Promise; } export const IUserDataSyncLogService = createDecorator('IUserDataSyncLogService'); diff --git a/src/vs/platform/userDataSync/common/userDataSyncAccount.ts b/src/vs/platform/userDataSync/common/userDataSyncAccount.ts index eace7baea36..1de4b5a9220 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncAccount.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncAccount.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IUserDataSyncLogService, IUserDataSyncStoreService, UserDataSyncErrorCode } from 'vs/platform/userDataSync/common/userDataSync'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IUserDataSyncLogService, IUserDataSyncStoreService, UserDataSyncErrorCode } from './userDataSync.js'; export interface IUserDataSyncAccount { readonly authenticationProviderId: string; diff --git a/src/vs/platform/userDataSync/common/userDataSyncEnablementService.ts b/src/vs/platform/userDataSync/common/userDataSyncEnablementService.ts index e1606de959c..c23c49aa8ea 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncEnablementService.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncEnablementService.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { isWeb } from 'vs/base/common/platform'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IApplicationStorageValueChangeEvent, IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ALL_SYNC_RESOURCES, getEnablementKey, IUserDataSyncEnablementService, IUserDataSyncStoreManagementService, SyncResource } from 'vs/platform/userDataSync/common/userDataSync'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { isWeb } from '../../../base/common/platform.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IApplicationStorageValueChangeEvent, IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { ALL_SYNC_RESOURCES, getEnablementKey, IUserDataSyncEnablementService, IUserDataSyncStoreManagementService, SyncResource } from './userDataSync.js'; type SyncEnablementClassification = { owner: 'sandy081'; diff --git a/src/vs/platform/userDataSync/common/userDataSyncIpc.ts b/src/vs/platform/userDataSync/common/userDataSyncIpc.ts index ede978060d9..9bd2359a9c0 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncIpc.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncIpc.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IUserDataSyncStore, IUserDataSyncStoreManagementService, UserDataSyncStoreType } from 'vs/platform/userDataSync/common/userDataSync'; -import { IUserDataSyncAccount, IUserDataSyncAccountService } from 'vs/platform/userDataSync/common/userDataSyncAccount'; -import { AbstractUserDataSyncStoreManagementService } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { IUserDataSyncStore, IUserDataSyncStoreManagementService, UserDataSyncStoreType } from './userDataSync.js'; +import { IUserDataSyncAccount, IUserDataSyncAccountService } from './userDataSyncAccount.js'; +import { AbstractUserDataSyncStoreManagementService } from './userDataSyncStoreService.js'; export class UserDataSyncAccountServiceChannel implements IServerChannel { constructor(private readonly service: IUserDataSyncAccountService) { } diff --git a/src/vs/platform/userDataSync/common/userDataSyncLocalStoreService.ts b/src/vs/platform/userDataSync/common/userDataSyncLocalStoreService.ts index 28d2400cfee..53acee377e0 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncLocalStoreService.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncLocalStoreService.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Promises } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { toLocalISOString } from 'vs/base/common/date'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { FileOperationResult, IFileService, IFileStat, toFileOperationResult } from 'vs/platform/files/common/files'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { ALL_SYNC_RESOURCES, IResourceRefHandle, IUserDataSyncLocalStoreService, IUserDataSyncLogService, SyncResource } from 'vs/platform/userDataSync/common/userDataSync'; +import { Promises } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { toLocalISOString } from '../../../base/common/date.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { joinPath } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { FileOperationResult, IFileService, IFileStat, toFileOperationResult } from '../../files/common/files.js'; +import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { ALL_SYNC_RESOURCES, IResourceRefHandle, IUserDataSyncLocalStoreService, IUserDataSyncLogService, SyncResource } from './userDataSync.js'; export class UserDataSyncLocalStoreService extends Disposable implements IUserDataSyncLocalStoreService { @@ -53,7 +53,7 @@ export class UserDataSyncLocalStoreService extends Disposable implements IUserDa if (stat.children) { for (const child of stat.children) { - if (child.isDirectory && !this.userDataProfilesService.profiles.some(profile => profile.id === child.name)) { + if (child.isDirectory && !ALL_SYNC_RESOURCES.includes(child.name) && !this.userDataProfilesService.profiles.some(profile => profile.id === child.name)) { try { this.logService.info('Deleting non existing profile from backup', child.resource.path); await this.fileService.del(child.resource, { recursive: true }); diff --git a/src/vs/platform/userDataSync/common/userDataSyncLog.ts b/src/vs/platform/userDataSync/common/userDataSyncLog.ts index 4dffdbc947e..464be1fa944 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncLog.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncLog.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { joinPath } from 'vs/base/common/resources'; -import { localize } from 'vs/nls'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { AbstractLogger, ILogger, ILoggerService } from 'vs/platform/log/common/log'; -import { IUserDataSyncLogService, USER_DATA_SYNC_LOG_ID } from 'vs/platform/userDataSync/common/userDataSync'; +import { joinPath } from '../../../base/common/resources.js'; +import { localize } from '../../../nls.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { AbstractLogger, ILogger, ILoggerService } from '../../log/common/log.js'; +import { IUserDataSyncLogService, USER_DATA_SYNC_LOG_ID } from './userDataSync.js'; export class UserDataSyncLogService extends AbstractLogger implements IUserDataSyncLogService { diff --git a/src/vs/platform/userDataSync/common/userDataSyncMachines.ts b/src/vs/platform/userDataSync/common/userDataSyncMachines.ts index ad3f8f63a1c..1c36206421a 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncMachines.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncMachines.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { isAndroid, isChrome, isEdge, isFirefox, isSafari, isWeb, Platform, platform, PlatformToString } from 'vs/base/common/platform'; -import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import { localize } from 'vs/nls'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { getServiceMachineId } from 'vs/platform/externalServices/common/serviceMachineId'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IUserData, IUserDataManifest, IUserDataSyncLogService, IUserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSync'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { isAndroid, isChrome, isEdge, isFirefox, isSafari, isWeb, Platform, platform, PlatformToString } from '../../../base/common/platform.js'; +import { escapeRegExpCharacters } from '../../../base/common/strings.js'; +import { localize } from '../../../nls.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IProductService } from '../../product/common/productService.js'; +import { getServiceMachineId } from '../../externalServices/common/serviceMachineId.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { IUserData, IUserDataManifest, IUserDataSyncLogService, IUserDataSyncStoreService } from './userDataSync.js'; export interface IMachineData { id: string; diff --git a/src/vs/platform/userDataSync/common/userDataSyncResourceProvider.ts b/src/vs/platform/userDataSync/common/userDataSyncResourceProvider.ts index c68c67a3a59..58ee44879bd 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncResourceProvider.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncResourceProvider.ts @@ -3,30 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IExtUri } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { getServiceMachineId } from 'vs/platform/externalServices/common/serviceMachineId'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { ISyncData, ISyncResourceHandle, IUserData, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncStoreService, SyncResource, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_SCHEME, IUserDataSyncResourceProviderService, ISyncUserDataProfile, CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM, IUserDataSyncResource } from 'vs/platform/userDataSync/common/userDataSync'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { isSyncData } from 'vs/platform/userDataSync/common/abstractSynchronizer'; -import { parseSnippets } from 'vs/platform/userDataSync/common/snippetsSync'; -import { parseSettingsSyncContent } from 'vs/platform/userDataSync/common/settingsSync'; -import { getKeybindingsContentFromSyncContent } from 'vs/platform/userDataSync/common/keybindingsSync'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { getTasksContentFromSyncContent } from 'vs/platform/userDataSync/common/tasksSync'; -import { LocalExtensionsProvider, parseExtensions, stringify as stringifyExtensions } from 'vs/platform/userDataSync/common/extensionsSync'; -import { LocalGlobalStateProvider, stringify as stringifyGlobalState } from 'vs/platform/userDataSync/common/globalStateSync'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { parseUserDataProfilesManifest, stringifyLocalProfiles } from 'vs/platform/userDataSync/common/userDataProfilesManifestSync'; -import { toFormattedString } from 'vs/base/common/jsonFormatter'; -import { trim } from 'vs/base/common/strings'; -import { IMachinesData, IUserDataSyncMachine } from 'vs/platform/userDataSync/common/userDataSyncMachines'; -import { getModelSelectionContentFromSyncContent } from 'vs/platform/userDataSync/common/modelSelectionSync'; +import { IExtUri } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { getServiceMachineId } from '../../externalServices/common/serviceMachineId.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; +import { ISyncData, ISyncResourceHandle, IUserData, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncStoreService, SyncResource, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_SCHEME, IUserDataSyncResourceProviderService, ISyncUserDataProfile, CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM, IUserDataSyncResource } from './userDataSync.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { isSyncData } from './abstractSynchronizer.js'; +import { parseSnippets } from './snippetsSync.js'; +import { parseSettingsSyncContent } from './settingsSync.js'; +import { getKeybindingsContentFromSyncContent } from './keybindingsSync.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { getTasksContentFromSyncContent } from './tasksSync.js'; +import { LocalExtensionsProvider, parseExtensions, stringify as stringifyExtensions } from './extensionsSync.js'; +import { LocalGlobalStateProvider, stringify as stringifyGlobalState } from './globalStateSync.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { parseUserDataProfilesManifest, stringifyLocalProfiles } from './userDataProfilesManifestSync.js'; +import { toFormattedString } from '../../../base/common/jsonFormatter.js'; +import { trim } from '../../../base/common/strings.js'; +import { IMachinesData, IUserDataSyncMachine } from './userDataSyncMachines.js'; +import { getModelSelectionContentFromSyncContent } from './modelSelectionSync.js'; interface ISyncResourceUriInfo { readonly remote: boolean; diff --git a/src/vs/platform/userDataSync/common/userDataSyncService.ts b/src/vs/platform/userDataSync/common/userDataSyncService.ts index e8f71278e52..67ca6b6ceb5 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncService.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncService.ts @@ -3,37 +3,37 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { equals } from 'vs/base/common/arrays'; -import { CancelablePromise, createCancelablePromise, RunOnceScheduler } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { isEqual } from 'vs/base/common/resources'; -import { isBoolean, isUndefined } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { ExtensionsSynchroniser } from 'vs/platform/userDataSync/common/extensionsSync'; -import { GlobalStateSynchroniser } from 'vs/platform/userDataSync/common/globalStateSync'; -import { KeybindingsSynchroniser } from 'vs/platform/userDataSync/common/keybindingsSync'; -import { SettingsSynchroniser } from 'vs/platform/userDataSync/common/settingsSync'; -import { SnippetsSynchroniser } from 'vs/platform/userDataSync/common/snippetsSync'; -import { TasksSynchroniser } from 'vs/platform/userDataSync/common/tasksSync'; -import { UserDataProfilesManifestSynchroniser } from 'vs/platform/userDataSync/common/userDataProfilesManifestSync'; +import { equals } from '../../../base/common/arrays.js'; +import { CancelablePromise, createCancelablePromise, RunOnceScheduler } from '../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { isEqual } from '../../../base/common/resources.js'; +import { isBoolean, isUndefined } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IExtensionGalleryService } from '../../extensionManagement/common/extensionManagement.js'; +import { IFileService } from '../../files/common/files.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; +import { ExtensionsSynchroniser } from './extensionsSync.js'; +import { GlobalStateSynchroniser } from './globalStateSync.js'; +import { KeybindingsSynchroniser } from './keybindingsSync.js'; +import { ModelSelectionSynchronizer } from './modelSelectionSync.js'; +import { SettingsSynchroniser } from './settingsSync.js'; +import { SnippetsSynchroniser } from './snippetsSync.js'; +import { TasksSynchroniser } from './tasksSync.js'; +import { UserDataProfilesManifestSynchroniser } from './userDataProfilesManifestSync.js'; import { ALL_SYNC_RESOURCES, Change, createSyncHeaders, IUserDataManualSyncTask, IUserDataSyncResourceConflicts, IUserDataSyncResourceError, IUserDataSyncResource, ISyncResourceHandle, IUserDataSyncTask, ISyncUserDataProfile, IUserDataManifest, IUserDataResourceManifest, IUserDataSyncConfiguration, IUserDataSyncEnablementService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService, MergeState, SyncResource, SyncStatus, UserDataSyncError, UserDataSyncErrorCode, UserDataSyncStoreError, USER_DATA_SYNC_CONFIGURATION_SCOPE, IUserDataSyncResourceProviderService, IUserDataActivityData, IUserDataSyncLocalStoreService -} from 'vs/platform/userDataSync/common/userDataSync'; -import { ModelSelectionSynchronizer } from 'vs/platform/userDataSync/common/modelSelectionSync'; +} from './userDataSync.js'; type SyncErrorClassification = { owner: 'sandy081'; @@ -703,8 +703,7 @@ class ProfileSynchronizer extends Disposable { const [[synchronizer, , disposable]] = this._enabled.splice(index, 1); disposable.dispose(); this.updateStatus(); - Promise.allSettled([synchronizer.stop(), synchronizer.resetLocal()]) - .then(null, error => this.logService.error(error)); + synchronizer.stop().then(null, error => this.logService.error(error)); } } diff --git a/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts b/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts index b052fe458c5..9516beebcf0 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUserDataProfilesService, reviveProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js'; +import { ILogService } from '../../log/common/log.js'; +import { IUserDataProfilesService, reviveProfile } from '../../userDataProfile/common/userDataProfile.js'; import { IUserDataManualSyncTask, IUserDataSyncResourceConflicts, IUserDataSyncResourceError, IUserDataSyncResource, ISyncResourceHandle, IUserDataSyncTask, IUserDataSyncService, SyncResource, SyncStatus, UserDataSyncError -} from 'vs/platform/userDataSync/common/userDataSync'; +} from './userDataSync.js'; type ManualSyncTaskEvent = { manualSyncTaskId: string; data: T }; diff --git a/src/vs/platform/userDataSync/common/userDataSyncStoreService.ts b/src/vs/platform/userDataSync/common/userDataSyncStoreService.ts index 32c4086b550..905148bab3f 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncStoreService.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncStoreService.ts @@ -3,28 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise, timeout } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { getErrorMessage, isCancellationError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { Mimes } from 'vs/base/common/mime'; -import { isWeb } from 'vs/base/common/platform'; -import { ConfigurationSyncStore } from 'vs/base/common/product'; -import { joinPath, relativePath } from 'vs/base/common/resources'; -import { isObject, isString } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IHeaders, IRequestContext, IRequestOptions } from 'vs/base/parts/request/common/request'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { asJson, asText, asTextOrError, hasNoContent, IRequestService, isSuccess, isSuccess as isSuccessContext } from 'vs/platform/request/common/request'; -import { getServiceMachineId } from 'vs/platform/externalServices/common/serviceMachineId'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { HEADER_EXECUTION_ID, HEADER_OPERATION_ID, IAuthenticationProvider, IResourceRefHandle, IUserData, IUserDataManifest, IUserDataSyncLogService, IUserDataSyncStore, IUserDataSyncStoreManagementService, IUserDataSyncStoreService, ServerResource, SYNC_SERVICE_URL_TYPE, UserDataSyncErrorCode, UserDataSyncStoreError, UserDataSyncStoreType } from 'vs/platform/userDataSync/common/userDataSync'; -import { VSBufferReadableStream } from 'vs/base/common/buffer'; +import { CancelablePromise, createCancelablePromise, timeout } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { getErrorMessage, isCancellationError } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { Mimes } from '../../../base/common/mime.js'; +import { isWeb } from '../../../base/common/platform.js'; +import { ConfigurationSyncStore } from '../../../base/common/product.js'; +import { joinPath, relativePath } from '../../../base/common/resources.js'; +import { isObject, isString } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IHeaders, IRequestContext, IRequestOptions } from '../../../base/parts/request/common/request.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { IFileService } from '../../files/common/files.js'; +import { IProductService } from '../../product/common/productService.js'; +import { asJson, asText, asTextOrError, hasNoContent, IRequestService, isSuccess, isSuccess as isSuccessContext } from '../../request/common/request.js'; +import { getServiceMachineId } from '../../externalServices/common/serviceMachineId.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { HEADER_EXECUTION_ID, HEADER_OPERATION_ID, IAuthenticationProvider, IResourceRefHandle, IUserData, IUserDataManifest, IUserDataSyncLogService, IUserDataSyncStore, IUserDataSyncStoreManagementService, IUserDataSyncStoreService, ServerResource, SYNC_SERVICE_URL_TYPE, UserDataSyncErrorCode, UserDataSyncStoreError, UserDataSyncStoreType } from './userDataSync.js'; +import { VSBufferReadableStream } from '../../../base/common/buffer.js'; const CONFIGURATION_SYNC_STORE_KEY = 'configurationSync.store'; const SYNC_PREVIOUS_STORE = 'sync.previous.store'; @@ -148,7 +148,7 @@ export class UserDataSyncStoreClient extends Disposable { private userDataSyncStoreUrl: URI | undefined; private authToken: { token: string; type: string } | undefined; - private readonly commonHeadersPromise: Promise<{ [key: string]: string }>; + private readonly commonHeadersPromise: Promise; private readonly session: RequestsSession; private _onTokenFailed = this._register(new Emitter()); diff --git a/src/vs/platform/userDataSync/node/userDataAutoSyncService.ts b/src/vs/platform/userDataSync/node/userDataAutoSyncService.ts index 2bdbeea386e..f8642d424a4 100644 --- a/src/vs/platform/userDataSync/node/userDataAutoSyncService.ts +++ b/src/vs/platform/userDataSync/node/userDataAutoSyncService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // -import { Event } from 'vs/base/common/event'; -import { INativeHostService } from 'vs/platform/native/common/native'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { UserDataAutoSyncService as BaseUserDataAutoSyncService } from 'vs/platform/userDataSync/common/userDataAutoSyncService'; -import { IUserDataSyncEnablementService, IUserDataSyncLogService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSync'; -import { IUserDataSyncAccountService } from 'vs/platform/userDataSync/common/userDataSyncAccount'; -import { IUserDataSyncMachinesService } from 'vs/platform/userDataSync/common/userDataSyncMachines'; +import { Event } from '../../../base/common/event.js'; +import { INativeHostService } from '../../native/common/native.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IStorageService } from '../../storage/common/storage.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { UserDataAutoSyncService as BaseUserDataAutoSyncService } from '../common/userDataAutoSyncService.js'; +import { IUserDataSyncEnablementService, IUserDataSyncLogService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService } from '../common/userDataSync.js'; +import { IUserDataSyncAccountService } from '../common/userDataSyncAccount.js'; +import { IUserDataSyncMachinesService } from '../common/userDataSyncMachines.js'; export class UserDataAutoSyncService extends BaseUserDataAutoSyncService { diff --git a/src/vs/platform/userDataSync/test/common/extensionsMerge.test.ts b/src/vs/platform/userDataSync/test/common/extensionsMerge.test.ts index 1ecc7b900a4..4a1c7540363 100644 --- a/src/vs/platform/userDataSync/test/common/extensionsMerge.test.ts +++ b/src/vs/platform/userDataSync/test/common/extensionsMerge.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { merge } from 'vs/platform/userDataSync/common/extensionsMerge'; -import { ILocalSyncExtension, ISyncExtension } from 'vs/platform/userDataSync/common/userDataSync'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { merge } from '../../common/extensionsMerge.js'; +import { ILocalSyncExtension, ISyncExtension } from '../../common/userDataSync.js'; suite('ExtensionsMerge', () => { diff --git a/src/vs/platform/userDataSync/test/common/globalStateMerge.test.ts b/src/vs/platform/userDataSync/test/common/globalStateMerge.test.ts index 7a17fac286d..88c15d78a78 100644 --- a/src/vs/platform/userDataSync/test/common/globalStateMerge.test.ts +++ b/src/vs/platform/userDataSync/test/common/globalStateMerge.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { merge } from 'vs/platform/userDataSync/common/globalStateMerge'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { merge } from '../../common/globalStateMerge.js'; suite('GlobalStateMerge', () => { diff --git a/src/vs/platform/userDataSync/test/common/globalStateSync.test.ts b/src/vs/platform/userDataSync/test/common/globalStateSync.test.ts index 7d3ecaca732..a179f8e02d0 100644 --- a/src/vs/platform/userDataSync/test/common/globalStateSync.test.ts +++ b/src/vs/platform/userDataSync/test/common/globalStateSync.test.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { GlobalStateSynchroniser } from 'vs/platform/userDataSync/common/globalStateSync'; -import { IGlobalState, ISyncData, IUserDataSyncStoreService, SyncResource, SyncStatus } from 'vs/platform/userDataSync/common/userDataSync'; -import { IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; -import { UserDataSyncClient, UserDataSyncTestServer } from 'vs/platform/userDataSync/test/common/userDataSyncClient'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { IEnvironmentService } from '../../../environment/common/environment.js'; +import { IFileService } from '../../../files/common/files.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../../storage/common/storage.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; +import { GlobalStateSynchroniser } from '../../common/globalStateSync.js'; +import { IGlobalState, ISyncData, IUserDataSyncStoreService, SyncResource, SyncStatus } from '../../common/userDataSync.js'; +import { IUserDataProfileStorageService } from '../../../userDataProfile/common/userDataProfileStorageService.js'; +import { UserDataSyncClient, UserDataSyncTestServer } from './userDataSyncClient.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('GlobalStateSync', () => { diff --git a/src/vs/platform/userDataSync/test/common/keybindingsMerge.test.ts b/src/vs/platform/userDataSync/test/common/keybindingsMerge.test.ts index c7a1f8675e7..4b713816e10 100644 --- a/src/vs/platform/userDataSync/test/common/keybindingsMerge.test.ts +++ b/src/vs/platform/userDataSync/test/common/keybindingsMerge.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { merge } from 'vs/platform/userDataSync/common/keybindingsMerge'; -import { TestUserDataSyncUtilService } from 'vs/platform/userDataSync/test/common/userDataSyncClient'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { merge } from '../../common/keybindingsMerge.js'; +import { TestUserDataSyncUtilService } from './userDataSyncClient.js'; suite('KeybindingsMerge - No Conflicts', () => { diff --git a/src/vs/platform/userDataSync/test/common/keybindingsSync.test.ts b/src/vs/platform/userDataSync/test/common/keybindingsSync.test.ts index 660185fd8fd..00841916bbe 100644 --- a/src/vs/platform/userDataSync/test/common/keybindingsSync.test.ts +++ b/src/vs/platform/userDataSync/test/common/keybindingsSync.test.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { getKeybindingsContentFromSyncContent, KeybindingsSynchroniser } from 'vs/platform/userDataSync/common/keybindingsSync'; -import { IUserDataSyncStoreService, SyncResource, UserDataSyncError, UserDataSyncErrorCode } from 'vs/platform/userDataSync/common/userDataSync'; -import { UserDataSyncClient, UserDataSyncTestServer } from 'vs/platform/userDataSync/test/common/userDataSyncClient'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IFileService } from '../../../files/common/files.js'; +import { ILogService } from '../../../log/common/log.js'; +import { IUserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; +import { getKeybindingsContentFromSyncContent, KeybindingsSynchroniser } from '../../common/keybindingsSync.js'; +import { IUserDataSyncStoreService, SyncResource, UserDataSyncError, UserDataSyncErrorCode } from '../../common/userDataSync.js'; +import { UserDataSyncClient, UserDataSyncTestServer } from './userDataSyncClient.js'; suite('KeybindingsSync', () => { diff --git a/src/vs/platform/userDataSync/test/common/settingsMerge.test.ts b/src/vs/platform/userDataSync/test/common/settingsMerge.test.ts index 625df21215c..0d6055ed1ce 100644 --- a/src/vs/platform/userDataSync/test/common/settingsMerge.test.ts +++ b/src/vs/platform/userDataSync/test/common/settingsMerge.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { addSetting, merge, updateIgnoredSettings } from 'vs/platform/userDataSync/common/settingsMerge'; -import type { IConflictSetting } from 'vs/platform/userDataSync/common/userDataSync'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { addSetting, merge, updateIgnoredSettings } from '../../common/settingsMerge.js'; +import type { IConflictSetting } from '../../common/userDataSync.js'; const formattingOptions = { eol: '\n', insertSpaces: false, tabSize: 4 }; diff --git a/src/vs/platform/userDataSync/test/common/settingsSync.test.ts b/src/vs/platform/userDataSync/test/common/settingsSync.test.ts index 39246f25ce1..914ae83a5d4 100644 --- a/src/vs/platform/userDataSync/test/common/settingsSync.test.ts +++ b/src/vs/platform/userDataSync/test/common/settingsSync.test.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Event } from 'vs/base/common/event'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ConfigurationScope, Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { IFileService } from 'vs/platform/files/common/files'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { ISettingsSyncContent, parseSettingsSyncContent, SettingsSynchroniser } from 'vs/platform/userDataSync/common/settingsSync'; -import { ISyncData, IUserDataSyncStoreService, SyncResource, SyncStatus, UserDataSyncError, UserDataSyncErrorCode } from 'vs/platform/userDataSync/common/userDataSync'; -import { UserDataSyncClient, UserDataSyncTestServer } from 'vs/platform/userDataSync/test/common/userDataSyncClient'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { Event } from '../../../../base/common/event.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IConfigurationService } from '../../../configuration/common/configuration.js'; +import { ConfigurationScope, Extensions, IConfigurationRegistry } from '../../../configuration/common/configurationRegistry.js'; +import { IFileService } from '../../../files/common/files.js'; +import { Registry } from '../../../registry/common/platform.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; +import { ISettingsSyncContent, parseSettingsSyncContent, SettingsSynchroniser } from '../../common/settingsSync.js'; +import { ISyncData, IUserDataSyncStoreService, SyncResource, SyncStatus, UserDataSyncError, UserDataSyncErrorCode } from '../../common/userDataSync.js'; +import { UserDataSyncClient, UserDataSyncTestServer } from './userDataSyncClient.js'; suite('SettingsSync - Auto', () => { diff --git a/src/vs/platform/userDataSync/test/common/snippetsMerge.test.ts b/src/vs/platform/userDataSync/test/common/snippetsMerge.test.ts index 50e5caa545f..bfd9b973fae 100644 --- a/src/vs/platform/userDataSync/test/common/snippetsMerge.test.ts +++ b/src/vs/platform/userDataSync/test/common/snippetsMerge.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { merge } from 'vs/platform/userDataSync/common/snippetsMerge'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { merge } from '../../common/snippetsMerge.js'; const tsSnippet1 = `{ diff --git a/src/vs/platform/userDataSync/test/common/snippetsSync.test.ts b/src/vs/platform/userDataSync/test/common/snippetsSync.test.ts index 97f4ab83f13..89e9c59c48b 100644 --- a/src/vs/platform/userDataSync/test/common/snippetsSync.test.ts +++ b/src/vs/platform/userDataSync/test/common/snippetsSync.test.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { dirname, joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { SnippetsSynchroniser } from 'vs/platform/userDataSync/common/snippetsSync'; -import { IResourcePreview, ISyncData, IUserDataSyncStoreService, PREVIEW_DIR_NAME, SyncResource, SyncStatus } from 'vs/platform/userDataSync/common/userDataSync'; -import { UserDataSyncClient, UserDataSyncTestServer } from 'vs/platform/userDataSync/test/common/userDataSyncClient'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { IStringDictionary } from '../../../../base/common/collections.js'; +import { dirname, joinPath } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IEnvironmentService } from '../../../environment/common/environment.js'; +import { IFileService } from '../../../files/common/files.js'; +import { IUserDataProfile, IUserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; +import { SnippetsSynchroniser } from '../../common/snippetsSync.js'; +import { IResourcePreview, ISyncData, IUserDataSyncStoreService, PREVIEW_DIR_NAME, SyncResource, SyncStatus } from '../../common/userDataSync.js'; +import { UserDataSyncClient, UserDataSyncTestServer } from './userDataSyncClient.js'; const tsSnippet1 = `{ diff --git a/src/vs/platform/userDataSync/test/common/synchronizer.test.ts b/src/vs/platform/userDataSync/test/common/synchronizer.test.ts index a336ca32411..cbc65e458b1 100644 --- a/src/vs/platform/userDataSync/test/common/synchronizer.test.ts +++ b/src/vs/platform/userDataSync/test/common/synchronizer.test.ts @@ -4,20 +4,20 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Barrier } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { isEqual, joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractSynchroniser, IAcceptResult, IMergeResult, IResourcePreview } from 'vs/platform/userDataSync/common/abstractSynchronizer'; -import { Change, IRemoteUserData, IResourcePreview as IBaseResourcePreview, IUserDataResourceManifest, IUserDataSyncConfiguration, IUserDataSyncStoreService, MergeState, SyncResource, SyncStatus, USER_DATA_SYNC_SCHEME } from 'vs/platform/userDataSync/common/userDataSync'; -import { UserDataSyncClient, UserDataSyncTestServer } from 'vs/platform/userDataSync/test/common/userDataSyncClient'; +import { Barrier } from '../../../../base/common/async.js'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { isEqual, joinPath } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IFileService } from '../../../files/common/files.js'; +import { IStorageService, StorageScope } from '../../../storage/common/storage.js'; +import { IUserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; +import { AbstractSynchroniser, IAcceptResult, IMergeResult, IResourcePreview } from '../../common/abstractSynchronizer.js'; +import { Change, IRemoteUserData, IResourcePreview as IBaseResourcePreview, IUserDataResourceManifest, IUserDataSyncConfiguration, IUserDataSyncStoreService, MergeState, SyncResource, SyncStatus, USER_DATA_SYNC_SCHEME } from '../../common/userDataSync.js'; +import { UserDataSyncClient, UserDataSyncTestServer } from './userDataSyncClient.js'; interface ITestResourcePreview extends IResourcePreview { ref: string; diff --git a/src/vs/platform/userDataSync/test/common/tasksSync.test.ts b/src/vs/platform/userDataSync/test/common/tasksSync.test.ts index c6cfd18a44b..26fa39aeeb2 100644 --- a/src/vs/platform/userDataSync/test/common/tasksSync.test.ts +++ b/src/vs/platform/userDataSync/test/common/tasksSync.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IFileService } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { getTasksContentFromSyncContent, TasksSynchroniser } from 'vs/platform/userDataSync/common/tasksSync'; -import { Change, IUserDataSyncStoreService, MergeState, SyncResource, SyncStatus } from 'vs/platform/userDataSync/common/userDataSync'; -import { UserDataSyncClient, UserDataSyncTestServer } from 'vs/platform/userDataSync/test/common/userDataSyncClient'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IFileService } from '../../../files/common/files.js'; +import { ILogService } from '../../../log/common/log.js'; +import { IUserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; +import { getTasksContentFromSyncContent, TasksSynchroniser } from '../../common/tasksSync.js'; +import { Change, IUserDataSyncStoreService, MergeState, SyncResource, SyncStatus } from '../../common/userDataSync.js'; +import { UserDataSyncClient, UserDataSyncTestServer } from './userDataSyncClient.js'; suite('TasksSync', () => { diff --git a/src/vs/platform/userDataSync/test/common/userDataAutoSyncService.test.ts b/src/vs/platform/userDataSync/test/common/userDataAutoSyncService.test.ts index e9c86afd301..9c3164a97b7 100644 --- a/src/vs/platform/userDataSync/test/common/userDataAutoSyncService.test.ts +++ b/src/vs/platform/userDataSync/test/common/userDataAutoSyncService.test.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Event } from 'vs/base/common/event'; -import { joinPath } from 'vs/base/common/resources'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { UserDataAutoSyncService } from 'vs/platform/userDataSync/common/userDataAutoSyncService'; -import { IUserDataSyncService, SyncResource, UserDataAutoSyncError, UserDataSyncErrorCode, UserDataSyncStoreError } from 'vs/platform/userDataSync/common/userDataSync'; -import { IUserDataSyncMachinesService } from 'vs/platform/userDataSync/common/userDataSyncMachines'; -import { UserDataSyncClient, UserDataSyncTestServer } from 'vs/platform/userDataSync/test/common/userDataSyncClient'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { Event } from '../../../../base/common/event.js'; +import { joinPath } from '../../../../base/common/resources.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IEnvironmentService } from '../../../environment/common/environment.js'; +import { IFileService } from '../../../files/common/files.js'; +import { IUserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; +import { UserDataAutoSyncService } from '../../common/userDataAutoSyncService.js'; +import { IUserDataSyncService, SyncResource, UserDataAutoSyncError, UserDataSyncErrorCode, UserDataSyncStoreError } from '../../common/userDataSync.js'; +import { IUserDataSyncMachinesService } from '../../common/userDataSyncMachines.js'; +import { UserDataSyncClient, UserDataSyncTestServer } from './userDataSyncClient.js'; class TestUserDataAutoSyncService extends UserDataAutoSyncService { protected override startAutoSync(): boolean { return false; } diff --git a/src/vs/platform/userDataSync/test/common/userDataProfilesManifestMerge.test.ts b/src/vs/platform/userDataSync/test/common/userDataProfilesManifestMerge.test.ts index e60f5314799..c40b4781ee8 100644 --- a/src/vs/platform/userDataSync/test/common/userDataProfilesManifestMerge.test.ts +++ b/src/vs/platform/userDataSync/test/common/userDataProfilesManifestMerge.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IUserDataProfile, toUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { merge } from 'vs/platform/userDataSync/common/userDataProfilesManifestMerge'; -import { ISyncUserDataProfile } from 'vs/platform/userDataSync/common/userDataSync'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IUserDataProfile, toUserDataProfile } from '../../../userDataProfile/common/userDataProfile.js'; +import { merge } from '../../common/userDataProfilesManifestMerge.js'; +import { ISyncUserDataProfile } from '../../common/userDataSync.js'; suite('UserDataProfilesManifestMerge', () => { diff --git a/src/vs/platform/userDataSync/test/common/userDataProfilesManifestSync.test.ts b/src/vs/platform/userDataSync/test/common/userDataProfilesManifestSync.test.ts index 2227e3d1182..d52b6a0db19 100644 --- a/src/vs/platform/userDataSync/test/common/userDataProfilesManifestSync.test.ts +++ b/src/vs/platform/userDataSync/test/common/userDataProfilesManifestSync.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { UserDataProfilesManifestSynchroniser } from 'vs/platform/userDataSync/common/userDataProfilesManifestSync'; -import { ISyncData, ISyncUserDataProfile, IUserDataSyncStoreService, SyncResource, SyncStatus } from 'vs/platform/userDataSync/common/userDataSync'; -import { UserDataSyncClient, UserDataSyncTestServer } from 'vs/platform/userDataSync/test/common/userDataSyncClient'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IUserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; +import { UserDataProfilesManifestSynchroniser } from '../../common/userDataProfilesManifestSync.js'; +import { ISyncData, ISyncUserDataProfile, IUserDataSyncStoreService, SyncResource, SyncStatus } from '../../common/userDataSync.js'; +import { UserDataSyncClient, UserDataSyncTestServer } from './userDataSyncClient.js'; suite('UserDataProfilesManifestSync', () => { diff --git a/src/vs/platform/userDataSync/test/common/userDataSyncClient.ts b/src/vs/platform/userDataSync/test/common/userDataSyncClient.ts index 977422623df..19c8f7f2f6d 100644 --- a/src/vs/platform/userDataSync/test/common/userDataSyncClient.ts +++ b/src/vs/platform/userDataSync/test/common/userDataSyncClient.ts @@ -3,48 +3,48 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { bufferToStream, VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Emitter } from 'vs/base/common/event'; -import { FormattingOptions } from 'vs/base/common/jsonFormatter'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IHeaders, IRequestContext, IRequestOptions } from 'vs/base/parts/request/common/request'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ConfigurationService } from 'vs/platform/configuration/common/configurationService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { GlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService'; -import { DidUninstallExtensionEvent, IExtensionGalleryService, IExtensionManagementService, IGlobalExtensionEnablementService, InstallExtensionResult } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { InMemoryFileSystemProvider } from 'vs/platform/files/common/inMemoryFilesystemProvider'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { InMemoryStorageService, IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { ExtensionStorageService, IExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage'; -import { IgnoredExtensionsManagementService, IIgnoredExtensionsManagementService } from 'vs/platform/userDataSync/common/ignoredExtensions'; -import { ALL_SYNC_RESOURCES, getDefaultIgnoredSettings, IUserData, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService, IUserDataSyncUtilService, registerConfiguration, ServerResource, SyncResource, IUserDataSynchroniser, IUserDataResourceManifest, IUserDataCollectionManifest, USER_DATA_SYNC_SCHEME } from 'vs/platform/userDataSync/common/userDataSync'; -import { IUserDataSyncAccountService, UserDataSyncAccountService } from 'vs/platform/userDataSync/common/userDataSyncAccount'; -import { UserDataSyncLocalStoreService } from 'vs/platform/userDataSync/common/userDataSyncLocalStoreService'; -import { IUserDataSyncMachinesService, UserDataSyncMachinesService } from 'vs/platform/userDataSync/common/userDataSyncMachines'; -import { UserDataSyncEnablementService } from 'vs/platform/userDataSync/common/userDataSyncEnablementService'; -import { UserDataSyncService } from 'vs/platform/userDataSync/common/userDataSyncService'; -import { UserDataSyncStoreManagementService, UserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; -import { InMemoryUserDataProfilesService, IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { NullPolicyService } from 'vs/platform/policy/common/policy'; -import { IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; -import { TestUserDataProfileStorageService } from 'vs/platform/userDataProfile/test/common/userDataProfileStorageService.test'; +import { bufferToStream, VSBuffer } from '../../../../base/common/buffer.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { IStringDictionary } from '../../../../base/common/collections.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { FormattingOptions } from '../../../../base/common/jsonFormatter.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { joinPath } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { generateUuid } from '../../../../base/common/uuid.js'; +import { IHeaders, IRequestContext, IRequestOptions } from '../../../../base/parts/request/common/request.js'; +import { IConfigurationService } from '../../../configuration/common/configuration.js'; +import { ConfigurationService } from '../../../configuration/common/configurationService.js'; +import { IEnvironmentService } from '../../../environment/common/environment.js'; +import { GlobalExtensionEnablementService } from '../../../extensionManagement/common/extensionEnablementService.js'; +import { DidUninstallExtensionEvent, IExtensionGalleryService, IExtensionManagementService, IGlobalExtensionEnablementService, InstallExtensionResult } from '../../../extensionManagement/common/extensionManagement.js'; +import { IFileService } from '../../../files/common/files.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { InMemoryFileSystemProvider } from '../../../files/common/inMemoryFilesystemProvider.js'; +import { TestInstantiationService } from '../../../instantiation/test/common/instantiationServiceMock.js'; +import { ILogService, NullLogService } from '../../../log/common/log.js'; +import product from '../../../product/common/product.js'; +import { IProductService } from '../../../product/common/productService.js'; +import { AuthInfo, Credentials, IRequestService } from '../../../request/common/request.js'; +import { InMemoryStorageService, IStorageService } from '../../../storage/common/storage.js'; +import { ITelemetryService } from '../../../telemetry/common/telemetry.js'; +import { NullTelemetryService } from '../../../telemetry/common/telemetryUtils.js'; +import { IUriIdentityService } from '../../../uriIdentity/common/uriIdentity.js'; +import { UriIdentityService } from '../../../uriIdentity/common/uriIdentityService.js'; +import { ExtensionStorageService, IExtensionStorageService } from '../../../extensionManagement/common/extensionStorage.js'; +import { IgnoredExtensionsManagementService, IIgnoredExtensionsManagementService } from '../../common/ignoredExtensions.js'; +import { ALL_SYNC_RESOURCES, getDefaultIgnoredSettings, IUserData, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService, IUserDataSyncUtilService, registerConfiguration, ServerResource, SyncResource, IUserDataSynchroniser, IUserDataResourceManifest, IUserDataCollectionManifest, USER_DATA_SYNC_SCHEME } from '../../common/userDataSync.js'; +import { IUserDataSyncAccountService, UserDataSyncAccountService } from '../../common/userDataSyncAccount.js'; +import { UserDataSyncLocalStoreService } from '../../common/userDataSyncLocalStoreService.js'; +import { IUserDataSyncMachinesService, UserDataSyncMachinesService } from '../../common/userDataSyncMachines.js'; +import { UserDataSyncEnablementService } from '../../common/userDataSyncEnablementService.js'; +import { UserDataSyncService } from '../../common/userDataSyncService.js'; +import { UserDataSyncStoreManagementService, UserDataSyncStoreService } from '../../common/userDataSyncStoreService.js'; +import { InMemoryUserDataProfilesService, IUserDataProfile, IUserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; +import { NullPolicyService } from '../../../policy/common/policy.js'; +import { IUserDataProfileStorageService } from '../../../userDataProfile/common/userDataProfileStorageService.js'; +import { TestUserDataProfileStorageService } from '../../../userDataProfile/test/common/userDataProfileStorageService.test.js'; export class UserDataSyncClient extends Disposable { @@ -189,6 +189,8 @@ export class UserDataSyncTestServer implements IRequestService { constructor(private readonly rateLimit = Number.MAX_SAFE_INTEGER, private readonly retryAfter?: number) { } async resolveProxy(url: string): Promise { return url; } + async lookupAuthorization(authInfo: AuthInfo): Promise { return undefined; } + async lookupKerberosAuthorization(url: string): Promise { return undefined; } async loadCertificates(): Promise { return []; } async request(options: IRequestOptions, token: CancellationToken): Promise { @@ -356,7 +358,7 @@ export class TestUserDataSyncUtilService implements IUserDataSyncUtilService { _serviceBrand: any; - async resolveDefaultIgnoredSettings(): Promise { + async resolveDefaultCoreIgnoredSettings(): Promise { return getDefaultIgnoredSettings(); } diff --git a/src/vs/platform/userDataSync/test/common/userDataSyncService.test.ts b/src/vs/platform/userDataSync/test/common/userDataSyncService.test.ts index a06d711277e..1c41d4884c7 100644 --- a/src/vs/platform/userDataSync/test/common/userDataSyncService.test.ts +++ b/src/vs/platform/userDataSync/test/common/userDataSyncService.test.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { dirname, joinPath } from 'vs/base/common/resources'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IUserDataSyncEnablementService, IUserDataSyncService, SyncResource, SyncStatus } from 'vs/platform/userDataSync/common/userDataSync'; -import { UserDataSyncClient, UserDataSyncTestServer } from 'vs/platform/userDataSync/test/common/userDataSyncClient'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { dirname, joinPath } from '../../../../base/common/resources.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IEnvironmentService } from '../../../environment/common/environment.js'; +import { IFileService } from '../../../files/common/files.js'; +import { IUserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; +import { IUserDataSyncEnablementService, IUserDataSyncService, SyncResource, SyncStatus } from '../../common/userDataSync.js'; +import { UserDataSyncClient, UserDataSyncTestServer } from './userDataSyncClient.js'; suite('UserDataSyncService', () => { diff --git a/src/vs/platform/userDataSync/test/common/userDataSyncStoreService.test.ts b/src/vs/platform/userDataSync/test/common/userDataSyncStoreService.test.ts index 2a69d9d3ebf..4f720f7d231 100644 --- a/src/vs/platform/userDataSync/test/common/userDataSyncStoreService.test.ts +++ b/src/vs/platform/userDataSync/test/common/userDataSyncStoreService.test.ts @@ -4,19 +4,19 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { timeout } from 'vs/base/common/async'; -import { newWriteableBufferStream } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { isWeb } from 'vs/base/common/platform'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { IUserDataSyncStoreService, SyncResource, UserDataSyncErrorCode, UserDataSyncStoreError } from 'vs/platform/userDataSync/common/userDataSync'; -import { RequestsSession, UserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; -import { UserDataSyncClient, UserDataSyncTestServer } from 'vs/platform/userDataSync/test/common/userDataSyncClient'; +import { timeout } from '../../../../base/common/async.js'; +import { newWriteableBufferStream } from '../../../../base/common/buffer.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Event } from '../../../../base/common/event.js'; +import { isWeb } from '../../../../base/common/platform.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { IProductService } from '../../../product/common/productService.js'; +import { IRequestService } from '../../../request/common/request.js'; +import { IUserDataSyncStoreService, SyncResource, UserDataSyncErrorCode, UserDataSyncStoreError } from '../../common/userDataSync.js'; +import { RequestsSession, UserDataSyncStoreService } from '../../common/userDataSyncStoreService.js'; +import { UserDataSyncClient, UserDataSyncTestServer } from './userDataSyncClient.js'; suite('UserDataSyncStoreService', () => { @@ -414,6 +414,8 @@ suite('UserDataSyncRequestsSession', () => { _serviceBrand: undefined, async request() { return { res: { headers: {} }, stream: newWriteableBufferStream() }; }, async resolveProxy() { return undefined; }, + async lookupAuthorization() { return undefined; }, + async lookupKerberosAuthorization() { return undefined; }, async loadCertificates() { return []; } }; diff --git a/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts b/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts index bfa2c0cb42f..ec5ba03f688 100644 --- a/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts +++ b/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts @@ -4,20 +4,21 @@ *--------------------------------------------------------------------------------------------*/ import { BrowserWindow, Details, MessageChannelMain, app, utilityProcess, UtilityProcess as ElectronUtilityProcess, ForkOptions } from 'electron'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Emitter, Event } from 'vs/base/common/event'; -import { ILogService } from 'vs/platform/log/common/log'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { ILogService } from '../../log/common/log.js'; import { StringDecoder } from 'string_decoder'; -import { timeout } from 'vs/base/common/async'; -import { FileAccess } from 'vs/base/common/network'; -import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; -import Severity from 'vs/base/common/severity'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { removeDangerousEnvVariables } from 'vs/base/common/processes'; -import { deepClone } from 'vs/base/common/objects'; -import { isWindows } from 'vs/base/common/platform'; -import { isUNCAccessRestrictionsDisabled, getUNCHostAllowlist } from 'vs/base/node/unc'; +import { timeout } from '../../../base/common/async.js'; +import { FileAccess } from '../../../base/common/network.js'; +import { IWindowsMainService } from '../../windows/electron-main/windows.js'; +import Severity from '../../../base/common/severity.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { removeDangerousEnvVariables } from '../../../base/common/processes.js'; +import { deepClone } from '../../../base/common/objects.js'; +import { isWindows } from '../../../base/common/platform.js'; +import { isUNCAccessRestrictionsDisabled, getUNCHostAllowlist } from '../../../base/node/unc.js'; +import { upcast } from '../../../base/common/types.js'; export interface IUtilityProcessConfiguration { @@ -76,6 +77,13 @@ export interface IUtilityProcessConfiguration { * the V8 sandbox. */ readonly forceAllocationsToV8Sandbox?: boolean; + + /** + * HTTP 401 and 407 requests created via electron:net module + * will be redirected to the main process and can be handled + * via the app#login event. + */ + readonly respondToAuthRequestsFromMainProcess?: boolean; } export interface IWindowUtilityProcessConfiguration extends IUtilityProcessConfiguration { @@ -235,20 +243,25 @@ export class UtilityProcess extends Disposable { const execArgv = this.configuration.execArgv ?? []; const allowLoadingUnsignedLibraries = this.configuration.allowLoadingUnsignedLibraries; const forceAllocationsToV8Sandbox = this.configuration.forceAllocationsToV8Sandbox; + const respondToAuthRequestsFromMainProcess = this.configuration.respondToAuthRequestsFromMainProcess; const stdio = 'pipe'; const env = this.createEnv(configuration); this.log('creating new...', Severity.Info); // Fork utility process - this.process = utilityProcess.fork(modulePath, args, { + this.process = utilityProcess.fork(modulePath, args, upcast({ serviceName, env, execArgv, allowLoadingUnsignedLibraries, forceAllocationsToV8Sandbox, + respondToAuthRequestsFromMainProcess, stdio - } as ForkOptions & { forceAllocationsToV8Sandbox?: Boolean }); + })); // Register to events this.registerListeners(this.process, this.configuration, serviceName); diff --git a/src/vs/platform/utilityProcess/electron-main/utilityProcessWorkerMainService.ts b/src/vs/platform/utilityProcess/electron-main/utilityProcessWorkerMainService.ts index 4888e76a2fe..9ab01b9be15 100644 --- a/src/vs/platform/utilityProcess/electron-main/utilityProcessWorkerMainService.ts +++ b/src/vs/platform/utilityProcess/electron-main/utilityProcessWorkerMainService.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUtilityProcessWorkerCreateConfiguration, IOnDidTerminateUtilityrocessWorkerProcess, IUtilityProcessWorkerConfiguration, IUtilityProcessWorkerProcessExit, IUtilityProcessWorkerService } from 'vs/platform/utilityProcess/common/utilityProcessWorkerService'; -import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; -import { WindowUtilityProcess } from 'vs/platform/utilityProcess/electron-main/utilityProcess'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { hash } from 'vs/base/common/hash'; -import { Event, Emitter } from 'vs/base/common/event'; -import { DeferredPromise } from 'vs/base/common/async'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IUtilityProcessWorkerCreateConfiguration, IOnDidTerminateUtilityrocessWorkerProcess, IUtilityProcessWorkerConfiguration, IUtilityProcessWorkerProcessExit, IUtilityProcessWorkerService } from '../common/utilityProcessWorkerService.js'; +import { IWindowsMainService } from '../../windows/electron-main/windows.js'; +import { WindowUtilityProcess } from './utilityProcess.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { hash } from '../../../base/common/hash.js'; +import { Event, Emitter } from '../../../base/common/event.js'; +import { DeferredPromise } from '../../../base/common/async.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; export const IUtilityProcessWorkerMainService = createDecorator('utilityProcessWorker'); diff --git a/src/vs/platform/webview/common/mimeTypes.ts b/src/vs/platform/webview/common/mimeTypes.ts index 848cc441919..36c950c5d54 100644 --- a/src/vs/platform/webview/common/mimeTypes.ts +++ b/src/vs/platform/webview/common/mimeTypes.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getMediaMime, Mimes } from 'vs/base/common/mime'; -import { extname } from 'vs/base/common/path'; -import { URI } from 'vs/base/common/uri'; +import { getMediaMime, Mimes } from '../../../base/common/mime.js'; +import { extname } from '../../../base/common/path.js'; +import { URI } from '../../../base/common/uri.js'; const webviewMimeTypes = new Map([ ['.svg', 'image/svg+xml'], diff --git a/src/vs/platform/webview/common/webviewManagerService.ts b/src/vs/platform/webview/common/webviewManagerService.ts index 78f44d0e814..ae380e0591c 100644 --- a/src/vs/platform/webview/common/webviewManagerService.ts +++ b/src/vs/platform/webview/common/webviewManagerService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export const IWebviewManagerService = createDecorator('webviewManagerService'); diff --git a/src/vs/platform/webview/common/webviewPortMapping.ts b/src/vs/platform/webview/common/webviewPortMapping.ts index b47339d28fa..7820092be18 100644 --- a/src/vs/platform/webview/common/webviewPortMapping.ts +++ b/src/vs/platform/webview/common/webviewPortMapping.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { IAddress } from 'vs/platform/remote/common/remoteAgentConnection'; -import { extractLocalHostUriMetaDataForPortMapping, ITunnelService, RemoteTunnel } from 'vs/platform/tunnel/common/tunnel'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import { IAddress } from '../../remote/common/remoteAgentConnection.js'; +import { extractLocalHostUriMetaDataForPortMapping, ITunnelService, RemoteTunnel } from '../../tunnel/common/tunnel.js'; export interface IWebviewPortMapping { readonly webviewPort: number; diff --git a/src/vs/platform/webview/electron-main/webviewMainService.ts b/src/vs/platform/webview/electron-main/webviewMainService.ts index 9b51a3a8b37..b7c1a341ed4 100644 --- a/src/vs/platform/webview/electron-main/webviewMainService.ts +++ b/src/vs/platform/webview/electron-main/webviewMainService.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { WebContents, webContents, WebFrameMain } from 'electron'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { FindInFrameOptions, FoundInFrameResult, IWebviewManagerService, WebviewWebContentsId, WebviewWindowId } from 'vs/platform/webview/common/webviewManagerService'; -import { WebviewProtocolProvider } from 'vs/platform/webview/electron-main/webviewProtocolProvider'; -import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { FindInFrameOptions, FoundInFrameResult, IWebviewManagerService, WebviewWebContentsId, WebviewWindowId } from '../common/webviewManagerService.js'; +import { WebviewProtocolProvider } from './webviewProtocolProvider.js'; +import { IWindowsMainService } from '../../windows/electron-main/windows.js'; export class WebviewMainService extends Disposable implements IWebviewManagerService { diff --git a/src/vs/platform/webview/electron-main/webviewProtocolProvider.ts b/src/vs/platform/webview/electron-main/webviewProtocolProvider.ts index fcce77faba4..493bd1b348d 100644 --- a/src/vs/platform/webview/electron-main/webviewProtocolProvider.ts +++ b/src/vs/platform/webview/electron-main/webviewProtocolProvider.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import { protocol } from 'electron'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { AppResourcePath, COI, FileAccess, Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { AppResourcePath, COI, FileAccess, Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; export class WebviewProtocolProvider extends Disposable { diff --git a/src/vs/platform/window/common/window.ts b/src/vs/platform/window/common/window.ts index 5f0d7e7b9dd..16f7745648f 100644 --- a/src/vs/platform/window/common/window.ts +++ b/src/vs/platform/window/common/window.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IStringDictionary } from 'vs/base/common/collections'; -import { PerformanceMark } from 'vs/base/common/performance'; -import { isLinux, isMacintosh, isNative, isWeb, isWindows } from 'vs/base/common/platform'; -import { URI, UriComponents, UriDto } from 'vs/base/common/uri'; -import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEditorOptions } from 'vs/platform/editor/common/editor'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { FileType } from 'vs/platform/files/common/files'; -import { ILoggerResource, LogLevel } from 'vs/platform/log/common/log'; -import { PolicyDefinition, PolicyValue } from 'vs/platform/policy/common/policy'; -import { IPartsSplash } from 'vs/platform/theme/common/themeService'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IAnyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { PerformanceMark } from '../../../base/common/performance.js'; +import { isLinux, isMacintosh, isNative, isWeb } from '../../../base/common/platform.js'; +import { URI, UriComponents, UriDto } from '../../../base/common/uri.js'; +import { ISandboxConfiguration } from '../../../base/parts/sandbox/common/sandboxTypes.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IEditorOptions } from '../../editor/common/editor.js'; +import { NativeParsedArgs } from '../../environment/common/argv.js'; +import { FileType } from '../../files/common/files.js'; +import { ILoggerResource, LogLevel } from '../../log/common/log.js'; +import { PolicyDefinition, PolicyValue } from '../../policy/common/policy.js'; +import { IPartsSplash } from '../../theme/common/themeService.js'; +import { IUserDataProfile } from '../../userDataProfile/common/userDataProfile.js'; +import { IAnyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from '../../workspace/common/workspace.js'; export const WindowMinimumSize = { WIDTH: 400, @@ -160,6 +160,7 @@ export interface IWindowSettings { readonly clickThroughInactive: boolean; readonly newWindowProfile: string; readonly density: IDensitySettings; + readonly experimentalControlOverlay?: boolean; } export interface IDensitySettings { @@ -225,14 +226,21 @@ export function getTitleBarStyle(configurationService: IConfigurationService): T export const DEFAULT_CUSTOM_TITLEBAR_HEIGHT = 35; // includes space for command center export function useWindowControlsOverlay(configurationService: IConfigurationService): boolean { - if (!isWindows || isWeb) { - return false; // only supported on a desktop Windows instance + if (isMacintosh || isWeb) { + return false; // only supported on a Windows/Linux desktop instances } if (hasNativeTitlebar(configurationService)) { return false; // only supported when title bar is custom } + if (isLinux) { + const setting = configurationService.getValue('window.experimentalControlOverlay'); + if (typeof setting === 'boolean') { + return setting; + } + } + // Default to true. return true; } diff --git a/src/vs/platform/window/electron-main/window.ts b/src/vs/platform/window/electron-main/window.ts index b63a6117514..8a861e7f176 100644 --- a/src/vs/platform/window/electron-main/window.ts +++ b/src/vs/platform/window/electron-main/window.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BrowserWindow, Rectangle, screen, WebContents } from 'electron'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ISerializableCommandAction } from 'vs/platform/action/common/action'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { INativeWindowConfiguration } from 'vs/platform/window/common/window'; -import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import electron from 'electron'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { ISerializableCommandAction } from '../../action/common/action.js'; +import { NativeParsedArgs } from '../../environment/common/argv.js'; +import { IUserDataProfile } from '../../userDataProfile/common/userDataProfile.js'; +import { INativeWindowConfiguration } from '../common/window.js'; +import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from '../../workspace/common/workspace.js'; export interface IBaseWindow extends IDisposable { @@ -23,7 +23,7 @@ export interface IBaseWindow extends IDisposable { readonly onDidClose: Event; readonly id: number; - readonly win: BrowserWindow | null; + readonly win: electron.BrowserWindow | null; readonly lastFocusTime: number; focus(options?: { force: boolean }): void; @@ -41,7 +41,7 @@ export interface IBaseWindow extends IDisposable { updateWindowControls(options: { height?: number; backgroundColor?: string; foregroundColor?: string }): void; - matches(webContents: WebContents): boolean; + matches(webContents: electron.WebContents): boolean; } export interface ICodeWindow extends IBaseWindow { @@ -76,7 +76,7 @@ export interface ICodeWindow extends IBaseWindow { close(): void; - getBounds(): Rectangle; + getBounds(): electron.Rectangle; send(channel: string, ...args: any[]): void; sendWhenReady(channel: string, token: CancellationToken, ...args: any[]): void; @@ -158,7 +158,7 @@ export const defaultAuxWindowState = function (): IWindowState { const width = 800; const height = 600; - const workArea = screen.getPrimaryDisplay().workArea; + const workArea = electron.screen.getPrimaryDisplay().workArea; const x = Math.max(workArea.x + (workArea.width / 2) - (width / 2), 0); const y = Math.max(workArea.y + (workArea.height / 2) - (height / 2), 0); diff --git a/src/vs/platform/window/electron-sandbox/window.ts b/src/vs/platform/window/electron-sandbox/window.ts index ab0e479d1a3..1adaa550081 100644 --- a/src/vs/platform/window/electron-sandbox/window.ts +++ b/src/vs/platform/window/electron-sandbox/window.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getZoomLevel, setZoomFactor, setZoomLevel } from 'vs/base/browser/browser'; -import { getActiveWindow, getWindows } from 'vs/base/browser/dom'; -import { mainWindow } from 'vs/base/browser/window'; -import { ISandboxGlobals, ipcRenderer, webFrame } from 'vs/base/parts/sandbox/electron-sandbox/globals'; -import { zoomLevelToZoomFactor } from 'vs/platform/window/common/window'; +import { getZoomLevel, setZoomFactor, setZoomLevel } from '../../../base/browser/browser.js'; +import { getActiveWindow, getWindows } from '../../../base/browser/dom.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { ISandboxGlobals, ipcRenderer, webFrame } from '../../../base/parts/sandbox/electron-sandbox/globals.js'; +import { zoomLevelToZoomFactor } from '../common/window.js'; export enum ApplyZoomTarget { ACTIVE_WINDOW = 1, diff --git a/src/vs/platform/windows/electron-main/windowImpl.ts b/src/vs/platform/windows/electron-main/windowImpl.ts index dcb3a1776ec..ae108b99c3c 100644 --- a/src/vs/platform/windows/electron-main/windowImpl.ts +++ b/src/vs/platform/windows/electron-main/windowImpl.ts @@ -3,47 +3,47 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { app, BrowserWindow, Display, nativeImage, NativeImage, Rectangle, screen, SegmentedControlSegment, systemPreferences, TouchBar, TouchBarSegmentedControl, WebContents, Event as ElectronEvent } from 'electron'; -import { DeferredPromise, RunOnceScheduler, timeout } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { FileAccess, Schemas } from 'vs/base/common/network'; -import { getMarks, mark } from 'vs/base/common/performance'; -import { isBigSurOrNewer, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; +import electron, { BrowserWindowConstructorOptions } from 'electron'; +import { DeferredPromise, RunOnceScheduler, timeout } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { FileAccess, Schemas } from '../../../base/common/network.js'; +import { getMarks, mark } from '../../../base/common/performance.js'; +import { isBigSurOrNewer, isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; import { release } from 'os'; -import { ISerializableCommandAction } from 'vs/platform/action/common/action'; -import { IBackupMainService } from 'vs/platform/backup/electron-main/backup'; -import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMainService'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { isLaunchedFromCli } from 'vs/platform/environment/node/argvHelper'; -import { IFileService } from 'vs/platform/files/common/files'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IProtocolMainService } from 'vs/platform/protocol/electron-main/protocol'; -import { resolveMarketplaceHeaders } from 'vs/platform/externalServices/common/marketplace'; -import { IApplicationStorageMainService, IStorageMainService } from 'vs/platform/storage/electron-main/storageMainService'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IThemeMainService } from 'vs/platform/theme/electron-main/themeMainService'; -import { getMenuBarVisibility, IFolderToOpen, INativeWindowConfiguration, IWindowSettings, IWorkspaceToOpen, MenuBarVisibility, hasNativeTitlebar, useNativeFullScreen, useWindowControlsOverlay, DEFAULT_CUSTOM_TITLEBAR_HEIGHT } from 'vs/platform/window/common/window'; -import { defaultBrowserWindowOptions, IWindowsMainService, OpenContext, WindowStateValidator } from 'vs/platform/windows/electron-main/windows'; -import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, toWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { IWorkspacesManagementMainService } from 'vs/platform/workspaces/electron-main/workspacesManagementMainService'; -import { IWindowState, ICodeWindow, ILoadEvent, WindowMode, WindowError, LoadReason, defaultWindowState, IBaseWindow } from 'vs/platform/window/electron-main/window'; -import { IPolicyService } from 'vs/platform/policy/common/policy'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IStateService } from 'vs/platform/state/node/state'; -import { IUserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile'; -import { ILoggerMainService } from 'vs/platform/log/electron-main/loggerService'; -import { firstOrDefault } from 'vs/base/common/arrays'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { ISerializableCommandAction } from '../../action/common/action.js'; +import { IBackupMainService } from '../../backup/electron-main/backup.js'; +import { IConfigurationChangeEvent, IConfigurationService } from '../../configuration/common/configuration.js'; +import { IDialogMainService } from '../../dialogs/electron-main/dialogMainService.js'; +import { NativeParsedArgs } from '../../environment/common/argv.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { isLaunchedFromCli } from '../../environment/node/argvHelper.js'; +import { IFileService } from '../../files/common/files.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IProtocolMainService } from '../../protocol/electron-main/protocol.js'; +import { resolveMarketplaceHeaders } from '../../externalServices/common/marketplace.js'; +import { IApplicationStorageMainService, IStorageMainService } from '../../storage/electron-main/storageMainService.js'; +import { ITelemetryService } from '../../telemetry/common/telemetry.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { IThemeMainService } from '../../theme/electron-main/themeMainService.js'; +import { getMenuBarVisibility, IFolderToOpen, INativeWindowConfiguration, IWindowSettings, IWorkspaceToOpen, MenuBarVisibility, hasNativeTitlebar, useNativeFullScreen, useWindowControlsOverlay, DEFAULT_CUSTOM_TITLEBAR_HEIGHT, TitlebarStyle } from '../../window/common/window.js'; +import { defaultBrowserWindowOptions, IWindowsMainService, OpenContext, WindowStateValidator } from './windows.js'; +import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, toWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { IWorkspacesManagementMainService } from '../../workspaces/electron-main/workspacesManagementMainService.js'; +import { IWindowState, ICodeWindow, ILoadEvent, WindowMode, WindowError, LoadReason, defaultWindowState, IBaseWindow } from '../../window/electron-main/window.js'; +import { IPolicyService } from '../../policy/common/policy.js'; +import { IUserDataProfile } from '../../userDataProfile/common/userDataProfile.js'; +import { IStateService } from '../../state/node/state.js'; +import { IUserDataProfilesMainService } from '../../userDataProfile/electron-main/userDataProfile.js'; +import { ILoggerMainService } from '../../log/electron-main/loggerService.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { isESM } from '../../../base/common/amd.js'; export interface IWindowCreationOptions { readonly state: IWindowState; @@ -51,7 +51,7 @@ export interface IWindowCreationOptions { readonly isExtensionTestHost?: boolean; } -interface ITouchBarSegment extends SegmentedControlSegment { +interface ITouchBarSegment extends electron.SegmentedControlSegment { readonly id: string; } @@ -111,9 +111,9 @@ export abstract class BaseWindow extends Disposable implements IBaseWindow { protected _lastFocusTime = Date.now(); // window is shown on creation so take current time get lastFocusTime(): number { return this._lastFocusTime; } - protected _win: BrowserWindow | null = null; + protected _win: electron.BrowserWindow | null = null; get win() { return this._win; } - protected setWin(win: BrowserWindow): void { + protected setWin(win: electron.BrowserWindow, options?: BrowserWindowConstructorOptions): void { this._win = win; // Window Events @@ -131,13 +131,13 @@ export abstract class BaseWindow extends Disposable implements IBaseWindow { this._register(Event.fromNodeEventEmitter(this._win, 'leave-full-screen')(() => this._onDidLeaveFullScreen.fire())); // Sheet Offsets - const useCustomTitleStyle = !hasNativeTitlebar(this.configurationService); + const useCustomTitleStyle = !hasNativeTitlebar(this.configurationService, options?.titleBarStyle === 'hidden' ? TitlebarStyle.CUSTOM : undefined /* unknown */); if (isMacintosh && useCustomTitleStyle) { win.setSheetOffset(isBigSurOrNewer(release()) ? 28 : 22); // offset dialogs by the height of the custom title bar if we have any } // Update the window controls immediately based on cached or default values - if (useCustomTitleStyle && ((isWindows && useWindowControlsOverlay(this.configurationService)) || isMacintosh)) { + if (useCustomTitleStyle && (useWindowControlsOverlay(this.configurationService) || isMacintosh)) { const cachedWindowControlHeight = this.stateService.getItem((BaseWindow.windowControlHeightStateStorageKey)); if (cachedWindowControlHeight) { this.updateWindowControls({ height: cachedWindowControlHeight }); @@ -160,7 +160,7 @@ export abstract class BaseWindow extends Disposable implements IBaseWindow { // This sets up a listener for the window hook. This is a Windows-only API provided by electron. win.hookWindowMessage(WM_INITMENU, () => { const [x, y] = win.getPosition(); - const cursorPos = screen.getCursorScreenPoint(); + const cursorPos = electron.screen.getCursorScreenPoint(); const cx = cursorPos.x - x; const cy = cursorPos.y - y; @@ -218,7 +218,7 @@ export abstract class BaseWindow extends Disposable implements IBaseWindow { super(); } - protected applyState(state: IWindowState, hasMultipleDisplays = screen.getAllDisplays().length > 0): void { + protected applyState(state: IWindowState, hasMultipleDisplays = electron.screen.getAllDisplays().length > 0): void { // TODO@electron (Electron 4 regression): when running on multiple displays where the target display // to open the window has a larger resolution than the primary display, the window will not size @@ -232,7 +232,7 @@ export abstract class BaseWindow extends Disposable implements IBaseWindow { const windowSettings = this.configurationService.getValue('window'); const useNativeTabs = isMacintosh && windowSettings?.nativeTabs === true; - if ((isMacintosh || isWindows) && hasMultipleDisplays && (!useNativeTabs || BrowserWindow.getAllWindows().length === 1)) { + if ((isMacintosh || isWindows) && hasMultipleDisplays && (!useNativeTabs || electron.BrowserWindow.getAllWindows().length === 1)) { if ([state.width, state.height, state.x, state.y].every(value => typeof value === 'number')) { this._win?.setBounds({ width: state.width, @@ -299,7 +299,7 @@ export abstract class BaseWindow extends Disposable implements IBaseWindow { focus(options?: { force: boolean }): void { if (isMacintosh && options?.force) { - app.focus({ steal: true }); + electron.app.focus({ steal: true }); } const win = this.win; @@ -322,7 +322,7 @@ export abstract class BaseWindow extends Disposable implements IBaseWindow { // Respect system settings on mac with regards to title click on windows title if (isMacintosh) { - const action = systemPreferences.getUserDefault('AppleActionOnDoubleClick', 'string'); + const action = electron.systemPreferences.getUserDefault('AppleActionOnDoubleClick', 'string'); switch (action) { case 'Minimize': win.minimize(); @@ -366,8 +366,8 @@ export abstract class BaseWindow extends Disposable implements IBaseWindow { this.stateService.setItem((CodeWindow.windowControlHeightStateStorageKey), options.height); } - // Windows: window control overlay (WCO) - if (isWindows && this.hasWindowControlOverlay) { + // Windows/Linux: window control overlay (WCO) + if (this.hasWindowControlOverlay) { win.setTitleBarOverlay({ color: options.backgroundColor?.trim() === '' ? undefined : options.backgroundColor, symbolColor: options.foregroundColor?.trim() === '' ? undefined : options.foregroundColor, @@ -494,7 +494,7 @@ export abstract class BaseWindow extends Disposable implements IBaseWindow { //#endregion - abstract matches(webContents: WebContents): boolean; + abstract matches(webContents: electron.WebContents): boolean; override dispose(): void { super.dispose(); @@ -524,7 +524,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { private _id: number; get id(): number { return this._id; } - protected override _win: BrowserWindow; + protected override _win: electron.BrowserWindow; get backupPath(): string | undefined { return this._config?.backupPath; } @@ -561,7 +561,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { private readonly whenReadyCallbacks: { (window: ICodeWindow): void }[] = []; - private readonly touchBarGroups: TouchBarSegmentedControl[] = []; + private readonly touchBarGroups: electron.TouchBarSegmentedControl[] = []; private currentHttpProxy: string | undefined = undefined; private currentNoProxy: string | undefined = undefined; @@ -604,7 +604,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { this.windowState = state; this.logService.trace('window#ctor: using window state', state); - const options = instantiationService.invokeFunction(defaultBrowserWindowOptions, this.windowState, { + const options = instantiationService.invokeFunction(defaultBrowserWindowOptions, this.windowState, undefined, { preload: FileAccess.asFileUri('vs/base/parts/sandbox/electron-sandbox/preload.js').fsPath, additionalArguments: [`--vscode-window-config=${this.configObjectUrl.resource.toString()}`], v8CacheOptions: this.environmentMainService.useCodeCache ? 'bypassHeatCheck' : 'none', @@ -612,11 +612,11 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { // Create the browser window mark('code/willCreateCodeBrowserWindow'); - this._win = new BrowserWindow(options); + this._win = new electron.BrowserWindow(options); mark('code/didCreateCodeBrowserWindow'); this._id = this._win.id; - this.setWin(this._win); + this.setWin(this._win, options); // Apply some state after window creation this.applyState(this.windowState, hasMultipleDisplays); @@ -693,7 +693,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { // unloading a window that should not be confused // with the DOM way. // (https://github.com/microsoft/vscode/issues/122736) - this._register(Event.fromNodeEventEmitter(this._win.webContents, 'will-prevent-unload')(event => event.preventDefault())); + this._register(Event.fromNodeEventEmitter(this._win.webContents, 'will-prevent-unload')(event => event.preventDefault())); // Remember that we loaded this._register(Event.fromNodeEventEmitter(this._win.webContents, 'did-finish-load')(() => { @@ -914,7 +914,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { } // Delegate to windows service - const window = firstOrDefault(await this.windowsMainService.open({ + const window = (await this.windowsMainService.open({ context: OpenContext.API, userEnv: this._config.userEnv, cli: { @@ -925,7 +925,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { forceEmpty, forceNewWindow: true, remoteAuthority: this.remoteAuthority - })); + })).at(0); window?.focus(); } } finally { @@ -957,16 +957,25 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { } // Proxy - if (!e || e.affectsConfiguration('http.proxy')) { + if (!e || e.affectsConfiguration('http.proxy') || e.affectsConfiguration('http.noProxy')) { let newHttpProxy = (this.configurationService.getValue('http.proxy') || '').trim() || (process.env['https_proxy'] || process.env['HTTPS_PROXY'] || process.env['http_proxy'] || process.env['HTTP_PROXY'] || '').trim() // Not standardized. || undefined; + if (newHttpProxy?.indexOf('@') !== -1) { + const uri = URI.parse(newHttpProxy!); + const i = uri.authority.indexOf('@'); + if (i !== -1) { + newHttpProxy = uri.with({ authority: uri.authority.substring(i + 1) }) + .toString(); + } + } if (newHttpProxy?.endsWith('/')) { newHttpProxy = newHttpProxy.substr(0, newHttpProxy.length - 1); } - const newNoProxy = (process.env['no_proxy'] || process.env['NO_PROXY'] || '').trim() || undefined; // Not standardized. + const newNoProxy = (this.configurationService.getValue('http.noProxy') || []).map((item) => item.trim()).join(',') + || (process.env['no_proxy'] || process.env['NO_PROXY'] || '').trim() || undefined; // Not standardized. if ((newHttpProxy || '').indexOf('@') === -1 && (newHttpProxy !== this.currentHttpProxy || newNoProxy !== this.currentNoProxy)) { this.currentHttpProxy = newHttpProxy; this.currentNoProxy = newNoProxy; @@ -975,13 +984,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { const proxyBypassRules = newNoProxy ? `${newNoProxy},` : ''; this.logService.trace(`Setting proxy to '${proxyRules}', bypassing '${proxyBypassRules}'`); this._win.webContents.session.setProxy({ proxyRules, proxyBypassRules, pacScript: '' }); - type appWithProxySupport = Electron.App & { - setProxy(config: Electron.Config): Promise; - resolveProxy(url: string): Promise; - }; - if (typeof (app as appWithProxySupport).setProxy === 'function') { - (app as appWithProxySupport).setProxy({ proxyRules, proxyBypassRules, pacScript: '' }); - } + electron.app.setProxy({ proxyRules, proxyBypassRules, pacScript: '' }); } } } @@ -1033,7 +1036,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { this.readyState = ReadyState.NAVIGATING; // Load URL - this._win.loadURL(FileAccess.asBrowserUri(`vs/code/electron-sandbox/workbench/workbench${this.environmentMainService.isBuilt ? '' : '-dev'}.html`).toString(true)); + this._win.loadURL(FileAccess.asBrowserUri(`vs/code/electron-sandbox/workbench/workbench${this.environmentMainService.isBuilt ? '' : '-dev'}.${isESM ? 'esm.' : ''}html`).toString(true)); // Remember that we did load const wasLoaded = this.wasLoaded; @@ -1132,7 +1135,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { configuration['extensions-dir'] = cli['extensions-dir']; } - configuration.accessibilitySupport = app.isAccessibilitySupportEnabled(); + configuration.accessibilitySupport = electron.app.isAccessibilitySupportEnabled(); configuration.isInitialStartup = false; // since this is a reload configuration.policiesData = this.policyService.serialize(); // set policies data again configuration.continueOn = this.environmentMainService.continueOn; @@ -1186,9 +1189,9 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { // fullscreen gets special treatment if (this.isFullScreen) { - let display: Display | undefined; + let display: electron.Display | undefined; try { - display = screen.getDisplayMatching(this.getBounds()); + display = electron.screen.getDisplayMatching(this.getBounds()); } catch (error) { // Electron has weird conditions under which it throws errors // e.g. https://github.com/microsoft/vscode/issues/100334 when @@ -1233,7 +1236,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { // only consider non-minimized window states if (mode === WindowMode.Normal || mode === WindowMode.Maximized) { - let bounds: Rectangle; + let bounds: electron.Rectangle; if (mode === WindowMode.Normal) { bounds = this.getBounds(); } else { @@ -1262,7 +1265,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { // Window dimensions try { - const displays = screen.getAllDisplays(); + const displays = electron.screen.getAllDisplays(); hasMultipleDisplays = displays.length > 1; state = WindowStateValidator.validateWindowState(this.logService, state, displays); @@ -1276,7 +1279,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { return [state || defaultWindowState(), hasMultipleDisplays]; } - getBounds(): Rectangle { + getBounds(): electron.Rectangle { const [x, y] = this._win.getPosition(); const [width, height] = this._win.getSize(); @@ -1425,16 +1428,16 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { this.touchBarGroups.push(groupTouchBar); } - this._win.setTouchBar(new TouchBar({ items: this.touchBarGroups })); + this._win.setTouchBar(new electron.TouchBar({ items: this.touchBarGroups })); } - private createTouchBarGroup(items: ISerializableCommandAction[] = []): TouchBarSegmentedControl { + private createTouchBarGroup(items: ISerializableCommandAction[] = []): electron.TouchBarSegmentedControl { // Group Segments const segments = this.createTouchBarGroupSegments(items); // Group Control - const control = new TouchBar.TouchBarSegmentedControl({ + const control = new electron.TouchBar.TouchBarSegmentedControl({ segments, mode: 'buttons', segmentStyle: 'automatic', @@ -1448,9 +1451,9 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { private createTouchBarGroupSegments(items: ISerializableCommandAction[] = []): ITouchBarSegment[] { const segments: ITouchBarSegment[] = items.map(item => { - let icon: NativeImage | undefined; + let icon: electron.NativeImage | undefined; if (item.icon && !ThemeIcon.isThemeIcon(item.icon) && item.icon?.dark?.scheme === Schemas.file) { - icon = nativeImage.createFromPath(URI.revive(item.icon.dark).fsPath); + icon = electron.nativeImage.createFromPath(URI.revive(item.icon.dark).fsPath); if (icon.isEmpty()) { icon = undefined; } @@ -1473,7 +1476,7 @@ export class CodeWindow extends BaseWindow implements ICodeWindow { return segments; } - matches(webContents: WebContents): boolean { + matches(webContents: electron.WebContents): boolean { return this._win?.webContents.id === webContents.id; } diff --git a/src/vs/platform/windows/electron-main/windows.ts b/src/vs/platform/windows/electron-main/windows.ts index abfc98bc2a3..dd5148103bd 100644 --- a/src/vs/platform/windows/electron-main/windows.ts +++ b/src/vs/platform/windows/electron-main/windows.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BrowserWindowConstructorOptions, Display, Rectangle, WebContents, WebPreferences, screen } from 'electron'; -import { Event } from 'vs/base/common/event'; -import { IProcessEnvironment, isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { ServicesAccessor, createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ICodeWindow, IWindowState, WindowMode, defaultWindowState } from 'vs/platform/window/electron-main/window'; -import { IOpenEmptyWindowOptions, IWindowOpenable, IWindowSettings, WindowMinimumSize, hasNativeTitlebar, useNativeFullScreen, useWindowControlsOverlay, zoomLevelToZoomFactor } from 'vs/platform/window/common/window'; -import { IThemeMainService } from 'vs/platform/theme/electron-main/themeMainService'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { join } from 'vs/base/common/path'; -import { IAuxiliaryWindow } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow'; -import { Color } from 'vs/base/common/color'; -import { ILogService } from 'vs/platform/log/common/log'; +import electron from 'electron'; +import { Color } from '../../../base/common/color.js'; +import { Event } from '../../../base/common/event.js'; +import { join } from '../../../base/common/path.js'; +import { IProcessEnvironment, isLinux, isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { URI } from '../../../base/common/uri.js'; +import { IAuxiliaryWindow } from '../../auxiliaryWindow/electron-main/auxiliaryWindow.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { NativeParsedArgs } from '../../environment/common/argv.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { ServicesAccessor, createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IProductService } from '../../product/common/productService.js'; +import { IThemeMainService } from '../../theme/electron-main/themeMainService.js'; +import { IOpenEmptyWindowOptions, IWindowOpenable, IWindowSettings, TitlebarStyle, WindowMinimumSize, hasNativeTitlebar, useNativeFullScreen, useWindowControlsOverlay, zoomLevelToZoomFactor } from '../../window/common/window.js'; +import { ICodeWindow, IWindowState, WindowMode, defaultWindowState } from '../../window/electron-main/window.js'; export const IWindowsMainService = createDecorator('windowsMainService'); @@ -53,7 +53,7 @@ export interface IWindowsMainService { getLastActiveWindow(): ICodeWindow | undefined; getWindowById(windowId: number): ICodeWindow | undefined; - getWindowByWebContents(webContents: WebContents): ICodeWindow | undefined; + getWindowByWebContents(webContents: electron.WebContents): ICodeWindow | undefined; } export interface IWindowsCountChangedEvent { @@ -79,7 +79,10 @@ export const enum OpenContext { DESKTOP, // opening through the API - API + API, + + // opening from a protocol link + LINK } export interface IBaseOpenConfiguration { @@ -115,7 +118,12 @@ export interface IOpenConfiguration extends IBaseOpenConfiguration { export interface IOpenEmptyConfiguration extends IBaseOpenConfiguration { } -export function defaultBrowserWindowOptions(accessor: ServicesAccessor, windowState: IWindowState, webPreferences?: WebPreferences): BrowserWindowConstructorOptions & { experimentalDarkMode: boolean } { +export interface IDefaultBrowserWindowOptionsOverrides { + forceNativeTitlebar?: boolean; + disableFullscreen?: boolean; +} + +export function defaultBrowserWindowOptions(accessor: ServicesAccessor, windowState: IWindowState, overrides?: IDefaultBrowserWindowOptionsOverrides, webPreferences?: electron.WebPreferences): electron.BrowserWindowConstructorOptions & { experimentalDarkMode: boolean } { const themeMainService = accessor.get(IThemeMainService); const productService = accessor.get(IProductService); const configurationService = accessor.get(IConfigurationService); @@ -123,7 +131,7 @@ export function defaultBrowserWindowOptions(accessor: ServicesAccessor, windowSt const windowSettings = configurationService.getValue('window'); - const options: BrowserWindowConstructorOptions & { experimentalDarkMode: boolean } = { + const options: electron.BrowserWindowConstructorOptions & { experimentalDarkMode: boolean } = { backgroundColor: themeMainService.getBackgroundColor(), minWidth: WindowMinimumSize.WIDTH, minHeight: WindowMinimumSize.HEIGHT, @@ -161,7 +169,9 @@ export function defaultBrowserWindowOptions(accessor: ServicesAccessor, windowSt } } - if (isMacintosh && !useNativeFullScreen(configurationService)) { + if (overrides?.disableFullscreen) { + options.fullscreen = false; + } else if (isMacintosh && !useNativeFullScreen(configurationService)) { options.fullscreenable = false; // enables simple fullscreen mode } @@ -170,7 +180,7 @@ export function defaultBrowserWindowOptions(accessor: ServicesAccessor, windowSt options.tabbingIdentifier = productService.nameShort; // this opts in to sierra tabs } - const hideNativeTitleBar = !hasNativeTitlebar(configurationService); + const hideNativeTitleBar = !hasNativeTitlebar(configurationService, overrides?.forceNativeTitlebar ? TitlebarStyle.NATIVE : undefined); if (hideNativeTitleBar) { options.titleBarStyle = 'hidden'; if (!isMacintosh) { @@ -215,7 +225,7 @@ export function getLastFocused(windows: ICodeWindow[] | IAuxiliaryWindow[]): ICo export namespace WindowStateValidator { - export function validateWindowState(logService: ILogService, state: IWindowState, displays = screen.getAllDisplays()): IWindowState | undefined { + export function validateWindowState(logService: ILogService, state: IWindowState, displays = electron.screen.getAllDisplays()): IWindowState | undefined { logService.trace(`window#validateWindowState: validating window state on ${displays.length} display(s)`, state); if ( @@ -313,10 +323,10 @@ export namespace WindowStateValidator { } // Multi Monitor (non-fullscreen): ensure window is within display bounds - let display: Display | undefined; - let displayWorkingArea: Rectangle | undefined; + let display: electron.Display | undefined; + let displayWorkingArea: electron.Rectangle | undefined; try { - display = screen.getDisplayMatching({ x: state.x, y: state.y, width: state.width, height: state.height }); + display = electron.screen.getDisplayMatching({ x: state.x, y: state.y, width: state.width, height: state.height }); displayWorkingArea = getWorkingArea(display); logService.trace('window#validateWindowState: multi-monitor working area', displayWorkingArea); @@ -343,7 +353,7 @@ export namespace WindowStateValidator { return undefined; } - function getWorkingArea(display: Display): Rectangle | undefined { + function getWorkingArea(display: electron.Display): electron.Rectangle | undefined { // Prefer the working area of the display to account for taskbars on the // desktop being positioned somewhere (https://github.com/microsoft/vscode/issues/50830). diff --git a/src/vs/platform/windows/electron-main/windowsFinder.ts b/src/vs/platform/windows/electron-main/windowsFinder.ts index c8d34be7505..1fc60b13554 100644 --- a/src/vs/platform/windows/electron-main/windowsFinder.ts +++ b/src/vs/platform/windows/electron-main/windowsFinder.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { ICodeWindow } from 'vs/platform/window/electron-main/window'; -import { IResolvedWorkspace, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { extUriBiasedIgnorePathCase } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { ICodeWindow } from '../../window/electron-main/window.js'; +import { IResolvedWorkspace, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IWorkspaceIdentifier } from '../../workspace/common/workspace.js'; export async function findWindowOnFile(windows: ICodeWindow[], fileUri: URI, localWorkspaceResolver: (workspace: IWorkspaceIdentifier) => Promise): Promise { diff --git a/src/vs/platform/windows/electron-main/windowsMainService.ts b/src/vs/platform/windows/electron-main/windowsMainService.ts index fd704a5cfe6..425cd45499e 100644 --- a/src/vs/platform/windows/electron-main/windowsMainService.ts +++ b/src/vs/platform/windows/electron-main/windowsMainService.ts @@ -3,59 +3,60 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'fs'; import { app, BrowserWindow, WebContents, shell } from 'electron'; -import { Promises } from 'vs/base/node/pfs'; -import { addUNCHostToAllowlist } from 'vs/base/node/unc'; +import { addUNCHostToAllowlist } from '../../../base/node/unc.js'; import { hostname, release, arch } from 'os'; -import { coalesce, distinct } from 'vs/base/common/arrays'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { CharCode } from 'vs/base/common/charCode'; -import { Emitter, Event } from 'vs/base/common/event'; -import { isWindowsDriveLetter, parseLineAndColumnAware, sanitizeFilePath, toSlashes } from 'vs/base/common/extpath'; -import { getPathLabel } from 'vs/base/common/labels'; -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { basename, join, normalize, posix } from 'vs/base/common/path'; -import { getMarks, mark } from 'vs/base/common/performance'; -import { IProcessEnvironment, isMacintosh, isWindows, OS } from 'vs/base/common/platform'; -import { cwd } from 'vs/base/common/process'; -import { extUriBiasedIgnorePathCase, isEqualAuthority, normalizePath, originalFSPath, removeTrailingPathSeparator } from 'vs/base/common/resources'; -import { assertIsDefined } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { IBackupMainService } from 'vs/platform/backup/electron-main/backup'; -import { IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMainService'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { FileType, IFileService } from 'vs/platform/files/common/files'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import product from 'vs/platform/product/common/product'; -import { IProtocolMainService } from 'vs/platform/protocol/electron-main/protocol'; -import { getRemoteAuthority } from 'vs/platform/remote/common/remoteHosts'; -import { IStateService } from 'vs/platform/state/node/state'; -import { IAddFoldersRequest, INativeOpenFileRequest, INativeWindowConfiguration, IOpenEmptyWindowOptions, IPath, IPathsToWaitFor, isFileToOpen, isFolderToOpen, isWorkspaceToOpen, IWindowOpenable, IWindowSettings } from 'vs/platform/window/common/window'; -import { CodeWindow } from 'vs/platform/windows/electron-main/windowImpl'; -import { IOpenConfiguration, IOpenEmptyConfiguration, IWindowsCountChangedEvent, IWindowsMainService, OpenContext, getLastFocused } from 'vs/platform/windows/electron-main/windows'; -import { findWindowOnExtensionDevelopmentPath, findWindowOnFile, findWindowOnWorkspaceOrFolder } from 'vs/platform/windows/electron-main/windowsFinder'; -import { IWindowState, WindowsStateHandler } from 'vs/platform/windows/electron-main/windowsStateHandler'; -import { IRecent } from 'vs/platform/workspaces/common/workspaces'; -import { hasWorkspaceFileExtension, IAnyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IWorkspaceIdentifier, toWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { createEmptyWorkspaceIdentifier, getSingleFolderWorkspaceIdentifier, getWorkspaceIdentifier } from 'vs/platform/workspaces/node/workspaces'; -import { IWorkspacesHistoryMainService } from 'vs/platform/workspaces/electron-main/workspacesHistoryMainService'; -import { IWorkspacesManagementMainService } from 'vs/platform/workspaces/electron-main/workspacesManagementMainService'; -import { ICodeWindow, UnloadReason } from 'vs/platform/window/electron-main/window'; -import { IThemeMainService } from 'vs/platform/theme/electron-main/themeMainService'; -import { IEditorOptions, ITextEditorOptions } from 'vs/platform/editor/common/editor'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IPolicyService } from 'vs/platform/policy/common/policy'; -import { IUserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile'; -import { ILoggerMainService } from 'vs/platform/log/electron-main/loggerService'; -import { IAuxiliaryWindowsMainService } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindows'; -import { IAuxiliaryWindow } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow'; +import { coalesce, distinct } from '../../../base/common/arrays.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { CharCode } from '../../../base/common/charCode.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { isWindowsDriveLetter, parseLineAndColumnAware, sanitizeFilePath, toSlashes } from '../../../base/common/extpath.js'; +import { getPathLabel } from '../../../base/common/labels.js'; +import { Disposable, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { basename, join, normalize, posix } from '../../../base/common/path.js'; +import { getMarks, mark } from '../../../base/common/performance.js'; +import { IProcessEnvironment, isMacintosh, isWindows, OS } from '../../../base/common/platform.js'; +import { cwd } from '../../../base/common/process.js'; +import { extUriBiasedIgnorePathCase, isEqualAuthority, normalizePath, originalFSPath, removeTrailingPathSeparator } from '../../../base/common/resources.js'; +import { assertIsDefined } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { getNLSLanguage, getNLSMessages, localize } from '../../../nls.js'; +import { IBackupMainService } from '../../backup/electron-main/backup.js'; +import { IEmptyWindowBackupInfo } from '../../backup/node/backup.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { IDialogMainService } from '../../dialogs/electron-main/dialogMainService.js'; +import { NativeParsedArgs } from '../../environment/common/argv.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { FileType, IFileService } from '../../files/common/files.js'; +import { IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import product from '../../product/common/product.js'; +import { IProtocolMainService } from '../../protocol/electron-main/protocol.js'; +import { getRemoteAuthority } from '../../remote/common/remoteHosts.js'; +import { IStateService } from '../../state/node/state.js'; +import { IAddFoldersRequest, INativeOpenFileRequest, INativeWindowConfiguration, IOpenEmptyWindowOptions, IPath, IPathsToWaitFor, isFileToOpen, isFolderToOpen, isWorkspaceToOpen, IWindowOpenable, IWindowSettings } from '../../window/common/window.js'; +import { CodeWindow } from './windowImpl.js'; +import { IOpenConfiguration, IOpenEmptyConfiguration, IWindowsCountChangedEvent, IWindowsMainService, OpenContext, getLastFocused } from './windows.js'; +import { findWindowOnExtensionDevelopmentPath, findWindowOnFile, findWindowOnWorkspaceOrFolder } from './windowsFinder.js'; +import { IWindowState, WindowsStateHandler } from './windowsStateHandler.js'; +import { IRecent } from '../../workspaces/common/workspaces.js'; +import { hasWorkspaceFileExtension, IAnyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IWorkspaceIdentifier, toWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { createEmptyWorkspaceIdentifier, getSingleFolderWorkspaceIdentifier, getWorkspaceIdentifier } from '../../workspaces/node/workspaces.js'; +import { IWorkspacesHistoryMainService } from '../../workspaces/electron-main/workspacesHistoryMainService.js'; +import { IWorkspacesManagementMainService } from '../../workspaces/electron-main/workspacesManagementMainService.js'; +import { ICodeWindow, UnloadReason } from '../../window/electron-main/window.js'; +import { IThemeMainService } from '../../theme/electron-main/themeMainService.js'; +import { IEditorOptions, ITextEditorOptions } from '../../editor/common/editor.js'; +import { IUserDataProfile } from '../../userDataProfile/common/userDataProfile.js'; +import { IPolicyService } from '../../policy/common/policy.js'; +import { IUserDataProfilesMainService } from '../../userDataProfile/electron-main/userDataProfile.js'; +import { ILoggerMainService } from '../../log/electron-main/loggerService.js'; +import { IAuxiliaryWindowsMainService } from '../../auxiliaryWindow/electron-main/auxiliaryWindows.js'; +import { IAuxiliaryWindow } from '../../auxiliaryWindow/electron-main/auxiliaryWindow.js'; +import { ICSSDevelopmentService } from '../../cssDev/node/cssDevService.js'; //#region Helper Interfaces @@ -229,7 +230,8 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic @IFileService private readonly fileService: IFileService, @IProtocolMainService private readonly protocolMainService: IProtocolMainService, @IThemeMainService private readonly themeMainService: IThemeMainService, - @IAuxiliaryWindowsMainService private readonly auxiliaryWindowsMainService: IAuxiliaryWindowsMainService + @IAuxiliaryWindowsMainService private readonly auxiliaryWindowsMainService: IAuxiliaryWindowsMainService, + @ICSSDevelopmentService private readonly cssDevelopmentService: ICSSDevelopmentService ) { super(); @@ -297,7 +299,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic const emptyWindowsWithBackupsToRestore: IEmptyWindowBackupInfo[] = []; let filesToOpen: IFilesToOpen | undefined; - let emptyToOpen = 0; + let openOneEmptyWindow = false; // Identify things to open from open config const pathsToOpen = await this.getPathsToOpen(openConfig); @@ -321,7 +323,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic } else if (path.backupPath) { emptyWindowsWithBackupsToRestore.push({ backupFolder: basename(path.backupPath), remoteAuthority: path.remoteAuthority }); } else { - emptyToOpen++; + openOneEmptyWindow = true; } } @@ -357,9 +359,9 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic } // Open based on config - const { windows: usedWindows, filesOpenedInWindow } = await this.doOpen(openConfig, workspacesToOpen, foldersToOpen, emptyWindowsWithBackupsToRestore, emptyToOpen, filesToOpen, foldersToAdd); + const { windows: usedWindows, filesOpenedInWindow } = await this.doOpen(openConfig, workspacesToOpen, foldersToOpen, emptyWindowsWithBackupsToRestore, openOneEmptyWindow, filesToOpen, foldersToAdd); - this.logService.trace(`windowsManager#open used window count ${usedWindows.length} (workspacesToOpen: ${workspacesToOpen.length}, foldersToOpen: ${foldersToOpen.length}, emptyToRestore: ${emptyWindowsWithBackupsToRestore.length}, emptyToOpen: ${emptyToOpen})`); + this.logService.trace(`windowsManager#open used window count ${usedWindows.length} (workspacesToOpen: ${workspacesToOpen.length}, foldersToOpen: ${foldersToOpen.length}, emptyToRestore: ${emptyWindowsWithBackupsToRestore.length}, openOneEmptyWindow: ${openOneEmptyWindow})`); // Make sure to pass focus to the most relevant of the windows if we open multiple if (usedWindows.length > 1) { @@ -458,7 +460,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic workspacesToOpen: IWorkspacePathToOpen[], foldersToOpen: ISingleFolderWorkspacePathToOpen[], emptyToRestore: IEmptyWindowBackupInfo[], - emptyToOpen: number, + openOneEmptyWindow: boolean, filesToOpen: IFilesToOpen | undefined, foldersToAdd: ISingleFolderWorkspacePathToOpen[] ): Promise<{ windows: ICodeWindow[]; filesOpenedInWindow: ICodeWindow | undefined }> { @@ -506,7 +508,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic // this step. let windowToUseForFiles: ICodeWindow | undefined = undefined; if (fileToCheck?.fileUri && !openFilesInNewWindow) { - if (openConfig.context === OpenContext.DESKTOP || openConfig.context === OpenContext.CLI || openConfig.context === OpenContext.DOCK) { + if (openConfig.context === OpenContext.DESKTOP || openConfig.context === OpenContext.CLI || openConfig.context === OpenContext.DOCK || openConfig.context === OpenContext.LINK) { windowToUseForFiles = await findWindowOnFile(windows, fileToCheck.fileUri, async workspace => workspace.configPath.scheme === Schemas.file ? this.workspacesManagementMainService.resolveLocalWorkspace(workspace.configPath) : undefined); } @@ -627,20 +629,11 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic } } - // Handle empty to open (only if no other window opened) - if (usedWindows.length === 0 || filesToOpen) { - if (filesToOpen && !emptyToOpen) { - emptyToOpen++; - } - + // Open empty window either if enforced or when files still have to open + if (filesToOpen || openOneEmptyWindow) { const remoteAuthority = filesToOpen ? filesToOpen.remoteAuthority : openConfig.remoteAuthority; - for (let i = 0; i < emptyToOpen; i++) { - addUsedWindow(await this.doOpenEmpty(openConfig, openFolderInNewWindow, remoteAuthority, filesToOpen), !!filesToOpen); - - // any other window to open must open in new window then - openFolderInNewWindow = true; - } + addUsedWindow(await this.doOpenEmpty(openConfig, openFolderInNewWindow, remoteAuthority, filesToOpen), !!filesToOpen); } return { windows: distinct(usedWindows), filesOpenedInWindow }; @@ -1057,7 +1050,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic path = sanitizeFilePath(normalize(path), cwd()); try { - const pathStat = await Promises.stat(path); + const pathStat = await fs.promises.stat(path); // File if (pathStat.isFile()) { @@ -1444,6 +1437,11 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic workspace: options.workspace, userEnv: { ...this.initialUserEnv, ...options.userEnv }, + nls: { + messages: getNLSMessages(), + language: getNLSLanguage() + }, + filesToOpenOrCreate: options.filesToOpen?.filesToOpenOrCreate, filesToDiff: options.filesToOpen?.filesToDiff, filesToMerge: options.filesToOpen?.filesToMerge, @@ -1466,7 +1464,9 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic accessibilitySupport: app.accessibilitySupportEnabled, colorScheme: this.themeMainService.getColorScheme(), policiesData: this.policyService.serialize(), - continueOn: this.environmentMainService.continueOn + continueOn: this.environmentMainService.continueOn, + + cssModules: this.cssDevelopmentService.isEnabled ? await this.cssDevelopmentService.getCssModules() : undefined }; // New window diff --git a/src/vs/platform/windows/electron-main/windowsStateHandler.ts b/src/vs/platform/windows/electron-main/windowsStateHandler.ts index dcbec3407c4..bd14cdbe3f4 100644 --- a/src/vs/platform/windows/electron-main/windowsStateHandler.ts +++ b/src/vs/platform/windows/electron-main/windowsStateHandler.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { app, Display, screen } from 'electron'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { isMacintosh } from 'vs/base/common/platform'; -import { extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IStateService } from 'vs/platform/state/node/state'; -import { INativeWindowConfiguration, IWindowSettings } from 'vs/platform/window/common/window'; -import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; -import { defaultWindowState, ICodeWindow, IWindowState as IWindowUIState, WindowMode } from 'vs/platform/window/electron-main/window'; -import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import electron from 'electron'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { isMacintosh } from '../../../base/common/platform.js'; +import { extUriBiasedIgnorePathCase } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../configuration/common/configuration.js'; +import { ILifecycleMainService } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { IStateService } from '../../state/node/state.js'; +import { INativeWindowConfiguration, IWindowSettings } from '../../window/common/window.js'; +import { IWindowsMainService } from './windows.js'; +import { defaultWindowState, ICodeWindow, IWindowState as IWindowUIState, WindowMode } from '../../window/electron-main/window.js'; +import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IWorkspaceIdentifier } from '../../workspace/common/workspace.js'; export interface IWindowState { readonly windowId?: number; @@ -78,7 +78,7 @@ export class WindowsStateHandler extends Disposable { // When a window looses focus, save all windows state. This allows to // prevent loss of window-state data when OS is restarted without properly // shutting down the application (https://github.com/microsoft/vscode/issues/87171) - app.on('browser-window-blur', () => { + electron.app.on('browser-window-blur', () => { if (!this.shuttingDown) { this.saveWindowsState(); } @@ -339,8 +339,8 @@ export class WindowsStateHandler extends Disposable { // // We want the new window to open on the same display that the last active one is in - let displayToUse: Display | undefined; - const displays = screen.getAllDisplays(); + let displayToUse: electron.Display | undefined; + const displays = electron.screen.getAllDisplays(); // Single Display if (displays.length === 1) { @@ -352,18 +352,18 @@ export class WindowsStateHandler extends Disposable { // on mac there is 1 menu per window so we need to use the monitor where the cursor currently is if (isMacintosh) { - const cursorPoint = screen.getCursorScreenPoint(); - displayToUse = screen.getDisplayNearestPoint(cursorPoint); + const cursorPoint = electron.screen.getCursorScreenPoint(); + displayToUse = electron.screen.getDisplayNearestPoint(cursorPoint); } // if we have a last active window, use that display for the new window if (!displayToUse && lastActive) { - displayToUse = screen.getDisplayMatching(lastActive.getBounds()); + displayToUse = electron.screen.getDisplayMatching(lastActive.getBounds()); } // fallback to primary display or first display if (!displayToUse) { - displayToUse = screen.getPrimaryDisplay() || displays[0]; + displayToUse = electron.screen.getPrimaryDisplay() || displays[0]; } } diff --git a/src/vs/platform/windows/node/windowTracker.ts b/src/vs/platform/windows/node/windowTracker.ts index cc0abcbd24f..6c2306a4280 100644 --- a/src/vs/platform/windows/node/windowTracker.ts +++ b/src/vs/platform/windows/node/windowTracker.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; -import { Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; +import { CancelablePromise, createCancelablePromise } from '../../../base/common/async.js'; +import { Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; export class ActiveWindowManager extends Disposable { diff --git a/src/vs/platform/windows/test/electron-main/windowsFinder.test.ts b/src/vs/platform/windows/test/electron-main/windowsFinder.test.ts index f3ce84f9c7a..98973497b19 100644 --- a/src/vs/platform/windows/test/electron-main/windowsFinder.test.ts +++ b/src/vs/platform/windows/test/electron-main/windowsFinder.test.ts @@ -4,20 +4,20 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { join } from 'vs/base/common/path'; -import { extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { URI, UriDto } from 'vs/base/common/uri'; -import { ICommandAction } from 'vs/platform/action/common/action'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { INativeWindowConfiguration } from 'vs/platform/window/common/window'; -import { ICodeWindow, ILoadEvent, IWindowState } from 'vs/platform/window/electron-main/window'; -import { findWindowOnFile } from 'vs/platform/windows/electron-main/windowsFinder'; -import { toWorkspaceFolders } from 'vs/platform/workspaces/common/workspaces'; -import { IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { FileAccess } from 'vs/base/common/network'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { Event } from '../../../../base/common/event.js'; +import { join } from '../../../../base/common/path.js'; +import { extUriBiasedIgnorePathCase } from '../../../../base/common/resources.js'; +import { URI, UriDto } from '../../../../base/common/uri.js'; +import { ICommandAction } from '../../../action/common/action.js'; +import { NativeParsedArgs } from '../../../environment/common/argv.js'; +import { INativeWindowConfiguration } from '../../../window/common/window.js'; +import { ICodeWindow, ILoadEvent, IWindowState } from '../../../window/electron-main/window.js'; +import { findWindowOnFile } from '../../electron-main/windowsFinder.js'; +import { toWorkspaceFolders } from '../../../workspaces/common/workspaces.js'; +import { IWorkspaceIdentifier } from '../../../workspace/common/workspace.js'; +import { FileAccess } from '../../../../base/common/network.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('WindowsFinder', () => { diff --git a/src/vs/platform/windows/test/electron-main/windowsStateHandler.test.ts b/src/vs/platform/windows/test/electron-main/windowsStateHandler.test.ts index 65d1a9937f9..a1ed6bd2794 100644 --- a/src/vs/platform/windows/test/electron-main/windowsStateHandler.test.ts +++ b/src/vs/platform/windows/test/electron-main/windowsStateHandler.test.ts @@ -5,12 +5,12 @@ import assert from 'assert'; import { tmpdir } from 'os'; -import { join } from 'vs/base/common/path'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IWindowState as IWindowUIState, WindowMode } from 'vs/platform/window/electron-main/window'; -import { getWindowsStateStoreData, IWindowsState, IWindowState, restoreWindowsState } from 'vs/platform/windows/electron-main/windowsStateHandler'; -import { IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { join } from '../../../../base/common/path.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IWindowState as IWindowUIState, WindowMode } from '../../../window/electron-main/window.js'; +import { getWindowsStateStoreData, IWindowsState, IWindowState, restoreWindowsState } from '../../electron-main/windowsStateHandler.js'; +import { IWorkspaceIdentifier } from '../../../workspace/common/workspace.js'; suite('Windows State Storing', () => { diff --git a/src/vs/platform/workspace/common/canonicalUri.ts b/src/vs/platform/workspace/common/canonicalUri.ts index 11196429b0b..f34a1478539 100644 --- a/src/vs/platform/workspace/common/canonicalUri.ts +++ b/src/vs/platform/workspace/common/canonicalUri.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export interface ICanonicalUriProvider { readonly scheme: string; diff --git a/src/vs/platform/workspace/common/editSessions.ts b/src/vs/platform/workspace/common/editSessions.ts index 1eb989cda89..a80e6d095aa 100644 --- a/src/vs/platform/workspace/common/editSessions.ts +++ b/src/vs/platform/workspace/common/editSessions.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IWorkspaceFolder } from './workspace.js'; export interface IEditSessionIdentityProvider { readonly scheme: string; diff --git a/src/vs/platform/workspace/common/virtualWorkspace.ts b/src/vs/platform/workspace/common/virtualWorkspace.ts index 6161b9215cb..e4321bf56fb 100644 --- a/src/vs/platform/workspace/common/virtualWorkspace.ts +++ b/src/vs/platform/workspace/common/virtualWorkspace.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { IWorkspace } from 'vs/platform/workspace/common/workspace'; +import { Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import { IWorkspace } from './workspace.js'; export function isVirtualResource(resource: URI) { return resource.scheme !== Schemas.file && resource.scheme !== Schemas.vscodeRemote; diff --git a/src/vs/platform/workspace/common/workspace.ts b/src/vs/platform/workspace/common/workspace.ts index 4ad55ee58fc..c6e7245ba7f 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { Event } from 'vs/base/common/event'; -import { basename, extname } from 'vs/base/common/path'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { extname as resourceExtname, basenameOrAuthority, joinPath, extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { Schemas } from 'vs/base/common/network'; +import { localize } from '../../../nls.js'; +import { Event } from '../../../base/common/event.js'; +import { basename, extname } from '../../../base/common/path.js'; +import { TernarySearchTree } from '../../../base/common/ternarySearchTree.js'; +import { extname as resourceExtname, basenameOrAuthority, joinPath, extUriBiasedIgnorePathCase } from '../../../base/common/resources.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { IEnvironmentService } from '../../environment/common/environment.js'; +import { Schemas } from '../../../base/common/network.js'; export const IWorkspaceContextService = createDecorator('contextService'); diff --git a/src/vs/platform/workspace/common/workspaceTrust.ts b/src/vs/platform/workspace/common/workspaceTrust.ts index 7988f9a930f..2d3ea5d1e37 100644 --- a/src/vs/platform/workspace/common/workspaceTrust.ts +++ b/src/vs/platform/workspace/common/workspaceTrust.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { Event } from '../../../base/common/event.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; export enum WorkspaceTrustScope { Local = 0, diff --git a/src/vs/platform/workspace/test/common/testWorkspace.ts b/src/vs/platform/workspace/test/common/testWorkspace.ts index c5c2fb62d9f..81fee382320 100644 --- a/src/vs/platform/workspace/test/common/testWorkspace.ts +++ b/src/vs/platform/workspace/test/common/testWorkspace.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isLinux, isWindows } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { toWorkspaceFolder, Workspace as BaseWorkspace, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; +import { isLinux, isWindows } from '../../../../base/common/platform.js'; +import { URI } from '../../../../base/common/uri.js'; +import { toWorkspaceFolder, Workspace as BaseWorkspace, WorkspaceFolder } from '../../common/workspace.js'; export class Workspace extends BaseWorkspace { constructor( diff --git a/src/vs/platform/workspace/test/common/workspace.test.ts b/src/vs/platform/workspace/test/common/workspace.test.ts index fb8c1cf18e6..0c20623a992 100644 --- a/src/vs/platform/workspace/test/common/workspace.test.ts +++ b/src/vs/platform/workspace/test/common/workspace.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { join } from 'vs/base/common/path'; -import { isLinux, isWindows } from 'vs/base/common/platform'; -import { extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { IRawFileWorkspaceFolder, Workspace, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { toWorkspaceFolders } from 'vs/platform/workspaces/common/workspaces'; +import { join } from '../../../../base/common/path.js'; +import { isLinux, isWindows } from '../../../../base/common/platform.js'; +import { extUriBiasedIgnorePathCase } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IRawFileWorkspaceFolder, Workspace, WorkspaceFolder } from '../../common/workspace.js'; +import { toWorkspaceFolders } from '../../../workspaces/common/workspaces.js'; suite('Workspace', () => { diff --git a/src/vs/platform/workspaces/common/workspaces.ts b/src/vs/platform/workspaces/common/workspaces.ts index 71e4a623f65..6097076c43f 100644 --- a/src/vs/platform/workspaces/common/workspaces.ts +++ b/src/vs/platform/workspaces/common/workspaces.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { isUNC, toSlashes } from 'vs/base/common/extpath'; -import * as json from 'vs/base/common/json'; -import * as jsonEdit from 'vs/base/common/jsonEdit'; -import { FormattingOptions } from 'vs/base/common/jsonFormatter'; -import { normalizeDriveLetter } from 'vs/base/common/labels'; -import { Schemas } from 'vs/base/common/network'; -import { isAbsolute, posix } from 'vs/base/common/path'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { IExtUri, isEqualAuthority } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { IWorkspaceBackupInfo, IFolderBackupInfo } from 'vs/platform/backup/common/backup'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { getRemoteAuthority } from 'vs/platform/remote/common/remoteHosts'; -import { IBaseWorkspace, IRawFileWorkspaceFolder, IRawUriWorkspaceFolder, IWorkspaceIdentifier, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; +import { Event } from '../../../base/common/event.js'; +import { isUNC, toSlashes } from '../../../base/common/extpath.js'; +import * as json from '../../../base/common/json.js'; +import * as jsonEdit from '../../../base/common/jsonEdit.js'; +import { FormattingOptions } from '../../../base/common/jsonFormatter.js'; +import { normalizeDriveLetter } from '../../../base/common/labels.js'; +import { Schemas } from '../../../base/common/network.js'; +import { isAbsolute, posix } from '../../../base/common/path.js'; +import { isLinux, isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { IExtUri, isEqualAuthority } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { IWorkspaceBackupInfo, IFolderBackupInfo } from '../../backup/common/backup.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { getRemoteAuthority } from '../../remote/common/remoteHosts.js'; +import { IBaseWorkspace, IRawFileWorkspaceFolder, IRawUriWorkspaceFolder, IWorkspaceIdentifier, WorkspaceFolder } from '../../workspace/common/workspace.js'; export const IWorkspacesService = createDecorator('workspacesService'); diff --git a/src/vs/platform/workspaces/electron-main/workspacesHistoryMainService.ts b/src/vs/platform/workspaces/electron-main/workspacesHistoryMainService.ts index a6f7fc430bc..0ee2bec4960 100644 --- a/src/vs/platform/workspaces/electron-main/workspacesHistoryMainService.ts +++ b/src/vs/platform/workspaces/electron-main/workspacesHistoryMainService.ts @@ -4,27 +4,27 @@ *--------------------------------------------------------------------------------------------*/ import { app, JumpListCategory, JumpListItem } from 'electron'; -import { coalesce } from 'vs/base/common/arrays'; -import { ThrottledDelayer } from 'vs/base/common/async'; -import { Emitter, Event as CommonEvent } from 'vs/base/common/event'; -import { normalizeDriveLetter, splitRecentLabel } from 'vs/base/common/labels'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { isMacintosh, isWindows } from 'vs/base/common/platform'; -import { basename, extUriBiasedIgnorePathCase, originalFSPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { Promises } from 'vs/base/node/pfs'; -import { localize } from 'vs/nls'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILifecycleMainService, LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IApplicationStorageMainService } from 'vs/platform/storage/electron-main/storageMainService'; -import { IRecent, IRecentFile, IRecentFolder, IRecentlyOpened, IRecentWorkspace, isRecentFile, isRecentFolder, isRecentWorkspace, restoreRecentlyOpened, toStoreData } from 'vs/platform/workspaces/common/workspaces'; -import { IWorkspaceIdentifier, WORKSPACE_EXTENSION } from 'vs/platform/workspace/common/workspace'; -import { IWorkspacesManagementMainService } from 'vs/platform/workspaces/electron-main/workspacesManagementMainService'; -import { ResourceMap } from 'vs/base/common/map'; -import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMainService'; +import { coalesce } from '../../../base/common/arrays.js'; +import { ThrottledDelayer } from '../../../base/common/async.js'; +import { Emitter, Event as CommonEvent } from '../../../base/common/event.js'; +import { normalizeDriveLetter, splitRecentLabel } from '../../../base/common/labels.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { basename, extUriBiasedIgnorePathCase, originalFSPath } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { Promises } from '../../../base/node/pfs.js'; +import { localize } from '../../../nls.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILifecycleMainService, LifecycleMainPhase } from '../../lifecycle/electron-main/lifecycleMainService.js'; +import { ILogService } from '../../log/common/log.js'; +import { StorageScope, StorageTarget } from '../../storage/common/storage.js'; +import { IApplicationStorageMainService } from '../../storage/electron-main/storageMainService.js'; +import { IRecent, IRecentFile, IRecentFolder, IRecentlyOpened, IRecentWorkspace, isRecentFile, isRecentFolder, isRecentWorkspace, restoreRecentlyOpened, toStoreData } from '../common/workspaces.js'; +import { IWorkspaceIdentifier, WORKSPACE_EXTENSION } from '../../workspace/common/workspace.js'; +import { IWorkspacesManagementMainService } from './workspacesManagementMainService.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { IDialogMainService } from '../../dialogs/electron-main/dialogMainService.js'; export const IWorkspacesHistoryMainService = createDecorator('workspacesHistoryMainService'); diff --git a/src/vs/platform/workspaces/electron-main/workspacesMainService.ts b/src/vs/platform/workspaces/electron-main/workspacesMainService.ts index de17f98befb..b42bd3ad679 100644 --- a/src/vs/platform/workspaces/electron-main/workspacesMainService.ts +++ b/src/vs/platform/workspaces/electron-main/workspacesMainService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AddFirstParameterToFunctions } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { IBackupMainService } from 'vs/platform/backup/electron-main/backup'; -import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; -import { IEnterWorkspaceResult, IRecent, IRecentlyOpened, IWorkspaceFolderCreationData, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; -import { IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { IWorkspacesHistoryMainService } from 'vs/platform/workspaces/electron-main/workspacesHistoryMainService'; -import { IWorkspacesManagementMainService } from 'vs/platform/workspaces/electron-main/workspacesManagementMainService'; -import { IWorkspaceBackupInfo, IFolderBackupInfo } from 'vs/platform/backup/common/backup'; +import { AddFirstParameterToFunctions } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { IBackupMainService } from '../../backup/electron-main/backup.js'; +import { IWindowsMainService } from '../../windows/electron-main/windows.js'; +import { IEnterWorkspaceResult, IRecent, IRecentlyOpened, IWorkspaceFolderCreationData, IWorkspacesService } from '../common/workspaces.js'; +import { IWorkspaceIdentifier } from '../../workspace/common/workspace.js'; +import { IWorkspacesHistoryMainService } from './workspacesHistoryMainService.js'; +import { IWorkspacesManagementMainService } from './workspacesManagementMainService.js'; +import { IWorkspaceBackupInfo, IFolderBackupInfo } from '../../backup/common/backup.js'; export class WorkspacesMainService implements AddFirstParameterToFunctions /* only methods, not events */, number /* window ID */> { diff --git a/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts b/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts index 236f6d6fc32..904aea65df3 100644 --- a/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts +++ b/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts @@ -3,27 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BrowserWindow } from 'electron'; -import { Emitter, Event } from 'vs/base/common/event'; -import { parse } from 'vs/base/common/json'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { dirname, join } from 'vs/base/common/path'; -import { basename, extUriBiasedIgnorePathCase, joinPath, originalFSPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { Promises } from 'vs/base/node/pfs'; -import { localize } from 'vs/nls'; -import { IBackupMainService } from 'vs/platform/backup/electron-main/backup'; -import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMainService'; -import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile'; -import { ICodeWindow } from 'vs/platform/window/electron-main/window'; -import { findWindowOnWorkspaceOrFolder } from 'vs/platform/windows/electron-main/windowsFinder'; -import { isWorkspaceIdentifier, IWorkspaceIdentifier, IResolvedWorkspace, hasWorkspaceFileExtension, UNTITLED_WORKSPACE_NAME, isUntitledWorkspace } from 'vs/platform/workspace/common/workspace'; -import { getStoredWorkspaceFolder, IEnterWorkspaceResult, isStoredWorkspaceFolder, IStoredWorkspace, IStoredWorkspaceFolder, IUntitledWorkspaceInfo, IWorkspaceFolderCreationData, toWorkspaceFolders } from 'vs/platform/workspaces/common/workspaces'; -import { getWorkspaceIdentifier } from 'vs/platform/workspaces/node/workspaces'; +import * as fs from 'fs'; +import electron from 'electron'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { parse } from '../../../base/common/json.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { dirname, join } from '../../../base/common/path.js'; +import { basename, extUriBiasedIgnorePathCase, joinPath, originalFSPath } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { Promises } from '../../../base/node/pfs.js'; +import { localize } from '../../../nls.js'; +import { IBackupMainService } from '../../backup/electron-main/backup.js'; +import { IDialogMainService } from '../../dialogs/electron-main/dialogMainService.js'; +import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +import { ILogService } from '../../log/common/log.js'; +import { IUserDataProfilesMainService } from '../../userDataProfile/electron-main/userDataProfile.js'; +import { ICodeWindow } from '../../window/electron-main/window.js'; +import { findWindowOnWorkspaceOrFolder } from '../../windows/electron-main/windowsFinder.js'; +import { isWorkspaceIdentifier, IWorkspaceIdentifier, IResolvedWorkspace, hasWorkspaceFileExtension, UNTITLED_WORKSPACE_NAME, isUntitledWorkspace } from '../../workspace/common/workspace.js'; +import { getStoredWorkspaceFolder, IEnterWorkspaceResult, isStoredWorkspaceFolder, IStoredWorkspace, IStoredWorkspaceFolder, IUntitledWorkspaceInfo, IWorkspaceFolderCreationData, toWorkspaceFolders } from '../common/workspaces.js'; +import { getWorkspaceIdentifier } from '../node/workspaces.js'; export const IWorkspacesManagementMainService = createDecorator('workspacesManagementMainService'); @@ -102,7 +103,7 @@ export class WorkspacesManagementMainService extends Disposable implements IWork } resolveLocalWorkspace(uri: URI): Promise { - return this.doResolveLocalWorkspace(uri, path => Promises.readFile(path, 'utf8')); + return this.doResolveLocalWorkspace(uri, path => fs.promises.readFile(path, 'utf8')); } private doResolveLocalWorkspace(uri: URI, contentsFn: (path: string) => string): IResolvedWorkspace | undefined; @@ -169,7 +170,7 @@ export class WorkspacesManagementMainService extends Disposable implements IWork const { workspace, storedWorkspace } = this.newUntitledWorkspace(folders, remoteAuthority); const configPath = workspace.configPath.fsPath; - await Promises.mkdir(dirname(configPath), { recursive: true }); + await fs.promises.mkdir(dirname(configPath), { recursive: true }); await Promises.writeFile(configPath, JSON.stringify(storedWorkspace, null, '\t')); this.untitledWorkspaces.push({ workspace, remoteAuthority }); @@ -280,7 +281,7 @@ export class WorkspacesManagementMainService extends Disposable implements IWork buttons: [localize({ key: 'ok', comment: ['&& denotes a mnemonic'] }, "&&OK")], message: localize('workspaceOpenedMessage', "Unable to save workspace '{0}'", basename(workspacePath)), detail: localize('workspaceOpenedDetail', "The workspace is already opened in another window. Please close that window first and then try again.") - }, BrowserWindow.getFocusedWindow() ?? undefined); + }, electron.BrowserWindow.getFocusedWindow() ?? undefined); return false; } diff --git a/src/vs/platform/workspaces/node/workspaces.ts b/src/vs/platform/workspaces/node/workspaces.ts index 86e7f3ebeee..1189358ed30 100644 --- a/src/vs/platform/workspaces/node/workspaces.ts +++ b/src/vs/platform/workspaces/node/workspaces.ts @@ -5,11 +5,11 @@ import { createHash } from 'crypto'; import { Stats } from 'fs'; -import { Schemas } from 'vs/base/common/network'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { originalFSPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { IEmptyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { Schemas } from '../../../base/common/network.js'; +import { isLinux, isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { originalFSPath } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { IEmptyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from '../../workspace/common/workspace.js'; /** * Length of workspace identifiers that are not empty. Those are diff --git a/src/vs/platform/workspaces/test/common/workspaces.test.ts b/src/vs/platform/workspaces/test/common/workspaces.test.ts index a08f1035ce1..12589a491c3 100644 --- a/src/vs/platform/workspaces/test/common/workspaces.test.ts +++ b/src/vs/platform/workspaces/test/common/workspaces.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ISerializedSingleFolderWorkspaceIdentifier, ISerializedWorkspaceIdentifier, reviveIdentifier, hasWorkspaceFileExtension, isWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, IEmptyWorkspaceIdentifier, toWorkspaceIdentifier, isEmptyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ISerializedSingleFolderWorkspaceIdentifier, ISerializedWorkspaceIdentifier, reviveIdentifier, hasWorkspaceFileExtension, isWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, IEmptyWorkspaceIdentifier, toWorkspaceIdentifier, isEmptyWorkspaceIdentifier } from '../../../workspace/common/workspace.js'; suite('Workspaces', () => { diff --git a/src/vs/platform/workspaces/test/electron-main/workspaces.test.ts b/src/vs/platform/workspaces/test/electron-main/workspaces.test.ts index 42fd463b9bf..0bfb4dedd40 100644 --- a/src/vs/platform/workspaces/test/electron-main/workspaces.test.ts +++ b/src/vs/platform/workspaces/test/electron-main/workspaces.test.ts @@ -6,13 +6,13 @@ import assert from 'assert'; import * as fs from 'fs'; import * as os from 'os'; -import * as path from 'vs/base/common/path'; -import { isWindows } from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import * as pfs from 'vs/base/node/pfs'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { flakySuite, getRandomTestPath } from 'vs/base/test/node/testUtils'; -import { getSingleFolderWorkspaceIdentifier, getWorkspaceIdentifier } from 'vs/platform/workspaces/node/workspaces'; +import * as path from '../../../../base/common/path.js'; +import { isWindows } from '../../../../base/common/platform.js'; +import { URI } from '../../../../base/common/uri.js'; +import * as pfs from '../../../../base/node/pfs.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { flakySuite, getRandomTestPath } from '../../../../base/test/node/testUtils.js'; +import { getSingleFolderWorkspaceIdentifier, getWorkspaceIdentifier } from '../../node/workspaces.js'; flakySuite('Workspaces', () => { @@ -23,7 +23,7 @@ flakySuite('Workspaces', () => { setup(async () => { testDir = getRandomTestPath(tmpDir, 'vsctests', 'workspacesmanagementmainservice'); - return pfs.Promises.mkdir(testDir, { recursive: true }); + return fs.promises.mkdir(testDir, { recursive: true }); }); teardown(() => { diff --git a/src/vs/platform/workspaces/test/electron-main/workspacesHistoryStorage.test.ts b/src/vs/platform/workspaces/test/electron-main/workspacesHistoryStorage.test.ts index f2102c3b098..1c86fda9442 100644 --- a/src/vs/platform/workspaces/test/electron-main/workspacesHistoryStorage.test.ts +++ b/src/vs/platform/workspaces/test/electron-main/workspacesHistoryStorage.test.ts @@ -5,12 +5,12 @@ import assert from 'assert'; import { tmpdir } from 'os'; -import { join } from 'vs/base/common/path'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { IRecentFolder, IRecentlyOpened, IRecentWorkspace, isRecentFolder, restoreRecentlyOpened, toStoreData } from 'vs/platform/workspaces/common/workspaces'; +import { join } from '../../../../base/common/path.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { NullLogService } from '../../../log/common/log.js'; +import { IWorkspaceIdentifier } from '../../../workspace/common/workspace.js'; +import { IRecentFolder, IRecentlyOpened, IRecentWorkspace, isRecentFolder, restoreRecentlyOpened, toStoreData } from '../../common/workspaces.js'; suite('History Storage', () => { diff --git a/src/vs/platform/workspaces/test/electron-main/workspacesManagementMainService.test.ts b/src/vs/platform/workspaces/test/electron-main/workspacesManagementMainService.test.ts index fe5bd2994c8..8b870f33a27 100644 --- a/src/vs/platform/workspaces/test/electron-main/workspacesManagementMainService.test.ts +++ b/src/vs/platform/workspaces/test/electron-main/workspacesManagementMainService.test.ts @@ -6,32 +6,32 @@ import assert from 'assert'; import * as fs from 'fs'; import * as os from 'os'; -import { isUNC, toSlashes } from 'vs/base/common/extpath'; -import { normalizeDriveLetter } from 'vs/base/common/labels'; -import * as path from 'vs/base/common/path'; -import { isWindows } from 'vs/base/common/platform'; -import { extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import * as pfs from 'vs/base/node/pfs'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { flakySuite, getRandomTestPath } from 'vs/base/test/node/testUtils'; -import { IWorkspaceBackupInfo, IFolderBackupInfo } from 'vs/platform/backup/common/backup'; -import { IBackupMainService } from 'vs/platform/backup/electron-main/backup'; -import { IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup'; -import { INativeOpenDialogOptions } from 'vs/platform/dialogs/common/dialogs'; -import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMainService'; -import { EnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService'; -import { OPTIONS, parseArgs } from 'vs/platform/environment/node/argv'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { NullLogService } from 'vs/platform/log/common/log'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { SaveStrategy, StateService } from 'vs/platform/state/node/stateService'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { UserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile'; -import { IRawFileWorkspaceFolder, IRawUriWorkspaceFolder, WORKSPACE_EXTENSION } from 'vs/platform/workspace/common/workspace'; -import { IStoredWorkspace, IStoredWorkspaceFolder, IWorkspaceFolderCreationData, rewriteWorkspaceFileForNewLocation } from 'vs/platform/workspaces/common/workspaces'; -import { WorkspacesManagementMainService } from 'vs/platform/workspaces/electron-main/workspacesManagementMainService'; +import { isUNC, toSlashes } from '../../../../base/common/extpath.js'; +import { normalizeDriveLetter } from '../../../../base/common/labels.js'; +import * as path from '../../../../base/common/path.js'; +import { isWindows } from '../../../../base/common/platform.js'; +import { extUriBiasedIgnorePathCase } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import * as pfs from '../../../../base/node/pfs.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { flakySuite, getRandomTestPath } from '../../../../base/test/node/testUtils.js'; +import { IWorkspaceBackupInfo, IFolderBackupInfo } from '../../../backup/common/backup.js'; +import { IBackupMainService } from '../../../backup/electron-main/backup.js'; +import { IEmptyWindowBackupInfo } from '../../../backup/node/backup.js'; +import { INativeOpenDialogOptions } from '../../../dialogs/common/dialogs.js'; +import { IDialogMainService } from '../../../dialogs/electron-main/dialogMainService.js'; +import { EnvironmentMainService } from '../../../environment/electron-main/environmentMainService.js'; +import { OPTIONS, parseArgs } from '../../../environment/node/argv.js'; +import { FileService } from '../../../files/common/fileService.js'; +import { NullLogService } from '../../../log/common/log.js'; +import product from '../../../product/common/product.js'; +import { IProductService } from '../../../product/common/productService.js'; +import { SaveStrategy, StateService } from '../../../state/node/stateService.js'; +import { UriIdentityService } from '../../../uriIdentity/common/uriIdentityService.js'; +import { UserDataProfilesMainService } from '../../../userDataProfile/electron-main/userDataProfile.js'; +import { IRawFileWorkspaceFolder, IRawUriWorkspaceFolder, WORKSPACE_EXTENSION } from '../../../workspace/common/workspace.js'; +import { IStoredWorkspace, IStoredWorkspaceFolder, IWorkspaceFolderCreationData, rewriteWorkspaceFileForNewLocation } from '../../common/workspaces.js'; +import { WorkspacesManagementMainService } from '../../electron-main/workspacesManagementMainService.js'; flakySuite('WorkspacesManagementMainService', () => { @@ -112,7 +112,7 @@ flakySuite('WorkspacesManagementMainService', () => { const fileService = new FileService(logService); service = new WorkspacesManagementMainService(environmentMainService, logService, new UserDataProfilesMainService(new StateService(SaveStrategy.DELAYED, environmentMainService, logService, fileService), new UriIdentityService(fileService), environmentMainService, fileService, logService), new TestBackupMainService(), new TestDialogMainService()); - return pfs.Promises.mkdir(untitledWorkspacesHomePath, { recursive: true }); + return fs.promises.mkdir(untitledWorkspacesHomePath, { recursive: true }); }); teardown(() => { diff --git a/src/vs/server/node/extensionHostConnection.ts b/src/vs/server/node/extensionHostConnection.ts index 9fbb33d3ece..ab484be52a9 100644 --- a/src/vs/server/node/extensionHostConnection.ts +++ b/src/vs/server/node/extensionHostConnection.ts @@ -5,23 +5,23 @@ import * as cp from 'child_process'; import * as net from 'net'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { FileAccess } from 'vs/base/common/network'; -import { delimiter, join } from 'vs/base/common/path'; -import { IProcessEnvironment, isWindows } from 'vs/base/common/platform'; -import { removeDangerousEnvVariables } from 'vs/base/common/processes'; -import { createRandomIPCHandle, NodeSocket, WebSocketNodeSocket } from 'vs/base/parts/ipc/node/ipc.net'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IRemoteExtensionHostStartParams } from 'vs/platform/remote/common/remoteAgentConnection'; -import { getResolvedShellEnv } from 'vs/platform/shell/node/shellEnv'; -import { IExtensionHostStatusService } from 'vs/server/node/extensionHostStatusService'; -import { getNLSConfiguration } from 'vs/server/node/remoteLanguagePacks'; -import { IServerEnvironmentService } from 'vs/server/node/serverEnvironmentService'; -import { IPCExtHostConnection, SocketExtHostConnection, writeExtHostConnection } from 'vs/workbench/services/extensions/common/extensionHostEnv'; -import { IExtHostReadyMessage, IExtHostReduceGraceTimeMessage, IExtHostSocketMessage } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; +import { VSBuffer } from '../../base/common/buffer.js'; +import { Emitter, Event } from '../../base/common/event.js'; +import { Disposable, DisposableStore, toDisposable } from '../../base/common/lifecycle.js'; +import { FileAccess } from '../../base/common/network.js'; +import { delimiter, join } from '../../base/common/path.js'; +import { IProcessEnvironment, isWindows } from '../../base/common/platform.js'; +import { removeDangerousEnvVariables } from '../../base/common/processes.js'; +import { createRandomIPCHandle, NodeSocket, WebSocketNodeSocket } from '../../base/parts/ipc/node/ipc.net.js'; +import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; +import { ILogService } from '../../platform/log/common/log.js'; +import { IRemoteExtensionHostStartParams } from '../../platform/remote/common/remoteAgentConnection.js'; +import { getResolvedShellEnv } from '../../platform/shell/node/shellEnv.js'; +import { IExtensionHostStatusService } from './extensionHostStatusService.js'; +import { getNLSConfiguration } from './remoteLanguagePacks.js'; +import { IServerEnvironmentService } from './serverEnvironmentService.js'; +import { IPCExtHostConnection, SocketExtHostConnection, writeExtHostConnection } from '../../workbench/services/extensions/common/extensionHostEnv.js'; +import { IExtHostReadyMessage, IExtHostReduceGraceTimeMessage, IExtHostSocketMessage } from '../../workbench/services/extensions/common/extensionHostProtocol.js'; export async function buildUserEnvironment(startParamsEnv: { [key: string]: string | null } = {}, withUserShellEnvironment: boolean, language: string, environmentService: IServerEnvironmentService, logService: ILogService, configurationService: IConfigurationService): Promise { const nlsConfig = await getNLSConfiguration(language, environmentService.userDataPath); @@ -43,7 +43,7 @@ export async function buildUserEnvironment(startParamsEnv: { [key: string]: stri ...{ VSCODE_AMD_ENTRYPOINT: 'vs/workbench/api/node/extensionHostProcess', VSCODE_HANDLES_UNCAUGHT_ERRORS: 'true', - VSCODE_NLS_CONFIG: JSON.stringify(nlsConfig, undefined, 0) + VSCODE_NLS_CONFIG: JSON.stringify(nlsConfig) }, ...startParamsEnv }; diff --git a/src/vs/server/node/extensionHostStatusService.ts b/src/vs/server/node/extensionHostStatusService.ts index d6f7c9e1beb..79426739b7f 100644 --- a/src/vs/server/node/extensionHostStatusService.ts +++ b/src/vs/server/node/extensionHostStatusService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtensionHostExitInfo } from 'vs/workbench/services/remote/common/remoteAgentService'; +import { createDecorator } from '../../platform/instantiation/common/instantiation.js'; +import { IExtensionHostExitInfo } from '../../workbench/services/remote/common/remoteAgentService.js'; export const IExtensionHostStatusService = createDecorator('extensionHostStatusService'); diff --git a/src/vs/server/node/extensionsScannerService.ts b/src/vs/server/node/extensionsScannerService.ts index 5430ae19162..5a191557cc2 100644 --- a/src/vs/server/node/extensionsScannerService.ts +++ b/src/vs/server/node/extensionsScannerService.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { joinPath } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { AbstractExtensionsScannerService, IExtensionsScannerService, Translations } from 'vs/platform/extensionManagement/common/extensionsScannerService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { getNLSConfiguration, InternalNLSConfiguration } from 'vs/server/node/remoteLanguagePacks'; +import { joinPath } from '../../base/common/resources.js'; +import { URI } from '../../base/common/uri.js'; +import { INativeEnvironmentService } from '../../platform/environment/common/environment.js'; +import { IExtensionsProfileScannerService } from '../../platform/extensionManagement/common/extensionsProfileScannerService.js'; +import { AbstractExtensionsScannerService, IExtensionsScannerService, Translations } from '../../platform/extensionManagement/common/extensionsScannerService.js'; +import { IFileService } from '../../platform/files/common/files.js'; +import { IInstantiationService } from '../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../platform/log/common/log.js'; +import { IProductService } from '../../platform/product/common/productService.js'; +import { IUriIdentityService } from '../../platform/uriIdentity/common/uriIdentity.js'; +import { IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js'; +import { getNLSConfiguration } from './remoteLanguagePacks.js'; export class ExtensionsScannerService extends AbstractExtensionsScannerService implements IExtensionsScannerService { @@ -38,9 +38,9 @@ export class ExtensionsScannerService extends AbstractExtensionsScannerService i protected async getTranslations(language: string): Promise { const config = await getNLSConfiguration(language, this.nativeEnvironmentService.userDataPath); - if (InternalNLSConfiguration.is(config)) { + if (config.languagePack) { try { - const content = await this.fileService.readFile(URI.file(config._translationsConfigFile)); + const content = await this.fileService.readFile(URI.file(config.languagePack.translationsConfigFile)); return JSON.parse(content.value.toString()); } catch (err) { /* Ignore error */ } } diff --git a/src/vs/server/node/remoteAgentEnvironmentImpl.ts b/src/vs/server/node/remoteAgentEnvironmentImpl.ts index b9861444caf..e050ae1f4f5 100644 --- a/src/vs/server/node/remoteAgentEnvironmentImpl.ts +++ b/src/vs/server/node/remoteAgentEnvironmentImpl.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import * as platform from 'vs/base/common/platform'; -import * as performance from 'vs/base/common/performance'; -import { URI } from 'vs/base/common/uri'; -import { createURITransformer } from 'vs/workbench/api/node/uriTransformer'; -import { IRemoteAgentEnvironmentDTO, IGetEnvironmentDataArguments, IGetExtensionHostExitInfoArguments } from 'vs/workbench/services/remote/common/remoteAgentEnvironmentChannel'; -import { IServerEnvironmentService } from 'vs/server/node/serverEnvironmentService'; -import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { transformOutgoingURIs } from 'vs/base/common/uriIpc'; -import { listProcesses } from 'vs/base/node/ps'; -import { getMachineInfo, collectWorkspaceStats } from 'vs/platform/diagnostics/node/diagnosticsService'; -import { IDiagnosticInfoOptions, IDiagnosticInfo } from 'vs/platform/diagnostics/common/diagnostics'; -import { basename } from 'vs/base/common/path'; -import { ProcessItem } from 'vs/base/common/processes'; -import { ServerConnectionToken, ServerConnectionTokenType } from 'vs/server/node/serverConnectionToken'; -import { IExtensionHostStatusService } from 'vs/server/node/extensionHostStatusService'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { joinPath } from 'vs/base/common/resources'; +import { Event } from '../../base/common/event.js'; +import * as platform from '../../base/common/platform.js'; +import * as performance from '../../base/common/performance.js'; +import { URI } from '../../base/common/uri.js'; +import { createURITransformer } from '../../workbench/api/node/uriTransformer.js'; +import { IRemoteAgentEnvironmentDTO, IGetEnvironmentDataArguments, IGetExtensionHostExitInfoArguments } from '../../workbench/services/remote/common/remoteAgentEnvironmentChannel.js'; +import { IServerEnvironmentService } from './serverEnvironmentService.js'; +import { IServerChannel } from '../../base/parts/ipc/common/ipc.js'; +import { transformOutgoingURIs } from '../../base/common/uriIpc.js'; +import { listProcesses } from '../../base/node/ps.js'; +import { getMachineInfo, collectWorkspaceStats } from '../../platform/diagnostics/node/diagnosticsService.js'; +import { IDiagnosticInfoOptions, IDiagnosticInfo } from '../../platform/diagnostics/common/diagnostics.js'; +import { basename } from '../../base/common/path.js'; +import { ProcessItem } from '../../base/common/processes.js'; +import { ServerConnectionToken, ServerConnectionTokenType } from './serverConnectionToken.js'; +import { IExtensionHostStatusService } from './extensionHostStatusService.js'; +import { IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js'; +import { joinPath } from '../../base/common/resources.js'; export class RemoteAgentEnvironmentChannel implements IServerChannel { diff --git a/src/vs/server/node/remoteExtensionHostAgentCli.ts b/src/vs/server/node/remoteExtensionHostAgentCli.ts index b489ca72bcb..47322ee6ac6 100644 --- a/src/vs/server/node/remoteExtensionHostAgentCli.ts +++ b/src/vs/server/node/remoteExtensionHostAgentCli.ts @@ -3,53 +3,53 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ConsoleLogger, getLogLevel, ILoggerService, ILogService } from 'vs/platform/log/common/log'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { ConfigurationService } from 'vs/platform/configuration/common/configurationService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { RequestService } from 'vs/platform/request/node/requestService'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IExtensionGalleryService, InstallOptions } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionGalleryServiceWithNoStorageService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; -import { ExtensionManagementService, INativeServerExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; -import { ExtensionSignatureVerificationService, IExtensionSignatureVerificationService } from 'vs/platform/extensionManagement/node/extensionSignatureVerificationService'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import product from 'vs/platform/product/common/product'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { Schemas } from 'vs/base/common/network'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IServerEnvironmentService, ServerEnvironmentService, ServerParsedArgs } from 'vs/server/node/serverEnvironmentService'; -import { ExtensionManagementCLI } from 'vs/platform/extensionManagement/common/extensionManagementCLI'; -import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks'; -import { NativeLanguagePackService } from 'vs/platform/languagePacks/node/languagePacks'; -import { getErrorMessage } from 'vs/base/common/errors'; -import { URI } from 'vs/base/common/uri'; -import { isAbsolute, join } from 'vs/base/common/path'; -import { cwd } from 'vs/base/common/process'; -import { DownloadService } from 'vs/platform/download/common/downloadService'; -import { IDownloadService } from 'vs/platform/download/common/download'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { buildHelpMessage, buildVersionMessage, OptionDescriptions } from 'vs/platform/environment/node/argv'; -import { isWindows } from 'vs/base/common/platform'; -import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService'; -import { ExtensionsScannerService } from 'vs/server/node/extensionsScannerService'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { NullPolicyService } from 'vs/platform/policy/common/policy'; -import { ServerUserDataProfilesService } from 'vs/platform/userDataProfile/node/userDataProfile'; -import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService'; -import { LogService } from 'vs/platform/log/common/logService'; -import { LoggerService } from 'vs/platform/log/node/loggerService'; -import { localize } from 'vs/nls'; -import { addUNCHostToAllowlist, disableUNCAccessRestrictions } from 'vs/base/node/unc'; +import { ServiceCollection } from '../../platform/instantiation/common/serviceCollection.js'; +import { ConsoleLogger, getLogLevel, ILoggerService, ILogService, NullLogger } from '../../platform/log/common/log.js'; +import { SyncDescriptor } from '../../platform/instantiation/common/descriptors.js'; +import { ConfigurationService } from '../../platform/configuration/common/configurationService.js'; +import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; +import { IRequestService } from '../../platform/request/common/request.js'; +import { RequestService } from '../../platform/request/node/requestService.js'; +import { NullTelemetryService } from '../../platform/telemetry/common/telemetryUtils.js'; +import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js'; +import { IExtensionGalleryService, InstallOptions } from '../../platform/extensionManagement/common/extensionManagement.js'; +import { ExtensionGalleryServiceWithNoStorageService } from '../../platform/extensionManagement/common/extensionGalleryService.js'; +import { ExtensionManagementService, INativeServerExtensionManagementService } from '../../platform/extensionManagement/node/extensionManagementService.js'; +import { ExtensionSignatureVerificationService, IExtensionSignatureVerificationService } from '../../platform/extensionManagement/node/extensionSignatureVerificationService.js'; +import { InstantiationService } from '../../platform/instantiation/common/instantiationService.js'; +import { IInstantiationService } from '../../platform/instantiation/common/instantiation.js'; +import product from '../../platform/product/common/product.js'; +import { Disposable } from '../../base/common/lifecycle.js'; +import { FileService } from '../../platform/files/common/fileService.js'; +import { DiskFileSystemProvider } from '../../platform/files/node/diskFileSystemProvider.js'; +import { Schemas } from '../../base/common/network.js'; +import { IFileService } from '../../platform/files/common/files.js'; +import { IProductService } from '../../platform/product/common/productService.js'; +import { IServerEnvironmentService, ServerEnvironmentService, ServerParsedArgs } from './serverEnvironmentService.js'; +import { ExtensionManagementCLI } from '../../platform/extensionManagement/common/extensionManagementCLI.js'; +import { ILanguagePackService } from '../../platform/languagePacks/common/languagePacks.js'; +import { NativeLanguagePackService } from '../../platform/languagePacks/node/languagePacks.js'; +import { getErrorMessage } from '../../base/common/errors.js'; +import { URI } from '../../base/common/uri.js'; +import { isAbsolute, join } from '../../base/common/path.js'; +import { cwd } from '../../base/common/process.js'; +import { DownloadService } from '../../platform/download/common/downloadService.js'; +import { IDownloadService } from '../../platform/download/common/download.js'; +import { IUriIdentityService } from '../../platform/uriIdentity/common/uriIdentity.js'; +import { UriIdentityService } from '../../platform/uriIdentity/common/uriIdentityService.js'; +import { buildHelpMessage, buildVersionMessage, OptionDescriptions } from '../../platform/environment/node/argv.js'; +import { isWindows } from '../../base/common/platform.js'; +import { IExtensionsScannerService } from '../../platform/extensionManagement/common/extensionsScannerService.js'; +import { ExtensionsScannerService } from './extensionsScannerService.js'; +import { IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js'; +import { IExtensionsProfileScannerService } from '../../platform/extensionManagement/common/extensionsProfileScannerService.js'; +import { NullPolicyService } from '../../platform/policy/common/policy.js'; +import { ServerUserDataProfilesService } from '../../platform/userDataProfile/node/userDataProfile.js'; +import { ExtensionsProfileScannerService } from '../../platform/extensionManagement/node/extensionsProfileScannerService.js'; +import { LogService } from '../../platform/log/common/logService.js'; +import { LoggerService } from '../../platform/log/node/loggerService.js'; +import { localize } from '../../nls.js'; +import { addUNCHostToAllowlist, disableUNCAccessRestrictions } from '../../base/node/unc.js'; class CliMain extends Disposable { @@ -128,7 +128,7 @@ class CliMain extends Disposable { userDataProfilesService.init() ]); - services.set(IRequestService, new SyncDescriptor(RequestService)); + services.set(IRequestService, new SyncDescriptor(RequestService, [new NullLogger()])); services.set(IDownloadService, new SyncDescriptor(DownloadService)); services.set(ITelemetryService, NullTelemetryService); services.set(IExtensionGalleryService, new SyncDescriptor(ExtensionGalleryServiceWithNoStorageService)); diff --git a/src/vs/server/node/remoteExtensionHostAgentServer.ts b/src/vs/server/node/remoteExtensionHostAgentServer.ts index 29aa95e5683..c77fbfd3736 100644 --- a/src/vs/server/node/remoteExtensionHostAgentServer.ts +++ b/src/vs/server/node/remoteExtensionHostAgentServer.ts @@ -9,37 +9,41 @@ import * as http from 'http'; import * as net from 'net'; import { performance } from 'perf_hooks'; import * as url from 'url'; -import { LoaderStats } from 'vs/base/common/amd'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CharCode } from 'vs/base/common/charCode'; -import { isSigPipeError, onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors'; -import { isEqualOrParent } from 'vs/base/common/extpath'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { connectionTokenQueryName, FileAccess, getServerRootPath, Schemas } from 'vs/base/common/network'; -import { dirname, join } from 'vs/base/common/path'; -import * as perf from 'vs/base/common/performance'; -import * as platform from 'vs/base/common/platform'; -import { createRegExp, escapeRegExpCharacters } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { getOSReleaseInfo } from 'vs/base/node/osReleaseInfo'; -import { findFreePort } from 'vs/base/node/ports'; -import { addUNCHostToAllowlist, disableUNCAccessRestrictions } from 'vs/base/node/unc'; -import { PersistentProtocol } from 'vs/base/parts/ipc/common/ipc.net'; -import { NodeSocket, WebSocketNodeSocket } from 'vs/base/parts/ipc/node/ipc.net'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ConnectionType, ConnectionTypeRequest, ErrorMessage, HandshakeMessage, IRemoteExtensionHostStartParams, ITunnelConnectionStartParams, SignRequest } from 'vs/platform/remote/common/remoteAgentConnection'; -import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ExtensionHostConnection } from 'vs/server/node/extensionHostConnection'; -import { ManagementConnection } from 'vs/server/node/remoteExtensionManagement'; -import { determineServerConnectionToken, requestHasValidConnectionToken as httpRequestHasValidConnectionToken, ServerConnectionToken, ServerConnectionTokenParseError, ServerConnectionTokenType } from 'vs/server/node/serverConnectionToken'; -import { IServerEnvironmentService, ServerParsedArgs } from 'vs/server/node/serverEnvironmentService'; -import { setupServerServices, SocketServer } from 'vs/server/node/serverServices'; -import { CacheControl, serveError, serveFile, WebClientServer } from 'vs/server/node/webClientServer'; +import { LoaderStats, isESM } from '../../base/common/amd.js'; +import { VSBuffer } from '../../base/common/buffer.js'; +import { CharCode } from '../../base/common/charCode.js'; +import { isSigPipeError, onUnexpectedError, setUnexpectedErrorHandler } from '../../base/common/errors.js'; +import { isEqualOrParent } from '../../base/common/extpath.js'; +import { Disposable, DisposableStore } from '../../base/common/lifecycle.js'; +import { connectionTokenQueryName, FileAccess, getServerRootPath, Schemas } from '../../base/common/network.js'; +import { dirname, join } from '../../base/common/path.js'; +import * as perf from '../../base/common/performance.js'; +import * as platform from '../../base/common/platform.js'; +import { createRegExp, escapeRegExpCharacters } from '../../base/common/strings.js'; +import { URI } from '../../base/common/uri.js'; +import { generateUuid } from '../../base/common/uuid.js'; +import { getOSReleaseInfo } from '../../base/node/osReleaseInfo.js'; +import { findFreePort } from '../../base/node/ports.js'; +import { addUNCHostToAllowlist, disableUNCAccessRestrictions } from '../../base/node/unc.js'; +import { PersistentProtocol } from '../../base/parts/ipc/common/ipc.net.js'; +import { NodeSocket, WebSocketNodeSocket } from '../../base/parts/ipc/node/ipc.net.js'; +import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; +import { IInstantiationService } from '../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../platform/log/common/log.js'; +import { IProductService } from '../../platform/product/common/productService.js'; +import { ConnectionType, ConnectionTypeRequest, ErrorMessage, HandshakeMessage, IRemoteExtensionHostStartParams, ITunnelConnectionStartParams, SignRequest } from '../../platform/remote/common/remoteAgentConnection.js'; +import { RemoteAgentConnectionContext } from '../../platform/remote/common/remoteAgentEnvironment.js'; +import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js'; +import { ExtensionHostConnection } from './extensionHostConnection.js'; +import { ManagementConnection } from './remoteExtensionManagement.js'; +import { determineServerConnectionToken, requestHasValidConnectionToken as httpRequestHasValidConnectionToken, ServerConnectionToken, ServerConnectionTokenParseError, ServerConnectionTokenType } from './serverConnectionToken.js'; +import { IServerEnvironmentService, ServerParsedArgs } from './serverEnvironmentService.js'; +import { setupServerServices, SocketServer } from './serverServices.js'; +import { CacheControl, serveError, serveFile, WebClientServer } from './webClientServer.js'; +// ESM-uncomment-begin +import { createRequire } from 'node:module'; +const require = createRequire(import.meta.url); +// ESM-uncomment-end const SHUTDOWN_TIMEOUT = 5 * 60 * 1000; @@ -696,7 +700,7 @@ export async function createServer(address: string | net.AddressInfo | null, arg let didLogAboutSIGPIPE = false; process.on('SIGPIPE', () => { // See https://github.com/microsoft/vscode-remote-release/issues/6543 - // We would normally install a SIGPIPE listener in bootstrap.js + // We would normally install a SIGPIPE listener in bootstrap-node.js // But in certain situations, the console itself can be in a broken pipe state // so logging SIGPIPE to the console will cause an infinite async loop if (!didLogAboutSIGPIPE) { @@ -768,7 +772,7 @@ export async function createServer(address: string | net.AddressInfo | null, arg const hasVSDA = fs.existsSync(join(FileAccess.asFileUri('').fsPath, '../node_modules/vsda')); if (hasVSDA) { try { - return globalThis._VSCODE_NODE_MODULES['vsda']; + return require('vsda'); } catch (err) { logService.error(err); } @@ -781,7 +785,7 @@ export async function createServer(address: string | net.AddressInfo | null, arg serverBasePath = `/${serverBasePath}`; } - const hasWebClient = fs.existsSync(FileAccess.asFileUri('vs/code/browser/workbench/workbench.html').fsPath); + const hasWebClient = fs.existsSync(FileAccess.asFileUri(`vs/code/browser/workbench/workbench.${isESM ? 'esm.' : ''}html`).fsPath); if (hasWebClient && address && typeof address !== 'string') { // ships the web ui! diff --git a/src/vs/server/node/remoteExtensionManagement.ts b/src/vs/server/node/remoteExtensionManagement.ts index 8c19086588a..d9179e2b2d0 100644 --- a/src/vs/server/node/remoteExtensionManagement.ts +++ b/src/vs/server/node/remoteExtensionManagement.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { PersistentProtocol, ProtocolConstants, ISocket } from 'vs/base/parts/ipc/common/ipc.net'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Emitter, Event } from 'vs/base/common/event'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { ProcessTimeRunOnceScheduler } from 'vs/base/common/async'; +import { PersistentProtocol, ProtocolConstants, ISocket } from '../../base/parts/ipc/common/ipc.net.js'; +import { ILogService } from '../../platform/log/common/log.js'; +import { Emitter, Event } from '../../base/common/event.js'; +import { VSBuffer } from '../../base/common/buffer.js'; +import { ProcessTimeRunOnceScheduler } from '../../base/common/async.js'; function printTime(ms: number): string { let h = 0; diff --git a/src/vs/server/node/remoteExtensionsScanner.ts b/src/vs/server/node/remoteExtensionsScanner.ts index 7b58140ea1b..ee94de1090d 100644 --- a/src/vs/server/node/remoteExtensionsScanner.ts +++ b/src/vs/server/node/remoteExtensionsScanner.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isAbsolute, join, resolve } from 'vs/base/common/path'; -import * as platform from 'vs/base/common/platform'; -import { cwd } from 'vs/base/common/process'; -import { URI } from 'vs/base/common/uri'; -import * as performance from 'vs/base/common/performance'; -import { Event } from 'vs/base/common/event'; -import { IURITransformer, transformOutgoingURIs } from 'vs/base/common/uriIpc'; -import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyExpr, ContextKeyExpression, ContextKeyGreaterEqualsExpr, ContextKeyGreaterExpr, ContextKeyInExpr, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyNotInExpr, ContextKeyRegexExpr, ContextKeySmallerEqualsExpr, ContextKeySmallerExpr, IContextKeyExprMapper } from 'vs/platform/contextkey/common/contextkey'; -import { IExtensionGalleryService, InstallOptions } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionManagementCLI } from 'vs/platform/extensionManagement/common/extensionManagementCLI'; -import { IExtensionsScannerService, toExtensionDescription } from 'vs/platform/extensionManagement/common/extensionsScannerService'; -import { ExtensionType, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { IServerEnvironmentService } from 'vs/server/node/serverEnvironmentService'; -import { dedupExtensions } from 'vs/workbench/services/extensions/common/extensionsUtil'; -import { Schemas } from 'vs/base/common/network'; -import { IRemoteExtensionsScannerService } from 'vs/platform/remote/common/remoteExtensionsScanner'; -import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks'; +import { isAbsolute, join, resolve } from '../../base/common/path.js'; +import * as platform from '../../base/common/platform.js'; +import { cwd } from '../../base/common/process.js'; +import { URI } from '../../base/common/uri.js'; +import * as performance from '../../base/common/performance.js'; +import { Event } from '../../base/common/event.js'; +import { IURITransformer, transformOutgoingURIs } from '../../base/common/uriIpc.js'; +import { IServerChannel } from '../../base/parts/ipc/common/ipc.js'; +import { ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyExpr, ContextKeyExpression, ContextKeyGreaterEqualsExpr, ContextKeyGreaterExpr, ContextKeyInExpr, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyNotInExpr, ContextKeyRegexExpr, ContextKeySmallerEqualsExpr, ContextKeySmallerExpr, IContextKeyExprMapper } from '../../platform/contextkey/common/contextkey.js'; +import { IExtensionGalleryService, InstallOptions } from '../../platform/extensionManagement/common/extensionManagement.js'; +import { ExtensionManagementCLI } from '../../platform/extensionManagement/common/extensionManagementCLI.js'; +import { IExtensionsScannerService, toExtensionDescription } from '../../platform/extensionManagement/common/extensionsScannerService.js'; +import { ExtensionType, IExtensionDescription } from '../../platform/extensions/common/extensions.js'; +import { ILogService } from '../../platform/log/common/log.js'; +import { IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js'; +import { IServerEnvironmentService } from './serverEnvironmentService.js'; +import { dedupExtensions } from '../../workbench/services/extensions/common/extensionsUtil.js'; +import { Schemas } from '../../base/common/network.js'; +import { IRemoteExtensionsScannerService } from '../../platform/remote/common/remoteExtensionsScanner.js'; +import { ILanguagePackService } from '../../platform/languagePacks/common/languagePacks.js'; export class RemoteExtensionsScannerService implements IRemoteExtensionsScannerService { diff --git a/src/vs/server/node/remoteFileSystemProviderServer.ts b/src/vs/server/node/remoteFileSystemProviderServer.ts index 9a4c62a6aff..00c9b24f584 100644 --- a/src/vs/server/node/remoteFileSystemProviderServer.ts +++ b/src/vs/server/node/remoteFileSystemProviderServer.ts @@ -3,18 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { IFileChange } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; -import { createURITransformer } from 'vs/workbench/api/node/uriTransformer'; -import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { posix, delimiter } from 'vs/base/common/path'; -import { IServerEnvironmentService } from 'vs/server/node/serverEnvironmentService'; -import { AbstractDiskFileSystemProviderChannel, AbstractSessionFileWatcher, ISessionFileWatcher } from 'vs/platform/files/node/diskFileSystemProviderServer'; -import { IRecursiveWatcherOptions } from 'vs/platform/files/common/watcher'; +import { Emitter } from '../../base/common/event.js'; +import { URI, UriComponents } from '../../base/common/uri.js'; +import { IURITransformer } from '../../base/common/uriIpc.js'; +import { IFileChange } from '../../platform/files/common/files.js'; +import { ILogService } from '../../platform/log/common/log.js'; +import { createURITransformer } from '../../workbench/api/node/uriTransformer.js'; +import { RemoteAgentConnectionContext } from '../../platform/remote/common/remoteAgentEnvironment.js'; +import { DiskFileSystemProvider } from '../../platform/files/node/diskFileSystemProvider.js'; +import { posix, delimiter } from '../../base/common/path.js'; +import { IServerEnvironmentService } from './serverEnvironmentService.js'; +import { AbstractDiskFileSystemProviderChannel, AbstractSessionFileWatcher, ISessionFileWatcher } from '../../platform/files/node/diskFileSystemProviderServer.js'; +import { IRecursiveWatcherOptions } from '../../platform/files/common/watcher.js'; +import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; export class RemoteAgentFileSystemProviderChannel extends AbstractDiskFileSystemProviderChannel { @@ -22,7 +23,8 @@ export class RemoteAgentFileSystemProviderChannel extends AbstractDiskFileSystem constructor( logService: ILogService, - private readonly environmentService: IServerEnvironmentService + private readonly environmentService: IServerEnvironmentService, + private readonly configurationService: IConfigurationService ) { super(new DiskFileSystemProvider(logService), logService); @@ -52,7 +54,7 @@ export class RemoteAgentFileSystemProviderChannel extends AbstractDiskFileSystem //#region File Watching protected createSessionFileWatcher(uriTransformer: IURITransformer, emitter: Emitter): ISessionFileWatcher { - return new SessionFileWatcher(uriTransformer, emitter, this.logService, this.environmentService); + return new SessionFileWatcher(uriTransformer, emitter, this.logService, this.environmentService, this.configurationService); } //#endregion @@ -64,23 +66,26 @@ class SessionFileWatcher extends AbstractSessionFileWatcher { uriTransformer: IURITransformer, sessionEmitter: Emitter, logService: ILogService, - environmentService: IServerEnvironmentService + environmentService: IServerEnvironmentService, + configurationService: IConfigurationService ) { - super(uriTransformer, sessionEmitter, logService, environmentService); + super(uriTransformer, sessionEmitter, logService, environmentService, configurationService); } protected override getRecursiveWatcherOptions(environmentService: IServerEnvironmentService): IRecursiveWatcherOptions | undefined { + const options = super.getRecursiveWatcherOptions(environmentService); + const fileWatcherPolling = environmentService.args['file-watcher-polling']; if (fileWatcherPolling) { const segments = fileWatcherPolling.split(delimiter); const pollingInterval = Number(segments[0]); if (pollingInterval > 0) { const usePolling = segments.length > 1 ? segments.slice(1) : true; - return { usePolling, pollingInterval }; + return { ...options, usePolling, pollingInterval }; } } - return undefined; + return options; } protected override getExtraExcludes(environmentService: IServerEnvironmentService): string[] | undefined { diff --git a/src/vs/server/node/remoteLanguagePacks.ts b/src/vs/server/node/remoteLanguagePacks.ts index 682b6f2b088..1e6db87fb53 100644 --- a/src/vs/server/node/remoteLanguagePacks.ts +++ b/src/vs/server/node/remoteLanguagePacks.ts @@ -3,46 +3,37 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as fs from 'fs'; -import { FileAccess } from 'vs/base/common/network'; -import * as path from 'vs/base/common/path'; +import { FileAccess } from '../../base/common/network.js'; +import { join } from '../../base/common/path.js'; +import type { INLSConfiguration } from '../../nls.js'; +import { resolveNLSConfiguration } from '../../base/node/nls.js'; +import { Promises } from '../../base/node/pfs.js'; +import product from '../../platform/product/common/product.js'; -import * as lp from 'vs/base/node/languagePacks'; -import product from 'vs/platform/product/common/product'; +const nlsMetadataPath = join(FileAccess.asFileUri('').fsPath); +const defaultMessagesFile = join(nlsMetadataPath, 'nls.messages.json'); +const nlsConfigurationCache = new Map>(); -const metaData = path.join(FileAccess.asFileUri('').fsPath, 'nls.metadata.json'); -const _cache: Map> = new Map(); +export async function getNLSConfiguration(language: string, userDataPath: string): Promise { + if (!product.commit || !(await Promises.exists(defaultMessagesFile))) { + return { + userLocale: 'en', + osLocale: 'en', + resolvedLanguage: 'en', + defaultMessagesFile, -function exists(file: string) { - return new Promise(c => fs.exists(file, c)); -} - -export function getNLSConfiguration(language: string, userDataPath: string): Promise { - return exists(metaData).then((fileExists) => { - if (!fileExists || !product.commit) { - // console.log(`==> MetaData or commit unknown. Using default language.`); - // The OS Locale on the remote side really doesn't matter, so we return the default locale - return Promise.resolve({ locale: 'en', osLocale: 'en', availableLanguages: {} }); - } - const key = `${language}||${userDataPath}`; - let result = _cache.get(key); - if (!result) { - // The OS Locale on the remote side really doesn't matter, so we pass in the same language - result = lp.getNLSConfiguration(product.commit, userDataPath, metaData, language, language).then(value => { - if (InternalNLSConfiguration.is(value)) { - value._languagePackSupport = true; - } - return value; - }); - _cache.set(key, result); - } - return result; - }); -} + // NLS: below 2 are a relic from old times only used by vscode-nls and deprecated + locale: 'en', + availableLanguages: {} + }; + } -export namespace InternalNLSConfiguration { - export function is(value: lp.NLSConfiguration): value is lp.InternalNLSConfiguration { - const candidate: lp.InternalNLSConfiguration = value as lp.InternalNLSConfiguration; - return candidate && typeof candidate._languagePackId === 'string'; + const cacheKey = `${language}||${userDataPath}`; + let result = nlsConfigurationCache.get(cacheKey); + if (!result) { + result = resolveNLSConfiguration({ userLocale: language, osLocale: language, commit: product.commit, userDataPath, nlsMetadataPath }); + nlsConfigurationCache.set(cacheKey, result); } + + return result; } diff --git a/src/vs/server/node/remoteTerminalChannel.ts b/src/vs/server/node/remoteTerminalChannel.ts index 657d3e8238a..399c8d8f8e6 100644 --- a/src/vs/server/node/remoteTerminalChannel.ts +++ b/src/vs/server/node/remoteTerminalChannel.ts @@ -4,35 +4,35 @@ *--------------------------------------------------------------------------------------------*/ import * as os from 'os'; -import { Emitter, Event } from 'vs/base/common/event'; -import { cloneAndChange } from 'vs/base/common/objects'; -import { Disposable } from 'vs/base/common/lifecycle'; -import * as path from 'vs/base/common/path'; -import * as platform from 'vs/base/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { IServerChannel } from 'vs/base/parts/ipc/common/ipc'; -import { createRandomIPCHandle } from 'vs/base/parts/ipc/node/ipc.net'; -import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment'; -import { IPtyHostService, IShellLaunchConfig, ITerminalProfile } from 'vs/platform/terminal/common/terminal'; -import { IGetTerminalLayoutInfoArgs, ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess'; -import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { createURITransformer } from 'vs/workbench/api/node/uriTransformer'; -import { CLIServerBase, ICommandsExecuter } from 'vs/workbench/api/node/extHostCLIServer'; -import { IEnvironmentVariableCollection } from 'vs/platform/terminal/common/environmentVariable'; -import { MergedEnvironmentVariableCollection } from 'vs/platform/terminal/common/environmentVariableCollection'; -import { deserializeEnvironmentDescriptionMap, deserializeEnvironmentVariableCollection } from 'vs/platform/terminal/common/environmentVariableShared'; -import { ICreateTerminalProcessArguments, ICreateTerminalProcessResult, IWorkspaceFolderData, RemoteTerminalChannelEvent, RemoteTerminalChannelRequest } from 'vs/workbench/contrib/terminal/common/remote/terminal'; -import * as terminalEnvironment from 'vs/workbench/contrib/terminal/common/terminalEnvironment'; -import { AbstractVariableResolverService } from 'vs/workbench/services/configurationResolver/common/variableResolver'; -import { buildUserEnvironment } from 'vs/server/node/extensionHostConnection'; -import { IServerEnvironmentService } from 'vs/server/node/serverEnvironmentService'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILogService } from 'vs/platform/log/common/log'; -import { promiseWithResolvers } from 'vs/base/common/async'; -import { shouldUseEnvironmentVariableCollection } from 'vs/platform/terminal/common/terminalEnvironment'; +import { Emitter, Event } from '../../base/common/event.js'; +import { cloneAndChange } from '../../base/common/objects.js'; +import { Disposable } from '../../base/common/lifecycle.js'; +import * as path from '../../base/common/path.js'; +import * as platform from '../../base/common/platform.js'; +import { URI } from '../../base/common/uri.js'; +import { IURITransformer } from '../../base/common/uriIpc.js'; +import { IServerChannel } from '../../base/parts/ipc/common/ipc.js'; +import { createRandomIPCHandle } from '../../base/parts/ipc/node/ipc.net.js'; +import { RemoteAgentConnectionContext } from '../../platform/remote/common/remoteAgentEnvironment.js'; +import { IPtyHostService, IShellLaunchConfig, ITerminalProfile } from '../../platform/terminal/common/terminal.js'; +import { IGetTerminalLayoutInfoArgs, ISetTerminalLayoutInfoArgs } from '../../platform/terminal/common/terminalProcess.js'; +import { IWorkspaceFolder } from '../../platform/workspace/common/workspace.js'; +import { createURITransformer } from '../../workbench/api/node/uriTransformer.js'; +import { CLIServerBase, ICommandsExecuter } from '../../workbench/api/node/extHostCLIServer.js'; +import { IEnvironmentVariableCollection } from '../../platform/terminal/common/environmentVariable.js'; +import { MergedEnvironmentVariableCollection } from '../../platform/terminal/common/environmentVariableCollection.js'; +import { deserializeEnvironmentDescriptionMap, deserializeEnvironmentVariableCollection } from '../../platform/terminal/common/environmentVariableShared.js'; +import { ICreateTerminalProcessArguments, ICreateTerminalProcessResult, IWorkspaceFolderData, RemoteTerminalChannelEvent, RemoteTerminalChannelRequest } from '../../workbench/contrib/terminal/common/remote/terminal.js'; +import * as terminalEnvironment from '../../workbench/contrib/terminal/common/terminalEnvironment.js'; +import { AbstractVariableResolverService } from '../../workbench/services/configurationResolver/common/variableResolver.js'; +import { buildUserEnvironment } from './extensionHostConnection.js'; +import { IServerEnvironmentService } from './serverEnvironmentService.js'; +import { IProductService } from '../../platform/product/common/productService.js'; +import { IExtensionManagementService } from '../../platform/extensionManagement/common/extensionManagement.js'; +import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; +import { ILogService } from '../../platform/log/common/log.js'; +import { promiseWithResolvers } from '../../base/common/async.js'; +import { shouldUseEnvironmentVariableCollection } from '../../platform/terminal/common/terminalEnvironment.js'; class CustomVariableResolver extends AbstractVariableResolverService { constructor( diff --git a/src/vs/server/node/server.cli.ts b/src/vs/server/node/server.cli.ts index 2eed66f7ee0..da4c1f730b7 100644 --- a/src/vs/server/node/server.cli.ts +++ b/src/vs/server/node/server.cli.ts @@ -3,19 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as _fs from 'fs'; -import * as _url from 'url'; -import * as _cp from 'child_process'; -import * as _http from 'http'; -import * as _os from 'os'; -import { cwd } from 'vs/base/common/process'; -import { dirname, extname, resolve, join } from 'vs/base/common/path'; -import { parseArgs, buildHelpMessage, buildVersionMessage, OPTIONS, OptionDescriptions, ErrorReporter } from 'vs/platform/environment/node/argv'; -import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; -import { createWaitMarkerFileSync } from 'vs/platform/environment/node/wait'; -import { PipeCommand } from 'vs/workbench/api/node/extHostCLIServer'; -import { hasStdinWithoutTty, getStdinFilePath, readFromStdin } from 'vs/platform/environment/node/stdin'; -import { DeferredPromise } from 'vs/base/common/async'; +import * as fs from 'fs'; +import * as url from 'url'; +import * as cp from 'child_process'; +import * as http from 'http'; +import { cwd } from '../../base/common/process.js'; +import { dirname, extname, resolve, join } from '../../base/common/path.js'; +import { parseArgs, buildHelpMessage, buildVersionMessage, OPTIONS, OptionDescriptions, ErrorReporter } from '../../platform/environment/node/argv.js'; +import { NativeParsedArgs } from '../../platform/environment/common/argv.js'; +import { createWaitMarkerFileSync } from '../../platform/environment/node/wait.js'; +import { PipeCommand } from '../../workbench/api/node/extHostCLIServer.js'; +import { hasStdinWithoutTty, getStdinFilePath, readFromStdin } from '../../platform/environment/node/stdin.js'; +import { DeferredPromise } from '../../base/common/async.js'; /* * Implements a standalone CLI app that opens VS Code from a remote terminal. @@ -240,8 +239,8 @@ export async function main(desc: ProductDescription, args: string[]): Promise console.log(err)); + const childProcess = cp.fork(join(__dirname, '../../../server-main.js'), cmdLine, { stdio: 'inherit' }); + childProcess.on('error', err => console.log(err)); return; } @@ -270,7 +269,7 @@ export async function main(desc: ProductDescription, args: string[]): Promise process.stdout.write(data)); - cp.stderr.on('data', data => process.stderr.write(data)); + const childProcess = cp.spawn(cliCommand, newCommandline, { cwd: cliCwd, env, stdio: ['inherit', 'pipe', 'pipe'] }); + childProcess.stdout.on('data', data => process.stdout.write(data)); + childProcess.stderr.on('data', data => process.stderr.write(data)); } else { - _cp.spawn(cliCommand, newCommandline, { cwd: cliCwd, env, stdio: 'inherit' }); + cp.spawn(cliCommand, newCommandline, { cwd: cliCwd, env, stdio: 'inherit' }); } } } else { @@ -357,7 +356,7 @@ export async function main(desc: ProductDescription, args: string[]): Promise setTimeout(res, 1000)); } } @@ -376,7 +375,7 @@ function openInBrowser(args: string[], verbose: boolean) { for (const location of args) { try { if (/^(http|https|file):\/\//.test(location)) { - uris.push(_url.parse(location).href); + uris.push(url.parse(location).href); } else { uris.push(pathToURI(location).href); } @@ -406,7 +405,7 @@ function sendToPipe(args: PipeCommand, verbose: boolean): Promise { return; } - const opts: _http.RequestOptions = { + const opts: http.RequestOptions = { socketPath: cliPipe, path: '/', method: 'POST', @@ -416,7 +415,7 @@ function sendToPipe(args: PipeCommand, verbose: boolean): Promise { } }; - const req = _http.request(opts, res => { + const req = http.request(opts, res => { if (res.headers['content-type'] !== 'application/json') { reject('Error in response: Invalid content type: Expected \'application/json\', is: ' + res.headers['content-type']); return; @@ -461,18 +460,18 @@ function fatal(message: string, err: any): void { const preferredCwd = process.env.PWD || cwd(); // prefer process.env.PWD as it does not follow symlinks -function pathToURI(input: string): _url.URL { +function pathToURI(input: string): url.URL { input = input.trim(); input = resolve(preferredCwd, input); - return _url.pathToFileURL(input); + return url.pathToFileURL(input); } function translatePath(input: string, mapFileUri: (input: string) => string, folderURIS: string[], fileURIS: string[]) { const url = pathToURI(input); const mappedUri = mapFileUri(url.href); try { - const stat = _fs.lstatSync(_fs.realpathSync(input)); + const stat = fs.lstatSync(fs.realpathSync(input)); if (stat.isFile()) { fileURIS.push(mappedUri); diff --git a/src/vs/server/node/server.main.ts b/src/vs/server/node/server.main.ts index 469671e5745..f53f9eefcf6 100644 --- a/src/vs/server/node/server.main.ts +++ b/src/vs/server/node/server.main.ts @@ -6,15 +6,15 @@ import * as os from 'os'; import * as fs from 'fs'; import * as net from 'net'; -import { FileAccess } from 'vs/base/common/network'; -import { run as runCli } from 'vs/server/node/remoteExtensionHostAgentCli'; -import { createServer as doCreateServer, IServerAPI } from 'vs/server/node/remoteExtensionHostAgentServer'; -import { parseArgs, ErrorReporter } from 'vs/platform/environment/node/argv'; -import { join, dirname } from 'vs/base/common/path'; +import { FileAccess } from '../../base/common/network.js'; +import { run as runCli } from './remoteExtensionHostAgentCli.js'; +import { createServer as doCreateServer, IServerAPI } from './remoteExtensionHostAgentServer.js'; +import { parseArgs, ErrorReporter } from '../../platform/environment/node/argv.js'; +import { join, dirname } from '../../base/common/path.js'; import { performance } from 'perf_hooks'; -import { serverOptions } from 'vs/server/node/serverEnvironmentService'; -import product from 'vs/platform/product/common/product'; -import * as perf from 'vs/base/common/performance'; +import { serverOptions } from './serverEnvironmentService.js'; +import product from '../../platform/product/common/product.js'; +import * as perf from '../../base/common/performance.js'; perf.mark('code/server/codeLoaded'); (global).vscodeServerCodeLoadedTime = performance.now(); diff --git a/src/vs/server/node/serverConnectionToken.ts b/src/vs/server/node/serverConnectionToken.ts index f976d0e379a..b2036788008 100644 --- a/src/vs/server/node/serverConnectionToken.ts +++ b/src/vs/server/node/serverConnectionToken.ts @@ -7,11 +7,11 @@ import * as cookie from 'cookie'; import * as fs from 'fs'; import * as http from 'http'; import * as url from 'url'; -import * as path from 'vs/base/common/path'; -import { generateUuid } from 'vs/base/common/uuid'; -import { connectionTokenCookieName, connectionTokenQueryName } from 'vs/base/common/network'; -import { ServerParsedArgs } from 'vs/server/node/serverEnvironmentService'; -import { Promises } from 'vs/base/node/pfs'; +import * as path from '../../base/common/path.js'; +import { generateUuid } from '../../base/common/uuid.js'; +import { connectionTokenCookieName, connectionTokenQueryName } from '../../base/common/network.js'; +import { ServerParsedArgs } from './serverEnvironmentService.js'; +import { Promises } from '../../base/node/pfs.js'; const connectionTokenRegex = /^[0-9A-Za-z_-]+$/; @@ -100,7 +100,7 @@ export async function determineServerConnectionToken(args: ServerParsedArgs): Pr // First try to find a connection token try { - const fileContents = await Promises.readFile(storageLocation); + const fileContents = await fs.promises.readFile(storageLocation); const connectionToken = fileContents.toString().replace(/\r?\n$/, ''); if (connectionTokenRegex.test(connectionToken)) { return connectionToken; diff --git a/src/vs/server/node/serverEnvironmentService.ts b/src/vs/server/node/serverEnvironmentService.ts index fce1842f1bd..2770df603e5 100644 --- a/src/vs/server/node/serverEnvironmentService.ts +++ b/src/vs/server/node/serverEnvironmentService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; - -import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService'; -import { OPTIONS, OptionDescriptions } from 'vs/platform/environment/node/argv'; -import { refineServiceDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { memoize } from 'vs/base/common/decorators'; -import { URI } from 'vs/base/common/uri'; +import * as nls from '../../nls.js'; + +import { NativeEnvironmentService } from '../../platform/environment/node/environmentService.js'; +import { OPTIONS, OptionDescriptions } from '../../platform/environment/node/argv.js'; +import { refineServiceDecorator } from '../../platform/instantiation/common/instantiation.js'; +import { IEnvironmentService, INativeEnvironmentService } from '../../platform/environment/common/environment.js'; +import { memoize } from '../../base/common/decorators.js'; +import { URI } from '../../base/common/uri.js'; export const serverOptions: OptionDescriptions> = { diff --git a/src/vs/server/node/serverServices.ts b/src/vs/server/node/serverServices.ts index 46f2f004655..cd1091150db 100644 --- a/src/vs/server/node/serverServices.ts +++ b/src/vs/server/node/serverServices.ts @@ -4,79 +4,80 @@ *--------------------------------------------------------------------------------------------*/ import { hostname, release } from 'os'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import * as path from 'vs/base/common/path'; -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { getMachineId, getSqmMachineId, getdevDeviceId } from 'vs/base/node/id'; -import { Promises } from 'vs/base/node/pfs'; -import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from 'vs/base/parts/ipc/common/ipc'; -import { ProtocolConstants } from 'vs/base/parts/ipc/common/ipc.net'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ConfigurationService } from 'vs/platform/configuration/common/configurationService'; -import { ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc'; -import { IDownloadService } from 'vs/platform/download/common/download'; -import { DownloadServiceChannelClient } from 'vs/platform/download/common/downloadIpc'; -import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ExtensionGalleryServiceWithNoStorageService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; -import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionSignatureVerificationService, IExtensionSignatureVerificationService } from 'vs/platform/extensionManagement/node/extensionSignatureVerificationService'; -import { ExtensionManagementCLI } from 'vs/platform/extensionManagement/common/extensionManagementCLI'; -import { ExtensionManagementChannel } from 'vs/platform/extensionManagement/common/extensionManagementIpc'; -import { ExtensionManagementService, INativeServerExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { FileService } from 'vs/platform/files/common/fileService'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks'; -import { NativeLanguagePackService } from 'vs/platform/languagePacks/node/languagePacks'; -import { AbstractLogger, DEFAULT_LOG_LEVEL, getLogLevel, ILoggerService, ILogService, log, LogLevel, LogLevelToString } from 'vs/platform/log/common/log'; -import product from 'vs/platform/product/common/product'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { RequestChannel } from 'vs/platform/request/common/requestIpc'; -import { RequestService } from 'vs/platform/request/node/requestService'; -import { resolveCommonProperties } from 'vs/platform/telemetry/common/commonProperties'; -import { ITelemetryService, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { ITelemetryServiceConfig } from 'vs/platform/telemetry/common/telemetryService'; -import { getPiiPathsFromEnvironment, isInternalTelemetry, isLoggingOnly, ITelemetryAppender, NullAppender, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; -import ErrorTelemetry from 'vs/platform/telemetry/node/errorTelemetry'; -import { IPtyService, TerminalSettingId } from 'vs/platform/terminal/common/terminal'; -import { PtyHostService } from 'vs/platform/terminal/node/ptyHostService'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { RemoteAgentEnvironmentChannel } from 'vs/server/node/remoteAgentEnvironmentImpl'; -import { RemoteAgentFileSystemProviderChannel } from 'vs/server/node/remoteFileSystemProviderServer'; -import { ServerTelemetryChannel } from 'vs/platform/telemetry/common/remoteTelemetryChannel'; -import { IServerTelemetryService, ServerNullTelemetryService, ServerTelemetryService } from 'vs/platform/telemetry/common/serverTelemetryService'; -import { RemoteTerminalChannel } from 'vs/server/node/remoteTerminalChannel'; -import { createURITransformer } from 'vs/workbench/api/node/uriTransformer'; -import { ServerConnectionToken } from 'vs/server/node/serverConnectionToken'; -import { ServerEnvironmentService, ServerParsedArgs } from 'vs/server/node/serverEnvironmentService'; -import { REMOTE_TERMINAL_CHANNEL_NAME } from 'vs/workbench/contrib/terminal/common/remote/remoteTerminalChannel'; -import { REMOTE_FILE_SYSTEM_CHANNEL_NAME } from 'vs/workbench/services/remote/common/remoteFileSystemProviderClient'; -import { ExtensionHostStatusService, IExtensionHostStatusService } from 'vs/server/node/extensionHostStatusService'; -import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService'; -import { ExtensionsScannerService } from 'vs/server/node/extensionsScannerService'; -import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { NullPolicyService } from 'vs/platform/policy/common/policy'; -import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender'; -import { LoggerService } from 'vs/platform/log/node/loggerService'; -import { ServerUserDataProfilesService } from 'vs/platform/userDataProfile/node/userDataProfile'; -import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService'; -import { LogService } from 'vs/platform/log/common/logService'; -import { LoggerChannel } from 'vs/platform/log/common/logIpc'; -import { localize } from 'vs/nls'; -import { RemoteExtensionsScannerChannel, RemoteExtensionsScannerService } from 'vs/server/node/remoteExtensionsScanner'; -import { RemoteExtensionsScannerChannelName } from 'vs/platform/remote/common/remoteExtensionsScanner'; -import { RemoteUserDataProfilesServiceChannel } from 'vs/platform/userDataProfile/common/userDataProfileIpc'; -import { NodePtyHostStarter } from 'vs/platform/terminal/node/nodePtyHostStarter'; +import { Emitter, Event } from '../../base/common/event.js'; +import { DisposableStore, toDisposable } from '../../base/common/lifecycle.js'; +import { Schemas } from '../../base/common/network.js'; +import * as path from '../../base/common/path.js'; +import { IURITransformer } from '../../base/common/uriIpc.js'; +import { getMachineId, getSqmMachineId, getdevDeviceId } from '../../base/node/id.js'; +import { Promises } from '../../base/node/pfs.js'; +import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from '../../base/parts/ipc/common/ipc.js'; +import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js'; +import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; +import { ConfigurationService } from '../../platform/configuration/common/configurationService.js'; +import { ExtensionHostDebugBroadcastChannel } from '../../platform/debug/common/extensionHostDebugIpc.js'; +import { IDownloadService } from '../../platform/download/common/download.js'; +import { DownloadServiceChannelClient } from '../../platform/download/common/downloadIpc.js'; +import { IEnvironmentService, INativeEnvironmentService } from '../../platform/environment/common/environment.js'; +import { ExtensionGalleryServiceWithNoStorageService } from '../../platform/extensionManagement/common/extensionGalleryService.js'; +import { IExtensionGalleryService } from '../../platform/extensionManagement/common/extensionManagement.js'; +import { ExtensionSignatureVerificationService, IExtensionSignatureVerificationService } from '../../platform/extensionManagement/node/extensionSignatureVerificationService.js'; +import { ExtensionManagementCLI } from '../../platform/extensionManagement/common/extensionManagementCLI.js'; +import { ExtensionManagementChannel } from '../../platform/extensionManagement/common/extensionManagementIpc.js'; +import { ExtensionManagementService, INativeServerExtensionManagementService } from '../../platform/extensionManagement/node/extensionManagementService.js'; +import { IFileService } from '../../platform/files/common/files.js'; +import { FileService } from '../../platform/files/common/fileService.js'; +import { DiskFileSystemProvider } from '../../platform/files/node/diskFileSystemProvider.js'; +import { SyncDescriptor } from '../../platform/instantiation/common/descriptors.js'; +import { IInstantiationService } from '../../platform/instantiation/common/instantiation.js'; +import { InstantiationService } from '../../platform/instantiation/common/instantiationService.js'; +import { ServiceCollection } from '../../platform/instantiation/common/serviceCollection.js'; +import { ILanguagePackService } from '../../platform/languagePacks/common/languagePacks.js'; +import { NativeLanguagePackService } from '../../platform/languagePacks/node/languagePacks.js'; +import { AbstractLogger, DEFAULT_LOG_LEVEL, getLogLevel, ILoggerService, ILogService, log, LogLevel, LogLevelToString } from '../../platform/log/common/log.js'; +import product from '../../platform/product/common/product.js'; +import { IProductService } from '../../platform/product/common/productService.js'; +import { RemoteAgentConnectionContext } from '../../platform/remote/common/remoteAgentEnvironment.js'; +import { IRequestService } from '../../platform/request/common/request.js'; +import { RequestChannel } from '../../platform/request/common/requestIpc.js'; +import { RequestService } from '../../platform/request/node/requestService.js'; +import { resolveCommonProperties } from '../../platform/telemetry/common/commonProperties.js'; +import { ITelemetryService, TelemetryLevel } from '../../platform/telemetry/common/telemetry.js'; +import { ITelemetryServiceConfig } from '../../platform/telemetry/common/telemetryService.js'; +import { getPiiPathsFromEnvironment, isInternalTelemetry, isLoggingOnly, ITelemetryAppender, NullAppender, supportsTelemetry } from '../../platform/telemetry/common/telemetryUtils.js'; +import ErrorTelemetry from '../../platform/telemetry/node/errorTelemetry.js'; +import { IPtyService, TerminalSettingId } from '../../platform/terminal/common/terminal.js'; +import { PtyHostService } from '../../platform/terminal/node/ptyHostService.js'; +import { IUriIdentityService } from '../../platform/uriIdentity/common/uriIdentity.js'; +import { UriIdentityService } from '../../platform/uriIdentity/common/uriIdentityService.js'; +import { RemoteAgentEnvironmentChannel } from './remoteAgentEnvironmentImpl.js'; +import { RemoteAgentFileSystemProviderChannel } from './remoteFileSystemProviderServer.js'; +import { ServerTelemetryChannel } from '../../platform/telemetry/common/remoteTelemetryChannel.js'; +import { IServerTelemetryService, ServerNullTelemetryService, ServerTelemetryService } from '../../platform/telemetry/common/serverTelemetryService.js'; +import { RemoteTerminalChannel } from './remoteTerminalChannel.js'; +import { createURITransformer } from '../../workbench/api/node/uriTransformer.js'; +import { ServerConnectionToken } from './serverConnectionToken.js'; +import { ServerEnvironmentService, ServerParsedArgs } from './serverEnvironmentService.js'; +import { REMOTE_TERMINAL_CHANNEL_NAME } from '../../workbench/contrib/terminal/common/remote/remoteTerminalChannel.js'; +import { REMOTE_FILE_SYSTEM_CHANNEL_NAME } from '../../workbench/services/remote/common/remoteFileSystemProviderClient.js'; +import { ExtensionHostStatusService, IExtensionHostStatusService } from './extensionHostStatusService.js'; +import { IExtensionsScannerService } from '../../platform/extensionManagement/common/extensionsScannerService.js'; +import { ExtensionsScannerService } from './extensionsScannerService.js'; +import { IExtensionsProfileScannerService } from '../../platform/extensionManagement/common/extensionsProfileScannerService.js'; +import { IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js'; +import { NullPolicyService } from '../../platform/policy/common/policy.js'; +import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js'; +import { LoggerService } from '../../platform/log/node/loggerService.js'; +import { ServerUserDataProfilesService } from '../../platform/userDataProfile/node/userDataProfile.js'; +import { ExtensionsProfileScannerService } from '../../platform/extensionManagement/node/extensionsProfileScannerService.js'; +import { LogService } from '../../platform/log/common/logService.js'; +import { LoggerChannel } from '../../platform/log/common/logIpc.js'; +import { localize } from '../../nls.js'; +import { RemoteExtensionsScannerChannel, RemoteExtensionsScannerService } from './remoteExtensionsScanner.js'; +import { RemoteExtensionsScannerChannelName } from '../../platform/remote/common/remoteExtensionsScanner.js'; +import { RemoteUserDataProfilesServiceChannel } from '../../platform/userDataProfile/common/userDataProfileIpc.js'; +import { NodePtyHostStarter } from '../../platform/terminal/node/nodePtyHostStarter.js'; +import { CSSDevelopmentService, ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js'; const eventPrefix = 'monacoworkbench'; @@ -131,6 +132,9 @@ export async function setupServerServices(connectionToken: ServerConnectionToken services.set(IUserDataProfilesService, userDataProfilesService); socketServer.registerChannel('userDataProfiles', new RemoteUserDataProfilesServiceChannel(userDataProfilesService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority))); + // Dev Only: CSS service (for ESM) + services.set(ICSSDevelopmentService, new SyncDescriptor(CSSDevelopmentService, undefined, true)); + // Initialize const [, , machineId, sqmId, devDeviceId] = await Promise.all([ configurationService.initialize(), @@ -144,7 +148,7 @@ export async function setupServerServices(connectionToken: ServerConnectionToken services.set(IExtensionHostStatusService, extensionHostStatusService); // Request - const requestService = new RequestService(configurationService, environmentService, logService, loggerService); + const requestService = new RequestService(configurationService, environmentService, logService); services.set(IRequestService, requestService); let oneDsAppender: ITelemetryAppender = NullAppender; @@ -217,7 +221,7 @@ export async function setupServerServices(connectionToken: ServerConnectionToken const remoteExtensionsScanner = new RemoteExtensionsScannerService(instantiationService.createInstance(ExtensionManagementCLI, logService), environmentService, userDataProfilesService, extensionsScannerService, logService, extensionGalleryService, languagePackService); socketServer.registerChannel(RemoteExtensionsScannerChannelName, new RemoteExtensionsScannerChannel(remoteExtensionsScanner, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority))); - const remoteFileSystemChannel = disposables.add(new RemoteAgentFileSystemProviderChannel(logService, environmentService)); + const remoteFileSystemChannel = disposables.add(new RemoteAgentFileSystemProviderChannel(logService, environmentService, configurationService)); socketServer.registerChannel(REMOTE_FILE_SYSTEM_CHANNEL_NAME, remoteFileSystemChannel); socketServer.registerChannel('request', new RequestChannel(accessor.get(IRequestService))); diff --git a/src/vs/server/node/webClientServer.ts b/src/vs/server/node/webClientServer.ts index 6dc550b6cf0..6ef3eac5f02 100644 --- a/src/vs/server/node/webClientServer.ts +++ b/src/vs/server/node/webClientServer.ts @@ -3,32 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createReadStream } from 'fs'; -import { Promises } from 'vs/base/node/pfs'; +import { createReadStream, promises } from 'fs'; import * as path from 'path'; import * as http from 'http'; import * as url from 'url'; import * as cookie from 'cookie'; import * as crypto from 'crypto'; -import { isEqualOrParent } from 'vs/base/common/extpath'; -import { getMediaMime } from 'vs/base/common/mime'; -import { isLinux } from 'vs/base/common/platform'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IServerEnvironmentService } from 'vs/server/node/serverEnvironmentService'; -import { extname, dirname, join, normalize } from 'vs/base/common/path'; -import { FileAccess, connectionTokenCookieName, connectionTokenQueryName, Schemas, builtinExtensionsPath } from 'vs/base/common/network'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ServerConnectionToken, ServerConnectionTokenType } from 'vs/server/node/serverConnectionToken'; -import { asTextOrError, IRequestService } from 'vs/platform/request/common/request'; -import { IHeaders } from 'vs/base/parts/request/common/request'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { URI } from 'vs/base/common/uri'; -import { streamToBuffer } from 'vs/base/common/buffer'; -import { IProductConfiguration } from 'vs/base/common/product'; -import { isString } from 'vs/base/common/types'; -import { CharCode } from 'vs/base/common/charCode'; -import { IExtensionManifest } from 'vs/platform/extensions/common/extensions'; +import { isEqualOrParent } from '../../base/common/extpath.js'; +import { getMediaMime } from '../../base/common/mime.js'; +import { isLinux } from '../../base/common/platform.js'; +import { ILogService } from '../../platform/log/common/log.js'; +import { IServerEnvironmentService } from './serverEnvironmentService.js'; +import { extname, dirname, join, normalize } from '../../base/common/path.js'; +import { FileAccess, connectionTokenCookieName, connectionTokenQueryName, Schemas, builtinExtensionsPath } from '../../base/common/network.js'; +import { generateUuid } from '../../base/common/uuid.js'; +import { IProductService } from '../../platform/product/common/productService.js'; +import { ServerConnectionToken, ServerConnectionTokenType } from './serverConnectionToken.js'; +import { asTextOrError, IRequestService } from '../../platform/request/common/request.js'; +import { IHeaders } from '../../base/parts/request/common/request.js'; +import { CancellationToken } from '../../base/common/cancellation.js'; +import { URI } from '../../base/common/uri.js'; +import { streamToBuffer } from '../../base/common/buffer.js'; +import { IProductConfiguration } from '../../base/common/product.js'; +import { isString } from '../../base/common/types.js'; +import { CharCode } from '../../base/common/charCode.js'; +import { IExtensionManifest } from '../../platform/extensions/common/extensions.js'; +import { isESM } from '../../base/common/amd.js'; +import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js'; const textMimeType: { [ext: string]: string | undefined } = { '.html': 'text/html', @@ -55,7 +56,7 @@ export const enum CacheControl { */ export async function serveFile(filePath: string, cacheControl: CacheControl, logService: ILogService, req: http.IncomingMessage, res: http.ServerResponse, responseHeaders: Record): Promise { try { - const stat = await Promises.stat(filePath); // throws an error if file doesn't exist + const stat = await promises.stat(filePath); // throws an error if file doesn't exist if (cacheControl === CacheControl.ETAG) { // Check if file modified since @@ -109,6 +110,7 @@ export class WebClientServer { @ILogService private readonly _logService: ILogService, @IRequestService private readonly _requestService: IRequestService, @IProductService private readonly _productService: IProductService, + @ICSSDevelopmentService private readonly _cssDevService: ICSSDevelopmentService ) { this._webExtensionResourceUrlTemplate = this._productService.extensionsGallery?.resourceUrlTemplate ? URI.parse(this._productService.extensionsGallery.resourceUrlTemplate) : undefined; @@ -222,7 +224,7 @@ export class WebClientServer { return serveError(req, res, status, text || `Request failed with status ${status}`); } - const responseHeaders: Record = Object.create(null); + const responseHeaders: Record = Object.create(null); const setResponseHeader = (header: string) => { const value = context.res.headers[header]; if (value) { @@ -298,7 +300,7 @@ export class WebClientServer { const resolveWorkspaceURI = (defaultLocation?: string) => defaultLocation && URI.file(path.resolve(defaultLocation)).with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority }); - const filePath = FileAccess.asFileUri(this._environmentService.isBuilt ? 'vs/code/browser/workbench/workbench.html' : 'vs/code/browser/workbench/workbench-dev.html').fsPath; + const filePath = FileAccess.asFileUri(`vs/code/browser/workbench/workbench${this._environmentService.isBuilt ? '' : '-dev'}.${isESM ? 'esm.' : ''}html`).fsPath; const authSessionInfo = !this._environmentService.isBuilt && this._environmentService.args['github-auth'] ? { id: generateUuid(), providerId: 'github', @@ -320,7 +322,7 @@ export class WebClientServer { if (!this._environmentService.isBuilt) { try { - const productOverrides = JSON.parse((await Promises.readFile(join(APP_ROOT, 'product.overrides.json'))).toString()); + const productOverrides = JSON.parse((await promises.readFile(join(APP_ROOT, 'product.overrides.json'))).toString()); Object.assign(productConfiguration, productOverrides); } catch (err) {/* Ignore Error */ } } @@ -338,18 +340,39 @@ export class WebClientServer { callbackRoute: this._callbackRoute }; - const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl; + const cookies = cookie.parse(req.headers.cookie || ''); + const locale = cookies['vscode.nls.locale'] || req.headers['accept-language']?.split(',')[0]?.toLowerCase() || 'en'; + let WORKBENCH_NLS_BASE_URL: string | undefined; + let WORKBENCH_NLS_URL: string; + if (!locale.startsWith('en') && this._productService.nlsCoreBaseUrl) { + WORKBENCH_NLS_BASE_URL = this._productService.nlsCoreBaseUrl; + WORKBENCH_NLS_URL = `${WORKBENCH_NLS_BASE_URL}${this._productService.commit}/${this._productService.version}/${locale}/nls.messages.js`; + } else { + WORKBENCH_NLS_URL = ''; // fallback will apply + } + const values: { [key: string]: string } = { WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration), WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '', WORKBENCH_WEB_BASE_URL: this._staticRoute, - WORKBENCH_NLS_BASE_URL: nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : '', + WORKBENCH_NLS_URL, + WORKBENCH_NLS_FALLBACK_URL: `${this._staticRoute}/out/nls.messages.js` }; + // DEV --------------------------------------------------------------------------------------- + // DEV: This is for development and enables loading CSS via import-statements via import-maps. + // DEV: The server needs to send along all CSS modules so that the client can construct the + // DEV: import-map. + // DEV --------------------------------------------------------------------------------------- + if (this._cssDevService.isEnabled) { + const cssModules = await this._cssDevService.getCssModules(); + values['WORKBENCH_DEV_CSS_MODULES'] = JSON.stringify(cssModules); + } + if (useTestResolver) { const bundledExtensions: { extensionPath: string; packageJSON: IExtensionManifest }[] = []; for (const extensionPath of ['vscode-test-resolver', 'github-authentication']) { - const packageJSON = JSON.parse((await Promises.readFile(FileAccess.asFileUri(`${builtinExtensionsPath}/${extensionPath}/package.json`).fsPath)).toString()); + const packageJSON = JSON.parse((await promises.readFile(FileAccess.asFileUri(`${builtinExtensionsPath}/${extensionPath}/package.json`).fsPath)).toString()); bundledExtensions.push({ extensionPath, packageJSON }); } values['WORKBENCH_BUILTIN_EXTENSIONS'] = asJSON(bundledExtensions); @@ -357,20 +380,22 @@ export class WebClientServer { let data; try { - const workbenchTemplate = (await Promises.readFile(filePath)).toString(); + const workbenchTemplate = (await promises.readFile(filePath)).toString(); data = workbenchTemplate.replace(/\{\{([^}]+)\}\}/g, (_, key) => values[key] ?? 'undefined'); } catch (e) { res.writeHead(404, { 'Content-Type': 'text/plain' }); return void res.end('Not found'); } - const webWorkerExtensionHostIframeScriptSHA = 'sha256-75NYUUvf+5++1WbfCZOV3PSWxBhONpaxwx+mkOFRv/Y='; + const webWorkerExtensionHostIframeScriptSHA = isESM ? 'sha256-2Q+j4hfT09+1+imS46J2YlkCtHWQt0/BE79PXjJ0ZJ8=' : 'sha256-V28GQnL3aYxbwgpV3yW1oJ+VKKe/PBSzWntNyH8zVXA='; const cspDirectives = [ 'default-src \'self\';', 'img-src \'self\' https: data: blob:;', 'media-src \'self\';', - `script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : `http://${remoteAuthority}`};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html + isESM ? + `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${useTestResolver ? '' : `http://${remoteAuthority}`};` : // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html + `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : `http://${remoteAuthority}`};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html 'child-src \'self\';', `frame-src 'self' https://*.vscode-cdn.net data:;`, 'worker-src \'self\' data: blob:;', @@ -426,7 +451,7 @@ export class WebClientServer { */ private async _handleCallback(res: http.ServerResponse): Promise { const filePath = FileAccess.asFileUri('vs/code/browser/workbench/callback.html').fsPath; - const data = (await Promises.readFile(filePath)).toString(); + const data = (await promises.readFile(filePath)).toString(); const cspDirectives = [ 'default-src \'self\';', 'img-src \'self\' https: data: blob:;', diff --git a/src/vs/server/test/node/serverConnectionToken.test.ts b/src/vs/server/test/node/serverConnectionToken.test.ts index b04dab4d308..67756065062 100644 --- a/src/vs/server/test/node/serverConnectionToken.test.ts +++ b/src/vs/server/test/node/serverConnectionToken.test.ts @@ -7,10 +7,10 @@ import assert from 'assert'; import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { getRandomTestPath } from 'vs/base/test/node/testUtils'; -import { parseServerConnectionToken, ServerConnectionToken, ServerConnectionTokenParseError, ServerConnectionTokenType } from 'vs/server/node/serverConnectionToken'; -import { ServerParsedArgs } from 'vs/server/node/serverEnvironmentService'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../base/test/common/utils.js'; +import { getRandomTestPath } from '../../../base/test/node/testUtils.js'; +import { parseServerConnectionToken, ServerConnectionToken, ServerConnectionTokenParseError, ServerConnectionTokenType } from '../../node/serverConnectionToken.js'; +import { ServerParsedArgs } from '../../node/serverEnvironmentService.js'; suite('parseServerConnectionToken', () => { ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/workbench/api/browser/extensionHost.contribution.ts b/src/vs/workbench/api/browser/extensionHost.contribution.ts index aeb196df365..c56c311ea4c 100644 --- a/src/vs/workbench/api/browser/extensionHost.contribution.ts +++ b/src/vs/workbench/api/browser/extensionHost.contribution.ts @@ -3,97 +3,96 @@ * 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'; -import './mainThreadModelSelection'; -import './mainThreadAideChatAgents2'; -import './mainThreadAideChatVariables'; -import './mainThreadAideProbeProvider'; -import './mainThreadLanguageModels'; -import './mainThreadChatAgents2'; -import './mainThreadChatVariables'; -import './mainThreadLanguageModelTools'; -import './mainThreadEmbeddings'; -import './mainThreadCodeInsets'; -import './mainThreadCLICommands'; -import './mainThreadClipboard'; -import './mainThreadCommands'; -import './mainThreadConfiguration'; -import './mainThreadConsole'; -import './mainThreadDebugService'; -import './mainThreadDecorations'; -import './mainThreadDiagnostics'; -import './mainThreadDialogs'; -import './mainThreadDocumentContentProviders'; -import './mainThreadDocuments'; -import './mainThreadDocumentsAndEditors'; -import './mainThreadEditor'; -import './mainThreadEditors'; -import './mainThreadEditorTabs'; -import './mainThreadErrors'; -import './mainThreadExtensionService'; -import './mainThreadFileSystem'; -import './mainThreadFileSystemEventService'; -import './mainThreadLanguageFeatures'; -import './mainThreadLanguages'; -import './mainThreadLogService'; -import './mainThreadMessageService'; -import './mainThreadManagedSockets'; -import './mainThreadOutputService'; -import './mainThreadProgress'; -import './mainThreadQuickDiff'; -import './mainThreadQuickOpen'; -import './mainThreadRemoteConnectionData'; -import './mainThreadSaveParticipant'; -import './mainThreadSpeech'; -import './mainThreadEditSessionIdentityParticipant'; -import './mainThreadSCM'; -import './mainThreadSearch'; -import './mainThreadStatusBar'; -import './mainThreadStorage'; -import './mainThreadTelemetry'; -import './mainThreadTerminalService'; -import './mainThreadTerminalShellIntegration'; -import './mainThreadTheming'; -import './mainThreadTreeViews'; -import './mainThreadDownloadService'; -import './mainThreadUrls'; -import './mainThreadUriOpeners'; -import './mainThreadWindow'; -import './mainThreadWebviewManager'; -import './mainThreadWorkspace'; -import './mainThreadComments'; -import './mainThreadNotebook'; -import './mainThreadNotebookKernels'; -import './mainThreadNotebookDocumentsAndEditors'; -import './mainThreadNotebookRenderers'; -import './mainThreadNotebookSaveParticipant'; -import './mainThreadInteractive'; -import './mainThreadTask'; -import './mainThreadLabelService'; -import './mainThreadTunnelService'; -import './mainThreadAuthentication'; -import './mainThreadCSAuthentication'; -import './mainThreadTimeline'; -import './mainThreadTesting'; -import './mainThreadSecretState'; -import './mainThreadShare'; -import './mainThreadProfileContentHandlers'; -import './mainThreadAiRelatedInformation'; -import './mainThreadAiEmbeddingVector'; -import './mainThreadCSEvents'; +import './mainThreadLocalization.js'; +import './mainThreadBulkEdits.js'; +import './mainThreadModelSelection.js'; +import './mainThreadAideProbeProvider.js'; +import './mainThreadLanguageModels.js'; +import './mainThreadChatAgents2.js'; +import './mainThreadChatVariables.js'; +import './mainThreadChatCodeMapper.js'; +import './mainThreadLanguageModelTools.js'; +import './mainThreadEmbeddings.js'; +import './mainThreadCodeInsets.js'; +import './mainThreadCLICommands.js'; +import './mainThreadClipboard.js'; +import './mainThreadCommands.js'; +import './mainThreadConfiguration.js'; +import './mainThreadConsole.js'; +import './mainThreadDebugService.js'; +import './mainThreadDecorations.js'; +import './mainThreadDiagnostics.js'; +import './mainThreadDialogs.js'; +import './mainThreadDocumentContentProviders.js'; +import './mainThreadDocuments.js'; +import './mainThreadDocumentsAndEditors.js'; +import './mainThreadEditor.js'; +import './mainThreadEditors.js'; +import './mainThreadEditorTabs.js'; +import './mainThreadErrors.js'; +import './mainThreadExtensionService.js'; +import './mainThreadFileSystem.js'; +import './mainThreadFileSystemEventService.js'; +import './mainThreadLanguageFeatures.js'; +import './mainThreadLanguages.js'; +import './mainThreadLogService.js'; +import './mainThreadMessageService.js'; +import './mainThreadManagedSockets.js'; +import './mainThreadOutputService.js'; +import './mainThreadProgress.js'; +import './mainThreadQuickDiff.js'; +import './mainThreadQuickOpen.js'; +import './mainThreadRemoteConnectionData.js'; +import './mainThreadSaveParticipant.js'; +import './mainThreadSpeech.js'; +import './mainThreadEditSessionIdentityParticipant.js'; +import './mainThreadSCM.js'; +import './mainThreadSearch.js'; +import './mainThreadStatusBar.js'; +import './mainThreadStorage.js'; +import './mainThreadTelemetry.js'; +import './mainThreadTerminalService.js'; +import './mainThreadTerminalShellIntegration.js'; +import './mainThreadTheming.js'; +import './mainThreadTreeViews.js'; +import './mainThreadDownloadService.js'; +import './mainThreadUrls.js'; +import './mainThreadUriOpeners.js'; +import './mainThreadWindow.js'; +import './mainThreadWebviewManager.js'; +import './mainThreadWorkspace.js'; +import './mainThreadComments.js'; +import './mainThreadNotebook.js'; +import './mainThreadNotebookKernels.js'; +import './mainThreadNotebookDocumentsAndEditors.js'; +import './mainThreadNotebookRenderers.js'; +import './mainThreadNotebookSaveParticipant.js'; +import './mainThreadInteractive.js'; +import './mainThreadTask.js'; +import './mainThreadLabelService.js'; +import './mainThreadTunnelService.js'; +import './mainThreadAuthentication.js'; +import './mainThreadCSAuthentication.js'; +import './mainThreadTimeline.js'; +import './mainThreadTesting.js'; +import './mainThreadSecretState.js'; +import './mainThreadShare.js'; +import './mainThreadProfileContentHandlers.js'; +import './mainThreadAiRelatedInformation.js'; +import './mainThreadAiEmbeddingVector.js'; +import './mainThreadCSEvents.js'; export class ExtensionPoints implements IWorkbenchContribution { diff --git a/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.ts b/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.ts index 954679e2c52..68906b6ce3a 100644 --- a/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.ts +++ b/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Disposable, DisposableMap } from 'vs/base/common/lifecycle'; -import { ExtHostAiEmbeddingVectorShape, ExtHostContext, MainContext, MainThreadAiEmbeddingVectorShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IAiEmbeddingVectorProvider, IAiEmbeddingVectorService } from 'vs/workbench/services/aiEmbeddingVector/common/aiEmbeddingVectorService'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Disposable, DisposableMap } from '../../../base/common/lifecycle.js'; +import { ExtHostAiEmbeddingVectorShape, ExtHostContext, MainContext, MainThreadAiEmbeddingVectorShape } from '../common/extHost.protocol.js'; +import { IAiEmbeddingVectorProvider, IAiEmbeddingVectorService } from '../../services/aiEmbeddingVector/common/aiEmbeddingVectorService.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; @extHostNamedCustomer(MainContext.MainThreadAiEmbeddingVector) export class MainThreadAiEmbeddingVector extends Disposable implements MainThreadAiEmbeddingVectorShape { diff --git a/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.ts b/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.ts index e254b5f4149..722866e7154 100644 --- a/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.ts +++ b/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Disposable, DisposableMap } from 'vs/base/common/lifecycle'; -import { ExtHostAiRelatedInformationShape, ExtHostContext, MainContext, MainThreadAiRelatedInformationShape } from 'vs/workbench/api/common/extHost.protocol'; -import { RelatedInformationType } from 'vs/workbench/api/common/extHostTypes'; -import { IAiRelatedInformationProvider, IAiRelatedInformationService, RelatedInformationResult } from 'vs/workbench/services/aiRelatedInformation/common/aiRelatedInformation'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Disposable, DisposableMap } from '../../../base/common/lifecycle.js'; +import { ExtHostAiRelatedInformationShape, ExtHostContext, MainContext, MainThreadAiRelatedInformationShape } from '../common/extHost.protocol.js'; +import { RelatedInformationType } from '../common/extHostTypes.js'; +import { IAiRelatedInformationProvider, IAiRelatedInformationService, RelatedInformationResult } from '../../services/aiRelatedInformation/common/aiRelatedInformation.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; @extHostNamedCustomer(MainContext.MainThreadAiRelatedInformation) export class MainThreadAiRelatedInformation extends Disposable implements MainThreadAiRelatedInformationShape { diff --git a/src/vs/workbench/api/browser/mainThreadAideChatAgents2.ts b/src/vs/workbench/api/browser/mainThreadAideChatAgents2.ts deleted file mode 100644 index 80a7da4378d..00000000000 --- a/src/vs/workbench/api/browser/mainThreadAideChatAgents2.ts +++ /dev/null @@ -1,327 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { DeferredPromise } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { Disposable, DisposableMap, IDisposable } from 'vs/base/common/lifecycle'; -import { revive } from 'vs/base/common/marshalling'; -import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { getWordAtText } from 'vs/editor/common/core/wordHelper'; -import { CompletionContext, CompletionItem, CompletionItemKind, CompletionList } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { ICSAccountService } from 'vs/platform/codestoryAccount/common/csAccount'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostAideChatAgentsShape2, ExtHostContext, IChatProgressDto, IDynamicChatAgentProps, IExtensionChatAgentMetadata, MainContext, MainThreadAideChatAgentsShape2 } from 'vs/workbench/api/common/extHost.protocol'; -import { IAideChatWidgetService } from 'vs/workbench/contrib/aideChat/browser/aideChat'; -import { ChatInputPart } from 'vs/workbench/contrib/aideChat/browser/aideChatInputPart'; -import { AddDynamicVariableAction, IAddDynamicVariableContext } from 'vs/workbench/contrib/aideChat/browser/contrib/aideChatDynamicVariables'; -import { AideChatAgentLocation, IAideChatAgentService, IChatAgentImplementation } from 'vs/workbench/contrib/aideChat/common/aideChatAgents'; -import { ChatRequestAgentPart } from 'vs/workbench/contrib/aideChat/common/aideChatParserTypes'; -import { ChatRequestParser } from 'vs/workbench/contrib/aideChat/common/aideChatRequestParser'; -import { IAideChatContentReference, IAideChatFollowup, IAideChatProgress, IAideChatService, IAideChatTask, IAideChatWarningMessage } from 'vs/workbench/contrib/aideChat/common/aideChatService'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; - -interface AgentData { - dispose: () => void; - id: string; - extensionId: ExtensionIdentifier; - hasFollowups?: boolean; -} - -class MainThreadChatTask implements IAideChatTask { - public readonly kind = 'progressTask'; - - public readonly deferred = new DeferredPromise(); - - private readonly _onDidAddProgress = new Emitter(); - public get onDidAddProgress(): Event { return this._onDidAddProgress.event; } - - public readonly progress: (IAideChatWarningMessage | IAideChatContentReference)[] = []; - - constructor(public content: IMarkdownString) { } - - task() { - return this.deferred.p; - } - - isSettled() { - return this.deferred.isSettled; - } - - complete(v: string | void) { - this.deferred.complete(v); - } - - add(progress: IAideChatWarningMessage | IAideChatContentReference): void { - this.progress.push(progress); - this._onDidAddProgress.fire(progress); - } -} - -@extHostNamedCustomer(MainContext.MainThreadAideChatAgents2) -export class MainThreadAideChatAgents2 extends Disposable implements MainThreadAideChatAgentsShape2 { - - private readonly _agents = this._register(new DisposableMap()); - private readonly _agentCompletionProviders = this._register(new DisposableMap()); - private readonly _agentIdsToCompletionProviders = this._register(new DisposableMap); - - private readonly _pendingProgress = new Map void>(); - private readonly _proxy: ExtHostAideChatAgentsShape2; - - private _responsePartHandlePool = 0; - private readonly _activeTasks = new Map(); - - constructor( - extHostContext: IExtHostContext, - @IAideChatAgentService private readonly _chatAgentService: IAideChatAgentService, - @IAideChatService private readonly _chatService: IAideChatService, - @ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService, - @IAideChatWidgetService private readonly _chatWidgetService: IAideChatWidgetService, - @IInstantiationService private readonly _instantiationService: IInstantiationService, - @ILogService private readonly _logService: ILogService, - @IExtensionService private readonly _extensionService: IExtensionService, - @ICSAccountService private readonly _csAccountService: ICSAccountService, - ) { - super(); - this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostAideChatAgents2); - - this._register(this._chatService.onDidDisposeSession(e => { - this._proxy.$releaseSession(e.sessionId); - })); - this._register(this._chatService.onDidPerformUserAction(e => { - if (typeof e.agentId === 'string') { - for (const [handle, agent] of this._agents) { - if (agent.id === e.agentId) { - if (e.action.kind === 'vote') { - this._proxy.$acceptFeedback(handle, e.result ?? {}, e.action.direction); - } else { - this._proxy.$acceptAction(handle, e.result || {}, e); - } - break; - } - } - } - })); - } - - $unregisterAgent(handle: number): void { - this._agents.deleteAndDispose(handle); - } - - $transferActiveChatSession(toWorkspace: UriComponents): void { - const widget = this._chatWidgetService.lastFocusedWidget; - const sessionId = widget?.viewModel?.model.sessionId; - if (!sessionId) { - this._logService.error(`MainThreadChat#$transferActiveChatSession: No active chat session found`); - return; - } - - const inputValue = widget?.inputEditor.getValue() ?? ''; - this._chatService.transferChatSession({ sessionId, inputValue }, URI.revive(toWorkspace)); - } - - $registerAgent(handle: number, extension: ExtensionIdentifier, id: string, metadata: IExtensionChatAgentMetadata, dynamicProps: IDynamicChatAgentProps | undefined): void { - const staticAgentRegistration = this._chatAgentService.getAgent(id); - if (!staticAgentRegistration && !dynamicProps) { - if (this._chatAgentService.getAgentsByName(id).length) { - // Likely some extension authors will not adopt the new ID, so give a hint if they register a - // participant by name instead of ID. - throw new Error(`chatParticipant must be declared with an ID in package.json. The "id" property may be missing! "${id}"`); - } - - throw new Error(`chatParticipant must be declared in package.json: ${id}`); - } - - const impl: IChatAgentImplementation = { - invoke: async (request, progress, history, token) => { - const authenticated = await this._csAccountService.ensureAuthenticated(); - if (!authenticated) { - return {}; - } - - this._pendingProgress.set(request.requestId, progress); - try { - return await this._proxy.$invokeAgent(handle, request, { history }, token) ?? {}; - } finally { - this._pendingProgress.delete(request.requestId); - } - }, - provideFollowups: async (request, result, history, token): Promise => { - if (!this._agents.get(handle)?.hasFollowups) { - return []; - } - - return this._proxy.$provideFollowups(request, handle, result, { history }, token); - }, - provideWelcomeMessage: (location: AideChatAgentLocation, token: CancellationToken) => { - return this._proxy.$provideWelcomeMessage(handle, location, token); - }, - provideSampleQuestions: (location: AideChatAgentLocation, token: CancellationToken) => { - return this._proxy.$provideSampleQuestions(handle, location, token); - } - }; - - let disposable: IDisposable; - if (!staticAgentRegistration && dynamicProps) { - const extensionDescription = this._extensionService.extensions.find(e => ExtensionIdentifier.equals(e.identifier, extension)); - disposable = this._chatAgentService.registerDynamicAgent( - { - id, - name: dynamicProps.name ?? '', // This case is for an API change and can be removed tomorrow - description: dynamicProps.description, - extensionId: extension, - extensionDisplayName: extensionDescription?.displayName ?? extension.value, - extensionPublisherId: extensionDescription?.publisher ?? '', - publisherDisplayName: dynamicProps.publisherName, - fullName: dynamicProps.fullName, - metadata: revive(metadata), - slashCommands: [], - locations: [AideChatAgentLocation.Panel] // TODO all dynamic participants are panel only? - }, - impl); - } else { - disposable = this._chatAgentService.registerAgentImplementation(id, impl); - } - - this._agents.set(handle, { - id: id, - extensionId: extension, - dispose: disposable.dispose, - hasFollowups: metadata.hasFollowups - }); - } - - $updateAgent(handle: number, metadataUpdate: IExtensionChatAgentMetadata): void { - const data = this._agents.get(handle); - if (!data) { - throw new Error(`No agent with handle ${handle} registered`); - } - data.hasFollowups = metadataUpdate.hasFollowups; - this._chatAgentService.updateAgent(data.id, revive(metadataUpdate)); - } - - async $handleProgressChunk(requestId: string, progress: IChatProgressDto, responsePartHandle?: number): Promise { - const revivedProgress = revive(progress) as IAideChatProgress; - if (revivedProgress.kind === 'progressTask') { - const handle = ++this._responsePartHandlePool; - const responsePartId = `${requestId}_${handle}`; - const task = new MainThreadChatTask(revivedProgress.content); - this._activeTasks.set(responsePartId, task); - this._pendingProgress.get(requestId)?.(task); - return handle; - } else if (responsePartHandle !== undefined) { - const responsePartId = `${requestId}_${responsePartHandle}`; - const task = this._activeTasks.get(responsePartId); - switch (revivedProgress.kind) { - case 'progressTaskResult': - if (task && revivedProgress.content) { - task.complete(revivedProgress.content.value); - this._activeTasks.delete(responsePartId); - } else { - task?.complete(undefined); - } - return responsePartHandle; - case 'warning': - case 'reference': - task?.add(revivedProgress); - return; - } - } - this._pendingProgress.get(requestId)?.(revivedProgress); - } - - $registerAgentCompletionsProvider(handle: number, id: string, triggerCharacters: string[]): void { - const provide = async (query: string, token: CancellationToken) => { - const completions = await this._proxy.$invokeCompletionProvider(handle, query, token); - return completions.map((c) => ({ ...c, icon: c.icon ? ThemeIcon.fromId(c.icon) : undefined })); - }; - this._agentIdsToCompletionProviders.set(id, this._chatAgentService.registerAgentCompletionProvider(id, provide)); - - this._agentCompletionProviders.set(handle, this._languageFeaturesService.completionProvider.register({ scheme: ChatInputPart.INPUT_SCHEME, hasAccessToAllModels: true }, { - _debugDisplayName: 'chatAgentCompletions:' + handle, - triggerCharacters, - provideCompletionItems: async (model: ITextModel, position: Position, _context: CompletionContext, token: CancellationToken) => { - const widget = this._chatWidgetService.getWidgetByInputUri(model.uri); - if (!widget || !widget.viewModel) { - return; - } - - const triggerCharsPart = triggerCharacters.map(c => escapeRegExpCharacters(c)).join(''); - const wordRegex = new RegExp(`[${triggerCharsPart}]\\S*`, 'g'); - const query = getWordAtText(position.column, wordRegex, model.getLineContent(position.lineNumber), 0)?.word ?? ''; - - if (query && !triggerCharacters.some(c => query.startsWith(c))) { - return; - } - - const parsedRequest = this._instantiationService.createInstance(ChatRequestParser).parseChatRequest(widget.viewModel.sessionId, model.getValue()).parts; - const agentPart = parsedRequest.find((part): part is ChatRequestAgentPart => part instanceof ChatRequestAgentPart); - const thisAgentId = this._agents.get(handle)?.id; - if (agentPart?.agent.id !== thisAgentId) { - return; - } - - const range = computeCompletionRanges(model, position, wordRegex); - if (!range) { - return null; - } - - const result = await provide(query, token); - const variableItems = result.map(v => { - const insertText = v.insertText ?? (typeof v.label === 'string' ? v.label : v.label.label); - const rangeAfterInsert = new Range(range.insert.startLineNumber, range.insert.startColumn, range.insert.endLineNumber, range.insert.startColumn + insertText.length); - return { - label: v.label, - range, - insertText: insertText + ' ', - kind: CompletionItemKind.Text, - detail: v.detail, - documentation: v.documentation, - command: { id: AddDynamicVariableAction.ID, title: '', arguments: [{ id: v.id, widget, range: rangeAfterInsert, variableData: revive(v.value) as any, command: v.command } satisfies IAddDynamicVariableContext] } - } satisfies CompletionItem; - }); - - return { - suggestions: variableItems - } satisfies CompletionList; - } - })); - } - - $unregisterAgentCompletionsProvider(handle: number, id: string): void { - this._agentCompletionProviders.deleteAndDispose(handle); - this._agentIdsToCompletionProviders.deleteAndDispose(id); - } -} - - -function computeCompletionRanges(model: ITextModel, position: Position, reg: RegExp): { insert: Range; replace: Range } | undefined { - const varWord = getWordAtText(position.column, reg, model.getLineContent(position.lineNumber), 0); - if (!varWord && model.getWordUntilPosition(position).word) { - // inside a "normal" word - return; - } - - let insert: Range; - let replace: Range; - if (!varWord) { - insert = replace = Range.fromPositions(position); - } else { - insert = new Range(position.lineNumber, varWord.startColumn, position.lineNumber, position.column); - replace = new Range(position.lineNumber, varWord.startColumn, position.lineNumber, varWord.endColumn); - } - - return { insert, replace }; -} diff --git a/src/vs/workbench/api/browser/mainThreadAideChatVariables.ts b/src/vs/workbench/api/browser/mainThreadAideChatVariables.ts deleted file mode 100644 index 6b0c9607c49..00000000000 --- a/src/vs/workbench/api/browser/mainThreadAideChatVariables.ts +++ /dev/null @@ -1,50 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { DisposableMap } from 'vs/base/common/lifecycle'; -import { revive } from 'vs/base/common/marshalling'; -import { ExtHostAideChatVariablesShape, ExtHostContext, IChatVariableResolverProgressDto, MainContext, MainThreadAideChatVariablesShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IAideChatRequestVariableValue, IAideChatVariableData, IAideChatVariableResolverProgress, IAideChatVariablesService } from 'vs/workbench/contrib/aideChat/common/aideChatVariables'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; - -@extHostNamedCustomer(MainContext.MainThreadAideChatVariables) -export class MainThreadAideChatVariables implements MainThreadAideChatVariablesShape { - - private readonly _proxy: ExtHostAideChatVariablesShape; - private readonly _variables = new DisposableMap(); - private readonly _pendingProgress = new Map void>(); - - constructor( - extHostContext: IExtHostContext, - @IAideChatVariablesService private readonly _chatVariablesService: IAideChatVariablesService, - ) { - this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostChatVariables); - } - - dispose(): void { - this._variables.clearAndDisposeAll(); - } - - $registerVariable(handle: number, data: IAideChatVariableData): void { - const registration = this._chatVariablesService.registerVariable(data, async (messageText, _arg, model, progress, token) => { - const varRequestId = `${model.sessionId}-${handle}`; - this._pendingProgress.set(varRequestId, progress); - const result = revive(await this._proxy.$resolveVariable(handle, varRequestId, messageText, token)); - - this._pendingProgress.delete(varRequestId); - return result as any; // 'revive' type signature doesn't like this type for some reason - }); - this._variables.set(handle, registration); - } - - async $handleProgressChunk(requestId: string, progress: IChatVariableResolverProgressDto): Promise { - const revivedProgress = revive(progress); - this._pendingProgress.get(requestId)?.(revivedProgress as IAideChatVariableResolverProgress); - } - - $unregisterVariable(handle: number): void { - this._variables.deleteAndDispose(handle); - } -} diff --git a/src/vs/workbench/api/browser/mainThreadAideProbeProvider.ts b/src/vs/workbench/api/browser/mainThreadAideProbeProvider.ts index f6ff5c119c4..bd99a90bd1d 100644 --- a/src/vs/workbench/api/browser/mainThreadAideProbeProvider.ts +++ b/src/vs/workbench/api/browser/mainThreadAideProbeProvider.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { revive } from 'vs/base/common/marshalling'; -import { ICSAccountService } from 'vs/platform/codestoryAccount/common/csAccount'; -import { ExtHostAideProbeProviderShape, ExtHostContext, IAideProbeProgressDto, MainContext, MainThreadAideProbeProviderShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IAideProbeResolver, IAideProbeService } from 'vs/workbench/contrib/aideProbe/browser/aideProbeService'; -import { IAideProbeData, IAideProbeProgress, IAideProbeRequestModel, IAideProbeSessionAction, IAideProbeUserAction } from 'vs/workbench/contrib/aideProbe/common/aideProbe'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { ICSAccountService } from '../../../platform/codestoryAccount/common/csAccount.js'; +import { IAideProbeResolver, IAideProbeService } from '../../contrib/aideProbe/browser/aideProbeService.js'; +import { IAideProbeData, IAideProbeProgress, IAideProbeRequestModel, IAideProbeSessionAction, IAideProbeUserAction } from '../../contrib/aideProbe/common/aideProbe.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostAideProbeProviderShape, ExtHostContext, IAideProbeProgressDto, MainContext, MainThreadAideProbeProviderShape } from '../common/extHost.protocol.js'; @extHostNamedCustomer(MainContext.MainThreadProbeProvider) export class MainThreadAideProbeProvider extends Disposable implements MainThreadAideProbeProviderShape { diff --git a/src/vs/workbench/api/browser/mainThreadAuthentication.ts b/src/vs/workbench/api/browser/mainThreadAuthentication.ts index c60acfa9739..89a6f10f562 100644 --- a/src/vs/workbench/api/browser/mainThreadAuthentication.ts +++ b/src/vs/workbench/api/browser/mainThreadAuthentication.ts @@ -3,22 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, DisposableMap } from 'vs/base/common/lifecycle'; -import * as nls from 'vs/nls'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IAuthenticationCreateSessionOptions, AuthenticationSession, AuthenticationSessionsChangeEvent, IAuthenticationProvider, IAuthenticationService, IAuthenticationExtensionsService, INTERNAL_AUTH_PROVIDER_PREFIX as INTERNAL_MODEL_AUTH_PROVIDER_PREFIX, AuthenticationSessionAccount, IAuthenticationProviderSessionOptions } from 'vs/workbench/services/authentication/common/authentication'; -import { ExtHostAuthenticationShape, ExtHostContext, MainContext, MainThreadAuthenticationShape } from '../common/extHost.protocol'; -import { IDialogService, IPromptButton } from 'vs/platform/dialogs/common/dialogs'; -import Severity from 'vs/base/common/severity'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { ActivationKind, IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IAuthenticationAccessService } from 'vs/workbench/services/authentication/browser/authenticationAccessService'; -import { IAuthenticationUsageService } from 'vs/workbench/services/authentication/browser/authenticationUsageService'; -import { getAuthenticationProviderActivationEvent } from 'vs/workbench/services/authentication/browser/authenticationService'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { Disposable, DisposableMap } from '../../../base/common/lifecycle.js'; +import * as nls from '../../../nls.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IAuthenticationCreateSessionOptions, AuthenticationSession, AuthenticationSessionsChangeEvent, IAuthenticationProvider, IAuthenticationService, IAuthenticationExtensionsService, INTERNAL_AUTH_PROVIDER_PREFIX as INTERNAL_MODEL_AUTH_PROVIDER_PREFIX, AuthenticationSessionAccount, IAuthenticationProviderSessionOptions } from '../../services/authentication/common/authentication.js'; +import { ExtHostAuthenticationShape, ExtHostContext, MainContext, MainThreadAuthenticationShape } from '../common/extHost.protocol.js'; +import { IDialogService, IPromptButton } from '../../../platform/dialogs/common/dialogs.js'; +import Severity from '../../../base/common/severity.js'; +import { INotificationService } from '../../../platform/notification/common/notification.js'; +import { ActivationKind, IExtensionService } from '../../services/extensions/common/extensions.js'; +import { ITelemetryService } from '../../../platform/telemetry/common/telemetry.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IAuthenticationAccessService } from '../../services/authentication/browser/authenticationAccessService.js'; +import { IAuthenticationUsageService } from '../../services/authentication/browser/authenticationUsageService.js'; +import { getAuthenticationProviderActivationEvent } from '../../services/authentication/browser/authenticationService.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IOpenerService } from '../../../platform/opener/common/opener.js'; +import { CancellationError } from '../../../base/common/errors.js'; interface AuthenticationForceNewSessionOptions { detail?: string; @@ -159,6 +160,31 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu return result ?? false; } + private async continueWithIncorrectAccountPrompt(chosenAccountLabel: string, requestedAccountLabel: string): Promise { + const result = await this.dialogService.prompt({ + message: nls.localize('incorrectAccount', "Incorrect account detected"), + detail: nls.localize('incorrectAccountDetail', "The chosen account, {0}, does not match the requested account, {1}.", chosenAccountLabel, requestedAccountLabel), + type: Severity.Warning, + cancelButton: true, + buttons: [ + { + label: nls.localize('keep', 'Keep {0}', chosenAccountLabel), + run: () => chosenAccountLabel + }, + { + label: nls.localize('loginWith', 'Login with {0}', requestedAccountLabel), + run: () => requestedAccountLabel + } + ], + }); + + if (!result.result) { + throw new CancellationError(); + } + + return result.result === chosenAccountLabel; + } + private async doGetSession(providerId: string, scopes: string[], extensionId: string, extensionName: string, options: AuthenticationGetSessionOptions): Promise { const sessions = await this.authenticationService.getSessions(providerId, scopes, options.account, true); const provider = this.authenticationService.getProvider(providerId); @@ -174,21 +200,21 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu throw new Error('Invalid combination of options. Please remove one of the following: createIfNone, silent'); } + if (options.clearSessionPreference) { + // Clearing the session preference is usually paired with createIfNone, so just remove the preference and + // defer to the rest of the logic in this function to choose the session. + this.authenticationExtensionsService.removeSessionPreference(providerId, extensionId, scopes); + } + // Check if the sessions we have are valid if (!options.forceNewSession && sessions.length) { if (provider.supportsMultipleAccounts) { - if (options.clearSessionPreference) { - // Clearing the session preference is usually paired with createIfNone, so just remove the preference and - // defer to the rest of the logic in this function to choose the session. - this.authenticationExtensionsService.removeSessionPreference(providerId, extensionId, scopes); - } else { - // If we have an existing session preference, use that. If not, we'll return any valid session at the end of this function. - const existingSessionPreference = this.authenticationExtensionsService.getSessionPreference(providerId, extensionId, scopes); - if (existingSessionPreference) { - const matchingSession = sessions.find(session => session.id === existingSessionPreference); - if (matchingSession && this.authenticationAccessService.isAccessAllowed(providerId, matchingSession.account.label, extensionId)) { - return matchingSession; - } + // If we have an existing session preference, use that. If not, we'll return any valid session at the end of this function. + const existingSessionPreference = this.authenticationExtensionsService.getSessionPreference(providerId, extensionId, scopes); + if (existingSessionPreference) { + const matchingSession = sessions.find(session => session.id === existingSessionPreference); + if (matchingSession && this.authenticationAccessService.isAccessAllowed(providerId, matchingSession.account.label, extensionId)) { + return matchingSession; } } } else if (this.authenticationAccessService.isAccessAllowed(providerId, sessions[0].account.label, extensionId)) { @@ -212,18 +238,25 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu throw new Error('User did not consent to login.'); } - let session; + let session: AuthenticationSession; if (sessions?.length && !options.forceNewSession) { session = provider.supportsMultipleAccounts && !options.account ? await this.authenticationExtensionsService.selectSession(providerId, extensionId, extensionName, scopes, sessions) : sessions[0]; } else { - let account: AuthenticationSessionAccount | undefined = options.account; - if (!account) { + let accountToCreate: AuthenticationSessionAccount | undefined = options.account; + if (!accountToCreate) { const sessionIdToRecreate = this.authenticationExtensionsService.getSessionPreference(providerId, extensionId, scopes); - account = sessionIdToRecreate ? sessions.find(session => session.id === sessionIdToRecreate)?.account : undefined; + accountToCreate = sessionIdToRecreate ? sessions.find(session => session.id === sessionIdToRecreate)?.account : undefined; } - session = await this.authenticationService.createSession(providerId, scopes, { activateImmediate: true, account }); + + do { + session = await this.authenticationService.createSession(providerId, scopes, { activateImmediate: true, account: accountToCreate }); + } while ( + accountToCreate + && accountToCreate.label !== session.account.label + && !await this.continueWithIncorrectAccountPrompt(session.account.label, accountToCreate.label) + ); } this.authenticationAccessService.updateAllowedExtensions(providerId, session.account.label, [{ id: extensionId, name: extensionName, allowed: true }]); @@ -260,28 +293,8 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu return session; } - async $getSessions(providerId: string, scopes: readonly string[], extensionId: string, extensionName: string): Promise { - const sessions = await this.authenticationService.getSessions(providerId, [...scopes], undefined, true); - const accessibleSessions = sessions.filter(s => this.authenticationAccessService.isAccessAllowed(providerId, s.account.label, extensionId)); - if (accessibleSessions.length) { - this.sendProviderUsageTelemetry(extensionId, providerId); - for (const session of accessibleSessions) { - this.authenticationUsageService.addAccountUsage(providerId, session.account.label, extensionId, extensionName); - } - } - return accessibleSessions; - } - async $getAccounts(providerId: string): Promise> { - const sessions = await this.authenticationService.getSessions(providerId); - const accounts = new Array(); - const seenAccounts = new Set(); - for (const session of sessions) { - if (!seenAccounts.has(session.account.label)) { - seenAccounts.add(session.account.label); - accounts.push(session.account); - } - } + const accounts = await this.authenticationService.getAccounts(providerId); return accounts; } diff --git a/src/vs/workbench/api/browser/mainThreadBulkEdits.ts b/src/vs/workbench/api/browser/mainThreadBulkEdits.ts index dfd425729a3..a82377228dc 100644 --- a/src/vs/workbench/api/browser/mainThreadBulkEdits.ts +++ b/src/vs/workbench/api/browser/mainThreadBulkEdits.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer, decodeBase64 } from 'vs/base/common/buffer'; -import { revive } from 'vs/base/common/marshalling'; -import { IBulkEditService, ResourceFileEdit, ResourceTextEdit } from 'vs/editor/browser/services/bulkEditService'; -import { WorkspaceEdit } from 'vs/editor/common/languages'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IWorkspaceCellEditDto, IWorkspaceEditDto, IWorkspaceFileEditDto, MainContext, MainThreadBulkEditsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ResourceNotebookCellEdit } from 'vs/workbench/contrib/bulkEdit/browser/bulkCellEdits'; -import { CellEditType } from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { VSBuffer, decodeBase64 } from '../../../base/common/buffer.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { IBulkEditService, ResourceFileEdit, ResourceTextEdit } from '../../../editor/browser/services/bulkEditService.js'; +import { WorkspaceEdit } from '../../../editor/common/languages.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js'; +import { IWorkspaceCellEditDto, IWorkspaceEditDto, IWorkspaceFileEditDto, MainContext, MainThreadBulkEditsShape } from '../common/extHost.protocol.js'; +import { ResourceNotebookCellEdit } from '../../contrib/bulkEdit/browser/bulkCellEdits.js'; +import { CellEditType } from '../../contrib/notebook/common/notebookCommon.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; @extHostNamedCustomer(MainContext.MainThreadBulkEdits) diff --git a/src/vs/workbench/api/browser/mainThreadCLICommands.ts b/src/vs/workbench/api/browser/mainThreadCLICommands.ts index 03a03f9c2a4..c8aed8587cd 100644 --- a/src/vs/workbench/api/browser/mainThreadCLICommands.ts +++ b/src/vs/workbench/api/browser/mainThreadCLICommands.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Schemas } from 'vs/base/common/network'; -import { isWeb } from 'vs/base/common/platform'; -import { isString } from 'vs/base/common/types'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { IExtensionGalleryService, IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionManagementCLI } from 'vs/platform/extensionManagement/common/extensionManagementCLI'; -import { getExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { IExtensionManifest } from 'vs/platform/extensions/common/extensions'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { AbstractMessageLogger, ILogger, LogLevel } from 'vs/platform/log/common/log'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { IOpenWindowOptions, IWindowOpenable } from 'vs/platform/window/common/window'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; -import { IExtensionManifestPropertiesService } from 'vs/workbench/services/extensions/common/extensionManifestPropertiesService'; +import { Schemas } from '../../../base/common/network.js'; +import { isWeb } from '../../../base/common/platform.js'; +import { isString } from '../../../base/common/types.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { CommandsRegistry, ICommandService } from '../../../platform/commands/common/commands.js'; +import { IExtensionGalleryService, IExtensionManagementService } from '../../../platform/extensionManagement/common/extensionManagement.js'; +import { ExtensionManagementCLI } from '../../../platform/extensionManagement/common/extensionManagementCLI.js'; +import { getExtensionId } from '../../../platform/extensionManagement/common/extensionManagementUtil.js'; +import { IExtensionManifest } from '../../../platform/extensions/common/extensions.js'; +import { IInstantiationService, ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { ServiceCollection } from '../../../platform/instantiation/common/serviceCollection.js'; +import { ILabelService } from '../../../platform/label/common/label.js'; +import { AbstractMessageLogger, ILogger, LogLevel } from '../../../platform/log/common/log.js'; +import { IOpenerService } from '../../../platform/opener/common/opener.js'; +import { IOpenWindowOptions, IWindowOpenable } from '../../../platform/window/common/window.js'; +import { IWorkbenchEnvironmentService } from '../../services/environment/common/environmentService.js'; +import { IExtensionManagementServerService } from '../../services/extensionManagement/common/extensionManagement.js'; +import { IExtensionManifestPropertiesService } from '../../services/extensions/common/extensionManifestPropertiesService.js'; // this class contains the commands that the CLI server is reying on diff --git a/src/vs/workbench/api/browser/mainThreadCSAuthentication.ts b/src/vs/workbench/api/browser/mainThreadCSAuthentication.ts index 06a05b40191..4fbd34a4b33 100644 --- a/src/vs/workbench/api/browser/mainThreadCSAuthentication.ts +++ b/src/vs/workbench/api/browser/mainThreadCSAuthentication.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { CSAuthenticationSession, ICSAuthenticationService } from 'vs/platform/codestoryAccount/common/csAccount'; -import { MainContext, MainThreadCSAuthenticationShape } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { CSAuthenticationSession, ICSAuthenticationService } from '../../../platform/codestoryAccount/common/csAccount.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { MainContext, MainThreadCSAuthenticationShape } from '../common/extHost.protocol.js'; @extHostNamedCustomer(MainContext.MainThreadCSAuthentication) export class MainThreadCSAuthentication extends Disposable implements MainThreadCSAuthenticationShape { diff --git a/src/vs/workbench/api/browser/mainThreadCSEvents.ts b/src/vs/workbench/api/browser/mainThreadCSEvents.ts index f79b2e99a6d..9ed7a0a3b78 100644 --- a/src/vs/workbench/api/browser/mainThreadCSEvents.ts +++ b/src/vs/workbench/api/browser/mainThreadCSEvents.ts @@ -2,10 +2,11 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, DisposableMap } from 'vs/base/common/lifecycle'; -import { ICSEventHandler, ICSEventsService } from 'vs/editor/common/services/csEvents'; -import { ExtHostCSEventsShape, ExtHostContext, MainContext, MainThreadCSEventsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; + +import { Disposable, DisposableMap } from '../../../base/common/lifecycle.js'; +import { ICSEventHandler, ICSEventsService } from '../../../editor/common/services/csEvents.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostCSEventsShape, MainContext, MainThreadCSEventsShape } from '../common/extHost.protocol.js'; @extHostNamedCustomer(MainContext.MainThreadCSEvents) export class MainThreadCSEvents extends Disposable implements MainThreadCSEventsShape { diff --git a/src/vs/workbench/api/browser/mainThreadChatAgents2.ts b/src/vs/workbench/api/browser/mainThreadChatAgents2.ts index 0d63847dae5..a325853c237 100644 --- a/src/vs/workbench/api/browser/mainThreadChatAgents2.ts +++ b/src/vs/workbench/api/browser/mainThreadChatAgents2.ts @@ -3,34 +3,34 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DeferredPromise } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { Disposable, DisposableMap, IDisposable } from 'vs/base/common/lifecycle'; -import { revive } from 'vs/base/common/marshalling'; -import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { getWordAtText } from 'vs/editor/common/core/wordHelper'; -import { CompletionContext, CompletionItem, CompletionItemKind, CompletionList } from 'vs/editor/common/languages'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostChatAgentsShape2, ExtHostContext, IChatProgressDto, IDynamicChatAgentProps, IExtensionChatAgentMetadata, MainContext, MainThreadChatAgentsShape2 } from 'vs/workbench/api/common/extHost.protocol'; -import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat'; -import { ChatInputPart } from 'vs/workbench/contrib/chat/browser/chatInputPart'; -import { AddDynamicVariableAction, IAddDynamicVariableContext } from 'vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables'; -import { ChatAgentLocation, IChatAgentImplementation, IChatAgentService } from 'vs/workbench/contrib/chat/common/chatAgents'; -import { ChatRequestAgentPart } from 'vs/workbench/contrib/chat/common/chatParserTypes'; -import { ChatRequestParser } from 'vs/workbench/contrib/chat/common/chatRequestParser'; -import { IChatContentReference, IChatFollowup, IChatProgress, IChatService, IChatTask, IChatWarningMessage } from 'vs/workbench/contrib/chat/common/chatService'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; +import { DeferredPromise } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { Disposable, DisposableMap, IDisposable } from '../../../base/common/lifecycle.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { escapeRegExpCharacters } from '../../../base/common/strings.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { Position } from '../../../editor/common/core/position.js'; +import { Range } from '../../../editor/common/core/range.js'; +import { getWordAtText } from '../../../editor/common/core/wordHelper.js'; +import { CompletionContext, CompletionItem, CompletionItemKind, CompletionList } from '../../../editor/common/languages.js'; +import { ITextModel } from '../../../editor/common/model.js'; +import { ILanguageFeaturesService } from '../../../editor/common/services/languageFeatures.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ExtHostChatAgentsShape2, ExtHostContext, IChatParticipantMetadata, IChatProgressDto, IDynamicChatAgentProps, IExtensionChatAgentMetadata, MainContext, MainThreadChatAgentsShape2 } from '../common/extHost.protocol.js'; +import { IChatWidgetService } from '../../contrib/chat/browser/chat.js'; +import { ChatInputPart } from '../../contrib/chat/browser/chatInputPart.js'; +import { AddDynamicVariableAction, IAddDynamicVariableContext } from '../../contrib/chat/browser/contrib/chatDynamicVariables.js'; +import { ChatAgentLocation, IChatAgentHistoryEntry, IChatAgentImplementation, IChatAgentRequest, IChatAgentService } from '../../contrib/chat/common/chatAgents.js'; +import { ChatRequestAgentPart } from '../../contrib/chat/common/chatParserTypes.js'; +import { ChatRequestParser } from '../../contrib/chat/common/chatRequestParser.js'; +import { IChatContentReference, IChatFollowup, IChatProgress, IChatService, IChatTask, IChatWarningMessage } from '../../contrib/chat/common/chatService.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; +import { IExtensionService } from '../../services/extensions/common/extensions.js'; interface AgentData { dispose: () => void; @@ -39,7 +39,7 @@ interface AgentData { hasFollowups?: boolean; } -class MainThreadChatTask implements IChatTask { +export class MainThreadChatTask implements IChatTask { public readonly kind = 'progressTask'; public readonly deferred = new DeferredPromise(); @@ -76,6 +76,8 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA private readonly _agentCompletionProviders = this._register(new DisposableMap()); private readonly _agentIdsToCompletionProviders = this._register(new DisposableMap); + private readonly _chatParticipantDetectionProviders = this._register(new DisposableMap()); + private readonly _pendingProgress = new Map void>(); private readonly _proxy: ExtHostChatAgentsShape2; @@ -103,7 +105,7 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA for (const [handle, agent] of this._agents) { if (agent.id === e.agentId) { if (e.action.kind === 'vote') { - this._proxy.$acceptFeedback(handle, e.result ?? {}, e.action.direction); + this._proxy.$acceptFeedback(handle, e.result ?? {}, e.action); } else { this._proxy.$acceptAction(handle, e.result || {}, e); } @@ -161,6 +163,9 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA provideWelcomeMessage: (location: ChatAgentLocation, token: CancellationToken) => { return this._proxy.$provideWelcomeMessage(handle, location, token); }, + provideChatTitle: (history, token) => { + return this._proxy.$provideChatTitle(handle, history, token); + }, provideSampleQuestions: (location: ChatAgentLocation, token: CancellationToken) => { return this._proxy.$provideSampleQuestions(handle, location, token); } @@ -172,7 +177,7 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA disposable = this._chatAgentService.registerDynamicAgent( { id, - name: dynamicProps.name ?? '', // This case is for an API change and can be removed tomorrow + name: dynamicProps.name, description: dynamicProps.description, extensionId: extension, extensionDisplayName: extensionDescription?.displayName ?? extension.value, @@ -181,6 +186,7 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA fullName: dynamicProps.fullName, metadata: revive(metadata), slashCommands: [], + disambiguation: [], locations: [ChatAgentLocation.Panel] // TODO all dynamic participants are panel only? }, impl); @@ -199,7 +205,8 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA $updateAgent(handle: number, metadataUpdate: IExtensionChatAgentMetadata): void { const data = this._agents.get(handle); if (!data) { - throw new Error(`No agent with handle ${handle} registered`); + this._logService.error(`MainThreadChatAgents2#$updateAgent: No agent with handle ${handle} registered`); + return; } data.hasFollowups = metadataUpdate.hasFollowups; this._chatAgentService.updateAgent(data.id, revive(metadataUpdate)); @@ -297,6 +304,20 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA this._agentCompletionProviders.deleteAndDispose(handle); this._agentIdsToCompletionProviders.deleteAndDispose(id); } + + $registerChatParticipantDetectionProvider(handle: number): void { + this._chatParticipantDetectionProviders.set(handle, this._chatAgentService.registerChatParticipantDetectionProvider(handle, + { + provideParticipantDetection: async (request: IChatAgentRequest, history: IChatAgentHistoryEntry[], options: { location: ChatAgentLocation; participants: IChatParticipantMetadata[] }, token: CancellationToken) => { + return await this._proxy.$detectChatParticipant(handle, request, { history }, options, token); + } + } + )); + } + + $unregisterChatParticipantDetectionProvider(handle: number): void { + this._chatParticipantDetectionProviders.deleteAndDispose(handle); + } } diff --git a/src/vs/workbench/api/browser/mainThreadChatCodeMapper.ts b/src/vs/workbench/api/browser/mainThreadChatCodeMapper.ts new file mode 100644 index 00000000000..abacb824c24 --- /dev/null +++ b/src/vs/workbench/api/browser/mainThreadChatCodeMapper.ts @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Disposable, DisposableMap, IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { ICodeMapperProvider, ICodeMapperRequest, ICodeMapperResponse, ICodeMapperService } from '../../contrib/chat/common/chatCodeMapperService.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostCodeMapperShape, ExtHostContext, ICodeMapperProgressDto, ICodeMapperRequestDto, MainContext, MainThreadCodeMapperShape } from '../common/extHost.protocol.js'; + +@extHostNamedCustomer(MainContext.MainThreadCodeMapper) +export class MainThreadChatCodemapper extends Disposable implements MainThreadCodeMapperShape { + + private providers = this._register(new DisposableMap()); + private readonly _proxy: ExtHostCodeMapperShape; + private static _requestHandlePool: number = 0; + private _responseMap = new Map(); + + constructor( + extHostContext: IExtHostContext, + @ICodeMapperService private readonly codeMapperService: ICodeMapperService + ) { + super(); + this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostCodeMapper); + } + + $registerCodeMapperProvider(handle: number): void { + const impl: ICodeMapperProvider = { + mapCode: async (uiRequest: ICodeMapperRequest, response: ICodeMapperResponse, token: CancellationToken) => { + const requestId = String(MainThreadChatCodemapper._requestHandlePool++); + this._responseMap.set(requestId, response); + const extHostRequest: ICodeMapperRequestDto = { + requestId, + codeBlocks: uiRequest.codeBlocks, + conversation: uiRequest.conversation + }; + try { + return await this._proxy.$mapCode(handle, extHostRequest, token).then((result) => result ?? undefined); + } finally { + this._responseMap.delete(requestId); + } + } + }; + + const disposable = this.codeMapperService.registerCodeMapperProvider(handle, impl); + this.providers.set(handle, disposable); + } + + $unregisterCodeMapperProvider(handle: number): void { + this.providers.deleteAndDispose(handle); + } + + $handleProgress(requestId: string, data: ICodeMapperProgressDto): Promise { + const response = this._responseMap.get(requestId); + if (response) { + const resource = URI.revive(data.uri); + response.textEdit(resource, data.edits); + } + return Promise.resolve(); + } +} diff --git a/src/vs/workbench/api/browser/mainThreadChatVariables.ts b/src/vs/workbench/api/browser/mainThreadChatVariables.ts index 9e08e5d1423..9897a5e8f85 100644 --- a/src/vs/workbench/api/browser/mainThreadChatVariables.ts +++ b/src/vs/workbench/api/browser/mainThreadChatVariables.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableMap } from 'vs/base/common/lifecycle'; -import { revive } from 'vs/base/common/marshalling'; -import { ExtHostChatVariablesShape, ExtHostContext, IChatVariableResolverProgressDto, MainContext, MainThreadChatVariablesShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IChatRequestVariableValue, IChatVariableData, IChatVariableResolverProgress, IChatVariablesService } from 'vs/workbench/contrib/chat/common/chatVariables'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { DisposableMap } from '../../../base/common/lifecycle.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { ExtHostChatVariablesShape, ExtHostContext, IChatVariableResolverProgressDto, MainContext, MainThreadChatVariablesShape } from '../common/extHost.protocol.js'; +import { IChatRequestVariableValue, IChatVariableData, IChatVariableResolverProgress, IChatVariablesService } from '../../contrib/chat/common/chatVariables.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; @extHostNamedCustomer(MainContext.MainThreadChatVariables) export class MainThreadChatVariables implements MainThreadChatVariablesShape { diff --git a/src/vs/workbench/api/browser/mainThreadClipboard.ts b/src/vs/workbench/api/browser/mainThreadClipboard.ts index 11be3e647dc..911c72cc8e9 100644 --- a/src/vs/workbench/api/browser/mainThreadClipboard.ts +++ b/src/vs/workbench/api/browser/mainThreadClipboard.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { MainContext, MainThreadClipboardShape } from '../common/extHost.protocol'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; +import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; +import { MainContext, MainThreadClipboardShape } from '../common/extHost.protocol.js'; +import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js'; @extHostNamedCustomer(MainContext.MainThreadClipboard) export class MainThreadClipboard implements MainThreadClipboardShape { diff --git a/src/vs/workbench/api/browser/mainThreadCodeInsets.ts b/src/vs/workbench/api/browser/mainThreadCodeInsets.ts index 3fa0eef969f..efc220d3c31 100644 --- a/src/vs/workbench/api/browser/mainThreadCodeInsets.ts +++ b/src/vs/workbench/api/browser/mainThreadCodeInsets.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getWindow } from 'vs/base/browser/dom'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { isEqual } from 'vs/base/common/resources'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IActiveCodeEditor, IViewZone } from 'vs/editor/browser/editorBrowser'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { reviveWebviewContentOptions } from 'vs/workbench/api/browser/mainThreadWebviews'; -import { ExtHostContext, ExtHostEditorInsetsShape, IWebviewContentOptions, MainContext, MainThreadEditorInsetsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IWebviewService, IWebviewElement } from 'vs/workbench/contrib/webview/browser/webview'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { getWindow } from '../../../base/browser/dom.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { isEqual } from '../../../base/common/resources.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IActiveCodeEditor, IViewZone } from '../../../editor/browser/editorBrowser.js'; +import { ICodeEditorService } from '../../../editor/browser/services/codeEditorService.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { reviveWebviewContentOptions } from './mainThreadWebviews.js'; +import { ExtHostContext, ExtHostEditorInsetsShape, IWebviewContentOptions, MainContext, MainThreadEditorInsetsShape } from '../common/extHost.protocol.js'; +import { IWebviewService, IWebviewElement } from '../../contrib/webview/browser/webview.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; // todo@jrieken move these things back into something like contrib/insets class EditorWebviewZone implements IViewZone { diff --git a/src/vs/workbench/api/browser/mainThreadCommands.ts b/src/vs/workbench/api/browser/mainThreadCommands.ts index 47e8acbbf81..9e92c453fc2 100644 --- a/src/vs/workbench/api/browser/mainThreadCommands.ts +++ b/src/vs/workbench/api/browser/mainThreadCommands.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableMap, IDisposable } from 'vs/base/common/lifecycle'; -import { revive } from 'vs/base/common/marshalling'; -import { CommandsRegistry, ICommandMetadata, ICommandService } from 'vs/platform/commands/common/commands'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { Dto, SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { ExtHostCommandsShape, ExtHostContext, MainContext, MainThreadCommandsShape } from '../common/extHost.protocol'; -import { isString } from 'vs/base/common/types'; +import { DisposableMap, IDisposable } from '../../../base/common/lifecycle.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { CommandsRegistry, ICommandMetadata, ICommandService } from '../../../platform/commands/common/commands.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; +import { IExtensionService } from '../../services/extensions/common/extensions.js'; +import { Dto, SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; +import { ExtHostCommandsShape, ExtHostContext, MainContext, MainThreadCommandsShape } from '../common/extHost.protocol.js'; +import { isString } from '../../../base/common/types.js'; @extHostNamedCustomer(MainContext.MainThreadCommands) diff --git a/src/vs/workbench/api/browser/mainThreadComments.ts b/src/vs/workbench/api/browser/mainThreadComments.ts index 2e342290e96..a35bd555c87 100644 --- a/src/vs/workbench/api/browser/mainThreadComments.ts +++ b/src/vs/workbench/api/browser/mainThreadComments.ts @@ -3,34 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import * as languages from 'vs/editor/common/languages'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ICommentController, ICommentService } from 'vs/workbench/contrib/comments/browser/commentService'; -import { CommentsPanel } from 'vs/workbench/contrib/comments/browser/commentsView'; -import { CommentProviderFeatures, ExtHostCommentsShape, ExtHostContext, MainContext, MainThreadCommentsShape, CommentThreadChanges } from '../common/extHost.protocol'; -import { COMMENTS_VIEW_ID, COMMENTS_VIEW_STORAGE_ID, COMMENTS_VIEW_TITLE } from 'vs/workbench/contrib/comments/browser/commentsTreeViewer'; -import { ViewContainer, IViewContainersRegistry, Extensions as ViewExtensions, ViewContainerLocation, IViewsRegistry, IViewDescriptorService } from 'vs/workbench/common/views'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; -import { Codicon } from 'vs/base/common/codicons'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { localize } from 'vs/nls'; -import { MarshalledId } from 'vs/base/common/marshallingIds'; -import { ICellRange } from 'vs/workbench/contrib/notebook/common/notebookRange'; -import { Schemas } from 'vs/base/common/network'; -import { IViewsService } from 'vs/workbench/services/views/common/viewsService'; -import { MarshalledCommentThread } from 'vs/workbench/common/comments'; -import { revealCommentThread } from 'vs/workbench/contrib/comments/browser/commentsController'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { CommentThreadRevealOptions } from 'vs/editor/common/languages'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IRange, Range } from '../../../editor/common/core/range.js'; +import * as languages from '../../../editor/common/languages.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ICommentController, ICommentService } from '../../contrib/comments/browser/commentService.js'; +import { CommentsPanel } from '../../contrib/comments/browser/commentsView.js'; +import { CommentProviderFeatures, ExtHostCommentsShape, ExtHostContext, MainContext, MainThreadCommentsShape, CommentThreadChanges } from '../common/extHost.protocol.js'; +import { COMMENTS_VIEW_ID, COMMENTS_VIEW_STORAGE_ID, COMMENTS_VIEW_TITLE } from '../../contrib/comments/browser/commentsTreeViewer.js'; +import { ViewContainer, IViewContainersRegistry, Extensions as ViewExtensions, ViewContainerLocation, IViewsRegistry, IViewDescriptorService } from '../../common/views.js'; +import { SyncDescriptor } from '../../../platform/instantiation/common/descriptors.js'; +import { ViewPaneContainer } from '../../browser/parts/views/viewPaneContainer.js'; +import { Codicon } from '../../../base/common/codicons.js'; +import { registerIcon } from '../../../platform/theme/common/iconRegistry.js'; +import { localize } from '../../../nls.js'; +import { MarshalledId } from '../../../base/common/marshallingIds.js'; +import { ICellRange } from '../../contrib/notebook/common/notebookRange.js'; +import { Schemas } from '../../../base/common/network.js'; +import { IViewsService } from '../../services/views/common/viewsService.js'; +import { MarshalledCommentThread } from '../../common/comments.js'; +import { revealCommentThread } from '../../contrib/comments/browser/commentsController.js'; +import { IEditorService } from '../../services/editor/common/editorService.js'; +import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js'; export class MainThreadCommentThread implements languages.CommentThread { private _input?: languages.CommentInput; @@ -70,13 +69,13 @@ export class MainThreadCommentThread implements languages.CommentThread { private readonly _onDidChangeLabel = new Emitter(); readonly onDidChangeLabel: Event = this._onDidChangeLabel.event; - private _comments: languages.Comment[] | undefined; + private _comments: ReadonlyArray | undefined; - public get comments(): languages.Comment[] | undefined { + public get comments(): ReadonlyArray | undefined { return this._comments; } - public set comments(newComments: languages.Comment[] | undefined) { + public set comments(newComments: ReadonlyArray | undefined) { this._comments = newComments; this._onDidChangeComments.fire(this._comments); } @@ -86,7 +85,6 @@ export class MainThreadCommentThread implements languages.CommentThread { set range(range: T | undefined) { this._range = range; - this._onDidChangeRange.fire(this._range); } get range(): T | undefined { @@ -104,9 +102,6 @@ export class MainThreadCommentThread implements languages.CommentThread { return this._canReply; } - private readonly _onDidChangeRange = new Emitter(); - public onDidChangeRange = this._onDidChangeRange.event; - private _collapsibleState: languages.CommentThreadCollapsibleState | undefined; get collapsibleState() { return this._collapsibleState; @@ -185,6 +180,7 @@ export class MainThreadCommentThread implements languages.CommentThread { public threadId: string, public resource: string, private _range: T | undefined, + comments: languages.Comment[] | undefined, private _canReply: boolean, private _isTemplate: boolean, public editorId?: string @@ -192,6 +188,8 @@ export class MainThreadCommentThread implements languages.CommentThread { this._isDisposed = false; if (_isTemplate) { this.comments = []; + } else if (comments) { + this._comments = comments; } } @@ -202,7 +200,7 @@ export class MainThreadCommentThread implements languages.CommentThread { if (modified('range')) { this._range = changes.range!; } if (modified('label')) { this._label = changes.label; } if (modified('contextValue')) { this._contextValue = changes.contextValue === null ? undefined : changes.contextValue; } - if (modified('comments')) { this._comments = changes.comments; } + if (modified('comments')) { this.comments = changes.comments; } if (modified('collapseState')) { this.initialCollapsibleState = changes.collapseState; } if (modified('canReply')) { this.canReply = changes.canReply!; } if (modified('state')) { this.state = changes.state!; } @@ -210,13 +208,16 @@ export class MainThreadCommentThread implements languages.CommentThread { if (modified('isTemplate')) { this._isTemplate = changes.isTemplate!; } } + hasComments(): boolean { + return !!this.comments && this.comments.length > 0; + } + dispose() { this._isDisposed = true; this._onDidChangeCollapsibleState.dispose(); this._onDidChangeComments.dispose(); this._onDidChangeInput.dispose(); this._onDidChangeLabel.dispose(); - this._onDidChangeRange.dispose(); this._onDidChangeState.dispose(); } @@ -298,6 +299,7 @@ export class MainThreadCommentController implements ICommentController { threadId: string, resource: UriComponents, range: IRange | ICellRange | undefined, + comments: languages.Comment[], isTemplate: boolean, editorId?: string ): languages.CommentThread { @@ -308,6 +310,7 @@ export class MainThreadCommentController implements ICommentController { threadId, URI.revive(resource).toString(), range, + comments, true, isTemplate, editorId @@ -590,6 +593,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments threadId: string, resource: UriComponents, range: IRange | ICellRange | undefined, + comments: languages.Comment[], extensionId: ExtensionIdentifier, isTemplate: boolean, editorId?: string @@ -600,7 +604,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments return undefined; } - return provider.createCommentThread(extensionId.value, commentThreadHandle, threadId, resource, range, isTemplate, editorId); + return provider.createCommentThread(extensionId.value, commentThreadHandle, threadId, resource, range, comments, isTemplate, editorId); } $updateCommentThread(handle: number, @@ -637,7 +641,24 @@ export class MainThreadComments extends Disposable implements MainThreadComments provider.updateCommentingRanges(resourceHints); } - async $revealCommentThread(handle: number, commentThreadHandle: number, options: CommentThreadRevealOptions): Promise { + async $revealCommentThread(handle: number, commentThreadHandle: number, commentUniqueIdInThread: number, options: languages.CommentThreadRevealOptions): Promise { + const provider = this._commentControllers.get(handle); + + if (!provider) { + return Promise.resolve(); + } + + const thread = provider.getAllComments().find(thread => thread.commentThreadHandle === commentThreadHandle); + if (!thread || !thread.isDocumentCommentThread()) { + return Promise.resolve(); + } + + const comment = thread.comments?.find(comment => comment.uniqueIdInThread === commentUniqueIdInThread); + + revealCommentThread(this._commentService, this._editorService, this._uriIdentityService, thread, comment, options.focusReply, undefined, options.preserveFocus); + } + + async $hideCommentThread(handle: number, commentThreadHandle: number): Promise { const provider = this._commentControllers.get(handle); if (!provider) { @@ -649,7 +670,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments return Promise.resolve(); } - revealCommentThread(this._commentService, this._editorService, this._uriIdentityService, thread, undefined, options.focusReply, undefined, options.preserveFocus); + thread.collapsibleState = languages.CommentThreadCollapsibleState.Collapsed; } private registerView(commentsViewAlreadyRegistered: boolean) { diff --git a/src/vs/workbench/api/browser/mainThreadConfiguration.ts b/src/vs/workbench/api/browser/mainThreadConfiguration.ts index deb82c81365..86891475af3 100644 --- a/src/vs/workbench/api/browser/mainThreadConfiguration.ts +++ b/src/vs/workbench/api/browser/mainThreadConfiguration.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope, getScopes } from 'vs/platform/configuration/common/configurationRegistry'; -import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; -import { MainThreadConfigurationShape, MainContext, ExtHostContext, IConfigurationInitData } from '../common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ConfigurationTarget, IConfigurationService, IConfigurationOverrides } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { URI } from '../../../base/common/uri.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope, getScopes } from '../../../platform/configuration/common/configurationRegistry.js'; +import { IWorkspaceContextService, WorkbenchState } from '../../../platform/workspace/common/workspace.js'; +import { MainThreadConfigurationShape, MainContext, ExtHostContext, IConfigurationInitData } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ConfigurationTarget, IConfigurationService, IConfigurationOverrides } from '../../../platform/configuration/common/configuration.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; @extHostNamedCustomer(MainContext.MainThreadConfiguration) export class MainThreadConfiguration implements MainThreadConfigurationShape { diff --git a/src/vs/workbench/api/browser/mainThreadConsole.ts b/src/vs/workbench/api/browser/mainThreadConsole.ts index c942d609405..d81a9a787a1 100644 --- a/src/vs/workbench/api/browser/mainThreadConsole.ts +++ b/src/vs/workbench/api/browser/mainThreadConsole.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { MainContext, MainThreadConsoleShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IRemoteConsoleLog, log } from 'vs/base/common/console'; -import { logRemoteEntry, logRemoteEntryIfError } from 'vs/workbench/services/extensions/common/remoteConsoleUtil'; -import { parseExtensionDevOptions } from 'vs/workbench/services/extensions/common/extensionDevOptions'; -import { ILogService } from 'vs/platform/log/common/log'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { MainContext, MainThreadConsoleShape } from '../common/extHost.protocol.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; +import { IRemoteConsoleLog, log } from '../../../base/common/console.js'; +import { logRemoteEntry, logRemoteEntryIfError } from '../../services/extensions/common/remoteConsoleUtil.js'; +import { parseExtensionDevOptions } from '../../services/extensions/common/extensionDevOptions.js'; +import { ILogService } from '../../../platform/log/common/log.js'; @extHostNamedCustomer(MainContext.MainThreadConsole) export class MainThreadConsole implements MainThreadConsoleShape { diff --git a/src/vs/workbench/api/browser/mainThreadCustomEditors.ts b/src/vs/workbench/api/browser/mainThreadCustomEditors.ts index 3f992a4cfad..73c9a19d3d0 100644 --- a/src/vs/workbench/api/browser/mainThreadCustomEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadCustomEditors.ts @@ -3,47 +3,47 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { multibyteAwareBtoa } from 'vs/base/browser/dom'; -import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { isCancellationError, onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableMap, DisposableStore, IReference } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { basename } from 'vs/base/common/path'; -import { isEqual, isEqualOrParent, toLocalResource } from 'vs/base/common/resources'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { localize } from 'vs/nls'; -import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { FileOperation, IFileService } from 'vs/platform/files/common/files'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IUndoRedoService, UndoRedoElementType } from 'vs/platform/undoRedo/common/undoRedo'; -import { MainThreadWebviewPanels } from 'vs/workbench/api/browser/mainThreadWebviewPanels'; -import { MainThreadWebviews, reviveWebviewExtension } from 'vs/workbench/api/browser/mainThreadWebviews'; -import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol'; -import { IRevertOptions, ISaveOptions } from 'vs/workbench/common/editor'; -import { CustomEditorInput } from 'vs/workbench/contrib/customEditor/browser/customEditorInput'; -import { CustomDocumentBackupData } from 'vs/workbench/contrib/customEditor/browser/customEditorInputFactory'; -import { ICustomEditorModel, ICustomEditorService } from 'vs/workbench/contrib/customEditor/common/customEditor'; -import { CustomTextEditorModel } from 'vs/workbench/contrib/customEditor/common/customTextEditorModel'; -import { ExtensionKeyedWebviewOriginStore, WebviewExtensionDescription } from 'vs/workbench/contrib/webview/browser/webview'; -import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput'; -import { IWebviewWorkbenchService } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService'; -import { editorGroupToColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IPathService } from 'vs/workbench/services/path/common/pathService'; -import { ResourceWorkingCopy } from 'vs/workbench/services/workingCopy/common/resourceWorkingCopy'; -import { IWorkingCopy, IWorkingCopyBackup, IWorkingCopySaveEvent, NO_TYPE_ID, WorkingCopyCapabilities } from 'vs/workbench/services/workingCopy/common/workingCopy'; -import { IWorkingCopyFileService, WorkingCopyFileEvent } from 'vs/workbench/services/workingCopy/common/workingCopyFileService'; -import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; +import { multibyteAwareBtoa } from '../../../base/browser/dom.js'; +import { CancelablePromise, createCancelablePromise } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { isCancellationError, onUnexpectedError } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableMap, DisposableStore, IReference } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { basename } from '../../../base/common/path.js'; +import { isEqual, isEqualOrParent, toLocalResource } from '../../../base/common/resources.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { localize } from '../../../nls.js'; +import { IFileDialogService } from '../../../platform/dialogs/common/dialogs.js'; +import { FileOperation, IFileService } from '../../../platform/files/common/files.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { ILabelService } from '../../../platform/label/common/label.js'; +import { IStorageService } from '../../../platform/storage/common/storage.js'; +import { IUndoRedoService, UndoRedoElementType } from '../../../platform/undoRedo/common/undoRedo.js'; +import { MainThreadWebviewPanels } from './mainThreadWebviewPanels.js'; +import { MainThreadWebviews, reviveWebviewExtension } from './mainThreadWebviews.js'; +import * as extHostProtocol from '../common/extHost.protocol.js'; +import { IRevertOptions, ISaveOptions } from '../../common/editor.js'; +import { CustomEditorInput } from '../../contrib/customEditor/browser/customEditorInput.js'; +import { CustomDocumentBackupData } from '../../contrib/customEditor/browser/customEditorInputFactory.js'; +import { ICustomEditorModel, ICustomEditorService } from '../../contrib/customEditor/common/customEditor.js'; +import { CustomTextEditorModel } from '../../contrib/customEditor/common/customTextEditorModel.js'; +import { ExtensionKeyedWebviewOriginStore, WebviewExtensionDescription } from '../../contrib/webview/browser/webview.js'; +import { WebviewInput } from '../../contrib/webviewPanel/browser/webviewEditorInput.js'; +import { IWebviewWorkbenchService } from '../../contrib/webviewPanel/browser/webviewWorkbenchService.js'; +import { editorGroupToColumn } from '../../services/editor/common/editorGroupColumn.js'; +import { IEditorGroupsService } from '../../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../../services/editor/common/editorService.js'; +import { IWorkbenchEnvironmentService } from '../../services/environment/common/environmentService.js'; +import { IExtensionService } from '../../services/extensions/common/extensions.js'; +import { IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IPathService } from '../../services/path/common/pathService.js'; +import { ResourceWorkingCopy } from '../../services/workingCopy/common/resourceWorkingCopy.js'; +import { IWorkingCopy, IWorkingCopyBackup, IWorkingCopySaveEvent, NO_TYPE_ID, WorkingCopyCapabilities } from '../../services/workingCopy/common/workingCopy.js'; +import { IWorkingCopyFileService, WorkingCopyFileEvent } from '../../services/workingCopy/common/workingCopyFileService.js'; +import { IWorkingCopyService } from '../../services/workingCopy/common/workingCopyService.js'; const enum CustomEditorModelType { Custom, diff --git a/src/vs/workbench/api/browser/mainThreadDebugService.ts b/src/vs/workbench/api/browser/mainThreadDebugService.ts index 36b5a4df0ae..cccdce7eb4c 100644 --- a/src/vs/workbench/api/browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/browser/mainThreadDebugService.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableMap, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { URI as uri, UriComponents } from 'vs/base/common/uri'; -import { IDebugService, IConfig, IDebugConfigurationProvider, IBreakpoint, IFunctionBreakpoint, IBreakpointData, IDebugAdapter, IDebugAdapterDescriptorFactory, IDebugSession, IDebugAdapterFactory, IDataBreakpoint, IDebugSessionOptions, IInstructionBreakpoint, DebugConfigurationProviderTriggerKind, IDebugVisualization, DataBreakpointSetType } from 'vs/workbench/contrib/debug/common/debug'; +import { DisposableMap, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { URI as uri, UriComponents } from '../../../base/common/uri.js'; +import { IDebugService, IConfig, IDebugConfigurationProvider, IBreakpoint, IFunctionBreakpoint, IBreakpointData, IDebugAdapter, IDebugAdapterDescriptorFactory, IDebugSession, IDebugAdapterFactory, IDataBreakpoint, IDebugSessionOptions, IInstructionBreakpoint, DebugConfigurationProviderTriggerKind, IDebugVisualization, DataBreakpointSetType } from '../../contrib/debug/common/debug.js'; import { ExtHostContext, ExtHostDebugServiceShape, MainThreadDebugServiceShape, DebugSessionUUID, MainContext, IBreakpointsDeltaDto, ISourceMultiBreakpointDto, ISourceBreakpointDto, IFunctionBreakpointDto, IDebugSessionDto, IDataBreakpointDto, IStartDebuggingOptions, IDebugConfiguration, IThreadFocusDto, IStackFrameFocusDto -} from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import severity from 'vs/base/common/severity'; -import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstractDebugAdapter'; -import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { convertToVSCPaths, convertToDAPaths, isSessionAttach } from 'vs/workbench/contrib/debug/common/debugUtils'; -import { ErrorNoTelemetry } from 'vs/base/common/errors'; -import { IDebugVisualizerService } from 'vs/workbench/contrib/debug/common/debugVisualizers'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { Event } from 'vs/base/common/event'; -import { isDefined } from 'vs/base/common/types'; +} from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import severity from '../../../base/common/severity.js'; +import { AbstractDebugAdapter } from '../../contrib/debug/common/abstractDebugAdapter.js'; +import { IWorkspaceFolder } from '../../../platform/workspace/common/workspace.js'; +import { convertToVSCPaths, convertToDAPaths, isSessionAttach } from '../../contrib/debug/common/debugUtils.js'; +import { ErrorNoTelemetry } from '../../../base/common/errors.js'; +import { IDebugVisualizerService } from '../../contrib/debug/common/debugVisualizers.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { Event } from '../../../base/common/event.js'; +import { isDefined } from '../../../base/common/types.js'; @extHostNamedCustomer(MainContext.MainThreadDebugService) export class MainThreadDebugService implements MainThreadDebugServiceShape, IDebugAdapterFactory { @@ -46,7 +46,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb this._toDispose.add(debugService.onDidNewSession(session => { this._proxy.$acceptDebugSessionStarted(this.getSessionDto(session)); const store = sessionListeners.get(session); - store!.add(session.onDidChangeName(name => { + store?.add(session.onDidChangeName(name => { this._proxy.$acceptDebugSessionNameChanged(this.getSessionDto(session), name); })); })); diff --git a/src/vs/workbench/api/browser/mainThreadDecorations.ts b/src/vs/workbench/api/browser/mainThreadDecorations.ts index 46ae4275baa..9363c8bb9a4 100644 --- a/src/vs/workbench/api/browser/mainThreadDecorations.ts +++ b/src/vs/workbench/api/browser/mainThreadDecorations.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI, UriComponents } from 'vs/base/common/uri'; -import { Emitter } from 'vs/base/common/event'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { ExtHostContext, MainContext, MainThreadDecorationsShape, ExtHostDecorationsShape, DecorationData, DecorationRequest } from '../common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IDecorationsService, IDecorationData } from 'vs/workbench/services/decorations/common/decorations'; -import { CancellationToken } from 'vs/base/common/cancellation'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { Emitter } from '../../../base/common/event.js'; +import { IDisposable, dispose } from '../../../base/common/lifecycle.js'; +import { ExtHostContext, MainContext, MainThreadDecorationsShape, ExtHostDecorationsShape, DecorationData, DecorationRequest } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IDecorationsService, IDecorationData } from '../../services/decorations/common/decorations.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; class DecorationRequestsQueue { diff --git a/src/vs/workbench/api/browser/mainThreadDiagnostics.ts b/src/vs/workbench/api/browser/mainThreadDiagnostics.ts index 0fcc79603cc..df4491d4e86 100644 --- a/src/vs/workbench/api/browser/mainThreadDiagnostics.ts +++ b/src/vs/workbench/api/browser/mainThreadDiagnostics.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IMarkerService, IMarkerData } from 'vs/platform/markers/common/markers'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { MainThreadDiagnosticsShape, MainContext, ExtHostDiagnosticsShape, ExtHostContext } from '../common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; +import { IMarkerService, IMarkerData } from '../../../platform/markers/common/markers.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { MainThreadDiagnosticsShape, MainContext, ExtHostDiagnosticsShape, ExtHostContext } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js'; @extHostNamedCustomer(MainContext.MainThreadDiagnostics) export class MainThreadDiagnostics implements MainThreadDiagnosticsShape { diff --git a/src/vs/workbench/api/browser/mainThreadDialogs.ts b/src/vs/workbench/api/browser/mainThreadDialogs.ts index 424b70bcc78..4ab41cf2663 100644 --- a/src/vs/workbench/api/browser/mainThreadDialogs.ts +++ b/src/vs/workbench/api/browser/mainThreadDialogs.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { MainThreadDiaglogsShape, MainContext, MainThreadDialogOpenOptions, MainThreadDialogSaveOptions } from '../common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IFileDialogService, IOpenDialogOptions, ISaveDialogOptions } from 'vs/platform/dialogs/common/dialogs'; -import { Schemas } from 'vs/base/common/network'; +import { URI } from '../../../base/common/uri.js'; +import { MainThreadDiaglogsShape, MainContext, MainThreadDialogOpenOptions, MainThreadDialogSaveOptions } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IFileDialogService, IOpenDialogOptions, ISaveDialogOptions } from '../../../platform/dialogs/common/dialogs.js'; +import { Schemas } from '../../../base/common/network.js'; @extHostNamedCustomer(MainContext.MainThreadDialogs) export class MainThreadDialogs implements MainThreadDiaglogsShape { diff --git a/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.ts b/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.ts index 1acbcf23d03..7ff4687fdf2 100644 --- a/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.ts +++ b/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { onUnexpectedError } from 'vs/base/common/errors'; -import { dispose, DisposableMap } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Range } from 'vs/editor/common/core/range'; -import { ITextModel } from 'vs/editor/common/model'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, ExtHostDocumentContentProvidersShape, MainContext, MainThreadDocumentContentProvidersShape } from '../common/extHost.protocol'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import { dispose, DisposableMap } from '../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { EditOperation } from '../../../editor/common/core/editOperation.js'; +import { Range } from '../../../editor/common/core/range.js'; +import { ITextModel } from '../../../editor/common/model.js'; +import { IEditorWorkerService } from '../../../editor/common/services/editorWorker.js'; +import { IModelService } from '../../../editor/common/services/model.js'; +import { ILanguageService } from '../../../editor/common/languages/language.js'; +import { ITextModelService } from '../../../editor/common/services/resolverService.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostDocumentContentProvidersShape, MainContext, MainThreadDocumentContentProvidersShape } from '../common/extHost.protocol.js'; +import { CancellationTokenSource } from '../../../base/common/cancellation.js'; @extHostNamedCustomer(MainContext.MainThreadDocumentContentProviders) export class MainThreadDocumentContentProviders implements MainThreadDocumentContentProvidersShape { diff --git a/src/vs/workbench/api/browser/mainThreadDocuments.ts b/src/vs/workbench/api/browser/mainThreadDocuments.ts index 02d36af3856..6ded63e34be 100644 --- a/src/vs/workbench/api/browser/mainThreadDocuments.ts +++ b/src/vs/workbench/api/browser/mainThreadDocuments.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { IReference, dispose, Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ITextModel, shouldSynchronizeModel } from 'vs/editor/common/model'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { IFileService, FileOperation } from 'vs/platform/files/common/files'; -import { ExtHostContext, ExtHostDocumentsShape, MainThreadDocumentsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { toLocalResource, extUri, IExtUri } from 'vs/base/common/resources'; -import { IWorkingCopyFileService } from 'vs/workbench/services/workingCopy/common/workingCopyFileService'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IPathService } from 'vs/workbench/services/path/common/pathService'; -import { ResourceMap } from 'vs/base/common/map'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ErrorNoTelemetry } from 'vs/base/common/errors'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { IReference, dispose, Disposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { ITextModel, shouldSynchronizeModel } from '../../../editor/common/model.js'; +import { IModelService } from '../../../editor/common/services/model.js'; +import { ITextModelService } from '../../../editor/common/services/resolverService.js'; +import { IFileService, FileOperation } from '../../../platform/files/common/files.js'; +import { ExtHostContext, ExtHostDocumentsShape, MainThreadDocumentsShape } from '../common/extHost.protocol.js'; +import { ITextFileService } from '../../services/textfile/common/textfiles.js'; +import { IWorkbenchEnvironmentService } from '../../services/environment/common/environmentService.js'; +import { toLocalResource, extUri, IExtUri } from '../../../base/common/resources.js'; +import { IWorkingCopyFileService } from '../../services/workingCopy/common/workingCopyFileService.js'; +import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IPathService } from '../../services/path/common/pathService.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ErrorNoTelemetry } from '../../../base/common/errors.js'; export class BoundModelReferenceCollection { diff --git a/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts b/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts index dc20f23f976..c7a3dcea721 100644 --- a/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts @@ -3,35 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { combinedDisposable, DisposableStore, DisposableMap } from 'vs/base/common/lifecycle'; -import { ICodeEditor, isCodeEditor, isDiffEditor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { IEditor } from 'vs/editor/common/editorCommon'; -import { ITextModel, shouldSynchronizeModel } from 'vs/editor/common/model'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { extHostCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { MainThreadDocuments } from 'vs/workbench/api/browser/mainThreadDocuments'; -import { MainThreadTextEditor } from 'vs/workbench/api/browser/mainThreadEditor'; -import { MainThreadTextEditors } from 'vs/workbench/api/browser/mainThreadEditors'; -import { ExtHostContext, ExtHostDocumentsAndEditorsShape, IDocumentsAndEditorsDelta, IModelAddedData, ITextEditorAddData, MainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { AbstractTextEditor } from 'vs/workbench/browser/parts/editor/textEditor'; -import { IEditorPane } from 'vs/workbench/common/editor'; -import { EditorGroupColumn, editorGroupToColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IWorkingCopyFileService } from 'vs/workbench/services/workingCopy/common/workingCopyFileService'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { IPathService } from 'vs/workbench/services/path/common/pathService'; -import { diffSets, diffMaps } from 'vs/base/common/collections'; -import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; -import { ViewContainerLocation } from 'vs/workbench/common/views'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { Event } from '../../../base/common/event.js'; +import { combinedDisposable, DisposableStore, DisposableMap } from '../../../base/common/lifecycle.js'; +import { ICodeEditor, isCodeEditor, isDiffEditor, IActiveCodeEditor } from '../../../editor/browser/editorBrowser.js'; +import { ICodeEditorService } from '../../../editor/browser/services/codeEditorService.js'; +import { IEditor } from '../../../editor/common/editorCommon.js'; +import { ITextModel, shouldSynchronizeModel } from '../../../editor/common/model.js'; +import { IModelService } from '../../../editor/common/services/model.js'; +import { ITextModelService } from '../../../editor/common/services/resolverService.js'; +import { IFileService } from '../../../platform/files/common/files.js'; +import { extHostCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { MainThreadDocuments } from './mainThreadDocuments.js'; +import { MainThreadTextEditor } from './mainThreadEditor.js'; +import { MainThreadTextEditors } from './mainThreadEditors.js'; +import { ExtHostContext, ExtHostDocumentsAndEditorsShape, IDocumentsAndEditorsDelta, IModelAddedData, ITextEditorAddData, MainContext } from '../common/extHost.protocol.js'; +import { AbstractTextEditor } from '../../browser/parts/editor/textEditor.js'; +import { IEditorPane } from '../../common/editor.js'; +import { EditorGroupColumn, editorGroupToColumn } from '../../services/editor/common/editorGroupColumn.js'; +import { IEditorService } from '../../services/editor/common/editorService.js'; +import { IEditorGroupsService } from '../../services/editor/common/editorGroupsService.js'; +import { ITextFileService } from '../../services/textfile/common/textfiles.js'; +import { IWorkbenchEnvironmentService } from '../../services/environment/common/environmentService.js'; +import { IWorkingCopyFileService } from '../../services/workingCopy/common/workingCopyFileService.js'; +import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js'; +import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js'; +import { IPathService } from '../../services/path/common/pathService.js'; +import { diffSets, diffMaps } from '../../../base/common/collections.js'; +import { IPaneCompositePartService } from '../../services/panecomposite/browser/panecomposite.js'; +import { ViewContainerLocation } from '../../common/views.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; class TextEditorSnapshot { diff --git a/src/vs/workbench/api/browser/mainThreadDownloadService.ts b/src/vs/workbench/api/browser/mainThreadDownloadService.ts index d8c25cadd72..33d4e7989ae 100644 --- a/src/vs/workbench/api/browser/mainThreadDownloadService.ts +++ b/src/vs/workbench/api/browser/mainThreadDownloadService.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { MainContext, MainThreadDownloadServiceShape } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IDownloadService } from 'vs/platform/download/common/download'; -import { UriComponents, URI } from 'vs/base/common/uri'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { MainContext, MainThreadDownloadServiceShape } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IDownloadService } from '../../../platform/download/common/download.js'; +import { UriComponents, URI } from '../../../base/common/uri.js'; @extHostNamedCustomer(MainContext.MainThreadDownloadService) export class MainThreadDownloadService extends Disposable implements MainThreadDownloadServiceShape { diff --git a/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.ts b/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.ts index c3dc1150084..db70e241abc 100644 --- a/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.ts +++ b/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { localize } from 'vs/nls'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { extHostCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { raceCancellationError } from 'vs/base/common/async'; -import { IEditSessionIdentityCreateParticipant, IEditSessionIdentityService } from 'vs/platform/workspace/common/editSessions'; -import { ExtHostContext, ExtHostWorkspaceShape } from 'vs/workbench/api/common/extHost.protocol'; -import { WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { localize } from '../../../nls.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { extHostCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { raceCancellationError } from '../../../base/common/async.js'; +import { IEditSessionIdentityCreateParticipant, IEditSessionIdentityService } from '../../../platform/workspace/common/editSessions.js'; +import { ExtHostContext, ExtHostWorkspaceShape } from '../common/extHost.protocol.js'; +import { WorkspaceFolder } from '../../../platform/workspace/common/workspace.js'; class ExtHostEditSessionIdentityCreateParticipant implements IEditSessionIdentityCreateParticipant { diff --git a/src/vs/workbench/api/browser/mainThreadEditor.ts b/src/vs/workbench/api/browser/mainThreadEditor.ts index 575c4033787..7dd21444995 100644 --- a/src/vs/workbench/api/browser/mainThreadEditor.ts +++ b/src/vs/workbench/api/browser/mainThreadEditor.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { RenderLineNumbersType, TextEditorCursorStyle, cursorStyleToString, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { ISelection, Selection } from 'vs/editor/common/core/selection'; -import { IDecorationOptions, ScrollType } from 'vs/editor/common/editorCommon'; -import { ITextModel, ITextModelUpdateOptions } from 'vs/editor/common/model'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { IModelService } from 'vs/editor/common/services/model'; -import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; -import { IApplyEditsOptions, IEditorPropertiesChangeData, IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate, IUndoStopOptions, TextEditorRevealType } from 'vs/workbench/api/common/extHost.protocol'; -import { IEditorPane } from 'vs/workbench/common/editor'; -import { equals } from 'vs/base/common/arrays'; -import { CodeEditorStateFlag, EditorState } from 'vs/editor/contrib/editorState/browser/editorState'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { SnippetParser } from 'vs/editor/contrib/snippet/browser/snippetParser'; -import { MainThreadDocuments } from 'vs/workbench/api/browser/mainThreadDocuments'; -import { ISnippetEdit } from 'vs/editor/contrib/snippet/browser/snippetSession'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../editor/browser/editorBrowser.js'; +import { RenderLineNumbersType, TextEditorCursorStyle, cursorStyleToString, EditorOption } from '../../../editor/common/config/editorOptions.js'; +import { IRange, Range } from '../../../editor/common/core/range.js'; +import { ISelection, Selection } from '../../../editor/common/core/selection.js'; +import { IDecorationOptions, ScrollType } from '../../../editor/common/editorCommon.js'; +import { ITextModel, ITextModelUpdateOptions } from '../../../editor/common/model.js'; +import { ISingleEditOperation } from '../../../editor/common/core/editOperation.js'; +import { IModelService } from '../../../editor/common/services/model.js'; +import { SnippetController2 } from '../../../editor/contrib/snippet/browser/snippetController2.js'; +import { IApplyEditsOptions, IEditorPropertiesChangeData, IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate, IUndoStopOptions, TextEditorRevealType } from '../common/extHost.protocol.js'; +import { IEditorPane } from '../../common/editor.js'; +import { equals } from '../../../base/common/arrays.js'; +import { CodeEditorStateFlag, EditorState } from '../../../editor/contrib/editorState/browser/editorState.js'; +import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js'; +import { SnippetParser } from '../../../editor/contrib/snippet/browser/snippetParser.js'; +import { MainThreadDocuments } from './mainThreadDocuments.js'; +import { ISnippetEdit } from '../../../editor/contrib/snippet/browser/snippetSession.js'; export interface IFocusTracker { onGainedFocus(): void; diff --git a/src/vs/workbench/api/browser/mainThreadEditorTabs.ts b/src/vs/workbench/api/browser/mainThreadEditorTabs.ts index ae73118c466..9d0d3555b66 100644 --- a/src/vs/workbench/api/browser/mainThreadEditorTabs.ts +++ b/src/vs/workbench/api/browser/mainThreadEditorTabs.ts @@ -3,32 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { DisposableMap, DisposableStore } from 'vs/base/common/lifecycle'; -import { isEqual } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILogService } from 'vs/platform/log/common/log'; -import { AnyInputDto, ExtHostContext, IEditorTabDto, IEditorTabGroupDto, IExtHostEditorTabsShape, MainContext, MainThreadEditorTabsShape, TabInputKind, TabModelOperationKind, TextDiffInputDto } from 'vs/workbench/api/common/extHost.protocol'; -import { EditorResourceAccessor, GroupModelChangeKind, SideBySideEditor } from 'vs/workbench/common/editor'; -import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; -import { isGroupEditorMoveEvent } from 'vs/workbench/common/editor/editorGroupModel'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput'; -import { AbstractTextResourceEditorInput } from 'vs/workbench/common/editor/textResourceEditorInput'; -import { AideChatEditorInput } from 'vs/workbench/contrib/aideChat/browser/aideChatEditorInput'; -import { ChatEditorInput } from 'vs/workbench/contrib/chat/browser/chatEditorInput'; -import { CustomEditorInput } from 'vs/workbench/contrib/customEditor/browser/customEditorInput'; -import { InteractiveEditorInput } from 'vs/workbench/contrib/interactive/browser/interactiveEditorInput'; -import { MergeEditorInput } from 'vs/workbench/contrib/mergeEditor/browser/mergeEditorInput'; -import { MultiDiffEditorInput } from 'vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput'; -import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/common/notebookEditorInput'; -import { TerminalEditorInput } from 'vs/workbench/contrib/terminal/browser/terminalEditorInput'; -import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput'; -import { columnToEditorGroup, EditorGroupColumn, editorGroupToColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { GroupDirection, IEditorGroup, IEditorGroupsService, preferredSideBySideGroupDirection } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorsChangeEvent, IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { Event } from '../../../base/common/event.js'; +import { DisposableMap, DisposableStore } from '../../../base/common/lifecycle.js'; +import { isEqual } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { AnyInputDto, ExtHostContext, IEditorTabDto, IEditorTabGroupDto, IExtHostEditorTabsShape, MainContext, MainThreadEditorTabsShape, TabInputKind, TabModelOperationKind, TextDiffInputDto } from '../common/extHost.protocol.js'; +import { EditorResourceAccessor, GroupModelChangeKind, SideBySideEditor } from '../../common/editor.js'; +import { DiffEditorInput } from '../../common/editor/diffEditorInput.js'; +import { isGroupEditorMoveEvent } from '../../common/editor/editorGroupModel.js'; +import { EditorInput } from '../../common/editor/editorInput.js'; +import { SideBySideEditorInput } from '../../common/editor/sideBySideEditorInput.js'; +import { AbstractTextResourceEditorInput } from '../../common/editor/textResourceEditorInput.js'; +import { ChatEditorInput } from '../../contrib/chat/browser/chatEditorInput.js'; +import { CustomEditorInput } from '../../contrib/customEditor/browser/customEditorInput.js'; +import { InteractiveEditorInput } from '../../contrib/interactive/browser/interactiveEditorInput.js'; +import { MergeEditorInput } from '../../contrib/mergeEditor/browser/mergeEditorInput.js'; +import { MultiDiffEditorInput } from '../../contrib/multiDiffEditor/browser/multiDiffEditorInput.js'; +import { NotebookEditorInput } from '../../contrib/notebook/common/notebookEditorInput.js'; +import { TerminalEditorInput } from '../../contrib/terminal/browser/terminalEditorInput.js'; +import { WebviewInput } from '../../contrib/webviewPanel/browser/webviewEditorInput.js'; +import { columnToEditorGroup, EditorGroupColumn, editorGroupToColumn } from '../../services/editor/common/editorGroupColumn.js'; +import { GroupDirection, IEditorGroup, IEditorGroupsService, preferredSideBySideGroupDirection } from '../../services/editor/common/editorGroupsService.js'; +import { IEditorsChangeEvent, IEditorService, SIDE_GROUP } from '../../services/editor/common/editorService.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; interface TabInfo { tab: IEditorTabDto; @@ -205,20 +204,14 @@ export class MainThreadEditorTabs implements MainThreadEditorTabsShape { }; } - if (editor instanceof AideChatEditorInput) { - return { - kind: TabInputKind.AideChatEditorInput, - }; - } - if (editor instanceof MultiDiffEditorInput) { const diffEditors: TextDiffInputDto[] = []; for (const resource of (editor?.resources.get() ?? [])) { - if (resource.original && resource.modified) { + if (resource.originalUri && resource.modifiedUri) { diffEditors.push({ kind: TabInputKind.TextDiffInput, - original: resource.original, - modified: resource.modified + original: resource.originalUri, + modified: resource.modifiedUri }); } } diff --git a/src/vs/workbench/api/browser/mainThreadEditors.ts b/src/vs/workbench/api/browser/mainThreadEditors.ts index 84bc6f34f1e..a51ada95deb 100644 --- a/src/vs/workbench/api/browser/mainThreadEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadEditors.ts @@ -3,32 +3,32 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { illegalArgument } from 'vs/base/common/errors'; -import { IDisposable, dispose, DisposableStore } from 'vs/base/common/lifecycle'; -import { equals as objectEquals } from 'vs/base/common/objects'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { IRange } from 'vs/editor/common/core/range'; -import { ISelection } from 'vs/editor/common/core/selection'; -import { IDecorationOptions, IDecorationRenderOptions } from 'vs/editor/common/editorCommon'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ITextEditorOptions, IResourceEditorInput, EditorActivation, EditorResolution } from 'vs/platform/editor/common/editor'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { MainThreadTextEditor } from 'vs/workbench/api/browser/mainThreadEditor'; -import { ExtHostContext, ExtHostEditorsShape, IApplyEditsOptions, ITextDocumentShowOptions, ITextEditorConfigurationUpdate, ITextEditorPositionData, IUndoStopOptions, MainThreadTextEditorsShape, TextEditorRevealType } from 'vs/workbench/api/common/extHost.protocol'; -import { editorGroupToColumn, columnToEditorGroup, EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { IChange } from 'vs/editor/common/diff/legacyLinesDiffComputer'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IEditorControl } from 'vs/workbench/common/editor'; -import { getCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { DirtyDiffContribution } from 'vs/workbench/contrib/scm/browser/dirtydiffDecorator'; +import { illegalArgument } from '../../../base/common/errors.js'; +import { IDisposable, dispose, DisposableStore } from '../../../base/common/lifecycle.js'; +import { equals as objectEquals } from '../../../base/common/objects.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { ICodeEditorService } from '../../../editor/browser/services/codeEditorService.js'; +import { IRange } from '../../../editor/common/core/range.js'; +import { ISelection } from '../../../editor/common/core/selection.js'; +import { IDecorationOptions, IDecorationRenderOptions } from '../../../editor/common/editorCommon.js'; +import { ISingleEditOperation } from '../../../editor/common/core/editOperation.js'; +import { CommandsRegistry } from '../../../platform/commands/common/commands.js'; +import { ITextEditorOptions, IResourceEditorInput, EditorActivation, EditorResolution } from '../../../platform/editor/common/editor.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { MainThreadTextEditor } from './mainThreadEditor.js'; +import { ExtHostContext, ExtHostEditorsShape, IApplyEditsOptions, ITextDocumentShowOptions, ITextEditorConfigurationUpdate, ITextEditorPositionData, IUndoStopOptions, MainThreadTextEditorsShape, TextEditorRevealType } from '../common/extHost.protocol.js'; +import { editorGroupToColumn, columnToEditorGroup, EditorGroupColumn } from '../../services/editor/common/editorGroupColumn.js'; +import { IEditorService } from '../../services/editor/common/editorService.js'; +import { IEditorGroupsService } from '../../services/editor/common/editorGroupsService.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; +import { IWorkingCopyService } from '../../services/workingCopy/common/workingCopyService.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { IChange } from '../../../editor/common/diff/legacyLinesDiffComputer.js'; +import { IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IEditorControl } from '../../common/editor.js'; +import { getCodeEditor, ICodeEditor } from '../../../editor/browser/editorBrowser.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { DirtyDiffContribution } from '../../contrib/scm/browser/dirtydiffDecorator.js'; export interface IMainThreadEditorLocator { getEditor(id: string): MainThreadTextEditor | undefined; diff --git a/src/vs/workbench/api/browser/mainThreadEmbeddings.ts b/src/vs/workbench/api/browser/mainThreadEmbeddings.ts index 776c471e15f..de8c19a2226 100644 --- a/src/vs/workbench/api/browser/mainThreadEmbeddings.ts +++ b/src/vs/workbench/api/browser/mainThreadEmbeddings.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableMap, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ExtHostContext, ExtHostEmbeddingsShape, MainContext, MainThreadEmbeddingsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { DisposableMap, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ExtHostContext, ExtHostEmbeddingsShape, MainContext, MainThreadEmbeddingsShape } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; interface IEmbeddingsProvider { diff --git a/src/vs/workbench/api/browser/mainThreadErrors.ts b/src/vs/workbench/api/browser/mainThreadErrors.ts index e1591179944..becba7680c6 100644 --- a/src/vs/workbench/api/browser/mainThreadErrors.ts +++ b/src/vs/workbench/api/browser/mainThreadErrors.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SerializedError, onUnexpectedError, transformErrorFromSerialization } from 'vs/base/common/errors'; -import { extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { MainContext, MainThreadErrorsShape } from 'vs/workbench/api/common/extHost.protocol'; +import { SerializedError, onUnexpectedError, transformErrorFromSerialization } from '../../../base/common/errors.js'; +import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; +import { MainContext, MainThreadErrorsShape } from '../common/extHost.protocol.js'; @extHostNamedCustomer(MainContext.MainThreadErrors) export class MainThreadErrors implements MainThreadErrorsShape { diff --git a/src/vs/workbench/api/browser/mainThreadExtensionService.ts b/src/vs/workbench/api/browser/mainThreadExtensionService.ts index 7c4db0a5def..faf19a0dce2 100644 --- a/src/vs/workbench/api/browser/mainThreadExtensionService.ts +++ b/src/vs/workbench/api/browser/mainThreadExtensionService.ts @@ -3,32 +3,32 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Action } from 'vs/base/common/actions'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { SerializedError, transformErrorFromSerialization } from 'vs/base/common/errors'; -import { FileAccess } from 'vs/base/common/network'; -import Severity from 'vs/base/common/severity'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IRemoteConnectionData, ManagedRemoteConnection, RemoteConnection, RemoteConnectionType, ResolvedAuthority, WebSocketRemoteConnection } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { ExtHostContext, ExtHostExtensionServiceShape, MainContext, MainThreadExtensionServiceShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtension, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { EnablementState, IWorkbenchExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; -import { ExtensionHostKind } from 'vs/workbench/services/extensions/common/extensionHostKind'; -import { IExtensionDescriptionDelta } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; -import { IExtensionHostProxy, IResolveAuthorityResult } from 'vs/workbench/services/extensions/common/extensionHostProxy'; -import { ActivationKind, ExtensionActivationReason, IExtensionService, IInternalExtensionService, MissingExtensionDependency } from 'vs/workbench/services/extensions/common/extensions'; -import { extHostNamedCustomer, IExtHostContext, IInternalExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { Dto } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { ITimerService } from 'vs/workbench/services/timer/browser/timerService'; +import { Action } from '../../../base/common/actions.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { SerializedError, transformErrorFromSerialization } from '../../../base/common/errors.js'; +import { FileAccess } from '../../../base/common/network.js'; +import Severity from '../../../base/common/severity.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { ICommandService } from '../../../platform/commands/common/commands.js'; +import { ILocalExtension } from '../../../platform/extensionManagement/common/extensionManagement.js'; +import { areSameExtensions } from '../../../platform/extensionManagement/common/extensionManagementUtil.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { INotificationService } from '../../../platform/notification/common/notification.js'; +import { IRemoteConnectionData, ManagedRemoteConnection, RemoteConnection, RemoteConnectionType, ResolvedAuthority, WebSocketRemoteConnection } from '../../../platform/remote/common/remoteAuthorityResolver.js'; +import { ExtHostContext, ExtHostExtensionServiceShape, MainContext, MainThreadExtensionServiceShape } from '../common/extHost.protocol.js'; +import { IExtension, IExtensionsWorkbenchService } from '../../contrib/extensions/common/extensions.js'; +import { IWorkbenchEnvironmentService } from '../../services/environment/common/environmentService.js'; +import { EnablementState, IWorkbenchExtensionEnablementService } from '../../services/extensionManagement/common/extensionManagement.js'; +import { ExtensionHostKind } from '../../services/extensions/common/extensionHostKind.js'; +import { IExtensionDescriptionDelta } from '../../services/extensions/common/extensionHostProtocol.js'; +import { IExtensionHostProxy, IResolveAuthorityResult } from '../../services/extensions/common/extensionHostProxy.js'; +import { ActivationKind, ExtensionActivationReason, IExtensionService, IInternalExtensionService, MissingExtensionDependency } from '../../services/extensions/common/extensions.js'; +import { extHostNamedCustomer, IExtHostContext, IInternalExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { Dto } from '../../services/extensions/common/proxyIdentifier.js'; +import { IHostService } from '../../services/host/browser/host.js'; +import { ITimerService } from '../../services/timer/browser/timerService.js'; @extHostNamedCustomer(MainContext.MainThreadExtensionService) export class MainThreadExtensionService implements MainThreadExtensionServiceShape { diff --git a/src/vs/workbench/api/browser/mainThreadFileSystem.ts b/src/vs/workbench/api/browser/mainThreadFileSystem.ts index e0f9359f0e9..295fb754349 100644 --- a/src/vs/workbench/api/browser/mainThreadFileSystem.ts +++ b/src/vs/workbench/api/browser/mainThreadFileSystem.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable, toDisposable, DisposableStore, DisposableMap } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IFileWriteOptions, FileSystemProviderCapabilities, IFileChange, IFileService, IStat, IWatchOptions, FileType, IFileOverwriteOptions, IFileDeleteOptions, IFileOpenOptions, FileOperationError, FileOperationResult, FileSystemProviderErrorCode, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithFileFolderCopyCapability, FilePermission, toFileSystemProviderErrorCode, IFileStatWithPartialMetadata, IFileStat } from 'vs/platform/files/common/files'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, ExtHostFileSystemShape, IFileChangeDto, MainContext, MainThreadFileSystemShape } from '../common/extHost.protocol'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IDisposable, toDisposable, DisposableStore, DisposableMap } from '../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IFileWriteOptions, FileSystemProviderCapabilities, IFileChange, IFileService, IStat, IWatchOptions, FileType, IFileOverwriteOptions, IFileDeleteOptions, IFileOpenOptions, FileOperationError, FileOperationResult, FileSystemProviderErrorCode, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithFileFolderCopyCapability, FilePermission, toFileSystemProviderErrorCode, IFileStatWithPartialMetadata, IFileStat } from '../../../platform/files/common/files.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostFileSystemShape, IFileChangeDto, MainContext, MainThreadFileSystemShape } from '../common/extHost.protocol.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; @extHostNamedCustomer(MainContext.MainThreadFileSystem) export class MainThreadFileSystem implements MainThreadFileSystemShape { diff --git a/src/vs/workbench/api/browser/mainThreadFileSystemEventService.ts b/src/vs/workbench/api/browser/mainThreadFileSystemEventService.ts index 22976049d5a..572acf83917 100644 --- a/src/vs/workbench/api/browser/mainThreadFileSystemEventService.ts +++ b/src/vs/workbench/api/browser/mainThreadFileSystemEventService.ts @@ -3,31 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableMap, DisposableStore } from 'vs/base/common/lifecycle'; -import { FileOperation, IFileService, IFilesConfiguration, IWatchOptions } from 'vs/platform/files/common/files'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, ExtHostFileSystemEventServiceShape, MainContext, MainThreadFileSystemEventServiceShape } from '../common/extHost.protocol'; -import { localize } from 'vs/nls'; -import { IWorkingCopyFileOperationParticipant, IWorkingCopyFileService, SourceTargetPair, IFileOperationUndoRedoInfo } from 'vs/workbench/services/workingCopy/common/workingCopyFileService'; -import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; -import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; -import { raceCancellation } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import Severity from 'vs/base/common/severity'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { reviveWorkspaceEditDto } from 'vs/workbench/api/browser/mainThreadBulkEdits'; -import { GLOBSTAR } from 'vs/base/common/glob'; -import { rtrim } from 'vs/base/common/strings'; -import { UriComponents, URI } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { normalizeWatcherPattern } from 'vs/platform/files/common/watcher'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { DisposableMap, DisposableStore } from '../../../base/common/lifecycle.js'; +import { FileOperation, IFileService, IWatchOptions } from '../../../platform/files/common/files.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostFileSystemEventServiceShape, MainContext, MainThreadFileSystemEventServiceShape } from '../common/extHost.protocol.js'; +import { localize } from '../../../nls.js'; +import { IWorkingCopyFileOperationParticipant, IWorkingCopyFileService, SourceTargetPair, IFileOperationUndoRedoInfo } from '../../services/workingCopy/common/workingCopyFileService.js'; +import { IBulkEditService } from '../../../editor/browser/services/bulkEditService.js'; +import { IProgressService, ProgressLocation } from '../../../platform/progress/common/progress.js'; +import { raceCancellation } from '../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { IDialogService } from '../../../platform/dialogs/common/dialogs.js'; +import Severity from '../../../base/common/severity.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../../platform/storage/common/storage.js'; +import { Action2, registerAction2 } from '../../../platform/actions/common/actions.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; +import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js'; +import { reviveWorkspaceEditDto } from './mainThreadBulkEdits.js'; +import { UriComponents, URI } from '../../../base/common/uri.js'; @extHostNamedCustomer(MainContext.MainThreadFileSystemEventService) export class MainThreadFileSystemEventService implements MainThreadFileSystemEventServiceShape { @@ -50,9 +45,7 @@ export class MainThreadFileSystemEventService implements MainThreadFileSystemEve @ILogService logService: ILogService, @IEnvironmentService envService: IEnvironmentService, @IUriIdentityService uriIdentService: IUriIdentityService, - @IWorkspaceContextService private readonly _contextService: IWorkspaceContextService, @ILogService private readonly _logService: ILogService, - @IConfigurationService private readonly _configurationService: IConfigurationService ) { this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostFileSystemEventService); @@ -234,9 +227,9 @@ export class MainThreadFileSystemEventService implements MainThreadFileSystemEve } } - // Correlated file watching is taken as is + // Correlated file watching: use an exclusive `createWatcher()` if (correlate) { - this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching correlated (extension: ${extensionId}, path: ${uri.toString(true)}, recursive: ${opts.recursive}, session: ${session})`); + this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching correlated (extension: ${extensionId}, path: ${uri.toString(true)}, recursive: ${opts.recursive}, session: ${session}, excludes: ${JSON.stringify(opts.excludes)}, includes: ${JSON.stringify(opts.includes)})`); const watcherDisposables = new DisposableStore(); const subscription = watcherDisposables.add(this._fileService.createWatcher(uri, opts)); @@ -252,60 +245,9 @@ export class MainThreadFileSystemEventService implements MainThreadFileSystemEve this._watches.set(session, watcherDisposables); } - // Uncorrelated file watching gets special treatment + // Uncorrelated file watching: via shared `watch()` else { - this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching uncorrelated (extension: ${extensionId}, path: ${uri.toString(true)}, recursive: ${opts.recursive}, session: ${session})`); - - const workspaceFolder = this._contextService.getWorkspaceFolder(uri); - - // Automatically add `files.watcherExclude` patterns when watching - // recursively to give users a chance to configure exclude rules - // for reducing the overhead of watching recursively - if (opts.recursive && opts.excludes.length === 0) { - const config = this._configurationService.getValue(); - if (config.files?.watcherExclude) { - for (const key in config.files.watcherExclude) { - if (key && config.files.watcherExclude[key] === true) { - opts.excludes.push(key); - } - } - } - } - - // Non-recursive watching inside the workspace will overlap with - // our standard workspace watchers. To prevent duplicate events, - // we only want to include events for files that are otherwise - // excluded via `files.watcherExclude`. As such, we configure - // to include each configured exclude pattern so that only those - // events are reported that are otherwise excluded. - // However, we cannot just use the pattern as is, because a pattern - // such as `bar` for a exclude, will work to exclude any of - // `/bar` but will not work as include for files within - // `bar` unless a suffix of `/**` if added. - // (https://github.com/microsoft/vscode/issues/148245) - else if (!opts.recursive && workspaceFolder) { - const config = this._configurationService.getValue(); - if (config.files?.watcherExclude) { - for (const key in config.files.watcherExclude) { - if (key && config.files.watcherExclude[key] === true) { - if (!opts.includes) { - opts.includes = []; - } - - const includePattern = `${rtrim(key, '/')}/${GLOBSTAR}`; - opts.includes.push(normalizeWatcherPattern(workspaceFolder.uri.fsPath, includePattern)); - } - } - } - - // Still ignore watch request if there are actually no configured - // exclude rules, because in that case our default recursive watcher - // should be able to take care of all events. - if (!opts.includes || opts.includes.length === 0) { - this._logService.trace(`MainThreadFileSystemEventService#$watch(): ignoring request to start watching because path is inside workspace and no excludes are configured (extension: ${extensionId}, path: ${uri.toString(true)}, recursive: ${opts.recursive}, session: ${session})`); - return; - } - } + this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching uncorrelated (extension: ${extensionId}, path: ${uri.toString(true)}, recursive: ${opts.recursive}, session: ${session}, excludes: ${JSON.stringify(opts.excludes)}, includes: ${JSON.stringify(opts.includes)})`); const subscription = this._fileService.watch(uri, opts); this._watches.set(session, subscription); diff --git a/src/vs/workbench/api/browser/mainThreadInteractive.ts b/src/vs/workbench/api/browser/mainThreadInteractive.ts index 36b227a69de..abcc61ff9c2 100644 --- a/src/vs/workbench/api/browser/mainThreadInteractive.ts +++ b/src/vs/workbench/api/browser/mainThreadInteractive.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { ExtHostContext, ExtHostInteractiveShape, MainContext, MainThreadInteractiveShape } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IInteractiveDocumentService } from 'vs/workbench/contrib/interactive/browser/interactiveDocumentService'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../../../editor/common/languages/modesRegistry.js'; +import { ExtHostContext, ExtHostInteractiveShape, MainContext, MainThreadInteractiveShape } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IInteractiveDocumentService } from '../../contrib/interactive/browser/interactiveDocumentService.js'; @extHostNamedCustomer(MainContext.MainThreadInteractive) export class MainThreadInteractive implements MainThreadInteractiveShape { diff --git a/src/vs/workbench/api/browser/mainThreadLabelService.ts b/src/vs/workbench/api/browser/mainThreadLabelService.ts index 8ade55d44e5..4b3db1a430b 100644 --- a/src/vs/workbench/api/browser/mainThreadLabelService.ts +++ b/src/vs/workbench/api/browser/mainThreadLabelService.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, DisposableMap } from 'vs/base/common/lifecycle'; -import { ILabelService, ResourceLabelFormatter } from 'vs/platform/label/common/label'; -import { MainContext, MainThreadLabelServiceShape } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { Disposable, DisposableMap } from '../../../base/common/lifecycle.js'; +import { ILabelService, ResourceLabelFormatter } from '../../../platform/label/common/label.js'; +import { MainContext, MainThreadLabelServiceShape } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; @extHostNamedCustomer(MainContext.MainThreadLabelService) export class MainThreadLabelService extends Disposable implements MainThreadLabelServiceShape { diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index 4aa61aeab45..c591ed677f1 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -3,39 +3,38 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isFalsyOrEmpty } from 'vs/base/common/arrays'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { createStringDataTransferItem, IReadonlyVSDataTransfer, VSDataTransfer } from 'vs/base/common/dataTransfer'; -import { CancellationError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { HierarchicalKind } from 'vs/base/common/hierarchicalKind'; -import { combinedDisposable, Disposable, DisposableMap, toDisposable } from 'vs/base/common/lifecycle'; -import { ResourceMap } from 'vs/base/common/map'; -import { revive } from 'vs/base/common/marshalling'; -import { mixin } from 'vs/base/common/objects'; -import { URI } from 'vs/base/common/uri'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { Position as EditorPosition, IPosition } from 'vs/editor/common/core/position'; -import { Range as EditorRange, IRange } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import * as languages from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IndentationRule, LanguageConfiguration, OnEnterRule } from 'vs/editor/common/languages/languageConfiguration'; -import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { decodeSemanticTokensDto } from 'vs/editor/common/services/semanticTokensDto'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { reviveWorkspaceEditDto } from 'vs/workbench/api/browser/mainThreadBulkEdits'; -import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; -import { DataTransferFileCache } from 'vs/workbench/api/common/shared/dataTransferCache'; -import * as callh from 'vs/workbench/contrib/callHierarchy/common/callHierarchy'; -import * as search from 'vs/workbench/contrib/search/common/search'; -import * as typeh from 'vs/workbench/contrib/typeHierarchy/common/typeHierarchy'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, ExtHostLanguageFeaturesShape, HoverWithId, ICallHierarchyItemDto, ICodeActionDto, ICodeActionProviderMetadataDto, IdentifiableInlineCompletion, IdentifiableInlineCompletions, IdentifiableInlineEdit, IDocumentDropEditDto, IDocumentDropEditProviderMetadata, IDocumentFilterDto, IIndentationRuleDto, IInlayHintDto, ILanguageConfigurationDto, ILanguageWordDefinitionDto, ILinkDto, ILocationDto, ILocationLinkDto, IOnEnterRuleDto, IPasteEditDto, IPasteEditProviderMetadataDto, IRegExpDto, ISignatureHelpProviderMetadataDto, ISuggestDataDto, ISuggestDataDtoField, ISuggestResultDtoField, ITypeHierarchyItemDto, IWorkspaceSymbolDto, MainContext, MainThreadLanguageFeaturesShape } from '../common/extHost.protocol'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { createStringDataTransferItem, IReadonlyVSDataTransfer, VSDataTransfer } from '../../../base/common/dataTransfer.js'; +import { CancellationError } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { HierarchicalKind } from '../../../base/common/hierarchicalKind.js'; +import { combinedDisposable, Disposable, DisposableMap, toDisposable } from '../../../base/common/lifecycle.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { mixin } from '../../../base/common/objects.js'; +import { URI } from '../../../base/common/uri.js'; +import { ISingleEditOperation } from '../../../editor/common/core/editOperation.js'; +import { Position as EditorPosition, IPosition } from '../../../editor/common/core/position.js'; +import { Range as EditorRange, IRange } from '../../../editor/common/core/range.js'; +import { Selection } from '../../../editor/common/core/selection.js'; +import * as languages from '../../../editor/common/languages.js'; +import { ILanguageService } from '../../../editor/common/languages/language.js'; +import { IndentationRule, LanguageConfiguration, OnEnterRule } from '../../../editor/common/languages/languageConfiguration.js'; +import { ILanguageConfigurationService } from '../../../editor/common/languages/languageConfigurationRegistry.js'; +import { ITextModel } from '../../../editor/common/model.js'; +import { ILanguageFeaturesService } from '../../../editor/common/services/languageFeatures.js'; +import { decodeSemanticTokensDto } from '../../../editor/common/services/semanticTokensDto.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js'; +import { reviveWorkspaceEditDto } from './mainThreadBulkEdits.js'; +import * as typeConvert from '../common/extHostTypeConverters.js'; +import { DataTransferFileCache } from '../common/shared/dataTransferCache.js'; +import * as callh from '../../contrib/callHierarchy/common/callHierarchy.js'; +import * as search from '../../contrib/search/common/search.js'; +import * as typeh from '../../contrib/typeHierarchy/common/typeHierarchy.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostLanguageFeaturesShape, HoverWithId, ICallHierarchyItemDto, ICodeActionDto, ICodeActionProviderMetadataDto, IdentifiableInlineCompletion, IdentifiableInlineCompletions, IdentifiableInlineEdit, IDocumentDropEditDto, IDocumentDropEditProviderMetadata, IDocumentFilterDto, IIndentationRuleDto, IInlayHintDto, ILanguageConfigurationDto, ILanguageWordDefinitionDto, ILinkDto, ILocationDto, ILocationLinkDto, IOnEnterRuleDto, IPasteEditDto, IPasteEditProviderMetadataDto, IRegExpDto, ISignatureHelpProviderMetadataDto, ISuggestDataDto, ISuggestDataDtoField, ISuggestResultDtoField, ITypeHierarchyItemDto, IWorkspaceSymbolDto, MainContext, MainThreadLanguageFeaturesShape } from '../common/extHost.protocol.js'; @extHostNamedCustomer(MainContext.MainThreadLanguageFeatures) export class MainThreadLanguageFeatures extends Disposable implements MainThreadLanguageFeaturesShape { @@ -321,7 +320,9 @@ export class MainThreadLanguageFeatures extends Disposable implements MainThread selector: selector, provideMultiDocumentHighlights: (model: ITextModel, position: EditorPosition, otherModels: ITextModel[], token: CancellationToken): Promise | undefined> => { return this._proxy.$provideMultiDocumentHighlights(handle, model.uri, position, otherModels.map(model => model.uri), token).then(dto => { - if (isFalsyOrEmpty(dto)) { + // dto should be non-null + non-undefined + // dto length of 0 is valid, just no highlights, pass this through. + if (dto === undefined || dto === null) { return undefined; } const result = new ResourceMap(); @@ -612,8 +613,8 @@ export class MainThreadLanguageFeatures extends Disposable implements MainThread provideInlineCompletions: async (model: ITextModel, position: EditorPosition, context: languages.InlineCompletionContext, token: CancellationToken): Promise => { return this._proxy.$provideInlineCompletions(handle, model.uri, position, context, token); }, - provideInlineEdits: async (model: ITextModel, range: EditorRange, context: languages.InlineCompletionContext, token: CancellationToken): Promise => { - return this._proxy.$provideInlineEdits(handle, model.uri, range, context, token); + provideInlineEditsForRange: async (model: ITextModel, range: EditorRange, context: languages.InlineCompletionContext, token: CancellationToken): Promise => { + return this._proxy.$provideInlineEditsForRange(handle, model.uri, range, context, token); }, handleItemDidShow: async (completions: IdentifiableInlineCompletions, item: IdentifiableInlineCompletion, updatedInsertText: string): Promise => { if (supportsHandleEvents) { @@ -1001,8 +1002,8 @@ export class MainThreadLanguageFeatures extends Disposable implements MainThread // --- mapped edits - $registerMappedEditsProvider(handle: number, selector: IDocumentFilterDto[]): void { - const provider = new MainThreadMappedEditsProvider(handle, this._proxy, this._uriIdentService); + $registerMappedEditsProvider(handle: number, selector: IDocumentFilterDto[], displayName: string): void { + const provider = new MainThreadMappedEditsProvider(displayName, handle, this._proxy, this._uriIdentService); this._registrations.set(handle, this._languageFeaturesService.mappedEditsProvider.register(selector, provider)); } } @@ -1241,6 +1242,7 @@ export class MainThreadDocumentRangeSemanticTokensProvider implements languages. export class MainThreadMappedEditsProvider implements languages.MappedEditsProvider { constructor( + public readonly displayName: string, private readonly _handle: number, private readonly _proxy: ExtHostLanguageFeaturesShape, private readonly _uriService: IUriIdentityService, diff --git a/src/vs/workbench/api/browser/mainThreadLanguageModelTools.ts b/src/vs/workbench/api/browser/mainThreadLanguageModelTools.ts index fbda6ced5a3..c7dd92cd7de 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageModelTools.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageModelTools.ts @@ -3,42 +3,81 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Disposable, DisposableMap } from 'vs/base/common/lifecycle'; -import { ExtHostLanguageModelToolsShape, ExtHostContext, MainContext, MainThreadLanguageModelToolsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IToolData, ILanguageModelToolsService } from 'vs/workbench/contrib/chat/common/languageModelToolsService'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { MarkdownString } from '../../../base/common/htmlContent.js'; +import { Disposable, DisposableMap } from '../../../base/common/lifecycle.js'; +import { ChatModel } from '../../contrib/chat/common/chatModel.js'; +import { IChatService, IChatTask } from '../../contrib/chat/common/chatService.js'; +import { CountTokensCallback, ILanguageModelToolsService, IToolData, IToolInvocation, IToolResult } from '../../contrib/chat/common/languageModelToolsService.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostLanguageModelToolsShape, MainContext, MainThreadLanguageModelToolsShape } from '../common/extHost.protocol.js'; +import { MainThreadChatTask } from './mainThreadChatAgents2.js'; @extHostNamedCustomer(MainContext.MainThreadLanguageModelTools) export class MainThreadLanguageModelTools extends Disposable implements MainThreadLanguageModelToolsShape { private readonly _proxy: ExtHostLanguageModelToolsShape; private readonly _tools = this._register(new DisposableMap()); + private readonly _countTokenCallbacks = new Map(); constructor( extHostContext: IExtHostContext, @ILanguageModelToolsService private readonly _languageModelToolsService: ILanguageModelToolsService, + @IChatService private readonly _chatService: IChatService, ) { super(); this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostLanguageModelTools); - this._register(this._languageModelToolsService.onDidChangeTools(e => this._proxy.$acceptToolDelta(e))); + this._register(this._languageModelToolsService.onDidChangeTools(e => this._proxy.$onDidChangeTools([...this._languageModelToolsService.getTools()]))); } async $getTools(): Promise { return Array.from(this._languageModelToolsService.getTools()); } - $invokeTool(name: string, parameters: any, token: CancellationToken): Promise { - return this._languageModelToolsService.invokeTool(name, parameters, token); + async $invokeTool(dto: IToolInvocation, token: CancellationToken): Promise { + // Shortcut to write to the model directly here, but could call all the way back to use the real stream. + // TODO move this to the tools service? + let task: IChatTask | undefined; + if (dto.context) { + const model = this._chatService.getSession(dto.context?.sessionId) as ChatModel; + const request = model.getRequests().at(-1)!; + const tool = this._languageModelToolsService.getTool(dto.toolId); + task = new MainThreadChatTask(new MarkdownString(`Using ${tool?.displayName ?? dto.toolId}`)); + model.acceptResponseProgress(request, task); + } + + try { + return await this._languageModelToolsService.invokeTool( + dto, + (input, token) => this._proxy.$countTokensForInvocation(dto.callId, input, token), + token, + ); + } finally { + task?.complete(); + } + } + + $countTokensForInvocation(callId: string, input: string, token: CancellationToken): Promise { + const fn = this._countTokenCallbacks.get(callId); + if (!fn) { + throw new Error(`Tool invocation call ${callId} not found`); + } + + return fn(input, token); } $registerTool(name: string): void { const disposable = this._languageModelToolsService.registerToolImplementation( name, { - invoke: async (parameters, token) => { - return await this._proxy.$invokeTool(name, parameters, token); + invoke: async (dto, countTokens, token) => { + try { + this._countTokenCallbacks.set(dto.callId, countTokens); + return await this._proxy.$invokeTool(dto, token); + } finally { + this._countTokenCallbacks.delete(dto.callId); + } }, }); this._tools.set(name, disposable); diff --git a/src/vs/workbench/api/browser/mainThreadLanguageModels.ts b/src/vs/workbench/api/browser/mainThreadLanguageModels.ts index adea665487c..6e1ee3afee7 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageModels.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageModels.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AsyncIterableSource, DeferredPromise } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { SerializedError, transformErrorForSerialization, transformErrorFromSerialization } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableMap, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { localize } from 'vs/nls'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostLanguageModelsShape, ExtHostContext, MainContext, MainThreadLanguageModelsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ILanguageModelStatsService } from 'vs/workbench/contrib/chat/common/languageModelStats'; -import { ILanguageModelChatMetadata, IChatResponseFragment, ILanguageModelsService, IChatMessage, ILanguageModelChatSelector, ILanguageModelChatResponse } from 'vs/workbench/contrib/chat/common/languageModels'; -import { IAuthenticationAccessService } from 'vs/workbench/services/authentication/browser/authenticationAccessService'; -import { AuthenticationSession, AuthenticationSessionsChangeEvent, IAuthenticationProvider, IAuthenticationService, INTERNAL_AUTH_PROVIDER_PREFIX } from 'vs/workbench/services/authentication/common/authentication'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; +import { AsyncIterableSource, DeferredPromise } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { SerializedError, transformErrorForSerialization, transformErrorFromSerialization } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableMap, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { localize } from '../../../nls.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ExtHostLanguageModelsShape, ExtHostContext, MainContext, MainThreadLanguageModelsShape } from '../common/extHost.protocol.js'; +import { ILanguageModelStatsService } from '../../contrib/chat/common/languageModelStats.js'; +import { ILanguageModelChatMetadata, IChatResponseFragment, ILanguageModelsService, IChatMessage, ILanguageModelChatSelector, ILanguageModelChatResponse } from '../../contrib/chat/common/languageModels.js'; +import { IAuthenticationAccessService } from '../../services/authentication/browser/authenticationAccessService.js'; +import { AuthenticationSession, AuthenticationSessionsChangeEvent, IAuthenticationProvider, IAuthenticationService, INTERNAL_AUTH_PROVIDER_PREFIX } from '../../services/authentication/common/authentication.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; +import { IExtensionService } from '../../services/extensions/common/extensions.js'; @extHostNamedCustomer(MainContext.MainThreadLanguageModels) export class MainThreadLanguageModels implements MainThreadLanguageModelsShape { diff --git a/src/vs/workbench/api/browser/mainThreadLanguages.ts b/src/vs/workbench/api/browser/mainThreadLanguages.ts index 7ec1932f4b0..05e8176ed1f 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguages.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguages.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IModelService } from 'vs/editor/common/services/model'; -import { MainThreadLanguagesShape, MainContext, ExtHostContext, ExtHostLanguagesShape } from '../common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IPosition } from 'vs/editor/common/core/position'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { ILanguageStatus, ILanguageStatusService } from 'vs/workbench/services/languageStatus/common/languageStatusService'; -import { DisposableMap, DisposableStore } from 'vs/base/common/lifecycle'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { ILanguageService } from '../../../editor/common/languages/language.js'; +import { IModelService } from '../../../editor/common/services/model.js'; +import { MainThreadLanguagesShape, MainContext, ExtHostContext, ExtHostLanguagesShape } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IPosition } from '../../../editor/common/core/position.js'; +import { IRange, Range } from '../../../editor/common/core/range.js'; +import { StandardTokenType } from '../../../editor/common/encodedTokenAttributes.js'; +import { ITextModelService } from '../../../editor/common/services/resolverService.js'; +import { ILanguageStatus, ILanguageStatusService } from '../../services/languageStatus/common/languageStatusService.js'; +import { DisposableMap, DisposableStore } from '../../../base/common/lifecycle.js'; @extHostNamedCustomer(MainContext.MainThreadLanguages) export class MainThreadLanguages implements MainThreadLanguagesShape { diff --git a/src/vs/workbench/api/browser/mainThreadLocalization.ts b/src/vs/workbench/api/browser/mainThreadLocalization.ts index af85618a64c..43b5887430e 100644 --- a/src/vs/workbench/api/browser/mainThreadLocalization.ts +++ b/src/vs/workbench/api/browser/mainThreadLocalization.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MainContext, MainThreadLocalizationShape } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IFileService } from 'vs/platform/files/common/files'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks'; +import { MainContext, MainThreadLocalizationShape } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IFileService } from '../../../platform/files/common/files.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { ILanguagePackService } from '../../../platform/languagePacks/common/languagePacks.js'; @extHostNamedCustomer(MainContext.MainThreadLocalization) export class MainThreadLocalization extends Disposable implements MainThreadLocalizationShape { diff --git a/src/vs/workbench/api/browser/mainThreadLogService.ts b/src/vs/workbench/api/browser/mainThreadLogService.ts index da8ac21f4fb..5e1271bc19a 100644 --- a/src/vs/workbench/api/browser/mainThreadLogService.ts +++ b/src/vs/workbench/api/browser/mainThreadLogService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ILoggerOptions, ILoggerResource, ILoggerService, ILogService, isLogLevel, log, LogLevel, LogLevelToString, parseLogLevel } from 'vs/platform/log/common/log'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ExtHostContext, MainThreadLoggerShape, MainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { UriComponents, URI, UriDto } from 'vs/base/common/uri'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ILoggerOptions, ILoggerResource, ILoggerService, ILogService, isLogLevel, log, LogLevel, LogLevelToString, parseLogLevel } from '../../../platform/log/common/log.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { ExtHostContext, MainThreadLoggerShape, MainContext } from '../common/extHost.protocol.js'; +import { UriComponents, URI, UriDto } from '../../../base/common/uri.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { CommandsRegistry } from '../../../platform/commands/common/commands.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; @extHostNamedCustomer(MainContext.MainThreadLogger) export class MainThreadLoggerService implements MainThreadLoggerShape { diff --git a/src/vs/workbench/api/browser/mainThreadManagedSockets.ts b/src/vs/workbench/api/browser/mainThreadManagedSockets.ts index 5cae557028c..8bd8f02136a 100644 --- a/src/vs/workbench/api/browser/mainThreadManagedSockets.ts +++ b/src/vs/workbench/api/browser/mainThreadManagedSockets.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { ISocket, SocketCloseEventType } from 'vs/base/parts/ipc/common/ipc.net'; -import { ManagedSocket, RemoteSocketHalf, connectManagedSocket } from 'vs/platform/remote/common/managedSocket'; -import { ManagedRemoteConnection, RemoteConnectionType } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { IRemoteSocketFactoryService, ISocketFactory } from 'vs/platform/remote/common/remoteSocketFactoryService'; -import { ExtHostContext, ExtHostManagedSocketsShape, MainContext, MainThreadManagedSocketsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { ISocket, SocketCloseEventType } from '../../../base/parts/ipc/common/ipc.net.js'; +import { ManagedSocket, RemoteSocketHalf, connectManagedSocket } from '../../../platform/remote/common/managedSocket.js'; +import { ManagedRemoteConnection, RemoteConnectionType } from '../../../platform/remote/common/remoteAuthorityResolver.js'; +import { IRemoteSocketFactoryService, ISocketFactory } from '../../../platform/remote/common/remoteSocketFactoryService.js'; +import { ExtHostContext, ExtHostManagedSocketsShape, MainContext, MainThreadManagedSocketsShape } from '../common/extHost.protocol.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; @extHostNamedCustomer(MainContext.MainThreadManagedSockets) export class MainThreadManagedSockets extends Disposable implements MainThreadManagedSocketsShape { diff --git a/src/vs/workbench/api/browser/mainThreadMessageService.ts b/src/vs/workbench/api/browser/mainThreadMessageService.ts index 5cf20960f3f..0cb41146947 100644 --- a/src/vs/workbench/api/browser/mainThreadMessageService.ts +++ b/src/vs/workbench/api/browser/mainThreadMessageService.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import Severity from 'vs/base/common/severity'; -import { IAction, toAction } from 'vs/base/common/actions'; -import { MainThreadMessageServiceShape, MainContext, MainThreadMessageOptions } from '../common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IDialogService, IPromptButton } from 'vs/platform/dialogs/common/dialogs'; -import { INotificationService, INotificationSource } from 'vs/platform/notification/common/notification'; -import { Event } from 'vs/base/common/event'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { IDisposable } from 'vs/base/common/lifecycle'; +import * as nls from '../../../nls.js'; +import Severity from '../../../base/common/severity.js'; +import { IAction, toAction } from '../../../base/common/actions.js'; +import { MainThreadMessageServiceShape, MainContext, MainThreadMessageOptions } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IDialogService, IPromptButton } from '../../../platform/dialogs/common/dialogs.js'; +import { INotificationService, INotificationSource } from '../../../platform/notification/common/notification.js'; +import { Event } from '../../../base/common/event.js'; +import { ICommandService } from '../../../platform/commands/common/commands.js'; +import { IExtensionService } from '../../services/extensions/common/extensions.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; @extHostNamedCustomer(MainContext.MainThreadMessageService) export class MainThreadMessageService implements MainThreadMessageServiceShape { diff --git a/src/vs/workbench/api/browser/mainThreadModelSelection.ts b/src/vs/workbench/api/browser/mainThreadModelSelection.ts index b06ac3625c8..f523316f748 100644 --- a/src/vs/workbench/api/browser/mainThreadModelSelection.ts +++ b/src/vs/workbench/api/browser/mainThreadModelSelection.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { IAIModelSelectionService, IModelSelectionSettings } from 'vs/platform/aiModel/common/aiModels'; -import { ExtHostContext, ExtHostModelSelectionShape, MainContext, MainThreadModelSelectionShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IAIModelSelectionService, IModelSelectionSettings } from '../../../platform/aiModel/common/aiModels.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostModelSelectionShape, MainContext, MainThreadModelSelectionShape } from '../common/extHost.protocol.js'; @extHostNamedCustomer(MainContext.MainThreadModelSelection) export class MainThreadModelSelection extends Disposable implements MainThreadModelSelectionShape { diff --git a/src/vs/workbench/api/browser/mainThreadNotebook.ts b/src/vs/workbench/api/browser/mainThreadNotebook.ts index c036901f907..927151c9eef 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebook.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebook.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter } from 'vs/base/common/event'; -import { DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ILogService } from 'vs/platform/log/common/log'; -import { NotebookDto } from 'vs/workbench/api/browser/mainThreadNotebookDto'; -import { INotebookCellStatusBarService } from 'vs/workbench/contrib/notebook/common/notebookCellStatusBarService'; -import { INotebookCellStatusBarItemProvider, INotebookContributionData, INotebookExclusiveDocumentFilter, NotebookData, NotebookExtensionDescription, TransientOptions } from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { INotebookService, SimpleNotebookProviderInfo } from 'vs/workbench/contrib/notebook/common/notebookService'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { ExtHostContext, ExtHostNotebookShape, MainContext, MainThreadNotebookShape } from '../common/extHost.protocol'; -import { IRelativePattern } from 'vs/base/common/glob'; -import { revive } from 'vs/base/common/marshalling'; -import { INotebookFileMatchNoModel } from 'vs/workbench/contrib/search/common/searchNotebookHelpers'; -import { NotebookPriorityInfo } from 'vs/workbench/contrib/search/common/search'; -import { coalesce } from 'vs/base/common/arrays'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter } from '../../../base/common/event.js'; +import { DisposableStore, dispose, IDisposable } from '../../../base/common/lifecycle.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { assertType } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { CommandsRegistry } from '../../../platform/commands/common/commands.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { NotebookDto } from './mainThreadNotebookDto.js'; +import { INotebookCellStatusBarService } from '../../contrib/notebook/common/notebookCellStatusBarService.js'; +import { INotebookCellStatusBarItemProvider, INotebookContributionData, INotebookExclusiveDocumentFilter, NotebookData, NotebookExtensionDescription, TransientOptions } from '../../contrib/notebook/common/notebookCommon.js'; +import { INotebookService, SimpleNotebookProviderInfo } from '../../contrib/notebook/common/notebookService.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; +import { ExtHostContext, ExtHostNotebookShape, MainContext, MainThreadNotebookShape } from '../common/extHost.protocol.js'; +import { IRelativePattern } from '../../../base/common/glob.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { INotebookFileMatchNoModel } from '../../contrib/search/common/searchNotebookHelpers.js'; +import { NotebookPriorityInfo } from '../../contrib/search/common/search.js'; +import { coalesce } from '../../../base/common/arrays.js'; @extHostNamedCustomer(MainContext.MainThreadNotebook) export class MainThreadNotebooks implements MainThreadNotebookShape { @@ -104,7 +104,7 @@ export class MainThreadNotebooks implements MainThreadNotebookShape { }; } - const thisPriorityInfo = coalesce([{ isFromSettings: false, filenamePatterns: includes }, ...allPriorityInfo.get(viewType) ?? []]); + const thisPriorityInfo = coalesce([{ isFromSettings: false, filenamePatterns: includes }, ...allPriorityInfo.get(viewType) ?? []]); const otherEditorsPriorityInfo = Array.from(allPriorityInfo.keys()) .flatMap(key => { if (key !== viewType) { diff --git a/src/vs/workbench/api/browser/mainThreadNotebookDocuments.ts b/src/vs/workbench/api/browser/mainThreadNotebookDocuments.ts index c18d0ac258a..c2d1234aa83 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebookDocuments.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebookDocuments.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore, dispose } from 'vs/base/common/lifecycle'; -import { ResourceMap } from 'vs/base/common/map'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { BoundModelReferenceCollection } from 'vs/workbench/api/browser/mainThreadDocuments'; -import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel'; -import { NotebookCellsChangeType } from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { INotebookEditorModelResolverService } from 'vs/workbench/contrib/notebook/common/notebookEditorModelResolverService'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { ExtHostContext, ExtHostNotebookDocumentsShape, MainThreadNotebookDocumentsShape, NotebookCellDto, NotebookCellsChangedEventDto, NotebookDataDto } from '../common/extHost.protocol'; -import { NotebookDto } from 'vs/workbench/api/browser/mainThreadNotebookDto'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { DisposableStore, dispose } from '../../../base/common/lifecycle.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { BoundModelReferenceCollection } from './mainThreadDocuments.js'; +import { NotebookTextModel } from '../../contrib/notebook/common/model/notebookTextModel.js'; +import { NotebookCellsChangeType } from '../../contrib/notebook/common/notebookCommon.js'; +import { INotebookEditorModelResolverService } from '../../contrib/notebook/common/notebookEditorModelResolverService.js'; +import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js'; +import { ExtHostContext, ExtHostNotebookDocumentsShape, MainThreadNotebookDocumentsShape, NotebookCellDto, NotebookCellsChangedEventDto, NotebookDataDto } from '../common/extHost.protocol.js'; +import { NotebookDto } from './mainThreadNotebookDto.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; +import { IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; export class MainThreadNotebookDocuments implements MainThreadNotebookDocumentsShape { @@ -125,30 +125,45 @@ export class MainThreadNotebookDocuments implements MainThreadNotebookDocumentsS } } - async $tryCreateNotebook(options: { viewType: string; content?: NotebookDataDto }): Promise { - const ref = await this._notebookEditorModelResolverService.resolve({ untitledResource: undefined }, options.viewType); - - // untitled notebooks are disposed when they get saved. we should not hold a reference - // to such a disposed notebook and therefore dispose the reference as well - ref.object.notebook.onWillDispose(() => { - ref.dispose(); - }); - - // untitled notebooks are dirty by default - this._proxy.$acceptDirtyStateChanged(ref.object.resource, true); - - // apply content changes... slightly HACKY -> this triggers a change event if (options.content) { - const data = NotebookDto.fromNotebookDataDto(options.content); - ref.object.notebook.reset(data.cells, data.metadata, ref.object.notebook.transientOptions); + const ref = await this._notebookEditorModelResolverService.resolve({ untitledResource: undefined }, options.viewType); + + // untitled notebooks are disposed when they get saved. we should not hold a reference + // to such a disposed notebook and therefore dispose the reference as well + ref.object.notebook.onWillDispose(() => { + ref.dispose(); + }); + + // untitled notebooks with content are dirty by default + this._proxy.$acceptDirtyStateChanged(ref.object.resource, true); + + // apply content changes... slightly HACKY -> this triggers a change event + if (options.content) { + const data = NotebookDto.fromNotebookDataDto(options.content); + ref.object.notebook.reset(data.cells, data.metadata, ref.object.notebook.transientOptions); + } + return ref.object.notebook.uri; + } else { + // If we aren't adding content, we don't need to resolve the full editor model yet. + // This will allow us to adjust settings when the editor is opened, e.g. scratchpad + const notebook = await this._notebookEditorModelResolverService.createUntitledNotebookTextModel(options.viewType); + return notebook.uri; } - return ref.object.resource; } async $tryOpenNotebook(uriComponents: UriComponents): Promise { const uri = URI.revive(uriComponents); const ref = await this._notebookEditorModelResolverService.resolve(uri, undefined); + + if (uriComponents.scheme === 'untitled') { + // untitled notebooks are disposed when they get saved. we should not hold a reference + // to such a disposed notebook and therefore dispose the reference as well + ref.object.notebook.onWillDispose(() => { + ref.dispose(); + }); + } + this._modelReferenceCollection.add(uri, ref); return uri; } diff --git a/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts b/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts index b13e8fb2d25..89c8975eb7e 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { diffMaps, diffSets } from 'vs/base/common/collections'; -import { combinedDisposable, DisposableStore, DisposableMap } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { MainThreadNotebookDocuments } from 'vs/workbench/api/browser/mainThreadNotebookDocuments'; -import { NotebookDto } from 'vs/workbench/api/browser/mainThreadNotebookDto'; -import { MainThreadNotebookEditors } from 'vs/workbench/api/browser/mainThreadNotebookEditors'; -import { extHostCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { editorGroupToColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { getNotebookEditorFromEditorPane, IActiveNotebookEditor, INotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; -import { INotebookEditorService } from 'vs/workbench/contrib/notebook/browser/services/notebookEditorService'; -import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel'; -import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { ExtHostContext, ExtHostNotebookShape, INotebookDocumentsAndEditorsDelta, INotebookEditorAddData, INotebookModelAddedData, MainContext } from '../common/extHost.protocol'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { diffMaps, diffSets } from '../../../base/common/collections.js'; +import { combinedDisposable, DisposableStore, DisposableMap } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { MainThreadNotebookDocuments } from './mainThreadNotebookDocuments.js'; +import { NotebookDto } from './mainThreadNotebookDto.js'; +import { MainThreadNotebookEditors } from './mainThreadNotebookEditors.js'; +import { extHostCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { editorGroupToColumn } from '../../services/editor/common/editorGroupColumn.js'; +import { getNotebookEditorFromEditorPane, IActiveNotebookEditor, INotebookEditor } from '../../contrib/notebook/browser/notebookBrowser.js'; +import { INotebookEditorService } from '../../contrib/notebook/browser/services/notebookEditorService.js'; +import { NotebookTextModel } from '../../contrib/notebook/common/model/notebookTextModel.js'; +import { INotebookService } from '../../contrib/notebook/common/notebookService.js'; +import { IEditorGroupsService } from '../../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../../services/editor/common/editorService.js'; +import { ExtHostContext, ExtHostNotebookShape, INotebookDocumentsAndEditorsDelta, INotebookEditorAddData, INotebookModelAddedData, MainContext } from '../common/extHost.protocol.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; interface INotebookAndEditorDelta { removedDocuments: URI[]; @@ -239,7 +239,8 @@ export class MainThreadNotebooksAndEditors { documentUri: add.textModel.uri, selections: add.getSelections(), visibleRanges: add.visibleRanges, - viewColumn: pane && editorGroupToColumn(this._editorGroupService, pane.group) + viewColumn: pane && editorGroupToColumn(this._editorGroupService, pane.group), + viewType: add.getViewModel().viewType }; } } diff --git a/src/vs/workbench/api/browser/mainThreadNotebookDto.ts b/src/vs/workbench/api/browser/mainThreadNotebookDto.ts index 9c7f5d67f0d..5ba3a3b3f68 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebookDto.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebookDto.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol'; -import * as notebookCommon from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { CellExecutionUpdateType } from 'vs/workbench/contrib/notebook/common/notebookExecutionService'; -import { ICellExecuteUpdate, ICellExecutionComplete } from 'vs/workbench/contrib/notebook/common/notebookExecutionStateService'; +import * as extHostProtocol from '../common/extHost.protocol.js'; +import * as notebookCommon from '../../contrib/notebook/common/notebookCommon.js'; +import { CellExecutionUpdateType } from '../../contrib/notebook/common/notebookExecutionService.js'; +import { ICellExecuteUpdate, ICellExecutionComplete } from '../../contrib/notebook/common/notebookExecutionStateService.js'; export namespace NotebookDto { diff --git a/src/vs/workbench/api/browser/mainThreadNotebookEditors.ts b/src/vs/workbench/api/browser/mainThreadNotebookEditors.ts index 0db9edac4d4..79449f391cf 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebookEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebookEditors.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore, dispose } from 'vs/base/common/lifecycle'; -import { equals } from 'vs/base/common/objects'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { EditorActivation } from 'vs/platform/editor/common/editor'; -import { getNotebookEditorFromEditorPane, INotebookEditor, INotebookEditorOptions } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; -import { INotebookEditorService } from 'vs/workbench/contrib/notebook/browser/services/notebookEditorService'; -import { ICellRange } from 'vs/workbench/contrib/notebook/common/notebookRange'; -import { columnToEditorGroup, editorGroupToColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, ExtHostNotebookEditorsShape, INotebookDocumentShowOptions, INotebookEditorViewColumnInfo, MainThreadNotebookEditorsShape, NotebookEditorRevealType } from '../common/extHost.protocol'; +import { DisposableStore, dispose } from '../../../base/common/lifecycle.js'; +import { equals } from '../../../base/common/objects.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { EditorActivation } from '../../../platform/editor/common/editor.js'; +import { getNotebookEditorFromEditorPane, INotebookEditor, INotebookEditorOptions } from '../../contrib/notebook/browser/notebookBrowser.js'; +import { INotebookEditorService } from '../../contrib/notebook/browser/services/notebookEditorService.js'; +import { ICellRange } from '../../contrib/notebook/common/notebookRange.js'; +import { columnToEditorGroup, editorGroupToColumn } from '../../services/editor/common/editorGroupColumn.js'; +import { IEditorGroupsService } from '../../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../../services/editor/common/editorService.js'; +import { IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostNotebookEditorsShape, INotebookDocumentShowOptions, INotebookEditorViewColumnInfo, MainThreadNotebookEditorsShape, NotebookEditorRevealType } from '../common/extHost.protocol.js'; class MainThreadNotebook { @@ -105,6 +105,7 @@ export class MainThreadNotebookEditors implements MainThreadNotebookEditorsShape // preserve pre 1.38 behaviour to not make group active when preserveFocus: true // but make sure to restore the editor to fix https://github.com/microsoft/vscode/issues/79633 activation: options.preserveFocus ? EditorActivation.RESTORE : undefined, + label: options.label, override: viewType }; diff --git a/src/vs/workbench/api/browser/mainThreadNotebookKernels.ts b/src/vs/workbench/api/browser/mainThreadNotebookKernels.ts index 678825ac6a5..8c38e14647e 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebookKernels.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebookKernels.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { combinedDisposable, DisposableMap, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { NotebookDto } from 'vs/workbench/api/browser/mainThreadNotebookDto'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { INotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; -import { INotebookEditorService } from 'vs/workbench/contrib/notebook/browser/services/notebookEditorService'; -import { INotebookCellExecution, INotebookExecution, INotebookExecutionStateService, NotebookExecutionType } from 'vs/workbench/contrib/notebook/common/notebookExecutionStateService'; -import { IKernelSourceActionProvider, INotebookKernel, INotebookKernelChangeEvent, INotebookKernelDetectionTask, INotebookKernelService, VariablesResult } from 'vs/workbench/contrib/notebook/common/notebookKernelService'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { ExtHostContext, ExtHostNotebookKernelsShape, ICellExecuteUpdateDto, ICellExecutionCompleteDto, INotebookKernelDto2, MainContext, MainThreadNotebookKernelsShape } from '../common/extHost.protocol'; -import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService'; -import { AsyncIterableObject, AsyncIterableSource } from 'vs/base/common/async'; +import { isNonEmptyArray } from '../../../base/common/arrays.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { DisposableMap, DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { ILanguageService } from '../../../editor/common/languages/language.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { NotebookDto } from './mainThreadNotebookDto.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { INotebookEditor } from '../../contrib/notebook/browser/notebookBrowser.js'; +import { INotebookEditorService } from '../../contrib/notebook/browser/services/notebookEditorService.js'; +import { INotebookCellExecution, INotebookExecution, INotebookExecutionStateService, NotebookExecutionType } from '../../contrib/notebook/common/notebookExecutionStateService.js'; +import { IKernelSourceActionProvider, INotebookKernel, INotebookKernelChangeEvent, INotebookKernelDetectionTask, INotebookKernelService, VariablesResult } from '../../contrib/notebook/common/notebookKernelService.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; +import { ExtHostContext, ExtHostNotebookKernelsShape, ICellExecuteUpdateDto, ICellExecutionCompleteDto, INotebookKernelDto2, MainContext, MainThreadNotebookKernelsShape } from '../common/extHost.protocol.js'; +import { INotebookService } from '../../contrib/notebook/common/notebookService.js'; +import { AsyncIterableObject, AsyncIterableSource } from '../../../base/common/async.js'; abstract class MainThreadKernel implements INotebookKernel { private readonly _onDidChange = new Emitter(); @@ -151,6 +151,16 @@ export class MainThreadNotebookKernels implements MainThreadNotebookKernelsShape this._proxy.$cellExecutionChanged(e.notebook, e.cellHandle, e.changed?.state); } })); + + this._disposables.add(this._notebookKernelService.onDidChangeSelectedNotebooks(e => { + for (const [handle, [kernel,]] of this._kernels) { + if (e.oldKernel === kernel.id) { + this._proxy.$acceptNotebookAssociation(handle, e.notebook, false); + } else if (e.newKernel === kernel.id) { + this._proxy.$acceptNotebookAssociation(handle, e.notebook, true); + } + } + })); } dispose(): void { @@ -262,16 +272,10 @@ export class MainThreadNotebookKernels implements MainThreadNotebookKernelsShape } }(data, this._languageService); - const listener = this._notebookKernelService.onDidChangeSelectedNotebooks(e => { - if (e.oldKernel === kernel.id) { - this._proxy.$acceptNotebookAssociation(handle, e.notebook, false); - } else if (e.newKernel === kernel.id) { - this._proxy.$acceptNotebookAssociation(handle, e.notebook, true); - } - }); - - const registration = this._notebookKernelService.registerKernel(kernel); - this._kernels.set(handle, [kernel, combinedDisposable(listener, registration)]); + const disposables = this._disposables.add(new DisposableStore()); + // Ensure _kernels is up to date before we register a kernel. + this._kernels.set(handle, [kernel, disposables]); + disposables.add(this._notebookKernelService.registerKernel(kernel)); } $updateKernel(handle: number, data: Partial): void { diff --git a/src/vs/workbench/api/browser/mainThreadNotebookRenderers.ts b/src/vs/workbench/api/browser/mainThreadNotebookRenderers.ts index b7c9bb85dc7..c0c9aef4e37 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebookRenderers.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebookRenderers.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { ExtHostContext, ExtHostNotebookRenderersShape, MainContext, MainThreadNotebookRenderersShape } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { INotebookRendererMessagingService } from 'vs/workbench/contrib/notebook/common/notebookRendererMessagingService'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { ExtHostContext, ExtHostNotebookRenderersShape, MainContext, MainThreadNotebookRenderersShape } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { INotebookRendererMessagingService } from '../../contrib/notebook/common/notebookRendererMessagingService.js'; @extHostNamedCustomer(MainContext.MainThreadNotebookRenderers) export class MainThreadNotebookRenderers extends Disposable implements MainThreadNotebookRenderersShape { diff --git a/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.ts b/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.ts index dd17844187d..13711b2a979 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { localize } from 'vs/nls'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IProgressStep, IProgress } from 'vs/platform/progress/common/progress'; -import { extHostCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, ExtHostNotebookDocumentSaveParticipantShape } from '../common/extHost.protocol'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { raceCancellationError } from 'vs/base/common/async'; -import { IStoredFileWorkingCopySaveParticipant, IStoredFileWorkingCopySaveParticipantContext, IWorkingCopyFileService } from 'vs/workbench/services/workingCopy/common/workingCopyFileService'; -import { IStoredFileWorkingCopy, IStoredFileWorkingCopyModel } from 'vs/workbench/services/workingCopy/common/storedFileWorkingCopy'; -import { NotebookFileWorkingCopyModel } from 'vs/workbench/contrib/notebook/common/notebookEditorModel'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { localize } from '../../../nls.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { IProgressStep, IProgress } from '../../../platform/progress/common/progress.js'; +import { extHostCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostNotebookDocumentSaveParticipantShape } from '../common/extHost.protocol.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { raceCancellationError } from '../../../base/common/async.js'; +import { IStoredFileWorkingCopySaveParticipant, IStoredFileWorkingCopySaveParticipantContext, IWorkingCopyFileService } from '../../services/workingCopy/common/workingCopyFileService.js'; +import { IStoredFileWorkingCopy, IStoredFileWorkingCopyModel } from '../../services/workingCopy/common/storedFileWorkingCopy.js'; +import { NotebookFileWorkingCopyModel } from '../../contrib/notebook/common/notebookEditorModel.js'; class ExtHostNotebookDocumentSaveParticipant implements IStoredFileWorkingCopySaveParticipant { diff --git a/src/vs/workbench/api/browser/mainThreadOutputService.ts b/src/vs/workbench/api/browser/mainThreadOutputService.ts index 077f0958325..2fa6443b374 100644 --- a/src/vs/workbench/api/browser/mainThreadOutputService.ts +++ b/src/vs/workbench/api/browser/mainThreadOutputService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Registry } from 'vs/platform/registry/common/platform'; -import { Extensions, IOutputChannelRegistry, IOutputService, IOutputChannel, OUTPUT_VIEW_ID, OutputChannelUpdateMode } from 'vs/workbench/services/output/common/output'; -import { MainThreadOutputServiceShape, MainContext, ExtHostOutputServiceShape, ExtHostContext } from '../common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { UriComponents, URI } from 'vs/base/common/uri'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { Event } from 'vs/base/common/event'; -import { IViewsService } from 'vs/workbench/services/views/common/viewsService'; -import { isNumber } from 'vs/base/common/types'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { Extensions, IOutputChannelRegistry, IOutputService, IOutputChannel, OUTPUT_VIEW_ID, OutputChannelUpdateMode } from '../../services/output/common/output.js'; +import { MainThreadOutputServiceShape, MainContext, ExtHostOutputServiceShape, ExtHostContext } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { UriComponents, URI } from '../../../base/common/uri.js'; +import { Disposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { Event } from '../../../base/common/event.js'; +import { IViewsService } from '../../services/views/common/viewsService.js'; +import { isNumber } from '../../../base/common/types.js'; @extHostNamedCustomer(MainContext.MainThreadOutputService) export class MainThreadOutputService extends Disposable implements MainThreadOutputServiceShape { diff --git a/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.ts b/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.ts index 357f1a2c315..ed7d917bb7c 100644 --- a/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.ts +++ b/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Disposable, DisposableMap, IDisposable } from 'vs/base/common/lifecycle'; -import { revive } from 'vs/base/common/marshalling'; -import { URI } from 'vs/base/common/uri'; -import { ExtHostContext, ExtHostProfileContentHandlersShape, MainContext, MainThreadProfileContentHandlersShape } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ISaveProfileResult, IUserDataProfileImportExportService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Disposable, DisposableMap, IDisposable } from '../../../base/common/lifecycle.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { URI } from '../../../base/common/uri.js'; +import { ExtHostContext, ExtHostProfileContentHandlersShape, MainContext, MainThreadProfileContentHandlersShape } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ISaveProfileResult, IUserDataProfileImportExportService } from '../../services/userDataProfile/common/userDataProfile.js'; @extHostNamedCustomer(MainContext.MainThreadProfileContentHandlers) export class MainThreadProfileContentHandlers extends Disposable implements MainThreadProfileContentHandlersShape { diff --git a/src/vs/workbench/api/browser/mainThreadProgress.ts b/src/vs/workbench/api/browser/mainThreadProgress.ts index beec4789ac9..6606b0d64bd 100644 --- a/src/vs/workbench/api/browser/mainThreadProgress.ts +++ b/src/vs/workbench/api/browser/mainThreadProgress.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IProgress, IProgressService, IProgressStep, ProgressLocation, IProgressOptions, IProgressNotificationOptions } from 'vs/platform/progress/common/progress'; -import { MainThreadProgressShape, MainContext, ExtHostProgressShape, ExtHostContext } from '../common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { Action } from 'vs/base/common/actions'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { localize } from 'vs/nls'; +import { IProgress, IProgressService, IProgressStep, ProgressLocation, IProgressOptions, IProgressNotificationOptions } from '../../../platform/progress/common/progress.js'; +import { MainThreadProgressShape, MainContext, ExtHostProgressShape, ExtHostContext } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { Action } from '../../../base/common/actions.js'; +import { ICommandService } from '../../../platform/commands/common/commands.js'; +import { localize } from '../../../nls.js'; class ManageExtensionAction extends Action { constructor(extensionId: string, label: string, commandService: ICommandService) { diff --git a/src/vs/workbench/api/browser/mainThreadQuickDiff.ts b/src/vs/workbench/api/browser/mainThreadQuickDiff.ts index d5312097ee9..541de6b2b5d 100644 --- a/src/vs/workbench/api/browser/mainThreadQuickDiff.ts +++ b/src/vs/workbench/api/browser/mainThreadQuickDiff.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { DisposableMap, IDisposable } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ExtHostContext, ExtHostQuickDiffShape, IDocumentFilterDto, MainContext, MainThreadQuickDiffShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IQuickDiffService, QuickDiffProvider } from 'vs/workbench/contrib/scm/common/quickDiff'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { DisposableMap, IDisposable } from '../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { ExtHostContext, ExtHostQuickDiffShape, IDocumentFilterDto, MainContext, MainThreadQuickDiffShape } from '../common/extHost.protocol.js'; +import { IQuickDiffService, QuickDiffProvider } from '../../contrib/scm/common/quickDiff.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; @extHostNamedCustomer(MainContext.MainThreadQuickDiff) export class MainThreadQuickDiff implements MainThreadQuickDiffShape { diff --git a/src/vs/workbench/api/browser/mainThreadQuickOpen.ts b/src/vs/workbench/api/browser/mainThreadQuickOpen.ts index 001745bf29a..eefc335a079 100644 --- a/src/vs/workbench/api/browser/mainThreadQuickOpen.ts +++ b/src/vs/workbench/api/browser/mainThreadQuickOpen.ts @@ -3,15 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IPickOptions, IInputOptions, IQuickInputService, IQuickInput, IQuickPick, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { ExtHostContext, MainThreadQuickOpenShape, ExtHostQuickOpenShape, TransferQuickPickItem, MainContext, TransferQuickInput, TransferQuickInputButton, IInputBoxOptions, TransferQuickPickItemOrSeparator } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { URI } from 'vs/base/common/uri'; -import { CancellationToken } from 'vs/base/common/cancellation'; +import { IPickOptions, IInputOptions, IQuickInputService, IQuickInput, IQuickPick, IQuickPickItem } from '../../../platform/quickinput/common/quickInput.js'; +import { ExtHostContext, MainThreadQuickOpenShape, ExtHostQuickOpenShape, TransferQuickPickItem, MainContext, TransferQuickInput, TransferQuickInputButton, IInputBoxOptions, TransferQuickPickItemOrSeparator } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { URI } from '../../../base/common/uri.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; interface QuickInputSession { input: IQuickInput; handlesToItems: Map; + store: DisposableStore; } function reviveIconPathUris(iconPath: { dark: URI; light?: URI | undefined }) { @@ -40,6 +42,9 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape { } public dispose(): void { + for (const [_id, session] of this.sessions) { + session.store.dispose(); + } } $show(instance: number, options: IPickOptions, token: CancellationToken): Promise { @@ -121,38 +126,40 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape { const sessionId = params.id; let session = this.sessions.get(sessionId); if (!session) { - + const store = new DisposableStore(); const input = params.type === 'quickPick' ? this._quickInputService.createQuickPick() : this._quickInputService.createInputBox(); - input.onDidAccept(() => { + store.add(input); + store.add(input.onDidAccept(() => { this._proxy.$onDidAccept(sessionId); - }); - input.onDidTriggerButton(button => { + })); + store.add(input.onDidTriggerButton(button => { this._proxy.$onDidTriggerButton(sessionId, (button as TransferQuickInputButton).handle); - }); - input.onDidChangeValue(value => { + })); + store.add(input.onDidChangeValue(value => { this._proxy.$onDidChangeValue(sessionId, value); - }); - input.onDidHide(() => { + })); + store.add(input.onDidHide(() => { this._proxy.$onDidHide(sessionId); - }); + })); if (params.type === 'quickPick') { // Add extra events specific for quickpick const quickpick = input as IQuickPick; - quickpick.onDidChangeActive(items => { + store.add(quickpick.onDidChangeActive(items => { this._proxy.$onDidChangeActive(sessionId, items.map(item => (item as TransferQuickPickItem).handle)); - }); - quickpick.onDidChangeSelection(items => { + })); + store.add(quickpick.onDidChangeSelection(items => { this._proxy.$onDidChangeSelection(sessionId, items.map(item => (item as TransferQuickPickItem).handle)); - }); - quickpick.onDidTriggerItemButton((e) => { + })); + store.add(quickpick.onDidTriggerItemButton((e) => { this._proxy.$onDidTriggerItemButton(sessionId, (e.item as TransferQuickPickItem).handle, (e.button as TransferQuickInputButton).handle); - }); + })); } session = { input, - handlesToItems: new Map() + handlesToItems: new Map(), + store }; this.sessions.set(sessionId, session); } @@ -212,7 +219,7 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape { $dispose(sessionId: number): Promise { const session = this.sessions.get(sessionId); if (session) { - session.input.dispose(); + session.store.dispose(); this.sessions.delete(sessionId); } return Promise.resolve(undefined); diff --git a/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.ts b/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.ts index abcaa4cc720..6d3fdb8228f 100644 --- a/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.ts +++ b/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { extHostCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, ExtHostExtensionServiceShape } from '../common/extHost.protocol'; -import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; +import { extHostCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostExtensionServiceShape } from '../common/extHost.protocol.js'; +import { IRemoteAuthorityResolverService } from '../../../platform/remote/common/remoteAuthorityResolver.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IWorkbenchEnvironmentService } from '../../services/environment/common/environmentService.js'; @extHostCustomer export class MainThreadRemoteConnectionData extends Disposable { diff --git a/src/vs/workbench/api/browser/mainThreadSCM.ts b/src/vs/workbench/api/browser/mainThreadSCM.ts index 5ae48f45106..2db57b96691 100644 --- a/src/vs/workbench/api/browser/mainThreadSCM.ts +++ b/src/vs/workbench/api/browser/mainThreadSCM.ts @@ -3,31 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Barrier } from 'vs/base/common/async'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { Event, Emitter } from 'vs/base/common/event'; -import { observableValue } from 'vs/base/common/observable'; -import { IDisposable, DisposableStore, combinedDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; -import { ISCMService, ISCMRepository, ISCMProvider, ISCMResource, ISCMResourceGroup, ISCMResourceDecorations, IInputValidation, ISCMViewService, InputValidationType, ISCMActionButtonDescriptor } from 'vs/workbench/contrib/scm/common/scm'; -import { ExtHostContext, MainThreadSCMShape, ExtHostSCMShape, SCMProviderFeatures, SCMRawResourceSplices, SCMGroupFeatures, MainContext, SCMHistoryItemGroupDto, SCMHistoryItemDto } from '../common/extHost.protocol'; -import { Command } from 'vs/editor/common/languages'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { MarshalledId } from 'vs/base/common/marshallingIds'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { IQuickDiffService, QuickDiffProvider } from 'vs/workbench/contrib/scm/common/quickDiff'; -import { ISCMHistoryItem, ISCMHistoryItemChange, ISCMHistoryItemGroup, ISCMHistoryOptions, ISCMHistoryProvider } from 'vs/workbench/contrib/scm/common/history'; -import { ResourceTree } from 'vs/base/common/resourceTree'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { basename } from 'vs/base/common/resources'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ITextModelContentProvider, ITextModelService } from 'vs/editor/common/services/resolverService'; -import { Schemas } from 'vs/base/common/network'; -import { ITextModel } from 'vs/editor/common/model'; -import { ILogService } from 'vs/platform/log/common/log'; +import { Barrier } from '../../../base/common/async.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { Event, Emitter } from '../../../base/common/event.js'; +import { IObservable, observableValue, observableValueOpts, transaction } from '../../../base/common/observable.js'; +import { IDisposable, DisposableStore, combinedDisposable, dispose, Disposable } from '../../../base/common/lifecycle.js'; +import { ISCMService, ISCMRepository, ISCMProvider, ISCMResource, ISCMResourceGroup, ISCMResourceDecorations, IInputValidation, ISCMViewService, InputValidationType, ISCMActionButtonDescriptor } from '../../contrib/scm/common/scm.js'; +import { ExtHostContext, MainThreadSCMShape, ExtHostSCMShape, SCMProviderFeatures, SCMRawResourceSplices, SCMGroupFeatures, MainContext, SCMHistoryItemDto, SCMHistoryItemRefsChangeEventDto, SCMHistoryItemRefDto } from '../common/extHost.protocol.js'; +import { Command } from '../../../editor/common/languages.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { MarshalledId } from '../../../base/common/marshallingIds.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { IQuickDiffService, QuickDiffProvider } from '../../contrib/scm/common/quickDiff.js'; +import { ISCMHistoryItem, ISCMHistoryItemChange, ISCMHistoryItemRef, ISCMHistoryItemRefsChangeEvent, ISCMHistoryOptions, ISCMHistoryProvider } from '../../contrib/scm/common/history.js'; +import { ResourceTree } from '../../../base/common/resourceTree.js'; +import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js'; +import { IWorkspaceContextService } from '../../../platform/workspace/common/workspace.js'; +import { basename } from '../../../base/common/resources.js'; +import { ILanguageService } from '../../../editor/common/languages/language.js'; +import { IModelService } from '../../../editor/common/services/model.js'; +import { ITextModelContentProvider, ITextModelService } from '../../../editor/common/services/resolverService.js'; +import { Schemas } from '../../../base/common/network.js'; +import { ITextModel } from '../../../editor/common/model.js'; +import { structuralEquals } from '../../../base/common/equals.js'; +import { historyItemBaseRefColor, historyItemRefColor, historyItemRemoteRefColor } from '../../contrib/scm/browser/scmHistory.js'; +import { ColorIdentifier } from '../../../platform/theme/common/colorUtils.js'; function getIconFromIconDto(iconDto?: UriComponents | { light: UriComponents; dark: UriComponents } | ThemeIcon): URI | { light: URI; dark: URI } | ThemeIcon | undefined { if (iconDto === undefined) { @@ -43,10 +45,19 @@ function getIconFromIconDto(iconDto?: UriComponents | { light: UriComponents; da } function toISCMHistoryItem(historyItemDto: SCMHistoryItemDto): ISCMHistoryItem { - const icon = getIconFromIconDto(historyItemDto.icon); - const labels = historyItemDto.labels?.map(l => ({ title: l.title, icon: getIconFromIconDto(l.icon) })); + const references = historyItemDto.references?.map(r => ({ + ...r, icon: getIconFromIconDto(r.icon) + })); - return { ...historyItemDto, icon, labels }; + const newLineIndex = historyItemDto.message.indexOf('\n'); + const subject = newLineIndex === -1 ? + historyItemDto.message : `${historyItemDto.message.substring(0, newLineIndex)}\u2026`; + + return { ...historyItemDto, subject, references }; +} + +function toISCMHistoryItemRef(historyItemRefDto?: SCMHistoryItemRefDto, color?: ColorIdentifier): ISCMHistoryItemRef | undefined { + return historyItemRefDto ? { ...historyItemRefDto, icon: getIconFromIconDto(historyItemRefDto.icon), color: color } : undefined; } class SCMInputBoxContentProvider extends Disposable implements ITextModelContentProvider { @@ -161,41 +172,43 @@ class MainThreadSCMResource implements ISCMResource { } class MainThreadSCMHistoryProvider implements ISCMHistoryProvider { - - private _onDidChangeCurrentHistoryItemGroup = new Emitter(); - readonly onDidChangeCurrentHistoryItemGroup = this._onDidChangeCurrentHistoryItemGroup.event; - - private _currentHistoryItemGroup: ISCMHistoryItemGroup | undefined; - get currentHistoryItemGroup(): ISCMHistoryItemGroup | undefined { return this._currentHistoryItemGroup; } - set currentHistoryItemGroup(historyItemGroup: ISCMHistoryItemGroup | undefined) { - this._currentHistoryItemGroup = historyItemGroup; - this._onDidChangeCurrentHistoryItemGroup.fire(); - } - - private readonly _currentHistoryItemGroupObs = observableValue(this, undefined); - get currentHistoryItemGroupObs() { return this._currentHistoryItemGroupObs; } + private readonly _historyItemRef = observableValueOpts({ + owner: this, + equalsFn: structuralEquals + }, undefined); + get historyItemRef(): IObservable { return this._historyItemRef; } + + private readonly _historyItemRemoteRef = observableValueOpts({ + owner: this, + equalsFn: structuralEquals + }, undefined); + get historyItemRemoteRef(): IObservable { return this._historyItemRemoteRef; } + + private readonly _historyItemBaseRef = observableValueOpts({ + owner: this, + equalsFn: structuralEquals + }, undefined); + get historyItemBaseRef(): IObservable { return this._historyItemBaseRef; } + + private readonly _historyItemRefChanges = observableValue(this, { added: [], modified: [], removed: [], silent: false }); + get historyItemRefChanges(): IObservable { return this._historyItemRefChanges; } constructor(private readonly proxy: ExtHostSCMShape, private readonly handle: number) { } - async resolveHistoryItemGroupCommonAncestor(historyItemGroupId1: string, historyItemGroupId2: string | undefined): Promise<{ id: string; ahead: number; behind: number } | undefined> { - return this.proxy.$resolveHistoryItemGroupCommonAncestor(this.handle, historyItemGroupId1, historyItemGroupId2, CancellationToken.None); + async resolveHistoryItemRefsCommonAncestor(historyItemRefs: string[]): Promise { + return this.proxy.$resolveHistoryItemRefsCommonAncestor(this.handle, historyItemRefs, CancellationToken.None); } - async provideHistoryItems(historyItemGroupId: string, options: ISCMHistoryOptions): Promise { - const historyItems = await this.proxy.$provideHistoryItems(this.handle, historyItemGroupId, options, CancellationToken.None); - return historyItems?.map(historyItem => toISCMHistoryItem(historyItem)); + async provideHistoryItemRefs(): Promise { + const historyItemRefs = await this.proxy.$provideHistoryItemRefs(this.handle, CancellationToken.None); + return historyItemRefs?.map(ref => ({ ...ref, icon: getIconFromIconDto(ref.icon) })); } - async provideHistoryItems2(options: ISCMHistoryOptions): Promise { - const historyItems = await this.proxy.$provideHistoryItems2(this.handle, options, CancellationToken.None); + async provideHistoryItems(options: ISCMHistoryOptions): Promise { + const historyItems = await this.proxy.$provideHistoryItems(this.handle, options, CancellationToken.None); return historyItems?.map(historyItem => toISCMHistoryItem(historyItem)); } - async provideHistoryItemSummary(historyItemId: string, historyItemParentId: string | undefined): Promise { - const historyItem = await this.proxy.$provideHistoryItemSummary(this.handle, historyItemId, historyItemParentId, CancellationToken.None); - return historyItem ? toISCMHistoryItem(historyItem) : undefined; - } - async provideHistoryItemChanges(historyItemId: string, historyItemParentId: string | undefined): Promise { const changes = await this.proxy.$provideHistoryItemChanges(this.handle, historyItemId, historyItemParentId, CancellationToken.None); return changes?.map(change => ({ @@ -206,8 +219,20 @@ class MainThreadSCMHistoryProvider implements ISCMHistoryProvider { })); } - $onDidChangeCurrentHistoryItemGroup(historyItemGroup: ISCMHistoryItemGroup | undefined): void { - this._currentHistoryItemGroupObs.set(historyItemGroup, undefined); + $onDidChangeCurrentHistoryItemRefs(historyItemRef?: SCMHistoryItemRefDto, historyItemRemoteRef?: SCMHistoryItemRefDto, historyItemBaseRef?: SCMHistoryItemRefDto): void { + transaction(tx => { + this._historyItemRef.set(toISCMHistoryItemRef(historyItemRef, historyItemRefColor), tx); + this._historyItemRemoteRef.set(toISCMHistoryItemRef(historyItemRemoteRef, historyItemRemoteRefColor), tx); + this._historyItemBaseRef.set(toISCMHistoryItemRef(historyItemBaseRef, historyItemBaseRefColor), tx); + }); + } + + $onDidChangeHistoryItemRefs(historyItemRefs: SCMHistoryItemRefsChangeEventDto): void { + const added = historyItemRefs.added.map(ref => toISCMHistoryItemRef(ref)!); + const modified = historyItemRefs.modified.map(ref => toISCMHistoryItemRef(ref)!); + const removed = historyItemRefs.removed.map(ref => toISCMHistoryItemRef(ref)!); + + this._historyItemRefChanges.set({ added, modified, removed, silent: historyItemRefs.silent }, undefined); } } @@ -245,7 +270,6 @@ class MainThreadSCMProvider implements ISCMProvider, QuickDiffProvider { get inputBoxTextModel(): ITextModel { return this._inputBoxTextModel; } get contextValue(): string { return this._providerId; } - get historyProvider(): ISCMHistoryProvider | undefined { return this._historyProvider; } get acceptInputCommand(): Command | undefined { return this.features.acceptInputCommand; } get actionButton(): ISCMActionButtonDescriptor | undefined { return this.features.actionButton ?? undefined; } @@ -261,18 +285,14 @@ class MainThreadSCMProvider implements ISCMProvider, QuickDiffProvider { private readonly _commitTemplate = observableValue(this, ''); get commitTemplate() { return this._commitTemplate; } - private readonly _onDidChangeHistoryProvider = new Emitter(); - readonly onDidChangeHistoryProvider: Event = this._onDidChangeHistoryProvider.event; - private readonly _onDidChange = new Emitter(); readonly onDidChange: Event = this._onDidChange.event; private _quickDiff: IDisposable | undefined; public readonly isSCM: boolean = true; - private _historyProvider: ISCMHistoryProvider | undefined; - private readonly _historyProviderObs = observableValue(this, undefined); - get historyProviderObs() { return this._historyProviderObs; } + private readonly _historyProvider = observableValue(this, undefined); + get historyProvider() { return this._historyProvider; } constructor( private readonly proxy: ExtHostSCMShape, @@ -283,8 +303,7 @@ class MainThreadSCMProvider implements ISCMProvider, QuickDiffProvider { private readonly _inputBoxTextModel: ITextModel, private readonly _quickDiffService: IQuickDiffService, private readonly _uriIdentService: IUriIdentityService, - private readonly _workspaceContextService: IWorkspaceContextService, - private readonly _logService: ILogService + private readonly _workspaceContextService: IWorkspaceContextService ) { if (_rootUri) { const folder = this._workspaceContextService.getWorkspaceFolder(_rootUri); @@ -309,7 +328,6 @@ class MainThreadSCMProvider implements ISCMProvider, QuickDiffProvider { } if (typeof features.statusBarCommands !== 'undefined') { - this._logService.trace(`MainThreadSCMProvider#updateSourceControl (${this._id}): ${features.statusBarCommands.map(c => c.title).join(', ')}`); this._statusBarCommands.set(features.statusBarCommands, undefined); } @@ -325,17 +343,11 @@ class MainThreadSCMProvider implements ISCMProvider, QuickDiffProvider { this._quickDiff = undefined; } - if (features.hasHistoryProvider && !this._historyProvider) { + if (features.hasHistoryProvider && !this.historyProvider.get()) { const historyProvider = new MainThreadSCMHistoryProvider(this.proxy, this.handle); - this._historyProviderObs.set(historyProvider, undefined); - - this._historyProvider = historyProvider; - this._onDidChangeHistoryProvider.fire(); - } else if (features.hasHistoryProvider === false && this._historyProvider) { - this._historyProviderObs.set(undefined, undefined); - - this._historyProvider = undefined; - this._onDidChangeHistoryProvider.fire(); + this._historyProvider.set(historyProvider, undefined); + } else if (features.hasHistoryProvider === false && this.historyProvider.get()) { + this._historyProvider.set(undefined, undefined); } } @@ -451,13 +463,20 @@ class MainThreadSCMProvider implements ISCMProvider, QuickDiffProvider { return result && URI.revive(result); } - $onDidChangeHistoryProviderCurrentHistoryItemGroup(currentHistoryItemGroup?: SCMHistoryItemGroupDto): void { - if (!this._historyProvider) { + $onDidChangeHistoryProviderCurrentHistoryItemRefs(historyItemRef?: SCMHistoryItemRefDto, historyItemRemoteRef?: SCMHistoryItemRefDto, historyItemBaseRef?: SCMHistoryItemRefDto): void { + if (!this.historyProvider.get()) { + return; + } + + this._historyProvider.get()?.$onDidChangeCurrentHistoryItemRefs(historyItemRef, historyItemRemoteRef, historyItemBaseRef); + } + + $onDidChangeHistoryProviderHistoryItemRefs(historyItemRefs: SCMHistoryItemRefsChangeEventDto): void { + if (!this.historyProvider.get()) { return; } - this._historyProvider.currentHistoryItemGroup = currentHistoryItemGroup ?? undefined; - this._historyProviderObs.get()?.$onDidChangeCurrentHistoryItemGroup(currentHistoryItemGroup); + this._historyProvider.get()?.$onDidChangeHistoryItemRefs(historyItemRefs); } toJSON(): any { @@ -490,8 +509,7 @@ export class MainThreadSCM implements MainThreadSCMShape { @ITextModelService private readonly textModelService: ITextModelService, @IQuickDiffService private readonly quickDiffService: IQuickDiffService, @IUriIdentityService private readonly _uriIdentService: IUriIdentityService, - @IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService, - @ILogService private readonly logService: ILogService + @IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService ) { this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostSCM); @@ -512,7 +530,7 @@ export class MainThreadSCM implements MainThreadSCMShape { this._repositoryBarriers.set(handle, new Barrier()); const inputBoxTextModelRef = await this.textModelService.createModelReference(URI.revive(inputBoxDocumentUri)); - const provider = new MainThreadSCMProvider(this._proxy, handle, id, label, rootUri ? URI.revive(rootUri) : undefined, inputBoxTextModelRef.object.textEditorModel, this.quickDiffService, this._uriIdentService, this.workspaceContextService, this.logService); + const provider = new MainThreadSCMProvider(this._proxy, handle, id, label, rootUri ? URI.revive(rootUri) : undefined, inputBoxTextModelRef.object.textEditorModel, this.quickDiffService, this._uriIdentService, this.workspaceContextService); const repository = this.scmService.registerSCMProvider(provider); this._repositories.set(handle, repository); @@ -694,7 +712,19 @@ export class MainThreadSCM implements MainThreadSCMShape { } } - async $onDidChangeHistoryProviderCurrentHistoryItemGroup(sourceControlHandle: number, historyItemGroup: SCMHistoryItemGroupDto | undefined): Promise { + async $onDidChangeHistoryProviderCurrentHistoryItemRefs(sourceControlHandle: number, historyItemRef?: SCMHistoryItemRefDto, historyItemRemoteRef?: SCMHistoryItemRefDto, historyItemBaseRef?: SCMHistoryItemRefDto): Promise { + await this._repositoryBarriers.get(sourceControlHandle)?.wait(); + const repository = this._repositories.get(sourceControlHandle); + + if (!repository) { + return; + } + + const provider = repository.provider as MainThreadSCMProvider; + provider.$onDidChangeHistoryProviderCurrentHistoryItemRefs(historyItemRef, historyItemRemoteRef, historyItemBaseRef); + } + + async $onDidChangeHistoryProviderHistoryItemRefs(sourceControlHandle: number, historyItemRefs: SCMHistoryItemRefsChangeEventDto): Promise { await this._repositoryBarriers.get(sourceControlHandle)?.wait(); const repository = this._repositories.get(sourceControlHandle); @@ -703,6 +733,6 @@ export class MainThreadSCM implements MainThreadSCMShape { } const provider = repository.provider as MainThreadSCMProvider; - provider.$onDidChangeHistoryProviderCurrentHistoryItemGroup(historyItemGroup); + provider.$onDidChangeHistoryProviderHistoryItemRefs(historyItemRefs); } } diff --git a/src/vs/workbench/api/browser/mainThreadSaveParticipant.ts b/src/vs/workbench/api/browser/mainThreadSaveParticipant.ts index a8c110c2ed4..9070caa10dd 100644 --- a/src/vs/workbench/api/browser/mainThreadSaveParticipant.ts +++ b/src/vs/workbench/api/browser/mainThreadSaveParticipant.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { shouldSynchronizeModel } from 'vs/editor/common/model'; -import { localize } from 'vs/nls'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IProgressStep, IProgress } from 'vs/platform/progress/common/progress'; -import { extHostCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ITextFileSaveParticipant, ITextFileService, ITextFileEditorModel, ITextFileSaveParticipantContext } from 'vs/workbench/services/textfile/common/textfiles'; -import { ExtHostContext, ExtHostDocumentSaveParticipantShape } from '../common/extHost.protocol'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { raceCancellationError } from 'vs/base/common/async'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { shouldSynchronizeModel } from '../../../editor/common/model.js'; +import { localize } from '../../../nls.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { IProgressStep, IProgress } from '../../../platform/progress/common/progress.js'; +import { extHostCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ITextFileSaveParticipant, ITextFileService, ITextFileEditorModel, ITextFileSaveParticipantContext } from '../../services/textfile/common/textfiles.js'; +import { ExtHostContext, ExtHostDocumentSaveParticipantShape } from '../common/extHost.protocol.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { raceCancellationError } from '../../../base/common/async.js'; class ExtHostSaveParticipant implements ITextFileSaveParticipant { diff --git a/src/vs/workbench/api/browser/mainThreadSearch.ts b/src/vs/workbench/api/browser/mainThreadSearch.ts index 9b1af87b574..4c02ed65739 100644 --- a/src/vs/workbench/api/browser/mainThreadSearch.ts +++ b/src/vs/workbench/api/browser/mainThreadSearch.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IFileMatch, IFileQuery, IRawFileMatch2, ISearchComplete, ISearchCompleteStats, ISearchProgressItem, ISearchQuery, ISearchResultProvider, ISearchService, ITextQuery, QueryType, SearchProviderType } from 'vs/workbench/services/search/common/search'; -import { ExtHostContext, ExtHostSearchShape, MainContext, MainThreadSearchShape } from '../common/extHost.protocol'; -import { revive } from 'vs/base/common/marshalling'; -import * as Constants from 'vs/workbench/contrib/search/common/constants'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { DisposableStore, dispose, IDisposable } from '../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { ITelemetryService } from '../../../platform/telemetry/common/telemetry.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IFileMatch, IFileQuery, IRawFileMatch2, ISearchComplete, ISearchCompleteStats, ISearchProgressItem, ISearchQuery, ISearchResultProvider, ISearchService, ITextQuery, QueryType, SearchProviderType } from '../../services/search/common/search.js'; +import { ExtHostContext, ExtHostSearchShape, MainContext, MainThreadSearchShape } from '../common/extHost.protocol.js'; +import { revive } from '../../../base/common/marshalling.js'; +import * as Constants from '../../contrib/search/common/constants.js'; +import { IContextKeyService } from '../../../platform/contextkey/common/contextkey.js'; @extHostNamedCustomer(MainContext.MainThreadSearch) export class MainThreadSearch implements MainThreadSearchShape { diff --git a/src/vs/workbench/api/browser/mainThreadSecretState.ts b/src/vs/workbench/api/browser/mainThreadSecretState.ts index 2c70d06f1ac..4fe8ac9c74d 100644 --- a/src/vs/workbench/api/browser/mainThreadSecretState.ts +++ b/src/vs/workbench/api/browser/mainThreadSecretState.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, ExtHostSecretStateShape, MainContext, MainThreadSecretStateShape } from '../common/extHost.protocol'; -import { ILogService } from 'vs/platform/log/common/log'; -import { SequencerByKey } from 'vs/base/common/async'; -import { ISecretStorageService } from 'vs/platform/secrets/common/secrets'; -import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostSecretStateShape, MainContext, MainThreadSecretStateShape } from '../common/extHost.protocol.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { SequencerByKey } from '../../../base/common/async.js'; +import { ISecretStorageService } from '../../../platform/secrets/common/secrets.js'; +import { IBrowserWorkbenchEnvironmentService } from '../../services/environment/browser/environmentService.js'; @extHostNamedCustomer(MainContext.MainThreadSecretState) export class MainThreadSecretState extends Disposable implements MainThreadSecretStateShape { diff --git a/src/vs/workbench/api/browser/mainThreadShare.ts b/src/vs/workbench/api/browser/mainThreadShare.ts index d517c23c906..cb63bb3fd03 100644 --- a/src/vs/workbench/api/browser/mainThreadShare.ts +++ b/src/vs/workbench/api/browser/mainThreadShare.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { ExtHostContext, ExtHostShareShape, IDocumentFilterDto, MainContext, MainThreadShareShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IShareProvider, IShareService, IShareableItem } from 'vs/workbench/contrib/share/common/share'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IDisposable, dispose } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { ExtHostContext, ExtHostShareShape, IDocumentFilterDto, MainContext, MainThreadShareShape } from '../common/extHost.protocol.js'; +import { IShareProvider, IShareService, IShareableItem } from '../../contrib/share/common/share.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; @extHostNamedCustomer(MainContext.MainThreadShare) export class MainThreadShare implements MainThreadShareShape { diff --git a/src/vs/workbench/api/browser/mainThreadSpeech.ts b/src/vs/workbench/api/browser/mainThreadSpeech.ts index 6dbb9033772..e2e0ad577a5 100644 --- a/src/vs/workbench/api/browser/mainThreadSpeech.ts +++ b/src/vs/workbench/api/browser/mainThreadSpeech.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { raceCancellation } from 'vs/base/common/async'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostContext, ExtHostSpeechShape, MainContext, MainThreadSpeechShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IKeywordRecognitionEvent, ISpeechProviderMetadata, ISpeechService, ISpeechToTextEvent, ITextToSpeechEvent, TextToSpeechStatus } from 'vs/workbench/contrib/speech/common/speechService'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { raceCancellation } from '../../../base/common/async.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ExtHostContext, ExtHostSpeechShape, MainContext, MainThreadSpeechShape } from '../common/extHost.protocol.js'; +import { IKeywordRecognitionEvent, ISpeechProviderMetadata, ISpeechService, ISpeechToTextEvent, ITextToSpeechEvent, TextToSpeechStatus } from '../../contrib/speech/common/speechService.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; type SpeechToTextSession = { readonly onDidChange: Emitter; diff --git a/src/vs/workbench/api/browser/mainThreadStatusBar.ts b/src/vs/workbench/api/browser/mainThreadStatusBar.ts index 00eb17f4982..4988e519f39 100644 --- a/src/vs/workbench/api/browser/mainThreadStatusBar.ts +++ b/src/vs/workbench/api/browser/mainThreadStatusBar.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MainThreadStatusBarShape, MainContext, ExtHostContext, StatusBarItemDto } from '../common/extHost.protocol'; -import { ThemeColor } from 'vs/base/common/themables'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -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 { IStatusbarEntry, StatusbarAlignment } from 'vs/workbench/services/statusbar/browser/statusbar'; +import { MainThreadStatusBarShape, MainContext, ExtHostContext, StatusBarItemDto } from '../common/extHost.protocol.js'; +import { ThemeColor } from '../../../base/common/themables.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +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'; @extHostNamedCustomer(MainContext.MainThreadStatusBar) export class MainThreadStatusBar implements MainThreadStatusBarShape { diff --git a/src/vs/workbench/api/browser/mainThreadStorage.ts b/src/vs/workbench/api/browser/mainThreadStorage.ts index 1d2fa2d8074..a801e971391 100644 --- a/src/vs/workbench/api/browser/mainThreadStorage.ts +++ b/src/vs/workbench/api/browser/mainThreadStorage.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { MainThreadStorageShape, MainContext, ExtHostStorageShape, ExtHostContext } from '../common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { isWeb } from 'vs/base/common/platform'; -import { IExtensionIdWithVersion, IExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage'; -import { migrateExtensionStorage } from 'vs/workbench/services/extensions/common/extensionStorageMigration'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; +import { IStorageService, StorageScope } from '../../../platform/storage/common/storage.js'; +import { MainThreadStorageShape, MainContext, ExtHostStorageShape, ExtHostContext } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { isWeb } from '../../../base/common/platform.js'; +import { IExtensionIdWithVersion, IExtensionStorageService } from '../../../platform/extensionManagement/common/extensionStorage.js'; +import { migrateExtensionStorage } from '../../services/extensions/common/extensionStorageMigration.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; @extHostNamedCustomer(MainContext.MainThreadStorage) export class MainThreadStorage implements MainThreadStorageShape { diff --git a/src/vs/workbench/api/browser/mainThreadTask.ts b/src/vs/workbench/api/browser/mainThreadTask.ts index 9c37c597978..3dc0326ef05 100644 --- a/src/vs/workbench/api/browser/mainThreadTask.ts +++ b/src/vs/workbench/api/browser/mainThreadTask.ts @@ -3,37 +3,37 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../nls.js'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import * as Types from 'vs/base/common/types'; -import * as Platform from 'vs/base/common/platform'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import * as Types from '../../../base/common/types.js'; +import * as Platform from '../../../base/common/platform.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; -import { IWorkspace, IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; +import { IWorkspace, IWorkspaceContextService, IWorkspaceFolder } from '../../../platform/workspace/common/workspace.js'; import { ContributedTask, ConfiguringTask, KeyedTaskIdentifier, ITaskExecution, Task, ITaskEvent, TaskEventKind, IPresentationOptions, CommandOptions, ICommandConfiguration, RuntimeType, CustomTask, TaskScope, TaskSource, TaskSourceKind, IExtensionTaskSource, IRunOptions, ITaskSet, TaskGroup, TaskDefinition, PresentationOptions, RunOptions -} from 'vs/workbench/contrib/tasks/common/tasks'; +} from '../../contrib/tasks/common/tasks.js'; -import { IResolveSet, IResolvedVariables } from 'vs/workbench/contrib/tasks/common/taskSystem'; -import { ITaskService, ITaskFilter, ITaskProvider } from 'vs/workbench/contrib/tasks/common/taskService'; +import { IResolveSet, IResolvedVariables } from '../../contrib/tasks/common/taskSystem.js'; +import { ITaskService, ITaskFilter, ITaskProvider } from '../../contrib/tasks/common/taskService.js'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, MainThreadTaskShape, ExtHostTaskShape, MainContext } from 'vs/workbench/api/common/extHost.protocol'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, MainThreadTaskShape, ExtHostTaskShape, MainContext } from '../common/extHost.protocol.js'; import { ITaskDefinitionDTO, ITaskExecutionDTO, IProcessExecutionOptionsDTO, ITaskPresentationOptionsDTO, IProcessExecutionDTO, IShellExecutionDTO, IShellExecutionOptionsDTO, ICustomExecutionDTO, ITaskDTO, ITaskSourceDTO, ITaskHandleDTO, ITaskFilterDTO, ITaskProcessStartedDTO, ITaskProcessEndedDTO, ITaskSystemInfoDTO, IRunOptionsDTO, ITaskGroupDTO -} from 'vs/workbench/api/common/shared/tasks'; -import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; -import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; -import { ErrorNoTelemetry } from 'vs/base/common/errors'; +} from '../common/shared/tasks.js'; +import { IConfigurationResolverService } from '../../services/configurationResolver/common/configurationResolver.js'; +import { ConfigurationTarget } from '../../../platform/configuration/common/configuration.js'; +import { ErrorNoTelemetry } from '../../../base/common/errors.js'; namespace TaskExecutionDTO { export function from(value: ITaskExecution): ITaskExecutionDTO { diff --git a/src/vs/workbench/api/browser/mainThreadTelemetry.ts b/src/vs/workbench/api/browser/mainThreadTelemetry.ts index 1728a106f61..ab72a2abdf8 100644 --- a/src/vs/workbench/api/browser/mainThreadTelemetry.ts +++ b/src/vs/workbench/api/browser/mainThreadTelemetry.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings'; -import { ITelemetryService, TelemetryLevel, TELEMETRY_OLD_SETTING_ID, TELEMETRY_SETTING_ID } from 'vs/platform/telemetry/common/telemetry'; -import { supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, ExtHostTelemetryShape, MainContext, MainThreadTelemetryShape } from '../common/extHost.protocol'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; +import { IProductService } from '../../../platform/product/common/productService.js'; +import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from '../../../platform/telemetry/common/gdprTypings.js'; +import { ITelemetryService, TelemetryLevel, TELEMETRY_OLD_SETTING_ID, TELEMETRY_SETTING_ID } from '../../../platform/telemetry/common/telemetry.js'; +import { supportsTelemetry } from '../../../platform/telemetry/common/telemetryUtils.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostTelemetryShape, MainContext, MainThreadTelemetryShape } from '../common/extHost.protocol.js'; @extHostNamedCustomer(MainContext.MainThreadTelemetry) export class MainThreadTelemetry extends Disposable implements MainThreadTelemetryShape { diff --git a/src/vs/workbench/api/browser/mainThreadTerminalService.ts b/src/vs/workbench/api/browser/mainThreadTerminalService.ts index 663c3fa5728..b184d49085b 100644 --- a/src/vs/workbench/api/browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/browser/mainThreadTerminalService.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore, Disposable, IDisposable, MutableDisposable, combinedDisposable } from 'vs/base/common/lifecycle'; -import { ExtHostContext, ExtHostTerminalServiceShape, MainThreadTerminalServiceShape, MainContext, TerminalLaunchConfig, ITerminalDimensionsDto, ExtHostTerminalIdentifier, TerminalQuickFix, ITerminalCommandDto } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { URI } from 'vs/base/common/uri'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProcessProperty, IProcessReadyWindowsPty, IShellLaunchConfig, IShellLaunchConfigDto, ITerminalOutputMatch, ITerminalOutputMatcher, ProcessPropertyType, TerminalExitReason, TerminalLocation } from 'vs/platform/terminal/common/terminal'; -import { TerminalDataBufferer } from 'vs/platform/terminal/common/terminalDataBuffering'; -import { ITerminalEditorService, ITerminalExternalLinkProvider, ITerminalGroupService, ITerminalInstance, ITerminalLink, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal'; -import { TerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy'; -import { IEnvironmentVariableService } from 'vs/workbench/contrib/terminal/common/environmentVariable'; -import { deserializeEnvironmentDescriptionMap, deserializeEnvironmentVariableCollection, serializeEnvironmentVariableCollection } from 'vs/platform/terminal/common/environmentVariableShared'; -import { IStartExtensionTerminalRequest, ITerminalProcessExtHostProxy, ITerminalProfileResolverService, ITerminalProfileService } from 'vs/workbench/contrib/terminal/common/terminal'; -import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; -import { OperatingSystem, OS } from 'vs/base/common/platform'; +import { DisposableStore, Disposable, IDisposable, MutableDisposable, combinedDisposable } from '../../../base/common/lifecycle.js'; +import { ExtHostContext, ExtHostTerminalServiceShape, MainThreadTerminalServiceShape, MainContext, TerminalLaunchConfig, ITerminalDimensionsDto, ExtHostTerminalIdentifier, TerminalQuickFix, ITerminalCommandDto } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { URI } from '../../../base/common/uri.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IProcessProperty, IProcessReadyWindowsPty, IShellLaunchConfig, IShellLaunchConfigDto, ITerminalOutputMatch, ITerminalOutputMatcher, ProcessPropertyType, TerminalExitReason, TerminalLocation } from '../../../platform/terminal/common/terminal.js'; +import { TerminalDataBufferer } from '../../../platform/terminal/common/terminalDataBuffering.js'; +import { ITerminalEditorService, ITerminalExternalLinkProvider, ITerminalGroupService, ITerminalInstance, ITerminalLink, ITerminalService } from '../../contrib/terminal/browser/terminal.js'; +import { TerminalProcessExtHostProxy } from '../../contrib/terminal/browser/terminalProcessExtHostProxy.js'; +import { IEnvironmentVariableService } from '../../contrib/terminal/common/environmentVariable.js'; +import { deserializeEnvironmentDescriptionMap, deserializeEnvironmentVariableCollection, serializeEnvironmentVariableCollection } from '../../../platform/terminal/common/environmentVariableShared.js'; +import { IStartExtensionTerminalRequest, ITerminalProcessExtHostProxy, ITerminalProfileResolverService, ITerminalProfileService } from '../../contrib/terminal/common/terminal.js'; +import { IRemoteAgentService } from '../../services/remote/common/remoteAgentService.js'; +import { OperatingSystem, OS } from '../../../base/common/platform.js'; import { TerminalEditorLocationOptions } from 'vscode'; -import { Promises } from 'vs/base/common/async'; -import { ISerializableEnvironmentDescriptionMap, ISerializableEnvironmentVariableCollection } from 'vs/platform/terminal/common/environmentVariable'; -import { ITerminalLinkProviderService } from 'vs/workbench/contrib/terminalContrib/links/browser/links'; -import { ITerminalQuickFixService, ITerminalQuickFix, TerminalQuickFixType } from 'vs/workbench/contrib/terminalContrib/quickFix/browser/quickFix'; -import { TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; +import { Promises } from '../../../base/common/async.js'; +import { ISerializableEnvironmentDescriptionMap, ISerializableEnvironmentVariableCollection } from '../../../platform/terminal/common/environmentVariable.js'; +import { ITerminalLinkProviderService } from '../../contrib/terminalContrib/links/browser/links.js'; +import { ITerminalQuickFixService, ITerminalQuickFix, TerminalQuickFixType } from '../../contrib/terminalContrib/quickFix/browser/quickFix.js'; +import { TerminalCapability } from '../../../platform/terminal/common/capabilities/capabilities.js'; @extHostNamedCustomer(MainContext.MainThreadTerminalService) export class MainThreadTerminalService implements MainThreadTerminalServiceShape { diff --git a/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.ts b/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.ts index 21092bb8bfe..de804627baf 100644 --- a/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.ts +++ b/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { Disposable, toDisposable, type IDisposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { TerminalCapability, type ITerminalCommand } from 'vs/platform/terminal/common/capabilities/capabilities'; -import { ExtHostContext, MainContext, type ExtHostTerminalShellIntegrationShape, type MainThreadTerminalShellIntegrationShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { extHostNamedCustomer, type IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { TerminalShellExecutionCommandLineConfidence } from 'vs/workbench/api/common/extHostTypes'; +import { Event } from '../../../base/common/event.js'; +import { Disposable, toDisposable, type IDisposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { TerminalCapability, type ITerminalCommand } from '../../../platform/terminal/common/capabilities/capabilities.js'; +import { ExtHostContext, MainContext, type ExtHostTerminalShellIntegrationShape, type MainThreadTerminalShellIntegrationShape } from '../common/extHost.protocol.js'; +import { ITerminalService } from '../../contrib/terminal/browser/terminal.js'; +import { IWorkbenchEnvironmentService } from '../../services/environment/common/environmentService.js'; +import { extHostNamedCustomer, type IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { TerminalShellExecutionCommandLineConfidence } from '../common/extHostTypes.js'; @extHostNamedCustomer(MainContext.MainThreadTerminalShellIntegration) export class MainThreadTerminalShellIntegration extends Disposable implements MainThreadTerminalShellIntegrationShape { @@ -60,7 +60,7 @@ export class MainThreadTerminalShellIntegration extends Disposable implements Ma // TerminalShellExecution.createDataStream // Debounce events to reduce the message count - when this listener is disposed the events will be flushed instanceDataListeners.get(instanceId)?.dispose(); - instanceDataListeners.set(instanceId, Event.accumulate(e.instance.onData, 50, this._store)(events => this._proxy.$shellExecutionData(instanceId, events.join()))); + instanceDataListeners.set(instanceId, Event.accumulate(e.instance.onData, 50, this._store)(events => this._proxy.$shellExecutionData(instanceId, events.join('')))); })); // onDidEndTerminalShellExecution diff --git a/src/vs/workbench/api/browser/mainThreadTesting.ts b/src/vs/workbench/api/browser/mainThreadTesting.ts index 1b2a115fca2..b2369b89fad 100644 --- a/src/vs/workbench/api/browser/mainThreadTesting.ts +++ b/src/vs/workbench/api/browser/mainThreadTesting.ts @@ -3,25 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, IDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ISettableObservable, transaction } from 'vs/base/common/observable'; -import { WellDefinedPrefixTree } from 'vs/base/common/prefixTree'; -import { URI } from 'vs/base/common/uri'; -import { Range } from 'vs/editor/common/core/range'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { MutableObservableValue } from 'vs/workbench/contrib/testing/common/observableValue'; -import { TestCoverage } from 'vs/workbench/contrib/testing/common/testCoverage'; -import { TestId } from 'vs/workbench/contrib/testing/common/testId'; -import { ITestProfileService } from 'vs/workbench/contrib/testing/common/testProfileService'; -import { LiveTestResult } from 'vs/workbench/contrib/testing/common/testResult'; -import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResultService'; -import { IMainThreadTestController, ITestService } from 'vs/workbench/contrib/testing/common/testService'; -import { CoverageDetails, ExtensionRunTestsRequest, IFileCoverage, ITestItem, ITestMessage, ITestRunProfile, ITestRunTask, ResolvedTestRunRequest, TestResultState, TestRunProfileBitset, TestsDiffOp } from 'vs/workbench/contrib/testing/common/testTypes'; -import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, ExtHostTestingShape, ILocationDto, ITestControllerPatch, MainContext, MainThreadTestingShape } from '../common/extHost.protocol'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { ISettableObservable, observableValue, transaction } from '../../../base/common/observable.js'; +import { WellDefinedPrefixTree } from '../../../base/common/prefixTree.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { Range } from '../../../editor/common/core/range.js'; +import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js'; +import { TestCoverage } from '../../contrib/testing/common/testCoverage.js'; +import { TestId } from '../../contrib/testing/common/testId.js'; +import { ITestProfileService } from '../../contrib/testing/common/testProfileService.js'; +import { LiveTestResult } from '../../contrib/testing/common/testResult.js'; +import { ITestResultService } from '../../contrib/testing/common/testResultService.js'; +import { IMainThreadTestController, ITestService } from '../../contrib/testing/common/testService.js'; +import { CoverageDetails, ExtensionRunTestsRequest, IFileCoverage, ITestItem, ITestMessage, ITestRunProfile, ITestRunTask, ResolvedTestRunRequest, TestControllerCapability, TestResultState, TestRunProfileBitset, TestsDiffOp } from '../../contrib/testing/common/testTypes.js'; +import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostTestingShape, ILocationDto, ITestControllerPatch, MainContext, MainThreadTestingShape } from '../common/extHost.protocol.js'; @extHostNamedCustomer(MainContext.MainThreadTesting) export class MainThreadTesting extends Disposable implements MainThreadTestingShape { @@ -29,8 +28,8 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh private readonly diffListener = this._register(new MutableDisposable()); private readonly testProviderRegistrations = new Map; - canRefresh: MutableObservableValue; + label: ISettableObservable; + capabilities: ISettableObservable; disposable: IDisposable; }>(); @@ -48,10 +47,11 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh provideTestFollowups: (req, token) => this.proxy.$provideTestFollowups(req, token), executeTestFollowup: id => this.proxy.$executeTestFollowup(id), disposeTestFollowups: ids => this.proxy.$disposeTestFollowups(ids), + getTestsRelatedToCode: (uri, position, token) => this.proxy.$getTestsRelatedToCode(uri, position, token), })); - this._register(this.testService.onDidCancelTestRun(({ runId }) => { - this.proxy.$cancelExtensionTestRun(runId); + this._register(this.testService.onDidCancelTestRun(({ runId, taskId }) => { + this.proxy.$cancelExtensionTestRun(runId, taskId); })); this._register(Event.debounce(testProfiles.onDidChange, (_last, e) => e)(() => { @@ -225,20 +225,26 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh /** * @inheritdoc */ - public $registerTestController(controllerId: string, labelStr: string, canRefreshValue: boolean) { + public $registerTestController(controllerId: string, _label: string, _capabilities: TestControllerCapability) { const disposable = new DisposableStore(); - const label = disposable.add(new MutableObservableValue(labelStr)); - const canRefresh = disposable.add(new MutableObservableValue(canRefreshValue)); + const label = observableValue(`${controllerId}.label`, _label); + const capabilities = observableValue(`${controllerId}.cap`, _capabilities); const controller: IMainThreadTestController = { id: controllerId, label, - canRefresh, + capabilities, syncTests: () => this.proxy.$syncTests(), refreshTests: token => this.proxy.$refreshTests(controllerId, token), configureRunProfile: id => this.proxy.$configureRunProfile(controllerId, id), runTests: (reqs, token) => this.proxy.$runControllerTests(reqs, token), startContinuousRun: (reqs, token) => this.proxy.$startContinuousRun(reqs, token), expandTest: (testId, levels) => this.proxy.$expandTest(testId, isFinite(levels) ? levels : -1), + getRelatedCode: (testId, token) => this.proxy.$getCodeRelatedToTest(testId, token).then(locations => + locations.map(l => ({ + uri: URI.revive(l.uri), + range: Range.lift(l.range) + })), + ), }; disposable.add(toDisposable(() => this.testProfiles.removeProfile(controllerId))); @@ -247,7 +253,7 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh this.testProviderRegistrations.set(controllerId, { instance: controller, label, - canRefresh, + capabilities, disposable }); } @@ -261,13 +267,16 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh return; } - if (patch.label !== undefined) { - controller.label.value = patch.label; - } + transaction(tx => { + if (patch.label !== undefined) { + controller.label.set(patch.label, tx); + } + + if (patch.capabilities !== undefined) { + controller.capabilities.set(patch.capabilities, tx); + } + }); - if (patch.canRefresh !== undefined) { - controller.canRefresh.value = patch.canRefresh; - } } /** @@ -301,11 +310,29 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh diff.map(d => TestsDiffOp.deserialize(this.uriIdentityService, d))); } + /** + * @inheritdoc + */ public async $runTests(req: ResolvedTestRunRequest, token: CancellationToken): Promise { const result = await this.testService.runResolvedTests(req, token); return result.id; } + /** + * @inheritdoc + */ + public async $getCoverageDetails(resultId: string, taskIndex: number, uri: UriComponents, token: CancellationToken): Promise { + const details = await this.resultService.getResult(resultId) + ?.tasks[taskIndex] + ?.coverage.get() + ?.getUri(URI.from(uri)) + ?.details(token); + + // Return empty if nothing. Some failure is always possible here because + // results might be cleared in the meantime. + return details || []; + } + public override dispose() { super.dispose(); for (const subscription of this.testProviderRegistrations.values()) { diff --git a/src/vs/workbench/api/browser/mainThreadTheming.ts b/src/vs/workbench/api/browser/mainThreadTheming.ts index 083da270ba3..9b5bd6eeeda 100644 --- a/src/vs/workbench/api/browser/mainThreadTheming.ts +++ b/src/vs/workbench/api/browser/mainThreadTheming.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MainContext, ExtHostThemingShape, ExtHostContext, MainThreadThemingShape } from '../common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { MainContext, ExtHostThemingShape, ExtHostContext, MainThreadThemingShape } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { IThemeService } from '../../../platform/theme/common/themeService.js'; @extHostNamedCustomer(MainContext.MainThreadTheming) export class MainThreadTheming implements MainThreadThemingShape { diff --git a/src/vs/workbench/api/browser/mainThreadTimeline.ts b/src/vs/workbench/api/browser/mainThreadTimeline.ts index 1cffecdef90..a7c61df1f39 100644 --- a/src/vs/workbench/api/browser/mainThreadTimeline.ts +++ b/src/vs/workbench/api/browser/mainThreadTimeline.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { URI } from 'vs/base/common/uri'; -import { ILogService } from 'vs/platform/log/common/log'; -import { MainContext, MainThreadTimelineShape, ExtHostTimelineShape, ExtHostContext } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { TimelineChangeEvent, TimelineOptions, TimelineProviderDescriptor, ITimelineService, Timeline } from 'vs/workbench/contrib/timeline/common/timeline'; -import { revive } from 'vs/base/common/marshalling'; +import { Emitter } from '../../../base/common/event.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { URI } from '../../../base/common/uri.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { MainContext, MainThreadTimelineShape, ExtHostTimelineShape, ExtHostContext } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { TimelineChangeEvent, TimelineOptions, TimelineProviderDescriptor, ITimelineService, Timeline } from '../../contrib/timeline/common/timeline.js'; +import { revive } from '../../../base/common/marshalling.js'; @extHostNamedCustomer(MainContext.MainThreadTimeline) export class MainThreadTimeline implements MainThreadTimelineShape { diff --git a/src/vs/workbench/api/browser/mainThreadTreeViews.ts b/src/vs/workbench/api/browser/mainThreadTreeViews.ts index eefa3c78a7f..2671f5b3880 100644 --- a/src/vs/workbench/api/browser/mainThreadTreeViews.ts +++ b/src/vs/workbench/api/browser/mainThreadTreeViews.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, DisposableMap, DisposableStore } from 'vs/base/common/lifecycle'; -import { ExtHostContext, MainThreadTreeViewsShape, ExtHostTreeViewsShape, MainContext, CheckboxUpdate } from 'vs/workbench/api/common/extHost.protocol'; -import { ITreeViewDataProvider, ITreeItem, ITreeView, IViewsRegistry, ITreeViewDescriptor, IRevealOptions, Extensions, ResolvableTreeItem, ITreeViewDragAndDropController, IViewBadge, NoTreeViewError } from 'vs/workbench/common/views'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { distinct } from 'vs/base/common/arrays'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { isUndefinedOrNull, isNumber } from 'vs/base/common/types'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { createStringDataTransferItem, VSDataTransfer } from 'vs/base/common/dataTransfer'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { DataTransferFileCache } from 'vs/workbench/api/common/shared/dataTransferCache'; -import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { IViewsService } from 'vs/workbench/services/views/common/viewsService'; +import { Disposable, DisposableMap, DisposableStore } from '../../../base/common/lifecycle.js'; +import { ExtHostContext, MainThreadTreeViewsShape, ExtHostTreeViewsShape, MainContext, CheckboxUpdate } from '../common/extHost.protocol.js'; +import { ITreeViewDataProvider, ITreeItem, ITreeView, IViewsRegistry, ITreeViewDescriptor, IRevealOptions, Extensions, ResolvableTreeItem, ITreeViewDragAndDropController, IViewBadge, NoTreeViewError } from '../../common/views.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { distinct } from '../../../base/common/arrays.js'; +import { INotificationService } from '../../../platform/notification/common/notification.js'; +import { isUndefinedOrNull, isNumber } from '../../../base/common/types.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { IExtensionService } from '../../services/extensions/common/extensions.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { createStringDataTransferItem, VSDataTransfer } from '../../../base/common/dataTransfer.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { DataTransferFileCache } from '../common/shared/dataTransferCache.js'; +import * as typeConvert from '../common/extHostTypeConverters.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { IViewsService } from '../../services/views/common/viewsService.js'; @extHostNamedCustomer(MainContext.MainThreadTreeViews) export class MainThreadTreeViews extends Disposable implements MainThreadTreeViewsShape { diff --git a/src/vs/workbench/api/browser/mainThreadTunnelService.ts b/src/vs/workbench/api/browser/mainThreadTunnelService.ts index 5b8cf2637fc..4aa5a7c1d48 100644 --- a/src/vs/workbench/api/browser/mainThreadTunnelService.ts +++ b/src/vs/workbench/api/browser/mainThreadTunnelService.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { MainThreadTunnelServiceShape, MainContext, ExtHostContext, ExtHostTunnelServiceShape, CandidatePortSource, PortAttributesSelector, TunnelDto } from 'vs/workbench/api/common/extHost.protocol'; -import { TunnelDtoConverter } from 'vs/workbench/api/common/extHostTunnelService'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { IRemoteExplorerService, PORT_AUTO_FORWARD_SETTING, PORT_AUTO_SOURCE_SETTING, PORT_AUTO_SOURCE_SETTING_HYBRID, PORT_AUTO_SOURCE_SETTING_OUTPUT } from 'vs/workbench/services/remote/common/remoteExplorerService'; -import { ITunnelProvider, ITunnelService, TunnelCreationOptions, TunnelProviderFeatures, TunnelOptions, RemoteTunnel, ProvidedPortAttributes, PortAttributesProvider, TunnelProtocol } from 'vs/platform/tunnel/common/tunnel'; -import { Disposable } from 'vs/base/common/lifecycle'; -import type { TunnelDescription } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { CandidatePort, TunnelCloseReason, TunnelSource, forwardedPortsViewEnabled, makeAddress } from 'vs/workbench/services/remote/common/tunnelModel'; +import * as nls from '../../../nls.js'; +import { MainThreadTunnelServiceShape, MainContext, ExtHostContext, ExtHostTunnelServiceShape, CandidatePortSource, PortAttributesSelector, TunnelDto } from '../common/extHost.protocol.js'; +import { TunnelDtoConverter } from '../common/extHostTunnelService.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IRemoteExplorerService, PORT_AUTO_FORWARD_SETTING, PORT_AUTO_SOURCE_SETTING, PORT_AUTO_SOURCE_SETTING_HYBRID, PORT_AUTO_SOURCE_SETTING_OUTPUT, PortsEnablement } from '../../services/remote/common/remoteExplorerService.js'; +import { ITunnelProvider, ITunnelService, TunnelCreationOptions, TunnelProviderFeatures, TunnelOptions, RemoteTunnel, ProvidedPortAttributes, PortAttributesProvider, TunnelProtocol } from '../../../platform/tunnel/common/tunnel.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import type { TunnelDescription } from '../../../platform/remote/common/remoteAuthorityResolver.js'; +import { INotificationService, Severity } from '../../../platform/notification/common/notification.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IRemoteAgentService } from '../../services/remote/common/remoteAgentService.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from '../../../platform/configuration/common/configurationRegistry.js'; +import { IContextKeyService } from '../../../platform/contextkey/common/contextkey.js'; +import { CandidatePort, TunnelCloseReason, TunnelSource, forwardedPortsFeaturesEnabled, makeAddress } from '../../services/remote/common/tunnelModel.js'; @extHostNamedCustomer(MainContext.MainThreadTunnelService) export class MainThreadTunnelService extends Disposable implements MainThreadTunnelServiceShape, PortAttributesProvider { @@ -50,18 +50,20 @@ export class MainThreadTunnelService extends Disposable implements MainThreadTun async $setRemoteTunnelService(processId: number): Promise { this.remoteExplorerService.namedProcesses.set(processId, 'Code Extension Host'); - if (this.remoteExplorerService.portsFeaturesEnabled) { + if (this.remoteExplorerService.portsFeaturesEnabled === PortsEnablement.AdditionalFeatures) { this._proxy.$registerCandidateFinder(this.processFindingEnabled()); } else { this._register(this.remoteExplorerService.onEnabledPortsFeatures(() => this._proxy.$registerCandidateFinder(this.processFindingEnabled()))); } this._register(this.configurationService.onDidChangeConfiguration(async (e) => { - if (e.affectsConfiguration(PORT_AUTO_FORWARD_SETTING) || e.affectsConfiguration(PORT_AUTO_SOURCE_SETTING)) { + if ((this.remoteExplorerService.portsFeaturesEnabled === PortsEnablement.AdditionalFeatures) && (e.affectsConfiguration(PORT_AUTO_FORWARD_SETTING) || e.affectsConfiguration(PORT_AUTO_SOURCE_SETTING))) { return this._proxy.$registerCandidateFinder(this.processFindingEnabled()); } })); - this._register(this.tunnelService.onAddedTunnelProvider(() => { - return this._proxy.$registerCandidateFinder(this.processFindingEnabled()); + this._register(this.tunnelService.onAddedTunnelProvider(async () => { + if (this.remoteExplorerService.portsFeaturesEnabled === PortsEnablement.AdditionalFeatures) { + return this._proxy.$registerCandidateFinder(this.processFindingEnabled()); + } })); } @@ -166,7 +168,7 @@ export class MainThreadTunnelService extends Disposable implements MainThreadTun this.remoteExplorerService.onFoundNewCandidates(candidates); } - async $setTunnelProvider(features?: TunnelProviderFeatures): Promise { + async $setTunnelProvider(features: TunnelProviderFeatures | undefined, isResolver: boolean): Promise { const tunnelProvider: ITunnelProvider = { forwardPort: (tunnelOptions: TunnelOptions, tunnelCreationOptions: TunnelCreationOptions) => { const forward = this._proxy.$forwardPort(tunnelOptions, tunnelCreationOptions); @@ -200,7 +202,9 @@ export class MainThreadTunnelService extends Disposable implements MainThreadTun } this.tunnelService.setTunnelProvider(tunnelProvider); // At this point we clearly want the ports view/features since we have a tunnel factory - this.contextKeyService.createKey(forwardedPortsViewEnabled.key, true); + if (isResolver) { + this.contextKeyService.createKey(forwardedPortsFeaturesEnabled.key, true); + } } async $setCandidateFilter(): Promise { diff --git a/src/vs/workbench/api/browser/mainThreadUriOpeners.ts b/src/vs/workbench/api/browser/mainThreadUriOpeners.ts index d44d17d5e32..39fc994eb63 100644 --- a/src/vs/workbench/api/browser/mainThreadUriOpeners.ts +++ b/src/vs/workbench/api/browser/mainThreadUriOpeners.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Action } from 'vs/base/common/actions'; -import { isCancellationError } from 'vs/base/common/errors'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ExtHostContext, ExtHostUriOpenersShape, MainContext, MainThreadUriOpenersShape } from 'vs/workbench/api/common/extHost.protocol'; -import { defaultExternalUriOpenerId } from 'vs/workbench/contrib/externalUriOpener/common/configuration'; -import { ContributedExternalUriOpenersStore } from 'vs/workbench/contrib/externalUriOpener/common/contributedOpeners'; -import { IExternalOpenerProvider, IExternalUriOpener, IExternalUriOpenerService } from 'vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers'; +import { Action } from '../../../base/common/actions.js'; +import { isCancellationError } from '../../../base/common/errors.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { INotificationService, Severity } from '../../../platform/notification/common/notification.js'; +import { IOpenerService } from '../../../platform/opener/common/opener.js'; +import { IStorageService } from '../../../platform/storage/common/storage.js'; +import { ExtHostContext, ExtHostUriOpenersShape, MainContext, MainThreadUriOpenersShape } from '../common/extHost.protocol.js'; +import { defaultExternalUriOpenerId } from '../../contrib/externalUriOpener/common/configuration.js'; +import { ContributedExternalUriOpenersStore } from '../../contrib/externalUriOpener/common/contributedOpeners.js'; +import { IExternalOpenerProvider, IExternalUriOpener, IExternalUriOpenerService } from '../../contrib/externalUriOpener/common/externalUriOpenerService.js'; +import { IExtensionService } from '../../services/extensions/common/extensions.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; interface RegisteredOpenerMetadata { readonly schemes: ReadonlySet; diff --git a/src/vs/workbench/api/browser/mainThreadUrls.ts b/src/vs/workbench/api/browser/mainThreadUrls.ts index 27ea552497c..bb0fa287aeb 100644 --- a/src/vs/workbench/api/browser/mainThreadUrls.ts +++ b/src/vs/workbench/api/browser/mainThreadUrls.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ExtHostContext, MainContext, MainThreadUrlsShape, ExtHostUrlsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers'; -import { IURLService, IOpenURLOptions } from 'vs/platform/url/common/url'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IExtensionContributedURLHandler, IExtensionUrlHandler } from 'vs/workbench/services/extensions/browser/extensionUrlHandler'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; +import { ExtHostContext, MainContext, MainThreadUrlsShape, ExtHostUrlsShape } from '../common/extHost.protocol.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { IURLService, IOpenURLOptions } from '../../../platform/url/common/url.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { IExtensionContributedURLHandler, IExtensionUrlHandler } from '../../services/extensions/browser/extensionUrlHandler.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; class ExtensionUrlHandler implements IExtensionContributedURLHandler { diff --git a/src/vs/workbench/api/browser/mainThreadWebviewManager.ts b/src/vs/workbench/api/browser/mainThreadWebviewManager.ts index eed33b05ed9..406b222a739 100644 --- a/src/vs/workbench/api/browser/mainThreadWebviewManager.ts +++ b/src/vs/workbench/api/browser/mainThreadWebviewManager.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { MainThreadCustomEditors } from 'vs/workbench/api/browser/mainThreadCustomEditors'; -import { MainThreadWebviewPanels } from 'vs/workbench/api/browser/mainThreadWebviewPanels'; -import { MainThreadWebviews } from 'vs/workbench/api/browser/mainThreadWebviews'; -import { MainThreadWebviewsViews } from 'vs/workbench/api/browser/mainThreadWebviewViews'; -import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol'; -import { extHostCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { MainThreadCustomEditors } from './mainThreadCustomEditors.js'; +import { MainThreadWebviewPanels } from './mainThreadWebviewPanels.js'; +import { MainThreadWebviews } from './mainThreadWebviews.js'; +import { MainThreadWebviewsViews } from './mainThreadWebviewViews.js'; +import * as extHostProtocol from '../common/extHost.protocol.js'; +import { extHostCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; @extHostCustomer export class MainThreadWebviewManager extends Disposable { diff --git a/src/vs/workbench/api/browser/mainThreadWebviewPanels.ts b/src/vs/workbench/api/browser/mainThreadWebviewPanels.ts index 996a8a2e657..3a7ddf961e8 100644 --- a/src/vs/workbench/api/browser/mainThreadWebviewPanels.ts +++ b/src/vs/workbench/api/browser/mainThreadWebviewPanels.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Event } from 'vs/base/common/event'; -import { Disposable, DisposableMap } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { MainThreadWebviews, reviveWebviewContentOptions, reviveWebviewExtension } from 'vs/workbench/api/browser/mainThreadWebviews'; -import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol'; -import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { ExtensionKeyedWebviewOriginStore, WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview'; -import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput'; -import { WebviewIcons } from 'vs/workbench/contrib/webviewPanel/browser/webviewIconManager'; -import { IWebViewShowOptions, IWebviewWorkbenchService } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService'; -import { editorGroupToColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { GroupLocation, GroupsOrder, IEditorGroup, IEditorGroupsService, preferredSideBySideGroupDirection } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { ACTIVE_GROUP, IEditorService, PreferredGroup, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import { Event } from '../../../base/common/event.js'; +import { Disposable, DisposableMap } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { IStorageService } from '../../../platform/storage/common/storage.js'; +import { ITelemetryService } from '../../../platform/telemetry/common/telemetry.js'; +import { MainThreadWebviews, reviveWebviewContentOptions, reviveWebviewExtension } from './mainThreadWebviews.js'; +import * as extHostProtocol from '../common/extHost.protocol.js'; +import { DiffEditorInput } from '../../common/editor/diffEditorInput.js'; +import { EditorInput } from '../../common/editor/editorInput.js'; +import { ExtensionKeyedWebviewOriginStore, WebviewOptions } from '../../contrib/webview/browser/webview.js'; +import { WebviewInput } from '../../contrib/webviewPanel/browser/webviewEditorInput.js'; +import { WebviewIcons } from '../../contrib/webviewPanel/browser/webviewIconManager.js'; +import { IWebViewShowOptions, IWebviewWorkbenchService } from '../../contrib/webviewPanel/browser/webviewWorkbenchService.js'; +import { editorGroupToColumn } from '../../services/editor/common/editorGroupColumn.js'; +import { GroupLocation, GroupsOrder, IEditorGroup, IEditorGroupsService, preferredSideBySideGroupDirection } from '../../services/editor/common/editorGroupsService.js'; +import { ACTIVE_GROUP, IEditorService, PreferredGroup, SIDE_GROUP } from '../../services/editor/common/editorService.js'; +import { IExtensionService } from '../../services/extensions/common/extensions.js'; +import { IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; /** * Bi-directional map between webview handles and inputs. diff --git a/src/vs/workbench/api/browser/mainThreadWebviewViews.ts b/src/vs/workbench/api/browser/mainThreadWebviewViews.ts index e6854c860cf..2ce367773d7 100644 --- a/src/vs/workbench/api/browser/mainThreadWebviewViews.ts +++ b/src/vs/workbench/api/browser/mainThreadWebviewViews.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposable, DisposableMap } from 'vs/base/common/lifecycle'; -import { generateUuid } from 'vs/base/common/uuid'; -import { MainThreadWebviews, reviveWebviewExtension } from 'vs/workbench/api/browser/mainThreadWebviews'; -import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol'; -import { IViewBadge } from 'vs/workbench/common/views'; -import { IWebviewViewService, WebviewView } from 'vs/workbench/contrib/webviewView/browser/webviewViewService'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import { Disposable, DisposableMap } from '../../../base/common/lifecycle.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { MainThreadWebviews, reviveWebviewExtension } from './mainThreadWebviews.js'; +import * as extHostProtocol from '../common/extHost.protocol.js'; +import { IViewBadge } from '../../common/views.js'; +import { IWebviewViewService, WebviewView } from '../../contrib/webviewView/browser/webviewViewService.js'; +import { ITelemetryService } from '../../../platform/telemetry/common/telemetry.js'; +import { IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; export class MainThreadWebviewsViews extends Disposable implements extHostProtocol.MainThreadWebviewViewsShape { diff --git a/src/vs/workbench/api/browser/mainThreadWebviews.ts b/src/vs/workbench/api/browser/mainThreadWebviews.ts index f537e94d64b..ed37c0b468a 100644 --- a/src/vs/workbench/api/browser/mainThreadWebviews.ts +++ b/src/vs/workbench/api/browser/mainThreadWebviews.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { isWeb } from 'vs/base/common/platform'; -import { escape } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { IProductService } from 'vs/platform/product/common/productService'; -import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol'; -import { deserializeWebviewMessage, serializeWebviewMessage } from 'vs/workbench/api/common/extHostWebviewMessaging'; -import { IOverlayWebview, IWebview, WebviewContentOptions, WebviewExtensionDescription } from 'vs/workbench/contrib/webview/browser/webview'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { isWeb } from '../../../base/common/platform.js'; +import { escape } from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { IOpenerService } from '../../../platform/opener/common/opener.js'; +import { IProductService } from '../../../platform/product/common/productService.js'; +import * as extHostProtocol from '../common/extHost.protocol.js'; +import { deserializeWebviewMessage, serializeWebviewMessage } from '../common/extHostWebviewMessaging.js'; +import { IOverlayWebview, IWebview, WebviewContentOptions, WebviewExtensionDescription } from '../../contrib/webview/browser/webview.js'; +import { IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; export class MainThreadWebviews extends Disposable implements extHostProtocol.MainThreadWebviewsShape { diff --git a/src/vs/workbench/api/browser/mainThreadWindow.ts b/src/vs/workbench/api/browser/mainThreadWindow.ts index f77f0b257a6..29760af2182 100644 --- a/src/vs/workbench/api/browser/mainThreadWindow.ts +++ b/src/vs/workbench/api/browser/mainThreadWindow.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtHostContext, ExtHostWindowShape, IOpenUriOptions, MainContext, MainThreadWindowShape } from '../common/extHost.protocol'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { IUserActivityService } from 'vs/workbench/services/userActivity/common/userActivityService'; +import { Event } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IOpenerService } from '../../../platform/opener/common/opener.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { ExtHostContext, ExtHostWindowShape, IOpenUriOptions, MainContext, MainThreadWindowShape } from '../common/extHost.protocol.js'; +import { IHostService } from '../../services/host/browser/host.js'; +import { IUserActivityService } from '../../services/userActivity/common/userActivityService.js'; @extHostNamedCustomer(MainContext.MainThreadWindow) export class MainThreadWindow implements MainThreadWindowShape { diff --git a/src/vs/workbench/api/browser/mainThreadWorkspace.ts b/src/vs/workbench/api/browser/mainThreadWorkspace.ts index 180932b6d6d..1f2e2807b7a 100644 --- a/src/vs/workbench/api/browser/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/browser/mainThreadWorkspace.ts @@ -3,31 +3,32 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { isCancellationError } from 'vs/base/common/errors'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { isNative } from 'vs/base/common/platform'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { WorkspaceTrustRequestOptions, IWorkspaceTrustManagementService, IWorkspaceTrustRequestService } from 'vs/platform/workspace/common/workspaceTrust'; -import { IWorkspace, IWorkspaceContextService, WorkbenchState, isUntitledWorkspace, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { checkGlobFileExists } from 'vs/workbench/services/extensions/common/workspaceContains'; -import { IFileQueryBuilderOptions, ITextQueryBuilderOptions, QueryBuilder } from 'vs/workbench/services/search/common/queryBuilder'; -import { IEditorService, ISaveEditorsResult } from 'vs/workbench/services/editor/common/editorService'; -import { IFileMatch, IPatternInfo, ISearchProgressItem, ISearchService } from 'vs/workbench/services/search/common/search'; -import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing'; -import { ExtHostContext, ExtHostWorkspaceShape, ITextSearchComplete, IWorkspaceData, MainContext, MainThreadWorkspaceShape } from '../common/extHost.protocol'; -import { IEditSessionIdentityService } from 'vs/platform/workspace/common/editSessions'; -import { EditorResourceAccessor, SaveReason, SideBySideEditor } from 'vs/workbench/common/editor'; -import { coalesce, firstOrDefault } from 'vs/base/common/arrays'; -import { ICanonicalUriService } from 'vs/platform/workspace/common/canonicalUri'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { isCancellationError } from '../../../base/common/errors.js'; +import { DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { isNative } from '../../../base/common/platform.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; +import { IFileService } from '../../../platform/files/common/files.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { ILabelService } from '../../../platform/label/common/label.js'; +import { INotificationService } from '../../../platform/notification/common/notification.js'; +import { AuthInfo, Credentials, IRequestService } from '../../../platform/request/common/request.js'; +import { WorkspaceTrustRequestOptions, IWorkspaceTrustManagementService, IWorkspaceTrustRequestService } from '../../../platform/workspace/common/workspaceTrust.js'; +import { IWorkspace, IWorkspaceContextService, WorkbenchState, isUntitledWorkspace, WorkspaceFolder } from '../../../platform/workspace/common/workspace.js'; +import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js'; +import { checkGlobFileExists } from '../../services/extensions/common/workspaceContains.js'; +import { IFileQueryBuilderOptions, ITextQueryBuilderOptions, QueryBuilder } from '../../services/search/common/queryBuilder.js'; +import { IEditorService, ISaveEditorsResult } from '../../services/editor/common/editorService.js'; +import { IFileMatch, IPatternInfo, ISearchProgressItem, ISearchService } from '../../services/search/common/search.js'; +import { IWorkspaceEditingService } from '../../services/workspaces/common/workspaceEditing.js'; +import { ExtHostContext, ExtHostWorkspaceShape, ITextSearchComplete, IWorkspaceData, MainContext, MainThreadWorkspaceShape } from '../common/extHost.protocol.js'; +import { IEditSessionIdentityService } from '../../../platform/workspace/common/editSessions.js'; +import { EditorResourceAccessor, SaveReason, SideBySideEditor } from '../../common/editor.js'; +import { coalesce } from '../../../base/common/arrays.js'; +import { ICanonicalUriService } from '../../../platform/workspace/common/canonicalUri.js'; +import { revive } from '../../../base/common/marshalling.js'; @extHostNamedCustomer(MainContext.MainThreadWorkspace) export class MainThreadWorkspace implements MainThreadWorkspaceShape { @@ -140,13 +141,13 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { // --- search --- - $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { const includeFolder = URI.revive(_includeFolder); const workspace = this._contextService.getWorkspace(); const query = this._queryBuilder.file( includeFolder ? [includeFolder] : workspace.folders, - options + revive(options) ); return this._searchService.fileSearch(query, token).then(result => { @@ -159,12 +160,12 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { }); } - $startTextSearch(pattern: IPatternInfo, _folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { + $startTextSearch(pattern: IPatternInfo, _folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { const folder = URI.revive(_folder); const workspace = this._contextService.getWorkspace(); const folders = folder ? [folder] : workspace.folders.map(folder => folder.uri); - const query = this._queryBuilder.text(pattern, folders, options); + const query = this._queryBuilder.text(pattern, folders, revive(options)); query._reason = 'startTextSearch'; const onProgress = (p: ISearchProgressItem) => { @@ -204,7 +205,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { force: !options.saveAs }); - return firstOrDefault(this._saveResultToUris(result)); + return this._saveResultToUris(result).at(0); } private _saveResultToUris(result: ISaveEditorsResult): URI[] { @@ -223,6 +224,14 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { return this._requestService.resolveProxy(url); } + $lookupAuthorization(authInfo: AuthInfo): Promise { + return this._requestService.lookupAuthorization(authInfo); + } + + $lookupKerberosAuthorization(url: string): Promise { + return this._requestService.lookupKerberosAuthorization(url); + } + $loadCertificates(): Promise { return this._requestService.loadCertificates(); } diff --git a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts b/src/vs/workbench/api/browser/statusBarExtensionPoint.ts index 99dd3279fe8..bae2812c5f3 100644 --- a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts +++ b/src/vs/workbench/api/browser/statusBarExtensionPoint.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -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 { 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 { asStatusBarItemIdentifier } from 'vs/workbench/api/common/extHostTypes'; -import { STATUS_BAR_ERROR_ITEM_BACKGROUND, STATUS_BAR_WARNING_ITEM_BACKGROUND } from 'vs/workbench/common/theme'; +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 { 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'; // --- service diff --git a/src/vs/workbench/api/browser/viewsExtensionPoint.ts b/src/vs/workbench/api/browser/viewsExtensionPoint.ts index b28bd289ca6..f5a0648d5d1 100644 --- a/src/vs/workbench/api/browser/viewsExtensionPoint.ts +++ b/src/vs/workbench/api/browser/viewsExtensionPoint.ts @@ -3,33 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import * as resources from 'vs/base/common/resources'; -import { isFalsyOrWhitespace } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { ExtensionIdentifier, ExtensionIdentifierSet, IExtensionDescription, IExtensionManifest } from 'vs/platform/extensions/common/extensions'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { Extensions as ViewletExtensions, PaneCompositeRegistry } from 'vs/workbench/browser/panecomposite'; -import { CustomTreeView, TreeViewPane } from 'vs/workbench/browser/parts/views/treeView'; -import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; -import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; -import { Extensions as ViewContainerExtensions, ICustomViewDescriptor, IViewContainersRegistry, IViewDescriptor, IViewsRegistry, ViewContainer, ViewContainerLocation } from 'vs/workbench/common/views'; -import { VIEWLET_ID as DEBUG } from 'vs/workbench/contrib/debug/common/debug'; -import { VIEWLET_ID as EXPLORER } from 'vs/workbench/contrib/files/common/files'; -import { VIEWLET_ID as REMOTE } from 'vs/workbench/contrib/remote/browser/remoteExplorer'; -import { VIEWLET_ID as SCM } from 'vs/workbench/contrib/scm/common/scm'; -import { WebviewViewPane } from 'vs/workbench/contrib/webviewView/browser/webviewViewPane'; -import { isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import { ExtensionMessageCollector, ExtensionsRegistry, IExtensionPoint, IExtensionPointUser } from 'vs/workbench/services/extensions/common/extensionsRegistry'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IExtensionFeatureTableRenderer, IRenderedData, ITableData, IRowData, IExtensionFeaturesRegistry, Extensions as ExtensionFeaturesRegistryExtensions } from 'vs/workbench/services/extensionManagement/common/extensionFeatures'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { MarkdownString } from 'vs/base/common/htmlContent'; +import { IJSONSchema } from '../../../base/common/jsonSchema.js'; +import * as resources from '../../../base/common/resources.js'; +import { isFalsyOrWhitespace } from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { ContextKeyExpr } from '../../../platform/contextkey/common/contextkey.js'; +import { ExtensionIdentifier, ExtensionIdentifierSet, IExtensionDescription, IExtensionManifest } from '../../../platform/extensions/common/extensions.js'; +import { SyncDescriptor } from '../../../platform/instantiation/common/descriptors.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { Extensions as ViewletExtensions, PaneCompositeRegistry } from '../../browser/panecomposite.js'; +import { CustomTreeView, TreeViewPane } from '../../browser/parts/views/treeView.js'; +import { ViewPaneContainer } from '../../browser/parts/views/viewPaneContainer.js'; +import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from '../../common/contributions.js'; +import { Extensions as ViewContainerExtensions, ICustomViewDescriptor, IViewContainersRegistry, IViewDescriptor, IViewsRegistry, ViewContainer, ViewContainerLocation } from '../../common/views.js'; +import { VIEWLET_ID as DEBUG } from '../../contrib/debug/common/debug.js'; +import { VIEWLET_ID as EXPLORER } from '../../contrib/files/common/files.js'; +import { VIEWLET_ID as REMOTE } from '../../contrib/remote/browser/remoteExplorer.js'; +import { VIEWLET_ID as SCM } from '../../contrib/scm/common/scm.js'; +import { WebviewViewPane } from '../../contrib/webviewView/browser/webviewViewPane.js'; +import { isProposedApiEnabled } from '../../services/extensions/common/extensions.js'; +import { ExtensionMessageCollector, ExtensionsRegistry, IExtensionPoint, IExtensionPointUser } from '../../services/extensions/common/extensionsRegistry.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IExtensionFeatureTableRenderer, IRenderedData, ITableData, IRowData, IExtensionFeaturesRegistry, Extensions as ExtensionFeaturesRegistryExtensions } from '../../services/extensionManagement/common/extensionFeatures.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { MarkdownString } from '../../../base/common/htmlContent.js'; export interface IUserFriendlyViewsContainerDescriptor { id: string; diff --git a/src/vs/workbench/api/common/configurationExtensionPoint.ts b/src/vs/workbench/api/common/configurationExtensionPoint.ts index 496651fe769..e45e567775c 100644 --- a/src/vs/workbench/api/common/configurationExtensionPoint.ts +++ b/src/vs/workbench/api/common/configurationExtensionPoint.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import * as objects from 'vs/base/common/objects'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { ExtensionsRegistry, IExtensionPointUser } from 'vs/workbench/services/extensions/common/extensionsRegistry'; -import { IConfigurationNode, IConfigurationRegistry, Extensions, validateProperty, ConfigurationScope, OVERRIDE_PROPERTY_REGEX, IConfigurationDefaults, configurationDefaultsSchemaId, IConfigurationDelta, getDefaultValue } from 'vs/platform/configuration/common/configurationRegistry'; -import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import { workspaceSettingsSchemaId, launchSchemaId, tasksSchemaId } from 'vs/workbench/services/configuration/common/configuration'; -import { isObject, isUndefined } from 'vs/base/common/types'; -import { ExtensionIdentifierMap, IExtensionManifest } from 'vs/platform/extensions/common/extensions'; -import { IStringDictionary } from 'vs/base/common/collections'; -import { Extensions as ExtensionFeaturesExtensions, IExtensionFeatureTableRenderer, IExtensionFeaturesRegistry, IRenderedData, IRowData, ITableData } from 'vs/workbench/services/extensionManagement/common/extensionFeatures'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { MarkdownString } from 'vs/base/common/htmlContent'; +import * as nls from '../../../nls.js'; +import * as objects from '../../../base/common/objects.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { IJSONSchema } from '../../../base/common/jsonSchema.js'; +import { ExtensionsRegistry, IExtensionPointUser } from '../../services/extensions/common/extensionsRegistry.js'; +import { IConfigurationNode, IConfigurationRegistry, Extensions, validateProperty, ConfigurationScope, OVERRIDE_PROPERTY_REGEX, IConfigurationDefaults, configurationDefaultsSchemaId, IConfigurationDelta, getDefaultValue, getAllConfigurationProperties, parseScope } from '../../../platform/configuration/common/configurationRegistry.js'; +import { IJSONContributionRegistry, Extensions as JSONExtensions } from '../../../platform/jsonschemas/common/jsonContributionRegistry.js'; +import { workspaceSettingsSchemaId, launchSchemaId, tasksSchemaId } from '../../services/configuration/common/configuration.js'; +import { isObject, isUndefined } from '../../../base/common/types.js'; +import { ExtensionIdentifierMap, IExtensionManifest } from '../../../platform/extensions/common/extensions.js'; +import { IStringDictionary } from '../../../base/common/collections.js'; +import { Extensions as ExtensionFeaturesExtensions, IExtensionFeatureTableRenderer, IExtensionFeaturesRegistry, IRenderedData, IRowData, ITableData } from '../../services/extensionManagement/common/extensionFeatures.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { SyncDescriptor } from '../../../platform/instantiation/common/descriptors.js'; +import { MarkdownString } from '../../../base/common/htmlContent.js'; const jsonRegistry = Registry.as(JSONExtensions.JSONContribution); const configurationRegistry = Registry.as(Extensions.Configuration); @@ -160,11 +160,17 @@ defaultConfigurationExtPoint.setHandler((extensions, { added, removed }) => { const addedDefaultConfigurations = added.map(extension => { const overrides: IStringDictionary = objects.deepClone(extension.value); for (const key of Object.keys(overrides)) { + const registeredPropertyScheme = registeredProperties[key]; + if (registeredPropertyScheme?.disallowConfigurationDefault) { + extension.collector.warn(nls.localize('config.property.preventDefaultConfiguration.warning', "Cannot register configuration defaults for '{0}'. This setting does not allow contributing configuration defaults.", key)); + delete overrides[key]; + continue; + } if (!OVERRIDE_PROPERTY_REGEX.test(key)) { - const registeredPropertyScheme = registeredProperties[key]; if (registeredPropertyScheme?.scope && !allowedScopes.includes(registeredPropertyScheme.scope)) { extension.collector.warn(nls.localize('config.property.defaultConfiguration.warning', "Cannot register configuration defaults for '{0}'. Only defaults for machine-overridable, window, resource and language overridable scoped settings are supported.", key)); delete overrides[key]; + continue; } } } @@ -210,8 +216,7 @@ configurationExtPoint.setHandler((extensions, { added, removed }) => { const seenProperties = new Set(); - function handleConfiguration(node: IConfigurationNode, extension: IExtensionPointUser): IConfigurationNode[] { - const configurations: IConfigurationNode[] = []; + function handleConfiguration(node: IConfigurationNode, extension: IExtensionPointUser): IConfigurationNode { const configuration = objects.deepClone(node); if (configuration.title && (typeof configuration.title !== 'string')) { @@ -224,8 +229,7 @@ configurationExtPoint.setHandler((extensions, { added, removed }) => { configuration.extensionInfo = { id: extension.description.identifier.value, displayName: extension.description.displayName }; configuration.restrictedProperties = extension.description.capabilities?.untrustedWorkspaces?.supported === 'limited' ? extension.description.capabilities?.untrustedWorkspaces.restrictedConfigurations : undefined; configuration.title = configuration.title || extension.description.displayName || extension.description.identifier.value; - configurations.push(configuration); - return configurations; + return configuration; } function validateProperties(configuration: IConfigurationNode, extension: IExtensionPointUser): void { @@ -254,23 +258,7 @@ configurationExtPoint.setHandler((extensions, { added, removed }) => { continue; } seenProperties.add(key); - if (propertyConfiguration.scope) { - if (propertyConfiguration.scope.toString() === 'application') { - propertyConfiguration.scope = ConfigurationScope.APPLICATION; - } else if (propertyConfiguration.scope.toString() === 'machine') { - propertyConfiguration.scope = ConfigurationScope.MACHINE; - } else if (propertyConfiguration.scope.toString() === 'resource') { - propertyConfiguration.scope = ConfigurationScope.RESOURCE; - } else if (propertyConfiguration.scope.toString() === 'machine-overridable') { - propertyConfiguration.scope = ConfigurationScope.MACHINE_OVERRIDABLE; - } else if (propertyConfiguration.scope.toString() === 'language-overridable') { - propertyConfiguration.scope = ConfigurationScope.LANGUAGE_OVERRIDABLE; - } else { - propertyConfiguration.scope = ConfigurationScope.WINDOW; - } - } else { - propertyConfiguration.scope = ConfigurationScope.WINDOW; - } + propertyConfiguration.scope = propertyConfiguration.scope ? parseScope(propertyConfiguration.scope.toString()) : ConfigurationScope.WINDOW; } } const subNodes = configuration.allOf; @@ -288,9 +276,9 @@ configurationExtPoint.setHandler((extensions, { added, removed }) => { const configurations: IConfigurationNode[] = []; const value = extension.value; if (Array.isArray(value)) { - value.forEach(v => configurations.push(...handleConfiguration(v, extension))); + value.forEach(v => configurations.push(handleConfiguration(v, extension))); } else { - configurations.push(...handleConfiguration(value, extension)); + configurations.push(handleConfiguration(value, extension)); } extensionConfigurations.set(extension.description.identifier, configurations); addedConfigurations.push(...configurations); @@ -400,15 +388,11 @@ class SettingsTableRenderer extends Disposable implements IExtensionFeatureTable } render(manifest: IExtensionManifest): IRenderedData { - const configuration = manifest.contributes?.configuration; - let properties: any = {}; - if (Array.isArray(configuration)) { - configuration.forEach(config => { - properties = { ...properties, ...config.properties }; - }); - } else if (configuration) { - properties = configuration.properties; - } + const configuration: IConfigurationNode[] = manifest.contributes?.configuration + ? Array.isArray(manifest.contributes.configuration) ? manifest.contributes.configuration : [manifest.contributes.configuration] + : []; + + const properties = getAllConfigurationProperties(configuration); const contrib = properties ? Object.keys(properties) : []; const headers = [nls.localize('setting name', "ID"), nls.localize('description', "Description"), nls.localize('default', "Default")]; diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 77b990c6fb5..78c74fe9bf1 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -3,117 +3,116 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import * as errors from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { combinedDisposable } from 'vs/base/common/lifecycle'; -import { Schemas, matchesScheme } from 'vs/base/common/network'; -import Severity from 'vs/base/common/severity'; -import { URI } from 'vs/base/common/uri'; -import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions'; -import { score, targetsNotebooks } from 'vs/editor/common/languageSelector'; -import * as languageConfiguration from 'vs/editor/common/languages/languageConfiguration'; -import { OverviewRulerLane } from 'vs/editor/common/model'; -import { ExtensionIdentifierSet, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import * as files from 'vs/platform/files/common/files'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService, ILoggerService, LogLevel } from 'vs/platform/log/common/log'; -import { getRemoteName } from 'vs/platform/remote/common/remoteHosts'; -import { TelemetryTrustedValue } from 'vs/platform/telemetry/common/telemetryUtils'; -import { EditSessionIdentityMatch } from 'vs/platform/workspace/common/editSessions'; -import { CandidatePortSource, ExtHostContext, ExtHostLogLevelServiceShape, MainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostRelatedInformation } from 'vs/workbench/api/common/extHostAiRelatedInformation'; -import { ExtHostAideChatAgents2 } from 'vs/workbench/api/common/extHostAideChatAgents2'; -import { ExtHostAideChatVariables } from 'vs/workbench/api/common/extHostAideChatVariables'; -import { ExtHostAideProbeProvider } from 'vs/workbench/api/common/extHostAideProbeProvider'; -import { ExtHostApiCommands } from 'vs/workbench/api/common/extHostApiCommands'; -import { IExtHostApiDeprecationService } from 'vs/workbench/api/common/extHostApiDeprecationService'; -import { IExtHostAuthentication } from 'vs/workbench/api/common/extHostAuthentication'; -import { ExtHostBulkEdits } from 'vs/workbench/api/common/extHostBulkEdits'; -import { IExtHostCSAuthentication } from 'vs/workbench/api/common/extHostCSAuthentication'; -import { ExtHostCSEvents } from 'vs/workbench/api/common/extHostCSEvents'; -import { ExtHostChatAgents2 } from 'vs/workbench/api/common/extHostChatAgents2'; -import { ExtHostChatVariables } from 'vs/workbench/api/common/extHostChatVariables'; -import { ExtHostClipboard } from 'vs/workbench/api/common/extHostClipboard'; -import { ExtHostEditorInsets } from 'vs/workbench/api/common/extHostCodeInsets'; -import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { createExtHostComments } from 'vs/workbench/api/common/extHostComments'; -import { ExtHostConfigProvider, IExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration'; -import { ExtHostCustomEditors } from 'vs/workbench/api/common/extHostCustomEditors'; -import { IExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService'; -import { IExtHostDecorations } from 'vs/workbench/api/common/extHostDecorations'; -import { ExtHostDiagnostics } from 'vs/workbench/api/common/extHostDiagnostics'; -import { ExtHostDialogs } from 'vs/workbench/api/common/extHostDialogs'; -import { ExtHostDocumentContentProvider } from 'vs/workbench/api/common/extHostDocumentContentProviders'; -import { ExtHostDocumentSaveParticipant } from 'vs/workbench/api/common/extHostDocumentSaveParticipant'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { IExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { IExtHostEditorTabs } from 'vs/workbench/api/common/extHostEditorTabs'; -import { ExtHostEmbeddings } from 'vs/workbench/api/common/extHostEmbedding'; -import { ExtHostAiEmbeddingVector } from 'vs/workbench/api/common/extHostEmbeddingVector'; -import { Extension, IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; -import { ExtHostFileSystem } from 'vs/workbench/api/common/extHostFileSystem'; -import { IExtHostConsumerFileSystem } from 'vs/workbench/api/common/extHostFileSystemConsumer'; -import { ExtHostFileSystemEventService, FileSystemWatcherCreateOptions } from 'vs/workbench/api/common/extHostFileSystemEventService'; -import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { ExtHostInteractive } from 'vs/workbench/api/common/extHostInteractive'; -import { ExtHostLabelService } from 'vs/workbench/api/common/extHostLabelService'; -import { ExtHostLanguageFeatures } from 'vs/workbench/api/common/extHostLanguageFeatures'; -import { ExtHostLanguageModelTools } from 'vs/workbench/api/common/extHostLanguageModelTools'; -import { IExtHostLanguageModels } from 'vs/workbench/api/common/extHostLanguageModels'; -import { ExtHostLanguages } from 'vs/workbench/api/common/extHostLanguages'; -import { IExtHostLocalizationService } from 'vs/workbench/api/common/extHostLocalizationService'; -import { IExtHostManagedSockets } from 'vs/workbench/api/common/extHostManagedSockets'; -import { ExtHostMessageService } from 'vs/workbench/api/common/extHostMessageService'; -import { ExtHostModelSelection } from 'vs/workbench/api/common/extHostModelSelection'; -import { ExtHostNotebookController } from 'vs/workbench/api/common/extHostNotebook'; -import { ExtHostNotebookDocumentSaveParticipant } from 'vs/workbench/api/common/extHostNotebookDocumentSaveParticipant'; -import { ExtHostNotebookDocuments } from 'vs/workbench/api/common/extHostNotebookDocuments'; -import { ExtHostNotebookEditors } from 'vs/workbench/api/common/extHostNotebookEditors'; -import { ExtHostNotebookKernels } from 'vs/workbench/api/common/extHostNotebookKernels'; -import { ExtHostNotebookRenderers } from 'vs/workbench/api/common/extHostNotebookRenderers'; -import { IExtHostOutputService } from 'vs/workbench/api/common/extHostOutput'; -import { ExtHostProfileContentHandlers } from 'vs/workbench/api/common/extHostProfileContentHandler'; -import { ExtHostProgress } from 'vs/workbench/api/common/extHostProgress'; -import { ExtHostQuickDiff } from 'vs/workbench/api/common/extHostQuickDiff'; -import { createExtHostQuickOpen } from 'vs/workbench/api/common/extHostQuickOpen'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ExtHostSCM } from 'vs/workbench/api/common/extHostSCM'; -import { IExtHostSearch } from 'vs/workbench/api/common/extHostSearch'; -import { IExtHostSecretState } from 'vs/workbench/api/common/extHostSecretState'; -import { ExtHostShare } from 'vs/workbench/api/common/extHostShare'; -import { ExtHostSpeech } from 'vs/workbench/api/common/extHostSpeech'; -import { ExtHostStatusBar } from 'vs/workbench/api/common/extHostStatusBar'; -import { IExtHostStorage } from 'vs/workbench/api/common/extHostStorage'; -import { IExtensionStoragePaths } from 'vs/workbench/api/common/extHostStoragePaths'; -import { IExtHostTask } from 'vs/workbench/api/common/extHostTask'; -import { ExtHostTelemetryLogger, IExtHostTelemetry, isNewAppInstall } from 'vs/workbench/api/common/extHostTelemetry'; -import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; -import { IExtHostTerminalShellIntegration } from 'vs/workbench/api/common/extHostTerminalShellIntegration'; -import { IExtHostTesting } from 'vs/workbench/api/common/extHostTesting'; -import { ExtHostEditors } from 'vs/workbench/api/common/extHostTextEditors'; -import { ExtHostTheming } from 'vs/workbench/api/common/extHostTheming'; -import { ExtHostTimeline } from 'vs/workbench/api/common/extHostTimeline'; -import { ExtHostTreeViews } from 'vs/workbench/api/common/extHostTreeViews'; -import { IExtHostTunnelService } from 'vs/workbench/api/common/extHostTunnelService'; -import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { ExtHostUriOpeners } from 'vs/workbench/api/common/extHostUriOpener'; -import { IURITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; -import { ExtHostUrls } from 'vs/workbench/api/common/extHostUrls'; -import { ExtHostWebviews } from 'vs/workbench/api/common/extHostWebview'; -import { ExtHostWebviewPanels } from 'vs/workbench/api/common/extHostWebviewPanels'; -import { ExtHostWebviewViews } from 'vs/workbench/api/common/extHostWebviewView'; -import { IExtHostWindow } from 'vs/workbench/api/common/extHostWindow'; -import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/contrib/debug/common/debug'; -import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/common/extensionDescriptionRegistry'; -import { UIKind } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; -import { checkProposedApiEnabled, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import { ProxyIdentifier } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { TextSearchCompleteMessageType } from 'vs/workbench/services/search/common/searchExtTypes'; +import { CancellationTokenSource } from '../../../base/common/cancellation.js'; +import * as errors from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { combinedDisposable } from '../../../base/common/lifecycle.js'; +import { Schemas, matchesScheme } from '../../../base/common/network.js'; +import Severity from '../../../base/common/severity.js'; +import { URI } from '../../../base/common/uri.js'; +import { TextEditorCursorStyle } from '../../../editor/common/config/editorOptions.js'; +import { score, targetsNotebooks } from '../../../editor/common/languageSelector.js'; +import * as languageConfiguration from '../../../editor/common/languages/languageConfiguration.js'; +import { OverviewRulerLane } from '../../../editor/common/model.js'; +import { ExtensionIdentifierSet, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import * as files from '../../../platform/files/common/files.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService, ILoggerService, LogLevel } from '../../../platform/log/common/log.js'; +import { getRemoteName } from '../../../platform/remote/common/remoteHosts.js'; +import { TelemetryTrustedValue } from '../../../platform/telemetry/common/telemetryUtils.js'; +import { EditSessionIdentityMatch } from '../../../platform/workspace/common/editSessions.js'; +import { CandidatePortSource, ExtHostContext, ExtHostLogLevelServiceShape, MainContext } from './extHost.protocol.js'; +import { ExtHostRelatedInformation } from './extHostAiRelatedInformation.js'; +import { ExtHostApiCommands } from './extHostApiCommands.js'; +import { IExtHostApiDeprecationService } from './extHostApiDeprecationService.js'; +import { IExtHostAuthentication } from './extHostAuthentication.js'; +import { ExtHostBulkEdits } from './extHostBulkEdits.js'; +import { ExtHostChatAgents2 } from './extHostChatAgents2.js'; +import { ExtHostChatVariables } from './extHostChatVariables.js'; +import { ExtHostClipboard } from './extHostClipboard.js'; +import { ExtHostEditorInsets } from './extHostCodeInsets.js'; +import { IExtHostCommands } from './extHostCommands.js'; +import { createExtHostComments } from './extHostComments.js'; +import { ExtHostConfigProvider, IExtHostConfiguration } from './extHostConfiguration.js'; +import { ExtHostCustomEditors } from './extHostCustomEditors.js'; +import { IExtHostDebugService } from './extHostDebugService.js'; +import { IExtHostDecorations } from './extHostDecorations.js'; +import { ExtHostDiagnostics } from './extHostDiagnostics.js'; +import { ExtHostDialogs } from './extHostDialogs.js'; +import { ExtHostDocumentContentProvider } from './extHostDocumentContentProviders.js'; +import { ExtHostDocumentSaveParticipant } from './extHostDocumentSaveParticipant.js'; +import { ExtHostDocuments } from './extHostDocuments.js'; +import { IExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import { IExtHostEditorTabs } from './extHostEditorTabs.js'; +import { ExtHostEmbeddings } from './extHostEmbedding.js'; +import { ExtHostAiEmbeddingVector } from './extHostEmbeddingVector.js'; +import { Extension, IExtHostExtensionService } from './extHostExtensionService.js'; +import { ExtHostFileSystem } from './extHostFileSystem.js'; +import { IExtHostConsumerFileSystem } from './extHostFileSystemConsumer.js'; +import { ExtHostFileSystemEventService, FileSystemWatcherCreateOptions } from './extHostFileSystemEventService.js'; +import { IExtHostFileSystemInfo } from './extHostFileSystemInfo.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { ExtHostInteractive } from './extHostInteractive.js'; +import { ExtHostLabelService } from './extHostLabelService.js'; +import { ExtHostLanguageFeatures } from './extHostLanguageFeatures.js'; +import { ExtHostLanguageModelTools } from './extHostLanguageModelTools.js'; +import { IExtHostLanguageModels } from './extHostLanguageModels.js'; +import { ExtHostLanguages } from './extHostLanguages.js'; +import { IExtHostLocalizationService } from './extHostLocalizationService.js'; +import { IExtHostManagedSockets } from './extHostManagedSockets.js'; +import { ExtHostMessageService } from './extHostMessageService.js'; +import { ExtHostNotebookController } from './extHostNotebook.js'; +import { ExtHostNotebookDocumentSaveParticipant } from './extHostNotebookDocumentSaveParticipant.js'; +import { ExtHostNotebookDocuments } from './extHostNotebookDocuments.js'; +import { ExtHostNotebookEditors } from './extHostNotebookEditors.js'; +import { ExtHostNotebookKernels } from './extHostNotebookKernels.js'; +import { ExtHostNotebookRenderers } from './extHostNotebookRenderers.js'; +import { IExtHostOutputService } from './extHostOutput.js'; +import { ExtHostProfileContentHandlers } from './extHostProfileContentHandler.js'; +import { ExtHostProgress } from './extHostProgress.js'; +import { ExtHostQuickDiff } from './extHostQuickDiff.js'; +import { createExtHostQuickOpen } from './extHostQuickOpen.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { ExtHostSCM } from './extHostSCM.js'; +import { IExtHostSearch } from './extHostSearch.js'; +import { IExtHostSecretState } from './extHostSecretState.js'; +import { ExtHostShare } from './extHostShare.js'; +import { ExtHostSpeech } from './extHostSpeech.js'; +import { ExtHostStatusBar } from './extHostStatusBar.js'; +import { IExtHostStorage } from './extHostStorage.js'; +import { IExtensionStoragePaths } from './extHostStoragePaths.js'; +import { IExtHostTask } from './extHostTask.js'; +import { ExtHostTelemetryLogger, IExtHostTelemetry, isNewAppInstall } from './extHostTelemetry.js'; +import { IExtHostTerminalService } from './extHostTerminalService.js'; +import { IExtHostTerminalShellIntegration } from './extHostTerminalShellIntegration.js'; +import { IExtHostTesting } from './extHostTesting.js'; +import { ExtHostEditors } from './extHostTextEditors.js'; +import { ExtHostTheming } from './extHostTheming.js'; +import { ExtHostTimeline } from './extHostTimeline.js'; +import { ExtHostTreeViews } from './extHostTreeViews.js'; +import { IExtHostTunnelService } from './extHostTunnelService.js'; +import * as typeConverters from './extHostTypeConverters.js'; +import * as extHostTypes from './extHostTypes.js'; +import { ExtHostUriOpeners } from './extHostUriOpener.js'; +import { IURITransformerService } from './extHostUriTransformerService.js'; +import { ExtHostUrls } from './extHostUrls.js'; +import { ExtHostWebviews } from './extHostWebview.js'; +import { ExtHostWebviewPanels } from './extHostWebviewPanels.js'; +import { ExtHostWebviewViews } from './extHostWebviewView.js'; +import { IExtHostWindow } from './extHostWindow.js'; +import { IExtHostWorkspace } from './extHostWorkspace.js'; +import { DebugConfigurationProviderTriggerKind } from '../../contrib/debug/common/debug.js'; +import { ExtensionDescriptionRegistry } from '../../services/extensions/common/extensionDescriptionRegistry.js'; +import { UIKind } from '../../services/extensions/common/extensionHostProtocol.js'; +import { checkProposedApiEnabled, isProposedApiEnabled } from '../../services/extensions/common/extensions.js'; +import { ProxyIdentifier } from '../../services/extensions/common/proxyIdentifier.js'; +import { ExcludeSettingOptions, TextSearchCompleteMessageType, TextSearchContextNew, TextSearchMatchNew } from '../../services/search/common/searchExtTypes.js'; import type * as vscode from 'vscode'; +import { ExtHostCodeMapper } from './extHostCodeMapper.js'; +import { ExtHostAideProbeProvider } from './extHostAideProbeProvider.js'; +import { IExtHostCSAuthentication } from './extHostCSAuthentication.js'; +import { ExtHostCSEvents } from './extHostCSEvents.js'; +import { ExtHostModelSelection } from './extHostModelSelection.js'; export interface IExtensionRegistries { mine: ExtensionDescriptionRegistry; @@ -199,6 +198,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I const extHostDiagnostics = rpcProtocol.set(ExtHostContext.ExtHostDiagnostics, new ExtHostDiagnostics(rpcProtocol, extHostLogService, extHostFileSystemInfo, extHostDocumentsAndEditors)); const extHostLanguages = rpcProtocol.set(ExtHostContext.ExtHostLanguages, new ExtHostLanguages(rpcProtocol, extHostDocuments, extHostCommands.converter, uriTransformer)); const extHostLanguageFeatures = rpcProtocol.set(ExtHostContext.ExtHostLanguageFeatures, new ExtHostLanguageFeatures(rpcProtocol, uriTransformer, extHostDocuments, extHostCommands, extHostDiagnostics, extHostLogService, extHostApiDeprecation, extHostTelemetry)); + const extHostCodeMapper = rpcProtocol.set(ExtHostContext.ExtHostCodeMapper, new ExtHostCodeMapper(rpcProtocol)); const extHostFileSystem = rpcProtocol.set(ExtHostContext.ExtHostFileSystem, new ExtHostFileSystem(rpcProtocol, extHostLanguageFeatures)); const extHostFileSystemEvent = rpcProtocol.set(ExtHostContext.ExtHostFileSystemEventService, new ExtHostFileSystemEventService(rpcProtocol, extHostLogService, extHostDocumentsAndEditors)); const extHostQuickOpen = rpcProtocol.set(ExtHostContext.ExtHostQuickOpen, createExtHostQuickOpen(rpcProtocol, extHostWorkspace, extHostCommands)); @@ -218,11 +218,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I const extHostUriOpeners = rpcProtocol.set(ExtHostContext.ExtHostUriOpeners, new ExtHostUriOpeners(rpcProtocol)); const extHostProfileContentHandlers = rpcProtocol.set(ExtHostContext.ExtHostProfileContentHandlers, new ExtHostProfileContentHandlers(rpcProtocol)); rpcProtocol.set(ExtHostContext.ExtHostInteractive, new ExtHostInteractive(rpcProtocol, extHostNotebook, extHostDocumentsAndEditors, extHostCommands, extHostLogService)); - const extHostChatAgents2 = rpcProtocol.set(ExtHostContext.ExtHostChatAgents2, new ExtHostChatAgents2(rpcProtocol, extHostLogService, extHostCommands)); + const extHostChatAgents2 = rpcProtocol.set(ExtHostContext.ExtHostChatAgents2, new ExtHostChatAgents2(rpcProtocol, extHostLogService, extHostCommands, extHostDocuments)); const extHostChatVariables = rpcProtocol.set(ExtHostContext.ExtHostChatVariables, new ExtHostChatVariables(rpcProtocol)); const extHostLanguageModelTools = rpcProtocol.set(ExtHostContext.ExtHostLanguageModelTools, new ExtHostLanguageModelTools(rpcProtocol)); - const extHostAideChatAgents2 = rpcProtocol.set(ExtHostContext.ExtHostAideChatAgents2, new ExtHostAideChatAgents2(rpcProtocol, extHostLogService, extHostCommands, initData.quality)); - const extHostAideChatVariables = rpcProtocol.set(ExtHostContext.ExtHostAideChatVariables, new ExtHostAideChatVariables(rpcProtocol)); const extHostAideProbeProvider = rpcProtocol.set(ExtHostContext.ExtHostAideProbeProvider, new ExtHostAideProbeProvider(rpcProtocol)); const extHostAiRelatedInformation = rpcProtocol.set(ExtHostContext.ExtHostAiRelatedInformation, new ExtHostRelatedInformation(rpcProtocol)); const extHostAiEmbeddingVector = rpcProtocol.set(ExtHostContext.ExtHostAiEmbeddingVector, new ExtHostAiEmbeddingVector(rpcProtocol)); @@ -302,17 +300,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I if (typeof options?.forceNewSession === 'object' && options.forceNewSession.learnMore) { checkProposedApiEnabled(extension, 'authLearnMore'); } - if (options?.account) { - checkProposedApiEnabled(extension, 'authGetSessions'); - } return extHostAuthentication.getSession(extension, providerId, scopes, options as any); }, - getSessions(providerId: string, scopes: readonly string[]) { - checkProposedApiEnabled(extension, 'authGetSessions'); - return extHostAuthentication.getSessions(extension, providerId, scopes); - }, getAccounts(providerId: string) { - checkProposedApiEnabled(extension, 'authGetSessions'); return extHostAuthentication.getAccounts(providerId); }, // TODO: remove this after GHPR and Codespaces move off of it @@ -784,15 +774,12 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I return _asExtensionEvent(extHostTerminalService.onDidExecuteTerminalCommand)(listener, thisArg, disposables); }, onDidChangeTerminalShellIntegration(listener, thisArg?, disposables?) { - checkProposedApiEnabled(extension, 'terminalShellIntegration'); return _asExtensionEvent(extHostTerminalShellIntegration.onDidChangeTerminalShellIntegration)(listener, thisArg, disposables); }, onDidStartTerminalShellExecution(listener, thisArg?, disposables?) { - checkProposedApiEnabled(extension, 'terminalShellIntegration'); return _asExtensionEvent(extHostTerminalShellIntegration.onDidStartTerminalShellExecution)(listener, thisArg, disposables); }, onDidEndTerminalShellExecution(listener, thisArg?, disposables?) { - checkProposedApiEnabled(extension, 'terminalShellIntegration'); return _asExtensionEvent(extHostTerminalShellIntegration.onDidEndTerminalShellExecution)(listener, thisArg, disposables); }, get state() { @@ -1004,10 +991,14 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I // Note, undefined/null have different meanings on "exclude" return extHostWorkspace.findFiles(include, exclude, maxResults, extension.identifier, token); }, - findFiles2: (filePattern, options?, token?) => { + findFiles2: (filePattern: vscode.GlobPattern, options?: vscode.FindFiles2Options, token?: vscode.CancellationToken): Thenable => { checkProposedApiEnabled(extension, 'findFiles2'); return extHostWorkspace.findFiles2(filePattern, options, extension.identifier, token); }, + findFiles2New: (filePattern: vscode.GlobPattern[], options?: vscode.FindFiles2OptionsNew, token?: vscode.CancellationToken): Thenable => { + checkProposedApiEnabled(extension, 'findFiles2New'); + return extHostWorkspace.findFiles2New(filePattern, options, extension.identifier, token); + }, findTextInFiles: (query: vscode.TextSearchQuery, optionsOrCallback: vscode.FindTextInFilesOptions | ((result: vscode.TextSearchResult) => void), callbackOrToken?: vscode.CancellationToken | ((result: vscode.TextSearchResult) => void), token?: vscode.CancellationToken) => { checkProposedApiEnabled(extension, 'findTextInFiles'); let options: vscode.FindTextInFilesOptions; @@ -1024,6 +1015,11 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I return extHostWorkspace.findTextInFiles(query, options || {}, callback, extension.identifier, token); }, + findTextInFilesNew: (query: vscode.TextSearchQueryNew, options?: vscode.FindTextInFilesOptionsNew, token?: vscode.CancellationToken): vscode.FindTextInFilesResponse => { + checkProposedApiEnabled(extension, 'findTextInFilesNew'); + checkProposedApiEnabled(extension, 'textSearchProviderNew'); + return extHostWorkspace.findTextInFilesNew(query, options, extension.identifier, token); + }, save: (uri) => { return extHostWorkspace.save(uri); }, @@ -1039,22 +1035,22 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I createFileSystemWatcher: (pattern, optionsOrIgnoreCreate, ignoreChange?, ignoreDelete?): vscode.FileSystemWatcher => { let options: FileSystemWatcherCreateOptions | undefined = undefined; - if (typeof optionsOrIgnoreCreate === 'boolean') { + if (optionsOrIgnoreCreate && typeof optionsOrIgnoreCreate !== 'boolean') { + checkProposedApiEnabled(extension, 'createFileSystemWatcher'); + options = { + ...optionsOrIgnoreCreate, + correlate: true + }; + } else { options = { ignoreCreateEvents: Boolean(optionsOrIgnoreCreate), ignoreChangeEvents: Boolean(ignoreChange), ignoreDeleteEvents: Boolean(ignoreDelete), correlate: false }; - } else if (optionsOrIgnoreCreate) { - checkProposedApiEnabled(extension, 'createFileSystemWatcher'); - options = { - ...optionsOrIgnoreCreate, - correlate: true - }; } - return extHostFileSystemEvent.createFileSystemWatcher(extHostWorkspace, extension, pattern, options); + return extHostFileSystemEvent.createFileSystemWatcher(extHostWorkspace, configProvider, extension, pattern, options); }, get textDocuments() { return extHostDocuments.getAllDocumentData().map(data => data.document); @@ -1077,6 +1073,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I } return uriPromise.then(uri => { + extHostLogService.trace(`openTextDocument from ${extension.identifier}`); if (uri.scheme === Schemas.vscodeRemote && !uri.authority) { extHostApiDeprecation.report('workspace.openTextDocument', extension, `A URI of 'vscode-remote' scheme requires an authority.`); } @@ -1160,16 +1157,30 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I }, registerFileSearchProvider: (scheme: string, provider: vscode.FileSearchProvider) => { checkProposedApiEnabled(extension, 'fileSearchProvider'); - return extHostSearch.registerFileSearchProvider(scheme, provider); + return extHostSearch.registerFileSearchProviderOld(scheme, provider); }, registerTextSearchProvider: (scheme: string, provider: vscode.TextSearchProvider) => { checkProposedApiEnabled(extension, 'textSearchProvider'); - return extHostSearch.registerTextSearchProvider(scheme, provider); + return extHostSearch.registerTextSearchProviderOld(scheme, provider); }, registerAITextSearchProvider: (scheme: string, provider: vscode.AITextSearchProvider) => { // there are some dependencies on textSearchProvider, so we need to check for both checkProposedApiEnabled(extension, 'aiTextSearchProvider'); checkProposedApiEnabled(extension, 'textSearchProvider'); + return extHostSearch.registerAITextSearchProviderOld(scheme, provider); + }, + registerFileSearchProviderNew: (scheme: string, provider: vscode.FileSearchProviderNew) => { + checkProposedApiEnabled(extension, 'fileSearchProviderNew'); + return extHostSearch.registerFileSearchProvider(scheme, provider); + }, + registerTextSearchProviderNew: (scheme: string, provider: vscode.TextSearchProviderNew) => { + checkProposedApiEnabled(extension, 'textSearchProviderNew'); + return extHostSearch.registerTextSearchProvider(scheme, provider); + }, + registerAITextSearchProviderNew: (scheme: string, provider: vscode.AITextSearchProviderNew) => { + // there are some dependencies on textSearchProvider, so we need to check for both + checkProposedApiEnabled(extension, 'aiTextSearchProviderNew'); + checkProposedApiEnabled(extension, 'textSearchProviderNew'); return extHostSearch.registerAITextSearchProvider(scheme, provider); }, registerRemoteAuthorityResolver: (authorityPrefix: string, resolver: vscode.RemoteAuthorityResolver) => { @@ -1424,8 +1435,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I // namespace: interactive const interactive: typeof vscode.interactive = { - // TODO Can be deleted after another Insiders - _version: 1, transferActiveChat(toWorkspace: vscode.Uri) { checkProposedApiEnabled(extension, 'interactive'); return extHostChatAgents2.transferActiveChat(toWorkspace); @@ -1450,10 +1459,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I // namespace: chat const chat: typeof vscode.chat = { - // IMPORTANT - // this needs to be updated whenever the API proposal changes and breaks backwards compatibility - _version: 1, - registerChatResponseProvider(id: string, provider: vscode.ChatResponseProvider, metadata: vscode.ChatResponseProviderMetadata) { checkProposedApiEnabled(extension, 'chatProvider'); return extHostLanguageModels.registerLanguageModel(extension, id, provider, metadata); @@ -1466,6 +1471,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I checkProposedApiEnabled(extension, 'mappedEditsProvider'); return extHostLanguageFeatures.registerMappedEditsProvider(extension, selector, provider); }, + registerMappedEditsProvider2(provider: vscode.MappedEditsProvider2) { + checkProposedApiEnabled(extension, 'mappedEditsProvider'); + return extHostCodeMapper.registerMappedEditsProvider(extension, provider); + }, createChatParticipant(id: string, handler: vscode.ChatExtendedRequestHandler) { return extHostChatAgents2.createChatAgent(extension, id, handler); }, @@ -1473,6 +1482,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I checkProposedApiEnabled(extension, 'chatParticipantPrivate'); return extHostChatAgents2.createDynamicChatAgent(extension, id, dynamicProps, handler); }, + registerChatParticipantDetectionProvider(provider: vscode.ChatParticipantDetectionProvider) { + checkProposedApiEnabled(extension, 'chatParticipantAdditions'); + return extHostChatAgents2.registerChatParticipantDetectionProvider(provider); + }, }; // namespace: lm @@ -1512,7 +1525,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I checkProposedApiEnabled(extension, 'lmTools'); return extHostLanguageModelTools.registerTool(extension, toolId, tool); }, - invokeTool(toolId: string, parameters: Object, token: vscode.CancellationToken) { + invokeTool(toolId: string, parameters: vscode.LanguageModelToolInvocationOptions, token: vscode.CancellationToken) { checkProposedApiEnabled(extension, 'lmTools'); return extHostLanguageModelTools.invokeTool(toolId, parameters, token); }, @@ -1522,26 +1535,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I }, }; - // namespace: aideChat - const aideChat: typeof vscode.aideChat = { - // IMPORTANT - // this needs to be updated whenever the API proposal changes and breaks backwards compatibility - _version: 1, - - registerChatVariableResolver(id: string, name: string, userDescription: string, modelDescription: string | undefined, isSlow: boolean | undefined, resolver: vscode.ChatVariableResolver, fullName?: string, icon?: vscode.ThemeIcon) { - checkProposedApiEnabled(extension, 'aideChatVariableResolver'); - return extHostAideChatVariables.registerVariableResolver(extension, id, name, userDescription, modelDescription, isSlow, resolver, fullName, icon?.id); - }, - createChatParticipant(id: string, handler: vscode.AideChatExtendedRequestHandler) { - checkProposedApiEnabled(extension, 'aideChatParticipant'); - return extHostAideChatAgents2.createChatAgent(extension, id, handler); - }, - createDynamicChatParticipant(id: string, dynamicProps: vscode.DynamicChatParticipantProps, handler: vscode.AideChatExtendedRequestHandler): vscode.AideChatParticipant { - checkProposedApiEnabled(extension, 'aideChatParticipant'); - return extHostAideChatAgents2.createDynamicChatAgent(extension, id, dynamicProps, handler); - } - }; - const aideProbe: typeof vscode.aideProbe = { // IMPORTANT // this needs to be updated whenever the API proposal changes and breaks backwards compatibility @@ -1585,7 +1578,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I version: initData.version, // namespaces ai, - aideChat, aideProbe, authentication, commands, @@ -1611,9 +1603,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I // types Breakpoint: extHostTypes.Breakpoint, TerminalOutputAnchor: extHostTypes.TerminalOutputAnchor, - AideChatResultFeedbackKind: extHostTypes.AideChatResultFeedbackKind, - AideChatVariableLevel: extHostTypes.AideChatVariableLevel, - AideChatCompletionItem: extHostTypes.AideChatCompletionItem, ChatResultFeedbackKind: extHostTypes.ChatResultFeedbackKind, ChatVariableLevel: extHostTypes.ChatVariableLevel, ChatCompletionItem: extHostTypes.ChatCompletionItem, @@ -1636,6 +1625,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I CommentThreadCollapsibleState: extHostTypes.CommentThreadCollapsibleState, CommentThreadState: extHostTypes.CommentThreadState, CommentThreadApplicability: extHostTypes.CommentThreadApplicability, + CommentThreadFocus: extHostTypes.CommentThreadFocus, CompletionItem: extHostTypes.CompletionItem, CompletionItemKind: extHostTypes.CompletionItemKind, CompletionItemTag: extHostTypes.CompletionItemTag, @@ -1695,6 +1685,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I Position: extHostTypes.Position, ProcessExecution: extHostTypes.ProcessExecution, ProgressLocation: extHostTypes.ProgressLocation, + QuickInputButtonLocation: extHostTypes.QuickInputButtonLocation, QuickInputButtons: extHostTypes.QuickInputButtons, Range: extHostTypes.Range, RelativePattern: extHostTypes.RelativePattern, @@ -1783,6 +1774,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I TestResultState: extHostTypes.TestResultState, TestRunRequest: extHostTypes.TestRunRequest, TestMessage: extHostTypes.TestMessage, + TestMessageStackFrame: extHostTypes.TestMessageStackFrame, TestTag: extHostTypes.TestTag, TestRunProfileKind: extHostTypes.TestRunProfileKind, TextSearchCompleteMessageType: TextSearchCompleteMessageType, @@ -1813,7 +1805,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I LogLevel: LogLevel, EditSessionIdentityMatch: EditSessionIdentityMatch, InteractiveSessionVoteDirection: extHostTypes.InteractiveSessionVoteDirection, - AideChatCopyKind: extHostTypes.AideChatCopyKind, ChatCopyKind: extHostTypes.ChatCopyKind, InteractiveEditorResponseFeedbackKind: extHostTypes.InteractiveEditorResponseFeedbackKind, DebugStackFrame: extHostTypes.DebugStackFrame, @@ -1824,37 +1815,43 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I TextToSpeechStatus: extHostTypes.TextToSpeechStatus, PartialAcceptTriggerKind: extHostTypes.PartialAcceptTriggerKind, KeywordRecognitionStatus: extHostTypes.KeywordRecognitionStatus, - AideChatLocation: extHostTypes.AideChatLocation, ChatResponseMarkdownPart: extHostTypes.ChatResponseMarkdownPart, ChatResponseFileTreePart: extHostTypes.ChatResponseFileTreePart, ChatResponseAnchorPart: extHostTypes.ChatResponseAnchorPart, ChatResponseProgressPart: extHostTypes.ChatResponseProgressPart, ChatResponseProgressPart2: extHostTypes.ChatResponseProgressPart2, ChatResponseReferencePart: extHostTypes.ChatResponseReferencePart, + ChatResponseReferencePart2: extHostTypes.ChatResponseReferencePart, + ChatResponseCodeCitationPart: extHostTypes.ChatResponseCodeCitationPart, + ChatResponseCodeblockUriPart: extHostTypes.ChatResponseCodeblockUriPart, ChatResponseWarningPart: extHostTypes.ChatResponseWarningPart, ChatResponseTextEditPart: extHostTypes.ChatResponseTextEditPart, ChatResponseMarkdownWithVulnerabilitiesPart: extHostTypes.ChatResponseMarkdownWithVulnerabilitiesPart, ChatResponseCommandButtonPart: extHostTypes.ChatResponseCommandButtonPart, ChatResponseDetectedParticipantPart: extHostTypes.ChatResponseDetectedParticipantPart, ChatResponseConfirmationPart: extHostTypes.ChatResponseConfirmationPart, + ChatResponseMovePart: extHostTypes.ChatResponseMovePart, + ChatResponseReferencePartStatusKind: extHostTypes.ChatResponseReferencePartStatusKind, ChatRequestTurn: extHostTypes.ChatRequestTurn, ChatResponseTurn: extHostTypes.ChatResponseTurn, ChatLocation: extHostTypes.ChatLocation, + ChatRequestEditorData: extHostTypes.ChatRequestEditorData, + ChatRequestNotebookData: extHostTypes.ChatRequestNotebookData, LanguageModelChatMessageRole: extHostTypes.LanguageModelChatMessageRole, LanguageModelChatMessage: extHostTypes.LanguageModelChatMessage, - LanguageModelChatMessageFunctionResultPart: extHostTypes.LanguageModelFunctionResultPart, + LanguageModelChatMessageToolResultPart: extHostTypes.LanguageModelToolResultPart, LanguageModelChatResponseTextPart: extHostTypes.LanguageModelTextPart, - LanguageModelChatResponseFunctionUsePart: extHostTypes.LanguageModelFunctionUsePart, - LanguageModelChatMessage2: extHostTypes.LanguageModelChatMessage, // TODO@jrieken REMOVE - LanguageModelChatSystemMessage: extHostTypes.LanguageModelChatSystemMessage,// TODO@jrieken REMOVE - LanguageModelChatUserMessage: extHostTypes.LanguageModelChatUserMessage,// TODO@jrieken REMOVE - LanguageModelChatAssistantMessage: extHostTypes.LanguageModelChatAssistantMessage,// TODO@jrieken REMOVE + LanguageModelChatResponseToolCallPart: extHostTypes.LanguageModelToolCallPart, LanguageModelError: extHostTypes.LanguageModelError, NewSymbolName: extHostTypes.NewSymbolName, NewSymbolNameTag: extHostTypes.NewSymbolNameTag, NewSymbolNameTriggerKind: extHostTypes.NewSymbolNameTriggerKind, InlineEdit: extHostTypes.InlineEdit, InlineEditTriggerKind: extHostTypes.InlineEditTriggerKind, + ExcludeSettingOptions: ExcludeSettingOptions, + TextSearchContextNew: TextSearchContextNew, + TextSearchMatchNew: TextSearchMatchNew, + TextSearchCompleteMessageTypeNew: TextSearchCompleteMessageType, }; }; } diff --git a/src/vs/workbench/api/common/extHost.common.services.ts b/src/vs/workbench/api/common/extHost.common.services.ts index 1c211df4fd9..20443ccf1c3 100644 --- a/src/vs/workbench/api/common/extHost.common.services.ts +++ b/src/vs/workbench/api/common/extHost.common.services.ts @@ -3,36 +3,36 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IExtHostOutputService, ExtHostOutputService } from 'vs/workbench/api/common/extHostOutput'; -import { IExtHostWorkspace, ExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { IExtHostDecorations, ExtHostDecorations } from 'vs/workbench/api/common/extHostDecorations'; -import { IExtHostConfiguration, ExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration'; -import { IExtHostCommands, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { IExtHostDocumentsAndEditors, ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { IExtHostTerminalService, WorkerExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; -import { IExtHostTask, WorkerExtHostTask } from 'vs/workbench/api/common/extHostTask'; -import { IExtHostDebugService, WorkerExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService'; -import { IExtHostSearch, ExtHostSearch } from 'vs/workbench/api/common/extHostSearch'; -import { IExtHostStorage, ExtHostStorage } from 'vs/workbench/api/common/extHostStorage'; -import { IExtHostTunnelService, ExtHostTunnelService } from 'vs/workbench/api/common/extHostTunnelService'; -import { IExtHostApiDeprecationService, ExtHostApiDeprecationService, } from 'vs/workbench/api/common/extHostApiDeprecationService'; -import { IExtHostWindow, ExtHostWindow } from 'vs/workbench/api/common/extHostWindow'; -import { IExtHostConsumerFileSystem, ExtHostConsumerFileSystem } from 'vs/workbench/api/common/extHostFileSystemConsumer'; -import { IExtHostFileSystemInfo, ExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { IExtHostSecretState, ExtHostSecretState } from 'vs/workbench/api/common/extHostSecretState'; -import { ExtHostTelemetry, IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import { ExtHostEditorTabs, IExtHostEditorTabs } from 'vs/workbench/api/common/extHostEditorTabs'; -import { ExtHostLoggerService } from 'vs/workbench/api/common/extHostLoggerService'; -import { ILoggerService } from 'vs/platform/log/common/log'; -import { ExtHostVariableResolverProviderService, IExtHostVariableResolverProvider } from 'vs/workbench/api/common/extHostVariableResolverService'; -import { ExtHostLocalizationService, IExtHostLocalizationService } from 'vs/workbench/api/common/extHostLocalizationService'; -import { ExtHostManagedSockets, IExtHostManagedSockets } from 'vs/workbench/api/common/extHostManagedSockets'; -import { ExtHostAuthentication, IExtHostAuthentication } from 'vs/workbench/api/common/extHostAuthentication'; -import { ExtHostLanguageModels, IExtHostLanguageModels } from 'vs/workbench/api/common/extHostLanguageModels'; -import { IExtHostTerminalShellIntegration, ExtHostTerminalShellIntegration } from 'vs/workbench/api/common/extHostTerminalShellIntegration'; -import { ExtHostTesting, IExtHostTesting } from 'vs/workbench/api/common/extHostTesting'; -import { ExtHostCSAuthentication, IExtHostCSAuthentication } from 'vs/workbench/api/common/extHostCSAuthentication'; +import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; +import { IExtHostOutputService, ExtHostOutputService } from './extHostOutput.js'; +import { IExtHostWorkspace, ExtHostWorkspace } from './extHostWorkspace.js'; +import { IExtHostDecorations, ExtHostDecorations } from './extHostDecorations.js'; +import { IExtHostConfiguration, ExtHostConfiguration } from './extHostConfiguration.js'; +import { IExtHostCommands, ExtHostCommands } from './extHostCommands.js'; +import { IExtHostDocumentsAndEditors, ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import { IExtHostTerminalService, WorkerExtHostTerminalService } from './extHostTerminalService.js'; +import { IExtHostTask, WorkerExtHostTask } from './extHostTask.js'; +import { IExtHostDebugService, WorkerExtHostDebugService } from './extHostDebugService.js'; +import { IExtHostSearch, ExtHostSearch } from './extHostSearch.js'; +import { IExtHostStorage, ExtHostStorage } from './extHostStorage.js'; +import { IExtHostTunnelService, ExtHostTunnelService } from './extHostTunnelService.js'; +import { IExtHostApiDeprecationService, ExtHostApiDeprecationService, } from './extHostApiDeprecationService.js'; +import { IExtHostWindow, ExtHostWindow } from './extHostWindow.js'; +import { IExtHostConsumerFileSystem, ExtHostConsumerFileSystem } from './extHostFileSystemConsumer.js'; +import { IExtHostFileSystemInfo, ExtHostFileSystemInfo } from './extHostFileSystemInfo.js'; +import { IExtHostSecretState, ExtHostSecretState } from './extHostSecretState.js'; +import { ExtHostTelemetry, IExtHostTelemetry } from './extHostTelemetry.js'; +import { ExtHostEditorTabs, IExtHostEditorTabs } from './extHostEditorTabs.js'; +import { ExtHostLoggerService } from './extHostLoggerService.js'; +import { ILoggerService } from '../../../platform/log/common/log.js'; +import { ExtHostVariableResolverProviderService, IExtHostVariableResolverProvider } from './extHostVariableResolverService.js'; +import { ExtHostLocalizationService, IExtHostLocalizationService } from './extHostLocalizationService.js'; +import { ExtHostManagedSockets, IExtHostManagedSockets } from './extHostManagedSockets.js'; +import { ExtHostAuthentication, IExtHostAuthentication } from './extHostAuthentication.js'; +import { ExtHostLanguageModels, IExtHostLanguageModels } from './extHostLanguageModels.js'; +import { IExtHostTerminalShellIntegration, ExtHostTerminalShellIntegration } from './extHostTerminalShellIntegration.js'; +import { ExtHostTesting, IExtHostTesting } from './extHostTesting.js'; +import { ExtHostCSAuthentication, IExtHostCSAuthentication } from './extHostCSAuthentication.js'; registerSingleton(IExtHostLocalizationService, ExtHostLocalizationService, InstantiationType.Delayed); registerSingleton(ILoggerService, ExtHostLoggerService, InstantiationType.Delayed); diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index dc5f4a03881..a36141cc99b 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -3,93 +3,92 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IRemoteConsoleLog } from 'vs/base/common/console'; -import { SerializedError } from 'vs/base/common/errors'; -import { IRelativePattern } from 'vs/base/common/glob'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import * as performance from 'vs/base/common/performance'; -import Severity from 'vs/base/common/severity'; -import { ThemeColor, ThemeIcon } from 'vs/base/common/themables'; -import { URI, UriComponents, UriDto } from 'vs/base/common/uri'; -import { RenderLineNumbersType, TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { IPosition } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { ISelection, Selection } from 'vs/editor/common/core/selection'; -import { IChange } from 'vs/editor/common/diff/legacyLinesDiffComputer'; -import * as editorCommon from 'vs/editor/common/editorCommon'; -import { StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; -import * as languages from 'vs/editor/common/languages'; -import { CharacterPair, CommentRule, EnterAction } from 'vs/editor/common/languages/languageConfiguration'; -import { EndOfLineSequence } from 'vs/editor/common/model'; -import { AgentCodeEditEvent, SymbolNavigationEvent } from 'vs/editor/common/model/csEvents'; -import { IModelChangedEvent } from 'vs/editor/common/model/mirrorTextModel'; -import { IAccessibilityInformation } from 'vs/platform/accessibility/common/accessibility'; -import { ILocalizedString } from 'vs/platform/action/common/action'; -import { IModelSelectionSettings } from 'vs/platform/aiModel/common/aiModels'; -import { CSAuthenticationSession } from 'vs/platform/codestoryAccount/common/csAccount'; -import { ConfigurationTarget, IConfigurationChange, IConfigurationData, IConfigurationOverrides } from 'vs/platform/configuration/common/configuration'; -import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; -import { IExtensionIdWithVersion } from 'vs/platform/extensionManagement/common/extensionStorage'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import * as files from 'vs/platform/files/common/files'; -import { ResourceLabelFormatter } from 'vs/platform/label/common/label'; -import { ILoggerOptions, ILoggerResource, LogLevel } from 'vs/platform/log/common/log'; -import { IMarkerData } from 'vs/platform/markers/common/markers'; -import { IProgressOptions, IProgressStep } from 'vs/platform/progress/common/progress'; -import * as quickInput from 'vs/platform/quickinput/common/quickInput'; -import { IRemoteConnectionData, TunnelDescription } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings'; -import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { ISerializableEnvironmentDescriptionMap, ISerializableEnvironmentVariableCollection } from 'vs/platform/terminal/common/environmentVariable'; -import { ICreateContributedTerminalProfileOptions, IProcessProperty, IProcessReadyWindowsPty, IShellLaunchConfigDto, ITerminalEnvironment, ITerminalLaunchError, ITerminalProfile, TerminalExitReason, TerminalLocation } from 'vs/platform/terminal/common/terminal'; -import { ProvidedPortAttributes, TunnelCreationOptions, TunnelOptions, TunnelPrivacyId, TunnelProviderFeatures } from 'vs/platform/tunnel/common/tunnel'; -import { EditSessionIdentityMatch } from 'vs/platform/workspace/common/editSessions'; -import { WorkspaceTrustRequestOptions } from 'vs/platform/workspace/common/workspaceTrust'; -import * as tasks from 'vs/workbench/api/common/shared/tasks'; -import { SaveReason } from 'vs/workbench/common/editor'; -import { IRevealOptions, ITreeItem, IViewBadge } from 'vs/workbench/common/views'; -import { AideChatAgentLocation, IAideChatAgentMetadata, IAideChatAgentRequest, IAideChatAgentResult } from 'vs/workbench/contrib/aideChat/common/aideChatAgents'; -import { IAideChatProgressResponseContent } from 'vs/workbench/contrib/aideChat/common/aideChatModel'; -import { AideChatAgentVoteDirection, IAideChatFollowup, IAideChatMarkdownContent, IAideChatProgress, IAideChatResponseErrorDetails, IAideChatTask, IAideChatTaskDto, IAideChatUserActionEvent } from 'vs/workbench/contrib/aideChat/common/aideChatService'; -import { IAideChatRequestVariableValue, IAideChatVariableData, IAideChatVariableResolverProgress } from 'vs/workbench/contrib/aideChat/common/aideChatVariables'; -import { IAideProbeBreakdownContent, IAideProbeData, IAideProbeGoToDefinition, IAideProbeInitialSymbols, IAideProbeIterationFinished, IAideProbeLongContextSearch, IAideProbeOpenFile, IAideProbeRepoMapGeneration, IAideProbeRequestModel, IAideProbeResult, IAideProbeTextEdit, IAideProbeSessionAction, IAideProbeUserAction, IAideReferenceFound, IAideRelevantReference, IAideFollowups } from 'vs/workbench/contrib/aideProbe/common/aideProbe'; -import { CallHierarchyItem } from 'vs/workbench/contrib/callHierarchy/common/callHierarchy'; -import { ChatAgentLocation, IChatAgentMetadata, IChatAgentRequest, IChatAgentResult } from 'vs/workbench/contrib/chat/common/chatAgents'; -import { IChatProgressResponseContent } from 'vs/workbench/contrib/chat/common/chatModel'; -import { ChatAgentVoteDirection, IChatFollowup, IChatProgress, IChatResponseErrorDetails, IChatTask, IChatTaskDto, IChatUserActionEvent } from 'vs/workbench/contrib/chat/common/chatService'; -import { IChatRequestVariableValue, IChatVariableData, IChatVariableResolverProgress } from 'vs/workbench/contrib/chat/common/chatVariables'; -import { IChatMessage, IChatResponseFragment, ILanguageModelChatMetadata, ILanguageModelChatSelector, ILanguageModelsChangeEvent } from 'vs/workbench/contrib/chat/common/languageModels'; -import { IToolData, IToolDelta } from 'vs/workbench/contrib/chat/common/languageModelToolsService'; -import { DebugConfigurationProviderTriggerKind, IAdapterDescriptor, IConfig, IDebugSessionReplMode, IDebugTestRunReference, IDebugVisualization, IDebugVisualizationContext, IDebugVisualizationTreeItem, MainThreadDebugVisualization } from 'vs/workbench/contrib/debug/common/debug'; -import * as notebookCommon from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { CellExecutionUpdateType } from 'vs/workbench/contrib/notebook/common/notebookExecutionService'; -import { ICellExecutionComplete, ICellExecutionStateUpdate } from 'vs/workbench/contrib/notebook/common/notebookExecutionStateService'; -import { ICellRange } from 'vs/workbench/contrib/notebook/common/notebookRange'; -import { InputValidationType } from 'vs/workbench/contrib/scm/common/scm'; -import { IWorkspaceSymbol, NotebookPriorityInfo } from 'vs/workbench/contrib/search/common/search'; -import { IRawClosedNotebookFileMatch } from 'vs/workbench/contrib/search/common/searchNotebookHelpers'; -import { IKeywordRecognitionEvent, ISpeechProviderMetadata, ISpeechToTextEvent, ITextToSpeechEvent } from 'vs/workbench/contrib/speech/common/speechService'; -import { CoverageDetails, ExtensionRunTestsRequest, ICallProfileRunHandler, IFileCoverage, ISerializedTestResults, IStartControllerTests, ITestItem, ITestMessage, ITestRunProfile, ITestRunTask, ResolvedTestRunRequest, TestMessageFollowupRequest, TestMessageFollowupResponse, TestResultState, TestsDiffOp } from 'vs/workbench/contrib/testing/common/testTypes'; -import { Timeline, TimelineChangeEvent, TimelineOptions, TimelineProviderDescriptor } from 'vs/workbench/contrib/timeline/common/timeline'; -import { TypeHierarchyItem } from 'vs/workbench/contrib/typeHierarchy/common/typeHierarchy'; -import { RelatedInformationResult, RelatedInformationType } from 'vs/workbench/services/aiRelatedInformation/common/aiRelatedInformation'; -import { AuthenticationSession, AuthenticationSessionAccount, AuthenticationSessionsChangeEvent, IAuthenticationCreateSessionOptions, IAuthenticationProviderSessionOptions } from 'vs/workbench/services/authentication/common/authentication'; -import { EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { IExtensionDescriptionDelta, IStaticWorkspaceData } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; -import { IResolveAuthorityResult } from 'vs/workbench/services/extensions/common/extensionHostProxy'; -import { ActivationKind, ExtensionActivationReason, MissingExtensionDependency } from 'vs/workbench/services/extensions/common/extensions'; -import { Dto, IRPCProtocol, SerializableObjectWithBuffers, createProxyIdentifier } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { ILanguageStatus } from 'vs/workbench/services/languageStatus/common/languageStatusService'; -import { OutputChannelUpdateMode } from 'vs/workbench/services/output/common/output'; -import { CandidatePort } from 'vs/workbench/services/remote/common/tunnelModel'; -import { IFileQueryBuilderOptions, ITextQueryBuilderOptions } from 'vs/workbench/services/search/common/queryBuilder'; -import * as search from 'vs/workbench/services/search/common/search'; -import { ISaveProfileResult } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; -import type { TerminalShellExecutionCommandLineConfidence } from 'vscode'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IRemoteConsoleLog } from '../../../base/common/console.js'; +import { SerializedError } from '../../../base/common/errors.js'; +import { IRelativePattern } from '../../../base/common/glob.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import * as performance from '../../../base/common/performance.js'; +import Severity from '../../../base/common/severity.js'; +import { ThemeColor, ThemeIcon } from '../../../base/common/themables.js'; +import { URI, UriComponents, UriDto } from '../../../base/common/uri.js'; +import { RenderLineNumbersType, TextEditorCursorStyle } from '../../../editor/common/config/editorOptions.js'; +import { ISingleEditOperation } from '../../../editor/common/core/editOperation.js'; +import { IPosition } from '../../../editor/common/core/position.js'; +import { IRange } from '../../../editor/common/core/range.js'; +import { ISelection, Selection } from '../../../editor/common/core/selection.js'; +import { IChange } from '../../../editor/common/diff/legacyLinesDiffComputer.js'; +import * as editorCommon from '../../../editor/common/editorCommon.js'; +import { StandardTokenType } from '../../../editor/common/encodedTokenAttributes.js'; +import * as languages from '../../../editor/common/languages.js'; +import { CharacterPair, CommentRule, EnterAction } from '../../../editor/common/languages/languageConfiguration.js'; +import { EndOfLineSequence } from '../../../editor/common/model.js'; +import { AgentCodeEditEvent, SymbolNavigationEvent } from '../../../editor/common/model/csEvents.js'; +import { IModelChangedEvent } from '../../../editor/common/model/mirrorTextModel.js'; +import { IAccessibilityInformation } from '../../../platform/accessibility/common/accessibility.js'; +import { ILocalizedString } from '../../../platform/action/common/action.js'; +import { IModelSelectionSettings } from '../../../platform/aiModel/common/aiModels.js'; +import { CSAuthenticationSession } from '../../../platform/codestoryAccount/common/csAccount.js'; +import { ConfigurationTarget, IConfigurationChange, IConfigurationData, IConfigurationOverrides } from '../../../platform/configuration/common/configuration.js'; +import { ConfigurationScope } from '../../../platform/configuration/common/configurationRegistry.js'; +import { IExtensionIdWithVersion } from '../../../platform/extensionManagement/common/extensionStorage.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import * as files from '../../../platform/files/common/files.js'; +import { ResourceLabelFormatter } from '../../../platform/label/common/label.js'; +import { ILoggerOptions, ILoggerResource, LogLevel } from '../../../platform/log/common/log.js'; +import { IMarkerData } from '../../../platform/markers/common/markers.js'; +import { IProgressOptions, IProgressStep } from '../../../platform/progress/common/progress.js'; +import * as quickInput from '../../../platform/quickinput/common/quickInput.js'; +import { IRemoteConnectionData, TunnelDescription } from '../../../platform/remote/common/remoteAuthorityResolver.js'; +import { AuthInfo, Credentials } from '../../../platform/request/common/request.js'; +import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from '../../../platform/telemetry/common/gdprTypings.js'; +import { TelemetryLevel } from '../../../platform/telemetry/common/telemetry.js'; +import { ISerializableEnvironmentDescriptionMap, ISerializableEnvironmentVariableCollection } from '../../../platform/terminal/common/environmentVariable.js'; +import { ICreateContributedTerminalProfileOptions, IProcessProperty, IProcessReadyWindowsPty, IShellLaunchConfigDto, ITerminalEnvironment, ITerminalLaunchError, ITerminalProfile, TerminalExitReason, TerminalLocation } from '../../../platform/terminal/common/terminal.js'; +import { ProvidedPortAttributes, TunnelCreationOptions, TunnelOptions, TunnelPrivacyId, TunnelProviderFeatures } from '../../../platform/tunnel/common/tunnel.js'; +import { EditSessionIdentityMatch } from '../../../platform/workspace/common/editSessions.js'; +import { WorkspaceTrustRequestOptions } from '../../../platform/workspace/common/workspaceTrust.js'; +import { SaveReason } from '../../common/editor.js'; +import { IRevealOptions, ITreeItem, IViewBadge } from '../../common/views.js'; +import { IAideProbeTextEdit, IAideProbeIterationFinished, IAideProbeBreakdownContent, IAideProbeGoToDefinition, IAideProbeOpenFile, IAideProbeRepoMapGeneration, IAideProbeLongContextSearch, IAideProbeInitialSymbols, IAideReferenceFound, IAideRelevantReference, IAideFollowups, IAideProbeData, IAideProbeRequestModel, IAideProbeResult, IAideProbeSessionAction, IAideProbeUserAction } from '../../contrib/aideProbe/common/aideProbe.js'; +import { CallHierarchyItem } from '../../contrib/callHierarchy/common/callHierarchy.js'; +import { ChatAgentLocation, IChatAgentMetadata, IChatAgentRequest, IChatAgentResult } from '../../contrib/chat/common/chatAgents.js'; +import { ICodeMapperRequest, ICodeMapperResult } from '../../contrib/chat/common/chatCodeMapperService.js'; +import { IChatProgressResponseContent } from '../../contrib/chat/common/chatModel.js'; +import { IChatFollowup, IChatMarkdownContent, IChatProgress, IChatResponseErrorDetails, IChatTask, IChatTaskDto, IChatUserActionEvent, IChatVoteAction } from '../../contrib/chat/common/chatService.js'; +import { IChatRequestVariableValue, IChatVariableData, IChatVariableResolverProgress } from '../../contrib/chat/common/chatVariables.js'; +import { IChatMessage, IChatResponseFragment, ILanguageModelChatMetadata, ILanguageModelChatSelector, ILanguageModelsChangeEvent } from '../../contrib/chat/common/languageModels.js'; +import { IToolData, IToolInvocation, IToolResult } from '../../contrib/chat/common/languageModelToolsService.js'; +import { DebugConfigurationProviderTriggerKind, IAdapterDescriptor, IConfig, IDebugSessionReplMode, IDebugTestRunReference, IDebugVisualization, IDebugVisualizationContext, IDebugVisualizationTreeItem, MainThreadDebugVisualization } from '../../contrib/debug/common/debug.js'; +import * as notebookCommon from '../../contrib/notebook/common/notebookCommon.js'; +import { CellExecutionUpdateType } from '../../contrib/notebook/common/notebookExecutionService.js'; +import { ICellExecutionComplete, ICellExecutionStateUpdate } from '../../contrib/notebook/common/notebookExecutionStateService.js'; +import { ICellRange } from '../../contrib/notebook/common/notebookRange.js'; +import { InputValidationType } from '../../contrib/scm/common/scm.js'; +import { IWorkspaceSymbol, NotebookPriorityInfo } from '../../contrib/search/common/search.js'; +import { IRawClosedNotebookFileMatch } from '../../contrib/search/common/searchNotebookHelpers.js'; +import { IKeywordRecognitionEvent, ISpeechProviderMetadata, ISpeechToTextEvent, ITextToSpeechEvent } from '../../contrib/speech/common/speechService.js'; +import { CoverageDetails, ExtensionRunTestsRequest, ICallProfileRunHandler, IFileCoverage, ISerializedTestResults, IStartControllerTests, ITestItem, ITestMessage, ITestRunProfile, ITestRunTask, ResolvedTestRunRequest, TestControllerCapability, TestMessageFollowupRequest, TestMessageFollowupResponse, TestResultState, TestsDiffOp } from '../../contrib/testing/common/testTypes.js'; +import { Timeline, TimelineChangeEvent, TimelineOptions, TimelineProviderDescriptor } from '../../contrib/timeline/common/timeline.js'; +import { TypeHierarchyItem } from '../../contrib/typeHierarchy/common/typeHierarchy.js'; +import { RelatedInformationResult, RelatedInformationType } from '../../services/aiRelatedInformation/common/aiRelatedInformation.js'; +import { AuthenticationSession, AuthenticationSessionAccount, AuthenticationSessionsChangeEvent, IAuthenticationCreateSessionOptions, IAuthenticationProviderSessionOptions } from '../../services/authentication/common/authentication.js'; +import { EditorGroupColumn } from '../../services/editor/common/editorGroupColumn.js'; +import { IExtensionDescriptionDelta, IStaticWorkspaceData } from '../../services/extensions/common/extensionHostProtocol.js'; +import { IResolveAuthorityResult } from '../../services/extensions/common/extensionHostProxy.js'; +import { ActivationKind, ExtensionActivationReason, MissingExtensionDependency } from '../../services/extensions/common/extensions.js'; +import { Dto, IRPCProtocol, SerializableObjectWithBuffers, createProxyIdentifier } from '../../services/extensions/common/proxyIdentifier.js'; +import { ILanguageStatus } from '../../services/languageStatus/common/languageStatusService.js'; +import { OutputChannelUpdateMode } from '../../services/output/common/output.js'; +import { CandidatePort } from '../../services/remote/common/tunnelModel.js'; +import { IFileQueryBuilderOptions, ITextQueryBuilderOptions } from '../../services/search/common/queryBuilder.js'; +import * as search from '../../services/search/common/search.js'; +import { TextSearchCompleteMessage } from '../../services/search/common/searchExtTypes.js'; +import { ISaveProfileResult } from '../../services/userDataProfile/common/userDataProfile.js'; +import { TerminalShellExecutionCommandLineConfidence } from './extHostTypes.js'; +import * as tasks from './shared/tasks.js'; export interface IWorkspaceData extends IStaticWorkspaceData { folders: { uri: UriComponents; name: string; index: number }[]; @@ -152,11 +151,12 @@ export interface MainThreadCommentsShape extends IDisposable { $registerCommentController(handle: number, id: string, label: string, extensionId: string): void; $unregisterCommentController(handle: number): void; $updateCommentControllerFeatures(handle: number, features: CommentProviderFeatures): void; - $createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange | ICellRange | undefined, extensionId: ExtensionIdentifier, isTemplate: boolean, editorId?: string): languages.CommentThread | undefined; + $createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange | ICellRange | undefined, comments: languages.Comment[], extensionId: ExtensionIdentifier, isTemplate: boolean, editorId?: string): languages.CommentThread | undefined; $updateCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, changes: CommentThreadChanges): void; $deleteCommentThread(handle: number, commentThreadHandle: number): void; $updateCommentingRanges(handle: number, resourceHints?: languages.CommentingRangeResourceHint): void; - $revealCommentThread(handle: number, commentThreadHandle: number, options: languages.CommentThreadRevealOptions): Promise; + $revealCommentThread(handle: number, commentThreadHandle: number, commentUniqueIdInThread: number, options: languages.CommentThreadRevealOptions): Promise; + $hideCommentThread(handle: number, commentThreadHandle: number): void; } export interface AuthenticationForceNewSessionOptions { @@ -170,7 +170,6 @@ export interface MainThreadAuthenticationShape extends IDisposable { $ensureProvider(id: string): Promise; $sendDidChangeSessions(providerId: string, event: AuthenticationSessionsChangeEvent): void; $getSession(providerId: string, scopes: readonly string[], extensionId: string, extensionName: string, options: { createIfNone?: boolean; forceNewSession?: boolean | AuthenticationForceNewSessionOptions; clearSessionPreference?: boolean }): Promise; - $getSessions(providerId: string, scopes: readonly string[], extensionId: string, extensionName: string): Promise; $getAccounts(providerId: string): Promise>; $removeSession(providerId: string, sessionId: string): Promise; } @@ -395,8 +394,29 @@ export interface IDocumentContextItemDto { readonly ranges: IRange[]; } +export interface IConversationItemDto { + readonly type: 'request' | 'response'; + readonly message: string; + readonly references?: IDocumentContextItemDto[]; +} + export interface IMappedEditsContextDto { documents: IDocumentContextItemDto[][]; + conversation?: IConversationItemDto[]; +} + +export interface ICodeBlockDto { + code: string; + resource: UriComponents; +} + +export interface IMappedEditsRequestDto { + readonly codeBlocks: ICodeBlockDto[]; + readonly conversation?: IConversationItemDto[]; +} + +export interface IMappedEditsResultDto { + readonly errorMessage?: string; } export interface ISignatureHelpProviderMetadataDto { @@ -461,7 +481,7 @@ export interface MainThreadLanguageFeaturesShape extends IDisposable { $resolvePasteFileData(handle: number, requestId: number, dataId: string): Promise; $resolveDocumentOnDropFileData(handle: number, requestId: number, dataId: string): Promise; $setLanguageConfiguration(handle: number, languageId: string, configuration: ILanguageConfigurationDto): void; - $registerMappedEditsProvider(handle: number, selector: IDocumentFilterDto[]): void; + $registerMappedEditsProvider(handle: number, selector: IDocumentFilterDto[], displayName: string): void; } export interface MainThreadLanguagesShape extends IDisposable { @@ -723,7 +743,6 @@ export const enum TabInputKind { TerminalEditorInput, InteractiveEditorInput, ChatEditorInput, - AideChatEditorInput, MultiDiffEditorInput } @@ -791,10 +810,6 @@ export interface ChatEditorInputDto { kind: TabInputKind.ChatEditorInput; } -export interface AideChatEditorInputDto { - kind: TabInputKind.AideChatEditorInput; -} - export interface MultiDiffEditorInputDto { kind: TabInputKind.MultiDiffEditorInput; diffEditors: TextDiffInputDto[]; @@ -804,7 +819,7 @@ export interface TabInputDto { kind: TabInputKind.TerminalEditorInput; } -export type AnyInputDto = UnknownInputDto | TextInputDto | TextDiffInputDto | MultiDiffEditorInputDto | TextMergeInputDto | NotebookInputDto | NotebookDiffInputDto | CustomInputDto | WebviewInputDto | InteractiveEditorInputDto | ChatEditorInputDto | AideChatEditorInputDto | TabInputDto; +export type AnyInputDto = UnknownInputDto | TextInputDto | TextDiffInputDto | MultiDiffEditorInputDto | TextMergeInputDto | NotebookInputDto | NotebookDiffInputDto | CustomInputDto | WebviewInputDto | InteractiveEditorInputDto | ChatEditorInputDto | TabInputDto; export interface MainThreadEditorTabsShape extends IDisposable { // manage tabs: move, close, rearrange etc @@ -1077,6 +1092,7 @@ export interface INotebookDocumentShowOptions { preserveFocus?: boolean; pinned?: boolean; selections?: ICellRange[]; + label?: string; } export type INotebookCellStatusBarEntryDto = Dto; @@ -1265,6 +1281,8 @@ export interface IDynamicChatAgentProps { export interface MainThreadChatAgentsShape2 extends IDisposable { $registerAgent(handle: number, extension: ExtensionIdentifier, id: string, metadata: IExtensionChatAgentMetadata, dynamicProps: IDynamicChatAgentProps | undefined): void; + $registerChatParticipantDetectionProvider(handle: number): void; + $unregisterChatParticipantDetectionProvider(handle: number): void; $registerAgentCompletionsProvider(handle: number, id: string, triggerCharacters: string[]): void; $unregisterAgentCompletionsProvider(handle: number, id: string): void; $updateAgent(handle: number, metadataUpdate: IExtensionChatAgentMetadata): void; @@ -1274,6 +1292,19 @@ export interface MainThreadChatAgentsShape2 extends IDisposable { $transferActiveChatSession(toWorkspace: UriComponents): void; } +export interface ICodeMapperTextEdit { + uri: URI; + edits: languages.TextEdit[]; +} + +export type ICodeMapperProgressDto = Dto; + +export interface MainThreadCodeMapperShape extends IDisposable { + $registerCodeMapperProvider(handle: number): void; + $unregisterCodeMapperProvider(handle: number): void; + $handleProgress(requestId: string, data: ICodeMapperProgressDto): Promise; +} + export interface IChatAgentCompletionItem { id: string; fullName?: string; @@ -1297,14 +1328,26 @@ export type IChatAgentHistoryEntryDto = { }; export interface ExtHostChatAgentsShape2 { - $invokeAgent(handle: number, request: IChatAgentRequest, context: { history: IChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise; - $provideFollowups(request: IChatAgentRequest, handle: number, result: IChatAgentResult, context: { history: IChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise; - $acceptFeedback(handle: number, result: IChatAgentResult, vote: ChatAgentVoteDirection, reportIssue?: boolean): void; + $invokeAgent(handle: number, request: Dto, context: { history: IChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise; + $provideFollowups(request: Dto, handle: number, result: IChatAgentResult, context: { history: IChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise; + $acceptFeedback(handle: number, result: IChatAgentResult, voteAction: IChatVoteAction): void; $acceptAction(handle: number, result: IChatAgentResult, action: IChatUserActionEvent): void; $invokeCompletionProvider(handle: number, query: string, token: CancellationToken): Promise; $provideWelcomeMessage(handle: number, location: ChatAgentLocation, token: CancellationToken): Promise<(string | IMarkdownString)[] | undefined>; + $provideChatTitle(handle: number, context: IChatAgentHistoryEntryDto[], token: CancellationToken): Promise; $provideSampleQuestions(handle: number, location: ChatAgentLocation, token: CancellationToken): Promise; $releaseSession(sessionId: string): void; + $detectChatParticipant(handle: number, request: Dto, context: { history: IChatAgentHistoryEntryDto[] }, options: { participants: IChatParticipantMetadata[]; location: ChatAgentLocation }, token: CancellationToken): Promise; +} +export interface IChatParticipantMetadata { + participant: string; + command?: string; + disambiguation: { category: string; description: string; examples: string[] }[]; +} + +export interface IChatParticipantDetectionResult { + participant: string; + command?: string; } export type IChatVariableResolverProgressDto = @@ -1316,9 +1359,12 @@ export interface MainThreadChatVariablesShape extends IDisposable { $unregisterVariable(handle: number): void; } +export type IToolDataDto = Omit; + export interface MainThreadLanguageModelToolsShape extends IDisposable { - $getTools(): Promise; - $invokeTool(name: string, parameters: any, token: CancellationToken): Promise; + $getTools(): Promise[]>; + $invokeTool(dto: IToolInvocation, token: CancellationToken): Promise; + $countTokensForInvocation(callId: string, input: string, token: CancellationToken): Promise; $registerTool(id: string): void; $unregisterTool(name: string): void; } @@ -1330,8 +1376,9 @@ export interface ExtHostChatVariablesShape { } export interface ExtHostLanguageModelToolsShape { - $acceptToolDelta(delta: IToolDelta): Promise; - $invokeTool(id: string, parameters: any, token: CancellationToken): Promise; + $onDidChangeTools(tools: IToolDataDto[]): void; + $invokeTool(dto: IToolInvocation, token: CancellationToken): Promise; + $countTokensForInvocation(callId: string, input: string, token: CancellationToken): Promise; } export interface MainThreadUrlsShape extends IDisposable { @@ -1375,111 +1422,9 @@ export type IChatProgressDto = ///////////////////////// END CHAT ///////////////////////// ///////////////////////// START AIDE ///////////////////////// -export interface IExtensionAideChatAgentMetadata extends Dto { - hasFollowups?: boolean; -} - -export interface IDynamicAideChatAgentProps { - name: string; - publisherName: string; - description?: string; - fullName?: string; -} - -export interface MainThreadAideChatAgentsShape2 extends IDisposable { - $registerAgent(handle: number, extension: ExtensionIdentifier, id: string, metadata: IExtensionAideChatAgentMetadata, dynamicProps: IDynamicAideChatAgentProps | undefined): void; - $registerAgentCompletionsProvider(handle: number, id: string, triggerCharacters: string[]): void; - $unregisterAgentCompletionsProvider(handle: number, id: string): void; - $updateAgent(handle: number, metadataUpdate: IExtensionAideChatAgentMetadata): void; - $unregisterAgent(handle: number): void; - $handleProgressChunk(requestId: string, chunk: IAideChatProgressDto, handle?: number): Promise; - - $transferActiveChatSession(toWorkspace: UriComponents): void; -} - -export interface IAideChatAgentCompletionItem { - id: string; - fullName?: string; - icon?: string; - insertText?: string; - label: string | languages.CompletionItemLabel; - value: IAideChatRequestVariableValueDto; - detail?: string; - documentation?: string | IMarkdownString; - command?: ICommandDto; -} - -export type IAideChatContentProgressDto = - | Dto> - | IAideChatTaskDto; - -export type IAideChatAgentHistoryEntryDto = { - request: IAideChatAgentRequest; - response: ReadonlyArray; - result: IAideChatAgentResult; -}; - -export interface ExtHostAideChatAgentsShape2 { - $invokeAgent(handle: number, request: IAideChatAgentRequest, context: { history: IAideChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise; - $provideFollowups(request: IAideChatAgentRequest, handle: number, result: IAideChatAgentResult, context: { history: IAideChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise; - $acceptFeedback(handle: number, result: IAideChatAgentResult, vote: AideChatAgentVoteDirection, reportIssue?: boolean): void; - $acceptAction(handle: number, result: IAideChatAgentResult, action: IAideChatUserActionEvent): void; - $invokeCompletionProvider(handle: number, query: string, token: CancellationToken): Promise; - $provideWelcomeMessage(handle: number, location: AideChatAgentLocation, token: CancellationToken): Promise<(string | IMarkdownString)[] | undefined>; - $provideSampleQuestions(handle: number, location: AideChatAgentLocation, token: CancellationToken): Promise; - $releaseSession(sessionId: string): void; -} - -export type IAideChatVariableResolverProgressDto = - | Dto; - -export interface MainThreadAideChatVariablesShape extends IDisposable { - $registerVariable(handle: number, data: IAideChatVariableData): void; - $handleProgressChunk(requestId: string, progress: IAideChatVariableResolverProgressDto): Promise; - $unregisterVariable(handle: number): void; -} - -export type IAideChatRequestVariableValueDto = Dto; - -export interface ExtHostAideChatVariablesShape { - $resolveVariable(handle: number, requestId: string, messageText: string, token: CancellationToken): Promise; -} - -export interface MainThreadUrlsShape extends IDisposable { - $registerUriHandler(handle: number, extensionId: ExtensionIdentifier, extensionDisplayName: string): Promise; - $unregisterUriHandler(handle: number): Promise; - $createAppUri(uri: UriComponents): Promise; -} - -export interface IAideChatDto { -} - -export interface IAideChatRequestDto { - message: string; - variables?: Record; -} - -export interface IAideChatResponseDto { - errorDetails?: IAideChatResponseErrorDetails; - timings: { - firstProgress: number; - totalElapsed: number; - }; -} - -export interface IAideChatResponseProgressFileTreeData { - label: string; - uri: URI; - children?: IAideChatResponseProgressFileTreeData[]; -} - -export type IAideChatProgressDto = - | Dto> - | IAideChatTaskDto; - export type IAideProbeTextEditDto = Omit, 'edits'> & { edits: IWorkspaceEditDto }; export type IAideProbeIterationFinishedDto = Omit, 'edits'> & { edits: IWorkspaceEditDto }; -export type IAideProbeProgressDto = Dto | IAideProbeTextEditDto | IAideProbeIterationFinishedDto; +export type IAideProbeProgressDto = Dto | IAideProbeTextEditDto | IAideProbeIterationFinishedDto; export interface MainThreadAideProbeProviderShape extends IDisposable { $registerProbingProvider(handle: number, data: IAideProbeData): void; @@ -1492,7 +1437,6 @@ export interface ExtHostAideProbeProviderShape { $onSessionAction(handle: number, action: IAideProbeSessionAction): Promise; $onUserAction(handle: number, action: IAideProbeUserAction): Promise; } - ///////////////////////// END AIDE ///////////////////////// export interface ExtHostUrlsShape { @@ -1521,6 +1465,7 @@ export interface ExtHostProfileContentHandlersShape { export interface ITextSearchComplete { limitHit?: boolean; + message?: TextSearchCompleteMessage | TextSearchCompleteMessage[]; } export interface MainThreadWorkspaceShape extends IDisposable { @@ -1531,6 +1476,8 @@ export interface MainThreadWorkspaceShape extends IDisposable { $saveAll(includeUntitled?: boolean): Promise; $updateWorkspaceFolders(extensionName: string, index: number, deleteCount: number, workspaceFoldersToAdd: { uri: UriComponents; name?: string }[]): Promise; $resolveProxy(url: string): Promise; + $lookupAuthorization(authInfo: AuthInfo): Promise; + $lookupKerberosAuthorization(url: string): Promise; $loadCertificates(): Promise; $requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise; $registerEditSessionIdentityProvider(handle: number, scheme: string): void; @@ -1656,29 +1603,35 @@ export type SCMRawResourceSplices = [ SCMRawResourceSplice[] ]; -export interface SCMHistoryItemGroupDto { +export interface SCMHistoryItemRefDto { readonly id: string; readonly name: string; - readonly base?: Omit, 'remote'>; - readonly remote?: Omit, 'remote'>; + readonly revision?: string; + readonly category?: string; + readonly description?: string; + readonly icon?: UriComponents | { light: UriComponents; dark: UriComponents } | ThemeIcon; +} + +export interface SCMHistoryItemRefsChangeEventDto { + readonly added: readonly SCMHistoryItemRefDto[]; + readonly modified: readonly SCMHistoryItemRefDto[]; + readonly removed: readonly SCMHistoryItemRefDto[]; + readonly silent: boolean; } export interface SCMHistoryItemDto { readonly id: string; readonly parentIds: string[]; readonly message: string; + readonly displayId?: string; readonly author?: string; - readonly icon?: UriComponents | { light: UriComponents; dark: UriComponents } | ThemeIcon; readonly timestamp?: number; readonly statistics?: { readonly files: number; readonly insertions: number; readonly deletions: number; }; - readonly labels?: { - readonly title: string; - readonly icon?: UriComponents | { light: UriComponents; dark: UriComponents } | ThemeIcon; - }[]; + readonly references?: SCMHistoryItemRefDto[]; } export interface SCMHistoryItemChangeDto { @@ -1707,7 +1660,8 @@ export interface MainThreadSCMShape extends IDisposable { $showValidationMessage(sourceControlHandle: number, message: string | IMarkdownString, type: InputValidationType): Promise; $setValidationProviderIsEnabled(sourceControlHandle: number, enabled: boolean): Promise; - $onDidChangeHistoryProviderCurrentHistoryItemGroup(sourceControlHandle: number, historyItemGroup: SCMHistoryItemGroupDto | undefined): Promise; + $onDidChangeHistoryProviderCurrentHistoryItemRefs(sourceControlHandle: number, historyItemRef?: SCMHistoryItemRefDto, historyItemRemoteRef?: SCMHistoryItemRefDto, historyItemBaseRef?: SCMHistoryItemRefDto): Promise; + $onDidChangeHistoryProviderHistoryItemRefs(sourceControlHandle: number, historyItemRefs: SCMHistoryItemRefsChangeEventDto): Promise; } export interface MainThreadQuickDiffShape extends IDisposable { @@ -1788,7 +1742,7 @@ export interface MainThreadTunnelServiceShape extends IDisposable { $openTunnel(tunnelOptions: TunnelOptions, source: string | undefined): Promise; $closeTunnel(remote: { host: string; port: number }): Promise; $getTunnels(): Promise; - $setTunnelProvider(features?: TunnelProviderFeatures): Promise; + $setTunnelProvider(features: TunnelProviderFeatures | undefined, enablePortsView: boolean): Promise; $setRemoteTunnelService(processId: number): Promise; $setCandidateFilter(): Promise; $onFoundNewCandidates(candidates: CandidatePort[]): Promise; @@ -1829,6 +1783,14 @@ export interface ICommandMetadataDto { readonly returns?: string; } +export interface ICodeMapperRequestDto extends Dto { + requestId: string; +} + +export interface ExtHostCodeMapperShape { + $mapCode(handle: number, request: ICodeMapperRequestDto, token: CancellationToken): Promise; +} + export interface ExtHostCommandsShape { $executeContributedCommand(id: string, ...args: any[]): Promise; $getContributedCommandMetadata(): Promise<{ [id: string]: string | ICommandMetadataDto }>; @@ -2341,7 +2303,7 @@ export interface ExtHostLanguageFeaturesShape { $resolveCompletionItem(handle: number, id: ChainedCacheId, token: CancellationToken): Promise; $releaseCompletionItems(handle: number, id: number): void; $provideInlineCompletions(handle: number, resource: UriComponents, position: IPosition, context: languages.InlineCompletionContext, token: CancellationToken): Promise; - $provideInlineEdits(handle: number, resource: UriComponents, range: IRange, context: languages.InlineCompletionContext, token: CancellationToken): Promise; + $provideInlineEditsForRange(handle: number, resource: UriComponents, range: IRange, context: languages.InlineCompletionContext, token: CancellationToken): Promise; $handleInlineCompletionDidShow(handle: number, pid: number, idx: number, updatedInsertText: string): void; $handleInlineCompletionPartialAccept(handle: number, pid: number, idx: number, acceptedCharacters: number, info: languages.PartialAcceptInfo): void; $freeInlineCompletionsList(handle: number, pid: number): void; @@ -2478,11 +2440,10 @@ export interface ExtHostSCMShape { $executeResourceCommand(sourceControlHandle: number, groupHandle: number, handle: number, preserveFocus: boolean): Promise; $validateInput(sourceControlHandle: number, value: string, cursorPosition: number): Promise<[string | IMarkdownString, number] | undefined>; $setSelectedSourceControl(selectedSourceControlHandle: number | undefined): Promise; - $provideHistoryItems(sourceControlHandle: number, historyItemGroupId: string, options: any, token: CancellationToken): Promise; - $provideHistoryItems2(sourceControlHandle: number, options: any, token: CancellationToken): Promise; - $provideHistoryItemSummary(sourceControlHandle: number, historyItemId: string, historyItemParentId: string | undefined, token: CancellationToken): Promise; + $provideHistoryItemRefs(sourceControlHandle: number, token: CancellationToken): Promise; + $provideHistoryItems(sourceControlHandle: number, options: any, token: CancellationToken): Promise; $provideHistoryItemChanges(sourceControlHandle: number, historyItemId: string, historyItemParentId: string | undefined, token: CancellationToken): Promise; - $resolveHistoryItemGroupCommonAncestor(sourceControlHandle: number, historyItemGroupId1: string, historyItemGroupId2: string | undefined, token: CancellationToken): Promise<{ id: string; ahead: number; behind: number } | undefined>; + $resolveHistoryItemRefsCommonAncestor(sourceControlHandle: number, historyItemRefs: string[], token: CancellationToken): Promise; } export interface ExtHostQuickDiffShape { @@ -2690,6 +2651,7 @@ export interface INotebookEditorAddData { selections: ICellRange[]; visibleRanges: ICellRange[]; viewColumn?: number; + viewType: string; } export interface INotebookDocumentsAndEditorsDelta { @@ -2878,7 +2840,7 @@ export const enum ExtHostTestingResource { export interface ExtHostTestingShape { $runControllerTests(req: IStartControllerTests[], token: CancellationToken): Promise<{ error?: string }[]>; $startContinuousRun(req: ICallProfileRunHandler[], token: CancellationToken): Promise<{ error?: string }[]>; - $cancelExtensionTestRun(runId: string | undefined): void; + $cancelExtensionTestRun(runId: string | undefined, taskId: string | undefined): void; /** Handles a diff of tests, as a result of a subscribeToDiffs() call */ $acceptDiff(diff: TestsDiffOp.Serialized[]): void; /** Expands a test item's children, by the given number of levels. */ @@ -2895,6 +2857,8 @@ export interface ExtHostTestingShape { $syncTests(): Promise; /** Sets the active test run profiles */ $setDefaultRunProfiles(profiles: Record): void; + $getTestsRelatedToCode(uri: UriComponents, position: IPosition, token: CancellationToken): Promise; + $getCodeRelatedToTest(testId: string, token: CancellationToken): Promise; // --- test results: @@ -2923,14 +2887,14 @@ export interface IStringDetails { export interface ITestControllerPatch { label?: string; - canRefresh?: boolean; + capabilities?: TestControllerCapability; } export interface MainThreadTestingShape { // --- test lifecycle: /** Registers that there's a test controller with the given ID */ - $registerTestController(controllerId: string, label: string, canRefresh: boolean): void; + $registerTestController(controllerId: string, label: string, capability: TestControllerCapability): void; /** Updates the label of an existing test controller. */ $updateController(controllerId: string, patch: ITestControllerPatch): void; /** Diposes of the test controller with the given ID */ @@ -2941,6 +2905,8 @@ export interface MainThreadTestingShape { $unsubscribeFromDiffs(): void; /** Publishes that new tests were available on the given source. */ $publishDiff(controllerId: string, diff: TestsDiffOp.Serialized[]): void; + /** Gets coverage details from a test result. */ + $getCoverageDetails(resultId: string, taskIndex: number, uri: UriComponents, token: CancellationToken): Promise; // --- test run configurations: @@ -2998,10 +2964,9 @@ export const MainContext = { MainThreadBulkEdits: createProxyIdentifier('MainThreadBulkEdits'), MainThreadLanguageModels: createProxyIdentifier('MainThreadLanguageModels'), MainThreadEmbeddings: createProxyIdentifier('MainThreadEmbeddings'), - MainThreadAideChatAgents2: createProxyIdentifier('MainThreadAideChatAgents2'), - MainThreadAideChatVariables: createProxyIdentifier('MainThreadAideChatVariables'), MainThreadProbeProvider: createProxyIdentifier('MainThreadProbeProvider'), MainThreadChatAgents2: createProxyIdentifier('MainThreadChatAgents2'), + MainThreadCodeMapper: createProxyIdentifier('MainThreadCodeMapper'), MainThreadChatVariables: createProxyIdentifier('MainThreadChatVariables'), MainThreadLanguageModelTools: createProxyIdentifier('MainThreadChatSkills'), MainThreadClipboard: createProxyIdentifier('MainThreadClipboard'), @@ -3073,6 +3038,7 @@ export const MainContext = { }; export const ExtHostContext = { + ExtHostCodeMapper: createProxyIdentifier('ExtHostCodeMapper'), ExtHostCommands: createProxyIdentifier('ExtHostCommands'), ExtHostConfiguration: createProxyIdentifier('ExtHostConfiguration'), ExtHostDiagnostics: createProxyIdentifier('ExtHostDiagnostics'), @@ -3128,8 +3094,6 @@ export const ExtHostContext = { ExtHostChatVariables: createProxyIdentifier('ExtHostChatVariables'), ExtHostLanguageModelTools: createProxyIdentifier('ExtHostChatSkills'), ExtHostChatProvider: createProxyIdentifier('ExtHostChatProvider'), - ExtHostAideChatAgents2: createProxyIdentifier('ExtHostAideChatAgents'), - ExtHostAideChatVariables: createProxyIdentifier('ExtHostAideChatVariables'), ExtHostAideProbeProvider: createProxyIdentifier('ExtHostAideProbeProvider'), ExtHostSpeech: createProxyIdentifier('ExtHostSpeech'), ExtHostEmbeddings: createProxyIdentifier('ExtHostEmbeddings'), diff --git a/src/vs/workbench/api/common/extHostAiRelatedInformation.ts b/src/vs/workbench/api/common/extHostAiRelatedInformation.ts index 5594a8adf4c..c0b1994ba1a 100644 --- a/src/vs/workbench/api/common/extHostAiRelatedInformation.ts +++ b/src/vs/workbench/api/common/extHostAiRelatedInformation.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostAiRelatedInformationShape, IMainContext, MainContext, MainThreadAiRelatedInformationShape } from 'vs/workbench/api/common/extHost.protocol'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostAiRelatedInformationShape, IMainContext, MainContext, MainThreadAiRelatedInformationShape } from './extHost.protocol.js'; import type { CancellationToken, RelatedInformationProvider, RelatedInformationType, RelatedInformationResult } from 'vscode'; -import { Disposable } from 'vs/workbench/api/common/extHostTypes'; +import { Disposable } from './extHostTypes.js'; export class ExtHostRelatedInformation implements ExtHostAiRelatedInformationShape { private _relatedInformationProviders: Map = new Map(); diff --git a/src/vs/workbench/api/common/extHostAideChatAgents2.ts b/src/vs/workbench/api/common/extHostAideChatAgents2.ts deleted file mode 100644 index b7c85764874..00000000000 --- a/src/vs/workbench/api/common/extHostAideChatAgents2.ts +++ /dev/null @@ -1,749 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { coalesce } from 'vs/base/common/arrays'; -import { raceCancellation } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { Emitter } from 'vs/base/common/event'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { Iterable } from 'vs/base/common/iterator'; -import { Disposable, DisposableMap, DisposableStore } from 'vs/base/common/lifecycle'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { Location } from 'vs/editor/common/languages'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostAideChatAgentsShape2, IAideChatAgentCompletionItem, IAideChatAgentHistoryEntryDto, IAideChatProgressDto, IExtensionAideChatAgentMetadata, IMainContext, MainContext, MainThreadAideChatAgentsShape2 } from 'vs/workbench/api/common/extHost.protocol'; -import { CommandsConverter, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { AideChatAgentLocation, IAideChatAgentRequest, IAideChatAgentResult } from 'vs/workbench/contrib/aideChat/common/aideChatAgents'; -import { IAideChatContentReference, IAideChatFollowup, IAideChatUserActionEvent, AideChatAgentVoteDirection, IAideChatResponseErrorDetails } from 'vs/workbench/contrib/aideChat/common/aideChatService'; -import { checkProposedApiEnabled, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import { Dto } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import type * as vscode from 'vscode'; - -class ChatAgentResponseStream { - - private _stopWatch = StopWatch.create(false); - private _isClosed: boolean = false; - private _firstProgress: number | undefined; - private _apiObject: vscode.AideChatResponseStream | undefined; - - constructor( - private readonly _extension: IExtensionDescription, - private readonly _request: IAideChatAgentRequest, - private readonly _proxy: MainThreadAideChatAgentsShape2, - private readonly _commandsConverter: CommandsConverter, - private readonly _sessionDisposables: DisposableStore - ) { } - - close() { - this._isClosed = true; - } - - get timings() { - return { - firstProgress: this._firstProgress, - totalElapsed: this._stopWatch.elapsed() - }; - } - - get apiObject() { - - if (!this._apiObject) { - - const that = this; - this._stopWatch.reset(); - - function throwIfDone(source: Function | undefined) { - if (that._isClosed) { - const err = new Error('Response stream has been closed'); - Error.captureStackTrace(err, source); - throw err; - } - } - - const _report = (progress: IAideChatProgressDto, task?: (progress: vscode.Progress) => Thenable) => { - // Measure the time to the first progress update with real markdown content - if (typeof this._firstProgress === 'undefined' && 'content' in progress) { - this._firstProgress = this._stopWatch.elapsed(); - } - - if (task) { - const progressReporterPromise = this._proxy.$handleProgressChunk(this._request.requestId, progress); - const progressReporter = { - report: (p: vscode.ChatResponseWarningPart | vscode.ChatResponseReferencePart) => { - progressReporterPromise?.then((handle) => { - if (handle) { - if (extHostTypes.MarkdownString.isMarkdownString(p.value)) { - this._proxy.$handleProgressChunk(this._request.requestId, typeConvert.AideChatResponseWarningPart.from(p), handle); - } else { - this._proxy.$handleProgressChunk(this._request.requestId, typeConvert.AideChatResponseReferencePart.from(p), handle); - } - } - }); - } - }; - - Promise.all([progressReporterPromise, task?.(progressReporter)]).then(([handle, res]) => { - if (handle !== undefined && res !== undefined) { - this._proxy.$handleProgressChunk(this._request.requestId, typeConvert.AideChatTaskResult.from(res), handle); - } - }); - } else { - this._proxy.$handleProgressChunk(this._request.requestId, progress); - } - }; - - this._apiObject = { - markdown(value) { - throwIfDone(this.markdown); - const part = new extHostTypes.AideChatResponseMarkdownPart(value); - const dto = typeConvert.AideChatResponseMarkdownPart.from(part); - _report(dto); - return this; - }, - markdownWithVulnerabilities(value, vulnerabilities) { - throwIfDone(this.markdown); - if (vulnerabilities) { - checkProposedApiEnabled(that._extension, 'aideChatParticipant'); - } - - const part = new extHostTypes.AideChatResponseMarkdownWithVulnerabilitiesPart(value, vulnerabilities); - const dto = typeConvert.AideChatResponseMarkdownWithVulnerabilitiesPart.from(part); - _report(dto); - return this; - }, - filetree(value, baseUri) { - throwIfDone(this.filetree); - const part = new extHostTypes.AideChatResponseFileTreePart(value, baseUri); - const dto = typeConvert.AideChatResponseFilesPart.from(part); - _report(dto); - return this; - }, - anchor(value, title?: string) { - throwIfDone(this.anchor); - const part = new extHostTypes.AideChatResponseAnchorPart(value, title); - const dto = typeConvert.AideChatResponseAnchorPart.from(part); - _report(dto); - return this; - }, - button(value) { - throwIfDone(this.anchor); - const part = new extHostTypes.AideChatResponseCommandButtonPart(value); - const dto = typeConvert.AideChatResponseCommandButtonPart.from(part, that._commandsConverter, that._sessionDisposables); - _report(dto); - return this; - }, - progress(value, task?: ((progress: vscode.Progress) => Thenable)) { - throwIfDone(this.progress); - const part = new extHostTypes.AideChatResponseProgressPart2(value, task); - const dto = task ? typeConvert.AideChatTask.from(part) : typeConvert.AideChatResponseProgressPart.from(part); - _report(dto, task); - return this; - }, - warning(value) { - throwIfDone(this.progress); - checkProposedApiEnabled(that._extension, 'aideChatParticipant'); - const part = new extHostTypes.ChatResponseWarningPart(value); - const dto = typeConvert.AideChatResponseWarningPart.from(part); - _report(dto); - return this; - }, - reference(value, iconPath) { - throwIfDone(this.reference); - - if ('variableName' in value) { - checkProposedApiEnabled(that._extension, 'aideChatParticipant'); - } - - if ('variableName' in value && !value.value) { - // The participant used this variable. Does that variable have any references to pull in? - const matchingVarData = that._request.variables.variables.find(v => v.name === value.variableName); - if (matchingVarData) { - let references: Dto[] | undefined; - if (matchingVarData.references?.length) { - references = matchingVarData.references.map(r => ({ - kind: 'reference', - reference: { variableName: value.variableName, value: r.reference as URI | Location } - } satisfies IAideChatContentReference)); - } else { - // Participant sent a variableName reference but the variable produced no references. Show variable reference with no value - const part = new extHostTypes.AideChatResponseReferencePart(value, iconPath); - const dto = typeConvert.AideChatResponseReferencePart.from(part); - references = [dto]; - } - - references.forEach(r => _report(r)); - return this; - } else { - // Something went wrong- that variable doesn't actually exist - } - } else { - const part = new extHostTypes.AideChatResponseReferencePart(value, iconPath); - const dto = typeConvert.AideChatResponseReferencePart.from(part); - _report(dto); - } - - return this; - }, - textEdit(target, edits) { - throwIfDone(this.textEdit); - checkProposedApiEnabled(that._extension, 'aideChatParticipant'); - - const part = new extHostTypes.AideChatResponseTextEditPart(target, edits); - const dto = typeConvert.AideChatResponseTextEditPart.from(part); - _report(dto); - return this; - }, - detectedParticipant(participant, command) { - throwIfDone(this.detectedParticipant); - checkProposedApiEnabled(that._extension, 'aideChatParticipant'); - - const part = new extHostTypes.AideChatResponseDetectedParticipantPart(participant, command); - const dto = typeConvert.AideChatResponseDetectedParticipantPart.from(part); - _report(dto); - return this; - }, - confirmation(title, message, data) { - throwIfDone(this.confirmation); - checkProposedApiEnabled(that._extension, 'aideChatParticipant'); - - const part = new extHostTypes.AideChatResponseConfirmationPart(title, message, data); - const dto = typeConvert.AideChatResponseConfirmationPart.from(part); - _report(dto); - return this; - }, - push(part) { - throwIfDone(this.push); - - if ( - part instanceof extHostTypes.ChatResponseTextEditPart || - part instanceof extHostTypes.ChatResponseMarkdownWithVulnerabilitiesPart || - part instanceof extHostTypes.ChatResponseDetectedParticipantPart || - part instanceof extHostTypes.ChatResponseWarningPart || - part instanceof extHostTypes.ChatResponseConfirmationPart - ) { - checkProposedApiEnabled(that._extension, 'aideChatParticipant'); - } - - if (part instanceof extHostTypes.ChatResponseReferencePart) { - // Ensure variable reference values get fixed up - this.reference(part.value, part.iconPath); - } else { - const dto = typeConvert.AideChatResponsePart.from(part, that._commandsConverter, that._sessionDisposables); - _report(dto); - } - - return this; - }, - }; - } - - return this._apiObject; - } -} - -export class ExtHostAideChatAgents2 extends Disposable implements ExtHostAideChatAgentsShape2 { - - private static _idPool = 0; - - private readonly _agents = new Map(); - private readonly _proxy: MainThreadAideChatAgentsShape2; - - private readonly _sessionDisposables: DisposableMap = this._register(new DisposableMap()); - private readonly _completionDisposables: DisposableMap = this._register(new DisposableMap()); - - constructor( - mainContext: IMainContext, - private readonly _logService: ILogService, - private readonly commands: ExtHostCommands, - private readonly quality: string | undefined - ) { - super(); - this._proxy = mainContext.getProxy(MainContext.MainThreadAideChatAgents2); - } - - transferActiveChat(newWorkspace: vscode.Uri): void { - this._proxy.$transferActiveChatSession(newWorkspace); - } - - createChatAgent(extension: IExtensionDescription, id: string, handler: vscode.AideChatExtendedRequestHandler): vscode.AideChatParticipant { - const handle = ExtHostAideChatAgents2._idPool++; - const agent = new ExtHostChatAgent(extension, this.quality, id, this._proxy, handle, handler); - this._agents.set(handle, agent); - - if (agent.isAgentEnabled()) { - this._proxy.$registerAgent(handle, extension.identifier, id, {}, undefined); - } - - return agent.apiAgent; - } - - createDynamicChatAgent(extension: IExtensionDescription, id: string, dynamicProps: vscode.DynamicChatParticipantProps, handler: vscode.AideChatExtendedRequestHandler): vscode.AideChatParticipant { - const handle = ExtHostAideChatAgents2._idPool++; - const agent = new ExtHostChatAgent(extension, this.quality, id, this._proxy, handle, handler); - this._agents.set(handle, agent); - - this._proxy.$registerAgent(handle, extension.identifier, id, { isSticky: true } satisfies IExtensionAideChatAgentMetadata, dynamicProps); - return agent.apiAgent; - } - - async $invokeAgent(handle: number, request: IAideChatAgentRequest, context: { history: IAideChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise { - const agent = this._agents.get(handle); - if (!agent) { - throw new Error(`[CHAT](${handle}) CANNOT invoke agent because the agent is not registered`); - } - - // Init session disposables - let sessionDisposables = this._sessionDisposables.get(request.sessionId); - if (!sessionDisposables) { - sessionDisposables = new DisposableStore(); - this._sessionDisposables.set(request.sessionId, sessionDisposables); - } - - const stream = new ChatAgentResponseStream(agent.extension, request, this._proxy, this.commands.converter, sessionDisposables); - try { - const convertedHistory = await this.prepareHistoryTurns(request.agentId, context); - const task = agent.invoke( - typeConvert.AideChatAgentRequest.to(request), - { history: convertedHistory }, - stream.apiObject, - token - ); - - return await raceCancellation(Promise.resolve(task).then((result) => { - if (result?.metadata) { - try { - JSON.stringify(result.metadata); - } catch (err) { - const msg = `result.metadata MUST be JSON.stringify-able. Got error: ${err.message}`; - this._logService.error(`[${agent.extension.identifier.value}] [@${agent.id}] ${msg}`, agent.extension); - return { errorDetails: { message: msg }, timings: stream.timings }; - } - } - let errorDetails: IAideChatResponseErrorDetails | undefined; - if (result?.errorDetails) { - errorDetails = { - ...result.errorDetails, - responseIsIncomplete: true - }; - } - if (errorDetails?.responseIsRedacted) { - checkProposedApiEnabled(agent.extension, 'aideChatParticipant'); - } - - return { errorDetails, timings: stream.timings, metadata: result?.metadata } satisfies IAideChatAgentResult; - }), token); - } catch (e) { - this._logService.error(e, agent.extension); - - return { errorDetails: { message: toErrorMessage(e), responseIsIncomplete: true } }; - - } finally { - stream.close(); - } - } - - private async prepareHistoryTurns(agentId: string, context: { history: IAideChatAgentHistoryEntryDto[] }): Promise<(vscode.ChatRequestTurn | vscode.ChatResponseTurn)[]> { - - const res: (vscode.ChatRequestTurn | vscode.ChatResponseTurn)[] = []; - - for (const h of context.history) { - const ehResult = typeConvert.AideChatAgentResult.to(h.result); - const result: vscode.ChatResult = agentId === h.request.agentId ? - ehResult : - { ...ehResult, metadata: undefined }; - - // REQUEST turn - res.push(new extHostTypes.AideChatRequestTurn(h.request.message, h.request.command, h.request.variables.variables.map(typeConvert.AideChatAgentValueReference.to), h.request.agentId)); - - // RESPONSE turn - const parts = coalesce(h.response.map(r => typeConvert.AideChatResponsePart.toContent(r, this.commands.converter))); - res.push(new extHostTypes.AideChatResponseTurn(parts, result, h.request.agentId, h.request.command)); - } - - return res; - } - - $releaseSession(sessionId: string): void { - this._sessionDisposables.deleteAndDispose(sessionId); - } - - async $provideFollowups(request: IAideChatAgentRequest, handle: number, result: IAideChatAgentResult, context: { history: IAideChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise { - const agent = this._agents.get(handle); - if (!agent) { - return Promise.resolve([]); - } - - const convertedHistory = await this.prepareHistoryTurns(agent.id, context); - - const ehResult = typeConvert.AideChatAgentResult.to(result); - return (await agent.provideFollowups(ehResult, { history: convertedHistory }, token)) - .filter(f => { - // The followup must refer to a participant that exists from the same extension - const isValid = !f.participant || Iterable.some( - this._agents.values(), - a => a.id === f.participant && ExtensionIdentifier.equals(a.extension.identifier, agent.extension.identifier)); - if (!isValid) { - this._logService.warn(`[@${agent.id}] ChatFollowup refers to an unknown participant: ${f.participant}`); - } - return isValid; - }) - .map(f => typeConvert.AideChatFollowup.from(f, request)); - } - - $acceptFeedback(handle: number, result: IAideChatAgentResult, vote: AideChatAgentVoteDirection, reportIssue?: boolean): void { - const agent = this._agents.get(handle); - if (!agent) { - return; - } - - const ehResult = typeConvert.AideChatAgentResult.to(result); - let kind: extHostTypes.AideChatResultFeedbackKind; - switch (vote) { - case AideChatAgentVoteDirection.Down: - kind = extHostTypes.AideChatResultFeedbackKind.Unhelpful; - break; - case AideChatAgentVoteDirection.Up: - kind = extHostTypes.AideChatResultFeedbackKind.Helpful; - break; - } - agent.acceptFeedback(reportIssue ? - Object.freeze({ result: ehResult, kind, reportIssue }) : - Object.freeze({ result: ehResult, kind })); - } - - $acceptAction(handle: number, result: IAideChatAgentResult, event: IAideChatUserActionEvent): void { - const agent = this._agents.get(handle); - if (!agent) { - return; - } - if (event.action.kind === 'vote') { - // handled by $acceptFeedback - return; - } - - const ehAction = typeConvert.AideChatAgentUserActionEvent.to(result, event, this.commands.converter); - if (ehAction) { - agent.acceptAction(Object.freeze(ehAction)); - } - } - - async $invokeCompletionProvider(handle: number, query: string, token: CancellationToken): Promise { - const agent = this._agents.get(handle); - if (!agent) { - return []; - } - - let disposables = this._completionDisposables.get(handle); - if (disposables) { - // Clear any disposables from the last invocation of this completion provider - disposables.clear(); - } else { - disposables = new DisposableStore(); - this._completionDisposables.set(handle, disposables); - } - - const items = await agent.invokeCompletionProvider(query, token); - - return items.map((i) => typeConvert.AideChatAgentCompletionItem.from(i, this.commands.converter, disposables)); - } - - async $provideWelcomeMessage(handle: number, location: AideChatAgentLocation, token: CancellationToken): Promise<(string | IMarkdownString)[] | undefined> { - const agent = this._agents.get(handle); - if (!agent) { - return; - } - - return await agent.provideWelcomeMessage(typeConvert.AideChatLocation.to(location), token); - } - - async $provideSampleQuestions(handle: number, location: AideChatAgentLocation, token: CancellationToken): Promise { - const agent = this._agents.get(handle); - if (!agent) { - return; - } - - return (await agent.provideSampleQuestions(typeConvert.AideChatLocation.to(location), token)) - .map(f => typeConvert.AideChatFollowup.from(f, undefined)); - } -} - -class ExtHostChatAgent { - - private _followupProvider: vscode.ChatFollowupProvider | undefined; - private _iconPath: vscode.Uri | { light: vscode.Uri; dark: vscode.Uri } | vscode.ThemeIcon | undefined; - private _isDefault: boolean | undefined; - private _helpTextPrefix: string | vscode.MarkdownString | undefined; - private _helpTextVariablesPrefix: string | vscode.MarkdownString | undefined; - private _helpTextPostfix: string | vscode.MarkdownString | undefined; - private _isSecondary: boolean | undefined; - private _onDidReceiveFeedback = new Emitter(); - private _onDidPerformAction = new Emitter(); - private _supportIssueReporting: boolean | undefined; - private _agentVariableProvider?: { provider: vscode.ChatParticipantCompletionItemProvider; triggerCharacters: string[] }; - private _welcomeMessageProvider?: vscode.AideChatWelcomeMessageProvider | undefined; - private _requester: vscode.ChatRequesterInformation | undefined; - private _supportsSlowReferences: boolean | undefined; - - constructor( - public readonly extension: IExtensionDescription, - private readonly quality: string | undefined, - public readonly id: string, - private readonly _proxy: MainThreadAideChatAgentsShape2, - private readonly _handle: number, - private _requestHandler: vscode.AideChatExtendedRequestHandler, - ) { } - - acceptFeedback(feedback: vscode.AideChatResultFeedback) { - this._onDidReceiveFeedback.fire(feedback); - } - - acceptAction(event: vscode.ChatUserActionEvent) { - this._onDidPerformAction.fire(event); - } - - async invokeCompletionProvider(query: string, token: CancellationToken): Promise { - if (!this._agentVariableProvider) { - return []; - } - - return await this._agentVariableProvider.provider.provideCompletionItems(query, token) ?? []; - } - - public isAgentEnabled() { - // If in stable and this extension doesn't have the right proposed API, then don't register the agent - return !(this.quality === 'stable' && !isProposedApiEnabled(this.extension, 'aideChatParticipant')); - } - - async provideFollowups(result: vscode.ChatResult, context: vscode.ChatContext, token: CancellationToken): Promise { - if (!this._followupProvider) { - return []; - } - - const followups = await this._followupProvider.provideFollowups(result, context, token); - if (!followups) { - return []; - } - return followups - // Filter out "command followups" from older providers - .filter(f => !(f && 'commandId' in f)) - // Filter out followups from older providers before 'message' changed to 'prompt' - .filter(f => !(f && 'message' in f)); - } - - async provideWelcomeMessage(location: vscode.AideChatLocation, token: CancellationToken): Promise<(string | IMarkdownString)[] | undefined> { - if (!this._welcomeMessageProvider) { - return []; - } - const content = await this._welcomeMessageProvider.provideWelcomeMessage(location, token); - if (!content) { - return []; - } - return content.map(item => { - if (typeof item === 'string') { - return item; - } else { - return typeConvert.MarkdownString.from(item); - } - }); - } - - async provideSampleQuestions(location: vscode.AideChatLocation, token: CancellationToken): Promise { - if (!this._welcomeMessageProvider || !this._welcomeMessageProvider.provideSampleQuestions) { - return []; - } - const content = await this._welcomeMessageProvider.provideSampleQuestions(location, token); - if (!content) { - return []; - } - - return content; - } - - get apiAgent(): vscode.AideChatParticipant { - let disposed = false; - let updateScheduled = false; - const updateMetadataSoon = () => { - if (disposed) { - return; - } - if (updateScheduled) { - return; - } - updateScheduled = true; - queueMicrotask(() => { - if (!that.isAgentEnabled()) { - return; - } - - this._proxy.$updateAgent(this._handle, { - icon: !this._iconPath ? undefined : - this._iconPath instanceof URI ? this._iconPath : - 'light' in this._iconPath ? this._iconPath.light : - undefined, - iconDark: !this._iconPath ? undefined : - 'dark' in this._iconPath ? this._iconPath.dark : - undefined, - themeIcon: this._iconPath instanceof extHostTypes.ThemeIcon || this._iconPath instanceof URI ? this._iconPath : undefined, - hasFollowups: this._followupProvider !== undefined, - isSecondary: this._isSecondary, - helpTextPrefix: (!this._helpTextPrefix || typeof this._helpTextPrefix === 'string') ? this._helpTextPrefix : typeConvert.MarkdownString.from(this._helpTextPrefix), - helpTextVariablesPrefix: (!this._helpTextVariablesPrefix || typeof this._helpTextVariablesPrefix === 'string') ? this._helpTextVariablesPrefix : typeConvert.MarkdownString.from(this._helpTextVariablesPrefix), - helpTextPostfix: (!this._helpTextPostfix || typeof this._helpTextPostfix === 'string') ? this._helpTextPostfix : typeConvert.MarkdownString.from(this._helpTextPostfix), - supportIssueReporting: this._supportIssueReporting, - requester: this._requester, - supportsSlowVariables: this._supportsSlowReferences, - }); - updateScheduled = false; - }); - }; - - const that = this; - return { - get id() { - return that.id; - }, - get iconPath() { - return that._iconPath; - }, - set iconPath(v) { - that._iconPath = v; - updateMetadataSoon(); - }, - get requestHandler() { - return that._requestHandler; - }, - set requestHandler(v) { - assertType(typeof v === 'function', 'Invalid request handler'); - that._requestHandler = v; - }, - get followupProvider() { - return that._followupProvider; - }, - set followupProvider(v) { - that._followupProvider = v; - updateMetadataSoon(); - }, - get isDefault() { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - return that._isDefault; - }, - set isDefault(v) { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - that._isDefault = v; - updateMetadataSoon(); - }, - get helpTextPrefix() { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - return that._helpTextPrefix; - }, - set helpTextPrefix(v) { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - that._helpTextPrefix = v; - updateMetadataSoon(); - }, - get helpTextVariablesPrefix() { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - return that._helpTextVariablesPrefix; - }, - set helpTextVariablesPrefix(v) { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - that._helpTextVariablesPrefix = v; - updateMetadataSoon(); - }, - get helpTextPostfix() { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - return that._helpTextPostfix; - }, - set helpTextPostfix(v) { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - that._helpTextPostfix = v; - updateMetadataSoon(); - }, - get isSecondary() { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - return that._isSecondary; - }, - set isSecondary(v) { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - that._isSecondary = v; - updateMetadataSoon(); - }, - get supportIssueReporting() { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - return that._supportIssueReporting; - }, - set supportIssueReporting(v) { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - that._supportIssueReporting = v; - updateMetadataSoon(); - }, - get onDidReceiveFeedback() { - return that._onDidReceiveFeedback.event; - }, - set participantVariableProvider(v) { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - that._agentVariableProvider = v; - if (v) { - if (!v.triggerCharacters.length) { - throw new Error('triggerCharacters are required'); - } - - that._proxy.$registerAgentCompletionsProvider(that._handle, that.id, v.triggerCharacters); - } else { - that._proxy.$unregisterAgentCompletionsProvider(that._handle, that.id); - } - }, - get participantVariableProvider() { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - return that._agentVariableProvider; - }, - set welcomeMessageProvider(v) { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - that._welcomeMessageProvider = v; - updateMetadataSoon(); - }, - get welcomeMessageProvider() { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - return that._welcomeMessageProvider; - }, - onDidPerformAction: !isProposedApiEnabled(this.extension, 'aideChatParticipant') - ? undefined! - : this._onDidPerformAction.event - , - set requester(v) { - that._requester = v; - updateMetadataSoon(); - }, - get requester() { - return that._requester; - }, - set supportsSlowReferences(v) { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - that._supportsSlowReferences = v; - updateMetadataSoon(); - }, - get supportsSlowReferences() { - checkProposedApiEnabled(that.extension, 'aideChatParticipant'); - return that._supportsSlowReferences; - }, - dispose() { - disposed = true; - that._followupProvider = undefined; - that._onDidReceiveFeedback.dispose(); - that._proxy.$unregisterAgent(that._handle); - }, - } satisfies vscode.AideChatParticipant; - } - - invoke(request: vscode.AideChatRequest, context: vscode.ChatContext, response: vscode.AideChatResponseStream, token: CancellationToken): vscode.ProviderResult { - return this._requestHandler(request, context, response, token); - } -} diff --git a/src/vs/workbench/api/common/extHostAideChatVariables.ts b/src/vs/workbench/api/common/extHostAideChatVariables.ts deleted file mode 100644 index 4dcd3026e4b..00000000000 --- a/src/vs/workbench/api/common/extHostAideChatVariables.ts +++ /dev/null @@ -1,130 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostAideChatVariablesShape, IChatVariableResolverProgressDto, IMainContext, MainContext, MainThreadAideChatVariablesShape } from 'vs/workbench/api/common/extHost.protocol'; -import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { IAideChatRequestVariableValue, IAideChatVariableData } from 'vs/workbench/contrib/aideChat/common/aideChatVariables'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import type * as vscode from 'vscode'; - -export class ExtHostAideChatVariables implements ExtHostAideChatVariablesShape { - - private static _idPool = 0; - - private readonly _resolver = new Map(); - private readonly _proxy: MainThreadAideChatVariablesShape; - - constructor(mainContext: IMainContext) { - this._proxy = mainContext.getProxy(MainContext.MainThreadAideChatVariables); - } - - async $resolveVariable(handle: number, requestId: string, messageText: string, token: CancellationToken): Promise { - const item = this._resolver.get(handle); - if (!item) { - return undefined; - } - try { - if (item.resolver.resolve2) { - checkProposedApiEnabled(item.extension, 'aideChatParticipant'); - const stream = new ChatVariableResolverResponseStream(requestId, this._proxy); - const value = await item.resolver.resolve2(item.data.name, { prompt: messageText }, stream.apiObject, token); - - // Temp, ignoring other returned values to convert the array into a single value - if (value && value[0]) { - return value[0].value; - } - } else { - const value = await item.resolver.resolve(item.data.name, { prompt: messageText }, token); - if (value && value[0]) { - return value[0].value; - } - } - } catch (err) { - onUnexpectedExternalError(err); - } - return undefined; - } - - registerVariableResolver(extension: IExtensionDescription, id: string, name: string, userDescription: string, modelDescription: string | undefined, isSlow: boolean | undefined, resolver: vscode.ChatVariableResolver, fullName?: string, themeIconId?: string): IDisposable { - const handle = ExtHostAideChatVariables._idPool++; - const icon = themeIconId ? ThemeIcon.fromId(themeIconId) : undefined; - this._resolver.set(handle, { extension, data: { id, name, description: userDescription, modelDescription, icon }, resolver: resolver }); - this._proxy.$registerVariable(handle, { id, name, description: userDescription, modelDescription, isSlow, fullName, icon }); - - return toDisposable(() => { - this._resolver.delete(handle); - this._proxy.$unregisterVariable(handle); - }); - } -} - -class ChatVariableResolverResponseStream { - - private _isClosed: boolean = false; - private _apiObject: vscode.ChatVariableResolverResponseStream | undefined; - - constructor( - private readonly _requestId: string, - private readonly _proxy: MainThreadAideChatVariablesShape, - ) { } - - close() { - this._isClosed = true; - } - - get apiObject() { - if (!this._apiObject) { - const that = this; - - function throwIfDone(source: Function | undefined) { - if (that._isClosed) { - const err = new Error('Response stream has been closed'); - Error.captureStackTrace(err, source); - throw err; - } - } - - const _report = (progress: IChatVariableResolverProgressDto) => { - this._proxy.$handleProgressChunk(this._requestId, progress); - }; - - this._apiObject = { - progress(value) { - throwIfDone(this.progress); - const part = new extHostTypes.ChatResponseProgressPart(value); - const dto = typeConvert.ChatResponseProgressPart.from(part); - _report(dto); - return this; - }, - reference(value) { - throwIfDone(this.reference); - const part = new extHostTypes.ChatResponseReferencePart(value); - const dto = typeConvert.AideChatResponseReferencePart.from(part); - _report(dto); - return this; - }, - push(part) { - throwIfDone(this.push); - - if (part instanceof extHostTypes.ChatResponseReferencePart) { - _report(typeConvert.AideChatResponseReferencePart.from(part)); - } else if (part instanceof extHostTypes.ChatResponseProgressPart) { - _report(typeConvert.AideChatResponseProgressPart.from(part)); - } - - return this; - } - }; - } - - return this._apiObject; - } -} diff --git a/src/vs/workbench/api/common/extHostAideProbeProvider.ts b/src/vs/workbench/api/common/extHostAideProbeProvider.ts index c3ce4d6d23a..91cb21b36a5 100644 --- a/src/vs/workbench/api/common/extHostAideProbeProvider.ts +++ b/src/vs/workbench/api/common/extHostAideProbeProvider.ts @@ -3,15 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { raceCancellation } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostAideProbeProviderShape, IMainContext, MainContext, MainThreadAideProbeProviderShape } from 'vs/workbench/api/common/extHost.protocol'; -import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { IAideProbeData, IAideProbeRequestModel, IAideProbeResponseErrorDetails, IAideProbeResult, IAideProbeSessionAction, IAideProbeUserAction } from 'vs/workbench/contrib/aideProbe/common/aideProbe'; import type * as vscode from 'vscode'; +import { raceCancellation } from '../../../base/common/async.js'; +import { Disposable, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { IAideProbeData, IAideProbeRequestModel, IAideProbeResponseErrorDetails, IAideProbeResult, IAideProbeSessionAction, IAideProbeUserAction } from '../../contrib/aideProbe/common/aideProbe.js'; +import { ExtHostAideProbeProviderShape, IMainContext, MainContext, MainThreadAideProbeProviderShape } from './extHost.protocol.js'; +import * as typeConvert from './extHostTypeConverters.js'; +import * as extHostTypes from './extHostTypes.js'; export class ExtHostAideProbeProvider extends Disposable implements ExtHostAideProbeProviderShape { private static _idPool = 0; @@ -26,7 +25,7 @@ export class ExtHostAideProbeProvider extends Disposable implements ExtHostAideP this._proxy = mainContext.getProxy(MainContext.MainThreadProbeProvider); } - async $initiateProbe(handle: number, request: IAideProbeRequestModel, token: CancellationToken): Promise { + async $initiateProbe(handle: number, request: IAideProbeRequestModel, token: vscode.CancellationToken): Promise { const provider = this._providers.get(handle); if (!provider) { return; @@ -57,9 +56,9 @@ export class ExtHostAideProbeProvider extends Disposable implements ExtHostAideP that._proxy.$handleProbingProgressChunk(request, dto); }, breakdown(value) { - const part = new extHostTypes.AideChatResponseBreakdownPart(value.reference.uri, value.reference.name, value.query, value.reason, value.response); - const dto = typeConvert.AideChatResponseBreakdownPart.from(part); - that._proxy.$handleProbingProgressChunk(request, dto); + // const part = new extHostTypes.ChatResponseMarkdownPart(value); + // const dto = typeConvert.AideChatResponseBreakdownPart.from(part); + // that._proxy.$handleProbingProgressChunk(request, dto); }, openFile(value) { const part = new extHostTypes.AideProbeOpenFilePart(value.uri); @@ -82,8 +81,8 @@ export class ExtHostAideProbeProvider extends Disposable implements ExtHostAideP that._proxy.$handleProbingProgressChunk(request, dto); }, markdown(value) { - const part = new extHostTypes.AideChatResponseMarkdownPart(value); - const dto = typeConvert.AideChatResponseMarkdownPart.from(part); + const part = new extHostTypes.ChatResponseMarkdownPart(value); + const dto = typeConvert.ChatResponseMarkdownPart.from(part); that._proxy.$handleProbingProgressChunk(request, dto); }, location(value) { diff --git a/src/vs/workbench/api/common/extHostApiCommands.ts b/src/vs/workbench/api/common/extHostApiCommands.ts index 5535cec0536..b43b330bfe2 100644 --- a/src/vs/workbench/api/common/extHostApiCommands.ts +++ b/src/vs/workbench/api/common/extHostApiCommands.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isFalsyOrEmpty } from 'vs/base/common/arrays'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Schemas, matchesSomeScheme } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { IPosition } from 'vs/editor/common/core/position'; -import { IRange } from 'vs/editor/common/core/range'; -import { ISelection } from 'vs/editor/common/core/selection'; -import * as languages from 'vs/editor/common/languages'; -import { decodeSemanticTokensDto } from 'vs/editor/common/services/semanticTokensDto'; -import { validateWhenClauses } from 'vs/platform/contextkey/common/contextkey'; -import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; -import { ICallHierarchyItemDto, IIncomingCallDto, IInlineValueContextDto, IOutgoingCallDto, IRawColorInfo, ITypeHierarchyItemDto, IWorkspaceEditDto } from 'vs/workbench/api/common/extHost.protocol'; -import { ApiCommand, ApiCommandArgument, ApiCommandResult, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { CustomCodeAction } from 'vs/workbench/api/common/extHostLanguageFeatures'; -import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import * as types from 'vs/workbench/api/common/extHostTypes'; -import { TransientCellMetadata, TransientDocumentMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import * as search from 'vs/workbench/contrib/search/common/search'; +import { isFalsyOrEmpty } from '../../../base/common/arrays.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Schemas, matchesSomeScheme } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import { IPosition } from '../../../editor/common/core/position.js'; +import { IRange } from '../../../editor/common/core/range.js'; +import { ISelection } from '../../../editor/common/core/selection.js'; +import * as languages from '../../../editor/common/languages.js'; +import { decodeSemanticTokensDto } from '../../../editor/common/services/semanticTokensDto.js'; +import { validateWhenClauses } from '../../../platform/contextkey/common/contextkey.js'; +import { ITextEditorOptions } from '../../../platform/editor/common/editor.js'; +import { ICallHierarchyItemDto, IIncomingCallDto, IInlineValueContextDto, IOutgoingCallDto, IRawColorInfo, ITypeHierarchyItemDto, IWorkspaceEditDto } from './extHost.protocol.js'; +import { ApiCommand, ApiCommandArgument, ApiCommandResult, ExtHostCommands } from './extHostCommands.js'; +import { CustomCodeAction } from './extHostLanguageFeatures.js'; +import * as typeConverters from './extHostTypeConverters.js'; +import * as types from './extHostTypes.js'; +import { TransientCellMetadata, TransientDocumentMetadata } from '../../contrib/notebook/common/notebookCommon.js'; +import * as search from '../../contrib/search/common/search.js'; import type * as vscode from 'vscode'; //#region --- NEW world @@ -88,32 +88,62 @@ const newCommands: ApiCommand[] = [ [ApiCommandArgument.Uri, ApiCommandArgument.Position], new ApiCommandResult<(languages.Location | languages.LocationLink)[], (types.Location | vscode.LocationLink)[] | undefined>('A promise that resolves to an array of Location or LocationLink instances.', mapLocationOrLocationLink) ), + new ApiCommand( + 'vscode.experimental.executeDefinitionProvider_recursive', '_executeDefinitionProvider_recursive', 'Execute all definition providers.', + [ApiCommandArgument.Uri, ApiCommandArgument.Position], + new ApiCommandResult<(languages.Location | languages.LocationLink)[], (types.Location | vscode.LocationLink)[] | undefined>('A promise that resolves to an array of Location or LocationLink instances.', mapLocationOrLocationLink) + ), new ApiCommand( 'vscode.executeTypeDefinitionProvider', '_executeTypeDefinitionProvider', 'Execute all type definition providers.', [ApiCommandArgument.Uri, ApiCommandArgument.Position], new ApiCommandResult<(languages.Location | languages.LocationLink)[], (types.Location | vscode.LocationLink)[] | undefined>('A promise that resolves to an array of Location or LocationLink instances.', mapLocationOrLocationLink) ), + new ApiCommand( + 'vscode.experimental.executeTypeDefinitionProvider_recursive', '_executeTypeDefinitionProvider_recursive', 'Execute all type definition providers.', + [ApiCommandArgument.Uri, ApiCommandArgument.Position], + new ApiCommandResult<(languages.Location | languages.LocationLink)[], (types.Location | vscode.LocationLink)[] | undefined>('A promise that resolves to an array of Location or LocationLink instances.', mapLocationOrLocationLink) + ), new ApiCommand( 'vscode.executeDeclarationProvider', '_executeDeclarationProvider', 'Execute all declaration providers.', [ApiCommandArgument.Uri, ApiCommandArgument.Position], new ApiCommandResult<(languages.Location | languages.LocationLink)[], (types.Location | vscode.LocationLink)[] | undefined>('A promise that resolves to an array of Location or LocationLink instances.', mapLocationOrLocationLink) ), + new ApiCommand( + 'vscode.experimental.executeDeclarationProvider_recursive', '_executeDeclarationProvider_recursive', 'Execute all declaration providers.', + [ApiCommandArgument.Uri, ApiCommandArgument.Position], + new ApiCommandResult<(languages.Location | languages.LocationLink)[], (types.Location | vscode.LocationLink)[] | undefined>('A promise that resolves to an array of Location or LocationLink instances.', mapLocationOrLocationLink) + ), new ApiCommand( 'vscode.executeImplementationProvider', '_executeImplementationProvider', 'Execute all implementation providers.', [ApiCommandArgument.Uri, ApiCommandArgument.Position], new ApiCommandResult<(languages.Location | languages.LocationLink)[], (types.Location | vscode.LocationLink)[] | undefined>('A promise that resolves to an array of Location or LocationLink instances.', mapLocationOrLocationLink) ), + new ApiCommand( + 'vscode.experimental.executeImplementationProvider_recursive', '_executeImplementationProvider_recursive', 'Execute all implementation providers.', + [ApiCommandArgument.Uri, ApiCommandArgument.Position], + new ApiCommandResult<(languages.Location | languages.LocationLink)[], (types.Location | vscode.LocationLink)[] | undefined>('A promise that resolves to an array of Location or LocationLink instances.', mapLocationOrLocationLink) + ), new ApiCommand( 'vscode.executeReferenceProvider', '_executeReferenceProvider', 'Execute all reference providers.', [ApiCommandArgument.Uri, ApiCommandArgument.Position], new ApiCommandResult('A promise that resolves to an array of Location-instances.', tryMapWith(typeConverters.location.to)) ), + new ApiCommand( + 'vscode.experimental.executeReferenceProvider', '_executeReferenceProvider_recursive', 'Execute all reference providers.', + [ApiCommandArgument.Uri, ApiCommandArgument.Position], + new ApiCommandResult('A promise that resolves to an array of Location-instances.', tryMapWith(typeConverters.location.to)) + ), // -- hover new ApiCommand( 'vscode.executeHoverProvider', '_executeHoverProvider', 'Execute all hover providers.', [ApiCommandArgument.Uri, ApiCommandArgument.Position], new ApiCommandResult('A promise that resolves to an array of Hover-instances.', tryMapWith(typeConverters.Hover.to)) ), + new ApiCommand( + 'vscode.experimental.executeHoverProvider_recursive', '_executeHoverProvider_recursive', 'Execute all hover providers.', + [ApiCommandArgument.Uri, ApiCommandArgument.Position], + new ApiCommandResult('A promise that resolves to an array of Hover-instances.', tryMapWith(typeConverters.Hover.to)) + ), // -- selection range new ApiCommand( 'vscode.executeSelectionRangeProvider', '_executeSelectionRangeProvider', 'Execute selection range provider.', diff --git a/src/vs/workbench/api/common/extHostApiDeprecationService.ts b/src/vs/workbench/api/common/extHostApiDeprecationService.ts index 59841770307..9a72ce444c0 100644 --- a/src/vs/workbench/api/common/extHostApiDeprecationService.ts +++ b/src/vs/workbench/api/common/extHostApiDeprecationService.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import * as extHostProtocol from './extHost.protocol.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; export interface IExtHostApiDeprecationService { readonly _serviceBrand: undefined; diff --git a/src/vs/workbench/api/common/extHostAuthentication.ts b/src/vs/workbench/api/common/extHostAuthentication.ts index 5c75a1318ca..b05a7b4794e 100644 --- a/src/vs/workbench/api/common/extHostAuthentication.ts +++ b/src/vs/workbench/api/common/extHostAuthentication.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { Emitter, Event } from 'vs/base/common/event'; -import { MainContext, MainThreadAuthenticationShape, ExtHostAuthenticationShape } from 'vs/workbench/api/common/extHost.protocol'; -import { Disposable } from 'vs/workbench/api/common/extHostTypes'; -import { IExtensionDescription, ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { INTERNAL_AUTH_PROVIDER_PREFIX } from 'vs/workbench/services/authentication/common/authentication'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { MainContext, MainThreadAuthenticationShape, ExtHostAuthenticationShape } from './extHost.protocol.js'; +import { Disposable } from './extHostTypes.js'; +import { IExtensionDescription, ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { INTERNAL_AUTH_PROVIDER_PREFIX } from '../../services/authentication/common/authentication.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; export interface IExtHostAuthentication extends ExtHostAuthentication { } export const IExtHostAuthentication = createDecorator('IExtHostAuthentication'); @@ -32,7 +32,6 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape { readonly onDidChangeSessions: Event = this._onDidChangeSessions.event; private _getSessionTaskSingler = new TaskSingler(); - private _getSessionsTaskSingler = new TaskSingler>(); constructor( @IExtHostRpcService extHostRpc: IExtHostRpcService @@ -54,16 +53,6 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape { }); } - async getSessions(requestingExtension: IExtensionDescription, providerId: string, scopes: readonly string[]): Promise> { - const extensionId = ExtensionIdentifier.toKey(requestingExtension.identifier); - const sortedScopes = [...scopes].sort().join(' '); - return await this._getSessionsTaskSingler.getOrCreate(`${extensionId} ${sortedScopes}`, async () => { - await this._proxy.$ensureProvider(providerId); - const extensionName = requestingExtension.displayName || requestingExtension.name; - return this._proxy.$getSessions(providerId, scopes, extensionId, extensionName); - }); - } - async getAccounts(providerId: string) { await this._proxy.$ensureProvider(providerId); return await this._proxy.$getAccounts(providerId); diff --git a/src/vs/workbench/api/common/extHostBulkEdits.ts b/src/vs/workbench/api/common/extHostBulkEdits.ts index 281a003c40c..a1284739dc1 100644 --- a/src/vs/workbench/api/common/extHostBulkEdits.ts +++ b/src/vs/workbench/api/common/extHostBulkEdits.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { MainContext, MainThreadBulkEditsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { WorkspaceEdit } from 'vs/workbench/api/common/extHostTypeConverters'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { MainContext, MainThreadBulkEditsShape } from './extHost.protocol.js'; +import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { WorkspaceEdit } from './extHostTypeConverters.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; import type * as vscode from 'vscode'; export class ExtHostBulkEdits { diff --git a/src/vs/workbench/api/common/extHostCSAuthentication.ts b/src/vs/workbench/api/common/extHostCSAuthentication.ts index 018307e2969..362fd4b0f01 100644 --- a/src/vs/workbench/api/common/extHostCSAuthentication.ts +++ b/src/vs/workbench/api/common/extHostCSAuthentication.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ExtHostCSAuthenticationShape, MainContext, MainThreadCSAuthenticationShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; import type * as vscode from 'vscode'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ExtHostCSAuthenticationShape, MainContext, MainThreadCSAuthenticationShape } from './extHost.protocol.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; export interface IExtHostCSAuthentication extends ExtHostCSAuthentication { } export const IExtHostCSAuthentication = createDecorator('IExtHostCSAuthentication'); diff --git a/src/vs/workbench/api/common/extHostCSEvents.ts b/src/vs/workbench/api/common/extHostCSEvents.ts index eaf09ca578b..8a699652663 100644 --- a/src/vs/workbench/api/common/extHostCSEvents.ts +++ b/src/vs/workbench/api/common/extHostCSEvents.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SymbolNavigationEvent } from 'vs/editor/common/model/csEvents'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import * as TypeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import { Disposable } from 'vs/workbench/api/common/extHostTypes'; import type { CSEventHandler, SymbolNavigationEvent as ExtSymbolNavigationEvent } from 'vscode'; -import { ExtHostCSEventsShape, IMainContext, MainContext, MainThreadCSEventsShape } from './extHost.protocol'; +import { SymbolNavigationEvent } from '../../../editor/common/model/csEvents.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostCSEventsShape, IMainContext, MainContext, MainThreadCSEventsShape } from './extHost.protocol.js'; +import * as TypeConverters from './extHostTypeConverters.js'; +import { Disposable } from './extHostTypes.js'; export class ExtHostCSEvents implements ExtHostCSEventsShape { private readonly _proxy: MainThreadCSEventsShape; diff --git a/src/vs/workbench/api/common/extHostChatAgents2.ts b/src/vs/workbench/api/common/extHostChatAgents2.ts index 37a81b0034d..7ed66111655 100644 --- a/src/vs/workbench/api/common/extHostChatAgents2.ts +++ b/src/vs/workbench/api/common/extHostChatAgents2.ts @@ -3,28 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce } from 'vs/base/common/arrays'; -import { raceCancellation } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { Emitter } from 'vs/base/common/event'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { Iterable } from 'vs/base/common/iterator'; -import { Disposable, DisposableMap, DisposableStore } from 'vs/base/common/lifecycle'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { assertType } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { Location } from 'vs/editor/common/languages'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostChatAgentsShape2, IChatAgentCompletionItem, IChatAgentHistoryEntryDto, IChatProgressDto, IExtensionChatAgentMetadata, IMainContext, MainContext, MainThreadChatAgentsShape2 } from 'vs/workbench/api/common/extHost.protocol'; -import { CommandsConverter, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { ChatAgentLocation, IChatAgentRequest, IChatAgentResult } from 'vs/workbench/contrib/chat/common/chatAgents'; -import { ChatAgentVoteDirection, IChatContentReference, IChatFollowup, IChatResponseErrorDetails, IChatUserActionEvent } from 'vs/workbench/contrib/chat/common/chatService'; -import { checkProposedApiEnabled, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import { Dto } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { coalesce } from '../../../base/common/arrays.js'; +import { raceCancellation } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { Emitter } from '../../../base/common/event.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { Iterable } from '../../../base/common/iterator.js'; +import { Disposable, DisposableMap, DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { assertType } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { Location } from '../../../editor/common/languages.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ExtHostChatAgentsShape2, IChatAgentCompletionItem, IChatAgentHistoryEntryDto, IChatProgressDto, IExtensionChatAgentMetadata, IMainContext, MainContext, MainThreadChatAgentsShape2 } from './extHost.protocol.js'; +import { CommandsConverter, ExtHostCommands } from './extHostCommands.js'; +import { ExtHostDocuments } from './extHostDocuments.js'; +import * as typeConvert from './extHostTypeConverters.js'; +import * as extHostTypes from './extHostTypes.js'; +import { ChatAgentLocation, IChatAgentRequest, IChatAgentResult, IChatAgentResultTimings } from '../../contrib/chat/common/chatAgents.js'; +import { ChatAgentVoteDirection, IChatContentReference, IChatFollowup, IChatResponseErrorDetails, IChatUserActionEvent, IChatVoteAction } from '../../contrib/chat/common/chatService.js'; +import { checkProposedApiEnabled, isProposedApiEnabled } from '../../services/extensions/common/extensions.js'; +import { Dto } from '../../services/extensions/common/proxyIdentifier.js'; import type * as vscode from 'vscode'; class ChatAgentResponseStream { @@ -46,7 +48,7 @@ class ChatAgentResponseStream { this._isClosed = true; } - get timings() { + get timings(): IChatAgentResultTimings { return { firstProgress: this._firstProgress, totalElapsed: this._stopWatch.elapsed() @@ -70,7 +72,7 @@ class ChatAgentResponseStream { const _report = (progress: IChatProgressDto, task?: (progress: vscode.Progress) => Thenable) => { // Measure the time to the first progress update with real markdown content - if (typeof this._firstProgress === 'undefined' && 'content' in progress) { + if (typeof this._firstProgress === 'undefined' && (progress.kind === 'markdownContent' || progress.kind === 'markdownVuln')) { this._firstProgress = this._stopWatch.elapsed(); } @@ -91,7 +93,7 @@ class ChatAgentResponseStream { }; Promise.all([progressReporterPromise, task?.(progressReporter)]).then(([handle, res]) => { - if (handle !== undefined && res !== undefined) { + if (handle !== undefined) { this._proxy.$handleProgressChunk(this._request.requestId, typeConvert.ChatTaskResult.from(res), handle); } }); @@ -119,6 +121,14 @@ class ChatAgentResponseStream { _report(dto); return this; }, + codeblockUri(value) { + throwIfDone(this.codeblockUri); + checkProposedApiEnabled(that._extension, 'chatParticipantAdditions'); + const part = new extHostTypes.ChatResponseCodeblockUriPart(value); + const dto = typeConvert.ChatResponseCodeblockUriPart.from(part); + _report(dto); + return this; + }, filetree(value, baseUri) { throwIfDone(this.filetree); const part = new extHostTypes.ChatResponseFileTreePart(value, baseUri); @@ -156,13 +166,16 @@ class ChatAgentResponseStream { return this; }, reference(value, iconPath) { + return this.reference2(value, iconPath); + }, + reference2(value, iconPath, options) { throwIfDone(this.reference); - if ('variableName' in value) { + if (typeof value === 'object' && 'variableName' in value) { checkProposedApiEnabled(that._extension, 'chatParticipantAdditions'); } - if ('variableName' in value && !value.value) { + if (typeof value === 'object' && 'variableName' in value && !value.value) { // The participant used this variable. Does that variable have any references to pull in? const matchingVarData = that._request.variables.variables.find(v => v.name === value.variableName); if (matchingVarData) { @@ -174,7 +187,7 @@ class ChatAgentResponseStream { } satisfies IChatContentReference)); } else { // Participant sent a variableName reference but the variable produced no references. Show variable reference with no value - const part = new extHostTypes.ChatResponseReferencePart(value, iconPath); + const part = new extHostTypes.ChatResponseReferencePart(value, iconPath, options); const dto = typeConvert.ChatResponseReferencePart.from(part); references = [dto]; } @@ -185,13 +198,21 @@ class ChatAgentResponseStream { // Something went wrong- that variable doesn't actually exist } } else { - const part = new extHostTypes.ChatResponseReferencePart(value, iconPath); + const part = new extHostTypes.ChatResponseReferencePart(value, iconPath, options); const dto = typeConvert.ChatResponseReferencePart.from(part); _report(dto); } return this; }, + codeCitation(value: vscode.Uri, license: string, snippet: string): void { + throwIfDone(this.codeCitation); + checkProposedApiEnabled(that._extension, 'chatParticipantAdditions'); + + const part = new extHostTypes.ChatResponseCodeCitationPart(value, license, snippet); + const dto = typeConvert.ChatResponseCodeCitationPart.from(part); + _report(dto); + }, textEdit(target, edits) { throwIfDone(this.textEdit); checkProposedApiEnabled(that._extension, 'chatParticipantAdditions'); @@ -210,11 +231,11 @@ class ChatAgentResponseStream { _report(dto); return this; }, - confirmation(title, message, data) { + confirmation(title, message, data, buttons) { throwIfDone(this.confirmation); checkProposedApiEnabled(that._extension, 'chatParticipantAdditions'); - const part = new extHostTypes.ChatResponseConfirmationPart(title, message, data); + const part = new extHostTypes.ChatResponseConfirmationPart(title, message, data, buttons); const dto = typeConvert.ChatResponseConfirmationPart.from(part); _report(dto); return this; @@ -227,14 +248,16 @@ class ChatAgentResponseStream { part instanceof extHostTypes.ChatResponseMarkdownWithVulnerabilitiesPart || part instanceof extHostTypes.ChatResponseDetectedParticipantPart || part instanceof extHostTypes.ChatResponseWarningPart || - part instanceof extHostTypes.ChatResponseConfirmationPart + part instanceof extHostTypes.ChatResponseConfirmationPart || + part instanceof extHostTypes.ChatResponseCodeCitationPart || + part instanceof extHostTypes.ChatResponseMovePart ) { checkProposedApiEnabled(that._extension, 'chatParticipantAdditions'); } if (part instanceof extHostTypes.ChatResponseReferencePart) { // Ensure variable reference values get fixed up - this.reference(part.value, part.iconPath); + this.reference2(part.value, part.iconPath, part.options); } else { const dto = typeConvert.ChatResponsePart.from(part, that._commandsConverter, that._sessionDisposables); _report(dto); @@ -256,13 +279,17 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS private readonly _agents = new Map(); private readonly _proxy: MainThreadChatAgentsShape2; + private static _participantDetectionProviderIdPool = 0; + private readonly _participantDetectionProviders = new Map(); + private readonly _sessionDisposables: DisposableMap = this._register(new DisposableMap()); private readonly _completionDisposables: DisposableMap = this._register(new DisposableMap()); constructor( mainContext: IMainContext, private readonly _logService: ILogService, - private readonly commands: ExtHostCommands, + private readonly _commands: ExtHostCommands, + private readonly _documents: ExtHostDocuments ) { super(); this._proxy = mainContext.getProxy(MainContext.MainThreadChatAgents2); @@ -290,25 +317,81 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS return agent.apiAgent; } - async $invokeAgent(handle: number, request: IChatAgentRequest, context: { history: IChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise { + registerChatParticipantDetectionProvider(provider: vscode.ChatParticipantDetectionProvider): vscode.Disposable { + const handle = ExtHostChatAgents2._participantDetectionProviderIdPool++; + this._participantDetectionProviders.set(handle, provider); + this._proxy.$registerChatParticipantDetectionProvider(handle); + return toDisposable(() => { + this._participantDetectionProviders.delete(handle); + this._proxy.$unregisterChatParticipantDetectionProvider(handle); + }); + } + + async $detectChatParticipant(handle: number, requestDto: Dto, context: { history: IChatAgentHistoryEntryDto[] }, options: { location: ChatAgentLocation; participants?: vscode.ChatParticipantMetadata[] }, token: CancellationToken): Promise { + const { request, location, history } = await this._createRequest(requestDto, context); + + const provider = this._participantDetectionProviders.get(handle); + if (!provider) { + return undefined; + } + + return provider.provideParticipantDetection( + typeConvert.ChatAgentRequest.to(request, location), + { history }, + { participants: options.participants, location: typeConvert.ChatLocation.to(options.location) }, + token + ); + } + + private async _createRequest(requestDto: Dto, context: { history: IChatAgentHistoryEntryDto[] }) { + const request = revive(requestDto); + const convertedHistory = await this.prepareHistoryTurns(request.agentId, context); + + // in-place converting for location-data + let location: vscode.ChatRequestEditorData | vscode.ChatRequestNotebookData | undefined; + if (request.locationData?.type === ChatAgentLocation.Editor) { + // editor data + const document = this._documents.getDocument(request.locationData.document); + location = new extHostTypes.ChatRequestEditorData(document, typeConvert.Selection.to(request.locationData.selection), typeConvert.Range.to(request.locationData.wholeRange)); + + } else if (request.locationData?.type === ChatAgentLocation.Notebook) { + // notebook data + const cell = this._documents.getDocument(request.locationData.sessionInputUri); + location = new extHostTypes.ChatRequestNotebookData(cell); + + } else if (request.locationData?.type === ChatAgentLocation.Terminal) { + // TBD + } + + return { request, location, history: convertedHistory }; + } + + async $invokeAgent(handle: number, requestDto: Dto, context: { history: IChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise { const agent = this._agents.get(handle); if (!agent) { throw new Error(`[CHAT](${handle}) CANNOT invoke agent because the agent is not registered`); } - // Init session disposables - let sessionDisposables = this._sessionDisposables.get(request.sessionId); - if (!sessionDisposables) { - sessionDisposables = new DisposableStore(); - this._sessionDisposables.set(request.sessionId, sessionDisposables); - } + let stream: ChatAgentResponseStream | undefined; - const stream = new ChatAgentResponseStream(agent.extension, request, this._proxy, this.commands.converter, sessionDisposables); try { - const convertedHistory = await this.prepareHistoryTurns(request.agentId, context); + const { request, location, history } = await this._createRequest(requestDto, context); + if (!isProposedApiEnabled(agent.extension, 'chatParticipantAdditions')) { + delete request.userSelectedModelId; + } + + // Init session disposables + let sessionDisposables = this._sessionDisposables.get(request.sessionId); + if (!sessionDisposables) { + sessionDisposables = new DisposableStore(); + this._sessionDisposables.set(request.sessionId, sessionDisposables); + } + + stream = new ChatAgentResponseStream(agent.extension, request, this._proxy, this._commands.converter, sessionDisposables); + const task = agent.invoke( - typeConvert.ChatAgentRequest.to(request), - { history: convertedHistory }, + typeConvert.ChatAgentRequest.to(request, location), + { history }, stream.apiObject, token ); @@ -320,7 +403,7 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS } catch (err) { const msg = `result.metadata MUST be JSON.stringify-able. Got error: ${err.message}`; this._logService.error(`[${agent.extension.identifier.value}] [@${agent.id}] ${msg}`, agent.extension); - return { errorDetails: { message: msg }, timings: stream.timings }; + return { errorDetails: { message: msg }, timings: stream?.timings, nextQuestion: result.nextQuestion }; } } let errorDetails: IChatResponseErrorDetails | undefined; @@ -334,7 +417,7 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS checkProposedApiEnabled(agent.extension, 'chatParticipantPrivate'); } - return { errorDetails, timings: stream.timings, metadata: result?.metadata } satisfies IChatAgentResult; + return { errorDetails, timings: stream?.timings, metadata: result?.metadata, nextQuestion: result?.nextQuestion } satisfies IChatAgentResult; }), token); } catch (e) { this._logService.error(e, agent.extension); @@ -346,12 +429,11 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS return { errorDetails: { message: toErrorMessage(e), responseIsIncomplete: true } }; } finally { - stream.close(); + stream?.close(); } } private async prepareHistoryTurns(agentId: string, context: { history: IChatAgentHistoryEntryDto[] }): Promise<(vscode.ChatRequestTurn | vscode.ChatResponseTurn)[]> { - const res: (vscode.ChatRequestTurn | vscode.ChatResponseTurn)[] = []; for (const h of context.history) { @@ -361,10 +443,18 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS { ...ehResult, metadata: undefined }; // REQUEST turn - res.push(new extHostTypes.ChatRequestTurn(h.request.message, h.request.command, h.request.variables.variables.map(typeConvert.ChatAgentValueReference.to), h.request.agentId)); + const varsWithoutTools = h.request.variables.variables + .filter(v => !v.isTool) + .map(typeConvert.ChatPromptReference.to); + const toolReferences = h.request.variables.variables + .filter(v => v.isTool) + .map(typeConvert.ChatLanguageModelToolReference.to); + const turn = new extHostTypes.ChatRequestTurn(h.request.message, h.request.command, varsWithoutTools, h.request.agentId); + turn.toolReferences = toolReferences; + res.push(turn); // RESPONSE turn - const parts = coalesce(h.response.map(r => typeConvert.ChatResponsePart.toContent(r, this.commands.converter))); + const parts = coalesce(h.response.map(r => typeConvert.ChatResponsePart.toContent(r, this._commands.converter))); res.push(new extHostTypes.ChatResponseTurn(parts, result, h.request.agentId, h.request.command)); } @@ -375,12 +465,13 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS this._sessionDisposables.deleteAndDispose(sessionId); } - async $provideFollowups(request: IChatAgentRequest, handle: number, result: IChatAgentResult, context: { history: IChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise { + async $provideFollowups(requestDto: Dto, handle: number, result: IChatAgentResult, context: { history: IChatAgentHistoryEntryDto[] }, token: CancellationToken): Promise { const agent = this._agents.get(handle); if (!agent) { return Promise.resolve([]); } + const request = revive(requestDto); const convertedHistory = await this.prepareHistoryTurns(agent.id, context); const ehResult = typeConvert.ChatAgentResult.to(result); @@ -398,7 +489,7 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS .map(f => typeConvert.ChatFollowup.from(f, request)); } - $acceptFeedback(handle: number, result: IChatAgentResult, vote: ChatAgentVoteDirection, reportIssue?: boolean): void { + $acceptFeedback(handle: number, result: IChatAgentResult, voteAction: IChatVoteAction): void { const agent = this._agents.get(handle); if (!agent) { return; @@ -406,7 +497,7 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS const ehResult = typeConvert.ChatAgentResult.to(result); let kind: extHostTypes.ChatResultFeedbackKind; - switch (vote) { + switch (voteAction.direction) { case ChatAgentVoteDirection.Down: kind = extHostTypes.ChatResultFeedbackKind.Unhelpful; break; @@ -414,9 +505,13 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS kind = extHostTypes.ChatResultFeedbackKind.Helpful; break; } - agent.acceptFeedback(reportIssue ? - Object.freeze({ result: ehResult, kind, reportIssue }) : - Object.freeze({ result: ehResult, kind })); + + const feedback: vscode.ChatResultFeedback = { + result: ehResult, + kind, + unhelpfulReason: isProposedApiEnabled(agent.extension, 'chatParticipantAdditions') ? voteAction.reason : undefined, + }; + agent.acceptFeedback(Object.freeze(feedback)); } $acceptAction(handle: number, result: IChatAgentResult, event: IChatUserActionEvent): void { @@ -429,7 +524,7 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS return; } - const ehAction = typeConvert.ChatAgentUserActionEvent.to(result, event, this.commands.converter); + const ehAction = typeConvert.ChatAgentUserActionEvent.to(result, event, this._commands.converter); if (ehAction) { agent.acceptAction(Object.freeze(ehAction)); } @@ -452,7 +547,7 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS const items = await agent.invokeCompletionProvider(query, token); - return items.map((i) => typeConvert.ChatAgentCompletionItem.from(i, this.commands.converter, disposables)); + return items.map((i) => typeConvert.ChatAgentCompletionItem.from(i, this._commands.converter, disposables)); } async $provideWelcomeMessage(handle: number, location: ChatAgentLocation, token: CancellationToken): Promise<(string | IMarkdownString)[] | undefined> { @@ -464,6 +559,16 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS return await agent.provideWelcomeMessage(typeConvert.ChatLocation.to(location), token); } + async $provideChatTitle(handle: number, context: IChatAgentHistoryEntryDto[], token: CancellationToken): Promise { + const agent = this._agents.get(handle); + if (!agent) { + return; + } + + const history = await this.prepareHistoryTurns(agent.id, { history: context }); + return await agent.provideTitle({ history }, token); + } + async $provideSampleQuestions(handle: number, location: ChatAgentLocation, token: CancellationToken): Promise { const agent = this._agents.get(handle); if (!agent) { @@ -479,7 +584,6 @@ class ExtHostChatAgent { private _followupProvider: vscode.ChatFollowupProvider | undefined; private _iconPath: vscode.Uri | { light: vscode.Uri; dark: vscode.Uri } | vscode.ThemeIcon | undefined; - private _isDefault: boolean | undefined; private _helpTextPrefix: string | vscode.MarkdownString | undefined; private _helpTextVariablesPrefix: string | vscode.MarkdownString | undefined; private _helpTextPostfix: string | vscode.MarkdownString | undefined; @@ -489,6 +593,7 @@ class ExtHostChatAgent { private _supportIssueReporting: boolean | undefined; private _agentVariableProvider?: { provider: vscode.ChatParticipantCompletionItemProvider; triggerCharacters: string[] }; private _welcomeMessageProvider?: vscode.ChatWelcomeMessageProvider | undefined; + private _titleProvider?: vscode.ChatTitleProvider | undefined; private _requester: vscode.ChatRequesterInformation | undefined; private _supportsSlowReferences: boolean | undefined; @@ -549,6 +654,14 @@ class ExtHostChatAgent { }); } + async provideTitle(context: vscode.ChatContext, token: CancellationToken): Promise { + if (!this._titleProvider) { + return; + } + + return await this._titleProvider.provideChatTitle(context, token) ?? undefined; + } + async provideSampleQuestions(location: vscode.ChatLocation, token: CancellationToken): Promise { if (!this._welcomeMessageProvider || !this._welcomeMessageProvider.provideSampleQuestions) { return []; @@ -621,15 +734,6 @@ class ExtHostChatAgent { that._followupProvider = v; updateMetadataSoon(); }, - get isDefault() { - checkProposedApiEnabled(that.extension, 'defaultChatParticipant'); - return that._isDefault; - }, - set isDefault(v) { - checkProposedApiEnabled(that.extension, 'defaultChatParticipant'); - that._isDefault = v; - updateMetadataSoon(); - }, get helpTextPrefix() { checkProposedApiEnabled(that.extension, 'defaultChatParticipant'); return that._helpTextPrefix; @@ -704,6 +808,15 @@ class ExtHostChatAgent { checkProposedApiEnabled(that.extension, 'defaultChatParticipant'); return that._welcomeMessageProvider; }, + set titleProvider(v) { + checkProposedApiEnabled(that.extension, 'defaultChatParticipant'); + that._titleProvider = v; + updateMetadataSoon(); + }, + get titleProvider() { + checkProposedApiEnabled(that.extension, 'defaultChatParticipant'); + return that._titleProvider; + }, onDidPerformAction: !isProposedApiEnabled(this.extension, 'chatParticipantAdditions') ? undefined! : this._onDidPerformAction.event diff --git a/src/vs/workbench/api/common/extHostChatVariables.ts b/src/vs/workbench/api/common/extHostChatVariables.ts index dfc37201bd4..ce8d4eb6d61 100644 --- a/src/vs/workbench/api/common/extHostChatVariables.ts +++ b/src/vs/workbench/api/common/extHostChatVariables.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostChatVariablesShape, IChatVariableResolverProgressDto, IMainContext, MainContext, MainThreadChatVariablesShape } from 'vs/workbench/api/common/extHost.protocol'; -import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { IChatRequestVariableValue, IChatVariableData } from 'vs/workbench/contrib/chat/common/chatVariables'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { onUnexpectedExternalError } from '../../../base/common/errors.js'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostChatVariablesShape, IChatVariableResolverProgressDto, IMainContext, MainContext, MainThreadChatVariablesShape } from './extHost.protocol.js'; +import * as typeConvert from './extHostTypeConverters.js'; +import * as extHostTypes from './extHostTypes.js'; +import { IChatRequestVariableValue, IChatVariableData } from '../../contrib/chat/common/chatVariables.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; import type * as vscode from 'vscode'; export class ExtHostChatVariables implements ExtHostChatVariablesShape { diff --git a/src/vs/workbench/api/common/extHostClipboard.ts b/src/vs/workbench/api/common/extHostClipboard.ts index f8665dacbed..2907f47050e 100644 --- a/src/vs/workbench/api/common/extHostClipboard.ts +++ b/src/vs/workbench/api/common/extHostClipboard.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IMainContext, MainContext } from 'vs/workbench/api/common/extHost.protocol'; +import { IMainContext, MainContext } from './extHost.protocol.js'; import type * as vscode from 'vscode'; export class ExtHostClipboard { diff --git a/src/vs/workbench/api/common/extHostCodeInsets.ts b/src/vs/workbench/api/common/extHostCodeInsets.ts index bf6758e93ae..01cc0023b1d 100644 --- a/src/vs/workbench/api/common/extHostCodeInsets.ts +++ b/src/vs/workbench/api/common/extHostCodeInsets.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostTextEditor } from 'vs/workbench/api/common/extHostTextEditor'; -import { ExtHostEditors } from 'vs/workbench/api/common/extHostTextEditors'; -import { asWebviewUri, webviewGenericCspSource, WebviewRemoteInfo } from 'vs/workbench/contrib/webview/common/webview'; +import { Emitter } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostTextEditor } from './extHostTextEditor.js'; +import { ExtHostEditors } from './extHostTextEditors.js'; +import { asWebviewUri, webviewGenericCspSource, WebviewRemoteInfo } from '../../contrib/webview/common/webview.js'; import type * as vscode from 'vscode'; -import { ExtHostEditorInsetsShape, MainThreadEditorInsetsShape } from './extHost.protocol'; +import { ExtHostEditorInsetsShape, MainThreadEditorInsetsShape } from './extHost.protocol.js'; export class ExtHostEditorInsets implements ExtHostEditorInsetsShape { diff --git a/src/vs/workbench/api/common/extHostCodeMapper.ts b/src/vs/workbench/api/common/extHostCodeMapper.ts new file mode 100644 index 00000000000..055d52b3d4b --- /dev/null +++ b/src/vs/workbench/api/common/extHostCodeMapper.ts @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type * as vscode from 'vscode'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ICodeMapperResult } from '../../contrib/chat/common/chatCodeMapperService.js'; +import * as extHostProtocol from './extHost.protocol.js'; +import { TextEdit } from './extHostTypeConverters.js'; +import { URI } from '../../../base/common/uri.js'; + +export class ExtHostCodeMapper implements extHostProtocol.ExtHostCodeMapperShape { + + private static _providerHandlePool: number = 0; + private readonly _proxy: extHostProtocol.MainThreadCodeMapperShape; + private readonly providers = new Map(); + + constructor( + mainContext: extHostProtocol.IMainContext + ) { + this._proxy = mainContext.getProxy(extHostProtocol.MainContext.MainThreadCodeMapper); + } + + async $mapCode(handle: number, internalRequest: extHostProtocol.ICodeMapperRequestDto, token: CancellationToken): Promise { + // Received request to map code from the main thread + const provider = this.providers.get(handle); + if (!provider) { + throw new Error(`Received request to map code for unknown provider handle ${handle}`); + } + + // Construct a response object to pass to the provider + const stream: vscode.MappedEditsResponseStream = { + textEdit: (target: vscode.Uri, edits: vscode.TextEdit | vscode.TextEdit[]) => { + edits = (Array.isArray(edits) ? edits : [edits]); + this._proxy.$handleProgress(internalRequest.requestId, { + uri: target, + edits: edits.map(TextEdit.from) + }); + } + }; + + const request: vscode.MappedEditsRequest = { + codeBlocks: internalRequest.codeBlocks.map(block => { + return { + code: block.code, + resource: URI.revive(block.resource) + }; + }), + conversation: internalRequest.conversation + }; + + const result = await provider.provideMappedEdits(request, stream, token); + return result ?? null; + } + + registerMappedEditsProvider(extension: IExtensionDescription, provider: vscode.MappedEditsProvider2): vscode.Disposable { + const handle = ExtHostCodeMapper._providerHandlePool++; + this._proxy.$registerCodeMapperProvider(handle); + this.providers.set(handle, provider); + return { + dispose: () => { + return this._proxy.$unregisterCodeMapperProvider(handle); + } + }; + } +} diff --git a/src/vs/workbench/api/common/extHostCommands.ts b/src/vs/workbench/api/common/extHostCommands.ts index 15730c390b9..c40a1942e36 100644 --- a/src/vs/workbench/api/common/extHostCommands.ts +++ b/src/vs/workbench/api/common/extHostCommands.ts @@ -5,33 +5,33 @@ /* eslint-disable local/code-no-native-private */ -import { validateConstraint } from 'vs/base/common/types'; -import { ICommandMetadata } from 'vs/platform/commands/common/commands'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import * as extHostTypeConverter from 'vs/workbench/api/common/extHostTypeConverters'; -import { cloneAndChange } from 'vs/base/common/objects'; -import { MainContext, MainThreadCommandsShape, ExtHostCommandsShape, ICommandDto, ICommandMetadataDto, MainThreadTelemetryShape } from './extHost.protocol'; -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import * as languages from 'vs/editor/common/languages'; +import { validateConstraint } from '../../../base/common/types.js'; +import { ICommandMetadata } from '../../../platform/commands/common/commands.js'; +import * as extHostTypes from './extHostTypes.js'; +import * as extHostTypeConverter from './extHostTypeConverters.js'; +import { cloneAndChange } from '../../../base/common/objects.js'; +import { MainContext, MainThreadCommandsShape, ExtHostCommandsShape, ICommandDto, ICommandMetadataDto, MainThreadTelemetryShape } from './extHost.protocol.js'; +import { isNonEmptyArray } from '../../../base/common/arrays.js'; +import * as languages from '../../../editor/common/languages.js'; import type * as vscode from 'vscode'; -import { ILogService } from 'vs/platform/log/common/log'; -import { revive } from 'vs/base/common/marshalling'; -import { IRange, Range } from 'vs/editor/common/core/range'; -import { IPosition, Position } from 'vs/editor/common/core/position'; -import { URI } from 'vs/base/common/uri'; -import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ISelection } from 'vs/editor/common/core/selection'; -import { TestItemImpl } from 'vs/workbench/api/common/extHostTestItem'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { TelemetryTrustedValue } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import { generateUuid } from 'vs/base/common/uuid'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { IRange, Range } from '../../../editor/common/core/range.js'; +import { IPosition, Position } from '../../../editor/common/core/position.js'; +import { URI } from '../../../base/common/uri.js'; +import { DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { ISelection } from '../../../editor/common/core/selection.js'; +import { TestItemImpl } from './extHostTestItem.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { TelemetryTrustedValue } from '../../../platform/telemetry/common/telemetryUtils.js'; +import { IExtHostTelemetry } from './extHostTelemetry.js'; +import { generateUuid } from '../../../base/common/uuid.js'; interface CommandHandler { callback: Function; diff --git a/src/vs/workbench/api/common/extHostComments.ts b/src/vs/workbench/api/common/extHostComments.ts index 53b5176c25b..70bd44d3001 100644 --- a/src/vs/workbench/api/common/extHostComments.ts +++ b/src/vs/workbench/api/common/extHostComments.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { asPromise } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { debounce } from 'vs/base/common/decorators'; -import { Emitter } from 'vs/base/common/event'; -import { DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle'; -import { MarshalledId } from 'vs/base/common/marshallingIds'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IRange } from 'vs/editor/common/core/range'; -import * as languages from 'vs/editor/common/languages'; -import { ExtensionIdentifierMap, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import * as extHostTypeConverter from 'vs/workbench/api/common/extHostTypeConverters'; -import * as types from 'vs/workbench/api/common/extHostTypes'; +import { asPromise } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { debounce } from '../../../base/common/decorators.js'; +import { Emitter } from '../../../base/common/event.js'; +import { DisposableStore, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { MarshalledId } from '../../../base/common/marshallingIds.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IRange } from '../../../editor/common/core/range.js'; +import * as languages from '../../../editor/common/languages.js'; +import { ExtensionIdentifierMap, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostDocuments } from './extHostDocuments.js'; +import * as extHostTypeConverter from './extHostTypeConverters.js'; +import * as types from './extHostTypes.js'; import type * as vscode from 'vscode'; -import { ExtHostCommentsShape, IMainContext, MainContext, CommentThreadChanges, CommentChanges } from './extHost.protocol'; -import { ExtHostCommands } from './extHostCommands'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import { MarshalledCommentThread } from 'vs/workbench/common/comments'; +import { ExtHostCommentsShape, IMainContext, MainContext, CommentThreadChanges, CommentChanges } from './extHost.protocol.js'; +import { ExtHostCommands } from './extHostCommands.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; +import { MarshalledCommentThread } from '../../common/comments.js'; type ProviderHandle = number; @@ -424,6 +424,7 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo this._id, this._uri, extHostTypeConverter.Range.from(this._range), + this._comments.map(cmt => convertToDTOComment(this, cmt, this._commentsMap, this.extensionDescription)), extensionDescription.identifier, this._isTemplate, editorId @@ -436,9 +437,6 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo this.eventuallyUpdateCommentThread(); })); - // set up comments after ctor to batch update events. - this.comments = _comments; - this._localDisposables.push({ dispose: () => { proxy.$deleteCommentThread( @@ -465,7 +463,8 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo set label(value: string | undefined) { that.label = value; }, get state(): vscode.CommentThreadState | { resolved?: vscode.CommentThreadState; applicability?: vscode.CommentThreadApplicability } | undefined { return that.state; }, set state(value: vscode.CommentThreadState | { resolved?: vscode.CommentThreadState; applicability?: vscode.CommentThreadApplicability }) { that.state = value; }, - reveal: (options?: vscode.CommentThreadRevealOptions) => that.reveal(options), + reveal: (comment?: vscode.Comment | vscode.CommentThreadRevealOptions, options?: vscode.CommentThreadRevealOptions) => that.reveal(comment, options), + hide: () => that.hide(), dispose: () => { that.dispose(); } @@ -549,9 +548,29 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo return; } - async reveal(options?: vscode.CommentThreadRevealOptions): Promise { + async reveal(commentOrOptions?: vscode.Comment | vscode.CommentThreadRevealOptions, options?: vscode.CommentThreadRevealOptions): Promise { checkProposedApiEnabled(this.extensionDescription, 'commentReveal'); - return proxy.$revealCommentThread(this._commentControllerHandle, this.handle, { preserveFocus: false, focusReply: false, ...options }); + let comment: vscode.Comment | undefined; + if (commentOrOptions && (commentOrOptions as vscode.Comment).body !== undefined) { + comment = commentOrOptions as vscode.Comment; + } else { + options = options ?? commentOrOptions as vscode.CommentThreadRevealOptions; + } + let commentToReveal = comment ? this._commentsMap.get(comment) : undefined; + commentToReveal ??= this._commentsMap.get(this._comments[0])!; + let preserveFocus: boolean = true; + let focusReply: boolean = false; + if (options?.focus === types.CommentThreadFocus.Reply) { + focusReply = true; + preserveFocus = false; + } else if (options?.focus === types.CommentThreadFocus.Comment) { + preserveFocus = false; + } + return proxy.$revealCommentThread(this._commentControllerHandle, this.handle, commentToReveal, { preserveFocus, focusReply }); + } + + async hide(): Promise { + return proxy.$hideCommentThread(this._commentControllerHandle, this.handle); } dispose() { @@ -622,11 +641,11 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo return this._activeComment; } - private _activeThread: vscode.CommentThread2 | undefined; + private _activeThread: ExtHostCommentThread | undefined; get activeCommentThread(): vscode.CommentThread2 | undefined { checkProposedApiEnabled(this._extension, 'activeComment'); - return this._activeThread; + return this._activeThread?.value; } private _localDisposables: types.Disposable[]; diff --git a/src/vs/workbench/api/common/extHostConfiguration.ts b/src/vs/workbench/api/common/extHostConfiguration.ts index 2808a4eb0b1..5a474e8aa92 100644 --- a/src/vs/workbench/api/common/extHostConfiguration.ts +++ b/src/vs/workbench/api/common/extHostConfiguration.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { mixin, deepClone } from 'vs/base/common/objects'; -import { Event, Emitter } from 'vs/base/common/event'; +import { mixin, deepClone } from '../../../base/common/objects.js'; +import { Event, Emitter } from '../../../base/common/event.js'; import type * as vscode from 'vscode'; -import { ExtHostWorkspace, IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { ExtHostConfigurationShape, MainThreadConfigurationShape, IConfigurationInitData, MainContext } from './extHost.protocol'; -import { ConfigurationTarget as ExtHostConfigurationTarget } from './extHostTypes'; -import { ConfigurationTarget, IConfigurationChange, IConfigurationData, IConfigurationOverrides } from 'vs/platform/configuration/common/configuration'; -import { Configuration, ConfigurationChangeEvent } from 'vs/platform/configuration/common/configurationModels'; -import { ConfigurationScope, OVERRIDE_PROPERTY_REGEX } from 'vs/platform/configuration/common/configurationRegistry'; -import { isObject } from 'vs/base/common/types'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { Barrier } from 'vs/base/common/async'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Workspace } from 'vs/platform/workspace/common/workspace'; -import { URI } from 'vs/base/common/uri'; +import { ExtHostWorkspace, IExtHostWorkspace } from './extHostWorkspace.js'; +import { ExtHostConfigurationShape, MainThreadConfigurationShape, IConfigurationInitData, MainContext } from './extHost.protocol.js'; +import { ConfigurationTarget as ExtHostConfigurationTarget } from './extHostTypes.js'; +import { ConfigurationTarget, IConfigurationChange, IConfigurationData, IConfigurationOverrides } from '../../../platform/configuration/common/configuration.js'; +import { Configuration, ConfigurationChangeEvent } from '../../../platform/configuration/common/configurationModels.js'; +import { ConfigurationScope, OVERRIDE_PROPERTY_REGEX } from '../../../platform/configuration/common/configurationRegistry.js'; +import { isObject } from '../../../base/common/types.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { Barrier } from '../../../base/common/async.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { Workspace } from '../../../platform/workspace/common/workspace.js'; +import { URI } from '../../../base/common/uri.js'; function lookUp(tree: any, key: string) { if (key) { diff --git a/src/vs/workbench/api/common/extHostConsoleForwarder.ts b/src/vs/workbench/api/common/extHostConsoleForwarder.ts index 663841771e7..02559149900 100644 --- a/src/vs/workbench/api/common/extHostConsoleForwarder.ts +++ b/src/vs/workbench/api/common/extHostConsoleForwarder.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IStackArgument } from 'vs/base/common/console'; -import { safeStringify } from 'vs/base/common/objects'; -import { MainContext, MainThreadConsoleShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; +import { IStackArgument } from '../../../base/common/console.js'; +import { safeStringify } from '../../../base/common/objects.js'; +import { MainContext, MainThreadConsoleShape } from './extHost.protocol.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; export abstract class AbstractExtHostConsoleForwarder { diff --git a/src/vs/workbench/api/common/extHostCustomEditors.ts b/src/vs/workbench/api/common/extHostCustomEditors.ts index 99eef8fbc8b..458795180b0 100644 --- a/src/vs/workbench/api/common/extHostCustomEditors.ts +++ b/src/vs/workbench/api/common/extHostCustomEditors.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { hash } from 'vs/base/common/hash'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { joinPath } from 'vs/base/common/resources'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { IExtensionStoragePaths } from 'vs/workbench/api/common/extHostStoragePaths'; -import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import { ExtHostWebviews, shouldSerializeBuffersForPostMessage, toExtensionData } from 'vs/workbench/api/common/extHostWebview'; -import { ExtHostWebviewPanels } from 'vs/workbench/api/common/extHostWebviewPanels'; -import { EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { hash } from '../../../base/common/hash.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { joinPath } from '../../../base/common/resources.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostDocuments } from './extHostDocuments.js'; +import { IExtensionStoragePaths } from './extHostStoragePaths.js'; +import * as typeConverters from './extHostTypeConverters.js'; +import { ExtHostWebviews, shouldSerializeBuffersForPostMessage, toExtensionData } from './extHostWebview.js'; +import { ExtHostWebviewPanels } from './extHostWebviewPanels.js'; +import { EditorGroupColumn } from '../../services/editor/common/editorGroupColumn.js'; import type * as vscode from 'vscode'; -import { Cache } from './cache'; -import * as extHostProtocol from './extHost.protocol'; -import * as extHostTypes from './extHostTypes'; +import { Cache } from './cache.js'; +import * as extHostProtocol from './extHost.protocol.js'; +import * as extHostTypes from './extHostTypes.js'; class CustomDocumentStoreEntry { diff --git a/src/vs/workbench/api/common/extHostDebugService.ts b/src/vs/workbench/api/common/extHostDebugService.ts index a5e22aa3dee..fe33d966e66 100644 --- a/src/vs/workbench/api/common/extHostDebugService.ts +++ b/src/vs/workbench/api/common/extHostDebugService.ts @@ -3,34 +3,34 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { asPromise } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { Disposable as DisposableCls, toDisposable } from 'vs/base/common/lifecycle'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ISignService } from 'vs/platform/sign/common/sign'; -import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { DebugSessionUUID, ExtHostDebugServiceShape, IBreakpointsDeltaDto, IThreadFocusDto, IStackFrameFocusDto, IDebugSessionDto, IFunctionBreakpointDto, ISourceMultiBreakpointDto, MainContext, MainThreadDebugServiceShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostEditorTabs } from 'vs/workbench/api/common/extHostEditorTabs'; -import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { Breakpoint, DataBreakpoint, DebugAdapterExecutable, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer, DebugAdapterServer, DebugConsoleMode, Disposable, FunctionBreakpoint, Location, Position, setBreakpointId, SourceBreakpoint, DebugThread, DebugStackFrame, ThemeIcon } from 'vs/workbench/api/common/extHostTypes'; -import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstractDebugAdapter'; -import { MainThreadDebugVisualization, IAdapterDescriptor, IConfig, IDebugAdapter, IDebugAdapterExecutable, IDebugAdapterNamedPipeServer, IDebugAdapterServer, IDebugVisualization, IDebugVisualizationContext, IDebuggerContribution, DebugVisualizationType, IDebugVisualizationTreeItem } from 'vs/workbench/contrib/debug/common/debug'; -import { convertToDAPaths, convertToVSCPaths, isDebuggerMainContribution } from 'vs/workbench/contrib/debug/common/debugUtils'; -import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/common/extensionDescriptionRegistry'; -import { Dto } from 'vs/workbench/services/extensions/common/proxyIdentifier'; import type * as vscode from 'vscode'; -import { IExtHostConfiguration } from '../common/extHostConfiguration'; -import { IExtHostVariableResolverProvider } from './extHostVariableResolverService'; -import { ThemeIcon as ThemeIconUtils } from 'vs/base/common/themables'; -import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import * as Convert from 'vs/workbench/api/common/extHostTypeConverters'; -import { coalesce } from 'vs/base/common/arrays'; -import { IExtHostTesting } from 'vs/workbench/api/common/extHostTesting'; +import { coalesce } from '../../../base/common/arrays.js'; +import { asPromise } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable as DisposableCls, toDisposable } from '../../../base/common/lifecycle.js'; +import { ThemeIcon as ThemeIconUtils } from '../../../base/common/themables.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ISignService } from '../../../platform/sign/common/sign.js'; +import { IWorkspaceFolder } from '../../../platform/workspace/common/workspace.js'; +import { AbstractDebugAdapter } from '../../contrib/debug/common/abstractDebugAdapter.js'; +import { DebugVisualizationType, IAdapterDescriptor, IConfig, IDebugAdapter, IDebugAdapterExecutable, IDebugAdapterImpl, IDebugAdapterNamedPipeServer, IDebugAdapterServer, IDebuggerContribution, IDebugVisualization, IDebugVisualizationContext, IDebugVisualizationTreeItem, MainThreadDebugVisualization } from '../../contrib/debug/common/debug.js'; +import { convertToDAPaths, convertToVSCPaths, isDebuggerMainContribution } from '../../contrib/debug/common/debugUtils.js'; +import { ExtensionDescriptionRegistry } from '../../services/extensions/common/extensionDescriptionRegistry.js'; +import { Dto } from '../../services/extensions/common/proxyIdentifier.js'; +import { DebugSessionUUID, ExtHostDebugServiceShape, IBreakpointsDeltaDto, IDebugSessionDto, IFunctionBreakpointDto, ISourceMultiBreakpointDto, IStackFrameFocusDto, IThreadFocusDto, MainContext, MainThreadDebugServiceShape } from './extHost.protocol.js'; +import { IExtHostCommands } from './extHostCommands.js'; +import { IExtHostConfiguration } from './extHostConfiguration.js'; +import { IExtHostEditorTabs } from './extHostEditorTabs.js'; +import { IExtHostExtensionService } from './extHostExtensionService.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { IExtHostTesting } from './extHostTesting.js'; +import * as Convert from './extHostTypeConverters.js'; +import { Breakpoint, DataBreakpoint, DebugAdapterExecutable, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer, DebugAdapterServer, DebugConsoleMode, DebugStackFrame, DebugThread, Disposable, FunctionBreakpoint, Location, Position, setBreakpointId, SourceBreakpoint, ThemeIcon } from './extHostTypes.js'; +import { IExtHostVariableResolverProvider } from './extHostVariableResolverService.js'; +import { IExtHostWorkspace } from './extHostWorkspace.js'; export const IExtHostDebugService = createDecorator('IExtHostDebugService'); @@ -578,8 +578,8 @@ export abstract class ExtHostDebugServiceBase extends DisposableCls implements I return variableResolver.resolveAnyAsync(ws, config); } - protected createDebugAdapter(adapter: IAdapterDescriptor, session: ExtHostDebugSession): AbstractDebugAdapter | undefined { - if (adapter.type === 'implementation') { + protected createDebugAdapter(adapter: vscode.DebugAdapterDescriptor, session: ExtHostDebugSession): AbstractDebugAdapter | undefined { + if (adapter instanceof DebugAdapterInlineImplementation) { return new DirectDebugAdapter(adapter.implementation); } return undefined; @@ -600,9 +600,7 @@ export abstract class ExtHostDebugServiceBase extends DisposableCls implements I throw new Error(`Couldn't find a debug adapter descriptor for debug type '${session.type}' (extension might have failed to activate)`); } - const adapterDescriptor = this.convertToDto(daDescriptor); - - const da = this.createDebugAdapter(adapterDescriptor, session); + const da = this.createDebugAdapter(daDescriptor, session); if (!da) { throw new Error(`Couldn't create a debug adapter for type '${session.type}'.`); } @@ -891,35 +889,49 @@ export abstract class ExtHostDebugServiceBase extends DisposableCls implements I // private & dto helpers private convertToDto(x: vscode.DebugAdapterDescriptor): Dto { - if (x instanceof DebugAdapterExecutable) { - return { - type: 'executable', - command: x.command, - args: x.args, - options: x.options - } satisfies IDebugAdapterExecutable; + return this.convertExecutableToDto(x); } else if (x instanceof DebugAdapterServer) { - return { - type: 'server', - port: x.port, - host: x.host - } satisfies IDebugAdapterServer; + return this.convertServerToDto(x); } else if (x instanceof DebugAdapterNamedPipeServer) { - return { - type: 'pipeServer', - path: x.path - } satisfies IDebugAdapterNamedPipeServer; + return this.convertPipeServerToDto(x); } else if (x instanceof DebugAdapterInlineImplementation) { - return { - type: 'implementation', - implementation: x.implementation - } as Dto; + return this.convertImplementationToDto(x); } else { throw new Error('convertToDto unexpected type'); } } + protected convertExecutableToDto(x: DebugAdapterExecutable): IDebugAdapterExecutable { + return { + type: 'executable', + command: x.command, + args: x.args, + options: x.options + }; + } + + protected convertServerToDto(x: DebugAdapterServer): IDebugAdapterServer { + return { + type: 'server', + port: x.port, + host: x.host + }; + } + + protected convertPipeServerToDto(x: DebugAdapterNamedPipeServer): IDebugAdapterNamedPipeServer { + return { + type: 'pipeServer', + path: x.path + }; + } + + protected convertImplementationToDto(x: DebugAdapterInlineImplementation): IDebugAdapterImpl { + return { + type: 'implementation', + }; + } + private getAdapterDescriptorFactoryByType(type: string): vscode.DebugAdapterDescriptorFactory | undefined { const results = this._adapterFactories.filter(p => p.type === type); if (results.length > 0) { diff --git a/src/vs/workbench/api/common/extHostDecorations.ts b/src/vs/workbench/api/common/extHostDecorations.ts index 7633574f065..4da84a110fd 100644 --- a/src/vs/workbench/api/common/extHostDecorations.ts +++ b/src/vs/workbench/api/common/extHostDecorations.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { URI } from 'vs/base/common/uri'; -import { MainContext, ExtHostDecorationsShape, MainThreadDecorationsShape, DecorationData, DecorationRequest, DecorationReply } from 'vs/workbench/api/common/extHost.protocol'; -import { Disposable, FileDecoration } from 'vs/workbench/api/common/extHostTypes'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { asArray, groupBy } from 'vs/base/common/arrays'; -import { compare, count } from 'vs/base/common/strings'; -import { dirname } from 'vs/base/common/path'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; +import { URI } from '../../../base/common/uri.js'; +import { MainContext, ExtHostDecorationsShape, MainThreadDecorationsShape, DecorationData, DecorationRequest, DecorationReply } from './extHost.protocol.js'; +import { Disposable, FileDecoration } from './extHostTypes.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { asArray, groupBy } from '../../../base/common/arrays.js'; +import { compare, count } from '../../../base/common/strings.js'; +import { dirname } from '../../../base/common/path.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; interface ProviderData { provider: vscode.FileDecorationProvider; diff --git a/src/vs/workbench/api/common/extHostDiagnostics.ts b/src/vs/workbench/api/common/extHostDiagnostics.ts index e23ce395cc8..d2ca87f90d3 100644 --- a/src/vs/workbench/api/common/extHostDiagnostics.ts +++ b/src/vs/workbench/api/common/extHostDiagnostics.ts @@ -5,20 +5,20 @@ /* eslint-disable local/code-no-native-private */ -import { localize } from 'vs/nls'; -import { IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; -import { URI, UriComponents } from 'vs/base/common/uri'; +import { localize } from '../../../nls.js'; +import { IMarkerData, MarkerSeverity } from '../../../platform/markers/common/markers.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; import type * as vscode from 'vscode'; -import { MainContext, MainThreadDiagnosticsShape, ExtHostDiagnosticsShape, IMainContext } from './extHost.protocol'; -import { DiagnosticSeverity } from './extHostTypes'; -import * as converter from './extHostTypeConverters'; -import { Event, Emitter, DebounceEmitter } from 'vs/base/common/event'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ResourceMap } from 'vs/base/common/map'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { IExtUri } from 'vs/base/common/resources'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; +import { MainContext, MainThreadDiagnosticsShape, ExtHostDiagnosticsShape, IMainContext } from './extHost.protocol.js'; +import { DiagnosticSeverity } from './extHostTypes.js'; +import * as converter from './extHostTypeConverters.js'; +import { Event, Emitter, DebounceEmitter } from '../../../base/common/event.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { IExtHostFileSystemInfo } from './extHostFileSystemInfo.js'; +import { IExtUri } from '../../../base/common/resources.js'; +import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; export class DiagnosticCollection implements vscode.DiagnosticCollection { @@ -234,7 +234,7 @@ export class ExtHostDiagnostics implements ExtHostDiagnosticsShape { private static _idPool: number = 0; private static readonly _maxDiagnosticsPerFile: number = 1000; - private static readonly _maxDiagnosticsTotal: number = 1.1 * ExtHostDiagnostics._maxDiagnosticsPerFile; + private static readonly _maxDiagnosticsTotal: number = 1.1 * this._maxDiagnosticsPerFile; private readonly _proxy: MainThreadDiagnosticsShape; private readonly _collections = new Map(); diff --git a/src/vs/workbench/api/common/extHostDialogs.ts b/src/vs/workbench/api/common/extHostDialogs.ts index 372037aa341..8e98769e19c 100644 --- a/src/vs/workbench/api/common/extHostDialogs.ts +++ b/src/vs/workbench/api/common/extHostDialogs.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { URI } from 'vs/base/common/uri'; -import { MainContext, MainThreadDiaglogsShape, IMainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; +import { URI } from '../../../base/common/uri.js'; +import { MainContext, MainThreadDiaglogsShape, IMainContext } from './extHost.protocol.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; export class ExtHostDialogs { diff --git a/src/vs/workbench/api/common/extHostDocumentContentProviders.ts b/src/vs/workbench/api/common/extHostDocumentContentProviders.ts index daca96f1913..cf67e3e1747 100644 --- a/src/vs/workbench/api/common/extHostDocumentContentProviders.ts +++ b/src/vs/workbench/api/common/extHostDocumentContentProviders.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { onUnexpectedError } from 'vs/base/common/errors'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { Disposable } from 'vs/workbench/api/common/extHostTypes'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { Disposable } from './extHostTypes.js'; import type * as vscode from 'vscode'; -import { MainContext, ExtHostDocumentContentProvidersShape, MainThreadDocumentContentProvidersShape, IMainContext } from './extHost.protocol'; -import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors'; -import { Schemas } from 'vs/base/common/network'; -import { ILogService } from 'vs/platform/log/common/log'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { splitLines } from 'vs/base/common/strings'; +import { MainContext, ExtHostDocumentContentProvidersShape, MainThreadDocumentContentProvidersShape, IMainContext } from './extHost.protocol.js'; +import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import { Schemas } from '../../../base/common/network.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { splitLines } from '../../../base/common/strings.js'; export class ExtHostDocumentContentProvider implements ExtHostDocumentContentProvidersShape { diff --git a/src/vs/workbench/api/common/extHostDocumentData.ts b/src/vs/workbench/api/common/extHostDocumentData.ts index ee321b2575a..c69c38d80ce 100644 --- a/src/vs/workbench/api/common/extHostDocumentData.ts +++ b/src/vs/workbench/api/common/extHostDocumentData.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ok } from 'vs/base/common/assert'; -import { Schemas } from 'vs/base/common/network'; -import { regExpLeadsToEndlessLoop } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { MirrorTextModel } from 'vs/editor/common/model/mirrorTextModel'; -import { ensureValidWordDefinition, getWordAtText } from 'vs/editor/common/core/wordHelper'; -import { MainThreadDocumentsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { EndOfLine, Position, Range } from 'vs/workbench/api/common/extHostTypes'; +import { ok } from '../../../base/common/assert.js'; +import { Schemas } from '../../../base/common/network.js'; +import { regExpLeadsToEndlessLoop } from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import { MirrorTextModel } from '../../../editor/common/model/mirrorTextModel.js'; +import { ensureValidWordDefinition, getWordAtText } from '../../../editor/common/core/wordHelper.js'; +import { MainThreadDocumentsShape } from './extHost.protocol.js'; +import { EndOfLine, Position, Range } from './extHostTypes.js'; import type * as vscode from 'vscode'; -import { equals } from 'vs/base/common/arrays'; +import { equals } from '../../../base/common/arrays.js'; const _languageId2WordDefinition = new Map(); export function setWordDefinitionFor(languageId: string, wordDefinition: RegExp | undefined): void { @@ -76,6 +76,9 @@ export class ExtHostDocumentData extends MirrorTextModel { validateRange(ran) { return that._validateRange(ran); }, validatePosition(pos) { return that._validatePosition(pos); }, getWordRangeAtPosition(pos, regexp?) { return that._getWordRangeAtPosition(pos, regexp); }, + [Symbol.for('debug.description')]() { + return `TextDocument(${that._uri.toString()})`; + } }; } return Object.freeze(this._document); diff --git a/src/vs/workbench/api/common/extHostDocumentSaveParticipant.ts b/src/vs/workbench/api/common/extHostDocumentSaveParticipant.ts index de3123da9de..69787c4ade6 100644 --- a/src/vs/workbench/api/common/extHostDocumentSaveParticipant.ts +++ b/src/vs/workbench/api/common/extHostDocumentSaveParticipant.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { illegalState } from 'vs/base/common/errors'; -import { ExtHostDocumentSaveParticipantShape, IWorkspaceEditDto, MainThreadBulkEditsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { TextEdit } from 'vs/workbench/api/common/extHostTypes'; -import { Range, TextDocumentSaveReason, EndOfLine } from 'vs/workbench/api/common/extHostTypeConverters'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { SaveReason } from 'vs/workbench/common/editor'; +import { Event } from '../../../base/common/event.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { illegalState } from '../../../base/common/errors.js'; +import { ExtHostDocumentSaveParticipantShape, IWorkspaceEditDto, MainThreadBulkEditsShape } from './extHost.protocol.js'; +import { TextEdit } from './extHostTypes.js'; +import { Range, TextDocumentSaveReason, EndOfLine } from './extHostTypeConverters.js'; +import { ExtHostDocuments } from './extHostDocuments.js'; +import { SaveReason } from '../../common/editor.js'; import type * as vscode from 'vscode'; -import { LinkedList } from 'vs/base/common/linkedList'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { LinkedList } from '../../../base/common/linkedList.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; type Listener = [Function, any, IExtensionDescription]; diff --git a/src/vs/workbench/api/common/extHostDocuments.ts b/src/vs/workbench/api/common/extHostDocuments.ts index c9e1dad81b0..c26baab4a67 100644 --- a/src/vs/workbench/api/common/extHostDocuments.ts +++ b/src/vs/workbench/api/common/extHostDocuments.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IModelChangedEvent } from 'vs/editor/common/model/mirrorTextModel'; -import { ExtHostDocumentsShape, IMainContext, MainContext, MainThreadDocumentsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostDocumentData, setWordDefinitionFor } from 'vs/workbench/api/common/extHostDocumentData'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import * as TypeConverters from 'vs/workbench/api/common/extHostTypeConverters'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IModelChangedEvent } from '../../../editor/common/model/mirrorTextModel.js'; +import { ExtHostDocumentsShape, IMainContext, MainContext, MainThreadDocumentsShape } from './extHost.protocol.js'; +import { ExtHostDocumentData, setWordDefinitionFor } from './extHostDocumentData.js'; +import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import * as TypeConverters from './extHostTypeConverters.js'; import type * as vscode from 'vscode'; -import { assertIsDefined } from 'vs/base/common/types'; -import { deepFreeze } from 'vs/base/common/objects'; -import { TextDocumentChangeReason } from 'vs/workbench/api/common/extHostTypes'; +import { assertIsDefined } from '../../../base/common/types.js'; +import { deepFreeze } from '../../../base/common/objects.js'; +import { TextDocumentChangeReason } from './extHostTypes.js'; export class ExtHostDocuments implements ExtHostDocumentsShape { diff --git a/src/vs/workbench/api/common/extHostDocumentsAndEditors.ts b/src/vs/workbench/api/common/extHostDocumentsAndEditors.ts index 224d9d55371..5fe4b192750 100644 --- a/src/vs/workbench/api/common/extHostDocumentsAndEditors.ts +++ b/src/vs/workbench/api/common/extHostDocumentsAndEditors.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as assert from 'vs/base/common/assert'; +import * as assert from '../../../base/common/assert.js'; import * as vscode from 'vscode'; -import { Emitter, Event } from 'vs/base/common/event'; -import { dispose } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ExtHostDocumentsAndEditorsShape, IDocumentsAndEditorsDelta, MainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostDocumentData } from 'vs/workbench/api/common/extHostDocumentData'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ExtHostTextEditor } from 'vs/workbench/api/common/extHostTextEditor'; -import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ResourceMap } from 'vs/base/common/map'; -import { Schemas } from 'vs/base/common/network'; -import { Iterable } from 'vs/base/common/iterator'; -import { Lazy } from 'vs/base/common/lazy'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { dispose } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ExtHostDocumentsAndEditorsShape, IDocumentsAndEditorsDelta, MainContext } from './extHost.protocol.js'; +import { ExtHostDocumentData } from './extHostDocumentData.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { ExtHostTextEditor } from './extHostTextEditor.js'; +import * as typeConverters from './extHostTypeConverters.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { Schemas } from '../../../base/common/network.js'; +import { Iterable } from '../../../base/common/iterator.js'; +import { Lazy } from '../../../base/common/lazy.js'; class Reference { private _count = 0; diff --git a/src/vs/workbench/api/common/extHostEditorTabs.ts b/src/vs/workbench/api/common/extHostEditorTabs.ts index edaf6c33f1d..592c75c4bae 100644 --- a/src/vs/workbench/api/common/extHostEditorTabs.ts +++ b/src/vs/workbench/api/common/extHostEditorTabs.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { diffSets } from 'vs/base/common/collections'; -import { Emitter } from 'vs/base/common/event'; -import { assertIsDefined } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IEditorTabDto, IEditorTabGroupDto, IExtHostEditorTabsShape, MainContext, MainThreadEditorTabsShape, TabInputKind, TabModelOperationKind, TabOperation } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import { AideChatEditorTabInput, ChatEditorTabInput, CustomEditorTabInput, InteractiveWindowInput, NotebookDiffEditorTabInput, NotebookEditorTabInput, TerminalEditorTabInput, TextDiffTabInput, TextMergeTabInput, TextTabInput, WebviewEditorTabInput, TextMultiDiffTabInput } from 'vs/workbench/api/common/extHostTypes'; +import { diffSets } from '../../../base/common/collections.js'; +import { Emitter } from '../../../base/common/event.js'; +import { assertIsDefined } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IEditorTabDto, IEditorTabGroupDto, IExtHostEditorTabsShape, MainContext, MainThreadEditorTabsShape, TabInputKind, TabModelOperationKind, TabOperation } from './extHost.protocol.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import * as typeConverters from './extHostTypeConverters.js'; +import { ChatEditorTabInput, CustomEditorTabInput, InteractiveWindowInput, NotebookDiffEditorTabInput, NotebookEditorTabInput, TerminalEditorTabInput, TextDiffTabInput, TextMergeTabInput, TextTabInput, WebviewEditorTabInput, TextMultiDiffTabInput } from './extHostTypes.js'; import type * as vscode from 'vscode'; export interface IExtHostEditorTabs extends IExtHostEditorTabsShape { @@ -21,7 +21,7 @@ export interface IExtHostEditorTabs extends IExtHostEditorTabsShape { export const IExtHostEditorTabs = createDecorator('IExtHostEditorTabs'); -type AnyTabInput = TextTabInput | TextDiffTabInput | TextMultiDiffTabInput | CustomEditorTabInput | NotebookEditorTabInput | NotebookDiffEditorTabInput | WebviewEditorTabInput | TerminalEditorTabInput | InteractiveWindowInput | ChatEditorTabInput | AideChatEditorTabInput; +type AnyTabInput = TextTabInput | TextDiffTabInput | TextMultiDiffTabInput | CustomEditorTabInput | NotebookEditorTabInput | NotebookDiffEditorTabInput | WebviewEditorTabInput | TerminalEditorTabInput | InteractiveWindowInput | ChatEditorTabInput; class ExtHostEditorTab { private _apiObject: vscode.Tab | undefined; @@ -100,8 +100,6 @@ class ExtHostEditorTab { return new InteractiveWindowInput(URI.revive(this._dto.input.uri), URI.revive(this._dto.input.inputBoxUri)); case TabInputKind.ChatEditorInput: return new ChatEditorTabInput(); - case TabInputKind.AideChatEditorInput: - return new AideChatEditorTabInput(); case TabInputKind.MultiDiffEditorInput: return new TextMultiDiffTabInput(this._dto.input.diffEditors.map(diff => new TextDiffTabInput(URI.revive(diff.original), URI.revive(diff.modified)))); default: diff --git a/src/vs/workbench/api/common/extHostEmbedding.ts b/src/vs/workbench/api/common/extHostEmbedding.ts index f99cd387c62..afc42930343 100644 --- a/src/vs/workbench/api/common/extHostEmbedding.ts +++ b/src/vs/workbench/api/common/extHostEmbedding.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostEmbeddingsShape, IMainContext, MainContext, MainThreadEmbeddingsShape } from 'vs/workbench/api/common/extHost.protocol'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostEmbeddingsShape, IMainContext, MainContext, MainThreadEmbeddingsShape } from './extHost.protocol.js'; import type * as vscode from 'vscode'; @@ -39,6 +39,7 @@ export class ExtHostEmbeddings implements ExtHostEmbeddingsShape { this._provider.set(handle, { id: embeddingsModel, provider }); return toDisposable(() => { + this._allKnownModels.delete(embeddingsModel); this._proxy.$unregisterEmbeddingProvider(handle); this._provider.delete(handle); }); diff --git a/src/vs/workbench/api/common/extHostEmbeddingVector.ts b/src/vs/workbench/api/common/extHostEmbeddingVector.ts index 20b3bcb266b..9f97d789b44 100644 --- a/src/vs/workbench/api/common/extHostEmbeddingVector.ts +++ b/src/vs/workbench/api/common/extHostEmbeddingVector.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostAiEmbeddingVectorShape, IMainContext, MainContext, MainThreadAiEmbeddingVectorShape } from 'vs/workbench/api/common/extHost.protocol'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostAiEmbeddingVectorShape, IMainContext, MainContext, MainThreadAiEmbeddingVectorShape } from './extHost.protocol.js'; import type { CancellationToken, EmbeddingVectorProvider } from 'vscode'; -import { Disposable } from 'vs/workbench/api/common/extHostTypes'; +import { Disposable } from './extHostTypes.js'; export class ExtHostAiEmbeddingVector implements ExtHostAiEmbeddingVectorShape { private _AiEmbeddingVectorProviders: Map = new Map(); diff --git a/src/vs/workbench/api/common/extHostExtensionActivator.ts b/src/vs/workbench/api/common/extHostExtensionActivator.ts index 2c51f37aed2..20f8efbfdbd 100644 --- a/src/vs/workbench/api/common/extHostExtensionActivator.ts +++ b/src/vs/workbench/api/common/extHostExtensionActivator.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import * as errors from 'vs/base/common/errors'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/common/extensionDescriptionRegistry'; -import { ExtensionIdentifier, ExtensionIdentifierMap } from 'vs/platform/extensions/common/extensions'; -import { ExtensionActivationReason, MissingExtensionDependency } from 'vs/workbench/services/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Barrier } from 'vs/base/common/async'; +import * as errors from '../../../base/common/errors.js'; +import { Disposable, IDisposable } from '../../../base/common/lifecycle.js'; +import { ExtensionDescriptionRegistry } from '../../services/extensions/common/extensionDescriptionRegistry.js'; +import { ExtensionIdentifier, ExtensionIdentifierMap } from '../../../platform/extensions/common/extensions.js'; +import { ExtensionActivationReason, MissingExtensionDependency } from '../../services/extensions/common/extensions.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { Barrier } from '../../../base/common/async.js'; /** * Represents the source code (module) of an extension. @@ -119,7 +119,7 @@ export class ActivatedExtension { public readonly activationTimes: ExtensionActivationTimes; public readonly module: IExtensionModule; public readonly exports: IExtensionAPI | undefined; - public readonly subscriptions: IDisposable[]; + public readonly disposable: IDisposable; constructor( activationFailed: boolean, @@ -127,32 +127,32 @@ export class ActivatedExtension { activationTimes: ExtensionActivationTimes, module: IExtensionModule, exports: IExtensionAPI | undefined, - subscriptions: IDisposable[] + disposable: IDisposable ) { this.activationFailed = activationFailed; this.activationFailedError = activationFailedError; this.activationTimes = activationTimes; this.module = module; this.exports = exports; - this.subscriptions = subscriptions; + this.disposable = disposable; } } export class EmptyExtension extends ActivatedExtension { constructor(activationTimes: ExtensionActivationTimes) { - super(false, null, activationTimes, { activate: undefined, deactivate: undefined }, undefined, []); + super(false, null, activationTimes, { activate: undefined, deactivate: undefined }, undefined, Disposable.None); } } export class HostExtension extends ActivatedExtension { constructor() { - super(false, null, ExtensionActivationTimes.NONE, { activate: undefined, deactivate: undefined }, undefined, []); + super(false, null, ExtensionActivationTimes.NONE, { activate: undefined, deactivate: undefined }, undefined, Disposable.None); } } class FailedExtension extends ActivatedExtension { constructor(activationError: Error) { - super(true, activationError, ExtensionActivationTimes.NONE, { activate: undefined, deactivate: undefined }, undefined, []); + super(true, activationError, ExtensionActivationTimes.NONE, { activate: undefined, deactivate: undefined }, undefined, Disposable.None); } } diff --git a/src/vs/workbench/api/common/extHostExtensionService.ts b/src/vs/workbench/api/common/extHostExtensionService.ts index 6947479c2b8..e6af1f781be 100644 --- a/src/vs/workbench/api/common/extHostExtensionService.ts +++ b/src/vs/workbench/api/common/extHostExtensionService.ts @@ -5,49 +5,49 @@ /* eslint-disable local/code-no-native-private */ -import * as nls from 'vs/nls'; -import * as path from 'vs/base/common/path'; -import * as performance from 'vs/base/common/performance'; -import { originalFSPath, joinPath, extUriBiasedIgnorePathCase } from 'vs/base/common/resources'; -import { asPromise, Barrier, IntervalTimer, timeout } from 'vs/base/common/async'; -import { dispose, toDisposable, Disposable } from 'vs/base/common/lifecycle'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostExtensionServiceShape, MainContext, MainThreadExtensionServiceShape, MainThreadTelemetryShape, MainThreadWorkspaceShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtensionDescriptionDelta, IExtensionHostInitData } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; -import { ExtHostConfiguration, IExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration'; -import { ActivatedExtension, EmptyExtension, ExtensionActivationTimes, ExtensionActivationTimesBuilder, ExtensionsActivator, IExtensionAPI, IExtensionModule, HostExtension, ExtensionActivationTimesFragment } from 'vs/workbench/api/common/extHostExtensionActivator'; -import { ExtHostStorage, IExtHostStorage } from 'vs/workbench/api/common/extHostStorage'; -import { ExtHostWorkspace, IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { MissingExtensionDependency, ActivationKind, checkProposedApiEnabled, isProposedApiEnabled, ExtensionActivationReason } from 'vs/workbench/services/extensions/common/extensions'; -import { ExtensionDescriptionRegistry, IActivationEventsReader } from 'vs/workbench/services/extensions/common/extensionDescriptionRegistry'; -import * as errors from 'vs/base/common/errors'; +import * as nls from '../../../nls.js'; +import * as path from '../../../base/common/path.js'; +import * as performance from '../../../base/common/performance.js'; +import { originalFSPath, joinPath, extUriBiasedIgnorePathCase } from '../../../base/common/resources.js'; +import { asPromise, Barrier, IntervalTimer, timeout } from '../../../base/common/async.js'; +import { dispose, toDisposable, Disposable, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { TernarySearchTree } from '../../../base/common/ternarySearchTree.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ExtHostExtensionServiceShape, MainContext, MainThreadExtensionServiceShape, MainThreadTelemetryShape, MainThreadWorkspaceShape } from './extHost.protocol.js'; +import { IExtensionDescriptionDelta, IExtensionHostInitData } from '../../services/extensions/common/extensionHostProtocol.js'; +import { ExtHostConfiguration, IExtHostConfiguration } from './extHostConfiguration.js'; +import { ActivatedExtension, EmptyExtension, ExtensionActivationTimes, ExtensionActivationTimesBuilder, ExtensionsActivator, IExtensionAPI, IExtensionModule, HostExtension, ExtensionActivationTimesFragment } from './extHostExtensionActivator.js'; +import { ExtHostStorage, IExtHostStorage } from './extHostStorage.js'; +import { ExtHostWorkspace, IExtHostWorkspace } from './extHostWorkspace.js'; +import { MissingExtensionDependency, ActivationKind, checkProposedApiEnabled, isProposedApiEnabled, ExtensionActivationReason } from '../../services/extensions/common/extensions.js'; +import { ExtensionDescriptionRegistry, IActivationEventsReader } from '../../services/extensions/common/extensionDescriptionRegistry.js'; +import * as errors from '../../../base/common/errors.js'; import type * as vscode from 'vscode'; -import { ExtensionIdentifier, ExtensionIdentifierMap, ExtensionIdentifierSet, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { ExtensionGlobalMemento, ExtensionMemento } from 'vs/workbench/api/common/extHostMemento'; -import { RemoteAuthorityResolverError, ExtensionKind, ExtensionMode, ExtensionRuntime, ManagedResolvedAuthority as ExtHostManagedResolvedAuthority } from 'vs/workbench/api/common/extHostTypes'; -import { ResolvedAuthority, ResolvedOptions, RemoteAuthorityResolverErrorCode, IRemoteConnectionData, getRemoteAuthorityPrefix, TunnelInformation, ManagedRemoteConnection, WebSocketRemoteConnection } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { IInstantiationService, createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtensionStoragePaths } from 'vs/workbench/api/common/extHostStoragePaths'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IExtHostTunnelService } from 'vs/workbench/api/common/extHostTunnelService'; -import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; -import { IExtHostLanguageModels } from 'vs/workbench/api/common/extHostLanguageModels'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IExtensionActivationHost, checkActivateWorkspaceContainsExtension } from 'vs/workbench/services/extensions/common/workspaceContains'; -import { ExtHostSecretState, IExtHostSecretState } from 'vs/workbench/api/common/extHostSecretState'; -import { ExtensionSecrets } from 'vs/workbench/api/common/extHostSecrets'; -import { Schemas } from 'vs/base/common/network'; -import { IResolveAuthorityResult } from 'vs/workbench/services/extensions/common/extensionHostProxy'; -import { IExtHostLocalizationService } from 'vs/workbench/api/common/extHostLocalizationService'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { isCI, setTimeout0 } from 'vs/base/common/platform'; -import { IExtHostManagedSockets } from 'vs/workbench/api/common/extHostManagedSockets'; -import { Dto } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { ExtensionIdentifier, ExtensionIdentifierMap, ExtensionIdentifierSet, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { ExtensionGlobalMemento, ExtensionMemento } from './extHostMemento.js'; +import { RemoteAuthorityResolverError, ExtensionKind, ExtensionMode, ExtensionRuntime, ManagedResolvedAuthority as ExtHostManagedResolvedAuthority } from './extHostTypes.js'; +import { ResolvedAuthority, ResolvedOptions, RemoteAuthorityResolverErrorCode, IRemoteConnectionData, getRemoteAuthorityPrefix, TunnelInformation, ManagedRemoteConnection, WebSocketRemoteConnection } from '../../../platform/remote/common/remoteAuthorityResolver.js'; +import { IInstantiationService, createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { IExtensionStoragePaths } from './extHostStoragePaths.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { ServiceCollection } from '../../../platform/instantiation/common/serviceCollection.js'; +import { IExtHostTunnelService } from './extHostTunnelService.js'; +import { IExtHostTerminalService } from './extHostTerminalService.js'; +import { IExtHostLanguageModels } from './extHostLanguageModels.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IExtensionActivationHost, checkActivateWorkspaceContainsExtension } from '../../services/extensions/common/workspaceContains.js'; +import { ExtHostSecretState, IExtHostSecretState } from './extHostSecretState.js'; +import { ExtensionSecrets } from './extHostSecrets.js'; +import { Schemas } from '../../../base/common/network.js'; +import { IResolveAuthorityResult } from '../../services/extensions/common/extensionHostProxy.js'; +import { IExtHostLocalizationService } from './extHostLocalizationService.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { isCI, setTimeout0 } from '../../../base/common/platform.js'; +import { IExtHostManagedSockets } from './extHostManagedSockets.js'; +import { Dto } from '../../services/extensions/common/proxyIdentifier.js'; interface ITestRunner { /** Old test runner API, as exported from `vscode/lib/testrunner` */ @@ -177,10 +177,10 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme this._secretState = new ExtHostSecretState(this._extHostContext); this._storagePath = storagePath; - this._instaService = instaService.createChild(new ServiceCollection( + this._instaService = this._store.add(instaService.createChild(new ServiceCollection( [IExtHostStorage, this._storage], [IExtHostSecretState, this._secretState] - )); + ))); this._activator = this._register(new ExtensionsActivator( this._myRegistry, @@ -409,9 +409,9 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme // clean up subscriptions try { - dispose(extension.subscriptions); + extension.disposable.dispose(); } catch (err) { - this._logService.error(`An error occurred when deactivating the subscriptions for extension '${extensionId.value}':`); + this._logService.error(`An error occurred when disposing the subscriptions for extension '${extensionId.value}':`); this._logService.error(err); } @@ -482,25 +482,26 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme this._logService.info(`ExtensionService#_doActivateExtension ${extensionDescription.identifier.value}, startup: ${reason.startup}, activationEvent: '${reason.activationEvent}'${extensionDescription.identifier.value !== reason.extensionId.value ? `, root cause: ${reason.extensionId.value}` : ``}`); this._logService.flush(); + const extensionInternalStore = new DisposableStore(); // disposables that follow the extension lifecycle const activationTimesBuilder = new ExtensionActivationTimesBuilder(reason.startup); return Promise.all([ this._loadCommonJSModule(extensionDescription, joinPath(extensionDescription.extensionLocation, entryPoint), activationTimesBuilder), - this._loadExtensionContext(extensionDescription) + this._loadExtensionContext(extensionDescription, extensionInternalStore) ]).then(values => { performance.mark(`code/extHost/willActivateExtension/${extensionDescription.identifier.value}`); - return AbstractExtHostExtensionService._callActivate(this._logService, extensionDescription.identifier, values[0], values[1], activationTimesBuilder); + return AbstractExtHostExtensionService._callActivate(this._logService, extensionDescription.identifier, values[0], values[1], extensionInternalStore, activationTimesBuilder); }).then((activatedExtension) => { performance.mark(`code/extHost/didActivateExtension/${extensionDescription.identifier.value}`); return activatedExtension; }); } - private _loadExtensionContext(extensionDescription: IExtensionDescription): Promise { + private _loadExtensionContext(extensionDescription: IExtensionDescription, extensionInternalStore: DisposableStore): Promise { - const lanuageModelAccessInformation = this._extHostLanguageModels.createLanguageModelAccessInformation(extensionDescription); - const globalState = new ExtensionGlobalMemento(extensionDescription, this._storage); - const workspaceState = new ExtensionMemento(extensionDescription.identifier.value, false, this._storage); - const secrets = new ExtensionSecrets(extensionDescription, this._secretState); + const languageModelAccessInformation = this._extHostLanguageModels.createLanguageModelAccessInformation(extensionDescription); + const globalState = extensionInternalStore.add(new ExtensionGlobalMemento(extensionDescription, this._storage)); + const workspaceState = extensionInternalStore.add(new ExtensionMemento(extensionDescription.identifier.value, false, this._storage)); + const secrets = extensionInternalStore.add(new ExtensionSecrets(extensionDescription, this._secretState)); const extensionMode = extensionDescription.isUnderDevelopment ? (this._initData.environment.extensionTestsLocationURI ? ExtensionMode.Test : ExtensionMode.Development) : ExtensionMode.Production; @@ -526,7 +527,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme workspaceState, secrets, subscriptions: [], - get languageModelAccessInformation() { return lanuageModelAccessInformation; }, + get languageModelAccessInformation() { return languageModelAccessInformation; }, get extensionUri() { return extensionDescription.extensionLocation; }, get extensionPath() { return extensionDescription.extensionLocation.fsPath; }, asAbsolutePath(relativePath: string) { return path.join(extensionDescription.extensionLocation.fsPath, relativePath); }, @@ -568,7 +569,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme }); } - private static _callActivate(logService: ILogService, extensionId: ExtensionIdentifier, extensionModule: IExtensionModule, context: vscode.ExtensionContext, activationTimesBuilder: ExtensionActivationTimesBuilder): Promise { + private static _callActivate(logService: ILogService, extensionId: ExtensionIdentifier, extensionModule: IExtensionModule, context: vscode.ExtensionContext, extensionInternalStore: IDisposable, activationTimesBuilder: ExtensionActivationTimesBuilder): Promise { // Make sure the extension's surface is not undefined extensionModule = extensionModule || { activate: undefined, @@ -576,7 +577,10 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme }; return this._callActivateOptional(logService, extensionId, extensionModule, context, activationTimesBuilder).then((extensionExports) => { - return new ActivatedExtension(false, null, activationTimesBuilder.build(), extensionModule, extensionExports, context.subscriptions); + return new ActivatedExtension(false, null, activationTimesBuilder.build(), extensionModule, extensionExports, toDisposable(() => { + extensionInternalStore.dispose(); + dispose(context.subscriptions); + })); }); } diff --git a/src/vs/workbench/api/common/extHostFileSystem.ts b/src/vs/workbench/api/common/extHostFileSystem.ts index dc740ddf397..f4aa9827938 100644 --- a/src/vs/workbench/api/common/extHostFileSystem.ts +++ b/src/vs/workbench/api/common/extHostFileSystem.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI, UriComponents } from 'vs/base/common/uri'; -import { MainContext, IMainContext, ExtHostFileSystemShape, MainThreadFileSystemShape, IFileChangeDto } from './extHost.protocol'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { MainContext, IMainContext, ExtHostFileSystemShape, MainThreadFileSystemShape, IFileChangeDto } from './extHost.protocol.js'; import type * as vscode from 'vscode'; -import * as files from 'vs/platform/files/common/files'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { FileChangeType } from 'vs/workbench/api/common/extHostTypes'; -import * as typeConverter from 'vs/workbench/api/common/extHostTypeConverters'; -import { ExtHostLanguageFeatures } from 'vs/workbench/api/common/extHostLanguageFeatures'; -import { State, StateMachine, LinkComputer, Edge } from 'vs/editor/common/languages/linkComputer'; -import { commonPrefixLength } from 'vs/base/common/strings'; -import { CharCode } from 'vs/base/common/charCode'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import { IMarkdownString, isMarkdownString } from 'vs/base/common/htmlContent'; +import * as files from '../../../platform/files/common/files.js'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { FileChangeType } from './extHostTypes.js'; +import * as typeConverter from './extHostTypeConverters.js'; +import { ExtHostLanguageFeatures } from './extHostLanguageFeatures.js'; +import { State, StateMachine, LinkComputer, Edge } from '../../../editor/common/languages/linkComputer.js'; +import { commonPrefixLength } from '../../../base/common/strings.js'; +import { CharCode } from '../../../base/common/charCode.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; +import { IMarkdownString, isMarkdownString } from '../../../base/common/htmlContent.js'; class FsLinkProvider { diff --git a/src/vs/workbench/api/common/extHostFileSystemConsumer.ts b/src/vs/workbench/api/common/extHostFileSystemConsumer.ts index fb325813d25..b44f22574ad 100644 --- a/src/vs/workbench/api/common/extHostFileSystemConsumer.ts +++ b/src/vs/workbench/api/common/extHostFileSystemConsumer.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MainContext, MainThreadFileSystemShape } from './extHost.protocol'; +import { MainContext, MainThreadFileSystemShape } from './extHost.protocol.js'; import type * as vscode from 'vscode'; -import * as files from 'vs/platform/files/common/files'; -import { FileSystemError } from 'vs/workbench/api/common/extHostTypes'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ResourceQueue } from 'vs/base/common/async'; -import { IExtUri, extUri, extUriIgnorePathCase } from 'vs/base/common/resources'; -import { Schemas } from 'vs/base/common/network'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; +import * as files from '../../../platform/files/common/files.js'; +import { FileSystemError } from './extHostTypes.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { IExtHostFileSystemInfo } from './extHostFileSystemInfo.js'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { ResourceQueue } from '../../../base/common/async.js'; +import { IExtUri, extUri, extUriIgnorePathCase } from '../../../base/common/resources.js'; +import { Schemas } from '../../../base/common/network.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; export class ExtHostConsumerFileSystem { diff --git a/src/vs/workbench/api/common/extHostFileSystemEventService.ts b/src/vs/workbench/api/common/extHostFileSystemEventService.ts index 5ad160530c9..48aea545da0 100644 --- a/src/vs/workbench/api/common/extHostFileSystemEventService.ts +++ b/src/vs/workbench/api/common/extHostFileSystemEventService.ts @@ -3,20 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event, AsyncEmitter, IWaitUntil, IWaitUntilData } from 'vs/base/common/event'; -import { GLOBSTAR, GLOB_SPLIT, parse } from 'vs/base/common/glob'; -import { URI } from 'vs/base/common/uri'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; +import { Emitter, Event, AsyncEmitter, IWaitUntil, IWaitUntilData } from '../../../base/common/event.js'; +import { GLOBSTAR, GLOB_SPLIT, IRelativePattern, parse } from '../../../base/common/glob.js'; +import { URI } from '../../../base/common/uri.js'; +import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; import type * as vscode from 'vscode'; -import { ExtHostFileSystemEventServiceShape, FileSystemEvents, IMainContext, SourceTargetPair, IWorkspaceEditDto, IWillRunFileOperationParticipation, MainContext, IRelativePatternDto } from './extHost.protocol'; -import * as typeConverter from './extHostTypeConverters'; -import { Disposable, WorkspaceEdit } from './extHostTypes'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { FileChangeFilter, FileOperation } from 'vs/platform/files/common/files'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { Lazy } from 'vs/base/common/lazy'; +import { ExtHostFileSystemEventServiceShape, FileSystemEvents, IMainContext, SourceTargetPair, IWorkspaceEditDto, IWillRunFileOperationParticipation, MainContext, IRelativePatternDto } from './extHost.protocol.js'; +import * as typeConverter from './extHostTypeConverters.js'; +import { Disposable, WorkspaceEdit } from './extHostTypes.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { FileChangeFilter, FileOperation, IGlobPatterns } from '../../../platform/files/common/files.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IExtHostWorkspace } from './extHostWorkspace.js'; +import { Lazy } from '../../../base/common/lazy.js'; +import { ExtHostConfigProvider } from './extHostConfiguration.js'; +import { rtrim } from '../../../base/common/strings.js'; +import { normalizeWatcherPattern } from '../../../platform/files/common/watcher.js'; export interface FileSystemWatcherCreateOptions { readonly correlate: boolean; @@ -51,15 +54,15 @@ class FileSystemWatcher implements vscode.FileSystemWatcher { return Boolean(this._config & 0b100); } - constructor(mainContext: IMainContext, workspace: IExtHostWorkspace, extension: IExtensionDescription, dispatcher: Event, globPattern: string | IRelativePatternDto, options?: FileSystemWatcherCreateOptions) { + constructor(mainContext: IMainContext, configuration: ExtHostConfigProvider, workspace: IExtHostWorkspace, extension: IExtensionDescription, dispatcher: Event, globPattern: string | IRelativePatternDto, options: FileSystemWatcherCreateOptions) { this._config = 0; - if (options?.ignoreCreateEvents) { + if (options.ignoreCreateEvents) { this._config += 0b001; } - if (options?.ignoreChangeEvents) { + if (options.ignoreChangeEvents) { this._config += 0b010; } - if (options?.ignoreDeleteEvents) { + if (options.ignoreDeleteEvents) { this._config += 0b100; } @@ -75,7 +78,7 @@ class FileSystemWatcher implements vscode.FileSystemWatcher { // 1.84.x introduces new proposed API for a watcher to set exclude // rules. In these cases, we turn the file watcher into correlation // mode and ignore any event that does not match the correlation ID. - const excludeUncorrelatedEvents = options?.correlate; + const excludeUncorrelatedEvents = options.correlate; const subscription = dispatcher(events => { if (typeof events.session === 'number' && events.session !== this.session) { @@ -86,7 +89,7 @@ class FileSystemWatcher implements vscode.FileSystemWatcher { return; // ignore events from other non-correlating file watcher when we are in correlation mode } - if (!options?.ignoreCreateEvents) { + if (!options.ignoreCreateEvents) { for (const created of events.created) { const uri = URI.revive(created); if (parsedPattern(uri.fsPath) && (!excludeOutOfWorkspaceEvents || workspace.getWorkspaceFolder(uri))) { @@ -94,7 +97,7 @@ class FileSystemWatcher implements vscode.FileSystemWatcher { } } } - if (!options?.ignoreChangeEvents) { + if (!options.ignoreChangeEvents) { for (const changed of events.changed) { const uri = URI.revive(changed); if (parsedPattern(uri.fsPath) && (!excludeOutOfWorkspaceEvents || workspace.getWorkspaceFolder(uri))) { @@ -102,7 +105,7 @@ class FileSystemWatcher implements vscode.FileSystemWatcher { } } } - if (!options?.ignoreDeleteEvents) { + if (!options.ignoreDeleteEvents) { for (const deleted of events.deleted) { const uri = URI.revive(deleted); if (parsedPattern(uri.fsPath) && (!excludeOutOfWorkspaceEvents || workspace.getWorkspaceFolder(uri))) { @@ -112,17 +115,17 @@ class FileSystemWatcher implements vscode.FileSystemWatcher { } }); - this._disposable = Disposable.from(this.ensureWatching(mainContext, extension, globPattern, options, options?.correlate), this._onDidCreate, this._onDidChange, this._onDidDelete, subscription); + this._disposable = Disposable.from(this.ensureWatching(mainContext, workspace, configuration, extension, globPattern, options, options.correlate), this._onDidCreate, this._onDidChange, this._onDidDelete, subscription); } - private ensureWatching(mainContext: IMainContext, extension: IExtensionDescription, globPattern: string | IRelativePatternDto, options: FileSystemWatcherCreateOptions | undefined, correlate: boolean | undefined): Disposable { + private ensureWatching(mainContext: IMainContext, workspace: IExtHostWorkspace, configuration: ExtHostConfigProvider, extension: IExtensionDescription, globPattern: string | IRelativePatternDto, options: FileSystemWatcherCreateOptions, correlate: boolean | undefined): Disposable { const disposable = Disposable.from(); if (typeof globPattern === 'string') { return disposable; // workspace is already watched by default, no need to watch again! } - if (options?.ignoreChangeEvents && options?.ignoreCreateEvents && options?.ignoreDeleteEvents) { + if (options.ignoreChangeEvents && options.ignoreCreateEvents && options.ignoreDeleteEvents) { return disposable; // no need to watch if we ignore all events } @@ -133,26 +136,85 @@ class FileSystemWatcher implements vscode.FileSystemWatcher { recursive = true; // only watch recursively if pattern indicates the need for it } + const excludes = options.excludes ?? []; + let includes: Array | undefined = undefined; let filter: FileChangeFilter | undefined; + + // Correlated: adjust filter based on arguments if (correlate) { - if (options?.ignoreChangeEvents || options?.ignoreCreateEvents || options?.ignoreDeleteEvents) { + if (options.ignoreChangeEvents || options.ignoreCreateEvents || options.ignoreDeleteEvents) { filter = FileChangeFilter.UPDATED | FileChangeFilter.ADDED | FileChangeFilter.DELETED; - if (options?.ignoreChangeEvents) { + if (options.ignoreChangeEvents) { filter &= ~FileChangeFilter.UPDATED; } - if (options?.ignoreCreateEvents) { + if (options.ignoreCreateEvents) { filter &= ~FileChangeFilter.ADDED; } - if (options?.ignoreDeleteEvents) { + if (options.ignoreDeleteEvents) { filter &= ~FileChangeFilter.DELETED; } } } - proxy.$watch(extension.identifier.value, this.session, globPattern.baseUri, { recursive, excludes: options?.excludes ?? [], filter }, Boolean(correlate)); + // Uncorrelated: adjust includes and excludes based on settings + else { + + // Automatically add `files.watcherExclude` patterns when watching + // recursively to give users a chance to configure exclude rules + // for reducing the overhead of watching recursively + if (recursive && excludes.length === 0) { + const watcherExcludes = configuration.getConfiguration().get('files.watcherExclude'); + if (watcherExcludes) { + for (const key in watcherExcludes) { + if (key && watcherExcludes[key] === true) { + excludes.push(key); + } + } + } + } + + // Non-recursive watching inside the workspace will overlap with + // our standard workspace watchers. To prevent duplicate events, + // we only want to include events for files that are otherwise + // excluded via `files.watcherExclude`. As such, we configure + // to include each configured exclude pattern so that only those + // events are reported that are otherwise excluded. + // However, we cannot just use the pattern as is, because a pattern + // such as `bar` for a exclude, will work to exclude any of + // `/bar` but will not work as include for files within + // `bar` unless a suffix of `/**` if added. + // (https://github.com/microsoft/vscode/issues/148245) + else if (!recursive) { + const workspaceUri = workspace.getWorkspaceFolder(URI.revive(globPattern.baseUri))?.uri; + if (workspaceUri) { + const watcherExcludes = configuration.getConfiguration().get('files.watcherExclude'); + if (watcherExcludes) { + for (const key in watcherExcludes) { + if (key && watcherExcludes[key] === true) { + const includePattern = `${rtrim(key, '/')}/${GLOBSTAR}`; + if (!includes) { + includes = []; + } + + includes.push(normalizeWatcherPattern(workspaceUri.fsPath, includePattern)); + } + } + } + + // Still ignore watch request if there are actually no configured + // exclude rules, because in that case our default recursive watcher + // should be able to take care of all events. + if (!includes || includes.length === 0) { + return disposable; + } + } + } + } + + proxy.$watch(extension.identifier.value, this.session, globPattern.baseUri, { recursive, excludes, includes, filter }, Boolean(correlate)); return Disposable.from({ dispose: () => proxy.$unwatch(this.session) }); } @@ -220,8 +282,8 @@ export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServ //--- file events - createFileSystemWatcher(workspace: IExtHostWorkspace, extension: IExtensionDescription, globPattern: vscode.GlobPattern, options?: FileSystemWatcherCreateOptions): vscode.FileSystemWatcher { - return new FileSystemWatcher(this._mainContext, workspace, extension, this._onFileSystemEvent.event, typeConverter.GlobPattern.from(globPattern), options); + createFileSystemWatcher(workspace: IExtHostWorkspace, configProvider: ExtHostConfigProvider, extension: IExtensionDescription, globPattern: vscode.GlobPattern, options: FileSystemWatcherCreateOptions): vscode.FileSystemWatcher { + return new FileSystemWatcher(this._mainContext, configProvider, workspace, extension, this._onFileSystemEvent.event, typeConverter.GlobPattern.from(globPattern), options); } $onFileEvent(events: FileSystemEvents) { diff --git a/src/vs/workbench/api/common/extHostFileSystemInfo.ts b/src/vs/workbench/api/common/extHostFileSystemInfo.ts index 2fa583c672e..5aeabdd9d50 100644 --- a/src/vs/workbench/api/common/extHostFileSystemInfo.ts +++ b/src/vs/workbench/api/common/extHostFileSystemInfo.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Schemas } from 'vs/base/common/network'; -import { ExtUri, IExtUri } from 'vs/base/common/resources'; -import { UriComponents } from 'vs/base/common/uri'; -import { FileSystemProviderCapabilities } from 'vs/platform/files/common/files'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ExtHostFileSystemInfoShape } from 'vs/workbench/api/common/extHost.protocol'; +import { Schemas } from '../../../base/common/network.js'; +import { ExtUri, IExtUri } from '../../../base/common/resources.js'; +import { UriComponents } from '../../../base/common/uri.js'; +import { FileSystemProviderCapabilities } from '../../../platform/files/common/files.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ExtHostFileSystemInfoShape } from './extHost.protocol.js'; export class ExtHostFileSystemInfo implements ExtHostFileSystemInfoShape { diff --git a/src/vs/workbench/api/common/extHostInitDataService.ts b/src/vs/workbench/api/common/extHostInitDataService.ts index 5b7f1ebfa03..49a45f019fa 100644 --- a/src/vs/workbench/api/common/extHostInitDataService.ts +++ b/src/vs/workbench/api/common/extHostInitDataService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IExtensionHostInitData } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IExtensionHostInitData } from '../../services/extensions/common/extensionHostProtocol.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; export const IExtHostInitDataService = createDecorator('IExtHostInitDataService'); diff --git a/src/vs/workbench/api/common/extHostInteractive.ts b/src/vs/workbench/api/common/extHostInteractive.ts index 63296ab1030..0debcfa5b6c 100644 --- a/src/vs/workbench/api/common/extHostInteractive.ts +++ b/src/vs/workbench/api/common/extHostInteractive.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostInteractiveShape, IMainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { ApiCommand, ApiCommandArgument, ApiCommandResult, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { ExtHostNotebookController } from 'vs/workbench/api/common/extHostNotebook'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ExtHostInteractiveShape, IMainContext } from './extHost.protocol.js'; +import { ApiCommand, ApiCommandArgument, ApiCommandResult, ExtHostCommands } from './extHostCommands.js'; +import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import { ExtHostNotebookController } from './extHostNotebook.js'; import { NotebookEditor } from 'vscode'; export class ExtHostInteractive implements ExtHostInteractiveShape { diff --git a/src/vs/workbench/api/common/extHostLabelService.ts b/src/vs/workbench/api/common/extHostLabelService.ts index 3a7eec9b5a1..66b0e088802 100644 --- a/src/vs/workbench/api/common/extHostLabelService.ts +++ b/src/vs/workbench/api/common/extHostLabelService.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ResourceLabelFormatter } from 'vs/platform/label/common/label'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { MainThreadLabelServiceShape, ExtHostLabelServiceShape, MainContext, IMainContext } from 'vs/workbench/api/common/extHost.protocol'; +import { ResourceLabelFormatter } from '../../../platform/label/common/label.js'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { MainThreadLabelServiceShape, ExtHostLabelServiceShape, MainContext, IMainContext } from './extHost.protocol.js'; export class ExtHostLabelService implements ExtHostLabelServiceShape { diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index efa09624c15..f240f493a69 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -3,40 +3,40 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { asArray, coalesce, isFalsyOrEmpty, isNonEmptyArray } from 'vs/base/common/arrays'; -import { raceCancellationError } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { NotImplementedError, isCancellationError } from 'vs/base/common/errors'; -import { IdGenerator } from 'vs/base/common/idGenerator'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { equals, mixin } from 'vs/base/common/objects'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { regExpLeadsToEndlessLoop } from 'vs/base/common/strings'; -import { assertType, isObject } from 'vs/base/common/types'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { IPosition } from 'vs/editor/common/core/position'; -import { Range as EditorRange, IRange } from 'vs/editor/common/core/range'; -import { ISelection, Selection } from 'vs/editor/common/core/selection'; -import * as languages from 'vs/editor/common/languages'; -import { IAutoClosingPairConditional } from 'vs/editor/common/languages/languageConfiguration'; -import { encodeSemanticTokensDto } from 'vs/editor/common/services/semanticTokensDto'; -import { localize } from 'vs/nls'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IExtHostApiDeprecationService } from 'vs/workbench/api/common/extHostApiDeprecationService'; -import { CommandsConverter, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { ExtHostDiagnostics } from 'vs/workbench/api/common/extHostDiagnostics'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { ExtHostTelemetry, IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; -import { CodeActionKind, CompletionList, Disposable, DocumentDropOrPasteEditKind, DocumentSymbol, InlineCompletionTriggerKind, InlineEditTriggerKind, InternalDataTransferItem, Location, NewSymbolNameTriggerKind, Range, SemanticTokens, SemanticTokensEdit, SemanticTokensEdits, SnippetString, SymbolInformation, SyntaxTokenType } from 'vs/workbench/api/common/extHostTypes'; -import { checkProposedApiEnabled, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; +import { asArray, coalesce, isFalsyOrEmpty, isNonEmptyArray } from '../../../base/common/arrays.js'; +import { raceCancellationError } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { NotImplementedError, isCancellationError } from '../../../base/common/errors.js'; +import { IdGenerator } from '../../../base/common/idGenerator.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { equals, mixin } from '../../../base/common/objects.js'; +import { StopWatch } from '../../../base/common/stopwatch.js'; +import { regExpLeadsToEndlessLoop } from '../../../base/common/strings.js'; +import { assertType, isObject } from '../../../base/common/types.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IURITransformer } from '../../../base/common/uriIpc.js'; +import { ISingleEditOperation } from '../../../editor/common/core/editOperation.js'; +import { IPosition } from '../../../editor/common/core/position.js'; +import { Range as EditorRange, IRange } from '../../../editor/common/core/range.js'; +import { ISelection, Selection } from '../../../editor/common/core/selection.js'; +import * as languages from '../../../editor/common/languages.js'; +import { IAutoClosingPairConditional } from '../../../editor/common/languages/languageConfiguration.js'; +import { encodeSemanticTokensDto } from '../../../editor/common/services/semanticTokensDto.js'; +import { localize } from '../../../nls.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IExtHostApiDeprecationService } from './extHostApiDeprecationService.js'; +import { CommandsConverter, ExtHostCommands } from './extHostCommands.js'; +import { ExtHostDiagnostics } from './extHostDiagnostics.js'; +import { ExtHostDocuments } from './extHostDocuments.js'; +import { ExtHostTelemetry, IExtHostTelemetry } from './extHostTelemetry.js'; +import * as typeConvert from './extHostTypeConverters.js'; +import { CodeActionKind, CompletionList, Disposable, DocumentDropOrPasteEditKind, DocumentSymbol, InlineCompletionTriggerKind, InlineEditTriggerKind, InternalDataTransferItem, Location, NewSymbolNameTriggerKind, Range, SemanticTokens, SemanticTokensEdit, SemanticTokensEdits, SnippetString, SymbolInformation, SyntaxTokenType } from './extHostTypes.js'; +import { checkProposedApiEnabled, isProposedApiEnabled } from '../../services/extensions/common/extensions.js'; import type * as vscode from 'vscode'; -import { Cache } from './cache'; -import * as extHostProtocol from './extHost.protocol'; +import { Cache } from './cache.js'; +import * as extHostProtocol from './extHost.protocol.js'; // --- adapter @@ -1313,7 +1313,7 @@ class InlineCompletionAdapterBase { return undefined; } - async provideInlineEdits(resource: URI, range: IRange, context: languages.InlineCompletionContext, token: CancellationToken): Promise { + async provideInlineEditsForRange(resource: URI, range: IRange, context: languages.InlineCompletionContext, token: CancellationToken): Promise { return undefined; } @@ -1422,8 +1422,8 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase { }; } - override async provideInlineEdits(resource: URI, range: IRange, context: languages.InlineCompletionContext, token: CancellationToken): Promise { - if (!this._provider.provideInlineEdits) { + override async provideInlineEditsForRange(resource: URI, range: IRange, context: languages.InlineCompletionContext, token: CancellationToken): Promise { + if (!this._provider.provideInlineEditsForRange) { return undefined; } checkProposedApiEnabled(this._extension, 'inlineCompletionsAdditions'); @@ -1431,7 +1431,7 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase { const doc = this._documents.getDocument(resource); const r = typeConvert.Range.to(range); - const result = await this._provider.provideInlineEdits(doc, r, { + const result = await this._provider.provideInlineEditsForRange(doc, r, { selectedCompletionInfo: context.selectedSuggestionInfo ? { @@ -2180,19 +2180,32 @@ class MappedEditsAdapter { const uri = URI.revive(resource); const doc = this._documents.getDocument(uri); - const usedContext = context.documents.map((docSubArray) => - docSubArray.map((r) => { - return { - uri: URI.revive(r.uri), - version: r.version, - ranges: r.ranges.map((range) => typeConvert.Range.to(range)), - }; - }) - ); + const reviveContextItem = (item: extHostProtocol.IDocumentContextItemDto) => ({ + uri: URI.revive(item.uri), + version: item.version, + ranges: item.ranges.map(r => typeConvert.Range.to(r)), + } satisfies vscode.DocumentContextItem); + + + const usedContext = context.documents.map(docSubArray => docSubArray.map(reviveContextItem)); const ctx = { documents: usedContext, - selections: usedContext[0]?.[0]?.ranges ?? [] // @ulugbekna: this is a hack for backward compatibility + selections: usedContext[0]?.[0]?.ranges ?? [], // @ulugbekna: this is a hack for backward compatibility + conversation: context.conversation?.map(c => { + if (c.type === 'response') { + return { + type: 'response', + message: c.message, + references: c.references?.map(reviveContextItem) + } satisfies vscode.ConversationResponse; + } else { + return { + type: 'request', + message: c.message, + } satisfies vscode.ConversationRequest; + } + }) }; const mappedEdits = await this._provider.provideMappedEdits(doc, codeBlocks, ctx, token); @@ -2372,15 +2385,15 @@ export class ExtHostLanguageFeatures implements extHostProtocol.ExtHostLanguageF } $provideCodeLenses(handle: number, resource: UriComponents, token: CancellationToken): Promise { - return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.provideCodeLenses(URI.revive(resource), token), undefined, token); + return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.provideCodeLenses(URI.revive(resource), token), undefined, token, resource.scheme === 'output'); } $resolveCodeLens(handle: number, symbol: extHostProtocol.ICodeLensDto, token: CancellationToken): Promise { - return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.resolveCodeLens(symbol, token), undefined, undefined); + return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.resolveCodeLens(symbol, token), undefined, undefined, true); } $releaseCodeLenses(handle: number, cacheId: number): void { - this._withAdapter(handle, CodeLensAdapter, adapter => Promise.resolve(adapter.releaseCodeLenses(cacheId)), undefined, undefined); + this._withAdapter(handle, CodeLensAdapter, adapter => Promise.resolve(adapter.releaseCodeLenses(cacheId)), undefined, undefined, true); } // --- declaration @@ -2745,8 +2758,8 @@ export class ExtHostLanguageFeatures implements extHostProtocol.ExtHostLanguageF return this._withAdapter(handle, InlineCompletionAdapterBase, adapter => adapter.provideInlineCompletions(URI.revive(resource), position, context, token), undefined, token); } - $provideInlineEdits(handle: number, resource: UriComponents, range: IRange, context: languages.InlineCompletionContext, token: CancellationToken): Promise { - return this._withAdapter(handle, InlineCompletionAdapterBase, adapter => adapter.provideInlineEdits(URI.revive(resource), range, context, token), undefined, token); + $provideInlineEditsForRange(handle: number, resource: UriComponents, range: IRange, context: languages.InlineCompletionContext, token: CancellationToken): Promise { + return this._withAdapter(handle, InlineCompletionAdapterBase, adapter => adapter.provideInlineEditsForRange(URI.revive(resource), range, context, token), undefined, token); } $handleInlineCompletionDidShow(handle: number, pid: number, idx: number, updatedInsertText: string): void { @@ -2982,7 +2995,7 @@ export class ExtHostLanguageFeatures implements extHostProtocol.ExtHostLanguageF registerMappedEditsProvider(extension: IExtensionDescription, selector: vscode.DocumentSelector, provider: vscode.MappedEditsProvider): vscode.Disposable { const handle = this._addNewAdapter(new MappedEditsAdapter(this._documents, provider), extension); - this._proxy.$registerMappedEditsProvider(handle, this._transformDocumentSelector(selector, extension)); + this._proxy.$registerMappedEditsProvider(handle, this._transformDocumentSelector(selector, extension), extension.displayName ?? extension.name); return this._createDisposable(handle); } diff --git a/src/vs/workbench/api/common/extHostLanguageModelTools.ts b/src/vs/workbench/api/common/extHostLanguageModelTools.ts index e588f50ab6d..56725b94d09 100644 --- a/src/vs/workbench/api/common/extHostLanguageModelTools.ts +++ b/src/vs/workbench/api/common/extHostLanguageModelTools.ts @@ -3,44 +3,70 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostLanguageModelToolsShape, IMainContext, MainContext, MainThreadLanguageModelToolsShape } from 'vs/workbench/api/common/extHost.protocol'; -import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; -import { IToolData, IToolDelta } from 'vs/workbench/contrib/chat/common/languageModelToolsService'; +import { raceCancellation } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { CancellationError } from '../../../base/common/errors.js'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostLanguageModelToolsShape, IMainContext, IToolDataDto, MainContext, MainThreadLanguageModelToolsShape } from './extHost.protocol.js'; +import * as typeConvert from './extHostTypeConverters.js'; +import { IToolInvocation, IToolInvocationContext, IToolResult } from '../../contrib/chat/common/languageModelToolsService.js'; import type * as vscode from 'vscode'; export class ExtHostLanguageModelTools implements ExtHostLanguageModelToolsShape { /** A map of tools that were registered in this EH */ private readonly _registeredTools = new Map(); private readonly _proxy: MainThreadLanguageModelToolsShape; + private readonly _tokenCountFuncs = new Map Thenable>(); /** A map of all known tools, from other EHs or registered in vscode core */ - private readonly _allTools = new Map(); + private readonly _allTools = new Map(); constructor(mainContext: IMainContext) { this._proxy = mainContext.getProxy(MainContext.MainThreadLanguageModelTools); this._proxy.$getTools().then(tools => { for (const tool of tools) { - this._allTools.set(tool.name, tool); + this._allTools.set(tool.id, revive(tool)); } }); } - async invokeTool(name: string, parameters: any, token: CancellationToken): Promise { - // Making the round trip here because not all tools were necessarily registered in this EH - return await this._proxy.$invokeTool(name, parameters, token); + async $countTokensForInvocation(callId: string, input: string, token: CancellationToken): Promise { + const fn = this._tokenCountFuncs.get(callId); + if (!fn) { + throw new Error(`Tool invocation call ${callId} not found`); + } + + return await fn(input, token); } - async $acceptToolDelta(delta: IToolDelta): Promise { - if (delta.added) { - this._allTools.set(delta.added.name, delta.added); + async invokeTool(toolId: string, options: vscode.LanguageModelToolInvocationOptions, token: CancellationToken): Promise { + const callId = generateUuid(); + if (options.tokenOptions) { + this._tokenCountFuncs.set(callId, options.tokenOptions.countTokens); + } + try { + // Making the round trip here because not all tools were necessarily registered in this EH + const result = await this._proxy.$invokeTool({ + toolId, + callId, + parameters: options.parameters, + tokenBudget: options.tokenOptions?.tokenBudget, + context: options.toolInvocationToken as IToolInvocationContext | undefined, + }, token); + return typeConvert.LanguageModelToolResult.to(result); + } finally { + this._tokenCountFuncs.delete(callId); } + } - if (delta.removed) { - this._allTools.delete(delta.removed); + $onDidChangeTools(tools: IToolDataDto[]): void { + this._allTools.clear(); + for (const tool of tools) { + this._allTools.set(tool.id, tool); } } @@ -49,13 +75,40 @@ export class ExtHostLanguageModelTools implements ExtHostLanguageModelToolsShape .map(tool => typeConvert.LanguageModelToolDescription.to(tool)); } - async $invokeTool(name: string, parameters: any, token: CancellationToken): Promise { - const item = this._registeredTools.get(name); + async $invokeTool(dto: IToolInvocation, token: CancellationToken): Promise { + const item = this._registeredTools.get(dto.toolId); if (!item) { - throw new Error(`Unknown tool ${name}`); + throw new Error(`Unknown tool ${dto.toolId}`); + } + + const options: vscode.LanguageModelToolInvocationOptions = { parameters: dto.parameters, toolInvocationToken: dto.context }; + if (dto.tokenBudget !== undefined) { + options.tokenOptions = { + tokenBudget: dto.tokenBudget, + countTokens: this._tokenCountFuncs.get(dto.callId) || ((value, token = CancellationToken.None) => + this._proxy.$countTokensForInvocation(dto.callId, value, token)) + }; + } + + // Some participant in extHostChatAgents calls invokeTool, goes to extHostLMTools + // mainThreadLMTools invokes the tool, which calls back to extHostLMTools + // The tool requests permission + // The tool in extHostLMTools calls for permission back to mainThreadLMTools + // And back to extHostLMTools, and back to the participant in extHostChatAgents + // Is there a tool call ID to identify the call? + const extensionResult = await raceCancellation(Promise.resolve(item.tool.invoke(options, token)), token); + if (!extensionResult) { + throw new CancellationError(); + } + + for (const key of Object.keys(extensionResult)) { + const value = extensionResult[key]; + if (value instanceof Promise) { + throw new Error(`Tool result for '${key}' cannot be a Promise`); + } } - return await item.tool.invoke(parameters, token); + return typeConvert.LanguageModelToolResult.from(extensionResult); } registerTool(extension: IExtensionDescription, name: string, tool: vscode.LanguageModelTool): IDisposable { diff --git a/src/vs/workbench/api/common/extHostLanguageModels.ts b/src/vs/workbench/api/common/extHostLanguageModels.ts index b67999350af..d8cc94ef22f 100644 --- a/src/vs/workbench/api/common/extHostLanguageModels.ts +++ b/src/vs/workbench/api/common/extHostLanguageModels.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AsyncIterableObject, AsyncIterableSource } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { CancellationError, SerializedError, transformErrorForSerialization, transformErrorFromSerialization } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Iterable } from 'vs/base/common/iterator'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { localize } from 'vs/nls'; -import { ExtensionIdentifier, ExtensionIdentifierMap, ExtensionIdentifierSet, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Progress } from 'vs/platform/progress/common/progress'; -import { ExtHostLanguageModelsShape, MainContext, MainThreadLanguageModelsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostAuthentication } from 'vs/workbench/api/common/extHostAuthentication'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { IChatMessage, IChatResponseFragment, IChatResponsePart, ILanguageModelChatMetadata } from 'vs/workbench/contrib/chat/common/languageModels'; -import { INTERNAL_AUTH_PROVIDER_PREFIX } from 'vs/workbench/services/authentication/common/authentication'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; +import { AsyncIterableObject, AsyncIterableSource } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { toErrorMessage } from '../../../base/common/errorMessage.js'; +import { CancellationError, SerializedError, transformErrorForSerialization, transformErrorFromSerialization } from '../../../base/common/errors.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Iterable } from '../../../base/common/iterator.js'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { localize } from '../../../nls.js'; +import { ExtensionIdentifier, ExtensionIdentifierMap, ExtensionIdentifierSet, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { Progress } from '../../../platform/progress/common/progress.js'; +import { ExtHostLanguageModelsShape, MainContext, MainThreadLanguageModelsShape } from './extHost.protocol.js'; +import { IExtHostAuthentication } from './extHostAuthentication.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import * as typeConvert from './extHostTypeConverters.js'; +import * as extHostTypes from './extHostTypes.js'; +import { IChatMessage, IChatResponseFragment, IChatResponsePart, ILanguageModelChatMetadata } from '../../contrib/chat/common/languageModels.js'; +import { INTERNAL_AUTH_PROVIDER_PREFIX } from '../../services/authentication/common/authentication.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; import type * as vscode from 'vscode'; export interface IExtHostLanguageModels extends ExtHostLanguageModels { } @@ -37,13 +37,13 @@ type LanguageModelData = { class LanguageModelResponseStream { - readonly stream = new AsyncIterableSource(); + readonly stream = new AsyncIterableSource(); constructor( readonly option: number, - stream?: AsyncIterableSource + stream?: AsyncIterableSource ) { - this.stream = stream ?? new AsyncIterableSource(); + this.stream = stream ?? new AsyncIterableSource(); } } @@ -52,7 +52,7 @@ class LanguageModelResponse { readonly apiObject: vscode.LanguageModelChatResponse; private readonly _responseStreams = new Map(); - private readonly _defaultStream = new AsyncIterableSource(); + private readonly _defaultStream = new AsyncIterableSource(); private _isDone: boolean = false; constructor() { @@ -100,11 +100,11 @@ class LanguageModelResponse { this._responseStreams.set(fragment.index, res); } - let out: vscode.LanguageModelChatResponseTextPart | vscode.LanguageModelChatResponseFunctionUsePart; + let out: vscode.LanguageModelChatResponseTextPart | vscode.LanguageModelChatResponseToolCallPart; if (fragment.part.type === 'text') { out = new extHostTypes.LanguageModelTextPart(fragment.part.value); } else { - out = new extHostTypes.LanguageModelFunctionUsePart(fragment.part.name, fragment.part.parameters); + out = new extHostTypes.LanguageModelToolCallPart(fragment.part.name, fragment.part.toolCallId, fragment.part.parameters); } res.stream.emitOne(out); } @@ -175,7 +175,9 @@ export class ExtHostLanguageModels implements ExtHostLanguageModelsShape { maxInputTokens: metadata.maxInputTokens, maxOutputTokens: metadata.maxOutputTokens, auth, - targetExtensions: metadata.extensions + targetExtensions: metadata.extensions, + isDefault: metadata.isDefault, + isUserSelectable: metadata.isUserSelectable, }); const responseReceivedListener = provider.onDidReceiveLanguageModelResponse2?.(({ extensionId, participant, tokenCount }) => { @@ -201,8 +203,8 @@ export class ExtHostLanguageModels implements ExtHostLanguageModelsShape { } let part: IChatResponsePart | undefined; - if (fragment.part instanceof extHostTypes.LanguageModelFunctionUsePart) { - part = { type: 'function_use', name: fragment.part.name, parameters: fragment.part.parameters }; + if (fragment.part instanceof extHostTypes.LanguageModelToolCallPart) { + part = { type: 'tool_use', name: fragment.part.name, parameters: fragment.part.parameters, toolCallId: fragment.part.toolCallId }; } else if (fragment.part instanceof extHostTypes.LanguageModelTextPart) { part = { type: 'text', value: fragment.part.value }; } @@ -396,7 +398,7 @@ export class ExtHostLanguageModels implements ExtHostLanguageModelsShape { if (message.role as number === extHostTypes.LanguageModelChatMessageRole.System) { checkProposedApiEnabled(extension, 'languageModelSystem'); } - if (message.content2 instanceof extHostTypes.LanguageModelFunctionResultPart) { + if (message.content2.some(part => part instanceof extHostTypes.LanguageModelToolResultPart)) { checkProposedApiEnabled(extension, 'lmTools'); } internalMessages.push(typeConvert.LanguageModelChatMessage.from(message)); diff --git a/src/vs/workbench/api/common/extHostLanguages.ts b/src/vs/workbench/api/common/extHostLanguages.ts index 78c5be8415e..c8dadb3f883 100644 --- a/src/vs/workbench/api/common/extHostLanguages.ts +++ b/src/vs/workbench/api/common/extHostLanguages.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MainContext, MainThreadLanguagesShape, IMainContext, ExtHostLanguagesShape } from './extHost.protocol'; +import { MainContext, MainThreadLanguagesShape, IMainContext, ExtHostLanguagesShape } from './extHost.protocol.js'; import type * as vscode from 'vscode'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; -import { StandardTokenType, Range, Position, LanguageStatusSeverity } from 'vs/workbench/api/common/extHostTypes'; -import Severity from 'vs/base/common/severity'; -import { disposableTimeout } from 'vs/base/common/async'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { CommandsConverter } from 'vs/workbench/api/common/extHostCommands'; -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; +import { ExtHostDocuments } from './extHostDocuments.js'; +import * as typeConvert from './extHostTypeConverters.js'; +import { StandardTokenType, Range, Position, LanguageStatusSeverity } from './extHostTypes.js'; +import Severity from '../../../base/common/severity.js'; +import { disposableTimeout } from '../../../base/common/async.js'; +import { DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { CommandsConverter } from './extHostCommands.js'; +import { IURITransformer } from '../../../base/common/uriIpc.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; export class ExtHostLanguages implements ExtHostLanguagesShape { diff --git a/src/vs/workbench/api/common/extHostLocalizationService.ts b/src/vs/workbench/api/common/extHostLocalizationService.ts index 6ed204b58dd..754a6e713a4 100644 --- a/src/vs/workbench/api/common/extHostLocalizationService.ts +++ b/src/vs/workbench/api/common/extHostLocalizationService.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { LANGUAGE_DEFAULT } from 'vs/base/common/platform'; -import { format2 } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostLocalizationShape, IStringDetails, MainContext, MainThreadLocalizationShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; +import { LANGUAGE_DEFAULT } from '../../../base/common/platform.js'; +import { format2 } from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ExtHostLocalizationShape, IStringDetails, MainContext, MainThreadLocalizationShape } from './extHost.protocol.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; export class ExtHostLocalizationService implements ExtHostLocalizationShape { readonly _serviceBrand: undefined; diff --git a/src/vs/workbench/api/common/extHostLogService.ts b/src/vs/workbench/api/common/extHostLogService.ts index d4baa5ae864..54a6c3d0d93 100644 --- a/src/vs/workbench/api/common/extHostLogService.ts +++ b/src/vs/workbench/api/common/extHostLogService.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { ILoggerService } from 'vs/platform/log/common/log'; -import { LogService } from 'vs/platform/log/common/logService'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; +import { localize } from '../../../nls.js'; +import { ILoggerService } from '../../../platform/log/common/log.js'; +import { LogService } from '../../../platform/log/common/logService.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; export class ExtHostLogService extends LogService { diff --git a/src/vs/workbench/api/common/extHostLoggerService.ts b/src/vs/workbench/api/common/extHostLoggerService.ts index 1d7b4288378..87ee751612a 100644 --- a/src/vs/workbench/api/common/extHostLoggerService.ts +++ b/src/vs/workbench/api/common/extHostLoggerService.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ILogger, ILoggerOptions, AbstractMessageLogger, LogLevel, AbstractLoggerService } from 'vs/platform/log/common/log'; -import { MainThreadLoggerShape, MainContext, ExtHostLogLevelServiceShape as ExtHostLogLevelServiceShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { revive } from 'vs/base/common/marshalling'; +import { ILogger, ILoggerOptions, AbstractMessageLogger, LogLevel, AbstractLoggerService } from '../../../platform/log/common/log.js'; +import { MainThreadLoggerShape, MainContext, ExtHostLogLevelServiceShape as ExtHostLogLevelServiceShape } from './extHost.protocol.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { revive } from '../../../base/common/marshalling.js'; export class ExtHostLoggerService extends AbstractLoggerService implements ExtHostLogLevelServiceShape { diff --git a/src/vs/workbench/api/common/extHostManagedSockets.ts b/src/vs/workbench/api/common/extHostManagedSockets.ts index d2f028df19e..6b020bca21d 100644 --- a/src/vs/workbench/api/common/extHostManagedSockets.ts +++ b/src/vs/workbench/api/common/extHostManagedSockets.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ExtHostManagedSocketsShape, MainContext, MainThreadManagedSocketsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { ExtHostManagedSocketsShape, MainContext, MainThreadManagedSocketsShape } from './extHost.protocol.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; import * as vscode from 'vscode'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { VSBuffer } from 'vs/base/common/buffer'; +import { Disposable, DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; export interface IExtHostManagedSockets extends ExtHostManagedSocketsShape { setFactory(socketFactoryId: number, makeConnection: () => Thenable): void; diff --git a/src/vs/workbench/api/common/extHostMemento.ts b/src/vs/workbench/api/common/extHostMemento.ts index c309007bc30..e1dc4f27947 100644 --- a/src/vs/workbench/api/common/extHostMemento.ts +++ b/src/vs/workbench/api/common/extHostMemento.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { ExtHostStorage } from 'vs/workbench/api/common/extHostStorage'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { DeferredPromise, RunOnceScheduler } from 'vs/base/common/async'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import { ExtHostStorage } from './extHostStorage.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { DeferredPromise, RunOnceScheduler } from '../../../base/common/async.js'; export class ExtensionMemento implements vscode.Memento { diff --git a/src/vs/workbench/api/common/extHostMessageService.ts b/src/vs/workbench/api/common/extHostMessageService.ts index 2503a53197a..eb84156fb74 100644 --- a/src/vs/workbench/api/common/extHostMessageService.ts +++ b/src/vs/workbench/api/common/extHostMessageService.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import Severity from 'vs/base/common/severity'; +import Severity from '../../../base/common/severity.js'; import type * as vscode from 'vscode'; -import { MainContext, MainThreadMessageServiceShape, MainThreadMessageOptions, IMainContext } from './extHost.protocol'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; +import { MainContext, MainThreadMessageServiceShape, MainThreadMessageOptions, IMainContext } from './extHost.protocol.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; function isMessageItem(item: any): item is vscode.MessageItem { return item && item.title; diff --git a/src/vs/workbench/api/common/extHostModelSelection.ts b/src/vs/workbench/api/common/extHostModelSelection.ts index c72486f2088..49fbbefd8fb 100644 --- a/src/vs/workbench/api/common/extHostModelSelection.ts +++ b/src/vs/workbench/api/common/extHostModelSelection.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { ExtHostModelSelectionShape, IMainContext, MainContext, MainThreadModelSelectionShape } from 'vs/workbench/api/common/extHost.protocol'; -import { Emitter } from 'vs/base/common/event'; +import { Emitter } from '../../../base/common/event.js'; +import { ExtHostModelSelectionShape, IMainContext, MainContext, MainThreadModelSelectionShape } from './extHost.protocol.js'; export class ExtHostModelSelection implements ExtHostModelSelectionShape { private readonly _onModelSelectionChange = new Emitter(); diff --git a/src/vs/workbench/api/common/extHostNotebook.ts b/src/vs/workbench/api/common/extHostNotebook.ts index 5b707fc865e..75b64857223 100644 --- a/src/vs/workbench/api/common/extHostNotebook.ts +++ b/src/vs/workbench/api/common/extHostNotebook.ts @@ -3,41 +3,41 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IRelativePattern } from 'vs/base/common/glob'; -import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ResourceMap, ResourceSet } from 'vs/base/common/map'; -import { MarshalledId } from 'vs/base/common/marshallingIds'; -import { isFalsyOrWhitespace } from 'vs/base/common/strings'; -import { assertIsDefined } from 'vs/base/common/types'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import * as files from 'vs/platform/files/common/files'; -import { Cache } from 'vs/workbench/api/common/cache'; -import { ExtHostNotebookShape, IMainContext, IModelAddedData, INotebookCellStatusBarListDto, INotebookDocumentsAndEditorsDelta, INotebookDocumentShowOptions, INotebookEditorAddData, INotebookPartialFileStatsWithMetadata, MainContext, MainThreadNotebookDocumentsShape, MainThreadNotebookEditorsShape, MainThreadNotebookShape, NotebookDataDto } from 'vs/workbench/api/common/extHost.protocol'; -import { ApiCommand, ApiCommandArgument, ApiCommandResult, CommandsConverter, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { INotebookExclusiveDocumentFilter, INotebookContributionData } from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { localize } from '../../../nls.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IRelativePattern } from '../../../base/common/glob.js'; +import { DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { ResourceMap, ResourceSet } from '../../../base/common/map.js'; +import { MarshalledId } from '../../../base/common/marshallingIds.js'; +import { isFalsyOrWhitespace } from '../../../base/common/strings.js'; +import { assertIsDefined } from '../../../base/common/types.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import * as files from '../../../platform/files/common/files.js'; +import { Cache } from './cache.js'; +import { ExtHostNotebookShape, IMainContext, IModelAddedData, INotebookCellStatusBarListDto, INotebookDocumentsAndEditorsDelta, INotebookDocumentShowOptions, INotebookEditorAddData, INotebookPartialFileStatsWithMetadata, MainContext, MainThreadNotebookDocumentsShape, MainThreadNotebookEditorsShape, MainThreadNotebookShape, NotebookDataDto } from './extHost.protocol.js'; +import { ApiCommand, ApiCommandArgument, ApiCommandResult, CommandsConverter, ExtHostCommands } from './extHostCommands.js'; +import { ExtHostDocuments } from './extHostDocuments.js'; +import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import * as typeConverters from './extHostTypeConverters.js'; +import * as extHostTypes from './extHostTypes.js'; +import { INotebookExclusiveDocumentFilter, INotebookContributionData } from '../../contrib/notebook/common/notebookCommon.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; import type * as vscode from 'vscode'; -import { ExtHostCell, ExtHostNotebookDocument } from './extHostNotebookDocument'; -import { ExtHostNotebookEditor } from './extHostNotebookEditor'; -import { IExtHostConsumerFileSystem } from 'vs/workbench/api/common/extHostFileSystemConsumer'; -import { filter } from 'vs/base/common/objects'; -import { Schemas } from 'vs/base/common/network'; -import { IFileQuery, ITextQuery, QueryType } from 'vs/workbench/services/search/common/search'; -import { IExtHostSearch } from 'vs/workbench/api/common/extHostSearch'; -import { CellSearchModel } from 'vs/workbench/contrib/search/common/cellSearchModel'; -import { INotebookCellMatchNoModel, INotebookFileMatchNoModel, IRawClosedNotebookFileMatch, genericCellMatchesToTextSearchMatches } from 'vs/workbench/contrib/search/common/searchNotebookHelpers'; -import { NotebookPriorityInfo } from 'vs/workbench/contrib/search/common/search'; -import { globMatchesResource, RegisteredEditorPriority } from 'vs/workbench/services/editor/common/editorResolverService'; -import { ILogService } from 'vs/platform/log/common/log'; +import { ExtHostCell, ExtHostNotebookDocument } from './extHostNotebookDocument.js'; +import { ExtHostNotebookEditor } from './extHostNotebookEditor.js'; +import { IExtHostConsumerFileSystem } from './extHostFileSystemConsumer.js'; +import { filter } from '../../../base/common/objects.js'; +import { Schemas } from '../../../base/common/network.js'; +import { IFileQuery, ITextQuery, QueryType } from '../../services/search/common/search.js'; +import { IExtHostSearch } from './extHostSearch.js'; +import { CellSearchModel } from '../../contrib/search/common/cellSearchModel.js'; +import { INotebookCellMatchNoModel, INotebookFileMatchNoModel, IRawClosedNotebookFileMatch, genericCellMatchesToTextSearchMatches } from '../../contrib/search/common/searchNotebookHelpers.js'; +import { NotebookPriorityInfo } from '../../contrib/search/common/search.js'; +import { globMatchesResource, RegisteredEditorPriority } from '../../services/editor/common/editorResolverService.js'; +import { ILogService } from '../../../platform/log/common/log.js'; export class ExtHostNotebookController implements ExtHostNotebookShape { private static _notebookStatusBarItemProviderHandlePool: number = 0; @@ -145,8 +145,6 @@ export class ExtHostNotebookController implements ExtHostNotebookShape { return result; } - - private static _convertNotebookRegistrationData(extension: IExtensionDescription, registration: vscode.NotebookRegistrationData | undefined): INotebookContributionData | undefined { if (!registration) { return; @@ -205,28 +203,29 @@ export class ExtHostNotebookController implements ExtHostNotebookShape { return assertIsDefined(document?.apiNotebook); } - - async showNotebookDocument(notebookOrUri: vscode.NotebookDocument | URI, options?: vscode.NotebookDocumentShowOptions): Promise { - - if (URI.isUri(notebookOrUri)) { - notebookOrUri = await this.openNotebookDocument(notebookOrUri); - } - + async showNotebookDocument(notebook: vscode.NotebookDocument, options?: vscode.NotebookDocumentShowOptions): Promise { let resolvedOptions: INotebookDocumentShowOptions; if (typeof options === 'object') { resolvedOptions = { position: typeConverters.ViewColumn.from(options.viewColumn), preserveFocus: options.preserveFocus, selections: options.selections && options.selections.map(typeConverters.NotebookRange.from), - pinned: typeof options.preview === 'boolean' ? !options.preview : undefined + pinned: typeof options.preview === 'boolean' ? !options.preview : undefined, + label: typeof options.asRepl === 'string' ? + options.asRepl : + typeof options.asRepl === 'object' ? + options.asRepl.label : + undefined, }; } else { resolvedOptions = { - preserveFocus: false + preserveFocus: false, + pinned: true }; } - const editorId = await this._notebookEditorsProxy.$tryShowNotebookDocument(notebookOrUri.uri, notebookOrUri.notebookType, resolvedOptions); + const viewType = !!options?.asRepl ? 'repl' : notebook.notebookType; + const editorId = await this._notebookEditorsProxy.$tryShowNotebookDocument(notebook.uri, viewType, resolvedOptions); const editor = editorId && this._editors.get(editorId)?.apiEditor; if (editor) { @@ -234,9 +233,9 @@ export class ExtHostNotebookController implements ExtHostNotebookShape { } if (editorId) { - throw new Error(`Could NOT open editor for "${notebookOrUri.uri.toString()}" because another editor opened in the meantime.`); + throw new Error(`Could NOT open editor for "${notebook.uri.toString()}" because another editor opened in the meantime.`); } else { - throw new Error(`Could NOT open editor for "${notebookOrUri.uri.toString()}".`); + throw new Error(`Could NOT open editor for "${notebook.uri.toString()}".`); } } @@ -593,7 +592,8 @@ export class ExtHostNotebookController implements ExtHostNotebookShape { document, data.visibleRanges.map(typeConverters.NotebookRange.to), data.selections.map(typeConverters.NotebookRange.to), - typeof data.viewColumn === 'number' ? typeConverters.ViewColumn.to(data.viewColumn) : undefined + typeof data.viewColumn === 'number' ? typeConverters.ViewColumn.to(data.viewColumn) : undefined, + data.viewType ); this._editors.set(editorId, editor); diff --git a/src/vs/workbench/api/common/extHostNotebookDocument.ts b/src/vs/workbench/api/common/extHostNotebookDocument.ts index 8f74a0a4b69..205a899854c 100644 --- a/src/vs/workbench/api/common/extHostNotebookDocument.ts +++ b/src/vs/workbench/api/common/extHostNotebookDocument.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import * as extHostTypeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import { NotebookRange } from 'vs/workbench/api/common/extHostTypes'; -import * as notebookCommon from 'vs/workbench/contrib/notebook/common/notebookCommon'; +import { Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import * as extHostProtocol from './extHost.protocol.js'; +import { ExtHostDocuments } from './extHostDocuments.js'; +import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import * as extHostTypeConverters from './extHostTypeConverters.js'; +import { NotebookRange } from './extHostTypes.js'; +import * as notebookCommon from '../../contrib/notebook/common/notebookCommon.js'; import * as vscode from 'vscode'; class RawContentChangeEvent { @@ -211,6 +211,9 @@ export class ExtHostNotebookDocument { }, save() { return that._save(); + }, + [Symbol.for('debug.description')]() { + return `NotebookDocument(${this.uri.toString()})`; } }; this._notebook = Object.freeze(apiObject); diff --git a/src/vs/workbench/api/common/extHostNotebookDocumentSaveParticipant.ts b/src/vs/workbench/api/common/extHostNotebookDocumentSaveParticipant.ts index 0f031e2f76b..b86e6a7a90f 100644 --- a/src/vs/workbench/api/common/extHostNotebookDocumentSaveParticipant.ts +++ b/src/vs/workbench/api/common/extHostNotebookDocumentSaveParticipant.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { AsyncEmitter, Event } from 'vs/base/common/event'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostNotebookDocumentSaveParticipantShape, IWorkspaceEditDto, MainThreadBulkEditsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostNotebookController } from 'vs/workbench/api/common/extHostNotebook'; -import { TextDocumentSaveReason, WorkspaceEdit as WorksapceEditConverter } from 'vs/workbench/api/common/extHostTypeConverters'; -import { WorkspaceEdit } from 'vs/workbench/api/common/extHostTypes'; -import { SaveReason } from 'vs/workbench/common/editor'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { AsyncEmitter, Event } from '../../../base/common/event.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ExtHostNotebookDocumentSaveParticipantShape, IWorkspaceEditDto, MainThreadBulkEditsShape } from './extHost.protocol.js'; +import { ExtHostNotebookController } from './extHostNotebook.js'; +import { TextDocumentSaveReason, WorkspaceEdit as WorksapceEditConverter } from './extHostTypeConverters.js'; +import { WorkspaceEdit } from './extHostTypes.js'; +import { SaveReason } from '../../common/editor.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; import { NotebookDocumentWillSaveEvent } from 'vscode'; interface IExtensionListener { diff --git a/src/vs/workbench/api/common/extHostNotebookDocuments.ts b/src/vs/workbench/api/common/extHostNotebookDocuments.ts index b89b9cd1f55..359eb94686a 100644 --- a/src/vs/workbench/api/common/extHostNotebookDocuments.ts +++ b/src/vs/workbench/api/common/extHostNotebookDocuments.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostNotebookController } from 'vs/workbench/api/common/extHostNotebook'; -import { NotebookDocumentMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { Emitter } from '../../../base/common/event.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import * as extHostProtocol from './extHost.protocol.js'; +import { ExtHostNotebookController } from './extHostNotebook.js'; +import { NotebookDocumentMetadata } from '../../contrib/notebook/common/notebookCommon.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; import type * as vscode from 'vscode'; export class ExtHostNotebookDocuments implements extHostProtocol.ExtHostNotebookDocumentsShape { diff --git a/src/vs/workbench/api/common/extHostNotebookEditor.ts b/src/vs/workbench/api/common/extHostNotebookEditor.ts index 8472fc1006d..c4c357d14c6 100644 --- a/src/vs/workbench/api/common/extHostNotebookEditor.ts +++ b/src/vs/workbench/api/common/extHostNotebookEditor.ts @@ -3,21 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { illegalArgument } from 'vs/base/common/errors'; -import { MainThreadNotebookEditorsShape } from 'vs/workbench/api/common/extHost.protocol'; -import * as extHostConverter from 'vs/workbench/api/common/extHostTypeConverters'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; +import { illegalArgument } from '../../../base/common/errors.js'; +import { MainThreadNotebookEditorsShape } from './extHost.protocol.js'; +import * as extHostConverter from './extHostTypeConverters.js'; +import * as extHostTypes from './extHostTypes.js'; import * as vscode from 'vscode'; -import { ExtHostNotebookDocument } from './extHostNotebookDocument'; +import { ExtHostNotebookDocument } from './extHostNotebookDocument.js'; export class ExtHostNotebookEditor { public static readonly apiEditorsToExtHost = new WeakMap(); - private _selections: vscode.NotebookRange[] = []; - private _visibleRanges: vscode.NotebookRange[] = []; - private _viewColumn?: vscode.ViewColumn; - private _visible: boolean = false; private _editor?: vscode.NotebookEditor; @@ -26,14 +22,11 @@ export class ExtHostNotebookEditor { readonly id: string, private readonly _proxy: MainThreadNotebookEditorsShape, readonly notebookData: ExtHostNotebookDocument, - visibleRanges: vscode.NotebookRange[], - selections: vscode.NotebookRange[], - viewColumn: vscode.ViewColumn | undefined - ) { - this._selections = selections; - this._visibleRanges = visibleRanges; - this._viewColumn = viewColumn; - } + private _visibleRanges: vscode.NotebookRange[], + private _selections: vscode.NotebookRange[], + private _viewColumn: vscode.ViewColumn | undefined, + private readonly viewType: string + ) { } get apiEditor(): vscode.NotebookEditor { if (!this._editor) { @@ -71,6 +64,15 @@ export class ExtHostNotebookEditor { get viewColumn() { return that._viewColumn; }, + get replOptions() { + if (that.viewType === 'repl') { + return { appendIndex: this.notebook.cellCount - 1 }; + } + return undefined; + }, + [Symbol.for('debug.description')]() { + return `NotebookEditor(${this.notebook.uri.toString()})`; + } }; ExtHostNotebookEditor.apiEditorsToExtHost.set(this._editor, this); diff --git a/src/vs/workbench/api/common/extHostNotebookEditors.ts b/src/vs/workbench/api/common/extHostNotebookEditors.ts index 5073d92c5e0..519f6921900 100644 --- a/src/vs/workbench/api/common/extHostNotebookEditors.ts +++ b/src/vs/workbench/api/common/extHostNotebookEditors.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostNotebookEditorsShape, INotebookEditorPropertiesChangeData, INotebookEditorViewColumnInfo } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostNotebookController } from 'vs/workbench/api/common/extHostNotebook'; -import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; +import { Emitter } from '../../../base/common/event.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ExtHostNotebookEditorsShape, INotebookEditorPropertiesChangeData, INotebookEditorViewColumnInfo } from './extHost.protocol.js'; +import { ExtHostNotebookController } from './extHostNotebook.js'; +import * as typeConverters from './extHostTypeConverters.js'; import type * as vscode from 'vscode'; diff --git a/src/vs/workbench/api/common/extHostNotebookKernels.ts b/src/vs/workbench/api/common/extHostNotebookKernels.ts index ecb6b4a7db3..584a4508003 100644 --- a/src/vs/workbench/api/common/extHostNotebookKernels.ts +++ b/src/vs/workbench/api/common/extHostNotebookKernels.ts @@ -3,29 +3,29 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { asArray } from 'vs/base/common/arrays'; -import { DeferredPromise, timeout } from 'vs/base/common/async'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { ResourceMap } from 'vs/base/common/map'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostNotebookKernelsShape, ICellExecuteUpdateDto, IMainContext, INotebookKernelDto2, MainContext, MainThreadNotebookKernelsShape, NotebookOutputDto, VariablesResult } from 'vs/workbench/api/common/extHost.protocol'; -import { ApiCommand, ApiCommandArgument, ApiCommandResult, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { ExtHostNotebookController } from 'vs/workbench/api/common/extHostNotebook'; -import { ExtHostCell, ExtHostNotebookDocument } from 'vs/workbench/api/common/extHostNotebookDocument'; -import * as extHostTypeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import { NotebookCellExecutionState as ExtHostNotebookCellExecutionState, NotebookCellOutput, NotebookControllerAffinity2, NotebookVariablesRequestKind } from 'vs/workbench/api/common/extHostTypes'; -import { asWebviewUri } from 'vs/workbench/contrib/webview/common/webview'; -import { INotebookKernelSourceAction, NotebookCellExecutionState } from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { CellExecutionUpdateType } from 'vs/workbench/contrib/notebook/common/notebookExecutionService'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { asArray } from '../../../base/common/arrays.js'; +import { DeferredPromise, timeout } from '../../../base/common/async.js'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ExtHostNotebookKernelsShape, ICellExecuteUpdateDto, IMainContext, INotebookKernelDto2, MainContext, MainThreadNotebookKernelsShape, NotebookOutputDto, VariablesResult } from './extHost.protocol.js'; +import { ApiCommand, ApiCommandArgument, ApiCommandResult, ExtHostCommands } from './extHostCommands.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { ExtHostNotebookController } from './extHostNotebook.js'; +import { ExtHostCell, ExtHostNotebookDocument } from './extHostNotebookDocument.js'; +import * as extHostTypeConverters from './extHostTypeConverters.js'; +import { NotebookCellExecutionState as ExtHostNotebookCellExecutionState, NotebookCellOutput, NotebookControllerAffinity2, NotebookVariablesRequestKind } from './extHostTypes.js'; +import { asWebviewUri } from '../../contrib/webview/common/webview.js'; +import { INotebookKernelSourceAction, NotebookCellExecutionState } from '../../contrib/notebook/common/notebookCommon.js'; +import { CellExecutionUpdateType } from '../../contrib/notebook/common/notebookExecutionService.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; import * as vscode from 'vscode'; -import { variablePageSize } from 'vs/workbench/contrib/notebook/common/notebookKernelService'; +import { variablePageSize } from '../../contrib/notebook/common/notebookKernelService.js'; interface IKernelData { extensionId: ExtensionIdentifier; diff --git a/src/vs/workbench/api/common/extHostNotebookRenderers.ts b/src/vs/workbench/api/common/extHostNotebookRenderers.ts index e63bbffccb9..56c273a7b0d 100644 --- a/src/vs/workbench/api/common/extHostNotebookRenderers.ts +++ b/src/vs/workbench/api/common/extHostNotebookRenderers.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter } from 'vs/base/common/event'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostNotebookRenderersShape, IMainContext, MainContext, MainThreadNotebookRenderersShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostNotebookController } from 'vs/workbench/api/common/extHostNotebook'; -import { ExtHostNotebookEditor } from 'vs/workbench/api/common/extHostNotebookEditor'; +import { Emitter } from '../../../base/common/event.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostNotebookRenderersShape, IMainContext, MainContext, MainThreadNotebookRenderersShape } from './extHost.protocol.js'; +import { ExtHostNotebookController } from './extHostNotebook.js'; +import { ExtHostNotebookEditor } from './extHostNotebookEditor.js'; import * as vscode from 'vscode'; diff --git a/src/vs/workbench/api/common/extHostOutput.ts b/src/vs/workbench/api/common/extHostOutput.ts index 502dd47fd47..c7aeef7a164 100644 --- a/src/vs/workbench/api/common/extHostOutput.ts +++ b/src/vs/workbench/api/common/extHostOutput.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MainContext, MainThreadOutputServiceShape, ExtHostOutputServiceShape } from './extHost.protocol'; +import { MainContext, MainThreadOutputServiceShape, ExtHostOutputServiceShape } from './extHost.protocol.js'; import type * as vscode from 'vscode'; -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { AbstractMessageLogger, ILogger, ILoggerService, ILogService, log, LogLevel, parseLogLevel } from 'vs/platform/log/common/log'; -import { OutputChannelUpdateMode } from 'vs/workbench/services/output/common/output'; -import { IExtHostConsumerFileSystem } from 'vs/workbench/api/common/extHostFileSystemConsumer'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { toLocalISOString } from 'vs/base/common/date'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { isString } from 'vs/base/common/types'; -import { FileSystemProviderErrorCode, toFileSystemProviderErrorCode } from 'vs/platform/files/common/files'; -import { Emitter } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { AbstractMessageLogger, ILogger, ILoggerService, ILogService, log, LogLevel, parseLogLevel } from '../../../platform/log/common/log.js'; +import { OutputChannelUpdateMode } from '../../services/output/common/output.js'; +import { IExtHostConsumerFileSystem } from './extHostFileSystemConsumer.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { IExtHostFileSystemInfo } from './extHostFileSystemInfo.js'; +import { toLocalISOString } from '../../../base/common/date.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { isString } from '../../../base/common/types.js'; +import { FileSystemProviderErrorCode, toFileSystemProviderErrorCode } from '../../../platform/files/common/files.js'; +import { Emitter } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; class ExtHostOutputChannel extends AbstractMessageLogger implements vscode.LogOutputChannel { diff --git a/src/vs/workbench/api/common/extHostProfileContentHandler.ts b/src/vs/workbench/api/common/extHostProfileContentHandler.ts index 19c2fb0d9b3..fbe8de654e3 100644 --- a/src/vs/workbench/api/common/extHostProfileContentHandler.ts +++ b/src/vs/workbench/api/common/extHostProfileContentHandler.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import { isString } from 'vs/base/common/types'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import { ISaveProfileResult } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { toDisposable } from '../../../base/common/lifecycle.js'; +import { isString } from '../../../base/common/types.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; +import { ISaveProfileResult } from '../../services/userDataProfile/common/userDataProfile.js'; import type * as vscode from 'vscode'; -import { ExtHostProfileContentHandlersShape, IMainContext, MainContext, MainThreadProfileContentHandlersShape } from './extHost.protocol'; +import { ExtHostProfileContentHandlersShape, IMainContext, MainContext, MainThreadProfileContentHandlersShape } from './extHost.protocol.js'; export class ExtHostProfileContentHandlers implements ExtHostProfileContentHandlersShape { diff --git a/src/vs/workbench/api/common/extHostProgress.ts b/src/vs/workbench/api/common/extHostProgress.ts index 42d8484a691..0914c2e7916 100644 --- a/src/vs/workbench/api/common/extHostProgress.ts +++ b/src/vs/workbench/api/common/extHostProgress.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import { ProgressOptions } from 'vscode'; -import { MainThreadProgressShape, ExtHostProgressShape } from './extHost.protocol'; -import { ProgressLocation } from './extHostTypeConverters'; -import { Progress, IProgressStep } from 'vs/platform/progress/common/progress'; -import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation'; -import { throttle } from 'vs/base/common/decorators'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; +import { MainThreadProgressShape, ExtHostProgressShape } from './extHost.protocol.js'; +import { ProgressLocation } from './extHostTypeConverters.js'; +import { Progress, IProgressStep } from '../../../platform/progress/common/progress.js'; +import { CancellationTokenSource, CancellationToken } from '../../../base/common/cancellation.js'; +import { throttle } from '../../../base/common/decorators.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { onUnexpectedExternalError } from '../../../base/common/errors.js'; export class ExtHostProgress implements ExtHostProgressShape { diff --git a/src/vs/workbench/api/common/extHostQuickDiff.ts b/src/vs/workbench/api/common/extHostQuickDiff.ts index 04e7c04a16c..f959ebf9d92 100644 --- a/src/vs/workbench/api/common/extHostQuickDiff.ts +++ b/src/vs/workbench/api/common/extHostQuickDiff.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ExtHostQuickDiffShape, IMainContext, MainContext, MainThreadQuickDiffShape } from 'vs/workbench/api/common/extHost.protocol'; -import { asPromise } from 'vs/base/common/async'; -import { DocumentSelector } from 'vs/workbench/api/common/extHostTypeConverters'; -import { IURITransformer } from 'vs/base/common/uriIpc'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { ExtHostQuickDiffShape, IMainContext, MainContext, MainThreadQuickDiffShape } from './extHost.protocol.js'; +import { asPromise } from '../../../base/common/async.js'; +import { DocumentSelector } from './extHostTypeConverters.js'; +import { IURITransformer } from '../../../base/common/uriIpc.js'; export class ExtHostQuickDiff implements ExtHostQuickDiffShape { private static handlePool: number = 0; diff --git a/src/vs/workbench/api/common/extHostQuickOpen.ts b/src/vs/workbench/api/common/extHostQuickOpen.ts index b850be83f86..a5194dce8ef 100644 --- a/src/vs/workbench/api/common/extHostQuickOpen.ts +++ b/src/vs/workbench/api/common/extHostQuickOpen.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter } from 'vs/base/common/event'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { IExtHostWorkspaceProvider } from 'vs/workbench/api/common/extHostWorkspace'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter } from '../../../base/common/event.js'; +import { dispose, IDisposable } from '../../../base/common/lifecycle.js'; +import { ExtHostCommands } from './extHostCommands.js'; +import { IExtHostWorkspaceProvider } from './extHostWorkspace.js'; import { InputBox, InputBoxOptions, InputBoxValidationMessage, QuickInput, QuickInputButton, QuickPick, QuickPickItem, QuickPickItemButtonEvent, QuickPickOptions, WorkspaceFolder, WorkspaceFolderPickOptions } from 'vscode'; -import { ExtHostQuickOpenShape, IMainContext, MainContext, TransferQuickInput, TransferQuickInputButton, TransferQuickPickItemOrSeparator } from './extHost.protocol'; -import { URI } from 'vs/base/common/uri'; -import { ThemeIcon, QuickInputButtons, QuickPickItemKind, InputBoxValidationSeverity } from 'vs/workbench/api/common/extHostTypes'; -import { isCancellationError } from 'vs/base/common/errors'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { coalesce } from 'vs/base/common/arrays'; -import Severity from 'vs/base/common/severity'; -import { ThemeIcon as ThemeIconUtils } from 'vs/base/common/themables'; -import { isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import { MarkdownString } from 'vs/workbench/api/common/extHostTypeConverters'; +import { ExtHostQuickOpenShape, IMainContext, MainContext, TransferQuickInput, TransferQuickInputButton, TransferQuickPickItemOrSeparator } from './extHost.protocol.js'; +import { URI } from '../../../base/common/uri.js'; +import { ThemeIcon, QuickInputButtons, QuickPickItemKind, InputBoxValidationSeverity } from './extHostTypes.js'; +import { isCancellationError } from '../../../base/common/errors.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { coalesce } from '../../../base/common/arrays.js'; +import Severity from '../../../base/common/severity.js'; +import { ThemeIcon as ThemeIconUtils } from '../../../base/common/themables.js'; +import { isProposedApiEnabled } from '../../services/extensions/common/extensions.js'; +import { MarkdownString } from './extHostTypeConverters.js'; export type Item = string | QuickPickItem; @@ -301,7 +301,7 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx this._onDidChangeValueEmitter ]; - constructor(protected _extensionId: ExtensionIdentifier, private _onDidDispose: () => void) { + constructor(protected _extension: IExtensionDescription, private _onDidDispose: () => void) { } get title() { @@ -385,6 +385,10 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx } set buttons(buttons: QuickInputButton[]) { + const allowedButtonLocation = isProposedApiEnabled(this._extension, 'quickInputButtonLocation'); + if (!allowedButtonLocation && buttons.some(button => button.location)) { + console.warn(`Extension '${this._extension.identifier.value}' uses a button location which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this._extension.identifier.value}`); + } this._buttons = buttons.slice(); this._handlesToButtons.clear(); buttons.forEach((button, i) => { @@ -397,6 +401,7 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx ...getIconPathOrClass(button.iconPath), tooltip: button.tooltip, handle: button === QuickInputButtons.Back ? -1 : i, + location: allowedButtonLocation ? button.location : undefined }; }) }); @@ -546,8 +551,8 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx private readonly _onDidChangeSelectionEmitter = new Emitter(); private readonly _onDidTriggerItemButtonEmitter = new Emitter>(); - constructor(private extension: IExtensionDescription, onDispose: () => void) { - super(extension.identifier, onDispose); + constructor(extension: IExtensionDescription, onDispose: () => void) { + super(extension, onDispose); this._disposables.push( this._onDidChangeActiveEmitter, this._onDidChangeSelectionEmitter, @@ -569,7 +574,7 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx this._itemsToHandles.set(item, i); }); - const allowedTooltips = isProposedApiEnabled(this.extension, 'quickPickItemTooltip'); + const allowedTooltips = isProposedApiEnabled(this._extension, 'quickPickItemTooltip'); const pickItems: TransferQuickPickItemOrSeparator[] = []; for (let handle = 0; handle < items.length; handle++) { @@ -578,7 +583,7 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx pickItems.push({ type: 'separator', label: item.label }); } else { if (item.tooltip && !allowedTooltips) { - console.warn(`Extension '${this.extension.identifier.value}' uses a tooltip which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this.extension.identifier.value}`); + console.warn(`Extension '${this._extension.identifier.value}' uses a tooltip which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this._extension.identifier.value}`); } const icon = (item.iconPath) ? getIconPathOrClass(item.iconPath) : undefined; @@ -712,7 +717,7 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx private _validationMessage: string | InputBoxValidationMessage | undefined; constructor(extension: IExtensionDescription, onDispose: () => void) { - super(extension.identifier, onDispose); + super(extension, onDispose); this.update({ type: 'inputBox' }); } diff --git a/src/vs/workbench/api/common/extHostRequireInterceptor.ts b/src/vs/workbench/api/common/extHostRequireInterceptor.ts index bcf03a6a02a..f01e80dd53e 100644 --- a/src/vs/workbench/api/common/extHostRequireInterceptor.ts +++ b/src/vs/workbench/api/common/extHostRequireInterceptor.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as performance from 'vs/base/common/performance'; -import { URI } from 'vs/base/common/uri'; -import { MainThreadTelemetryShape, MainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostConfigProvider, IExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration'; -import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; +import * as performance from '../../../base/common/performance.js'; +import { URI } from '../../../base/common/uri.js'; +import { MainThreadTelemetryShape, MainContext } from './extHost.protocol.js'; +import { ExtHostConfigProvider, IExtHostConfiguration } from './extHostConfiguration.js'; +import { nullExtensionDescription } from '../../services/extensions/common/extensions.js'; import * as vscode from 'vscode'; -import { ExtensionIdentifierMap } from 'vs/platform/extensions/common/extensions'; -import { IExtensionApiFactory, IExtensionRegistries } from 'vs/workbench/api/common/extHost.api.impl'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ExtensionPaths, IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { escapeRegExpCharacters } from 'vs/base/common/strings'; +import { ExtensionIdentifierMap } from '../../../platform/extensions/common/extensions.js'; +import { IExtensionApiFactory, IExtensionRegistries } from './extHost.api.impl.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { ExtensionPaths, IExtHostExtensionService } from './extHostExtensionService.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { escapeRegExpCharacters } from '../../../base/common/strings.js'; interface LoadFunction { diff --git a/src/vs/workbench/api/common/extHostRpcService.ts b/src/vs/workbench/api/common/extHostRpcService.ts index c6df14903e4..7886259ae94 100644 --- a/src/vs/workbench/api/common/extHostRpcService.ts +++ b/src/vs/workbench/api/common/extHostRpcService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ProxyIdentifier, IRPCProtocol, Proxied } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { ProxyIdentifier, IRPCProtocol, Proxied } from '../../services/extensions/common/proxyIdentifier.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; export const IExtHostRpcService = createDecorator('IExtHostRpcService'); diff --git a/src/vs/workbench/api/common/extHostSCM.ts b/src/vs/workbench/api/common/extHostSCM.ts index 6ce319f7334..a23632d35e7 100644 --- a/src/vs/workbench/api/common/extHostSCM.ts +++ b/src/vs/workbench/api/common/extHostSCM.ts @@ -5,28 +5,28 @@ /* eslint-disable local/code-no-native-private */ -import { URI, UriComponents } from 'vs/base/common/uri'; -import { Event, Emitter } from 'vs/base/common/event'; -import { debounce } from 'vs/base/common/decorators'; -import { DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { asPromise } from 'vs/base/common/async'; -import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { MainContext, MainThreadSCMShape, SCMRawResource, SCMRawResourceSplice, SCMRawResourceSplices, IMainContext, ExtHostSCMShape, ICommandDto, MainThreadTelemetryShape, SCMGroupFeatures, SCMHistoryItemDto, SCMHistoryItemChangeDto } from './extHost.protocol'; -import { sortedDiff, equals } from 'vs/base/common/arrays'; -import { comparePaths } from 'vs/base/common/comparers'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { Event, Emitter } from '../../../base/common/event.js'; +import { debounce } from '../../../base/common/decorators.js'; +import { DisposableStore, IDisposable, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { asPromise } from '../../../base/common/async.js'; +import { ExtHostCommands } from './extHostCommands.js'; +import { MainContext, MainThreadSCMShape, SCMRawResource, SCMRawResourceSplice, SCMRawResourceSplices, IMainContext, ExtHostSCMShape, ICommandDto, MainThreadTelemetryShape, SCMGroupFeatures, SCMHistoryItemDto, SCMHistoryItemChangeDto, SCMHistoryItemRefDto } from './extHost.protocol.js'; +import { sortedDiff, equals } from '../../../base/common/arrays.js'; +import { comparePaths } from '../../../base/common/comparers.js'; import type * as vscode from 'vscode'; -import { ISplice } from 'vs/base/common/sequence'; -import { ILogService } from 'vs/platform/log/common/log'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { ExtensionIdentifierMap, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { MarshalledId } from 'vs/base/common/marshallingIds'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { MarkdownString } from 'vs/workbench/api/common/extHostTypeConverters'; -import { checkProposedApiEnabled, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { Schemas } from 'vs/base/common/network'; -import { isLinux } from 'vs/base/common/platform'; +import { ISplice } from '../../../base/common/sequence.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { ExtensionIdentifierMap, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { MarshalledId } from '../../../base/common/marshallingIds.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { IMarkdownString } from '../../../base/common/htmlContent.js'; +import { MarkdownString } from './extHostTypeConverters.js'; +import { checkProposedApiEnabled, isProposedApiEnabled } from '../../services/extensions/common/extensions.js'; +import { ExtHostDocuments } from './extHostDocuments.js'; +import { Schemas } from '../../../base/common/network.js'; +import { isLinux } from '../../../base/common/platform.js'; type ProviderHandle = number; type GroupHandle = number; @@ -72,10 +72,15 @@ function getHistoryItemIconDto(icon: vscode.Uri | { light: vscode.Uri; dark: vsc } function toSCMHistoryItemDto(historyItem: vscode.SourceControlHistoryItem): SCMHistoryItemDto { - const icon = getHistoryItemIconDto(historyItem.icon); - const labels = historyItem.labels?.map(l => ({ title: l.title, icon: getHistoryItemIconDto(l.icon) })); + const references = historyItem.references?.map(r => ({ + ...r, icon: getHistoryItemIconDto(r.icon) + })); - return { ...historyItem, icon, labels }; + return { ...historyItem, references }; +} + +function toSCMHistoryItemRefDto(historyItemRef?: vscode.SourceControlHistoryItemRef): SCMHistoryItemRefDto | undefined { + return historyItemRef ? { ...historyItemRef, icon: getHistoryItemIconDto(historyItemRef.icon) } : undefined; } function compareResourceThemableDecorations(a: vscode.SourceControlResourceThemableDecorations, b: vscode.SourceControlResourceThemableDecorations): number { @@ -210,6 +215,10 @@ function compareResourceStates(a: vscode.SourceControlResourceState, b: vscode.S return -1; } + if (result !== 0) { + return result; + } + if (a.multiFileDiffEditorModifiedUri && b.multiFileDiffEditorModifiedUri) { result = comparePaths(a.multiFileDiffEditorModifiedUri.fsPath, b.multiFileDiffEditorModifiedUri.fsPath, true); } else if (a.multiFileDiffEditorModifiedUri) { @@ -217,6 +226,11 @@ function compareResourceStates(a: vscode.SourceControlResourceState, b: vscode.S } else if (b.multiFileDiffEditorModifiedUri) { return -1; } + + if (result !== 0) { + return result; + } + if (a.multiDiffEditorOriginalUri && b.multiDiffEditorOriginalUri) { result = comparePaths(a.multiDiffEditorOriginalUri.fsPath, b.multiDiffEditorOriginalUri.fsPath, true); } else if (a.multiDiffEditorOriginalUri) { @@ -567,7 +581,6 @@ class ExtHostSourceControl implements vscode.SourceControl { private _historyProvider: vscode.SourceControlHistoryProvider | undefined; private readonly _historyProviderDisposable = new MutableDisposable(); - private _historyProviderCurrentHistoryItemGroup: vscode.SourceControlHistoryItemGroup | undefined; get historyProvider(): vscode.SourceControlHistoryProvider | undefined { checkProposedApiEnabled(this._extension, 'scmHistoryProvider'); @@ -583,9 +596,23 @@ class ExtHostSourceControl implements vscode.SourceControl { this.#proxy.$updateSourceControl(this.handle, { hasHistoryProvider: !!historyProvider }); if (historyProvider) { - this._historyProviderDisposable.value.add(historyProvider.onDidChangeCurrentHistoryItemGroup(() => { - this._historyProviderCurrentHistoryItemGroup = historyProvider?.currentHistoryItemGroup; - this.#proxy.$onDidChangeHistoryProviderCurrentHistoryItemGroup(this.handle, this._historyProviderCurrentHistoryItemGroup); + this._historyProviderDisposable.value.add(historyProvider.onDidChangeCurrentHistoryItemRefs(() => { + const historyItemRef = toSCMHistoryItemRefDto(historyProvider?.currentHistoryItemRef); + const historyItemRemoteRef = toSCMHistoryItemRefDto(historyProvider?.currentHistoryItemRemoteRef); + const historyItemBaseRef = toSCMHistoryItemRefDto(historyProvider?.currentHistoryItemBaseRef); + + this.#proxy.$onDidChangeHistoryProviderCurrentHistoryItemRefs(this.handle, historyItemRef, historyItemRemoteRef, historyItemBaseRef); + })); + this._historyProviderDisposable.value.add(historyProvider.onDidChangeHistoryItemRefs((e) => { + if (e.added.length === 0 && e.modified.length === 0 && e.removed.length === 0) { + return; + } + + const added = e.added.map(ref => ({ ...ref, icon: getHistoryItemIconDto(ref.icon) })); + const modified = e.modified.map(ref => ({ ...ref, icon: getHistoryItemIconDto(ref.icon) })); + const removed = e.removed.map(ref => ({ ...ref, icon: getHistoryItemIconDto(ref.icon) })); + + this.#proxy.$onDidChangeHistoryProviderHistoryItemRefs(this.handle, { added, modified, removed, silent: e.silent }); })); } } @@ -654,9 +681,7 @@ class ExtHostSourceControl implements vscode.SourceControl { } set statusBarCommands(statusBarCommands: vscode.Command[] | undefined) { - this.logService.trace('ExtHostSourceControl#statusBarCommands', (statusBarCommands ?? []).map(c => c.command).join(', ')); if (this._statusBarCommands && statusBarCommands && commandListEquals(this._statusBarCommands, statusBarCommands)) { - this.logService.trace('ExtHostSourceControl#statusBarCommands are equal'); return; } @@ -684,7 +709,6 @@ class ExtHostSourceControl implements vscode.SourceControl { _extHostDocuments: ExtHostDocuments, proxy: MainThreadSCMShape, private _commands: ExtHostCommands, - private readonly logService: ILogService, private _id: string, private _label: string, private _rootUri?: vscode.Uri @@ -864,7 +888,7 @@ export class ExtHostSCM implements ExtHostSCMShape { }); const handle = ExtHostSCM._handlePool++; - const sourceControl = new ExtHostSourceControl(extension, this._extHostDocuments, this._proxy, this._commands, this.logService, id, label, rootUri); + const sourceControl = new ExtHostSourceControl(extension, this._extHostDocuments, this._proxy, this._commands, id, label, rootUri); this._sourceControls.set(handle, sourceControl); const sourceControls = this._sourceControlsByExtension.get(extension.identifier) || []; @@ -970,35 +994,25 @@ export class ExtHostSCM implements ExtHostSCMShape { return Promise.resolve(undefined); } - async $resolveHistoryItemGroupCommonAncestor(sourceControlHandle: number, historyItemGroupId1: string, historyItemGroupId2: string | undefined, token: CancellationToken): Promise<{ id: string; ahead: number; behind: number } | undefined> { + async $resolveHistoryItemRefsCommonAncestor(sourceControlHandle: number, historyItemRefs: string[], token: CancellationToken): Promise { const historyProvider = this._sourceControls.get(sourceControlHandle)?.historyProvider; - return await historyProvider?.resolveHistoryItemGroupCommonAncestor(historyItemGroupId1, historyItemGroupId2, token) ?? undefined; + return await historyProvider?.resolveHistoryItemRefsCommonAncestor(historyItemRefs, token) ?? undefined; } - async $provideHistoryItems(sourceControlHandle: number, historyItemGroupId: string, options: any, token: CancellationToken): Promise { + async $provideHistoryItemRefs(sourceControlHandle: number, token: CancellationToken): Promise { const historyProvider = this._sourceControls.get(sourceControlHandle)?.historyProvider; - const historyItems = await historyProvider?.provideHistoryItems(historyItemGroupId, options, token); + const historyItemRefs = await historyProvider?.provideHistoryItemRefs(token); - return historyItems?.map(item => toSCMHistoryItemDto(item)) ?? undefined; + return historyItemRefs?.map(ref => ({ ...ref, icon: getHistoryItemIconDto(ref.icon) })) ?? undefined; } - async $provideHistoryItems2(sourceControlHandle: number, options: any, token: CancellationToken): Promise { + async $provideHistoryItems(sourceControlHandle: number, options: any, token: CancellationToken): Promise { const historyProvider = this._sourceControls.get(sourceControlHandle)?.historyProvider; - const historyItems = await historyProvider?.provideHistoryItems2(options, token); + const historyItems = await historyProvider?.provideHistoryItems(options, token); return historyItems?.map(item => toSCMHistoryItemDto(item)) ?? undefined; } - async $provideHistoryItemSummary(sourceControlHandle: number, historyItemId: string, historyItemParentId: string | undefined, token: CancellationToken): Promise { - const historyProvider = this._sourceControls.get(sourceControlHandle)?.historyProvider; - if (typeof historyProvider?.provideHistoryItemSummary !== 'function') { - return undefined; - } - - const historyItem = await historyProvider.provideHistoryItemSummary(historyItemId, historyItemParentId, token); - return historyItem ? toSCMHistoryItemDto(historyItem) : undefined; - } - async $provideHistoryItemChanges(sourceControlHandle: number, historyItemId: string, historyItemParentId: string | undefined, token: CancellationToken): Promise { const historyProvider = this._sourceControls.get(sourceControlHandle)?.historyProvider; return await historyProvider?.provideHistoryItemChanges(historyItemId, historyItemParentId, token) ?? undefined; diff --git a/src/vs/workbench/api/common/extHostSearch.ts b/src/vs/workbench/api/common/extHostSearch.ts index f7da534aab8..ab4938e4e46 100644 --- a/src/vs/workbench/api/common/extHostSearch.ts +++ b/src/vs/workbench/api/common/extHostSearch.ts @@ -3,23 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; import type * as vscode from 'vscode'; -import { ExtHostSearchShape, MainThreadSearchShape, MainContext } from '../common/extHost.protocol'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { FileSearchManager } from 'vs/workbench/services/search/common/fileSearchManager'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IURITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IRawFileQuery, ISearchCompleteStats, IFileQuery, IRawTextQuery, IRawQuery, ITextQuery, IFolderQuery, IRawAITextQuery, IAITextQuery } from 'vs/workbench/services/search/common/search'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { TextSearchManager } from 'vs/workbench/services/search/common/textSearchManager'; -import { CancellationToken } from 'vs/base/common/cancellation'; +import { ExtHostSearchShape, MainThreadSearchShape, MainContext } from './extHost.protocol.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { FileSearchManager } from '../../services/search/common/fileSearchManager.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { IURITransformerService } from './extHostUriTransformerService.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IRawFileQuery, ISearchCompleteStats, IFileQuery, IRawTextQuery, IRawQuery, ITextQuery, IFolderQuery, IRawAITextQuery, IAITextQuery } from '../../services/search/common/search.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { TextSearchManager } from '../../services/search/common/textSearchManager.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { OldAITextSearchProviderConverter, OldFileSearchProviderConverter, OldTextSearchProviderConverter } from '../../services/search/common/searchExtConversionTypes.js'; export interface IExtHostSearch extends ExtHostSearchShape { - registerTextSearchProvider(scheme: string, provider: vscode.TextSearchProvider): IDisposable; - registerAITextSearchProvider(scheme: string, provider: vscode.AITextSearchProvider): IDisposable; - registerFileSearchProvider(scheme: string, provider: vscode.FileSearchProvider): IDisposable; + registerTextSearchProviderOld(scheme: string, provider: vscode.TextSearchProvider): IDisposable; + registerAITextSearchProviderOld(scheme: string, provider: vscode.AITextSearchProvider): IDisposable; + registerFileSearchProviderOld(scheme: string, provider: vscode.FileSearchProvider): IDisposable; + registerTextSearchProvider(scheme: string, provider: vscode.TextSearchProviderNew): IDisposable; + registerAITextSearchProvider(scheme: string, provider: vscode.AITextSearchProviderNew): IDisposable; + registerFileSearchProvider(scheme: string, provider: vscode.FileSearchProviderNew): IDisposable; doInternalFileSearchWithCustomCallback(query: IFileQuery, token: CancellationToken, handleFileMatch: (data: URI[]) => void): Promise; } @@ -30,13 +35,13 @@ export class ExtHostSearch implements IExtHostSearch { protected readonly _proxy: MainThreadSearchShape = this.extHostRpc.getProxy(MainContext.MainThreadSearch); protected _handlePool: number = 0; - private readonly _textSearchProvider = new Map(); + private readonly _textSearchProvider = new Map(); private readonly _textSearchUsedSchemes = new Set(); - private readonly _aiTextSearchProvider = new Map(); + private readonly _aiTextSearchProvider = new Map(); private readonly _aiTextSearchUsedSchemes = new Set(); - private readonly _fileSearchProvider = new Map(); + private readonly _fileSearchProvider = new Map(); private readonly _fileSearchUsedSchemes = new Set(); private readonly _fileSearchManager = new FileSearchManager(); @@ -44,14 +49,30 @@ export class ExtHostSearch implements IExtHostSearch { constructor( @IExtHostRpcService private extHostRpc: IExtHostRpcService, @IURITransformerService protected _uriTransformer: IURITransformerService, - @ILogService protected _logService: ILogService + @ILogService protected _logService: ILogService, ) { } protected _transformScheme(scheme: string): string { return this._uriTransformer.transformOutgoingScheme(scheme); } - registerTextSearchProvider(scheme: string, provider: vscode.TextSearchProvider): IDisposable { + registerTextSearchProviderOld(scheme: string, provider: vscode.TextSearchProvider): IDisposable { + if (this._textSearchUsedSchemes.has(scheme)) { + throw new Error(`a text search provider for the scheme '${scheme}' is already registered`); + } + + this._textSearchUsedSchemes.add(scheme); + const handle = this._handlePool++; + this._textSearchProvider.set(handle, new OldTextSearchProviderConverter(provider)); + this._proxy.$registerTextSearchProvider(handle, this._transformScheme(scheme)); + return toDisposable(() => { + this._textSearchUsedSchemes.delete(scheme); + this._textSearchProvider.delete(handle); + this._proxy.$unregisterProvider(handle); + }); + } + + registerTextSearchProvider(scheme: string, provider: vscode.TextSearchProviderNew): IDisposable { if (this._textSearchUsedSchemes.has(scheme)) { throw new Error(`a text search provider for the scheme '${scheme}' is already registered`); } @@ -67,7 +88,23 @@ export class ExtHostSearch implements IExtHostSearch { }); } - registerAITextSearchProvider(scheme: string, provider: vscode.AITextSearchProvider): IDisposable { + registerAITextSearchProviderOld(scheme: string, provider: vscode.AITextSearchProvider): IDisposable { + if (this._aiTextSearchUsedSchemes.has(scheme)) { + throw new Error(`an AI text search provider for the scheme '${scheme}'is already registered`); + } + + this._aiTextSearchUsedSchemes.add(scheme); + const handle = this._handlePool++; + this._aiTextSearchProvider.set(handle, new OldAITextSearchProviderConverter(provider)); + this._proxy.$registerAITextSearchProvider(handle, this._transformScheme(scheme)); + return toDisposable(() => { + this._aiTextSearchUsedSchemes.delete(scheme); + this._aiTextSearchProvider.delete(handle); + this._proxy.$unregisterProvider(handle); + }); + } + + registerAITextSearchProvider(scheme: string, provider: vscode.AITextSearchProviderNew): IDisposable { if (this._aiTextSearchUsedSchemes.has(scheme)) { throw new Error(`an AI text search provider for the scheme '${scheme}'is already registered`); } @@ -83,7 +120,23 @@ export class ExtHostSearch implements IExtHostSearch { }); } - registerFileSearchProvider(scheme: string, provider: vscode.FileSearchProvider): IDisposable { + registerFileSearchProviderOld(scheme: string, provider: vscode.FileSearchProvider): IDisposable { + if (this._fileSearchUsedSchemes.has(scheme)) { + throw new Error(`a file search provider for the scheme '${scheme}' is already registered`); + } + + this._fileSearchUsedSchemes.add(scheme); + const handle = this._handlePool++; + this._fileSearchProvider.set(handle, new OldFileSearchProviderConverter(provider)); + this._proxy.$registerFileSearchProvider(handle, this._transformScheme(scheme)); + return toDisposable(() => { + this._fileSearchUsedSchemes.delete(scheme); + this._fileSearchProvider.delete(handle); + this._proxy.$unregisterProvider(handle); + }); + } + + registerFileSearchProvider(scheme: string, provider: vscode.FileSearchProviderNew): IDisposable { if (this._fileSearchUsedSchemes.has(scheme)) { throw new Error(`a file search provider for the scheme '${scheme}' is already registered`); } @@ -107,7 +160,7 @@ export class ExtHostSearch implements IExtHostSearch { this._proxy.$handleFileMatch(handle, session, batch.map(p => p.resource)); }, token); } else { - throw new Error('3 unknown provider: ' + handle); + throw new Error('unknown provider: ' + handle); } } @@ -145,14 +198,14 @@ export class ExtHostSearch implements IExtHostSearch { $enableExtensionHostSearch(): void { } - protected createTextSearchManager(query: ITextQuery, provider: vscode.TextSearchProvider): TextSearchManager { + protected createTextSearchManager(query: ITextQuery, provider: vscode.TextSearchProviderNew): TextSearchManager { return new TextSearchManager({ query, provider }, { readdir: resource => Promise.resolve([]), toCanonicalName: encoding => encoding }, 'textSearchProvider'); } - protected createAITextSearchManager(query: IAITextQuery, provider: vscode.AITextSearchProvider): TextSearchManager { + protected createAITextSearchManager(query: IAITextQuery, provider: vscode.AITextSearchProviderNew): TextSearchManager { return new TextSearchManager({ query, provider }, { readdir: resource => Promise.resolve([]), toCanonicalName: encoding => encoding @@ -171,8 +224,6 @@ export function reviveQuery(rawQuery: U): U extends IRawTex } function reviveFolderQuery(rawFolderQuery: IFolderQuery): IFolderQuery { - return { - ...rawFolderQuery, - folder: URI.revive(rawFolderQuery.folder) - }; + return revive(rawFolderQuery); } + diff --git a/src/vs/workbench/api/common/extHostSecretState.ts b/src/vs/workbench/api/common/extHostSecretState.ts index 1e906df3f01..314a158fef0 100644 --- a/src/vs/workbench/api/common/extHostSecretState.ts +++ b/src/vs/workbench/api/common/extHostSecretState.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ExtHostSecretStateShape, MainContext, MainThreadSecretStateShape } from 'vs/workbench/api/common/extHost.protocol'; -import { Emitter } from 'vs/base/common/event'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { ExtHostSecretStateShape, MainContext, MainThreadSecretStateShape } from './extHost.protocol.js'; +import { Emitter } from '../../../base/common/event.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; export class ExtHostSecretState implements ExtHostSecretStateShape { private _proxy: MainThreadSecretStateShape; diff --git a/src/vs/workbench/api/common/extHostSecrets.ts b/src/vs/workbench/api/common/extHostSecrets.ts index 4b1e284b604..f183b889ff8 100644 --- a/src/vs/workbench/api/common/extHostSecrets.ts +++ b/src/vs/workbench/api/common/extHostSecrets.ts @@ -7,9 +7,10 @@ import type * as vscode from 'vscode'; -import { ExtHostSecretState } from 'vs/workbench/api/common/extHostSecretState'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { Event } from 'vs/base/common/event'; +import { ExtHostSecretState } from './extHostSecretState.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { Event } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; export class ExtensionSecrets implements vscode.SecretStorage { @@ -17,6 +18,7 @@ export class ExtensionSecrets implements vscode.SecretStorage { readonly #secretState: ExtHostSecretState; readonly onDidChange: Event; + readonly disposables = new DisposableStore(); constructor(extensionDescription: IExtensionDescription, secretState: ExtHostSecretState) { this._id = ExtensionIdentifier.toKey(extensionDescription.identifier); @@ -24,10 +26,15 @@ export class ExtensionSecrets implements vscode.SecretStorage { this.onDidChange = Event.map( Event.filter(this.#secretState.onDidChangePassword, e => e.extensionId === this._id), - e => ({ key: e.key }) + e => ({ key: e.key }), + this.disposables ); } + dispose() { + this.disposables.dispose(); + } + get(key: string): Promise { return this.#secretState.get(this._id, key); } diff --git a/src/vs/workbench/api/common/extHostShare.ts b/src/vs/workbench/api/common/extHostShare.ts index 56cd94f38df..d10bda0888e 100644 --- a/src/vs/workbench/api/common/extHostShare.ts +++ b/src/vs/workbench/api/common/extHostShare.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { ExtHostShareShape, IMainContext, IShareableItemDto, MainContext, MainThreadShareShape } from 'vs/workbench/api/common/extHost.protocol'; -import { DocumentSelector, Range } from 'vs/workbench/api/common/extHostTypeConverters'; -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { URI, UriComponents } from 'vs/base/common/uri'; +import { ExtHostShareShape, IMainContext, IShareableItemDto, MainContext, MainThreadShareShape } from './extHost.protocol.js'; +import { DocumentSelector, Range } from './extHostTypeConverters.js'; +import { IURITransformer } from '../../../base/common/uriIpc.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; export class ExtHostShare implements ExtHostShareShape { private static handlePool: number = 0; diff --git a/src/vs/workbench/api/common/extHostSpeech.ts b/src/vs/workbench/api/common/extHostSpeech.ts index 198eaee26ad..0900b33bda6 100644 --- a/src/vs/workbench/api/common/extHostSpeech.ts +++ b/src/vs/workbench/api/common/extHostSpeech.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ExtHostSpeechShape, IMainContext, MainContext, MainThreadSpeechShape } from 'vs/workbench/api/common/extHost.protocol'; +import { CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { ExtHostSpeechShape, IMainContext, MainContext, MainThreadSpeechShape } from './extHost.protocol.js'; import type * as vscode from 'vscode'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; export class ExtHostSpeech implements ExtHostSpeechShape { diff --git a/src/vs/workbench/api/common/extHostStatusBar.ts b/src/vs/workbench/api/common/extHostStatusBar.ts index 982cdc28c20..327d53c5c92 100644 --- a/src/vs/workbench/api/common/extHostStatusBar.ts +++ b/src/vs/workbench/api/common/extHostStatusBar.ts @@ -5,15 +5,15 @@ /* eslint-disable local/code-no-native-private */ -import { StatusBarAlignment as ExtHostStatusBarAlignment, Disposable, ThemeColor, asStatusBarItemIdentifier } from './extHostTypes'; +import { StatusBarAlignment as ExtHostStatusBarAlignment, Disposable, ThemeColor, asStatusBarItemIdentifier } from './extHostTypes.js'; import type * as vscode from 'vscode'; -import { MainContext, MainThreadStatusBarShape, IMainContext, ICommandDto, ExtHostStatusBarShape, StatusBarItemDto } from './extHost.protocol'; -import { localize } from 'vs/nls'; -import { CommandsConverter } from 'vs/workbench/api/common/extHostCommands'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { MarkdownString } from 'vs/workbench/api/common/extHostTypeConverters'; -import { isNumber } from 'vs/base/common/types'; +import { MainContext, MainThreadStatusBarShape, IMainContext, ICommandDto, ExtHostStatusBarShape, StatusBarItemDto } from './extHost.protocol.js'; +import { localize } from '../../../nls.js'; +import { CommandsConverter } from './extHostCommands.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { MarkdownString } from './extHostTypeConverters.js'; +import { isNumber } from '../../../base/common/types.js'; export class ExtHostStatusBarEntry implements vscode.StatusBarItem { diff --git a/src/vs/workbench/api/common/extHostStorage.ts b/src/vs/workbench/api/common/extHostStorage.ts index f5ea20880fb..f4cc16fc026 100644 --- a/src/vs/workbench/api/common/extHostStorage.ts +++ b/src/vs/workbench/api/common/extHostStorage.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MainContext, MainThreadStorageShape, ExtHostStorageShape } from './extHost.protocol'; -import { Emitter } from 'vs/base/common/event'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtensionIdWithVersion } from 'vs/platform/extensionManagement/common/extensionStorage'; -import { ILogService } from 'vs/platform/log/common/log'; +import { MainContext, MainThreadStorageShape, ExtHostStorageShape } from './extHost.protocol.js'; +import { Emitter } from '../../../base/common/event.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtensionIdWithVersion } from '../../../platform/extensionManagement/common/extensionStorage.js'; +import { ILogService } from '../../../platform/log/common/log.js'; export interface IStorageChangeEvent { shared: boolean; diff --git a/src/vs/workbench/api/common/extHostStoragePaths.ts b/src/vs/workbench/api/common/extHostStoragePaths.ts index 71342224211..b12bb7255ab 100644 --- a/src/vs/workbench/api/common/extHostStoragePaths.ts +++ b/src/vs/workbench/api/common/extHostStoragePaths.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IEnvironment, IStaticWorkspaceData } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; -import { IExtHostConsumerFileSystem } from 'vs/workbench/api/common/extHostFileSystemConsumer'; -import { URI } from 'vs/base/common/uri'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IEnvironment, IStaticWorkspaceData } from '../../services/extensions/common/extensionHostProtocol.js'; +import { IExtHostConsumerFileSystem } from './extHostFileSystemConsumer.js'; +import { URI } from '../../../base/common/uri.js'; export const IExtensionStoragePaths = createDecorator('IExtensionStoragePaths'); diff --git a/src/vs/workbench/api/common/extHostTask.ts b/src/vs/workbench/api/common/extHostTask.ts index b5829c09af7..e0774e293a0 100644 --- a/src/vs/workbench/api/common/extHostTask.ts +++ b/src/vs/workbench/api/common/extHostTask.ts @@ -5,29 +5,30 @@ /* eslint-disable local/code-no-native-private */ -import { URI, UriComponents } from 'vs/base/common/uri'; -import { asPromise } from 'vs/base/common/async'; -import { Event, Emitter } from 'vs/base/common/event'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { asPromise } from '../../../base/common/async.js'; +import { Event, Emitter } from '../../../base/common/event.js'; -import { MainContext, MainThreadTaskShape, ExtHostTaskShape } from 'vs/workbench/api/common/extHost.protocol'; -import * as types from 'vs/workbench/api/common/extHostTypes'; -import { IExtHostWorkspaceProvider, IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; +import { MainContext, MainThreadTaskShape, ExtHostTaskShape } from './extHost.protocol.js'; +import * as types from './extHostTypes.js'; +import { IExtHostWorkspaceProvider, IExtHostWorkspace } from './extHostWorkspace.js'; import type * as vscode from 'vscode'; -import * as tasks from '../common/shared/tasks'; -import { IExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { IExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { Schemas } from 'vs/base/common/network'; -import * as Platform from 'vs/base/common/platform'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IExtHostApiDeprecationService } from 'vs/workbench/api/common/extHostApiDeprecationService'; -import { USER_TASKS_GROUP_KEY } from 'vs/workbench/contrib/tasks/common/tasks'; -import { ErrorNoTelemetry, NotSupportedError } from 'vs/base/common/errors'; +import * as tasks from './shared/tasks.js'; +import { IExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import { IExtHostConfiguration } from './extHostConfiguration.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { IExtHostTerminalService } from './extHostTerminalService.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { Schemas } from '../../../base/common/network.js'; +import * as Platform from '../../../base/common/platform.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IExtHostApiDeprecationService } from './extHostApiDeprecationService.js'; +import { USER_TASKS_GROUP_KEY } from '../../contrib/tasks/common/tasks.js'; +import { ErrorNoTelemetry, NotSupportedError } from '../../../base/common/errors.js'; +import { asArray } from '../../../base/common/arrays.js'; export interface IExtHostTask extends ExtHostTaskShape { @@ -279,7 +280,7 @@ export namespace TaskDTO { isBackground: value.isBackground, group: TaskGroupDTO.from(value.group as vscode.TaskGroup), presentationOptions: TaskPresentationOptionsDTO.from(value.presentationOptions), - problemMatchers: value.problemMatchers, + problemMatchers: asArray(value.problemMatchers), hasDefinedMatchers: (value as types.Task).hasDefinedMatchers, runOptions: value.runOptions ? value.runOptions : { reevaluateOnRerun: true }, detail: value.detail diff --git a/src/vs/workbench/api/common/extHostTelemetry.ts b/src/vs/workbench/api/common/extHostTelemetry.ts index 64a12869610..ffef0eeb5d8 100644 --- a/src/vs/workbench/api/common/extHostTelemetry.ts +++ b/src/vs/workbench/api/common/extHostTelemetry.ts @@ -4,20 +4,20 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { Event, Emitter } from 'vs/base/common/event'; -import { ExtHostTelemetryShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ICommonProperties, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { ILogger, ILoggerService, LogLevel, isLogLevel } from 'vs/platform/log/common/log'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { UIKind } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; -import { getRemoteName } from 'vs/platform/remote/common/remoteHosts'; -import { cleanData, cleanRemoteAuthority, extensionTelemetryLogChannelId } from 'vs/platform/telemetry/common/telemetryUtils'; -import { mixin } from 'vs/base/common/objects'; -import { URI } from 'vs/base/common/uri'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { localize } from 'vs/nls'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { Event, Emitter } from '../../../base/common/event.js'; +import { ExtHostTelemetryShape } from './extHost.protocol.js'; +import { ICommonProperties, TelemetryLevel } from '../../../platform/telemetry/common/telemetry.js'; +import { ILogger, ILoggerService, LogLevel, isLogLevel } from '../../../platform/log/common/log.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { UIKind } from '../../services/extensions/common/extensionHostProtocol.js'; +import { getRemoteName } from '../../../platform/remote/common/remoteHosts.js'; +import { cleanData, cleanRemoteAuthority, extensionTelemetryLogChannelId } from '../../../platform/telemetry/common/telemetryUtils.js'; +import { mixin } from '../../../base/common/objects.js'; +import { URI } from '../../../base/common/uri.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { localize } from '../../../nls.js'; export class ExtHostTelemetry extends Disposable implements ExtHostTelemetryShape { diff --git a/src/vs/workbench/api/common/extHostTerminalService.ts b/src/vs/workbench/api/common/extHostTerminalService.ts index 9ce31e7147c..39ce969617b 100644 --- a/src/vs/workbench/api/common/extHostTerminalService.ts +++ b/src/vs/workbench/api/common/extHostTerminalService.ts @@ -4,29 +4,29 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { Event, Emitter } from 'vs/base/common/event'; -import { ExtHostTerminalServiceShape, MainContext, MainThreadTerminalServiceShape, ITerminalDimensionsDto, ITerminalLinkDto, ExtHostTerminalIdentifier, ICommandDto, ITerminalQuickFixOpenerDto, ITerminalQuickFixTerminalCommandDto, TerminalCommandMatchResultDto, ITerminalCommandDto } from 'vs/workbench/api/common/extHost.protocol'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { URI } from 'vs/base/common/uri'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IDisposable, DisposableStore, Disposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { Disposable as VSCodeDisposable, EnvironmentVariableMutatorType, TerminalExitReason } from './extHostTypes'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { localize } from 'vs/nls'; -import { NotSupportedError } from 'vs/base/common/errors'; -import { serializeEnvironmentDescriptionMap, serializeEnvironmentVariableCollection } from 'vs/platform/terminal/common/environmentVariableShared'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IEnvironmentVariableCollectionDescription, IEnvironmentVariableMutator, ISerializableEnvironmentVariableCollection } from 'vs/platform/terminal/common/environmentVariable'; -import { ICreateContributedTerminalProfileOptions, IProcessReadyEvent, IShellLaunchConfigDto, ITerminalChildProcess, ITerminalLaunchError, ITerminalProfile, TerminalIcon, TerminalLocation, IProcessProperty, ProcessPropertyType, IProcessPropertyMap } from 'vs/platform/terminal/common/terminal'; -import { TerminalDataBufferer } from 'vs/platform/terminal/common/terminalDataBuffering'; -import { ThemeColor } from 'vs/base/common/themables'; -import { Promises } from 'vs/base/common/async'; -import { EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { TerminalQuickFix, ViewColumn } from 'vs/workbench/api/common/extHostTypeConverters'; -import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { MarshalledId } from 'vs/base/common/marshallingIds'; -import { ISerializedTerminalInstanceContext } from 'vs/workbench/contrib/terminal/common/terminal'; +import { Event, Emitter } from '../../../base/common/event.js'; +import { ExtHostTerminalServiceShape, MainContext, MainThreadTerminalServiceShape, ITerminalDimensionsDto, ITerminalLinkDto, ExtHostTerminalIdentifier, ICommandDto, ITerminalQuickFixOpenerDto, ITerminalQuickFixTerminalCommandDto, TerminalCommandMatchResultDto, ITerminalCommandDto } from './extHost.protocol.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { URI } from '../../../base/common/uri.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { IDisposable, DisposableStore, Disposable, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { Disposable as VSCodeDisposable, EnvironmentVariableMutatorType, TerminalExitReason } from './extHostTypes.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { localize } from '../../../nls.js'; +import { NotSupportedError } from '../../../base/common/errors.js'; +import { serializeEnvironmentDescriptionMap, serializeEnvironmentVariableCollection } from '../../../platform/terminal/common/environmentVariableShared.js'; +import { CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IEnvironmentVariableCollectionDescription, IEnvironmentVariableMutator, ISerializableEnvironmentVariableCollection } from '../../../platform/terminal/common/environmentVariable.js'; +import { ICreateContributedTerminalProfileOptions, IProcessReadyEvent, IShellLaunchConfigDto, ITerminalChildProcess, ITerminalLaunchError, ITerminalProfile, TerminalIcon, TerminalLocation, IProcessProperty, ProcessPropertyType, IProcessPropertyMap } from '../../../platform/terminal/common/terminal.js'; +import { TerminalDataBufferer } from '../../../platform/terminal/common/terminalDataBuffering.js'; +import { ThemeColor } from '../../../base/common/themables.js'; +import { Promises } from '../../../base/common/async.js'; +import { EditorGroupColumn } from '../../services/editor/common/editorGroupColumn.js'; +import { TerminalQuickFix, ViewColumn } from './extHostTypeConverters.js'; +import { IExtHostCommands } from './extHostCommands.js'; +import { MarshalledId } from '../../../base/common/marshallingIds.js'; +import { ISerializedTerminalInstanceContext } from '../../contrib/terminal/common/terminal.js'; export interface IExtHostTerminalService extends ExtHostTerminalServiceShape, IDisposable { diff --git a/src/vs/workbench/api/common/extHostTerminalShellIntegration.ts b/src/vs/workbench/api/common/extHostTerminalShellIntegration.ts index 59f391f8b50..8acc68b0dd9 100644 --- a/src/vs/workbench/api/common/extHostTerminalShellIntegration.ts +++ b/src/vs/workbench/api/common/extHostTerminalShellIntegration.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { TerminalShellExecutionCommandLineConfidence } from './extHostTypes'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { MainContext, type ExtHostTerminalShellIntegrationShape, type MainThreadTerminalShellIntegrationShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; -import { Emitter, type Event } from 'vs/base/common/event'; -import { isUriComponents, URI } from 'vs/base/common/uri'; -import { AsyncIterableObject, Barrier, type AsyncIterableEmitter } from 'vs/base/common/async'; +import { TerminalShellExecutionCommandLineConfidence } from './extHostTypes.js'; +import { Disposable, DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { MainContext, type ExtHostTerminalShellIntegrationShape, type MainThreadTerminalShellIntegrationShape } from './extHost.protocol.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { IExtHostTerminalService } from './extHostTerminalService.js'; +import { Emitter, type Event } from '../../../base/common/event.js'; +import { URI, type UriComponents } from '../../../base/common/uri.js'; +import { AsyncIterableObject, Barrier, type AsyncIterableEmitter } from '../../../base/common/async.js'; export interface IExtHostTerminalShellIntegration extends ExtHostTerminalShellIntegrationShape { readonly _serviceBrand: undefined; @@ -104,7 +104,7 @@ export class ExtHostTerminalShellIntegration extends Disposable implements IExtH }); } - public $shellExecutionStart(instanceId: number, commandLineValue: string, commandLineConfidence: TerminalShellExecutionCommandLineConfidence, isTrusted: boolean, cwd: URI | undefined): void { + public $shellExecutionStart(instanceId: number, commandLineValue: string, commandLineConfidence: TerminalShellExecutionCommandLineConfidence, isTrusted: boolean, cwd: UriComponents | undefined): void { // Force shellIntegration creation if it hasn't been created yet, this could when events // don't come through on startup if (!this._activeShellIntegrations.has(instanceId)) { @@ -115,7 +115,7 @@ export class ExtHostTerminalShellIntegration extends Disposable implements IExtH confidence: commandLineConfidence, isTrusted }; - this._activeShellIntegrations.get(instanceId)?.startShellExecution(commandLine, cwd); + this._activeShellIntegrations.get(instanceId)?.startShellExecution(commandLine, URI.revive(cwd)); } public $shellExecutionEnd(instanceId: number, commandLineValue: string, commandLineConfidence: TerminalShellExecutionCommandLineConfidence, isTrusted: boolean, exitCode: number | undefined): void { @@ -131,8 +131,8 @@ export class ExtHostTerminalShellIntegration extends Disposable implements IExtH this._activeShellIntegrations.get(instanceId)?.emitData(data); } - public $cwdChange(instanceId: number, cwd: URI | undefined): void { - this._activeShellIntegrations.get(instanceId)?.setCwd(isUriComponents(cwd) ? URI.revive(cwd) : cwd); + public $cwdChange(instanceId: number, cwd: UriComponents | undefined): void { + this._activeShellIntegrations.get(instanceId)?.setCwd(URI.revive(cwd)); } public $closeTerminal(instanceId: number): void { @@ -202,7 +202,8 @@ class InternalTerminalShellIntegration extends Disposable { this._currentExecution.endExecution(undefined); this._onDidRequestEndExecution.fire({ terminal: this._terminal, shellIntegration: this.value, execution: this._currentExecution.value, exitCode: undefined }); } - const currentExecution = this._currentExecution = new InternalTerminalShellExecution(commandLine, cwd); + // Fallback to the shell integration's cwd as the cwd may not have been restored after a reload + const currentExecution = this._currentExecution = new InternalTerminalShellExecution(commandLine, cwd ?? this._cwd); if (fireEventInMicrotask) { queueMicrotask(() => this._onDidStartTerminalShellExecution.fire({ terminal: this._terminal, shellIntegration: this.value, execution: currentExecution.value })); } else { diff --git a/src/vs/workbench/api/common/extHostTestItem.ts b/src/vs/workbench/api/common/extHostTestItem.ts index 496cc12a035..7c4bfe2cd97 100644 --- a/src/vs/workbench/api/common/extHostTestItem.ts +++ b/src/vs/workbench/api/common/extHostTestItem.ts @@ -2,15 +2,15 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as editorRange from 'vs/editor/common/core/range'; -import { createPrivateApiFor, getPrivateApiFor, IExtHostTestItemApi } from 'vs/workbench/api/common/extHostTestingPrivateApi'; -import { TestId, TestIdPathParts } from 'vs/workbench/contrib/testing/common/testId'; -import { createTestItemChildren, ExtHostTestItemEvent, ITestChildrenLike, ITestItemApi, ITestItemChildren, TestItemCollection, TestItemEventOp } from 'vs/workbench/contrib/testing/common/testItemCollection'; -import { denamespaceTestTag, ITestItem, ITestItemContext } from 'vs/workbench/contrib/testing/common/testTypes'; +import * as editorRange from '../../../editor/common/core/range.js'; +import { createPrivateApiFor, getPrivateApiFor, IExtHostTestItemApi } from './extHostTestingPrivateApi.js'; +import { TestId, TestIdPathParts } from '../../contrib/testing/common/testId.js'; +import { createTestItemChildren, ExtHostTestItemEvent, ITestChildrenLike, ITestItemApi, ITestItemChildren, TestItemCollection, TestItemEventOp } from '../../contrib/testing/common/testItemCollection.js'; +import { denamespaceTestTag, ITestItem, ITestItemContext } from '../../contrib/testing/common/testTypes.js'; import type * as vscode from 'vscode'; -import * as Convert from 'vs/workbench/api/common/extHostTypeConverters'; -import { URI } from 'vs/base/common/uri'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; +import * as Convert from './extHostTypeConverters.js'; +import { URI } from '../../../base/common/uri.js'; +import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; const testItemPropAccessor = ( api: IExtHostTestItemApi, diff --git a/src/vs/workbench/api/common/extHostTesting.ts b/src/vs/workbench/api/common/extHostTesting.ts index 1ef9c81d439..e3ae92ae4c8 100644 --- a/src/vs/workbench/api/common/extHostTesting.ts +++ b/src/vs/workbench/api/common/extHostTesting.ts @@ -5,31 +5,33 @@ /* eslint-disable local/code-no-native-private */ -import { RunOnceScheduler } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Emitter, Event } from 'vs/base/common/event'; -import { createSingleCallFunction } from 'vs/base/common/functional'; -import { hash } from 'vs/base/common/hash'; -import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { MarshalledId } from 'vs/base/common/marshallingIds'; -import { isDefined } from 'vs/base/common/types'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostTestingShape, ILocationDto, MainContext, MainThreadTestingShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { IExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ExtHostTestItemCollection, TestItemImpl, TestItemRootImpl, toItemFromContext } from 'vs/workbench/api/common/extHostTestItem'; -import * as Convert from 'vs/workbench/api/common/extHostTypeConverters'; -import { FileCoverage, TestRunProfileKind, TestRunRequest } from 'vs/workbench/api/common/extHostTypes'; -import { TestCommandId } from 'vs/workbench/contrib/testing/common/constants'; -import { TestId, TestPosition } from 'vs/workbench/contrib/testing/common/testId'; -import { InvalidTestItemError } from 'vs/workbench/contrib/testing/common/testItemCollection'; -import { AbstractIncrementalTestCollection, CoverageDetails, ICallProfileRunHandler, ISerializedTestResults, IStartControllerTests, IStartControllerTestsResult, ITestErrorMessage, ITestItem, ITestItemContext, ITestMessageMenuArgs, ITestRunProfile, IncrementalChangeCollector, IncrementalTestCollectionItem, InternalTestItem, TestMessageFollowupRequest, TestMessageFollowupResponse, TestResultState, TestRunProfileBitset, TestsDiff, TestsDiffOp, isStartControllerTests } from 'vs/workbench/contrib/testing/common/testTypes'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { createSingleCallFunction } from '../../../base/common/functional.js'; +import { hash } from '../../../base/common/hash.js'; +import { Disposable, DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { MarshalledId } from '../../../base/common/marshallingIds.js'; +import { isDefined } from '../../../base/common/types.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IPosition } from '../../../editor/common/core/position.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ExtHostTestingShape, ILocationDto, MainContext, MainThreadTestingShape } from './extHost.protocol.js'; +import { IExtHostCommands } from './extHostCommands.js'; +import { IExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { ExtHostTestItemCollection, TestItemImpl, TestItemRootImpl, toItemFromContext } from './extHostTestItem.js'; +import * as Convert from './extHostTypeConverters.js'; +import { FileCoverage, TestRunProfileKind, TestRunRequest } from './extHostTypes.js'; +import { TestCommandId } from '../../contrib/testing/common/constants.js'; +import { TestId, TestPosition } from '../../contrib/testing/common/testId.js'; +import { InvalidTestItemError } from '../../contrib/testing/common/testItemCollection.js'; +import { AbstractIncrementalTestCollection, CoverageDetails, ICallProfileRunHandler, ISerializedTestResults, IStartControllerTests, IStartControllerTestsResult, ITestErrorMessage, ITestItem, ITestItemContext, ITestMessageMenuArgs, ITestRunProfile, IncrementalChangeCollector, IncrementalTestCollectionItem, InternalTestItem, TestControllerCapability, TestMessageFollowupRequest, TestMessageFollowupResponse, TestResultState, TestRunProfileBitset, TestsDiff, TestsDiffOp, isStartControllerTests } from '../../contrib/testing/common/testTypes.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; import type * as vscode from 'vscode'; interface ControllerInfo { @@ -37,6 +39,7 @@ interface ControllerInfo { profiles: Map; collection: ExtHostTestItemCollection; extension: IExtensionDescription; + relatedCodeProvider?: vscode.TestRelatedCodeProvider; activeProfiles: Set; } @@ -137,6 +140,23 @@ export class ExtHostTesting extends Disposable implements ExtHostTestingShape { const activeProfiles = new Set(); const proxy = this.proxy; + const getCapability = () => { + let cap = 0; + if (refreshHandler) { + cap |= TestControllerCapability.Refresh; + } + const rcp = info.relatedCodeProvider; + if (rcp) { + if (rcp?.provideRelatedTests) { + cap |= TestControllerCapability.TestRelatedToCode; + } + if (rcp?.provideRelatedCode) { + cap |= TestControllerCapability.CodeRelatedToTest; + } + } + return cap as TestControllerCapability; + }; + const controller: vscode.TestController = { items: collection.root.children, get label() { @@ -152,11 +172,19 @@ export class ExtHostTesting extends Disposable implements ExtHostTestingShape { }, set refreshHandler(value: ((token: CancellationToken) => Thenable | void) | undefined) { refreshHandler = value; - proxy.$updateController(controllerId, { canRefresh: !!value }); + proxy.$updateController(controllerId, { capabilities: getCapability() }); }, get id() { return controllerId; }, + get relatedCodeProvider() { + return info.relatedCodeProvider; + }, + set relatedCodeProvider(value: vscode.TestRelatedCodeProvider | undefined) { + checkProposedApiEnabled(extension, 'testRelatedCode'); + info.relatedCodeProvider = value; + proxy.$updateController(controllerId, { capabilities: getCapability() }); + }, createRunProfile: (label, group, runHandler, isDefault, tag?: vscode.TestTag | undefined, supportsContinuousRun?: boolean) => { // Derive the profile ID from a hash so that the same profile will tend // to have the same hashes, allowing re-run requests to work across reloads. @@ -192,10 +220,10 @@ export class ExtHostTesting extends Disposable implements ExtHostTestingShape { }, }; - proxy.$registerTestController(controllerId, label, !!refreshHandler); + const info: ControllerInfo = { controller, collection, profiles, extension, activeProfiles }; + proxy.$registerTestController(controllerId, label, getCapability()); disposable.add(toDisposable(() => proxy.$unregisterTestController(controllerId))); - const info: ControllerInfo = { controller, collection, profiles, extension, activeProfiles }; this.controllers.set(controllerId, info); disposable.add(toDisposable(() => this.controllers.delete(controllerId))); @@ -249,6 +277,56 @@ export class ExtHostTesting extends Disposable implements ExtHostTestingShape { //#endregion //#region RPC methods + /** + * @inheritdoc + */ + async $getTestsRelatedToCode(uri: UriComponents, _position: IPosition, token: CancellationToken): Promise { + const doc = this.editors.getDocument(URI.revive(uri)); + if (!doc) { + return []; + } + + const position = Convert.Position.to(_position); + const related: string[] = []; + await Promise.all([...this.controllers.values()].map(async (c) => { + let tests: vscode.TestItem[] | undefined | null; + try { + tests = await c.relatedCodeProvider?.provideRelatedTests?.(doc.document, position, token); + } catch (e) { + if (!token.isCancellationRequested) { + this.logService.warn(`Error thrown while providing related tests for ${c.controller.label}`, e); + } + } + + if (tests) { + for (const test of tests) { + related.push(TestId.fromExtHostTestItem(test, c.controller.id).toString()); + } + c.collection.flushDiff(); + } + })); + + return related; + } + + /** + * @inheritdoc + */ + async $getCodeRelatedToTest(testId: string, token: CancellationToken): Promise { + const controller = this.controllers.get(TestId.root(testId)); + if (!controller) { + return []; + } + + const test = controller.collection.tree.get(testId); + if (!test) { + return []; + } + + const locations = await controller.relatedCodeProvider?.provideRelatedCode?.(test.actual, token); + return locations?.map(Convert.location.from) ?? []; + } + /** * @inheritdoc */ @@ -321,6 +399,12 @@ export class ExtHostTesting extends Disposable implements ExtHostTestingShape { results .map(r => { const o = Convert.TestResults.to(r); + const taskWithCoverage = r.tasks.findIndex(t => t.hasCoverage); + if (taskWithCoverage !== -1) { + o.getDetailedCoverage = (uri, token = CancellationToken.None) => + this.proxy.$getCoverageDetails(r.id, taskWithCoverage, uri, token).then(r => r.map(Convert.TestCoverage.to)); + } + testResultInternalIDs.set(o, r.id); return o; }) @@ -428,11 +512,11 @@ export class ExtHostTesting extends Disposable implements ExtHostTestingShape { /** * Cancels an ongoing test run. */ - public $cancelExtensionTestRun(runId: string | undefined) { + public $cancelExtensionTestRun(runId: string | undefined, taskId: string | undefined) { if (runId === undefined) { this.runTracker.cancelAllRuns(); } else { - this.runTracker.cancelRunById(runId); + this.runTracker.cancelRunById(runId, taskId); } } @@ -521,7 +605,7 @@ const enum TestRunTrackerState { class TestRunTracker extends Disposable { private state = TestRunTrackerState.Running; private running = 0; - private readonly tasks = new Map(); + private readonly tasks = new Map(); private readonly sharedTestIds = new Set(); private readonly cts: CancellationTokenSource; private readonly endEmitter = this._register(new Emitter()); @@ -581,8 +665,10 @@ class TestRunTracker extends Disposable { } /** Requests cancellation of the run. On the second call, forces cancellation. */ - public cancel() { - if (this.state === TestRunTrackerState.Running) { + public cancel(taskId?: string) { + if (taskId) { + this.tasks.get(taskId)?.cts.cancel(); + } else if (this.state === TestRunTrackerState.Running) { this.cts.cancel(); this.state = TestRunTrackerState.Cancelling; } else if (this.state === TestRunTrackerState.Cancelling) { @@ -653,13 +739,15 @@ class TestRunTracker extends Disposable { }; let ended = false; + // tasks are alive for as long as the tracker is alive, so simple this._register is fine: + const cts = this._register(new CancellationTokenSource(this.cts.token)); // one-off map used to associate test items with incrementing IDs in `addCoverage`. // There's no need to include their entire ID, we just want to make sure they're // stable and unique. Normal map is okay since TestRun lifetimes are limited. const run: vscode.TestRun = { isPersisted: this.dto.isPersisted, - token: this.cts.token, + token: cts.token, name, onDidDispose: this.onDidDispose, addCoverage: (coverage) => { @@ -737,8 +825,13 @@ class TestRunTracker extends Disposable { }; this.running++; - this.tasks.set(taskId, { run }); - this.proxy.$startedTestRunTask(runId, { id: taskId, name, running: true }); + this.tasks.set(taskId, { run, cts }); + this.proxy.$startedTestRunTask(runId, { + id: taskId, + ctrlId: this.dto.controllerId, + name: name || this.extension.displayName || this.extension.identifier.value, + running: true, + }); return run; } @@ -843,8 +936,8 @@ export class TestRunCoordinator { /** * Cancels an existing test run via its cancellation token. */ - public cancelRunById(runId: string) { - this.trackedById.get(runId)?.cancel(); + public cancelRunById(runId: string, taskId?: string) { + this.trackedById.get(runId)?.cancel(taskId); } /** diff --git a/src/vs/workbench/api/common/extHostTestingPrivateApi.ts b/src/vs/workbench/api/common/extHostTestingPrivateApi.ts index f0870fd5a00..ea320c2a863 100644 --- a/src/vs/workbench/api/common/extHostTestingPrivateApi.ts +++ b/src/vs/workbench/api/common/extHostTestingPrivateApi.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ExtHostTestItemEvent, InvalidTestItemError } from 'vs/workbench/contrib/testing/common/testItemCollection'; +import { ExtHostTestItemEvent, InvalidTestItemError } from '../../contrib/testing/common/testItemCollection.js'; import * as vscode from 'vscode'; export interface IExtHostTestItemApi { diff --git a/src/vs/workbench/api/common/extHostTextEditor.ts b/src/vs/workbench/api/common/extHostTextEditor.ts index 44ed8f3804f..cba39eb86b5 100644 --- a/src/vs/workbench/api/common/extHostTextEditor.ts +++ b/src/vs/workbench/api/common/extHostTextEditor.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ok } from 'vs/base/common/assert'; -import { ReadonlyError, illegalArgument } from 'vs/base/common/errors'; -import { IdGenerator } from 'vs/base/common/idGenerator'; -import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions'; -import { IRange } from 'vs/editor/common/core/range'; -import { ISingleEditOperation } from 'vs/editor/common/core/editOperation'; -import { IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate, MainThreadTextEditorsShape } from 'vs/workbench/api/common/extHost.protocol'; -import * as TypeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import { EndOfLine, Position, Range, Selection, SnippetString, TextEditorLineNumbersStyle, TextEditorRevealType } from 'vs/workbench/api/common/extHostTypes'; +import { ok } from '../../../base/common/assert.js'; +import { ReadonlyError, illegalArgument } from '../../../base/common/errors.js'; +import { IdGenerator } from '../../../base/common/idGenerator.js'; +import { TextEditorCursorStyle } from '../../../editor/common/config/editorOptions.js'; +import { IRange } from '../../../editor/common/core/range.js'; +import { ISingleEditOperation } from '../../../editor/common/core/editOperation.js'; +import { IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate, MainThreadTextEditorsShape } from './extHost.protocol.js'; +import * as TypeConverters from './extHostTypeConverters.js'; +import { EndOfLine, Position, Range, Selection, SnippetString, TextEditorLineNumbersStyle, TextEditorRevealType } from './extHostTypes.js'; import type * as vscode from 'vscode'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Lazy } from 'vs/base/common/lazy'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { Lazy } from '../../../base/common/lazy.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; export class TextEditorDecorationType { @@ -566,6 +566,9 @@ export class ExtHostTextEditor { }, hide() { _proxy.$tryHideEditor(id); + }, + [Symbol.for('debug.description')]() { + return `TextEditor(${this.document.uri.toString()})`; } }); } diff --git a/src/vs/workbench/api/common/extHostTextEditors.ts b/src/vs/workbench/api/common/extHostTextEditors.ts index 277422f9acb..178c6c5bea9 100644 --- a/src/vs/workbench/api/common/extHostTextEditors.ts +++ b/src/vs/workbench/api/common/extHostTextEditors.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as arrays from 'vs/base/common/arrays'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostEditorsShape, IEditorPropertiesChangeData, IMainContext, ITextDocumentShowOptions, ITextEditorPositionData, MainContext, MainThreadTextEditorsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { ExtHostTextEditor, TextEditorDecorationType } from 'vs/workbench/api/common/extHostTextEditor'; -import * as TypeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import { TextEditorSelectionChangeKind } from 'vs/workbench/api/common/extHostTypes'; +import * as arrays from '../../../base/common/arrays.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostEditorsShape, IEditorPropertiesChangeData, IMainContext, ITextDocumentShowOptions, ITextEditorPositionData, MainContext, MainThreadTextEditorsShape } from './extHost.protocol.js'; +import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import { ExtHostTextEditor, TextEditorDecorationType } from './extHostTextEditor.js'; +import * as TypeConverters from './extHostTypeConverters.js'; +import { TextEditorSelectionChangeKind } from './extHostTypes.js'; import * as vscode from 'vscode'; export class ExtHostEditors extends Disposable implements ExtHostEditorsShape { diff --git a/src/vs/workbench/api/common/extHostTheming.ts b/src/vs/workbench/api/common/extHostTheming.ts index 1bcb3cad0b7..0f512fcf0e7 100644 --- a/src/vs/workbench/api/common/extHostTheming.ts +++ b/src/vs/workbench/api/common/extHostTheming.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ColorTheme, ColorThemeKind } from './extHostTypes'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ExtHostThemingShape } from 'vs/workbench/api/common/extHost.protocol'; -import { Emitter, Event } from 'vs/base/common/event'; +import { ColorTheme, ColorThemeKind } from './extHostTypes.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { ExtHostThemingShape } from './extHost.protocol.js'; +import { Emitter, Event } from '../../../base/common/event.js'; export class ExtHostTheming implements ExtHostThemingShape { diff --git a/src/vs/workbench/api/common/extHostTimeline.ts b/src/vs/workbench/api/common/extHostTimeline.ts index f769766f5e4..4bfa096c1ce 100644 --- a/src/vs/workbench/api/common/extHostTimeline.ts +++ b/src/vs/workbench/api/common/extHostTimeline.ts @@ -4,18 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { UriComponents, URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ExtHostTimelineShape, MainThreadTimelineShape, IMainContext, MainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { Timeline, TimelineItem, TimelineOptions, TimelineProvider } from 'vs/workbench/contrib/timeline/common/timeline'; -import { IDisposable, toDisposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { CommandsConverter, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { ThemeIcon, MarkdownString as MarkdownStringType } from 'vs/workbench/api/common/extHostTypes'; -import { MarkdownString } from 'vs/workbench/api/common/extHostTypeConverters'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { MarshalledId } from 'vs/base/common/marshallingIds'; -import { isString } from 'vs/base/common/types'; +import { UriComponents, URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ExtHostTimelineShape, MainThreadTimelineShape, IMainContext, MainContext } from './extHost.protocol.js'; +import { Timeline, TimelineItem, TimelineOptions, TimelineProvider } from '../../contrib/timeline/common/timeline.js'; +import { IDisposable, toDisposable, DisposableStore } from '../../../base/common/lifecycle.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { CommandsConverter, ExtHostCommands } from './extHostCommands.js'; +import { ThemeIcon, MarkdownString as MarkdownStringType } from './extHostTypes.js'; +import { MarkdownString } from './extHostTypeConverters.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; +import { MarshalledId } from '../../../base/common/marshallingIds.js'; +import { isString } from '../../../base/common/types.js'; export interface IExtHostTimeline extends ExtHostTimelineShape { readonly _serviceBrand: undefined; diff --git a/src/vs/workbench/api/common/extHostTreeViews.ts b/src/vs/workbench/api/common/extHostTreeViews.ts index ba5e9aa7c50..d3c2aae3c12 100644 --- a/src/vs/workbench/api/common/extHostTreeViews.ts +++ b/src/vs/workbench/api/common/extHostTreeViews.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; +import { localize } from '../../../nls.js'; import type * as vscode from 'vscode'; -import { basename } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { CheckboxUpdate, DataTransferDTO, ExtHostTreeViewsShape, MainThreadTreeViewsShape } from './extHost.protocol'; -import { ITreeItem, TreeViewItemHandleArg, ITreeItemLabel, IRevealOptions, TreeCommand, TreeViewPaneHandleArg, ITreeItemCheckboxState, NoTreeViewError } from 'vs/workbench/common/views'; -import { ExtHostCommands, CommandsConverter } from 'vs/workbench/api/common/extHostCommands'; -import { asPromise } from 'vs/base/common/async'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { isUndefinedOrNull, isString } from 'vs/base/common/types'; -import { equals, coalesce } from 'vs/base/common/arrays'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { MarkdownString, ViewBadge, DataTransfer } from 'vs/workbench/api/common/extHostTypeConverters'; -import { IMarkdownString, isMarkdownString } from 'vs/base/common/htmlContent'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { ITreeViewsDnDService, TreeViewsDnDService } from 'vs/editor/common/services/treeViewsDnd'; -import { IAccessibilityInformation } from 'vs/platform/accessibility/common/accessibility'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; +import { basename } from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable, DisposableStore, IDisposable } from '../../../base/common/lifecycle.js'; +import { CheckboxUpdate, DataTransferDTO, ExtHostTreeViewsShape, MainThreadTreeViewsShape } from './extHost.protocol.js'; +import { ITreeItem, TreeViewItemHandleArg, ITreeItemLabel, IRevealOptions, TreeCommand, TreeViewPaneHandleArg, ITreeItemCheckboxState, NoTreeViewError } from '../../common/views.js'; +import { ExtHostCommands, CommandsConverter } from './extHostCommands.js'; +import { asPromise } from '../../../base/common/async.js'; +import * as extHostTypes from './extHostTypes.js'; +import { isUndefinedOrNull, isString } from '../../../base/common/types.js'; +import { equals, coalesce } from '../../../base/common/arrays.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { MarkdownString, ViewBadge, DataTransfer } from './extHostTypeConverters.js'; +import { IMarkdownString, isMarkdownString } from '../../../base/common/htmlContent.js'; +import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js'; +import { ITreeViewsDnDService, TreeViewsDnDService } from '../../../editor/common/services/treeViewsDnd.js'; +import { IAccessibilityInformation } from '../../../platform/accessibility/common/accessibility.js'; +import { checkProposedApiEnabled } from '../../services/extensions/common/extensions.js'; type TreeItemHandle = string; diff --git a/src/vs/workbench/api/common/extHostTunnelService.ts b/src/vs/workbench/api/common/extHostTunnelService.ts index 650b852e1e4..17d8417ea55 100644 --- a/src/vs/workbench/api/common/extHostTunnelService.ts +++ b/src/vs/workbench/api/common/extHostTunnelService.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import * as nls from 'vs/nls'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { DisposableTunnel, ProvidedOnAutoForward, ProvidedPortAttributes, RemoteTunnel, TunnelCreationOptions, TunnelOptions, TunnelPrivacyId } from 'vs/platform/tunnel/common/tunnel'; -import { ExtHostTunnelServiceShape, MainContext, MainThreadTunnelServiceShape, PortAttributesSelector, TunnelDto } from 'vs/workbench/api/common/extHost.protocol'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import * as types from 'vs/workbench/api/common/extHostTypes'; -import { CandidatePort } from 'vs/workbench/services/remote/common/tunnelModel'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import * as nls from '../../../nls.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { DisposableTunnel, ProvidedOnAutoForward, ProvidedPortAttributes, RemoteTunnel, TunnelCreationOptions, TunnelOptions, TunnelPrivacyId } from '../../../platform/tunnel/common/tunnel.js'; +import { ExtHostTunnelServiceShape, MainContext, MainThreadTunnelServiceShape, PortAttributesSelector, TunnelDto } from './extHost.protocol.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import * as types from './extHostTypes.js'; +import { CandidatePort } from '../../services/remote/common/tunnelModel.js'; import * as vscode from 'vscode'; class ExtensionTunnel extends DisposableTunnel implements vscode.Tunnel { } @@ -162,10 +162,10 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe protocol: information.tunnelFeatures.protocol === undefined ? true : information.tunnelFeatures.protocol, } : undefined; - this._proxy.$setTunnelProvider(tunnelFeatures); + this._proxy.$setTunnelProvider(tunnelFeatures, true); return Promise.resolve(toDisposable(() => { this._forwardPortProvider = undefined; - this._proxy.$setTunnelProvider(undefined); + this._proxy.$setTunnelProvider(undefined, false); })); } @@ -214,7 +214,7 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe protocol: true } : undefined; - this._proxy.$setTunnelProvider(tunnelFeatures); + this._proxy.$setTunnelProvider(tunnelFeatures, !!provider.tunnelFactory); } } else { this._forwardPortProvider = undefined; diff --git a/src/vs/workbench/api/common/extHostTypeConverters.ts b/src/vs/workbench/api/common/extHostTypeConverters.ts index 8fd58b31edd..3d90157a8a6 100644 --- a/src/vs/workbench/api/common/extHostTypeConverters.ts +++ b/src/vs/workbench/api/common/extHostTypeConverters.ts @@ -3,62 +3,58 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { asArray, coalesce, isNonEmptyArray } from 'vs/base/common/arrays'; -import { VSBuffer, encodeBase64 } from 'vs/base/common/buffer'; -import { IDataTransferFile, IDataTransferItem, UriList } from 'vs/base/common/dataTransfer'; -import { createSingleCallFunction } from 'vs/base/common/functional'; -import * as htmlContent from 'vs/base/common/htmlContent'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ResourceMap, ResourceSet } from 'vs/base/common/map'; -import { marked } from 'vs/base/common/marked/marked'; -import { parse, revive } from 'vs/base/common/marshalling'; -import { Mimes } from 'vs/base/common/mime'; -import { cloneAndChange } from 'vs/base/common/objects'; -import { IPrefixTreeNode, WellDefinedPrefixTree } from 'vs/base/common/prefixTree'; -import { basename } from 'vs/base/common/resources'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { isDefined, isEmptyObject, isNumber, isString, isUndefinedOrNull } from 'vs/base/common/types'; -import { URI, UriComponents, isUriComponents } from 'vs/base/common/uri'; -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { RenderLineNumbersType } from 'vs/editor/common/config/editorOptions'; -import { IPosition } from 'vs/editor/common/core/position'; -import * as editorRange from 'vs/editor/common/core/range'; -import { ISelection } from 'vs/editor/common/core/selection'; -import { IContentDecorationRenderOptions, IDecorationOptions, IDecorationRenderOptions, IThemeDecorationRenderOptions } from 'vs/editor/common/editorCommon'; -import * as encodedTokenAttributes from 'vs/editor/common/encodedTokenAttributes'; -import * as languageSelector from 'vs/editor/common/languageSelector'; -import * as languages from 'vs/editor/common/languages'; -import { EndOfLineSequence, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { IMarkerData, IRelatedInformation, MarkerSeverity, MarkerTag } from 'vs/platform/markers/common/markers'; -import { ProgressLocation as MainProgressLocation } from 'vs/platform/progress/common/progress'; -import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol'; -import { CommandsConverter } from 'vs/workbench/api/common/extHostCommands'; -import { getPrivateApiFor } from 'vs/workbench/api/common/extHostTestingPrivateApi'; -import { DEFAULT_EDITOR_ASSOCIATION, SaveReason } from 'vs/workbench/common/editor'; -import { IViewBadge } from 'vs/workbench/common/views'; -import { AideChatAgentLocation, IAideChatAgentRequest, IAideChatAgentResult } from 'vs/workbench/contrib/aideChat/common/aideChatAgents'; -import { IAideChatRequestVariableEntry } from 'vs/workbench/contrib/aideChat/common/aideChatModel'; -import { IAideChatAgentDetection, IAideChatAgentMarkdownContentWithVulnerability, IAideChatCommandButton, IAideChatConfirmation, IAideChatContentInlineReference, IAideChatContentReference, IAideChatFollowup, IAideChatMarkdownContent, IAideChatProgressMessage, IAideChatTaskDto, IAideChatTaskResult, IAideChatTextEdit, IAideChatUserActionEvent, IAideChatWarningMessage } from 'vs/workbench/contrib/aideChat/common/aideChatService'; -import { IAideProbeBreakdownContent, IAideProbeIterationFinished, IAideProbeGoToDefinition, IAideProbeInitialSymbols, IAideProbeLongContextSearch, IAideProbeOpenFile, IAideProbeRepoMapGeneration, IAideProbeRequestModel, IAideProbeTextEdit, IAideProbeSessionAction, IAideProbeUserAction, IAideReferenceFound, IAideRelevantReference, IAideFollowups } from 'vs/workbench/contrib/aideProbe/common/aideProbe'; -import { ChatAgentLocation, IChatAgentRequest, IChatAgentResult } from 'vs/workbench/contrib/chat/common/chatAgents'; -import { IChatRequestVariableEntry } from 'vs/workbench/contrib/chat/common/chatModel'; -import { IChatAgentDetection, IChatAgentMarkdownContentWithVulnerability, IChatCommandButton, IChatConfirmation, IChatContentInlineReference, IChatContentReference, IChatFollowup, IChatMarkdownContent, IChatProgressMessage, IChatTaskDto, IChatTaskResult, IChatTextEdit, IChatTreeData, IChatUserActionEvent, IChatWarningMessage } from 'vs/workbench/contrib/chat/common/chatService'; -import { IToolData } from 'vs/workbench/contrib/chat/common/languageModelToolsService'; -import * as chatProvider from 'vs/workbench/contrib/chat/common/languageModels'; -import { DebugTreeItemCollapsibleState, IDebugVisualizationTreeItem } from 'vs/workbench/contrib/debug/common/debug'; -import * as notebooks from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { ICellRange } from 'vs/workbench/contrib/notebook/common/notebookRange'; -import * as search from 'vs/workbench/contrib/search/common/search'; -import { TestId } from 'vs/workbench/contrib/testing/common/testId'; -import { CoverageDetails, DetailType, ICoverageCount, IFileCoverage, ISerializedTestResults, ITestErrorMessage, ITestItem, ITestTag, TestMessageType, TestResultItem, denamespaceTestTag, namespaceTestTag } from 'vs/workbench/contrib/testing/common/testTypes'; -import { EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { Dto } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { asArray, coalesce, isNonEmptyArray } from '../../../base/common/arrays.js'; +import { VSBuffer, encodeBase64 } from '../../../base/common/buffer.js'; +import { IDataTransferFile, IDataTransferItem, UriList } from '../../../base/common/dataTransfer.js'; +import { createSingleCallFunction } from '../../../base/common/functional.js'; +import * as htmlContent from '../../../base/common/htmlContent.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { ResourceMap, ResourceSet } from '../../../base/common/map.js'; +import * as marked from '../../../base/common/marked/marked.js'; +import { parse, revive } from '../../../base/common/marshalling.js'; +import { Mimes } from '../../../base/common/mime.js'; +import { cloneAndChange } from '../../../base/common/objects.js'; +import { IPrefixTreeNode, WellDefinedPrefixTree } from '../../../base/common/prefixTree.js'; +import { basename } from '../../../base/common/resources.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { isDefined, isEmptyObject, isNumber, isString, isUndefinedOrNull } from '../../../base/common/types.js'; +import { URI, UriComponents, isUriComponents } from '../../../base/common/uri.js'; +import { IURITransformer } from '../../../base/common/uriIpc.js'; +import { RenderLineNumbersType } from '../../../editor/common/config/editorOptions.js'; +import { IPosition } from '../../../editor/common/core/position.js'; +import * as editorRange from '../../../editor/common/core/range.js'; +import { ISelection } from '../../../editor/common/core/selection.js'; +import { IContentDecorationRenderOptions, IDecorationOptions, IDecorationRenderOptions, IThemeDecorationRenderOptions } from '../../../editor/common/editorCommon.js'; +import * as encodedTokenAttributes from '../../../editor/common/encodedTokenAttributes.js'; +import * as languageSelector from '../../../editor/common/languageSelector.js'; +import * as languages from '../../../editor/common/languages.js'; +import { EndOfLineSequence, TrackedRangeStickiness } from '../../../editor/common/model.js'; +import { ITextEditorOptions } from '../../../platform/editor/common/editor.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { IMarkerData, IRelatedInformation, MarkerSeverity, MarkerTag } from '../../../platform/markers/common/markers.js'; +import { ProgressLocation as MainProgressLocation } from '../../../platform/progress/common/progress.js'; +import * as extHostProtocol from './extHost.protocol.js'; +import { CommandsConverter } from './extHostCommands.js'; +import { getPrivateApiFor } from './extHostTestingPrivateApi.js'; +import { DEFAULT_EDITOR_ASSOCIATION, SaveReason } from '../../common/editor.js'; +import { IViewBadge } from '../../common/views.js'; +import { ChatAgentLocation, IChatAgentRequest, IChatAgentResult } from '../../contrib/chat/common/chatAgents.js'; +import { IChatRequestVariableEntry } from '../../contrib/chat/common/chatModel.js'; +import { IChatAgentDetection, IChatAgentMarkdownContentWithVulnerability, IChatCodeCitation, IChatCommandButton, IChatConfirmation, IChatContentInlineReference, IChatContentReference, IChatFollowup, IChatMarkdownContent, IChatMoveMessage, IChatProgressMessage, IChatResponseCodeblockUriPart, IChatTaskDto, IChatTaskResult, IChatTextEdit, IChatTreeData, IChatUserActionEvent, IChatWarningMessage } from '../../contrib/chat/common/chatService.js'; +import { IToolData, IToolResult } from '../../contrib/chat/common/languageModelToolsService.js'; +import * as chatProvider from '../../contrib/chat/common/languageModels.js'; +import { DebugTreeItemCollapsibleState, IDebugVisualizationTreeItem } from '../../contrib/debug/common/debug.js'; +import * as notebooks from '../../contrib/notebook/common/notebookCommon.js'; +import { ICellRange } from '../../contrib/notebook/common/notebookRange.js'; +import * as search from '../../contrib/search/common/search.js'; +import { TestId } from '../../contrib/testing/common/testId.js'; +import { CoverageDetails, DetailType, ICoverageCount, IFileCoverage, ISerializedTestResults, ITestErrorMessage, ITestItem, ITestTag, TestMessageType, TestResultItem, denamespaceTestTag, namespaceTestTag } from '../../contrib/testing/common/testTypes.js'; +import { EditorGroupColumn } from '../../services/editor/common/editorGroupColumn.js'; +import { ACTIVE_GROUP, SIDE_GROUP } from '../../services/editor/common/editorService.js'; +import { Dto } from '../../services/extensions/common/proxyIdentifier.js'; import type * as vscode from 'vscode'; -import * as types from './extHostTypes'; - +import * as types from './extHostTypes.js'; +import { IAideProbeGoToDefinition, IAideProbeInitialSymbols, IAideProbeBreakdownContent, IAideProbeTextEdit, IAideProbeIterationFinished, IAideProbeOpenFile, IAideReferenceFound, IAideRelevantReference, IAideFollowups, IAideProbeRepoMapGeneration, IAideProbeLongContextSearch, IAideProbeRequestModel, IAideProbeSessionAction, IAideProbeUserAction } from '../../contrib/aideProbe/common/aideProbe.js'; export namespace Command { @@ -372,7 +368,7 @@ export namespace MarkdownString { const resUris: { [href: string]: UriComponents } = Object.create(null); res.uris = resUris; - const collectUri = (href: string): string => { + const collectUri = ({ href }: { href: string }): string => { try { let uri = URI.parse(href, true); uri = uri.with({ query: _uriMassage(uri.query, resUris) }); @@ -382,11 +378,16 @@ export namespace MarkdownString { } return ''; }; - const renderer = new marked.Renderer(); - renderer.link = collectUri; - renderer.image = href => typeof href === 'string' ? collectUri(htmlContent.parseHrefAndDimensions(href).href) : ''; - marked(res.value, { renderer }); + marked.marked.walkTokens(marked.marked.lexer(res.value), token => { + if (token.type === 'link') { + collectUri({ href: token.href }); + } else if (token.type === 'image') { + if (typeof token.href === 'string') { + collectUri(htmlContent.parseHrefAndDimensions(token.href)); + } + } + }); return res; } @@ -792,7 +793,7 @@ export namespace SymbolTag { export namespace WorkspaceSymbol { export function from(info: vscode.SymbolInformation): search.IWorkspaceSymbol { - return { + return { name: info.name, kind: SymbolKind.from(info.kind), tags: info.tags && info.tags.map(SymbolTag.from), @@ -971,7 +972,7 @@ export namespace Hover { export namespace EvaluatableExpression { export function from(expression: vscode.EvaluatableExpression): languages.EvaluatableExpression { - return { + return { range: Range.from(expression.range), expression: expression.expression }; @@ -985,24 +986,24 @@ export namespace EvaluatableExpression { export namespace InlineValue { export function from(inlineValue: vscode.InlineValue): languages.InlineValue { if (inlineValue instanceof types.InlineValueText) { - return { + return { type: 'text', range: Range.from(inlineValue.range), text: inlineValue.text - }; + } satisfies languages.InlineValueText; } else if (inlineValue instanceof types.InlineValueVariableLookup) { - return { + return { type: 'variable', range: Range.from(inlineValue.range), variableName: inlineValue.variableName, caseSensitiveLookup: inlineValue.caseSensitiveLookup - }; + } satisfies languages.InlineValueVariableLookup; } else if (inlineValue instanceof types.InlineValueEvaluatableExpression) { - return { + return { type: 'expression', range: Range.from(inlineValue.range), expression: inlineValue.expression - }; + } satisfies languages.InlineValueExpression; } else { throw new Error(`Unknown 'InlineValue' type`); } @@ -1011,28 +1012,28 @@ export namespace InlineValue { export function to(inlineValue: languages.InlineValue): vscode.InlineValue { switch (inlineValue.type) { case 'text': - return { + return { range: Range.to(inlineValue.range), text: inlineValue.text - }; + } satisfies vscode.InlineValueText; case 'variable': - return { + return { range: Range.to(inlineValue.range), variableName: inlineValue.variableName, caseSensitiveLookup: inlineValue.caseSensitiveLookup - }; + } satisfies vscode.InlineValueVariableLookup; case 'expression': - return { + return { range: Range.to(inlineValue.range), expression: inlineValue.expression - }; + } satisfies vscode.InlineValueEvaluatableExpression; } } } export namespace InlineValueContext { export function from(inlineValueContext: vscode.InlineValueContext): extHostProtocol.IInlineValueContextDto { - return { + return { frameId: inlineValueContext.frameId, stoppedLocation: Range.from(inlineValueContext.stoppedLocation) }; @@ -1623,27 +1624,51 @@ export namespace MappedEditsContext { !!v && typeof v === 'object' && 'documents' in v && Array.isArray(v.documents) && - v.documents.every(subArr => - Array.isArray(subArr) && - subArr.every(docRef => - docRef && typeof docRef === 'object' && - 'uri' in docRef && URI.isUri(docRef.uri) && - 'version' in docRef && typeof docRef.version === 'number' && - 'ranges' in docRef && Array.isArray(docRef.ranges) && docRef.ranges.every((r: unknown) => r instanceof types.Range) - ) - ) + v.documents.every( + subArr => Array.isArray(subArr) && + subArr.every(DocumentContextItem.is)) ); } export function from(extContext: vscode.MappedEditsContext): languages.MappedEditsContext { return { documents: extContext.documents.map((subArray) => - subArray.map((r) => ({ - uri: URI.from(r.uri), - version: r.version, - ranges: r.ranges.map((r) => Range.from(r)), - })) + subArray.map(DocumentContextItem.from) ), + conversation: extContext.conversation?.map(item => ( + (item.type === 'request') ? + { + type: 'request', + message: item.message, + } : + { + type: 'response', + message: item.message, + references: item.references?.map(DocumentContextItem.from) + } + )) + }; + + } +} + +export namespace DocumentContextItem { + + export function is(item: unknown): item is vscode.DocumentContextItem { + return ( + typeof item === 'object' && + item !== null && + 'uri' in item && URI.isUri(item.uri) && + 'version' in item && typeof item.version === 'number' && + 'ranges' in item && Array.isArray(item.ranges) && item.ranges.every((r: unknown) => r instanceof types.Range) + ); + } + + export function from(item: vscode.DocumentContextItem): languages.DocumentContextItem { + return { + uri: URI.from(item.uri), + version: item.version, + ranges: item.ranges.map(r => Range.from(r)), }; } } @@ -1893,6 +1918,11 @@ export namespace TestMessage { actual: message.actualOutput, contextValue: message.contextValue, location: message.location && ({ range: Range.from(message.location.range), uri: message.location.uri }), + stackTrace: message.stackTrace?.map(s => ({ + label: s.label, + position: s.position && Position.from(s.position), + uri: s.uri && URI.revive(s.uri).toJSON(), + })), }; } @@ -2036,6 +2066,43 @@ export namespace TestCoverage { return 'line' in location ? Position.from(location) : Range.from(location); } + function toLocation(location: IPosition | editorRange.IRange): types.Position | types.Range; + function toLocation(location: IPosition | editorRange.IRange | undefined): types.Position | types.Range | undefined; + function toLocation(location: IPosition | editorRange.IRange | undefined): types.Position | types.Range | undefined { + if (!location) { return undefined; } + return 'endLineNumber' in location ? Range.to(location) : Position.to(location); + } + + export function to(serialized: CoverageDetails.Serialized): vscode.FileCoverageDetail { + if (serialized.type === DetailType.Statement) { + const branches: vscode.BranchCoverage[] = []; + if (serialized.branches) { + for (const branch of serialized.branches) { + branches.push({ + executed: branch.count, + location: toLocation(branch.location), + label: branch.label + }); + } + } + return new types.StatementCoverage( + serialized.count, + toLocation(serialized.location), + serialized.branches?.map(b => new types.BranchCoverage( + b.count, + toLocation(b.location)!, + b.label, + )) + ); + } else { + return new types.DeclarationCoverage( + serialized.name, + serialized.count, + toLocation(serialized.location), + ); + } + } + export function fromDetails(coverage: vscode.FileCoverageDetail): CoverageDetails.Serialized { if (typeof coverage.executed === 'number' && coverage.executed < 0) { throw new Error(`Invalid coverage count ${coverage.executed}`); @@ -2272,18 +2339,19 @@ export namespace LanguageModelChatMessageRole { export namespace LanguageModelChatMessage { export function to(message: chatProvider.IChatMessage): vscode.LanguageModelChatMessage { - let content: string = ''; - let content2: vscode.LanguageModelChatMessageFunctionResultPart | undefined; - if (message.content.type === 'text') { - content = message.content.value; - } else { - content2 = new types.LanguageModelFunctionResultPart(message.content.name, message.content.value, message.content.isError); - } + const content2 = message.content.map(c => { + if (c.type === 'text') { + return c.value; + } else if (c.type === 'tool_result') { + return new types.LanguageModelToolResultPart(c.toolCallId, c.value, c.isError); + } else { + return new types.LanguageModelToolCallPart(c.name, c.toolCallId, c.parameters); + } + }); + const content = content2.find(c => typeof c === 'string') ?? ''; const role = LanguageModelChatMessageRole.to(message.role); const result = new types.LanguageModelChatMessage(role, content, message.name); - if (content2 !== undefined) { - result.content2 = content2; - } + result.content2 = content2; return result; } @@ -2292,21 +2360,32 @@ export namespace LanguageModelChatMessage { const role = LanguageModelChatMessageRole.from(message.role); const name = message.name; - let content: chatProvider.IChatMessagePart; + const content = message.content2.map((c): chatProvider.IChatMessagePart => { + if (c instanceof types.LanguageModelToolResultPart) { + return { + type: 'tool_result', + toolCallId: c.toolCallId, + value: c.content, + isError: c.isError + }; + } else if (c instanceof types.LanguageModelToolCallPart) { + return { + type: 'tool_use', + toolCallId: c.toolCallId, + name: c.name, + parameters: c.parameters + }; + } else { + if (typeof c !== 'string') { + throw new Error('Unexpected chat message content type'); + } - if (message.content2 instanceof types.LanguageModelFunctionResultPart) { - content = { - type: 'function_result', - name: message.content2.name, - value: message.content2.content, - isError: message.content2.isError - }; - } else { - content = { - type: 'text', - value: message.content - }; - } + return { + type: 'text', + value: c + }; + } + }); return { role, @@ -2328,6 +2407,18 @@ export namespace ChatResponseMarkdownPart { } } +export namespace ChatResponseCodeblockUriPart { + export function from(part: vscode.ChatResponseCodeblockUriPart): Dto { + return { + kind: 'codeblockUri', + uri: part.value, + }; + } + export function to(part: Dto): vscode.ChatResponseCodeblockUriPart { + return new types.ChatResponseCodeblockUriPart(URI.revive(part.uri)); + } +} + export namespace ChatResponseMarkdownWithVulnerabilitiesPart { export function from(part: vscode.ChatResponseMarkdownWithVulnerabilitiesPart): Dto { return { @@ -2360,7 +2451,8 @@ export namespace ChatResponseConfirmationPart { kind: 'confirmation', title: part.title, message: part.message, - data: part.data + data: part.data, + buttons: part.buttons }; } } @@ -2405,21 +2497,30 @@ export namespace ChatResponseFilesPart { } export namespace ChatResponseAnchorPart { - export function from(part: vscode.ChatResponseAnchorPart): Dto { + export function from(part: vscode.ChatResponseAnchorPart): Dto { // Work around type-narrowing confusion between vscode.Uri and URI const isUri = (thing: unknown): thing is vscode.Uri => URI.isUri(thing); + const isSymbolInformation = (x: any): x is vscode.SymbolInformation => x instanceof types.SymbolInformation; return { kind: 'inlineReference', name: part.title, - inlineReference: isUri(part.value) ? part.value : Location.from(part.value) + inlineReference: isUri(part.value) + ? part.value + : isSymbolInformation(part.value) + ? WorkspaceSymbol.from(part.value) + : Location.from(part.value) }; } - export function to(part: Dto): vscode.ChatResponseAnchorPart { - const value = revive(part); + export function to(part: Dto): vscode.ChatResponseAnchorPart { + const value = revive(part); return new types.ChatResponseAnchorPart( - URI.isUri(value.inlineReference) ? value.inlineReference : Location.to(value.inlineReference), + URI.isUri(value.inlineReference) + ? value.inlineReference + : 'location' in value.inlineReference + ? WorkspaceSymbol.to(value.inlineReference) as vscode.SymbolInformation + : Location.to(value.inlineReference), part.name ); } @@ -2449,6 +2550,19 @@ export namespace ChatResponseWarningPart { } } +export namespace ChatResponseMovePart { + export function from(part: vscode.ChatResponseMovePart): Dto { + return { + kind: 'move', + uri: part.uri, + range: Range.from(part.range), + }; + } + export function to(part: Dto): vscode.ChatResponseMovePart { + return new types.ChatResponseMovePart(URI.revive(part.uri), Range.to(part.range)); + } +} + export namespace ChatTask { export function from(part: vscode.ChatResponseProgressPart2): IChatTaskDto { return { @@ -2502,7 +2616,8 @@ export namespace ChatResponseReferencePart { : URI.isUri(part.iconPath) ? { light: URI.revive(part.iconPath) } : (part.iconPath && 'light' in part.iconPath && 'dark' in part.iconPath && URI.isUri(part.iconPath.light) && URI.isUri(part.iconPath.dark) ? { light: URI.revive(part.iconPath.light), dark: URI.revive(part.iconPath.dark) } : undefined); - if ('variableName' in part.value) { + + if (typeof part.value === 'object' && 'variableName' in part.value) { return { kind: 'reference', reference: { @@ -2511,16 +2626,18 @@ export namespace ChatResponseReferencePart { part.value.value : Location.from(part.value.value as vscode.Location) }, - iconPath + iconPath, + options: part.options }; } return { kind: 'reference', - reference: URI.isUri(part.value) ? + reference: URI.isUri(part.value) || typeof part.value === 'string' ? part.value : Location.from(part.value), - iconPath + iconPath, + options: part.options }; } export function to(part: Dto): vscode.ChatResponseReferencePart { @@ -2531,7 +2648,7 @@ export namespace ChatResponseReferencePart { Location.to(value); return new types.ChatResponseReferencePart( - 'variableName' in value.reference ? { + typeof value.reference === 'string' ? value.reference : 'variableName' in value.reference ? { variableName: value.reference.variableName, value: value.reference.value && mapValue(value.reference.value) } : @@ -2540,9 +2657,20 @@ export namespace ChatResponseReferencePart { } } +export namespace ChatResponseCodeCitationPart { + export function from(part: vscode.ChatResponseCodeCitationPart): Dto { + return { + kind: 'codeCitation', + value: part.value, + license: part.license, + snippet: part.snippet + }; + } +} + export namespace ChatResponsePart { - export function from(part: vscode.ChatResponsePart | vscode.ChatResponseTextEditPart | vscode.ChatResponseMarkdownWithVulnerabilitiesPart | vscode.ChatResponseDetectedParticipantPart | vscode.ChatResponseWarningPart | vscode.ChatResponseConfirmationPart | vscode.ChatResponseWarningPart, commandsConverter: CommandsConverter, commandDisposables: DisposableStore): extHostProtocol.IChatProgressDto { + export function from(part: vscode.ChatResponsePart | vscode.ChatResponseTextEditPart | vscode.ChatResponseMarkdownWithVulnerabilitiesPart | vscode.ChatResponseDetectedParticipantPart | vscode.ChatResponseWarningPart | vscode.ChatResponseConfirmationPart | vscode.ChatResponseReferencePart2 | vscode.ChatResponseMovePart, commandsConverter: CommandsConverter, commandDisposables: DisposableStore): extHostProtocol.IChatProgressDto { if (part instanceof types.ChatResponseMarkdownPart) { return ChatResponseMarkdownPart.from(part); } else if (part instanceof types.ChatResponseAnchorPart) { @@ -2559,10 +2687,18 @@ export namespace ChatResponsePart { return ChatResponseTextEditPart.from(part); } else if (part instanceof types.ChatResponseMarkdownWithVulnerabilitiesPart) { return ChatResponseMarkdownWithVulnerabilitiesPart.from(part); + } else if (part instanceof types.ChatResponseCodeblockUriPart) { + return ChatResponseCodeblockUriPart.from(part); } else if (part instanceof types.ChatResponseDetectedParticipantPart) { return ChatResponseDetectedParticipantPart.from(part); } else if (part instanceof types.ChatResponseWarningPart) { return ChatResponseWarningPart.from(part); + } else if (part instanceof types.ChatResponseConfirmationPart) { + return ChatResponseConfirmationPart.from(part); + } else if (part instanceof types.ChatResponseCodeCitationPart) { + return ChatResponseCodeCitationPart.from(part); + } else if (part instanceof types.ChatResponseMovePart) { + return ChatResponseMovePart.from(part); } return { @@ -2598,16 +2734,23 @@ export namespace ChatResponsePart { } export namespace ChatAgentRequest { - export function to(request: IChatAgentRequest): vscode.ChatRequest { + export function to(request: IChatAgentRequest, location2: vscode.ChatRequestEditorData | vscode.ChatRequestNotebookData | undefined): vscode.ChatRequest { + const toolReferences = request.variables.variables.filter(v => v.isTool); + const variableReferences = request.variables.variables.filter(v => !v.isTool); return { prompt: request.message, command: request.command, attempt: request.attempt ?? 0, enableCommandDetection: request.enableCommandDetection ?? true, - references: request.variables.variables.map(ChatAgentValueReference.to), + isParticipantDetected: request.isParticipantDetected ?? false, + references: variableReferences.map(ChatPromptReference.to), + toolReferences: toolReferences.map(ChatLanguageModelToolReference.to), location: ChatLocation.to(request.location), acceptedConfirmationData: request.acceptedConfirmationData, - rejectedConfirmationData: request.rejectedConfirmationData + rejectedConfirmationData: request.rejectedConfirmationData, + location2, + toolInvocationToken: Object.freeze({ sessionId: request.sessionId }), + userSelectedModelId: request.userSelectedModelId, }; } } @@ -2632,7 +2775,7 @@ export namespace ChatLocation { } } -export namespace ChatAgentValueReference { +export namespace ChatPromptReference { export function to(variable: IChatRequestVariableEntry): vscode.ChatPromptReference { const value = variable.value; if (!value) { @@ -2651,6 +2794,20 @@ export namespace ChatAgentValueReference { } } +export namespace ChatLanguageModelToolReference { + export function to(variable: IChatRequestVariableEntry): vscode.ChatLanguageModelToolReference { + const value = variable.value; + if (value) { + throw new Error('Invalid tool reference'); + } + + return { + id: variable.id, + range: variable.range && [variable.range.start, variable.range.endExclusive], + }; + } +} + export namespace ChatAgentCompletionItem { export function from(item: vscode.ChatCompletionItem, commandsConverter: CommandsConverter, disposables: DisposableStore): extHostProtocol.IChatAgentCompletionItem { return { @@ -2672,6 +2829,7 @@ export namespace ChatAgentResult { return { errorDetails: result.errorDetails, metadata: result.metadata, + nextQuestion: result.nextQuestion, }; } } @@ -2701,42 +2859,28 @@ export namespace ChatAgentUserActionEvent { } } } -///////////////////////////// END CHAT ///////////////////////////// -///////////////////////////// START AIDE ///////////////////////////// -export namespace AideChatFollowup { - export function from(followup: vscode.ChatFollowup, request: IAideChatAgentRequest | undefined): IAideChatFollowup { +export namespace LanguageModelToolResult { + export function from(result: vscode.LanguageModelToolResult): IToolResult { return { - kind: 'reply', - agentId: followup.participant ?? request?.agentId ?? '', - subCommand: followup.command ?? request?.command, - message: followup.prompt, - title: followup.label + ...result, + string: result.toString(), }; } - export function to(followup: IAideChatFollowup): vscode.ChatFollowup { - return { - prompt: followup.message, - label: followup.title, - participant: followup.agentId, - command: followup.subCommand, + export function to(result: IToolResult): vscode.LanguageModelToolResult { + const copy: vscode.LanguageModelToolResult = { + ...result, + toString: () => result.string, }; - } -} + delete copy.string; -export namespace AideChatResponseMarkdownPart { - export function from(part: vscode.ChatResponseMarkdownPart): Dto { - return { - kind: 'markdownContent', - content: MarkdownString.from(part.value) - }; - } - export function to(part: Dto): vscode.ChatResponseMarkdownPart { - return new types.AideChatResponseMarkdownPart(MarkdownString.to(part.content)); + return copy; } } +///////////////////////////// END CHAT ///////////////////////////// +///////////////////////////// START AIDE ///////////////////////////// export namespace AideProbeGoToDefinitionPart { export function from(part: vscode.AideProbeGoToDefinition): Dto { return { @@ -2759,217 +2903,6 @@ export namespace AideProbeInitialSymbolsPart { } } -export namespace AideChatResponseMarkdownWithVulnerabilitiesPart { - export function from(part: vscode.ChatResponseMarkdownWithVulnerabilitiesPart): Dto { - return { - kind: 'markdownVuln', - content: MarkdownString.from(part.value), - vulnerabilities: part.vulnerabilities, - }; - } - export function to(part: Dto): vscode.ChatResponseMarkdownWithVulnerabilitiesPart { - return new types.AideChatResponseMarkdownWithVulnerabilitiesPart(MarkdownString.to(part.content), part.vulnerabilities); - } -} - -export namespace AideChatResponseDetectedParticipantPart { - export function from(part: vscode.ChatResponseDetectedParticipantPart): Dto { - return { - kind: 'agentDetection', - agentId: part.participant, - command: part.command, - }; - } - export function to(part: Dto): vscode.ChatResponseDetectedParticipantPart { - return new types.AideChatResponseDetectedParticipantPart(part.agentId, part.command); - } -} - -export namespace AideChatResponseConfirmationPart { - export function from(part: vscode.ChatResponseConfirmationPart): Dto { - return { - kind: 'confirmation', - title: part.title, - message: part.message, - data: part.data - }; - } -} - -export namespace AideChatResponseFilesPart { - export function from(part: vscode.ChatResponseFileTreePart): IChatTreeData { - const { value, baseUri } = part; - function convert(items: vscode.ChatResponseFileTree[], baseUri: URI): extHostProtocol.IChatResponseProgressFileTreeData[] { - return items.map(item => { - const myUri = URI.joinPath(baseUri, item.name); - return { - label: item.name, - uri: myUri, - children: item.children && convert(item.children, myUri) - }; - }); - } - return { - kind: 'treeData', - treeData: { - label: basename(baseUri), - uri: baseUri, - children: convert(value, baseUri) - } - }; - } - export function to(part: Dto): vscode.ChatResponseFileTreePart { - const treeData = revive(part.treeData); - function convert(items: extHostProtocol.IChatResponseProgressFileTreeData[]): vscode.ChatResponseFileTree[] { - return items.map(item => { - return { - name: item.label, - children: item.children && convert(item.children) - }; - }); - } - - const baseUri = treeData.uri; - const items = treeData.children ? convert(treeData.children) : []; - return new types.AideChatResponseFileTreePart(items, baseUri); - } -} - -export namespace AideChatResponseAnchorPart { - export function from(part: vscode.ChatResponseAnchorPart): Dto { - // Work around type-narrowing confusion between vscode.Uri and URI - const isUri = (thing: unknown): thing is vscode.Uri => URI.isUri(thing); - - return { - kind: 'inlineReference', - name: part.title, - inlineReference: isUri(part.value) ? part.value : Location.from(part.value) - }; - } - - export function to(part: Dto): vscode.ChatResponseAnchorPart { - const value = revive(part); - return new types.ChatResponseAnchorPart( - URI.isUri(value.inlineReference) ? value.inlineReference : Location.to(value.inlineReference), - part.name - ); - } -} - -export namespace AideChatResponseProgressPart { - export function from(part: vscode.ChatResponseProgressPart): Dto { - return { - kind: 'progressMessage', - content: MarkdownString.from(part.value) - }; - } - export function to(part: Dto): vscode.ChatResponseProgressPart { - return new types.AideChatResponseProgressPart(part.content.value); - } -} - -export namespace AideChatResponseWarningPart { - export function from(part: vscode.ChatResponseWarningPart): Dto { - return { - kind: 'warning', - content: MarkdownString.from(part.value) - }; - } - export function to(part: Dto): vscode.ChatResponseWarningPart { - return new types.ChatResponseWarningPart(part.content.value); - } -} - -export namespace AideChatTask { - export function from(part: vscode.ChatResponseProgressPart2): IAideChatTaskDto { - return { - kind: 'progressTask', - content: MarkdownString.from(part.value), - }; - } -} - -export namespace AideChatTaskResult { - export function from(part: string | void): Dto { - return { - kind: 'progressTaskResult', - content: typeof part === 'string' ? MarkdownString.from(part) : undefined - }; - } -} - -export namespace AideChatResponseCommandButtonPart { - export function from(part: vscode.ChatResponseCommandButtonPart, commandsConverter: CommandsConverter, commandDisposables: DisposableStore): Dto { - // If the command isn't in the converter, then this session may have been restored, and the command args don't exist anymore - const command = commandsConverter.toInternal(part.value, commandDisposables) ?? { command: part.value.command, title: part.value.title }; - return { - kind: 'command', - command - }; - } - export function to(part: Dto, commandsConverter: CommandsConverter): vscode.ChatResponseCommandButtonPart { - // If the command isn't in the converter, then this session may have been restored, and the command args don't exist anymore - return new types.AideChatResponseCommandButtonPart(commandsConverter.fromInternal(part.command) ?? { command: part.command.id, title: part.command.title }); - } -} - -export namespace AideChatResponseTextEditPart { - export function from(part: vscode.AideChatResponseTextEdit): Dto { - return { - kind: 'textEdit', - uri: part.uri, - edits: part.edits.map(e => TextEdit.from(e)) - }; - } - export function to(part: Dto): vscode.AideChatResponseTextEdit { - return new types.AideChatResponseTextEditPart(URI.revive(part.uri), part.edits.map(e => TextEdit.to(e))); - } -} - -export namespace AideChatResponseReferencePart { - export function from(part: types.AideChatResponseReferencePart): Dto { - const iconPath = ThemeIcon.isThemeIcon(part.iconPath) ? part.iconPath - : URI.isUri(part.iconPath) ? { light: URI.revive(part.iconPath) } - : (part.iconPath && 'light' in part.iconPath && 'dark' in part.iconPath && URI.isUri(part.iconPath.light) && URI.isUri(part.iconPath.dark) ? { light: URI.revive(part.iconPath.light), dark: URI.revive(part.iconPath.dark) } - : undefined); - if ('variableName' in part.value) { - return { - kind: 'reference', - reference: { - variableName: part.value.variableName, - value: URI.isUri(part.value.value) || !part.value.value ? - part.value.value : - Location.from(part.value.value as vscode.Location) - }, - iconPath - }; - } - - return { - kind: 'reference', - reference: URI.isUri(part.value) ? - part.value : - Location.from(part.value), - iconPath - }; - } - export function to(part: Dto): vscode.ChatResponseReferencePart { - const value = revive(part); - - const mapValue = (value: URI | languages.Location): vscode.Uri | vscode.Location => URI.isUri(value) ? - value : - Location.to(value); - - return new types.AideChatResponseReferencePart( - 'variableName' in value.reference ? { - variableName: value.reference.variableName, - value: value.reference.value && mapValue(value.reference.value) - } : - mapValue(value.reference) - ) as vscode.ChatResponseReferencePart; // 'value' is extended with variableName - } -} - export namespace AideChatResponseBreakdownPart { export function from(part: vscode.AideChatResponseBreakdown): Dto { return { @@ -3070,149 +3003,12 @@ export namespace AideProbeLongContextSearchPart { } } -export namespace AideChatResponsePart { - - export function from(part: vscode.ChatResponsePart | vscode.ChatResponseTextEditPart | vscode.ChatResponseMarkdownWithVulnerabilitiesPart | vscode.ChatResponseDetectedParticipantPart | vscode.ChatResponseWarningPart | vscode.ChatResponseConfirmationPart | vscode.ChatResponseWarningPart, commandsConverter: CommandsConverter, commandDisposables: DisposableStore): extHostProtocol.IChatProgressDto { - if (part instanceof types.AideChatResponseMarkdownPart) { - return AideChatResponseMarkdownPart.from(part); - } else if (part instanceof types.AideChatResponseAnchorPart) { - return AideChatResponseAnchorPart.from(part); - } else if (part instanceof types.AideChatResponseReferencePart) { - return AideChatResponseReferencePart.from(part); - } else if (part instanceof types.AideChatResponseProgressPart) { - return AideChatResponseProgressPart.from(part); - } else if (part instanceof types.AideChatResponseFileTreePart) { - return AideChatResponseFilesPart.from(part); - } else if (part instanceof types.AideChatResponseCommandButtonPart) { - return AideChatResponseCommandButtonPart.from(part, commandsConverter, commandDisposables); - } else if (part instanceof types.AideChatResponseTextEditPart) { - return AideChatResponseTextEditPart.from(part); - } else if (part instanceof types.AideChatResponseMarkdownWithVulnerabilitiesPart) { - return AideChatResponseMarkdownWithVulnerabilitiesPart.from(part); - } else if (part instanceof types.AideChatResponseDetectedParticipantPart) { - return AideChatResponseDetectedParticipantPart.from(part); - } else if (part instanceof types.AideChatResponseWarningPart) { - return AideChatResponseWarningPart.from(part); - } - - return { - kind: 'markdownContent', - content: MarkdownString.from('') - }; - } - - export function to(part: extHostProtocol.IChatProgressDto, commandsConverter: CommandsConverter): vscode.ChatResponsePart | undefined { - switch (part.kind) { - case 'reference': return ChatResponseReferencePart.to(part); - case 'markdownContent': - case 'inlineReference': - case 'progressMessage': - case 'treeData': - case 'command': - return toContent(part, commandsConverter); - } - return undefined; - } - - export function toContent(part: extHostProtocol.IChatContentProgressDto, commandsConverter: CommandsConverter): vscode.ChatResponseMarkdownPart | vscode.ChatResponseFileTreePart | vscode.ChatResponseAnchorPart | vscode.ChatResponseCommandButtonPart | undefined { - switch (part.kind) { - case 'markdownContent': return ChatResponseMarkdownPart.to(part); - case 'inlineReference': return ChatResponseAnchorPart.to(part); - case 'progressMessage': return undefined; - case 'treeData': return ChatResponseFilesPart.to(part); - case 'command': return ChatResponseCommandButtonPart.to(part, commandsConverter); - } - - return undefined; - } -} - -export namespace AideChatAgentRequest { - export function to(request: IAideChatAgentRequest): vscode.AideChatRequest { - return { - threadId: request.sessionId, - prompt: request.message, - command: request.command, - attempt: request.attempt ?? 0, - enableCommandDetection: request.enableCommandDetection ?? true, - references: request.variables.variables.map(ChatAgentValueReference.to), - location: AideChatLocation.to(request.location), - acceptedConfirmationData: request.acceptedConfirmationData, - rejectedConfirmationData: request.rejectedConfirmationData - }; - } -} - -export namespace AideChatLocation { - export function to(loc: AideChatAgentLocation): types.AideChatLocation { - switch (loc) { - case AideChatAgentLocation.Notebook: return types.AideChatLocation.Notebook; - case AideChatAgentLocation.Terminal: return types.AideChatLocation.Terminal; - case AideChatAgentLocation.Panel: return types.AideChatLocation.Panel; - case AideChatAgentLocation.Editor: return types.AideChatLocation.Editor; - } - } - - export function from(loc: types.AideChatLocation): AideChatAgentLocation { - switch (loc) { - case types.AideChatLocation.Notebook: return AideChatAgentLocation.Notebook; - case types.AideChatLocation.Terminal: return AideChatAgentLocation.Terminal; - case types.AideChatLocation.Panel: return AideChatAgentLocation.Panel; - case types.AideChatLocation.Editor: return AideChatAgentLocation.Editor; - } - } -} - -export namespace AideChatAgentValueReference { - export function to(variable: IAideChatRequestVariableEntry): vscode.ChatPromptReference { - const value = variable.value; - if (!value) { - throw new Error('Invalid value reference'); - } - - return { - id: variable.id, - name: variable.name, - range: variable.range && [variable.range.start, variable.range.endExclusive], - value: isUriComponents(value) ? URI.revive(value) : - value && typeof value === 'object' && 'uri' in value && 'range' in value && isUriComponents(value.uri) ? - Location.to(revive(value)) : value, - modelDescription: variable.modelDescription - }; - } -} - -export namespace AideChatAgentCompletionItem { - export function from(item: vscode.ChatCompletionItem, commandsConverter: CommandsConverter, disposables: DisposableStore): extHostProtocol.IChatAgentCompletionItem { - return { - id: item.id, - label: item.label, - fullName: item.fullName, - icon: item.icon?.id, - value: item.values[0].value, - insertText: item.insertText, - detail: item.detail, - documentation: item.documentation, - command: commandsConverter.toInternal(item.command, disposables), - }; - } -} - -export namespace AideChatAgentResult { - export function to(result: IAideChatAgentResult): vscode.ChatResult { - return { - errorDetails: result.errorDetails, - metadata: result.metadata, - }; - } -} - export namespace AideProbeRequestModel { export function to(request: IAideProbeRequestModel): vscode.ProbeRequest { return { requestId: request.sessionId, query: request.message, - references: request.variableData.variables.map(ChatAgentValueReference.to), + references: [], scope: request.scope, }; } @@ -3233,32 +3029,6 @@ export namespace AideProbeUserAction { return userAction; } } - -export namespace AideChatAgentUserActionEvent { - export function to(result: IAideChatAgentResult, event: IAideChatUserActionEvent, commandsConverter: CommandsConverter): vscode.ChatUserActionEvent | undefined { - if (event.action.kind === 'vote') { - // Is the "feedback" type - return; - } - - const ehResult = AideChatAgentResult.to(result); - if (event.action.kind === 'command') { - const command = event.action.commandButton.command; - const commandButton = { - command: commandsConverter.fromInternal(command) ?? { command: command.id, title: command.title }, - }; - const commandAction: vscode.ChatCommandAction = { kind: 'command', commandButton }; - return { action: commandAction, result: ehResult }; - } else if (event.action.kind === 'followUp') { - const followupAction: vscode.ChatFollowupAction = { kind: 'followUp', followup: ChatFollowup.to(event.action.followup) }; - return { action: followupAction, result: ehResult }; - } else if (event.action.kind === 'inlineChat') { - return { action: { kind: 'editor', accepted: event.action.action === 'accepted' }, result: ehResult }; - } else { - return { action: event.action, result: ehResult }; - } - } -} ///////////////////////////// END AIDE ///////////////////////////// export namespace TerminalQuickFix { @@ -3313,9 +3083,10 @@ export namespace DebugTreeItem { export namespace LanguageModelToolDescription { export function to(item: IToolData): vscode.LanguageModelToolDescription { return { - name: item.name, - description: item.description, + id: item.id, + modelDescription: item.modelDescription, parametersSchema: item.parametersSchema, + displayName: item.displayName, }; } } diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 6c494637343..0c63c58cec1 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -5,21 +5,21 @@ /* eslint-disable local/code-no-native-private */ -import { asArray, coalesceInPlace, equals } from 'vs/base/common/arrays'; -import { illegalArgument } from 'vs/base/common/errors'; -import { IRelativePattern } from 'vs/base/common/glob'; -import { MarkdownString as BaseMarkdownString, MarkdownStringTrustedOptions } from 'vs/base/common/htmlContent'; -import { ResourceMap } from 'vs/base/common/map'; -import { Mimes, normalizeMimeType } from 'vs/base/common/mime'; -import { nextCharLength } from 'vs/base/common/strings'; -import { isNumber, isObject, isString, isStringArray } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { FileSystemProviderErrorCode, markAsFileSystemProviderError } from 'vs/platform/files/common/files'; -import { RemoteAuthorityResolverErrorCode } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { IRelativePatternDto } from 'vs/workbench/api/common/extHost.protocol'; -import { CellEditType, ICellMetadataEdit, IDocumentMetadataEdit, isTextStreamMime } from 'vs/workbench/contrib/notebook/common/notebookCommon'; +import { asArray, coalesceInPlace, equals } from '../../../base/common/arrays.js'; +import { illegalArgument } from '../../../base/common/errors.js'; +import { IRelativePattern } from '../../../base/common/glob.js'; +import { MarkdownString as BaseMarkdownString, MarkdownStringTrustedOptions } from '../../../base/common/htmlContent.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { Mimes, normalizeMimeType } from '../../../base/common/mime.js'; +import { nextCharLength } from '../../../base/common/strings.js'; +import { isNumber, isObject, isString, isStringArray } from '../../../base/common/types.js'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { FileSystemProviderErrorCode, markAsFileSystemProviderError } from '../../../platform/files/common/files.js'; +import { RemoteAuthorityResolverErrorCode } from '../../../platform/remote/common/remoteAuthorityResolver.js'; +import { IRelativePatternDto } from './extHost.protocol.js'; +import { CellEditType, ICellMetadataEdit, IDocumentMetadataEdit, isTextStreamMime } from '../../contrib/notebook/common/notebookCommon.js'; import type * as vscode from 'vscode'; /** @@ -271,6 +271,10 @@ export class Position { toJSON(): any { return { line: this.line, character: this.character }; } + + [Symbol.for('debug.description')]() { + return `(${this.line}:${this.character})`; + } } @es5ClassCompat @@ -417,6 +421,10 @@ export class Range { toJSON(): any { return [this.start, this.end]; } + + [Symbol.for('debug.description')]() { + return getDebugDescriptionOfRange(this); + } } @es5ClassCompat @@ -483,6 +491,29 @@ export class Selection extends Range { anchor: this.anchor }; } + + + [Symbol.for('debug.description')]() { + return getDebugDescriptionOfSelection(this); + } +} + +export function getDebugDescriptionOfRange(range: vscode.Range): string { + return range.isEmpty + ? `[${range.start.line}:${range.start.character})` + : `[${range.start.line}:${range.start.character} -> ${range.end.line}:${range.end.character})`; +} + +export function getDebugDescriptionOfSelection(selection: vscode.Selection): string { + let rangeStr = getDebugDescriptionOfRange(selection); + if (!selection.isEmpty) { + if (selection.active.isEqual(selection.start)) { + rangeStr = `|${rangeStr}`; + } else { + rangeStr = `${rangeStr}|`; + } + } + return rangeStr; } const validateConnectionToken = (connectionToken: string) => { @@ -1205,18 +1236,18 @@ export class Hover { @es5ClassCompat export class VerboseHover extends Hover { - public canIncreaseHover: boolean | undefined; - public canDecreaseHover: boolean | undefined; + public canIncreaseVerbosity: boolean | undefined; + public canDecreaseVerbosity: boolean | undefined; constructor( contents: vscode.MarkdownString | vscode.MarkedString | (vscode.MarkdownString | vscode.MarkedString)[], range?: Range, - canIncreaseHover?: boolean, - canDecreaseHover?: boolean, + canIncreaseVerbosity?: boolean, + canDecreaseVerbosity?: boolean, ) { super(contents, range); - this.canIncreaseHover = canIncreaseHover; - this.canDecreaseHover = canDecreaseHover; + this.canIncreaseVerbosity = canIncreaseVerbosity; + this.canDecreaseVerbosity = canDecreaseVerbosity; } } @@ -3310,6 +3341,11 @@ export enum CommentThreadApplicability { Outdated = 1 } +export enum CommentThreadFocus { + Reply = 1, + Comment = 2 +} + //#endregion //#region Semantic Coloring @@ -3561,6 +3597,11 @@ export class DebugVisualization { //#endregion +export enum QuickInputButtonLocation { + Title = 1, + Inline = 2 +} + @es5ClassCompat export class QuickInputButtons { @@ -4038,9 +4079,11 @@ export class TestMessage implements vscode.TestMessage { public expectedOutput?: string; public actualOutput?: string; public location?: vscode.Location; - /** proposed: */ public contextValue?: string; + /** proposed: */ + public stackTrace?: TestMessageStackFrame[]; + public static diff(message: string | vscode.MarkdownString, expected: string, actual: string) { const msg = new TestMessage(message); msg.expectedOutput = expected; @@ -4056,6 +4099,19 @@ export class TestTag implements vscode.TestTag { constructor(public readonly id: string) { } } +export class TestMessageStackFrame { + /** + * @param label The name of the stack frame + * @param file The file URI of the stack frame + * @param position The position of the stack frame within the file + */ + constructor( + public label: string, + public uri?: vscode.Uri, + public position?: Position, + ) { } +} + //#endregion //#region Test Coverage @@ -4246,10 +4302,6 @@ export class ChatEditorTabInput { constructor() { } } -export class AideChatEditorTabInput { - constructor() { } -} - export class TextMultiDiffTabInput { constructor(readonly textDiffs: TextDiffTabInput[]) { } } @@ -4350,10 +4402,13 @@ export class ChatResponseConfirmationPart { title: string; message: string; data: any; - constructor(title: string, message: string, data: any) { + buttons?: string[]; + + constructor(title: string, message: string, data: any, buttons?: string[]) { this.title = title; this.message = message; this.data = data; + this.buttons = buttons; } } @@ -4368,9 +4423,11 @@ export class ChatResponseFileTreePart { export class ChatResponseAnchorPart { value: vscode.Uri | vscode.Location; + value2: vscode.Uri | vscode.Location | vscode.SymbolInformation; title?: string; - constructor(value: vscode.Uri | vscode.Location, title?: string) { - this.value = value; + constructor(value: vscode.Uri | vscode.Location | vscode.SymbolInformation, title?: string) { + this.value = value as any; + this.value2 = value; this.title = title; } } @@ -4410,11 +4467,39 @@ export class ChatResponseCommandButtonPart { } export class ChatResponseReferencePart { - value: vscode.Uri | vscode.Location | { variableName: string; value?: vscode.Uri | vscode.Location }; + value: vscode.Uri | vscode.Location | { variableName: string; value?: vscode.Uri | vscode.Location } | string; iconPath?: vscode.Uri | vscode.ThemeIcon | { light: vscode.Uri; dark: vscode.Uri }; - constructor(value: vscode.Uri | vscode.Location | { variableName: string; value?: vscode.Uri | vscode.Location }, iconPath?: vscode.Uri | vscode.ThemeIcon | { light: vscode.Uri; dark: vscode.Uri }) { + options?: { status?: { description: string; kind: vscode.ChatResponseReferencePartStatusKind } }; + constructor(value: vscode.Uri | vscode.Location | { variableName: string; value?: vscode.Uri | vscode.Location } | string, iconPath?: vscode.Uri | vscode.ThemeIcon | { light: vscode.Uri; dark: vscode.Uri }, options?: { status?: { description: string; kind: vscode.ChatResponseReferencePartStatusKind } }) { this.value = value; this.iconPath = iconPath; + this.options = options; + } +} + +export class ChatResponseCodeblockUriPart { + value: vscode.Uri; + constructor(value: vscode.Uri) { + this.value = value; + } +} + +export class ChatResponseCodeCitationPart { + value: vscode.Uri; + license: string; + snippet: string; + constructor(value: vscode.Uri, license: string, snippet: string) { + this.value = value; + this.license = license; + this.snippet = snippet; + } +} + +export class ChatResponseMovePart { + constructor( + public readonly uri: vscode.Uri, + public readonly range: vscode.Range, + ) { } } @@ -4428,6 +4513,8 @@ export class ChatResponseTextEditPart { } export class ChatRequestTurn implements vscode.ChatRequestTurn { + toolReferences?: vscode.ChatLanguageModelToolReference[]; + constructor( readonly prompt: string, readonly command: string | undefined, @@ -4453,20 +4540,40 @@ export enum ChatLocation { Editor = 4, } +export enum ChatResponseReferencePartStatusKind { + Complete = 1, + Partial = 2, + Omitted = 3 +} + +export class ChatRequestEditorData implements vscode.ChatRequestEditorData { + constructor( + readonly document: vscode.TextDocument, + readonly selection: vscode.Selection, + readonly wholeRange: vscode.Range, + ) { } +} + +export class ChatRequestNotebookData implements vscode.ChatRequestNotebookData { + constructor( + readonly cell: vscode.TextDocument + ) { } +} + export enum LanguageModelChatMessageRole { User = 1, Assistant = 2, System = 3 } -export class LanguageModelFunctionResultPart implements vscode.LanguageModelChatMessageFunctionResultPart { +export class LanguageModelToolResultPart implements vscode.LanguageModelChatMessageToolResultPart { - name: string; + toolCallId: string; content: string; isError: boolean; - constructor(name: string, content: string, isError?: boolean) { - this.name = name; + constructor(toolCallId: string, content: string, isError?: boolean) { + this.toolCallId = toolCallId; this.content = content; this.isError = isError ?? false; } @@ -4474,9 +4581,9 @@ export class LanguageModelFunctionResultPart implements vscode.LanguageModelChat export class LanguageModelChatMessage implements vscode.LanguageModelChatMessage { - static User(content: string | LanguageModelFunctionResultPart, name?: string): LanguageModelChatMessage { + static User(content: string | LanguageModelToolResultPart, name?: string): LanguageModelChatMessage { const value = new LanguageModelChatMessage(LanguageModelChatMessageRole.User, typeof content === 'string' ? content : '', name); - value.content2 = content; + value.content2 = [content]; return value; } @@ -4486,23 +4593,25 @@ export class LanguageModelChatMessage implements vscode.LanguageModelChatMessage role: vscode.LanguageModelChatMessageRole; content: string; - content2: string | vscode.LanguageModelChatMessageFunctionResultPart; + content2: (string | vscode.LanguageModelChatMessageToolResultPart | vscode.LanguageModelChatResponseToolCallPart)[]; name: string | undefined; constructor(role: vscode.LanguageModelChatMessageRole, content: string, name?: string) { this.role = role; this.content = content; - this.content2 = content; + this.content2 = [content]; this.name = name; } } -export class LanguageModelFunctionUsePart implements vscode.LanguageModelChatResponseFunctionUsePart { +export class LanguageModelToolCallPart implements vscode.LanguageModelChatResponseToolCallPart { name: string; + toolCallId: string; parameters: any; - constructor(name: string, parameters: any) { + constructor(name: string, toolCallId: string, parameters: any) { this.name = name; + this.toolCallId = toolCallId; this.parameters = parameters; } } @@ -4580,176 +4689,6 @@ export class LanguageModelError extends Error { //#endregion //#region AideChat - -export enum AideChatCopyKind { - Action = 1, - Toolbar = 2 -} - -export enum AideChatVariableLevel { - Short = 1, - Medium = 2, - Full = 3 -} - -export class AideChatCompletionItem implements vscode.ChatCompletionItem { - id: string; - label: string | CompletionItemLabel; - fullName?: string | undefined; - icon?: vscode.ThemeIcon; - insertText?: string; - values: vscode.ChatVariableValue[]; - detail?: string; - documentation?: string | MarkdownString; - command?: vscode.Command; - - constructor(id: string, label: string | CompletionItemLabel, values: vscode.ChatVariableValue[]) { - this.id = id; - this.label = label; - this.values = values; - } -} - -export enum AideChatResultFeedbackKind { - Unhelpful = 0, - Helpful = 1, -} - -export class AideChatResponseMarkdownPart { - value: vscode.MarkdownString; - constructor(value: string | vscode.MarkdownString) { - if (typeof value !== 'string' && value.isTrusted === true) { - throw new Error('The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.'); - } - - this.value = typeof value === 'string' ? new MarkdownString(value) : value; - } -} - -/** - * TODO if 'vulnerabilities' is finalized, this should be merged with the base ChatResponseMarkdownPart. I just don't see how to do that while keeping - * vulnerabilities in a seperate API proposal in a clean way. - */ -export class AideChatResponseMarkdownWithVulnerabilitiesPart { - value: vscode.MarkdownString; - vulnerabilities: vscode.ChatVulnerability[]; - constructor(value: string | vscode.MarkdownString, vulnerabilities: vscode.ChatVulnerability[]) { - if (typeof value !== 'string' && value.isTrusted === true) { - throw new Error('The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.'); - } - - this.value = typeof value === 'string' ? new MarkdownString(value) : value; - this.vulnerabilities = vulnerabilities; - } -} - -export class AideChatResponseDetectedParticipantPart { - participant: string; - // TODO@API validate this against statically-declared slash commands? - command?: vscode.ChatCommand; - constructor(participant: string, command?: vscode.ChatCommand) { - this.participant = participant; - this.command = command; - } -} - -export class AideChatResponseConfirmationPart { - title: string; - message: string; - data: any; - constructor(title: string, message: string, data: any) { - this.title = title; - this.message = message; - this.data = data; - } -} - -export class AideChatResponseFileTreePart { - value: vscode.ChatResponseFileTree[]; - baseUri: vscode.Uri; - constructor(value: vscode.ChatResponseFileTree[], baseUri: vscode.Uri) { - this.value = value; - this.baseUri = baseUri; - } -} - -export class AideChatResponseAnchorPart { - value: vscode.Uri | vscode.Location; - title?: string; - constructor(value: vscode.Uri | vscode.Location, title?: string) { - this.value = value; - this.title = title; - } -} - -export class AideChatResponseProgressPart { - value: string; - constructor(value: string) { - this.value = value; - } -} - -export class AideChatResponseProgressPart2 { - value: string; - task?: (progress: vscode.Progress) => Thenable; - constructor(value: string, task?: (progress: vscode.Progress) => Thenable) { - this.value = value; - this.task = task; - } -} - -export class AideChatResponseWarningPart { - value: vscode.MarkdownString; - constructor(value: string | vscode.MarkdownString) { - if (typeof value !== 'string' && value.isTrusted === true) { - throw new Error('The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.'); - } - - this.value = typeof value === 'string' ? new MarkdownString(value) : value; - } -} - -export class AideChatResponseCommandButtonPart { - value: vscode.Command; - constructor(value: vscode.Command) { - this.value = value; - } -} - -export class AideChatResponseReferencePart { - value: vscode.Uri | vscode.Location | { variableName: string; value?: vscode.Uri | vscode.Location }; - iconPath?: vscode.Uri | vscode.ThemeIcon | { light: vscode.Uri; dark: vscode.Uri }; - constructor(value: vscode.Uri | vscode.Location | { variableName: string; value?: vscode.Uri | vscode.Location }, iconPath?: vscode.Uri | vscode.ThemeIcon | { light: vscode.Uri; dark: vscode.Uri }) { - this.value = value; - this.iconPath = iconPath; - } -} - -export class AideChatResponseBreakdownPart { - reference: vscode.CodeReferenceByName; - query?: vscode.MarkdownString; - reason?: vscode.MarkdownString; - response?: vscode.MarkdownString; - constructor( - uri: vscode.Uri, - name: string, - query?: vscode.MarkdownString, - reason?: vscode.MarkdownString, - response?: vscode.MarkdownString, - ) { - if ((typeof query !== 'string' && query?.isTrusted === true) - || (typeof reason !== 'string' && reason?.isTrusted === true) - || (typeof response !== 'string' && response?.isTrusted === true)) { - throw new Error('The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.'); - } - - this.reference = { uri, name }; - this.query = typeof query === 'string' ? new MarkdownString(query) : query; - this.reason = typeof reason === 'string' ? new MarkdownString(reason) : reason; - this.response = typeof response === 'string' ? new MarkdownString(response) : response; - } -} - export class AideProbeOpenFilePart { uri: vscode.Uri; constructor(uri: vscode.Uri) { @@ -4818,41 +4757,6 @@ export class AideProbeInitialSymbolsPart { } } -export class AideChatResponseTextEditPart { - uri: vscode.Uri; - edits: vscode.TextEdit[]; - constructor(uri: vscode.Uri, edits: vscode.TextEdit | vscode.TextEdit[]) { - this.uri = uri; - this.edits = Array.isArray(edits) ? edits : [edits]; - } -} - -export class AideChatRequestTurn implements vscode.ChatRequestTurn { - constructor( - readonly prompt: string, - readonly command: string | undefined, - readonly references: vscode.ChatPromptReference[], - readonly participant: string, - ) { } -} - -export class AideChatResponseTurn implements vscode.ChatResponseTurn { - - constructor( - readonly response: ReadonlyArray, - readonly result: vscode.ChatResult, - readonly participant: string, - readonly command?: string - ) { } -} - -export enum AideChatLocation { - Panel = 1, - Terminal = 2, - Notebook = 3, - Editor = 4, -} - //#endregion //#region ai diff --git a/src/vs/workbench/api/common/extHostUriOpener.ts b/src/vs/workbench/api/common/extHostUriOpener.ts index 4e3577ec1f7..7e97bb4fba0 100644 --- a/src/vs/workbench/api/common/extHostUriOpener.ts +++ b/src/vs/workbench/api/common/extHostUriOpener.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import * as languages from 'vs/editor/common/languages'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { toDisposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import * as languages from '../../../editor/common/languages.js'; +import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; import type * as vscode from 'vscode'; -import { ExtHostUriOpenersShape, IMainContext, MainContext, MainThreadUriOpenersShape } from './extHost.protocol'; +import { ExtHostUriOpenersShape, IMainContext, MainContext, MainThreadUriOpenersShape } from './extHost.protocol.js'; export class ExtHostUriOpeners implements ExtHostUriOpenersShape { diff --git a/src/vs/workbench/api/common/extHostUriTransformerService.ts b/src/vs/workbench/api/common/extHostUriTransformerService.ts index 4d86037b020..58f7ab6a6fc 100644 --- a/src/vs/workbench/api/common/extHostUriTransformerService.ts +++ b/src/vs/workbench/api/common/extHostUriTransformerService.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { URI, UriComponents } from 'vs/base/common/uri'; +import { IURITransformer } from '../../../base/common/uriIpc.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; export interface IURITransformerService extends IURITransformer { readonly _serviceBrand: undefined; diff --git a/src/vs/workbench/api/common/extHostUrls.ts b/src/vs/workbench/api/common/extHostUrls.ts index 2450fd6de0e..c75ce2d4ca1 100644 --- a/src/vs/workbench/api/common/extHostUrls.ts +++ b/src/vs/workbench/api/common/extHostUrls.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { MainContext, IMainContext, ExtHostUrlsShape, MainThreadUrlsShape } from './extHost.protocol'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { ExtensionIdentifierSet, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; +import { MainContext, IMainContext, ExtHostUrlsShape, MainThreadUrlsShape } from './extHost.protocol.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { toDisposable } from '../../../base/common/lifecycle.js'; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import { ExtensionIdentifierSet, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; export class ExtHostUrls implements ExtHostUrlsShape { diff --git a/src/vs/workbench/api/common/extHostVariableResolverService.ts b/src/vs/workbench/api/common/extHostVariableResolverService.ts index be13e517797..d5c19b162fa 100644 --- a/src/vs/workbench/api/common/extHostVariableResolverService.ts +++ b/src/vs/workbench/api/common/extHostVariableResolverService.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Lazy } from 'vs/base/common/lazy'; -import { Disposable } from 'vs/base/common/lifecycle'; -import * as path from 'vs/base/common/path'; -import * as process from 'vs/base/common/process'; -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { IExtHostEditorTabs } from 'vs/workbench/api/common/extHostEditorTabs'; -import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; -import { CustomEditorTabInput, NotebookDiffEditorTabInput, NotebookEditorTabInput, TextDiffTabInput, TextTabInput } from 'vs/workbench/api/common/extHostTypes'; -import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; -import { AbstractVariableResolverService } from 'vs/workbench/services/configurationResolver/common/variableResolver'; +import { Lazy } from '../../../base/common/lazy.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import * as path from '../../../base/common/path.js'; +import * as process from '../../../base/common/process.js'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors.js'; +import { IExtHostEditorTabs } from './extHostEditorTabs.js'; +import { IExtHostExtensionService } from './extHostExtensionService.js'; +import { CustomEditorTabInput, NotebookDiffEditorTabInput, NotebookEditorTabInput, TextDiffTabInput, TextTabInput } from './extHostTypes.js'; +import { IExtHostWorkspace } from './extHostWorkspace.js'; +import { IConfigurationResolverService } from '../../services/configurationResolver/common/configurationResolver.js'; +import { AbstractVariableResolverService } from '../../services/configurationResolver/common/variableResolver.js'; import * as vscode from 'vscode'; -import { ExtHostConfigProvider, IExtHostConfiguration } from './extHostConfiguration'; +import { ExtHostConfigProvider, IExtHostConfiguration } from './extHostConfiguration.js'; export interface IExtHostVariableResolverProvider { readonly _serviceBrand: undefined; diff --git a/src/vs/workbench/api/common/extHostWebview.ts b/src/vs/workbench/api/common/extHostWebview.ts index 367d4efbac2..435df4b03fc 100644 --- a/src/vs/workbench/api/common/extHostWebview.ts +++ b/src/vs/workbench/api/common/extHostWebview.ts @@ -5,22 +5,22 @@ /* eslint-disable local/code-no-native-private */ -import { VSBuffer } from 'vs/base/common/buffer'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import * as objects from 'vs/base/common/objects'; -import { URI } from 'vs/base/common/uri'; -import { normalizeVersion, parseVersion } from 'vs/platform/extensions/common/extensionValidator'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IExtHostApiDeprecationService } from 'vs/workbench/api/common/extHostApiDeprecationService'; -import { deserializeWebviewMessage, serializeWebviewMessage } from 'vs/workbench/api/common/extHostWebviewMessaging'; -import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { WebviewRemoteInfo, asWebviewUri, webviewGenericCspSource } from 'vs/workbench/contrib/webview/common/webview'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import * as objects from '../../../base/common/objects.js'; +import { URI } from '../../../base/common/uri.js'; +import { normalizeVersion, parseVersion } from '../../../platform/extensions/common/extensionValidator.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IExtHostApiDeprecationService } from './extHostApiDeprecationService.js'; +import { deserializeWebviewMessage, serializeWebviewMessage } from './extHostWebviewMessaging.js'; +import { IExtHostWorkspace } from './extHostWorkspace.js'; +import { WebviewRemoteInfo, asWebviewUri, webviewGenericCspSource } from '../../contrib/webview/common/webview.js'; +import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; import type * as vscode from 'vscode'; -import * as extHostProtocol from './extHost.protocol'; +import * as extHostProtocol from './extHost.protocol.js'; export class ExtHostWebview implements vscode.Webview { diff --git a/src/vs/workbench/api/common/extHostWebviewMessaging.ts b/src/vs/workbench/api/common/extHostWebviewMessaging.ts index 88c477baab5..faf3d228656 100644 --- a/src/vs/workbench/api/common/extHostWebviewMessaging.ts +++ b/src/vs/workbench/api/common/extHostWebviewMessaging.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { VSBuffer } from 'vs/base/common/buffer'; -import * as extHostProtocol from './extHost.protocol'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import * as extHostProtocol from './extHost.protocol.js'; class ArrayBufferSet { public readonly buffers: ArrayBuffer[] = []; diff --git a/src/vs/workbench/api/common/extHostWebviewPanels.ts b/src/vs/workbench/api/common/extHostWebviewPanels.ts index 6018c3718de..872c1fbe3dd 100644 --- a/src/vs/workbench/api/common/extHostWebviewPanels.ts +++ b/src/vs/workbench/api/common/extHostWebviewPanels.ts @@ -5,18 +5,18 @@ /* eslint-disable local/code-no-native-private */ -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; -import { serializeWebviewOptions, ExtHostWebview, ExtHostWebviews, toExtensionData, shouldSerializeBuffersForPostMessage } from 'vs/workbench/api/common/extHostWebview'; -import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { URI } from '../../../base/common/uri.js'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import * as typeConverters from './extHostTypeConverters.js'; +import { serializeWebviewOptions, ExtHostWebview, ExtHostWebviews, toExtensionData, shouldSerializeBuffersForPostMessage } from './extHostWebview.js'; +import { IExtHostWorkspace } from './extHostWorkspace.js'; +import { EditorGroupColumn } from '../../services/editor/common/editorGroupColumn.js'; import type * as vscode from 'vscode'; -import * as extHostProtocol from './extHost.protocol'; -import * as extHostTypes from './extHostTypes'; +import * as extHostProtocol from './extHost.protocol.js'; +import * as extHostTypes from './extHostTypes.js'; type IconPath = URI | { readonly light: URI; readonly dark: URI }; diff --git a/src/vs/workbench/api/common/extHostWebviewView.ts b/src/vs/workbench/api/common/extHostWebviewView.ts index 89ae50c50cf..4696f33c5fa 100644 --- a/src/vs/workbench/api/common/extHostWebviewView.ts +++ b/src/vs/workbench/api/common/extHostWebviewView.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationToken } from 'vs/base/common/cancellation'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostWebview, ExtHostWebviews, toExtensionData, shouldSerializeBuffersForPostMessage } from 'vs/workbench/api/common/extHostWebview'; -import { ViewBadge } from 'vs/workbench/api/common/extHostTypeConverters'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { Emitter } from '../../../base/common/event.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtHostWebview, ExtHostWebviews, toExtensionData, shouldSerializeBuffersForPostMessage } from './extHostWebview.js'; +import { ViewBadge } from './extHostTypeConverters.js'; import type * as vscode from 'vscode'; -import * as extHostProtocol from './extHost.protocol'; -import * as extHostTypes from './extHostTypes'; +import * as extHostProtocol from './extHost.protocol.js'; +import * as extHostTypes from './extHostTypes.js'; /* eslint-disable local/code-no-native-private */ diff --git a/src/vs/workbench/api/common/extHostWindow.ts b/src/vs/workbench/api/common/extHostWindow.ts index 82b721fe489..6f74b721b8a 100644 --- a/src/vs/workbench/api/common/extHostWindow.ts +++ b/src/vs/workbench/api/common/extHostWindow.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { Schemas } from 'vs/base/common/network'; -import { isFalsyOrWhitespace } from 'vs/base/common/strings'; -import { URI } from 'vs/base/common/uri'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { Schemas } from '../../../base/common/network.js'; +import { isFalsyOrWhitespace } from '../../../base/common/strings.js'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; import { WindowState } from 'vscode'; -import { ExtHostWindowShape, IOpenUriOptions, MainContext, MainThreadWindowShape } from './extHost.protocol'; +import { ExtHostWindowShape, IOpenUriOptions, MainContext, MainThreadWindowShape } from './extHost.protocol.js'; export class ExtHostWindow implements ExtHostWindowShape { diff --git a/src/vs/workbench/api/common/extHostWorkspace.ts b/src/vs/workbench/api/common/extHostWorkspace.ts index 5b3cd328aaa..abb49a3cc27 100644 --- a/src/vs/workbench/api/common/extHostWorkspace.ts +++ b/src/vs/workbench/api/common/extHostWorkspace.ts @@ -3,42 +3,46 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { delta as arrayDelta, mapArrayOrNot } from 'vs/base/common/arrays'; -import { Barrier } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { AsyncEmitter, Emitter, Event } from 'vs/base/common/event'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { Schemas } from 'vs/base/common/network'; -import { Counter } from 'vs/base/common/numbers'; -import { basename, basenameOrAuthority, dirname, ExtUri, relativePath } from 'vs/base/common/resources'; -import { compare } from 'vs/base/common/strings'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { FileSystemProviderCapabilities } from 'vs/platform/files/common/files'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Severity } from 'vs/platform/notification/common/notification'; -import { EditSessionIdentityMatch } from 'vs/platform/workspace/common/editSessions'; -import { Workspace, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { GlobPattern } from 'vs/workbench/api/common/extHostTypeConverters'; -import { Range } from 'vs/workbench/api/common/extHostTypes'; -import { IURITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; -import { IFileQueryBuilderOptions, ITextQueryBuilderOptions } from 'vs/workbench/services/search/common/queryBuilder'; -import { IRawFileMatch2, ITextSearchResult, resultIsMatch } from 'vs/workbench/services/search/common/search'; -import * as vscode from 'vscode'; -import { ExtHostWorkspaceShape, IRelativePatternDto, IWorkspaceData, MainContext, MainThreadMessageOptions, MainThreadMessageServiceShape, MainThreadWorkspaceShape } from './extHost.protocol'; -import { revive } from 'vs/base/common/marshalling'; +import { delta as arrayDelta, mapArrayOrNot } from '../../../base/common/arrays.js'; +import { AsyncIterableObject, Barrier } from '../../../base/common/async.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { AsyncEmitter, Emitter, Event } from '../../../base/common/event.js'; +import { DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; +import { TernarySearchTree } from '../../../base/common/ternarySearchTree.js'; +import { Schemas } from '../../../base/common/network.js'; +import { Counter } from '../../../base/common/numbers.js'; +import { basename, basenameOrAuthority, dirname, ExtUri, relativePath } from '../../../base/common/resources.js'; +import { compare } from '../../../base/common/strings.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { localize } from '../../../nls.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { FileSystemProviderCapabilities } from '../../../platform/files/common/files.js'; +import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { Severity } from '../../../platform/notification/common/notification.js'; +import { EditSessionIdentityMatch } from '../../../platform/workspace/common/editSessions.js'; +import { Workspace, WorkspaceFolder } from '../../../platform/workspace/common/workspace.js'; +import { IExtHostFileSystemInfo } from './extHostFileSystemInfo.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { IExtHostRpcService } from './extHostRpcService.js'; +import { GlobPattern } from './extHostTypeConverters.js'; +import { Range } from './extHostTypes.js'; +import { IURITransformerService } from './extHostUriTransformerService.js'; +import { IFileQueryBuilderOptions, ISearchPatternBuilder, ITextQueryBuilderOptions } from '../../services/search/common/queryBuilder.js'; +import { IRawFileMatch2, ITextSearchResult, resultIsMatch } from '../../services/search/common/search.js'; +import type * as vscode from 'vscode'; +import { ExtHostWorkspaceShape, IRelativePatternDto, IWorkspaceData, MainContext, MainThreadMessageOptions, MainThreadMessageServiceShape, MainThreadWorkspaceShape } from './extHost.protocol.js'; +import { revive } from '../../../base/common/marshalling.js'; +import { AuthInfo, Credentials } from '../../../platform/request/common/request.js'; +import { ExcludeSettingOptions, TextSearchContextNew, TextSearchMatchNew } from '../../services/search/common/searchExtTypes.js'; export interface IExtHostWorkspaceProvider { getWorkspaceFolder2(uri: vscode.Uri, resolveParent?: boolean): Promise; resolveWorkspaceFolder(uri: vscode.Uri): Promise; getWorkspaceFolders2(): Promise; resolveProxy(url: string): Promise; + lookupAuthorization(authInfo: AuthInfo): Promise; + lookupKerberosAuthorization(url: string): Promise; loadCertificates(): Promise; } @@ -75,6 +79,11 @@ interface MutableWorkspaceFolder extends vscode.WorkspaceFolder { index: number; } +interface QueryOptions { + options: T; + folder: URI | undefined; +} + class ExtHostWorkspaceImpl extends Workspace { static toExtHostWorkspace(data: IWorkspaceData | null, previousConfirmedWorkspace: ExtHostWorkspaceImpl | undefined, previousUnconfirmedWorkspace: ExtHostWorkspaceImpl | undefined, extHostFileSystemInfo: IExtHostFileSystemInfo): { workspace: ExtHostWorkspaceImpl | null; added: vscode.WorkspaceFolder[]; removed: vscode.WorkspaceFolder[] } { @@ -457,12 +466,15 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac excludeString = exclude.pattern; } } + + // todo: consider exclude baseURI if available return this._findFilesImpl(include, undefined, { - exclude: excludeString, + exclude: [excludeString], maxResults, - useDefaultExcludes: useFileExcludes, - useDefaultSearchExcludes: false, - useIgnoreFiles: false + useExcludeSettings: useFileExcludes ? ExcludeSettingOptions.FilesExclude : ExcludeSettingOptions.None, + useIgnoreFiles: { + local: false + } }, token); } @@ -471,86 +483,191 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac extensionId: ExtensionIdentifier, token: vscode.CancellationToken = CancellationToken.None): Promise { this._logService.trace(`extHostWorkspace#findFiles2: fileSearch, extension: ${extensionId.value}, entryPoint: findFiles2`); - return this._findFilesImpl(undefined, filePattern, options, token); + + + const useDefaultExcludes = options.useDefaultExcludes ?? true; + const useDefaultSearchExcludes = options.useDefaultSearchExcludes ?? true; + const excludeSetting = useDefaultExcludes ? + (useDefaultSearchExcludes ? ExcludeSettingOptions.SearchAndFilesExclude : ExcludeSettingOptions.FilesExclude) : + ExcludeSettingOptions.None; + const newOptions: vscode.FindFiles2OptionsNew = { + exclude: options.exclude ? [options.exclude] : undefined, + useIgnoreFiles: { + local: options.useIgnoreFiles, + global: options.useGlobalIgnoreFiles, + parent: options.useParentIgnoreFiles + }, + useExcludeSettings: excludeSetting, + followSymlinks: options.followSymlinks, + maxResults: options.maxResults, + }; + return this._findFilesImpl(undefined, filePattern !== undefined ? [filePattern] : [], newOptions, token); + } + + findFiles2New(filePatterns: vscode.GlobPattern[], + options: vscode.FindFiles2OptionsNew = {}, + extensionId: ExtensionIdentifier, + token: vscode.CancellationToken = CancellationToken.None): Promise { + this._logService.trace(`extHostWorkspace#findFiles2New: fileSearch, extension: ${extensionId.value}, entryPoint: findFiles2New`); + return this._findFilesImpl(undefined, filePatterns, options, token); } private async _findFilesImpl( // the old `findFiles` used `include` to query, but the new `findFiles2` uses `filePattern` to query. // `filePattern` is the proper way to handle this, since it takes less precedence than the ignore files. include: vscode.GlobPattern | undefined, - filePattern: vscode.GlobPattern | undefined, - options: vscode.FindFiles2Options, + filePatterns: vscode.GlobPattern[] | undefined, + options: vscode.FindFiles2OptionsNew, token: vscode.CancellationToken = CancellationToken.None): Promise { if (token && token.isCancellationRequested) { return Promise.resolve([]); } - const excludePattern = (typeof options.exclude === 'string') ? options.exclude : - options.exclude ? options.exclude.pattern : undefined; - const fileQueries: IFileQueryBuilderOptions = { - ignoreSymlinks: typeof options.followSymlinks === 'boolean' ? !options.followSymlinks : undefined, - disregardIgnoreFiles: typeof options.useIgnoreFiles === 'boolean' ? !options.useIgnoreFiles : undefined, - disregardGlobalIgnoreFiles: typeof options.useGlobalIgnoreFiles === 'boolean' ? !options.useGlobalIgnoreFiles : undefined, - disregardParentIgnoreFiles: typeof options.useParentIgnoreFiles === 'boolean' ? !options.useParentIgnoreFiles : undefined, - disregardExcludeSettings: typeof options.useDefaultExcludes === 'boolean' ? !options.useDefaultExcludes : false, - disregardSearchExcludeSettings: typeof options.useDefaultSearchExcludes === 'boolean' ? !options.useDefaultSearchExcludes : false, - maxResults: options.maxResults, - excludePattern: excludePattern, - shouldGlobSearch: typeof options.fuzzy === 'boolean' ? !options.fuzzy : true, - _reason: 'startFileSearch' - }; - let folderToUse: URI | undefined; - if (include) { - const { includePattern, folder } = parseSearchInclude(GlobPattern.from(include)); - folderToUse = folder; - fileQueries.includePattern = includePattern; - } else { - const { includePattern, folder } = parseSearchInclude(GlobPattern.from(filePattern)); - folderToUse = folder; - fileQueries.filePattern = includePattern; - } + const filePatternsToUse = include !== undefined ? [include] : filePatterns; + const queryOptions: QueryOptions[] = filePatternsToUse?.map(filePattern => { - return this._proxy.$startFileSearch( - folderToUse ?? null, - fileQueries, - token - ) - .then(data => Array.isArray(data) ? data.map(d => URI.revive(d)) : []); + const excludePatterns = globsToISearchPatternBuilder(options.exclude); + + const fileQueries: IFileQueryBuilderOptions = { + ignoreSymlinks: typeof options.followSymlinks === 'boolean' ? !options.followSymlinks : undefined, + disregardIgnoreFiles: typeof options.useIgnoreFiles?.local === 'boolean' ? !options.useIgnoreFiles.local : undefined, + disregardGlobalIgnoreFiles: typeof options.useIgnoreFiles?.global === 'boolean' ? !options.useIgnoreFiles.global : undefined, + disregardParentIgnoreFiles: typeof options.useIgnoreFiles?.parent === 'boolean' ? !options.useIgnoreFiles.parent : undefined, + disregardExcludeSettings: options.useExcludeSettings !== undefined && options.useExcludeSettings === ExcludeSettingOptions.None, + disregardSearchExcludeSettings: options.useExcludeSettings !== undefined && (options.useExcludeSettings !== ExcludeSettingOptions.SearchAndFilesExclude), + maxResults: options.maxResults, + excludePattern: excludePatterns.length > 0 ? excludePatterns : undefined, + _reason: 'startFileSearch', + shouldGlobSearch: include ? undefined : true, + }; + + const parseInclude = parseSearchExcludeInclude(GlobPattern.from(filePattern)); + const folderToUse = parseInclude?.folder; + if (include) { + fileQueries.includePattern = parseInclude?.pattern; + } else { + fileQueries.filePattern = parseInclude?.pattern; + } + return { + folder: folderToUse, + options: fileQueries + }; + }) ?? []; + + return this._findFilesBase(queryOptions, token); } - async findTextInFiles(query: vscode.TextSearchQuery, options: vscode.FindTextInFilesOptions, callback: (result: vscode.TextSearchResult) => void, extensionId: ExtensionIdentifier, token: vscode.CancellationToken = CancellationToken.None): Promise { - this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${extensionId.value}, entryPoint: findTextInFiles`); + private async _findFilesBase( + queryOptions: QueryOptions[] | undefined, + token: CancellationToken + ): Promise { + const result = await Promise.all(queryOptions?.map(option => this._proxy.$startFileSearch( + option.folder ?? null, + option.options, + token).then(data => Array.isArray(data) ? data.map(d => URI.revive(d)) : []) + ) ?? []); - const requestId = this._requestIdProvider.getNext(); + return result.flat(); + } - const previewOptions: vscode.TextSearchPreviewOptions = typeof options.previewOptions === 'undefined' ? - { - matchLines: 100, - charsPerLine: 10000 - } : - options.previewOptions; + findTextInFilesNew(query: vscode.TextSearchQueryNew, options: vscode.FindTextInFilesOptionsNew | undefined, extensionId: ExtensionIdentifier, token: vscode.CancellationToken = CancellationToken.None): vscode.FindTextInFilesResponse { + this._logService.trace(`extHostWorkspace#findTextInFilesNew: textSearch, extension: ${extensionId.value}, entryPoint: findTextInFilesNew`); - const { includePattern, folder } = parseSearchInclude(GlobPattern.from(options.include)); - const excludePattern = (typeof options.exclude === 'string') ? options.exclude : - options.exclude ? options.exclude.pattern : undefined; - const queryOptions: ITextQueryBuilderOptions = { - ignoreSymlinks: typeof options.followSymlinks === 'boolean' ? !options.followSymlinks : undefined, - disregardIgnoreFiles: typeof options.useIgnoreFiles === 'boolean' ? !options.useIgnoreFiles : undefined, - disregardGlobalIgnoreFiles: typeof options.useGlobalIgnoreFiles === 'boolean' ? !options.useGlobalIgnoreFiles : undefined, - disregardParentIgnoreFiles: typeof options.useParentIgnoreFiles === 'boolean' ? !options.useParentIgnoreFiles : undefined, - disregardExcludeSettings: typeof options.useDefaultExcludes === 'boolean' ? !options.useDefaultExcludes : true, - fileEncoding: options.encoding, - maxResults: options.maxResults, - previewOptions, - afterContext: options.afterContext, - beforeContext: options.beforeContext, - includePattern: includePattern, - excludePattern: excludePattern + const getOptions = (include: vscode.GlobPattern | undefined): QueryOptions => { + if (!options) { + return { + folder: undefined, + options: {} + }; + } + const parsedInclude = include ? parseSearchExcludeInclude(GlobPattern.from(include)) : undefined; + + const excludePatterns = options.exclude ? globsToISearchPatternBuilder(options.exclude) : undefined; + + return { + options: { + + ignoreSymlinks: typeof options.followSymlinks === 'boolean' ? !options.followSymlinks : undefined, + disregardIgnoreFiles: typeof options.useIgnoreFiles === 'boolean' ? !options.useIgnoreFiles : undefined, + disregardGlobalIgnoreFiles: typeof options.useIgnoreFiles?.global === 'boolean' ? !options.useIgnoreFiles?.global : undefined, + disregardParentIgnoreFiles: typeof options.useIgnoreFiles?.parent === 'boolean' ? !options.useIgnoreFiles?.parent : undefined, + disregardExcludeSettings: options.useExcludeSettings !== undefined && options.useExcludeSettings === ExcludeSettingOptions.None, + disregardSearchExcludeSettings: options.useExcludeSettings !== undefined && (options.useExcludeSettings !== ExcludeSettingOptions.SearchAndFilesExclude), + fileEncoding: options.encoding, + maxResults: options.maxResults, + previewOptions: options.previewOptions ? { + matchLines: options.previewOptions?.numMatchLines ?? 100, + charsPerLine: options.previewOptions?.charsPerLine ?? 10000, + } : undefined, + surroundingContext: options.surroundingContext, + + includePattern: parsedInclude?.pattern, + excludePattern: excludePatterns + } satisfies ITextQueryBuilderOptions, + folder: parsedInclude?.folder + } satisfies QueryOptions; + }; + + const queryOptionsRaw: (QueryOptions | undefined)[] = ((options?.include?.map((include) => + getOptions(include)))) ?? [getOptions(undefined)]; + + const queryOptions = queryOptionsRaw.filter((queryOps): queryOps is QueryOptions => !!queryOps); + + const disposables = new DisposableStore(); + const progressEmitter = disposables.add(new Emitter<{ result: ITextSearchResult; uri: URI }>()); + const complete = this.findTextInFilesBase( + query, + queryOptions, + (result, uri) => progressEmitter.fire({ result, uri }), + token + ); + const asyncIterable = new AsyncIterableObject(async emitter => { + disposables.add(progressEmitter.event(e => { + const result = e.result; + const uri = e.uri; + if (resultIsMatch(result)) { + emitter.emitOne(new TextSearchMatchNew( + uri, + result.rangeLocations.map((range) => ({ + previewRange: new Range(range.preview.startLineNumber, range.preview.startColumn, range.preview.endLineNumber, range.preview.endColumn), + sourceRange: new Range(range.source.startLineNumber, range.source.startColumn, range.source.endLineNumber, range.source.endColumn) + })), + result.previewText + + )); + } else { + emitter.emitOne(new TextSearchContextNew( + uri, + result.text, + result.lineNumber + )); + + } + })); + await complete; + }); + + return { + results: asyncIterable, + complete: complete.then((e) => { + disposables.dispose(); + return { + limitHit: e?.limitHit ?? false + }; + }), }; + } - const isCanceled = false; + + async findTextInFilesBase(query: vscode.TextSearchQuery, queryOptions: QueryOptions[] | undefined, callback: (result: ITextSearchResult, uri: URI) => void, token: vscode.CancellationToken = CancellationToken.None): Promise { + const requestId = this._requestIdProvider.getNext(); + + let isCanceled = false; + token.onCancellationRequested(_ => { + isCanceled = true; + }); this._activeSearchCallbacks[requestId] = p => { if (isCanceled) { @@ -560,26 +677,7 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac const uri = URI.revive(p.resource); p.results!.forEach(rawResult => { const result: ITextSearchResult = revive(rawResult); - if (resultIsMatch(result)) { - callback({ - uri, - preview: { - text: result.preview.text, - matches: mapArrayOrNot( - result.preview.matches, - m => new Range(m.startLineNumber, m.startColumn, m.endLineNumber, m.endColumn)) - }, - ranges: mapArrayOrNot( - result.ranges, - r => new Range(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn)) - } satisfies vscode.TextSearchMatch); - } else { - callback({ - uri, - text: result.text, - lineNumber: result.lineNumber - } satisfies vscode.TextSearchContext); - } + callback(result, uri); }); }; @@ -588,20 +686,83 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac } try { - const result = await this._proxy.$startTextSearch( + const result = await Promise.all(queryOptions?.map(option => this._proxy.$startTextSearch( query, - folder ?? null, - queryOptions, + option.folder ?? null, + option.options, requestId, - token); + token) || {} + ) ?? []); delete this._activeSearchCallbacks[requestId]; - return result || {}; + return result.reduce((acc, val) => { + return { + limitHit: acc?.limitHit || (val?.limitHit ?? false), + message: [acc?.message ?? [], val?.message ?? []].flat(), + }; + }, {}) ?? { limitHit: false }; + } catch (err) { delete this._activeSearchCallbacks[requestId]; throw err; } } + async findTextInFiles(query: vscode.TextSearchQuery, options: vscode.FindTextInFilesOptions & { useSearchExclude?: boolean }, callback: (result: vscode.TextSearchResult) => void, extensionId: ExtensionIdentifier, token: vscode.CancellationToken = CancellationToken.None): Promise { + this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${extensionId.value}, entryPoint: findTextInFiles`); + + const previewOptions: vscode.TextSearchPreviewOptions = typeof options.previewOptions === 'undefined' ? + { + matchLines: 100, + charsPerLine: 10000 + } : + options.previewOptions; + + const parsedInclude = parseSearchExcludeInclude(GlobPattern.from(options.include)); + + const excludePattern = (typeof options.exclude === 'string') ? options.exclude : + options.exclude ? options.exclude.pattern : undefined; + const queryOptions: ITextQueryBuilderOptions = { + ignoreSymlinks: typeof options.followSymlinks === 'boolean' ? !options.followSymlinks : undefined, + disregardIgnoreFiles: typeof options.useIgnoreFiles === 'boolean' ? !options.useIgnoreFiles : undefined, + disregardGlobalIgnoreFiles: typeof options.useGlobalIgnoreFiles === 'boolean' ? !options.useGlobalIgnoreFiles : undefined, + disregardParentIgnoreFiles: typeof options.useParentIgnoreFiles === 'boolean' ? !options.useParentIgnoreFiles : undefined, + disregardExcludeSettings: typeof options.useDefaultExcludes === 'boolean' ? !options.useDefaultExcludes : true, + disregardSearchExcludeSettings: typeof options.useSearchExclude === 'boolean' ? !options.useSearchExclude : true, + fileEncoding: options.encoding, + maxResults: options.maxResults, + previewOptions, + surroundingContext: options.afterContext, // TODO: remove ability to have before/after context separately + + includePattern: parsedInclude?.pattern, + excludePattern: excludePattern ? [{ pattern: excludePattern }] : undefined, + }; + + const progress = (result: ITextSearchResult, uri: URI) => { + if (resultIsMatch(result)) { + callback({ + uri, + preview: { + text: result.previewText, + matches: mapArrayOrNot( + result.rangeLocations, + m => new Range(m.preview.startLineNumber, m.preview.startColumn, m.preview.endLineNumber, m.preview.endColumn)) + }, + ranges: mapArrayOrNot( + result.rangeLocations, + r => new Range(r.source.startLineNumber, r.source.startColumn, r.source.endLineNumber, r.source.endColumn)) + } satisfies vscode.TextSearchMatch); + } else { + callback({ + uri, + text: result.text, + lineNumber: result.lineNumber + } satisfies vscode.TextSearchContext); + } + }; + + return this.findTextInFilesBase(query, [{ options: queryOptions, folder: parsedInclude?.folder }], progress, token); + } + $handleTextSearchResult(result: IRawFileMatch2, requestId: number): void { this._activeSearchCallbacks[requestId]?.(result); } @@ -626,6 +787,14 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac return this._proxy.$resolveProxy(url); } + lookupAuthorization(authInfo: AuthInfo): Promise { + return this._proxy.$lookupAuthorization(authInfo); + } + + lookupKerberosAuthorization(url: string): Promise { + return this._proxy.$lookupKerberosAuthorization(url); + } + loadCertificates(): Promise { return this._proxy.$loadCertificates(); } @@ -794,22 +963,23 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac export const IExtHostWorkspace = createDecorator('IExtHostWorkspace'); export interface IExtHostWorkspace extends ExtHostWorkspace, ExtHostWorkspaceShape, IExtHostWorkspaceProvider { } -function parseSearchInclude(include: string | IRelativePatternDto | undefined | null): { includePattern?: string; folder?: URI } { - let includePattern: string | undefined; +function parseSearchExcludeInclude(include: string | IRelativePatternDto | undefined | null): { pattern: string; folder?: URI } | undefined { + let pattern: string | undefined; let includeFolder: URI | undefined; if (include) { if (typeof include === 'string') { - includePattern = include; + pattern = include; } else { - includePattern = include.pattern; + pattern = include.pattern; includeFolder = URI.revive(include.baseUri); } - } - return { - includePattern, - folder: includeFolder - }; + return { + pattern, + folder: includeFolder + }; + } + return undefined; } interface IExtensionListener { @@ -817,3 +987,27 @@ interface IExtensionListener { (e: E): any; } +function globsToISearchPatternBuilder(excludes: vscode.GlobPattern[] | undefined): ISearchPatternBuilder[] { + return ( + excludes?.map((exclude): ISearchPatternBuilder | undefined => { + if (typeof exclude === 'string') { + if (exclude === '') { + return undefined; + } + return { + pattern: exclude, + uri: undefined + } satisfies ISearchPatternBuilder; + } else { + const parsedExclude = parseSearchExcludeInclude(exclude); + if (!parsedExclude) { + return undefined; + } + return { + pattern: parsedExclude.pattern, + uri: parsedExclude.folder + } satisfies ISearchPatternBuilder; + } + }) ?? [] + ).filter((e): e is ISearchPatternBuilder => !!e); +} diff --git a/src/vs/workbench/api/common/extensionHostMain.ts b/src/vs/workbench/api/common/extensionHostMain.ts index 50c47ba98a8..6c93b88e428 100644 --- a/src/vs/workbench/api/common/extensionHostMain.ts +++ b/src/vs/workbench/api/common/extensionHostMain.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as errors from 'vs/base/common/errors'; -import * as performance from 'vs/base/common/performance'; -import { URI } from 'vs/base/common/uri'; -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc'; -import { MainContext, MainThreadConsoleShape } from 'vs/workbench/api/common/extHost.protocol'; -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 { getSingletonServiceDescriptors } from 'vs/platform/instantiation/common/extensions'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostRpcService, ExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IURITransformerService, URITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; -import { IExtHostExtensionService, IHostUtils } from 'vs/workbench/api/common/extHostExtensionService'; -import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import { Mutable } from 'vs/base/common/types'; +import * as errors from '../../../base/common/errors.js'; +import * as performance from '../../../base/common/performance.js'; +import { URI } from '../../../base/common/uri.js'; +import { IURITransformer } from '../../../base/common/uriIpc.js'; +import { IMessagePassingProtocol } from '../../../base/parts/ipc/common/ipc.js'; +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 { getSingletonServiceDescriptors } from '../../../platform/instantiation/common/extensions.js'; +import { ServiceCollection } from '../../../platform/instantiation/common/serviceCollection.js'; +import { IExtHostInitDataService } from './extHostInitDataService.js'; +import { InstantiationService } from '../../../platform/instantiation/common/instantiationService.js'; +import { IInstantiationService, ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { IExtHostRpcService, ExtHostRpcService } from './extHostRpcService.js'; +import { IURITransformerService, URITransformerService } from './extHostUriTransformerService.js'; +import { IExtHostExtensionService, IHostUtils } from './extHostExtensionService.js'; +import { IExtHostTelemetry } from './extHostTelemetry.js'; +import { Mutable } from '../../../base/common/types.js'; export interface IExitFn { (code?: number): any; diff --git a/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts b/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts index 1b82d305f19..24559bee3f8 100644 --- a/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts +++ b/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry'; -import * as resources from 'vs/base/common/resources'; -import { isString } from 'vs/base/common/types'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Extensions, IExtensionFeatureTableRenderer, IExtensionFeaturesRegistry, IRenderedData, IRowData, ITableData } from 'vs/workbench/services/extensionManagement/common/extensionFeatures'; -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 * as nls from '../../../nls.js'; +import { ExtensionsRegistry } from '../../services/extensions/common/extensionsRegistry.js'; +import * as resources from '../../../base/common/resources.js'; +import { isString } from '../../../base/common/types.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Extensions, IExtensionFeatureTableRenderer, IExtensionFeaturesRegistry, IRenderedData, IRowData, ITableData } from '../../services/extensionManagement/common/extensionFeatures.js'; +import { IExtensionManifest } from '../../../platform/extensions/common/extensions.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { SyncDescriptor } from '../../../platform/instantiation/common/descriptors.js'; +import { MarkdownString } from '../../../base/common/htmlContent.js'; interface IJSONValidationExtensionPoint { fileMatch: string | string[]; diff --git a/src/vs/workbench/api/common/shared/dataTransferCache.ts b/src/vs/workbench/api/common/shared/dataTransferCache.ts index 49ff0735c5c..229407d21be 100644 --- a/src/vs/workbench/api/common/shared/dataTransferCache.ts +++ b/src/vs/workbench/api/common/shared/dataTransferCache.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { coalesce } from 'vs/base/common/arrays'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { IDataTransferFile, IReadonlyVSDataTransfer } from 'vs/base/common/dataTransfer'; +import { coalesce } from '../../../../base/common/arrays.js'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { IDataTransferFile, IReadonlyVSDataTransfer } from '../../../../base/common/dataTransfer.js'; export class DataTransferFileCache { diff --git a/src/vs/workbench/api/common/shared/tasks.ts b/src/vs/workbench/api/common/shared/tasks.ts index 6f0445ab393..67a3fe9e05d 100644 --- a/src/vs/workbench/api/common/shared/tasks.ts +++ b/src/vs/workbench/api/common/shared/tasks.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { UriComponents } from 'vs/base/common/uri'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import type { Dto } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { UriComponents } from '../../../../base/common/uri.js'; +import { IExtensionDescription } from '../../../../platform/extensions/common/extensions.js'; +import type { Dto } from '../../../services/extensions/common/proxyIdentifier.js'; export interface ITaskDefinitionDTO { type: string; diff --git a/src/vs/workbench/api/node/extHost.node.services.ts b/src/vs/workbench/api/node/extHost.node.services.ts index 582cea087ee..17d845a2ce6 100644 --- a/src/vs/workbench/api/node/extHost.node.services.ts +++ b/src/vs/workbench/api/node/extHost.node.services.ts @@ -3,29 +3,29 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { ExtHostTerminalService } from 'vs/workbench/api/node/extHostTerminalService'; -import { ExtHostTask } from 'vs/workbench/api/node/extHostTask'; -import { ExtHostDebugService } from 'vs/workbench/api/node/extHostDebugService'; -import { NativeExtHostSearch } from 'vs/workbench/api/node/extHostSearch'; -import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionService'; -import { NodeExtHostTunnelService } from 'vs/workbench/api/node/extHostTunnelService'; -import { IExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService'; -import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; -import { IExtHostSearch } from 'vs/workbench/api/common/extHostSearch'; -import { IExtHostTask } from 'vs/workbench/api/common/extHostTask'; -import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; -import { IExtHostTunnelService } from 'vs/workbench/api/common/extHostTunnelService'; -import { IExtensionStoragePaths } from 'vs/workbench/api/common/extHostStoragePaths'; -import { ExtensionStoragePaths } from 'vs/workbench/api/node/extHostStoragePaths'; -import { ExtHostLoggerService } from 'vs/workbench/api/node/extHostLoggerService'; -import { ILogService, ILoggerService } from 'vs/platform/log/common/log'; -import { NodeExtHostVariableResolverProviderService } from 'vs/workbench/api/node/extHostVariableResolverService'; -import { IExtHostVariableResolverProvider } from 'vs/workbench/api/common/extHostVariableResolverService'; -import { ExtHostLogService } from 'vs/workbench/api/common/extHostLogService'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { ISignService } from 'vs/platform/sign/common/sign'; -import { SignService } from 'vs/platform/sign/node/signService'; +import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; +import { ExtHostTerminalService } from './extHostTerminalService.js'; +import { ExtHostTask } from './extHostTask.js'; +import { ExtHostDebugService } from './extHostDebugService.js'; +import { NativeExtHostSearch } from './extHostSearch.js'; +import { ExtHostExtensionService } from './extHostExtensionService.js'; +import { NodeExtHostTunnelService } from './extHostTunnelService.js'; +import { IExtHostDebugService } from '../common/extHostDebugService.js'; +import { IExtHostExtensionService } from '../common/extHostExtensionService.js'; +import { IExtHostSearch } from '../common/extHostSearch.js'; +import { IExtHostTask } from '../common/extHostTask.js'; +import { IExtHostTerminalService } from '../common/extHostTerminalService.js'; +import { IExtHostTunnelService } from '../common/extHostTunnelService.js'; +import { IExtensionStoragePaths } from '../common/extHostStoragePaths.js'; +import { ExtensionStoragePaths } from './extHostStoragePaths.js'; +import { ExtHostLoggerService } from './extHostLoggerService.js'; +import { ILogService, ILoggerService } from '../../../platform/log/common/log.js'; +import { NodeExtHostVariableResolverProviderService } from './extHostVariableResolverService.js'; +import { IExtHostVariableResolverProvider } from '../common/extHostVariableResolverService.js'; +import { ExtHostLogService } from '../common/extHostLogService.js'; +import { SyncDescriptor } from '../../../platform/instantiation/common/descriptors.js'; +import { ISignService } from '../../../platform/sign/common/sign.js'; +import { SignService } from '../../../platform/sign/node/signService.js'; // ######################################################################### // ### ### diff --git a/src/vs/workbench/api/node/extHostCLIServer.ts b/src/vs/workbench/api/node/extHostCLIServer.ts index d9bb87accf8..e6261fb0b0c 100644 --- a/src/vs/workbench/api/node/extHostCLIServer.ts +++ b/src/vs/workbench/api/node/extHostCLIServer.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createRandomIPCHandle } from 'vs/base/parts/ipc/node/ipc.net'; +import { createRandomIPCHandle } from '../../../base/parts/ipc/node/ipc.net.js'; import * as http from 'http'; import * as fs from 'fs'; -import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { IWindowOpenable, IOpenWindowOptions } from 'vs/platform/window/common/window'; -import { URI } from 'vs/base/common/uri'; -import { ILogService } from 'vs/platform/log/common/log'; -import { hasWorkspaceFileExtension } from 'vs/platform/workspace/common/workspace'; +import { IExtHostCommands } from '../common/extHostCommands.js'; +import { IWindowOpenable, IOpenWindowOptions } from '../../../platform/window/common/window.js'; +import { URI } from '../../../base/common/uri.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { hasWorkspaceFileExtension } from '../../../platform/workspace/common/workspace.js'; export interface OpenCommandPipeArgs { type: 'open'; diff --git a/src/vs/workbench/api/node/extHostConsoleForwarder.ts b/src/vs/workbench/api/node/extHostConsoleForwarder.ts index 9069b9d041d..aa2dbca286c 100644 --- a/src/vs/workbench/api/node/extHostConsoleForwarder.ts +++ b/src/vs/workbench/api/node/extHostConsoleForwarder.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AbstractExtHostConsoleForwarder } from 'vs/workbench/api/common/extHostConsoleForwarder'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { NativeLogMarkers } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; +import { AbstractExtHostConsoleForwarder } from '../common/extHostConsoleForwarder.js'; +import { IExtHostInitDataService } from '../common/extHostInitDataService.js'; +import { IExtHostRpcService } from '../common/extHostRpcService.js'; +import { NativeLogMarkers } from '../../services/extensions/common/extensionHostProtocol.js'; const MAX_STREAM_BUFFER_LENGTH = 1024 * 1024; diff --git a/src/vs/workbench/api/node/extHostDebugService.ts b/src/vs/workbench/api/node/extHostDebugService.ts index dc48354e372..33e1b4d34ac 100644 --- a/src/vs/workbench/api/node/extHostDebugService.ts +++ b/src/vs/workbench/api/node/extHostDebugService.ts @@ -3,31 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createCancelablePromise, firstParallel, timeout } from 'vs/base/common/async'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import * as platform from 'vs/base/common/platform'; -import * as nls from 'vs/nls'; -import { IExternalTerminalService } from 'vs/platform/externalTerminal/common/externalTerminal'; -import { LinuxExternalTerminalService, MacExternalTerminalService, WindowsExternalTerminalService } from 'vs/platform/externalTerminal/node/externalTerminalService'; -import { ISignService } from 'vs/platform/sign/common/sign'; -import { SignService } from 'vs/platform/sign/node/signService'; -import { ExtHostDebugServiceBase, ExtHostDebugSession } from 'vs/workbench/api/common/extHostDebugService'; -import { IExtHostEditorTabs } from 'vs/workbench/api/common/extHostEditorTabs'; -import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; -import { DebugAdapterExecutable, ThemeIcon } from 'vs/workbench/api/common/extHostTypes'; -import { IExtHostVariableResolverProvider } from 'vs/workbench/api/common/extHostVariableResolverService'; -import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstractDebugAdapter'; -import { IAdapterDescriptor } from 'vs/workbench/contrib/debug/common/debug'; -import { ExecutableDebugAdapter, NamedPipeDebugAdapter, SocketDebugAdapter } from 'vs/workbench/contrib/debug/node/debugAdapter'; -import { hasChildProcesses, prepareCommand } from 'vs/workbench/contrib/debug/node/terminals'; -import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/common/extensionDescriptionRegistry'; import type * as vscode from 'vscode'; -import { ExtHostConfigProvider, IExtHostConfiguration } from '../common/extHostConfiguration'; -import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { IExtHostTesting } from 'vs/workbench/api/common/extHostTesting'; +import { createCancelablePromise, firstParallel, timeout } from '../../../base/common/async.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import * as platform from '../../../base/common/platform.js'; +import * as nls from '../../../nls.js'; +import { IExternalTerminalService } from '../../../platform/externalTerminal/common/externalTerminal.js'; +import { LinuxExternalTerminalService, MacExternalTerminalService, WindowsExternalTerminalService } from '../../../platform/externalTerminal/node/externalTerminalService.js'; +import { ISignService } from '../../../platform/sign/common/sign.js'; +import { SignService } from '../../../platform/sign/node/signService.js'; +import { AbstractDebugAdapter } from '../../contrib/debug/common/abstractDebugAdapter.js'; +import { ExecutableDebugAdapter, NamedPipeDebugAdapter, SocketDebugAdapter } from '../../contrib/debug/node/debugAdapter.js'; +import { hasChildProcesses, prepareCommand } from '../../contrib/debug/node/terminals.js'; +import { ExtensionDescriptionRegistry } from '../../services/extensions/common/extensionDescriptionRegistry.js'; +import { IExtHostCommands } from '../common/extHostCommands.js'; +import { ExtHostConfigProvider, IExtHostConfiguration } from '../common/extHostConfiguration.js'; +import { ExtHostDebugServiceBase, ExtHostDebugSession } from '../common/extHostDebugService.js'; +import { IExtHostEditorTabs } from '../common/extHostEditorTabs.js'; +import { IExtHostExtensionService } from '../common/extHostExtensionService.js'; +import { IExtHostRpcService } from '../common/extHostRpcService.js'; +import { IExtHostTerminalService } from '../common/extHostTerminalService.js'; +import { IExtHostTesting } from '../common/extHostTesting.js'; +import { DebugAdapterExecutable, DebugAdapterNamedPipeServer, DebugAdapterServer, ThemeIcon } from '../common/extHostTypes.js'; +import { IExtHostVariableResolverProvider } from '../common/extHostVariableResolverService.js'; +import { IExtHostWorkspace } from '../common/extHostWorkspace.js'; export class ExtHostDebugService extends ExtHostDebugServiceBase { @@ -50,16 +49,16 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase { super(extHostRpcService, workspaceService, extensionService, configurationService, editorTabs, variableResolver, commands, testing); } - protected override createDebugAdapter(adapter: IAdapterDescriptor, session: ExtHostDebugSession): AbstractDebugAdapter | undefined { - switch (adapter.type) { - case 'server': - return new SocketDebugAdapter(adapter); - case 'pipeServer': - return new NamedPipeDebugAdapter(adapter); - case 'executable': - return new ExecutableDebugAdapter(adapter, session.type); + protected override createDebugAdapter(adapter: vscode.DebugAdapterDescriptor, session: ExtHostDebugSession): AbstractDebugAdapter | undefined { + if (adapter instanceof DebugAdapterExecutable) { + return new ExecutableDebugAdapter(this.convertExecutableToDto(adapter), session.type); + } else if (adapter instanceof DebugAdapterServer) { + return new SocketDebugAdapter(this.convertServerToDto(adapter)); + } else if (adapter instanceof DebugAdapterNamedPipeServer) { + return new NamedPipeDebugAdapter(this.convertPipeServerToDto(adapter)); + } else { + return super.createDebugAdapter(adapter, session); } - return super.createDebugAdapter(adapter, session); } protected override daExecutableFromPackage(session: ExtHostDebugSession, extensionRegistry: ExtensionDescriptionRegistry): DebugAdapterExecutable | undefined { diff --git a/src/vs/workbench/api/node/extHostDiskFileSystemProvider.ts b/src/vs/workbench/api/node/extHostDiskFileSystemProvider.ts index c4a5e1d2b05..2be6ba4652f 100644 --- a/src/vs/workbench/api/node/extHostDiskFileSystemProvider.ts +++ b/src/vs/workbench/api/node/extHostDiskFileSystemProvider.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import type * as vscode from 'vscode'; -import { IExtHostConsumerFileSystem } from 'vs/workbench/api/common/extHostFileSystemConsumer'; -import { Schemas } from 'vs/base/common/network'; -import { ILogService } from 'vs/platform/log/common/log'; -import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider'; -import { FilePermission } from 'vs/platform/files/common/files'; -import { isLinux } from 'vs/base/common/platform'; +import { IExtHostConsumerFileSystem } from '../common/extHostFileSystemConsumer.js'; +import { Schemas } from '../../../base/common/network.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { DiskFileSystemProvider } from '../../../platform/files/node/diskFileSystemProvider.js'; +import { FilePermission } from '../../../platform/files/common/files.js'; +import { isLinux } from '../../../base/common/platform.js'; export class ExtHostDiskFileSystemProvider { diff --git a/src/vs/workbench/api/node/extHostDownloadService.ts b/src/vs/workbench/api/node/extHostDownloadService.ts index 9d81fe712ed..671dc268b51 100644 --- a/src/vs/workbench/api/node/extHostDownloadService.ts +++ b/src/vs/workbench/api/node/extHostDownloadService.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { join } from 'vs/base/common/path'; +import { join } from '../../../base/common/path.js'; import { tmpdir } from 'os'; -import { generateUuid } from 'vs/base/common/uuid'; -import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { MainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { URI } from 'vs/base/common/uri'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IExtHostCommands } from '../common/extHostCommands.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { MainContext } from '../common/extHost.protocol.js'; +import { URI } from '../../../base/common/uri.js'; +import { IExtHostRpcService } from '../common/extHostRpcService.js'; export class ExtHostDownloadService extends Disposable { diff --git a/src/vs/workbench/api/node/extHostExtensionService.ts b/src/vs/workbench/api/node/extHostExtensionService.ts index 5ac0ddc7ec9..c1e72f63784 100644 --- a/src/vs/workbench/api/node/extHostExtensionService.ts +++ b/src/vs/workbench/api/node/extHostExtensionService.ts @@ -3,27 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as performance from 'vs/base/common/performance'; -import { createApiFactoryAndRegisterActors } from 'vs/workbench/api/common/extHost.api.impl'; -import { RequireInterceptor } from 'vs/workbench/api/common/extHostRequireInterceptor'; -import { ExtensionActivationTimesBuilder } from 'vs/workbench/api/common/extHostExtensionActivator'; -import { connectProxyResolver } from 'vs/workbench/api/node/proxyResolver'; -import { AbstractExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; -import { ExtHostDownloadService } from 'vs/workbench/api/node/extHostDownloadService'; -import { URI } from 'vs/base/common/uri'; -import { Schemas } from 'vs/base/common/network'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtensionRuntime } from 'vs/workbench/api/common/extHostTypes'; -import { CLIServer } from 'vs/workbench/api/node/extHostCLIServer'; -import { realpathSync } from 'vs/base/node/extpath'; -import { ExtHostConsoleForwarder } from 'vs/workbench/api/node/extHostConsoleForwarder'; -import { ExtHostDiskFileSystemProvider } from 'vs/workbench/api/node/extHostDiskFileSystemProvider'; +import * as performance from '../../../base/common/performance.js'; +import { createApiFactoryAndRegisterActors } from '../common/extHost.api.impl.js'; +import { RequireInterceptor } from '../common/extHostRequireInterceptor.js'; +import { ExtensionActivationTimesBuilder } from '../common/extHostExtensionActivator.js'; +import { connectProxyResolver } from './proxyResolver.js'; +import { AbstractExtHostExtensionService } from '../common/extHostExtensionService.js'; +import { ExtHostDownloadService } from './extHostDownloadService.js'; +import { URI } from '../../../base/common/uri.js'; +import { Schemas } from '../../../base/common/network.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtensionRuntime } from '../common/extHostTypes.js'; +import { CLIServer } from './extHostCLIServer.js'; +import { realpathSync } from '../../../base/node/extpath.js'; +import { ExtHostConsoleForwarder } from './extHostConsoleForwarder.js'; +import { ExtHostDiskFileSystemProvider } from './extHostDiskFileSystemProvider.js'; +// ESM-uncomment-begin +import { createRequire } from 'node:module'; +const require = createRequire(import.meta.url); +// ESM-uncomment-end class NodeModuleRequireInterceptor extends RequireInterceptor { protected _installInterceptor(): void { const that = this; - const node_module = globalThis._VSCODE_NODE_MODULES.module; + const node_module = require('module'); const originalLoad = node_module._load; node_module._load = function load(request: string, parent: { filename: string }, isMain: boolean) { request = applyAlternatives(request); @@ -42,6 +46,20 @@ 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) { + // ESM: ever since we moved to ESM, `require.main` will be `undefined` for extensions + // Some extensions have been using `require.resolve('vsda', { paths: require.main.paths })` + // to find the `vsda` module in our app root. To be backwards compatible with this pattern, + // we help by filling in the `paths` array with the node modules paths of the current module. + options.paths = node_module._nodeModulePaths(import.meta.dirname); + } + return originalResolveFilename.call(this, request, parent, isMain, options); + }; + // ESM-uncomment-end + const applyAlternatives = (request: string) => { for (const alternativeModuleName of that._alternatives) { const alternative = alternativeModuleName(request); @@ -109,7 +127,7 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService { if (extensionId) { performance.mark(`code/extHost/willLoadExtensionCode/${extensionId}`); } - r = require.__$__nodeRequire(module.fsPath); + r = (require.__$__nodeRequire ?? require /* TODO@esm drop the first */)(module.fsPath); } finally { if (extensionId) { performance.mark(`code/extHost/didLoadExtensionCode/${extensionId}`); diff --git a/src/vs/workbench/api/node/extHostLoggerService.ts b/src/vs/workbench/api/node/extHostLoggerService.ts index 37bd422fbbe..8d7d79c9867 100644 --- a/src/vs/workbench/api/node/extHostLoggerService.ts +++ b/src/vs/workbench/api/node/extHostLoggerService.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ILogger, ILoggerOptions, ILoggerResource, LogLevel } from 'vs/platform/log/common/log'; -import { URI } from 'vs/base/common/uri'; -import { ExtHostLoggerService as BaseExtHostLoggerService } from 'vs/workbench/api/common/extHostLoggerService'; -import { Schemas } from 'vs/base/common/network'; -import { SpdLogLogger } from 'vs/platform/log/node/spdlogLog'; -import { generateUuid } from 'vs/base/common/uuid'; +import { ILogger, ILoggerOptions, ILoggerResource, LogLevel } from '../../../platform/log/common/log.js'; +import { URI } from '../../../base/common/uri.js'; +import { ExtHostLoggerService as BaseExtHostLoggerService } from '../common/extHostLoggerService.js'; +import { Schemas } from '../../../base/common/network.js'; +import { SpdLogLogger } from '../../../platform/log/node/spdlogLog.js'; +import { generateUuid } from '../../../base/common/uuid.js'; export class ExtHostLoggerService extends BaseExtHostLoggerService { diff --git a/src/vs/workbench/api/node/extHostSearch.ts b/src/vs/workbench/api/node/extHostSearch.ts index d10dbbb7d99..c91dd904607 100644 --- a/src/vs/workbench/api/node/extHostSearch.ts +++ b/src/vs/workbench/api/node/extHostSearch.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import * as pfs from 'vs/base/node/pfs'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ExtHostSearch, reviveQuery } from 'vs/workbench/api/common/extHostSearch'; -import { IURITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; -import { IFileQuery, IRawFileQuery, ISearchCompleteStats, ISerializedSearchProgressItem, isSerializedFileMatch, ITextQuery } from 'vs/workbench/services/search/common/search'; -import { TextSearchManager } from 'vs/workbench/services/search/common/textSearchManager'; -import { SearchService } from 'vs/workbench/services/search/node/rawSearchService'; -import { RipgrepSearchProvider } from 'vs/workbench/services/search/node/ripgrepSearchProvider'; -import { OutputChannel } from 'vs/workbench/services/search/node/ripgrepSearchUtils'; -import { NativeTextSearchManager } from 'vs/workbench/services/search/node/textSearchManager'; +import { DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; +import * as pfs from '../../../base/node/pfs.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IExtHostConfiguration } from '../common/extHostConfiguration.js'; +import { IExtHostInitDataService } from '../common/extHostInitDataService.js'; +import { IExtHostRpcService } from '../common/extHostRpcService.js'; +import { ExtHostSearch, reviveQuery } from '../common/extHostSearch.js'; +import { IURITransformerService } from '../common/extHostUriTransformerService.js'; +import { IFileQuery, IRawFileQuery, ISearchCompleteStats, ISerializedSearchProgressItem, isSerializedFileMatch, ITextQuery } from '../../services/search/common/search.js'; +import { TextSearchManager } from '../../services/search/common/textSearchManager.js'; +import { SearchService } from '../../services/search/node/rawSearchService.js'; +import { RipgrepSearchProvider } from '../../services/search/node/ripgrepSearchProvider.js'; +import { OutputChannel } from '../../services/search/node/ripgrepSearchUtils.js'; +import { NativeTextSearchManager } from '../../services/search/node/textSearchManager.js'; import type * as vscode from 'vscode'; export class NativeExtHostSearch extends ExtHostSearch implements IDisposable { @@ -161,7 +161,7 @@ export class NativeExtHostSearch extends ExtHostSearch implements IDisposable { return super.$clearCache(cacheKey); } - protected override createTextSearchManager(query: ITextQuery, provider: vscode.TextSearchProvider): TextSearchManager { + protected override createTextSearchManager(query: ITextQuery, provider: vscode.TextSearchProviderNew): TextSearchManager { return new NativeTextSearchManager(query, provider, undefined, 'textSearchProvider'); } } diff --git a/src/vs/workbench/api/node/extHostStoragePaths.ts b/src/vs/workbench/api/node/extHostStoragePaths.ts index 8348d9490b2..4ec23a27e5a 100644 --- a/src/vs/workbench/api/node/extHostStoragePaths.ts +++ b/src/vs/workbench/api/node/extHostStoragePaths.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import * as fs from 'fs'; -import * as path from 'vs/base/common/path'; -import { URI } from 'vs/base/common/uri'; -import { ExtensionStoragePaths as CommonExtensionStoragePaths } from 'vs/workbench/api/common/extHostStoragePaths'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { IntervalTimer, timeout } from 'vs/base/common/async'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Promises } from 'vs/base/node/pfs'; +import * as path from '../../../base/common/path.js'; +import { URI } from '../../../base/common/uri.js'; +import { ExtensionStoragePaths as CommonExtensionStoragePaths } from '../common/extHostStoragePaths.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import { IntervalTimer, timeout } from '../../../base/common/async.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { Promises } from '../../../base/node/pfs.js'; export class ExtensionStoragePaths extends CommonExtensionStoragePaths { @@ -69,14 +69,14 @@ export class ExtensionStoragePaths extends CommonExtensionStoragePaths { async function mkdir(dir: string): Promise { try { - await Promises.stat(dir); + await fs.promises.stat(dir); return; } catch { // doesn't exist, that's OK } try { - await Promises.mkdir(dir, { recursive: true }); + await fs.promises.mkdir(dir, { recursive: true }); } catch { } } @@ -103,7 +103,7 @@ class Lock extends Disposable { this._timer.cancel(); } try { - await Promises.utimes(filename, new Date(), new Date()); + await fs.promises.utimes(filename, new Date(), new Date()); } catch (err) { logService.error(err); logService.info(`Lock '${filename}': Could not update mtime.`); @@ -174,7 +174,7 @@ interface ILockfileContents { async function readLockfileContents(logService: ILogService, filename: string): Promise { let contents: Buffer; try { - contents = await Promises.readFile(filename); + contents = await fs.promises.readFile(filename); } catch (err) { // cannot read the file logService.error(err); @@ -196,7 +196,7 @@ async function readLockfileContents(logService: ILogService, filename: string): async function readmtime(logService: ILogService, filename: string): Promise { let stats: fs.Stats; try { - stats = await Promises.stat(filename); + stats = await fs.promises.stat(filename); } catch (err) { // cannot read the file stats to check if it is stale or not logService.error(err); @@ -279,7 +279,7 @@ async function checkStaleAndTryAcquireLock(logService: ILogService, filename: st async function tryDeleteAndAcquireLock(logService: ILogService, filename: string): Promise { logService.info(`Lock '${filename}': Deleting a stale lock.`); try { - await Promises.unlink(filename); + await fs.promises.unlink(filename); } catch (err) { // cannot delete the file // maybe the file is already deleted diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index b5fac17cde7..1e1f0637a26 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -3,28 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as path from 'vs/base/common/path'; +import * as path from '../../../base/common/path.js'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { win32 } from 'vs/base/node/processes'; -import * as types from 'vs/workbench/api/common/extHostTypes'; -import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { win32 } from '../../../base/node/processes.js'; +import * as types from '../common/extHostTypes.js'; +import { IExtHostWorkspace } from '../common/extHostWorkspace.js'; import type * as vscode from 'vscode'; -import * as tasks from '../common/shared/tasks'; -import { IExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { IExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration'; -import { IWorkspaceFolder, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { ExtHostTaskBase, TaskHandleDTO, TaskDTO, CustomExecutionDTO, HandlerData } from 'vs/workbench/api/common/extHostTask'; -import { Schemas } from 'vs/base/common/network'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IExtHostApiDeprecationService } from 'vs/workbench/api/common/extHostApiDeprecationService'; -import * as resources from 'vs/base/common/resources'; +import * as tasks from '../common/shared/tasks.js'; +import { IExtHostDocumentsAndEditors } from '../common/extHostDocumentsAndEditors.js'; +import { IExtHostConfiguration } from '../common/extHostConfiguration.js'; +import { IWorkspaceFolder, WorkspaceFolder } from '../../../platform/workspace/common/workspace.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { IExtHostTerminalService } from '../common/extHostTerminalService.js'; +import { IExtHostRpcService } from '../common/extHostRpcService.js'; +import { IExtHostInitDataService } from '../common/extHostInitDataService.js'; +import { ExtHostTaskBase, TaskHandleDTO, TaskDTO, CustomExecutionDTO, HandlerData } from '../common/extHostTask.js'; +import { Schemas } from '../../../base/common/network.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IExtHostApiDeprecationService } from '../common/extHostApiDeprecationService.js'; +import * as resources from '../../../base/common/resources.js'; import { homedir } from 'os'; -import { IExtHostVariableResolverProvider } from 'vs/workbench/api/common/extHostVariableResolverService'; +import { IExtHostVariableResolverProvider } from '../common/extHostVariableResolverService.js'; export class ExtHostTask extends ExtHostTaskBase { constructor( diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index fd5ec81368c..299f6d6d447 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { generateUuid } from 'vs/base/common/uuid'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { BaseExtHostTerminalService, ExtHostTerminal, ITerminalInternalOptions } from 'vs/workbench/api/common/extHostTerminalService'; +import { generateUuid } from '../../../base/common/uuid.js'; +import { IExtHostRpcService } from '../common/extHostRpcService.js'; +import { BaseExtHostTerminalService, ExtHostTerminal, ITerminalInternalOptions } from '../common/extHostTerminalService.js'; import type * as vscode from 'vscode'; -import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; +import { IExtHostCommands } from '../common/extHostCommands.js'; export class ExtHostTerminalService extends BaseExtHostTerminalService { diff --git a/src/vs/workbench/api/node/extHostTunnelService.ts b/src/vs/workbench/api/node/extHostTunnelService.ts index 13498806104..5e0e5cafa32 100644 --- a/src/vs/workbench/api/node/extHostTunnelService.ts +++ b/src/vs/workbench/api/node/extHostTunnelService.ts @@ -3,26 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'fs'; import { exec } from 'child_process'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Emitter } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { MovingAverage } from 'vs/base/common/numbers'; -import { isLinux } from 'vs/base/common/platform'; -import * as resources from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import * as pfs from 'vs/base/node/pfs'; -import { ISocket, SocketCloseEventType } from 'vs/base/parts/ipc/common/ipc.net'; -import { ILogService } from 'vs/platform/log/common/log'; -import { ManagedSocket, RemoteSocketHalf, connectManagedSocket } from 'vs/platform/remote/common/managedSocket'; -import { ManagedRemoteConnection } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { ISignService } from 'vs/platform/sign/common/sign'; -import { isAllInterfaces, isLocalhost } from 'vs/platform/tunnel/common/tunnel'; -import { NodeRemoteTunnel } from 'vs/platform/tunnel/node/tunnelService'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ExtHostTunnelService } from 'vs/workbench/api/common/extHostTunnelService'; -import { CandidatePort, parseAddress } from 'vs/workbench/services/remote/common/tunnelModel'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Emitter } from '../../../base/common/event.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { MovingAverage } from '../../../base/common/numbers.js'; +import { isLinux } from '../../../base/common/platform.js'; +import * as resources from '../../../base/common/resources.js'; +import { URI } from '../../../base/common/uri.js'; +import * as pfs from '../../../base/node/pfs.js'; +import { ISocket, SocketCloseEventType } from '../../../base/parts/ipc/common/ipc.net.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { ManagedSocket, RemoteSocketHalf, connectManagedSocket } from '../../../platform/remote/common/managedSocket.js'; +import { ManagedRemoteConnection } from '../../../platform/remote/common/remoteAuthorityResolver.js'; +import { ISignService } from '../../../platform/sign/common/sign.js'; +import { isAllInterfaces, isLocalhost } from '../../../platform/tunnel/common/tunnel.js'; +import { NodeRemoteTunnel } from '../../../platform/tunnel/node/tunnelService.js'; +import { IExtHostInitDataService } from '../common/extHostInitDataService.js'; +import { IExtHostRpcService } from '../common/extHostRpcService.js'; +import { ExtHostTunnelService } from '../common/extHostTunnelService.js'; +import { CandidatePort, parseAddress } from '../../services/remote/common/tunnelModel.js'; import * as vscode from 'vscode'; export function getSockets(stdout: string): Record { @@ -243,8 +244,8 @@ export class NodeExtHostTunnelService extends ExtHostTunnelService { let tcp: string = ''; let tcp6: string = ''; try { - tcp = await pfs.Promises.readFile('/proc/net/tcp', 'utf8'); - tcp6 = await pfs.Promises.readFile('/proc/net/tcp6', 'utf8'); + tcp = await fs.promises.readFile('/proc/net/tcp', 'utf8'); + tcp6 = await fs.promises.readFile('/proc/net/tcp6', 'utf8'); } catch (e) { // File reading error. No additional handling needed. } @@ -265,10 +266,10 @@ export class NodeExtHostTunnelService extends ExtHostTunnelService { try { const pid: number = Number(childName); const childUri = resources.joinPath(URI.file('/proc'), childName); - const childStat = await pfs.Promises.stat(childUri.fsPath); + const childStat = await fs.promises.stat(childUri.fsPath); if (childStat.isDirectory() && !isNaN(pid)) { - const cwd = await pfs.Promises.readlink(resources.joinPath(childUri, 'cwd').fsPath); - const cmd = await pfs.Promises.readFile(resources.joinPath(childUri, 'cmdline').fsPath, 'utf8'); + const cwd = await fs.promises.readlink(resources.joinPath(childUri, 'cwd').fsPath); + const cmd = await fs.promises.readFile(resources.joinPath(childUri, 'cmdline').fsPath, 'utf8'); processes.push({ pid, cwd, cmd }); } } catch (e) { diff --git a/src/vs/workbench/api/node/extHostVariableResolverService.ts b/src/vs/workbench/api/node/extHostVariableResolverService.ts index c6439fd4e03..e506a58ef40 100644 --- a/src/vs/workbench/api/node/extHostVariableResolverService.ts +++ b/src/vs/workbench/api/node/extHostVariableResolverService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { homedir } from 'os'; -import { ExtHostVariableResolverProviderService } from 'vs/workbench/api/common/extHostVariableResolverService'; +import { ExtHostVariableResolverProviderService } from '../common/extHostVariableResolverService.js'; export class NodeExtHostVariableResolverProviderService extends ExtHostVariableResolverProviderService { protected override homeDir(): string | undefined { diff --git a/src/vs/workbench/api/node/extensionHostProcess.ts b/src/vs/workbench/api/node/extensionHostProcess.ts index 80a60c1d4c1..694559385c4 100644 --- a/src/vs/workbench/api/node/extensionHostProcess.ts +++ b/src/vs/workbench/api/node/extensionHostProcess.ts @@ -6,29 +6,32 @@ import minimist from 'minimist'; import * as nativeWatchdog from 'native-watchdog'; import * as net from 'net'; -import { ProcessTimeRunOnceScheduler } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { isCancellationError, isSigPipeError, onUnexpectedError } from 'vs/base/common/errors'; -import { Event } from 'vs/base/common/event'; -import * as performance from 'vs/base/common/performance'; -import { IURITransformer } from 'vs/base/common/uriIpc'; -import { realpath } from 'vs/base/node/extpath'; -import { Promises } from 'vs/base/node/pfs'; -import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc'; -import { BufferedEmitter, PersistentProtocol, ProtocolConstants } from 'vs/base/parts/ipc/common/ipc.net'; -import { NodeSocket, WebSocketNodeSocket } from 'vs/base/parts/ipc/node/ipc.net'; -import type { MessagePortMain } from 'vs/base/parts/sandbox/node/electronTypes'; -import { boolean } from 'vs/editor/common/config/editorOptions'; -import product from 'vs/platform/product/common/product'; -import { ExtensionHostMain, IExitFn } from 'vs/workbench/api/common/extensionHostMain'; -import { IHostUtils } from 'vs/workbench/api/common/extHostExtensionService'; -import { createURITransformer } from 'vs/workbench/api/node/uriTransformer'; -import { ExtHostConnectionType, readExtHostConnection } from 'vs/workbench/services/extensions/common/extensionHostEnv'; -import { ExtensionHostExitCode, IExtHostReadyMessage, IExtHostReduceGraceTimeMessage, IExtHostSocketMessage, IExtensionHostInitData, MessageType, createMessageOfType, isMessageOfType } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; - -import { IDisposable } from 'vs/base/common/lifecycle'; -import 'vs/workbench/api/common/extHost.common.services'; -import 'vs/workbench/api/node/extHost.node.services'; +import { ProcessTimeRunOnceScheduler } from '../../../base/common/async.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { isCancellationError, isSigPipeError, onUnexpectedError } from '../../../base/common/errors.js'; +import { Event } from '../../../base/common/event.js'; +import * as performance from '../../../base/common/performance.js'; +import { IURITransformer } from '../../../base/common/uriIpc.js'; +import { realpath } from '../../../base/node/extpath.js'; +import { Promises } from '../../../base/node/pfs.js'; +import { IMessagePassingProtocol } from '../../../base/parts/ipc/common/ipc.js'; +import { BufferedEmitter, PersistentProtocol, ProtocolConstants } from '../../../base/parts/ipc/common/ipc.net.js'; +import { NodeSocket, WebSocketNodeSocket } from '../../../base/parts/ipc/node/ipc.net.js'; +import type { MessagePortMain } from '../../../base/parts/sandbox/node/electronTypes.js'; +import { boolean } from '../../../editor/common/config/editorOptions.js'; +import product from '../../../platform/product/common/product.js'; +import { ExtensionHostMain, IExitFn } from '../common/extensionHostMain.js'; +import { IHostUtils } from '../common/extHostExtensionService.js'; +import { createURITransformer } from './uriTransformer.js'; +import { ExtHostConnectionType, readExtHostConnection } from '../../services/extensions/common/extensionHostEnv.js'; +import { ExtensionHostExitCode, IExtHostReadyMessage, IExtHostReduceGraceTimeMessage, IExtHostSocketMessage, IExtensionHostInitData, MessageType, createMessageOfType, isMessageOfType } from '../../services/extensions/common/extensionHostProtocol.js'; +import { IDisposable } from '../../../base/common/lifecycle.js'; +import '../common/extHost.common.services.js'; +import './extHost.node.services.js'; +// ESM-uncomment-begin +import { createRequire } from 'node:module'; +const require = createRequire(import.meta.url); +// ESM-uncomment-end interface ParsedExtHostArgs { transformURIs?: boolean; @@ -63,7 +66,7 @@ const args = minimist(process.argv.slice(2), { // 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) { @@ -327,7 +330,7 @@ function connectToRenderer(protocol: IMessagePassingProtocol): Promise extHostWorkspace.resolveProxy(url), - lookupProxyAuthorization: lookupProxyAuthorization.bind(undefined, extHostLogService, mainThreadTelemetry, configProvider, {}, initData.remote.isRemote), + lookupProxyAuthorization: lookupProxyAuthorization.bind(undefined, extHostWorkspace, extHostLogService, mainThreadTelemetry, configProvider, {}, {}, initData.remote.isRemote, doUseHostProxy), getProxyURL: () => configProvider.getConfiguration('http').get('proxy'), getProxySupport: () => configProvider.getConfiguration('http').get('proxySupport') || 'off', + getNoProxyConfig: () => configProvider.getConfiguration('http').get('noProxy') || [], addCertificatesV1: () => certSettingV1(configProvider), addCertificatesV2: () => certSettingV2(configProvider), log: extHostLogService, @@ -109,7 +122,7 @@ const modulesCache = new Map): Promise { return extensionService.getExtensionPathIndex() .then(extensionPaths => { - const node_module = globalThis._VSCODE_NODE_MODULES.module; + const node_module = require('module'); const original = node_module._load; node_module._load = function load(request: string, parent: { filename: string }, isMain: boolean) { if (request === 'net') { @@ -139,14 +152,17 @@ function configureModuleLoading(extensionService: ExtHostExtensionService, looku } async function lookupProxyAuthorization( + extHostWorkspace: IExtHostWorkspaceProvider, extHostLogService: ILogService, mainThreadTelemetry: MainThreadTelemetryShape, configProvider: ExtHostConfigProvider, proxyAuthenticateCache: Record, + basicAuthCache: Record, isRemote: boolean, + useHostProxy: boolean, proxyURL: string, proxyAuthenticate: string | string[] | undefined, - state: { kerberosRequested?: boolean } + state: { kerberosRequested?: boolean; basicAuthCacheUsed?: boolean; basicAuthAttempt?: number } ): Promise { const cached = proxyAuthenticateCache[proxyURL]; if (proxyAuthenticate) { @@ -157,8 +173,9 @@ async function lookupProxyAuthorization( const authenticate = Array.isArray(header) ? header : typeof header === 'string' ? [header] : []; sendTelemetry(mainThreadTelemetry, authenticate, isRemote); if (authenticate.some(a => /^(Negotiate|Kerberos)( |$)/i.test(a)) && !state.kerberosRequested) { + state.kerberosRequested = true; + try { - state.kerberosRequested = true; const kerberos = await import('kerberos'); const url = new URL(proxyURL); const spn = configProvider.getConfiguration('http').get('proxyKerberosServicePrincipal') @@ -168,7 +185,54 @@ async function lookupProxyAuthorization( const response = await client.step(''); return 'Negotiate ' + response; } catch (err) { - extHostLogService.error('ProxyResolver#lookupProxyAuthorization Kerberos authentication failed', err); + extHostLogService.debug('ProxyResolver#lookupProxyAuthorization Kerberos authentication failed', err); + } + + if (isRemote && useHostProxy) { + extHostLogService.debug('ProxyResolver#lookupProxyAuthorization Kerberos authentication lookup on host', `proxyURL:${proxyURL}`); + const auth = await extHostWorkspace.lookupKerberosAuthorization(proxyURL); + if (auth) { + return 'Negotiate ' + auth; + } + } + } + const basicAuthHeader = authenticate.find(a => /^Basic( |$)/i.test(a)); + if (basicAuthHeader) { + try { + const cachedAuth = basicAuthCache[proxyURL]; + if (cachedAuth) { + if (state.basicAuthCacheUsed) { + extHostLogService.debug('ProxyResolver#lookupProxyAuthorization Basic authentication deleting cached credentials', `proxyURL:${proxyURL}`); + delete basicAuthCache[proxyURL]; + } else { + extHostLogService.debug('ProxyResolver#lookupProxyAuthorization Basic authentication using cached credentials', `proxyURL:${proxyURL}`); + state.basicAuthCacheUsed = true; + return cachedAuth; + } + } + state.basicAuthAttempt = (state.basicAuthAttempt || 0) + 1; + const realm = / realm="([^"]+)"/i.exec(basicAuthHeader)?.[1]; + extHostLogService.debug('ProxyResolver#lookupProxyAuthorization Basic authentication lookup', `proxyURL:${proxyURL}`, `realm:${realm}`); + const url = new URL(proxyURL); + const authInfo: AuthInfo = { + scheme: 'basic', + host: url.hostname, + port: Number(url.port), + realm: realm || '', + isProxy: true, + attempt: state.basicAuthAttempt, + }; + const credentials = await extHostWorkspace.lookupAuthorization(authInfo); + if (credentials) { + extHostLogService.debug('ProxyResolver#lookupProxyAuthorization Basic authentication received credentials', `proxyURL:${proxyURL}`, `realm:${realm}`); + const auth = 'Basic ' + Buffer.from(`${credentials.username}:${credentials.password}`).toString('base64'); + basicAuthCache[proxyURL] = auth; + return auth; + } else { + extHostLogService.debug('ProxyResolver#lookupProxyAuthorization Basic authentication received no credentials', `proxyURL:${proxyURL}`, `realm:${realm}`); + } + } catch (err) { + extHostLogService.error('ProxyResolver#lookupProxyAuthorization Basic authentication failed', err); } } return undefined; diff --git a/src/vs/workbench/api/node/uriTransformer.ts b/src/vs/workbench/api/node/uriTransformer.ts index c02ea46d00b..00bf30130df 100644 --- a/src/vs/workbench/api/node/uriTransformer.ts +++ b/src/vs/workbench/api/node/uriTransformer.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { UriParts, IRawURITransformer, URITransformer, IURITransformer } from 'vs/base/common/uriIpc'; +import { UriParts, IRawURITransformer, URITransformer, IURITransformer } from '../../../base/common/uriIpc.js'; /** * ``` diff --git a/src/vs/workbench/api/test/browser/extHost.api.impl.test.ts b/src/vs/workbench/api/test/browser/extHost.api.impl.test.ts index d5db3ca4683..28e325233b2 100644 --- a/src/vs/workbench/api/test/browser/extHost.api.impl.test.ts +++ b/src/vs/workbench/api/test/browser/extHost.api.impl.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { originalFSPath } from 'vs/base/common/resources'; -import { isWindows } from 'vs/base/common/platform'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { URI } from '../../../../base/common/uri.js'; +import { originalFSPath } from '../../../../base/common/resources.js'; +import { isWindows } from '../../../../base/common/platform.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ExtHost API', function () { test('issue #51387: originalFSPath', function () { diff --git a/src/vs/workbench/api/test/browser/extHostApiCommands.test.ts b/src/vs/workbench/api/test/browser/extHostApiCommands.test.ts index da5e8bb9e6f..2597ac759e5 100644 --- a/src/vs/workbench/api/test/browser/extHostApiCommands.test.ts +++ b/src/vs/workbench/api/test/browser/extHostApiCommands.test.ts @@ -3,68 +3,68 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/editor/contrib/codeAction/browser/codeAction'; -import 'vs/editor/contrib/codelens/browser/codelens'; -import 'vs/editor/contrib/colorPicker/browser/color'; -import 'vs/editor/contrib/format/browser/format'; -import 'vs/editor/contrib/gotoSymbol/browser/goToCommands'; -import 'vs/editor/contrib/documentSymbols/browser/documentSymbols'; -import 'vs/editor/contrib/hover/browser/getHover'; -import 'vs/editor/contrib/links/browser/getLinks'; -import 'vs/editor/contrib/parameterHints/browser/provideSignatureHelp'; -import 'vs/editor/contrib/smartSelect/browser/smartSelect'; -import 'vs/editor/contrib/suggest/browser/suggest'; -import 'vs/editor/contrib/rename/browser/rename'; -import 'vs/editor/contrib/inlayHints/browser/inlayHintsController'; +import '../../../../editor/contrib/codeAction/browser/codeAction.js'; +import '../../../../editor/contrib/codelens/browser/codelens.js'; +import '../../../../editor/contrib/colorPicker/browser/colorPickerContribution.js'; +import '../../../../editor/contrib/format/browser/format.js'; +import '../../../../editor/contrib/gotoSymbol/browser/goToCommands.js'; +import '../../../../editor/contrib/documentSymbols/browser/documentSymbols.js'; +import '../../../../editor/contrib/hover/browser/getHover.js'; +import '../../../../editor/contrib/links/browser/getLinks.js'; +import '../../../../editor/contrib/parameterHints/browser/provideSignatureHelp.js'; +import '../../../../editor/contrib/smartSelect/browser/smartSelect.js'; +import '../../../../editor/contrib/suggest/browser/suggest.js'; +import '../../../../editor/contrib/rename/browser/rename.js'; +import '../../../../editor/contrib/inlayHints/browser/inlayHintsController.js'; import assert from 'assert'; -import { setUnexpectedErrorHandler, errorHandler } from 'vs/base/common/errors'; -import { URI } from 'vs/base/common/uri'; -import { Event } from 'vs/base/common/event'; -import * as types from 'vs/workbench/api/common/extHostTypes'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { MarkerService } from 'vs/platform/markers/common/markerService'; -import { IMarkerService } from 'vs/platform/markers/common/markers'; -import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ExtHostLanguageFeatures } from 'vs/workbench/api/common/extHostLanguageFeatures'; -import { MainThreadLanguageFeatures } from 'vs/workbench/api/browser/mainThreadLanguageFeatures'; -import { ExtHostApiCommands } from 'vs/workbench/api/common/extHostApiCommands'; -import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { MainThreadCommands } from 'vs/workbench/api/browser/mainThreadCommands'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { MainContext, ExtHostContext } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostDiagnostics } from 'vs/workbench/api/common/extHostDiagnostics'; +import { setUnexpectedErrorHandler, errorHandler } from '../../../../base/common/errors.js'; +import { URI } from '../../../../base/common/uri.js'; +import { Event } from '../../../../base/common/event.js'; +import * as types from '../../common/extHostTypes.js'; +import { createTextModel } from '../../../../editor/test/common/testTextModel.js'; +import { TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { MarkerService } from '../../../../platform/markers/common/markerService.js'; +import { IMarkerService } from '../../../../platform/markers/common/markers.js'; +import { ICommandService, CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { IModelService } from '../../../../editor/common/services/model.js'; +import { ExtHostLanguageFeatures } from '../../common/extHostLanguageFeatures.js'; +import { MainThreadLanguageFeatures } from '../../browser/mainThreadLanguageFeatures.js'; +import { ExtHostApiCommands } from '../../common/extHostApiCommands.js'; +import { ExtHostCommands } from '../../common/extHostCommands.js'; +import { MainThreadCommands } from '../../browser/mainThreadCommands.js'; +import { ExtHostDocuments } from '../../common/extHostDocuments.js'; +import { ExtHostDocumentsAndEditors } from '../../common/extHostDocumentsAndEditors.js'; +import { MainContext, ExtHostContext } from '../../common/extHost.protocol.js'; +import { ExtHostDiagnostics } from '../../common/extHostDiagnostics.js'; import type * as vscode from 'vscode'; -import 'vs/workbench/contrib/search/browser/search.contribution'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { ITextModel } from 'vs/editor/common/model'; -import { nullExtensionDescription, IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { dispose, ImmortalReference } from 'vs/base/common/lifecycle'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { mock } from 'vs/base/test/common/mock'; -import { NullApiDeprecationService } from 'vs/workbench/api/common/extHostApiDeprecationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { IResolvedTextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService'; -import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { URITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; -import { IOutlineModelService, OutlineModelService } from 'vs/editor/contrib/documentSymbols/browser/outlineModel'; -import { ILanguageFeatureDebounceService, LanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { assertType } from 'vs/base/common/types'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { timeout } from 'vs/base/common/async'; +import '../../../contrib/search/browser/search.contribution.js'; +import { ILogService, NullLogService } from '../../../../platform/log/common/log.js'; +import { ITextModel } from '../../../../editor/common/model.js'; +import { nullExtensionDescription, IExtensionService } from '../../../services/extensions/common/extensions.js'; +import { dispose, ImmortalReference } from '../../../../base/common/lifecycle.js'; +import { IEditorWorkerService } from '../../../../editor/common/services/editorWorker.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { NullApiDeprecationService } from '../../common/extHostApiDeprecationService.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js'; +import { IResolvedTextEditorModel, ITextModelService } from '../../../../editor/common/services/resolverService.js'; +import { IExtHostFileSystemInfo } from '../../common/extHostFileSystemInfo.js'; +import { URITransformerService } from '../../common/extHostUriTransformerService.js'; +import { IOutlineModelService, OutlineModelService } from '../../../../editor/contrib/documentSymbols/browser/outlineModel.js'; +import { ILanguageFeatureDebounceService, LanguageFeatureDebounceService } from '../../../../editor/common/services/languageFeatureDebounce.js'; +import { ILanguageFeaturesService } from '../../../../editor/common/services/languageFeatures.js'; +import { LanguageFeaturesService } from '../../../../editor/common/services/languageFeaturesService.js'; +import { assertType } from '../../../../base/common/types.js'; +import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js'; +import { IExtHostTelemetry } from '../../common/extHostTelemetry.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { TestConfigurationService } from '../../../../platform/configuration/test/common/testConfigurationService.js'; +import { IEnvironmentService } from '../../../../platform/environment/common/environment.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { timeout } from '../../../../base/common/async.js'; function assertRejects(fn: () => Promise, message: string = 'Expected rejection') { return fn().then(() => assert.ok(false, message), _err => assert.ok(true)); diff --git a/src/vs/workbench/api/test/browser/extHostAuthentication.integrationTest.ts b/src/vs/workbench/api/test/browser/extHostAuthentication.integrationTest.ts index de02ffff745..0d7d21bf136 100644 --- a/src/vs/workbench/api/test/browser/extHostAuthentication.integrationTest.ts +++ b/src/vs/workbench/api/test/browser/extHostAuthentication.integrationTest.ts @@ -4,33 +4,33 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { TestDialogService } from 'vs/platform/dialogs/test/common/testDialogService'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; -import { IQuickInputHideEvent, IQuickInputService, IQuickPickDidAcceptEvent } from 'vs/platform/quickinput/common/quickInput'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { MainThreadAuthentication } from 'vs/workbench/api/browser/mainThreadAuthentication'; -import { ExtHostContext, MainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostAuthentication } from 'vs/workbench/api/common/extHostAuthentication'; -import { IActivityService } from 'vs/workbench/services/activity/common/activity'; -import { AuthenticationService } from 'vs/workbench/services/authentication/browser/authenticationService'; -import { IAuthenticationExtensionsService, IAuthenticationService } from 'vs/workbench/services/authentication/common/authentication'; -import { IExtensionService, nullExtensionDescription as extensionDescription } from 'vs/workbench/services/extensions/common/extensions'; -import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; -import { TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { TestEnvironmentService, TestQuickInputService, TestRemoteAgentService } from 'vs/workbench/test/browser/workbenchTestServices'; -import { TestActivityService, TestExtensionService, TestProductService, TestStorageService } from 'vs/workbench/test/common/workbenchTestServices'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js'; +import { TestDialogService } from '../../../../platform/dialogs/test/common/testDialogService.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { TestNotificationService } from '../../../../platform/notification/test/common/testNotificationService.js'; +import { IQuickInputHideEvent, IQuickInputService, IQuickPickDidAcceptEvent } from '../../../../platform/quickinput/common/quickInput.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { NullTelemetryService } from '../../../../platform/telemetry/common/telemetryUtils.js'; +import { MainThreadAuthentication } from '../../browser/mainThreadAuthentication.js'; +import { ExtHostContext, MainContext } from '../../common/extHost.protocol.js'; +import { ExtHostAuthentication } from '../../common/extHostAuthentication.js'; +import { IActivityService } from '../../../services/activity/common/activity.js'; +import { AuthenticationService } from '../../../services/authentication/browser/authenticationService.js'; +import { IAuthenticationExtensionsService, IAuthenticationService } from '../../../services/authentication/common/authentication.js'; +import { IExtensionService, nullExtensionDescription as extensionDescription } from '../../../services/extensions/common/extensions.js'; +import { IRemoteAgentService } from '../../../services/remote/common/remoteAgentService.js'; +import { TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { TestEnvironmentService, TestQuickInputService, TestRemoteAgentService } from '../../../test/browser/workbenchTestServices.js'; +import { TestActivityService, TestExtensionService, TestProductService, TestStorageService } from '../../../test/common/workbenchTestServices.js'; import type { AuthenticationProvider, AuthenticationSession } from 'vscode'; -import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { AuthenticationAccessService, IAuthenticationAccessService } from 'vs/workbench/services/authentication/browser/authenticationAccessService'; -import { AuthenticationUsageService, IAuthenticationUsageService } from 'vs/workbench/services/authentication/browser/authenticationUsageService'; -import { AuthenticationExtensionsService } from 'vs/workbench/services/authentication/browser/authenticationExtensionsService'; +import { IBrowserWorkbenchEnvironmentService } from '../../../services/environment/browser/environmentService.js'; +import { IProductService } from '../../../../platform/product/common/productService.js'; +import { AuthenticationAccessService, IAuthenticationAccessService } from '../../../services/authentication/browser/authenticationAccessService.js'; +import { AuthenticationUsageService, IAuthenticationUsageService } from '../../../services/authentication/browser/authenticationUsageService.js'; +import { AuthenticationExtensionsService } from '../../../services/authentication/browser/authenticationExtensionsService.js'; class AuthQuickPick { private listener: ((e: IQuickPickDidAcceptEvent) => any) | undefined; diff --git a/src/vs/workbench/api/test/browser/extHostBulkEdits.test.ts b/src/vs/workbench/api/test/browser/extHostBulkEdits.test.ts index be11d3a7353..582a5e7c954 100644 --- a/src/vs/workbench/api/test/browser/extHostBulkEdits.test.ts +++ b/src/vs/workbench/api/test/browser/extHostBulkEdits.test.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { MainContext, IWorkspaceEditDto, MainThreadBulkEditsShape, IWorkspaceTextEditDto } from 'vs/workbench/api/common/extHost.protocol'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { SingleProxyRPCProtocol, TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { ExtHostBulkEdits } from 'vs/workbench/api/common/extHostBulkEdits'; -import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import * as extHostTypes from '../../common/extHostTypes.js'; +import { MainContext, IWorkspaceEditDto, MainThreadBulkEditsShape, IWorkspaceTextEditDto } from '../../common/extHost.protocol.js'; +import { URI } from '../../../../base/common/uri.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ExtHostDocumentsAndEditors } from '../../common/extHostDocumentsAndEditors.js'; +import { SingleProxyRPCProtocol, TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { ExtHostBulkEdits } from '../../common/extHostBulkEdits.js'; +import { nullExtensionDescription } from '../../../services/extensions/common/extensions.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { SerializableObjectWithBuffers } from '../../../services/extensions/common/proxyIdentifier.js'; suite('ExtHostBulkEdits.applyWorkspaceEdit', () => { diff --git a/src/vs/workbench/api/test/browser/extHostCommands.test.ts b/src/vs/workbench/api/test/browser/extHostCommands.test.ts index 5353ca9c069..66e78d37251 100644 --- a/src/vs/workbench/api/test/browser/extHostCommands.test.ts +++ b/src/vs/workbench/api/test/browser/extHostCommands.test.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { MainThreadCommandsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { SingleProxyRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { mock } from 'vs/base/test/common/mock'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { ExtHostCommands } from '../../common/extHostCommands.js'; +import { MainThreadCommandsShape } from '../../common/extHost.protocol.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { SingleProxyRPCProtocol } from '../common/testRPCProtocol.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { IExtHostTelemetry } from '../../common/extHostTelemetry.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ExtHostCommands', function () { ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/workbench/api/test/browser/extHostConfiguration.test.ts b/src/vs/workbench/api/test/browser/extHostConfiguration.test.ts index 298299b3e56..00c9af61938 100644 --- a/src/vs/workbench/api/test/browser/extHostConfiguration.test.ts +++ b/src/vs/workbench/api/test/browser/extHostConfiguration.test.ts @@ -4,22 +4,22 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { ExtHostConfigProvider } from 'vs/workbench/api/common/extHostConfiguration'; -import { MainThreadConfigurationShape, IConfigurationInitData } from 'vs/workbench/api/common/extHost.protocol'; -import { ConfigurationModel, ConfigurationModelParser } from 'vs/platform/configuration/common/configurationModels'; -import { TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { mock } from 'vs/base/test/common/mock'; -import { IWorkspaceFolder, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { ConfigurationTarget, IConfigurationModel, IConfigurationChange } from 'vs/platform/configuration/common/configuration'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { FileSystemProviderCapabilities } from 'vs/platform/files/common/files'; -import { isLinux } from 'vs/base/common/platform'; -import { IURITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { URI, UriComponents } from '../../../../base/common/uri.js'; +import { ExtHostWorkspace } from '../../common/extHostWorkspace.js'; +import { ExtHostConfigProvider } from '../../common/extHostConfiguration.js'; +import { MainThreadConfigurationShape, IConfigurationInitData } from '../../common/extHost.protocol.js'; +import { ConfigurationModel, ConfigurationModelParser } from '../../../../platform/configuration/common/configurationModels.js'; +import { TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { IWorkspaceFolder, WorkspaceFolder } from '../../../../platform/workspace/common/workspace.js'; +import { ConfigurationTarget, IConfigurationModel, IConfigurationChange } from '../../../../platform/configuration/common/configuration.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { IExtHostInitDataService } from '../../common/extHostInitDataService.js'; +import { IExtHostFileSystemInfo } from '../../common/extHostFileSystemInfo.js'; +import { FileSystemProviderCapabilities } from '../../../../platform/files/common/files.js'; +import { isLinux } from '../../../../base/common/platform.js'; +import { IURITransformerService } from '../../common/extHostUriTransformerService.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ExtHostConfiguration', function () { diff --git a/src/vs/workbench/api/test/browser/extHostDecorations.test.ts b/src/vs/workbench/api/test/browser/extHostDecorations.test.ts index 8dca84bc5c1..78832d2d984 100644 --- a/src/vs/workbench/api/test/browser/extHostDecorations.test.ts +++ b/src/vs/workbench/api/test/browser/extHostDecorations.test.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { timeout } from 'vs/base/common/async'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { MainThreadDecorationsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostDecorations } from 'vs/workbench/api/common/extHostDecorations'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; +import { timeout } from '../../../../base/common/async.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { URI } from '../../../../base/common/uri.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { MainThreadDecorationsShape } from '../../common/extHost.protocol.js'; +import { ExtHostDecorations } from '../../common/extHostDecorations.js'; +import { IExtHostRpcService } from '../../common/extHostRpcService.js'; +import { nullExtensionDescription } from '../../../services/extensions/common/extensions.js'; suite('ExtHostDecorations', function () { diff --git a/src/vs/workbench/api/test/browser/extHostDiagnostics.test.ts b/src/vs/workbench/api/test/browser/extHostDiagnostics.test.ts index 2c866daee54..8f63ccc30d1 100644 --- a/src/vs/workbench/api/test/browser/extHostDiagnostics.test.ts +++ b/src/vs/workbench/api/test/browser/extHostDiagnostics.test.ts @@ -4,21 +4,21 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { DiagnosticCollection, ExtHostDiagnostics } from 'vs/workbench/api/common/extHostDiagnostics'; -import { Diagnostic, DiagnosticSeverity, Range, DiagnosticRelatedInformation, Location } from 'vs/workbench/api/common/extHostTypes'; -import { MainThreadDiagnosticsShape, IMainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; -import { mock } from 'vs/base/test/common/mock'; -import { Emitter, Event } from 'vs/base/common/event'; -import { NullLogService } from 'vs/platform/log/common/log'; +import { URI, UriComponents } from '../../../../base/common/uri.js'; +import { DiagnosticCollection, ExtHostDiagnostics } from '../../common/extHostDiagnostics.js'; +import { Diagnostic, DiagnosticSeverity, Range, DiagnosticRelatedInformation, Location } from '../../common/extHostTypes.js'; +import { MainThreadDiagnosticsShape, IMainContext } from '../../common/extHost.protocol.js'; +import { IMarkerData, MarkerSeverity } from '../../../../platform/markers/common/markers.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; import type * as vscode from 'vscode'; -import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; -import { ExtUri, extUri } from 'vs/base/common/resources'; -import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { IExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { nullExtensionDescription } from '../../../services/extensions/common/extensions.js'; +import { ExtUri, extUri } from '../../../../base/common/resources.js'; +import { IExtHostFileSystemInfo } from '../../common/extHostFileSystemInfo.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { IExtHostDocumentsAndEditors } from '../../common/extHostDocumentsAndEditors.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ExtHostDiagnostics', () => { diff --git a/src/vs/workbench/api/test/browser/extHostDocumentContentProvider.test.ts b/src/vs/workbench/api/test/browser/extHostDocumentContentProvider.test.ts index f4795adebb4..5a128d5f781 100644 --- a/src/vs/workbench/api/test/browser/extHostDocumentContentProvider.test.ts +++ b/src/vs/workbench/api/test/browser/extHostDocumentContentProvider.test.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { SingleProxyRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ExtHostDocumentContentProvider } from 'vs/workbench/api/common/extHostDocumentContentProviders'; -import { Emitter } from 'vs/base/common/event'; -import { MainThreadDocumentContentProvidersShape } from 'vs/workbench/api/common/extHost.protocol'; -import { timeout } from 'vs/base/common/async'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; +import { URI, UriComponents } from '../../../../base/common/uri.js'; +import { ExtHostDocumentsAndEditors } from '../../common/extHostDocumentsAndEditors.js'; +import { SingleProxyRPCProtocol } from '../common/testRPCProtocol.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ExtHostDocumentContentProvider } from '../../common/extHostDocumentContentProviders.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { MainThreadDocumentContentProvidersShape } from '../../common/extHost.protocol.js'; +import { timeout } from '../../../../base/common/async.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; suite('ExtHostDocumentContentProvider', () => { diff --git a/src/vs/workbench/api/test/browser/extHostDocumentData.test.ts b/src/vs/workbench/api/test/browser/extHostDocumentData.test.ts index 298a2811954..926b8fdc6d2 100644 --- a/src/vs/workbench/api/test/browser/extHostDocumentData.test.ts +++ b/src/vs/workbench/api/test/browser/extHostDocumentData.test.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ExtHostDocumentData } from 'vs/workbench/api/common/extHostDocumentData'; -import { Position } from 'vs/workbench/api/common/extHostTypes'; -import { Range } from 'vs/editor/common/core/range'; -import { MainThreadDocumentsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { IModelChangedEvent } from 'vs/editor/common/model/mirrorTextModel'; -import { mock } from 'vs/base/test/common/mock'; -import * as perfData from './extHostDocumentData.test.perf-data'; -import { setDefaultGetWordAtTextConfig } from 'vs/editor/common/core/wordHelper'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { URI } from '../../../../base/common/uri.js'; +import { ExtHostDocumentData } from '../../common/extHostDocumentData.js'; +import { Position } from '../../common/extHostTypes.js'; +import { Range } from '../../../../editor/common/core/range.js'; +import { MainThreadDocumentsShape } from '../../common/extHost.protocol.js'; +import { IModelChangedEvent } from '../../../../editor/common/model/mirrorTextModel.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import * as perfData from './extHostDocumentData.test.perf-data.js'; +import { setDefaultGetWordAtTextConfig } from '../../../../editor/common/core/wordHelper.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ExtHostDocumentData', () => { diff --git a/src/vs/workbench/api/test/browser/extHostDocumentSaveParticipant.test.ts b/src/vs/workbench/api/test/browser/extHostDocumentSaveParticipant.test.ts index 9f0a28ec02a..965bb16223e 100644 --- a/src/vs/workbench/api/test/browser/extHostDocumentSaveParticipant.test.ts +++ b/src/vs/workbench/api/test/browser/extHostDocumentSaveParticipant.test.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { TextDocumentSaveReason, TextEdit, Position, EndOfLine } from 'vs/workbench/api/common/extHostTypes'; -import { MainThreadTextEditorsShape, IWorkspaceEditDto, IWorkspaceTextEditDto, MainThreadBulkEditsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostDocumentSaveParticipant } from 'vs/workbench/api/common/extHostDocumentSaveParticipant'; -import { SingleProxyRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { SaveReason } from 'vs/workbench/common/editor'; +import { URI } from '../../../../base/common/uri.js'; +import { ExtHostDocuments } from '../../common/extHostDocuments.js'; +import { ExtHostDocumentsAndEditors } from '../../common/extHostDocumentsAndEditors.js'; +import { TextDocumentSaveReason, TextEdit, Position, EndOfLine } from '../../common/extHostTypes.js'; +import { MainThreadTextEditorsShape, IWorkspaceEditDto, IWorkspaceTextEditDto, MainThreadBulkEditsShape } from '../../common/extHost.protocol.js'; +import { ExtHostDocumentSaveParticipant } from '../../common/extHostDocumentSaveParticipant.js'; +import { SingleProxyRPCProtocol } from '../common/testRPCProtocol.js'; +import { SaveReason } from '../../../common/editor.js'; import type * as vscode from 'vscode'; -import { mock } from 'vs/base/test/common/mock'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { mock } from '../../../../base/test/common/mock.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { nullExtensionDescription } from '../../../services/extensions/common/extensions.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { SerializableObjectWithBuffers } from '../../../services/extensions/common/proxyIdentifier.js'; function timeout(n: number) { return new Promise(resolve => setTimeout(resolve, n)); diff --git a/src/vs/workbench/api/test/browser/extHostDocumentsAndEditors.test.ts b/src/vs/workbench/api/test/browser/extHostDocumentsAndEditors.test.ts index eda97538749..a0b9f1f7bef 100644 --- a/src/vs/workbench/api/test/browser/extHostDocumentsAndEditors.test.ts +++ b/src/vs/workbench/api/test/browser/extHostDocumentsAndEditors.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { URI } from '../../../../base/common/uri.js'; +import { ExtHostDocumentsAndEditors } from '../../common/extHostDocumentsAndEditors.js'; +import { TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ExtHostDocumentsAndEditors', () => { diff --git a/src/vs/workbench/api/test/browser/extHostEditorTabs.test.ts b/src/vs/workbench/api/test/browser/extHostEditorTabs.test.ts index 75f2ccce2d7..63bf82bdb66 100644 --- a/src/vs/workbench/api/test/browser/extHostEditorTabs.test.ts +++ b/src/vs/workbench/api/test/browser/extHostEditorTabs.test.ts @@ -5,13 +5,13 @@ import type * as vscode from 'vscode'; import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { IEditorTabDto, IEditorTabGroupDto, MainThreadEditorTabsShape, TabInputKind, TabModelOperationKind, TextInputDto } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostEditorTabs } from 'vs/workbench/api/common/extHostEditorTabs'; -import { SingleProxyRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { TextMergeTabInput, TextTabInput } from 'vs/workbench/api/common/extHostTypes'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { URI } from '../../../../base/common/uri.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { IEditorTabDto, IEditorTabGroupDto, MainThreadEditorTabsShape, TabInputKind, TabModelOperationKind, TextInputDto } from '../../common/extHost.protocol.js'; +import { ExtHostEditorTabs } from '../../common/extHostEditorTabs.js'; +import { SingleProxyRPCProtocol } from '../common/testRPCProtocol.js'; +import { TextMergeTabInput, TextTabInput } from '../../common/extHostTypes.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ExtHostEditorTabs', function () { diff --git a/src/vs/workbench/api/test/browser/extHostFileSystemEventService.test.ts b/src/vs/workbench/api/test/browser/extHostFileSystemEventService.test.ts index 953aff7ea0c..6ffae58bc79 100644 --- a/src/vs/workbench/api/test/browser/extHostFileSystemEventService.test.ts +++ b/src/vs/workbench/api/test/browser/extHostFileSystemEventService.test.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { ExtHostFileSystemEventService } from 'vs/workbench/api/common/extHostFileSystemEventService'; -import { IMainContext } from 'vs/workbench/api/common/extHost.protocol'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { ExtHostFileSystemEventService } from '../../common/extHostFileSystemEventService.js'; +import { IMainContext } from '../../common/extHost.protocol.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ExtHostFileSystemEventService', () => { @@ -22,13 +22,13 @@ suite('ExtHostFileSystemEventService', () => { drain: undefined! }; - const watcher1 = new ExtHostFileSystemEventService(protocol, new NullLogService(), undefined!).createFileSystemWatcher(undefined!, undefined!, '**/somethingInteresting', { correlate: false }); + const watcher1 = new ExtHostFileSystemEventService(protocol, new NullLogService(), undefined!).createFileSystemWatcher(undefined!, undefined!, undefined!, '**/somethingInteresting', { correlate: false }); assert.strictEqual(watcher1.ignoreChangeEvents, false); assert.strictEqual(watcher1.ignoreCreateEvents, false); assert.strictEqual(watcher1.ignoreDeleteEvents, false); watcher1.dispose(); - const watcher2 = new ExtHostFileSystemEventService(protocol, new NullLogService(), undefined!).createFileSystemWatcher(undefined!, undefined!, '**/somethingBoring', { ignoreCreateEvents: true, ignoreChangeEvents: true, ignoreDeleteEvents: true, correlate: false }); + const watcher2 = new ExtHostFileSystemEventService(protocol, new NullLogService(), undefined!).createFileSystemWatcher(undefined!, undefined!, undefined!, '**/somethingBoring', { ignoreCreateEvents: true, ignoreChangeEvents: true, ignoreDeleteEvents: true, correlate: false }); assert.strictEqual(watcher2.ignoreChangeEvents, true); assert.strictEqual(watcher2.ignoreCreateEvents, true); assert.strictEqual(watcher2.ignoreDeleteEvents, true); diff --git a/src/vs/workbench/api/test/browser/extHostLanguageFeatures.test.ts b/src/vs/workbench/api/test/browser/extHostLanguageFeatures.test.ts index 6b7de3ca716..e26fa6617e0 100644 --- a/src/vs/workbench/api/test/browser/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/api/test/browser/extHostLanguageFeatures.test.ts @@ -4,58 +4,58 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { setUnexpectedErrorHandler, errorHandler } from 'vs/base/common/errors'; -import { URI } from 'vs/base/common/uri'; -import * as types from 'vs/workbench/api/common/extHostTypes'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { Position as EditorPosition, Position } from 'vs/editor/common/core/position'; -import { Range as EditorRange } from 'vs/editor/common/core/range'; -import { TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { IMarkerService } from 'vs/platform/markers/common/markers'; -import { MarkerService } from 'vs/platform/markers/common/markerService'; -import { ExtHostLanguageFeatures } from 'vs/workbench/api/common/extHostLanguageFeatures'; -import { MainThreadLanguageFeatures } from 'vs/workbench/api/browser/mainThreadLanguageFeatures'; -import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { MainThreadCommands } from 'vs/workbench/api/browser/mainThreadCommands'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import * as languages from 'vs/editor/common/languages'; -import { getCodeLensModel } from 'vs/editor/contrib/codelens/browser/codelens'; -import { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition, getDeclarationsAtPosition, getReferencesAtPosition } from 'vs/editor/contrib/gotoSymbol/browser/goToSymbol'; -import { getHoversPromise } from 'vs/editor/contrib/hover/browser/getHover'; -import { getOccurrencesAtPosition } from 'vs/editor/contrib/wordHighlighter/browser/wordHighlighter'; -import { getCodeActions } from 'vs/editor/contrib/codeAction/browser/codeAction'; -import { getWorkspaceSymbols } from 'vs/workbench/contrib/search/common/search'; -import { rename } from 'vs/editor/contrib/rename/browser/rename'; -import { provideSignatureHelp } from 'vs/editor/contrib/parameterHints/browser/provideSignatureHelp'; -import { provideSuggestionItems, CompletionOptions } from 'vs/editor/contrib/suggest/browser/suggest'; -import { getDocumentFormattingEditsUntilResult, getDocumentRangeFormattingEditsUntilResult, getOnTypeFormattingEdits } from 'vs/editor/contrib/format/browser/format'; -import { getLinks } from 'vs/editor/contrib/links/browser/getLinks'; -import { MainContext, ExtHostContext } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostDiagnostics } from 'vs/workbench/api/common/extHostDiagnostics'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { setUnexpectedErrorHandler, errorHandler } from '../../../../base/common/errors.js'; +import { URI } from '../../../../base/common/uri.js'; +import * as types from '../../common/extHostTypes.js'; +import { createTextModel } from '../../../../editor/test/common/testTextModel.js'; +import { Position as EditorPosition, Position } from '../../../../editor/common/core/position.js'; +import { Range as EditorRange } from '../../../../editor/common/core/range.js'; +import { TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { IMarkerService } from '../../../../platform/markers/common/markers.js'; +import { MarkerService } from '../../../../platform/markers/common/markerService.js'; +import { ExtHostLanguageFeatures } from '../../common/extHostLanguageFeatures.js'; +import { MainThreadLanguageFeatures } from '../../browser/mainThreadLanguageFeatures.js'; +import { ExtHostCommands } from '../../common/extHostCommands.js'; +import { MainThreadCommands } from '../../browser/mainThreadCommands.js'; +import { ExtHostDocuments } from '../../common/extHostDocuments.js'; +import { ExtHostDocumentsAndEditors } from '../../common/extHostDocumentsAndEditors.js'; +import * as languages from '../../../../editor/common/languages.js'; +import { getCodeLensModel } from '../../../../editor/contrib/codelens/browser/codelens.js'; +import { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition, getDeclarationsAtPosition, getReferencesAtPosition } from '../../../../editor/contrib/gotoSymbol/browser/goToSymbol.js'; +import { getHoversPromise } from '../../../../editor/contrib/hover/browser/getHover.js'; +import { getOccurrencesAtPosition } from '../../../../editor/contrib/wordHighlighter/browser/wordHighlighter.js'; +import { getCodeActions } from '../../../../editor/contrib/codeAction/browser/codeAction.js'; +import { getWorkspaceSymbols } from '../../../contrib/search/common/search.js'; +import { rename } from '../../../../editor/contrib/rename/browser/rename.js'; +import { provideSignatureHelp } from '../../../../editor/contrib/parameterHints/browser/provideSignatureHelp.js'; +import { provideSuggestionItems, CompletionOptions } from '../../../../editor/contrib/suggest/browser/suggest.js'; +import { getDocumentFormattingEditsUntilResult, getDocumentRangeFormattingEditsUntilResult, getOnTypeFormattingEdits } from '../../../../editor/contrib/format/browser/format.js'; +import { getLinks } from '../../../../editor/contrib/links/browser/getLinks.js'; +import { MainContext, ExtHostContext } from '../../common/extHost.protocol.js'; +import { ExtHostDiagnostics } from '../../common/extHostDiagnostics.js'; import type * as vscode from 'vscode'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { ITextModel, EndOfLineSequence } from 'vs/editor/common/model'; -import { getColors } from 'vs/editor/contrib/colorPicker/browser/color'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { nullExtensionDescription as defaultExtension } from 'vs/workbench/services/extensions/common/extensions'; -import { provideSelectionRanges } from 'vs/editor/contrib/smartSelect/browser/smartSelect'; -import { mock } from 'vs/base/test/common/mock'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { NullApiDeprecationService } from 'vs/workbench/api/common/extHostApiDeprecationService'; -import { Progress } from 'vs/platform/progress/common/progress'; -import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { URITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; -import { OutlineModel } from 'vs/editor/contrib/documentSymbols/browser/outlineModel'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { LanguageFeaturesService } from 'vs/editor/common/services/languageFeaturesService'; -import { CodeActionTriggerSource } from 'vs/editor/contrib/codeAction/common/types'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { ITextModel, EndOfLineSequence } from '../../../../editor/common/model.js'; +import { getColors } from '../../../../editor/contrib/colorPicker/browser/color.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { nullExtensionDescription as defaultExtension } from '../../../services/extensions/common/extensions.js'; +import { provideSelectionRanges } from '../../../../editor/contrib/smartSelect/browser/smartSelect.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { IEditorWorkerService } from '../../../../editor/common/services/editorWorker.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { NullApiDeprecationService } from '../../common/extHostApiDeprecationService.js'; +import { Progress } from '../../../../platform/progress/common/progress.js'; +import { IExtHostFileSystemInfo } from '../../common/extHostFileSystemInfo.js'; +import { URITransformerService } from '../../common/extHostUriTransformerService.js'; +import { OutlineModel } from '../../../../editor/contrib/documentSymbols/browser/outlineModel.js'; +import { ILanguageFeaturesService } from '../../../../editor/common/services/languageFeatures.js'; +import { LanguageFeaturesService } from '../../../../editor/common/services/languageFeaturesService.js'; +import { CodeActionTriggerSource } from '../../../../editor/contrib/codeAction/common/types.js'; +import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js'; +import { IExtHostTelemetry } from '../../common/extHostTelemetry.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ExtHostLanguageFeatures', function () { @@ -301,7 +301,7 @@ suite('ExtHostLanguageFeatures', function () { })); await rpcProtocol.sync(); - const value = await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, new EditorPosition(1, 1), CancellationToken.None); + const value = await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, new EditorPosition(1, 1), false, CancellationToken.None); assert.strictEqual(value.length, 1); const [entry] = value; assert.deepStrictEqual(entry.range, { startLineNumber: 2, startColumn: 3, endLineNumber: 4, endColumn: 5 }); @@ -322,7 +322,7 @@ suite('ExtHostLanguageFeatures', function () { })); await rpcProtocol.sync(); - const value = await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, new EditorPosition(1, 1), CancellationToken.None); + const value = await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, new EditorPosition(1, 1), false, CancellationToken.None); assert.strictEqual(value.length, 2); }); @@ -341,7 +341,7 @@ suite('ExtHostLanguageFeatures', function () { })); await rpcProtocol.sync(); - const value = await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, new EditorPosition(1, 1), CancellationToken.None); + const value = await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, new EditorPosition(1, 1), false, CancellationToken.None); assert.strictEqual(value.length, 2); // let [first, second] = value; assert.strictEqual(value[0].uri.authority, 'second'); @@ -362,7 +362,7 @@ suite('ExtHostLanguageFeatures', function () { })); await rpcProtocol.sync(); - const value = await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, new EditorPosition(1, 1), CancellationToken.None); + const value = await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, new EditorPosition(1, 1), false, CancellationToken.None); assert.strictEqual(value.length, 1); }); @@ -377,7 +377,7 @@ suite('ExtHostLanguageFeatures', function () { })); await rpcProtocol.sync(); - const value = await getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, new EditorPosition(1, 1), CancellationToken.None); + const value = await getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, new EditorPosition(1, 1), false, CancellationToken.None); assert.strictEqual(value.length, 1); const [entry] = value; assert.deepStrictEqual(entry.range, { startLineNumber: 2, startColumn: 3, endLineNumber: 4, endColumn: 5 }); @@ -395,7 +395,7 @@ suite('ExtHostLanguageFeatures', function () { })); await rpcProtocol.sync(); - const value = await getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, new EditorPosition(1, 1), CancellationToken.None); + const value = await getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, new EditorPosition(1, 1), false, CancellationToken.None); assert.strictEqual(value.length, 1); const [entry] = value; assert.deepStrictEqual(entry.range, { startLineNumber: 2, startColumn: 3, endLineNumber: 4, endColumn: 5 }); @@ -413,7 +413,7 @@ suite('ExtHostLanguageFeatures', function () { })); await rpcProtocol.sync(); - const value = await getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, new EditorPosition(1, 1), CancellationToken.None); + const value = await getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, new EditorPosition(1, 1), false, CancellationToken.None); assert.strictEqual(value.length, 1); const [entry] = value; assert.deepStrictEqual(entry.range, { startLineNumber: 2, startColumn: 3, endLineNumber: 4, endColumn: 5 }); @@ -517,7 +517,7 @@ suite('ExtHostLanguageFeatures', function () { disposables.add(extHost.registerDocumentHighlightProvider(defaultExtension, defaultSelector, new class implements vscode.DocumentHighlightProvider { provideDocumentHighlights(): any { - return []; + return undefined; } })); disposables.add(extHost.registerDocumentHighlightProvider(defaultExtension, '*', new class implements vscode.DocumentHighlightProvider { @@ -591,7 +591,7 @@ suite('ExtHostLanguageFeatures', function () { })); await rpcProtocol.sync(); - const value = await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, new EditorPosition(1, 2), false, CancellationToken.None); + const value = await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, new EditorPosition(1, 2), false, false, CancellationToken.None); assert.strictEqual(value.length, 2); const [first, second] = value; assert.strictEqual(first.uri.path, '/second'); @@ -607,7 +607,7 @@ suite('ExtHostLanguageFeatures', function () { })); await rpcProtocol.sync(); - const value = await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, new EditorPosition(1, 2), false, CancellationToken.None); + const value = await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, new EditorPosition(1, 2), false, false, CancellationToken.None); assert.strictEqual(value.length, 1); const [item] = value; assert.deepStrictEqual(item.range, { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 }); @@ -628,7 +628,7 @@ suite('ExtHostLanguageFeatures', function () { })); await rpcProtocol.sync(); - const value = await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, new EditorPosition(1, 2), false, CancellationToken.None); + const value = await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, new EditorPosition(1, 2), false, false, CancellationToken.None); assert.strictEqual(value.length, 1); }); diff --git a/src/vs/workbench/api/test/browser/extHostMessagerService.test.ts b/src/vs/workbench/api/test/browser/extHostMessagerService.test.ts index a88e5a79bb9..d5fc283aeb6 100644 --- a/src/vs/workbench/api/test/browser/extHostMessagerService.test.ts +++ b/src/vs/workbench/api/test/browser/extHostMessagerService.test.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { MainThreadMessageService } from 'vs/workbench/api/browser/mainThreadMessageService'; -import { IDialogService, IPrompt, IPromptButton } from 'vs/platform/dialogs/common/dialogs'; -import { INotificationService, INotification, NoOpNotification, INotificationHandle, Severity, IPromptChoice, IPromptOptions, IStatusMessageOptions, INotificationSource, INotificationSourceFilter, NotificationsFilter } from 'vs/platform/notification/common/notification'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { mock } from 'vs/base/test/common/mock'; -import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; -import { Event } from 'vs/base/common/event'; -import { TestDialogService } from 'vs/platform/dialogs/test/common/testDialogService'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { TestExtensionService } from 'vs/workbench/test/common/workbenchTestServices'; +import { MainThreadMessageService } from '../../browser/mainThreadMessageService.js'; +import { IDialogService, IPrompt, IPromptButton } from '../../../../platform/dialogs/common/dialogs.js'; +import { INotificationService, INotification, NoOpNotification, INotificationHandle, Severity, IPromptChoice, IPromptOptions, IStatusMessageOptions, INotificationSource, INotificationSourceFilter, NotificationsFilter } from '../../../../platform/notification/common/notification.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { IDisposable, Disposable } from '../../../../base/common/lifecycle.js'; +import { Event } from '../../../../base/common/event.js'; +import { TestDialogService } from '../../../../platform/dialogs/test/common/testDialogService.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { TestExtensionService } from '../../../test/common/workbenchTestServices.js'; const emptyCommandService: ICommandService = { _serviceBrand: undefined, diff --git a/src/vs/workbench/api/test/browser/extHostNotebook.test.ts b/src/vs/workbench/api/test/browser/extHostNotebook.test.ts index 49a2f011645..54b14a349b4 100644 --- a/src/vs/workbench/api/test/browser/extHostNotebook.test.ts +++ b/src/vs/workbench/api/test/browser/extHostNotebook.test.ts @@ -5,30 +5,30 @@ import assert from 'assert'; import * as vscode from 'vscode'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { mock } from 'vs/base/test/common/mock'; -import { IModelAddedData, MainContext, MainThreadCommandsShape, MainThreadNotebookShape, NotebookCellsChangedEventDto, NotebookOutputItemDto } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostNotebookController } from 'vs/workbench/api/common/extHostNotebook'; -import { ExtHostNotebookDocument } from 'vs/workbench/api/common/extHostNotebookDocument'; -import { CellKind, CellUri, NotebookCellsChangeType } from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { URI } from 'vs/base/common/uri'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; -import { isEqual } from 'vs/base/common/resources'; -import { Event } from 'vs/base/common/event'; -import { ExtHostNotebookDocuments } from 'vs/workbench/api/common/extHostNotebookDocuments'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import { ExtHostConsumerFileSystem } from 'vs/workbench/api/common/extHostFileSystemConsumer'; -import { ExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ExtHostSearch } from 'vs/workbench/api/common/extHostSearch'; -import { URITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; +import { ExtHostDocumentsAndEditors } from '../../common/extHostDocumentsAndEditors.js'; +import { TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { IModelAddedData, MainContext, MainThreadCommandsShape, MainThreadNotebookShape, NotebookCellsChangedEventDto, NotebookOutputItemDto } from '../../common/extHost.protocol.js'; +import { ExtHostNotebookController } from '../../common/extHostNotebook.js'; +import { ExtHostNotebookDocument } from '../../common/extHostNotebookDocument.js'; +import { CellKind, CellUri, NotebookCellsChangeType } from '../../../contrib/notebook/common/notebookCommon.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ExtHostDocuments } from '../../common/extHostDocuments.js'; +import { ExtHostCommands } from '../../common/extHostCommands.js'; +import { nullExtensionDescription } from '../../../services/extensions/common/extensions.js'; +import { isEqual } from '../../../../base/common/resources.js'; +import { Event } from '../../../../base/common/event.js'; +import { ExtHostNotebookDocuments } from '../../common/extHostNotebookDocuments.js'; +import { SerializableObjectWithBuffers } from '../../../services/extensions/common/proxyIdentifier.js'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { IExtHostTelemetry } from '../../common/extHostTelemetry.js'; +import { ExtHostConsumerFileSystem } from '../../common/extHostFileSystemConsumer.js'; +import { ExtHostFileSystemInfo } from '../../common/extHostFileSystemInfo.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ExtHostSearch } from '../../common/extHostSearch.js'; +import { URITransformerService } from '../../common/extHostUriTransformerService.js'; suite('NotebookCell#Document', function () { let rpcProtocol: TestRPCProtocol; @@ -97,7 +97,8 @@ suite('NotebookCell#Document', function () { documentUri: notebookUri, id: '_notebook_editor_0', selections: [{ start: 0, end: 1 }], - visibleRanges: [] + visibleRanges: [], + viewType: 'test' }] })); extHostNotebooks.$acceptDocumentAndEditorsDelta(new SerializableObjectWithBuffers({ newActiveEditor: '_notebook_editor_0' })); @@ -369,7 +370,8 @@ suite('NotebookCell#Document', function () { documentUri: notebookUri, id: '_notebook_editor_2', selections: [{ start: 0, end: 1 }], - visibleRanges: [] + visibleRanges: [], + viewType: 'test' }] })); diff --git a/src/vs/workbench/api/test/browser/extHostNotebookKernel.test.ts b/src/vs/workbench/api/test/browser/extHostNotebookKernel.test.ts index a1341bad58c..e025bb78bd0 100644 --- a/src/vs/workbench/api/test/browser/extHostNotebookKernel.test.ts +++ b/src/vs/workbench/api/test/browser/extHostNotebookKernel.test.ts @@ -4,33 +4,33 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Barrier } from 'vs/base/common/async'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { ICellExecuteUpdateDto, ICellExecutionCompleteDto, INotebookKernelDto2, MainContext, MainThreadCommandsShape, MainThreadNotebookDocumentsShape, MainThreadNotebookKernelsShape, MainThreadNotebookShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { ExtHostNotebookController } from 'vs/workbench/api/common/extHostNotebook'; -import { ExtHostNotebookDocument } from 'vs/workbench/api/common/extHostNotebookDocument'; -import { ExtHostNotebookDocuments } from 'vs/workbench/api/common/extHostNotebookDocuments'; -import { ExtHostNotebookKernels } from 'vs/workbench/api/common/extHostNotebookKernels'; -import { NotebookCellOutput, NotebookCellOutputItem } from 'vs/workbench/api/common/extHostTypes'; -import { CellKind, CellUri, NotebookCellsChangeType } from 'vs/workbench/contrib/notebook/common/notebookCommon'; -import { CellExecutionUpdateType } from 'vs/workbench/contrib/notebook/common/notebookExecutionService'; -import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { mock } from 'vs/workbench/test/common/workbenchTestServices'; -import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import { ExtHostConsumerFileSystem } from 'vs/workbench/api/common/extHostFileSystemConsumer'; -import { ExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ExtHostSearch } from 'vs/workbench/api/common/extHostSearch'; -import { URITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; +import { Barrier } from '../../../../base/common/async.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { URI, UriComponents } from '../../../../base/common/uri.js'; +import { ExtensionIdentifier } from '../../../../platform/extensions/common/extensions.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { ICellExecuteUpdateDto, ICellExecutionCompleteDto, INotebookKernelDto2, MainContext, MainThreadCommandsShape, MainThreadNotebookDocumentsShape, MainThreadNotebookKernelsShape, MainThreadNotebookShape } from '../../common/extHost.protocol.js'; +import { ExtHostCommands } from '../../common/extHostCommands.js'; +import { ExtHostDocuments } from '../../common/extHostDocuments.js'; +import { ExtHostDocumentsAndEditors } from '../../common/extHostDocumentsAndEditors.js'; +import { IExtHostInitDataService } from '../../common/extHostInitDataService.js'; +import { ExtHostNotebookController } from '../../common/extHostNotebook.js'; +import { ExtHostNotebookDocument } from '../../common/extHostNotebookDocument.js'; +import { ExtHostNotebookDocuments } from '../../common/extHostNotebookDocuments.js'; +import { ExtHostNotebookKernels } from '../../common/extHostNotebookKernels.js'; +import { NotebookCellOutput, NotebookCellOutputItem } from '../../common/extHostTypes.js'; +import { CellKind, CellUri, NotebookCellsChangeType } from '../../../contrib/notebook/common/notebookCommon.js'; +import { CellExecutionUpdateType } from '../../../contrib/notebook/common/notebookExecutionService.js'; +import { nullExtensionDescription } from '../../../services/extensions/common/extensions.js'; +import { SerializableObjectWithBuffers } from '../../../services/extensions/common/proxyIdentifier.js'; +import { TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { mock } from '../../../test/common/workbenchTestServices.js'; +import { IExtHostTelemetry } from '../../common/extHostTelemetry.js'; +import { ExtHostConsumerFileSystem } from '../../common/extHostFileSystemConsumer.js'; +import { ExtHostFileSystemInfo } from '../../common/extHostFileSystemInfo.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ExtHostSearch } from '../../common/extHostSearch.js'; +import { URITransformerService } from '../../common/extHostUriTransformerService.js'; suite('NotebookKernel', function () { let rpcProtocol: TestRPCProtocol; @@ -136,7 +136,8 @@ suite('NotebookKernel', function () { documentUri: notebookUri, id: '_notebook_editor_0', selections: [{ start: 0, end: 1 }], - visibleRanges: [] + visibleRanges: [], + viewType: 'test', }] })); extHostNotebooks.$acceptDocumentAndEditorsDelta(new SerializableObjectWithBuffers({ newActiveEditor: '_notebook_editor_0' })); diff --git a/src/vs/workbench/api/test/browser/extHostTelemetry.test.ts b/src/vs/workbench/api/test/browser/extHostTelemetry.test.ts index 54878ddb0cd..7be5b9554c5 100644 --- a/src/vs/workbench/api/test/browser/extHostTelemetry.test.ts +++ b/src/vs/workbench/api/test/browser/extHostTelemetry.test.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ExtensionIdentifier, IExtensionDescription, TargetPlatform } from 'vs/platform/extensions/common/extensions'; -import { DEFAULT_LOG_LEVEL, LogLevel } from 'vs/platform/log/common/log'; -import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; -import { TestTelemetryLoggerService } from 'vs/platform/telemetry/test/common/telemetryLogAppender.test'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { ExtHostTelemetry, ExtHostTelemetryLogger } from 'vs/workbench/api/common/extHostTelemetry'; -import { IEnvironment } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; -import { mock } from 'vs/workbench/test/common/workbenchTestServices'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ExtensionIdentifier, IExtensionDescription, TargetPlatform } from '../../../../platform/extensions/common/extensions.js'; +import { DEFAULT_LOG_LEVEL, LogLevel } from '../../../../platform/log/common/log.js'; +import { TelemetryLevel } from '../../../../platform/telemetry/common/telemetry.js'; +import { TestTelemetryLoggerService } from '../../../../platform/telemetry/test/common/telemetryLogAppender.test.js'; +import { IExtHostInitDataService } from '../../common/extHostInitDataService.js'; +import { ExtHostTelemetry, ExtHostTelemetryLogger } from '../../common/extHostTelemetry.js'; +import { IEnvironment } from '../../../services/extensions/common/extensionHostProtocol.js'; +import { mock } from '../../../test/common/workbenchTestServices.js'; import type { TelemetryLoggerOptions, TelemetrySender } from 'vscode'; interface TelemetryLoggerSpy { diff --git a/src/vs/workbench/api/test/browser/extHostTesting.test.ts b/src/vs/workbench/api/test/browser/extHostTesting.test.ts index c4515796d05..3b45e1073b7 100644 --- a/src/vs/workbench/api/test/browser/extHostTesting.test.ts +++ b/src/vs/workbench/api/test/browser/extHostTesting.test.ts @@ -5,29 +5,29 @@ import assert from 'assert'; import * as sinon from 'sinon'; -import { timeout } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { Event } from 'vs/base/common/event'; -import { Iterable } from 'vs/base/common/iterator'; -import { URI } from 'vs/base/common/uri'; -import { mock, mockObject, MockObject } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import * as editorRange from 'vs/editor/common/core/range'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { MainThreadTestingShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import { ExtHostTesting, TestRunCoordinator, TestRunDto, TestRunProfileImpl } from 'vs/workbench/api/common/extHostTesting'; -import { ExtHostTestItemCollection, TestItemImpl } from 'vs/workbench/api/common/extHostTestItem'; -import * as convert from 'vs/workbench/api/common/extHostTypeConverters'; -import { Location, Position, Range, TestMessage, TestRunProfileKind, TestRunRequest as TestRunRequestImpl, TestTag } from 'vs/workbench/api/common/extHostTypes'; -import { AnyCallRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { TestId } from 'vs/workbench/contrib/testing/common/testId'; -import { TestDiffOpType, TestItemExpandState, TestMessageType, TestsDiff } from 'vs/workbench/contrib/testing/common/testTypes'; -import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; +import { timeout } from '../../../../base/common/async.js'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { Event } from '../../../../base/common/event.js'; +import { Iterable } from '../../../../base/common/iterator.js'; +import { URI } from '../../../../base/common/uri.js'; +import { mock, mockObject, MockObject } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import * as editorRange from '../../../../editor/common/core/range.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../../platform/extensions/common/extensions.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { MainThreadTestingShape } from '../../common/extHost.protocol.js'; +import { ExtHostCommands } from '../../common/extHostCommands.js'; +import { ExtHostDocumentsAndEditors } from '../../common/extHostDocumentsAndEditors.js'; +import { IExtHostTelemetry } from '../../common/extHostTelemetry.js'; +import { ExtHostTesting, TestRunCoordinator, TestRunDto, TestRunProfileImpl } from '../../common/extHostTesting.js'; +import { ExtHostTestItemCollection, TestItemImpl } from '../../common/extHostTestItem.js'; +import * as convert from '../../common/extHostTypeConverters.js'; +import { Location, Position, Range, TestMessage, TestRunProfileKind, TestRunRequest as TestRunRequestImpl, TestTag } from '../../common/extHostTypes.js'; +import { AnyCallRPCProtocol } from '../common/testRPCProtocol.js'; +import { TestId } from '../../../contrib/testing/common/testId.js'; +import { TestDiffOpType, TestItemExpandState, TestMessageType, TestsDiff } from '../../../contrib/testing/common/testTypes.js'; +import { nullExtensionDescription } from '../../../services/extensions/common/extensions.js'; import type { TestController, TestItem, TestRunProfile, TestRunRequest } from 'vscode'; const simplify = (item: TestItem) => ({ @@ -829,7 +829,8 @@ suite('ExtHost Testing', () => { expected: undefined, contextValue: undefined, actual: undefined, - location: convert.location.from(message1.location) + location: convert.location.from(message1.location), + stackTrace: undefined, }] ]); @@ -846,6 +847,7 @@ suite('ExtHost Testing', () => { expected: undefined, actual: undefined, location: convert.location.from({ uri: test2.uri!, range: test2.range }), + stackTrace: undefined, }] ]); diff --git a/src/vs/workbench/api/test/browser/extHostTextEditor.test.ts b/src/vs/workbench/api/test/browser/extHostTextEditor.test.ts index 98bc7766151..b76b9048aaa 100644 --- a/src/vs/workbench/api/test/browser/extHostTextEditor.test.ts +++ b/src/vs/workbench/api/test/browser/extHostTextEditor.test.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Lazy } from 'vs/base/common/lazy'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { RenderLineNumbersType, TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate, MainThreadTextEditorsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostDocumentData } from 'vs/workbench/api/common/extHostDocumentData'; -import { ExtHostTextEditor, ExtHostTextEditorOptions } from 'vs/workbench/api/common/extHostTextEditor'; -import { Range, TextEditorLineNumbersStyle } from 'vs/workbench/api/common/extHostTypes'; +import { Lazy } from '../../../../base/common/lazy.js'; +import { URI } from '../../../../base/common/uri.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { RenderLineNumbersType, TextEditorCursorStyle } from '../../../../editor/common/config/editorOptions.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate, MainThreadTextEditorsShape } from '../../common/extHost.protocol.js'; +import { ExtHostDocumentData } from '../../common/extHostDocumentData.js'; +import { ExtHostTextEditor, ExtHostTextEditorOptions } from '../../common/extHostTextEditor.js'; +import { Range, TextEditorLineNumbersStyle } from '../../common/extHostTypes.js'; suite('ExtHostTextEditor', () => { diff --git a/src/vs/workbench/api/test/browser/extHostTreeViews.test.ts b/src/vs/workbench/api/test/browser/extHostTreeViews.test.ts index 1e442c1ed88..d00b0f7c988 100644 --- a/src/vs/workbench/api/test/browser/extHostTreeViews.test.ts +++ b/src/vs/workbench/api/test/browser/extHostTreeViews.test.ts @@ -5,20 +5,20 @@ import assert from 'assert'; import * as sinon from 'sinon'; -import { Emitter } from 'vs/base/common/event'; -import { ExtHostTreeViews } from 'vs/workbench/api/common/extHostTreeViews'; -import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { MainThreadTreeViewsShape, MainContext, MainThreadCommandsShape } from 'vs/workbench/api/common/extHost.protocol'; +import { Emitter } from '../../../../base/common/event.js'; +import { ExtHostTreeViews } from '../../common/extHostTreeViews.js'; +import { ExtHostCommands } from '../../common/extHostCommands.js'; +import { MainThreadTreeViewsShape, MainContext, MainThreadCommandsShape } from '../../common/extHost.protocol.js'; import { TreeDataProvider, TreeItem } from 'vscode'; -import { TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { mock } from 'vs/base/test/common/mock'; -import { TreeItemCollapsibleState, ITreeItem, IRevealOptions } from 'vs/workbench/common/views'; -import { NullLogService } from 'vs/platform/log/common/log'; -import type { IDisposable } from 'vs/base/common/lifecycle'; -import { nullExtensionDescription as extensionsDescription } from 'vs/workbench/services/extensions/common/extensions'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { TreeItemCollapsibleState, ITreeItem, IRevealOptions } from '../../../common/views.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import type { IDisposable } from '../../../../base/common/lifecycle.js'; +import { nullExtensionDescription as extensionsDescription } from '../../../services/extensions/common/extensions.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { IExtHostTelemetry } from '../../common/extHostTelemetry.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ExtHostTreeView', function () { const store = ensureNoDisposablesAreLeakedInTestSuite(); diff --git a/src/vs/workbench/api/test/browser/extHostTypeConverter.test.ts b/src/vs/workbench/api/test/browser/extHostTypeConverter.test.ts index 40a148042ff..c4296afa836 100644 --- a/src/vs/workbench/api/test/browser/extHostTypeConverter.test.ts +++ b/src/vs/workbench/api/test/browser/extHostTypeConverter.test.ts @@ -5,12 +5,12 @@ import assert from 'assert'; -import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { MarkdownString, NotebookCellOutputItem, NotebookData, LanguageSelector, WorkspaceEdit } from 'vs/workbench/api/common/extHostTypeConverters'; -import { isEmptyObject } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { IWorkspaceTextEditDto } from 'vs/workbench/api/common/extHost.protocol'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import * as extHostTypes from '../../common/extHostTypes.js'; +import { MarkdownString, NotebookCellOutputItem, NotebookData, LanguageSelector, WorkspaceEdit } from '../../common/extHostTypeConverters.js'; +import { isEmptyObject } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IWorkspaceTextEditDto } from '../../common/extHost.protocol.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('ExtHostTypeConverter', function () { diff --git a/src/vs/workbench/api/test/browser/extHostTypes.test.ts b/src/vs/workbench/api/test/browser/extHostTypes.test.ts index 3d1ff69b232..0ed70be8207 100644 --- a/src/vs/workbench/api/test/browser/extHostTypes.test.ts +++ b/src/vs/workbench/api/test/browser/extHostTypes.test.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import * as types from 'vs/workbench/api/common/extHostTypes'; -import { isWindows } from 'vs/base/common/platform'; -import { assertType } from 'vs/base/common/types'; -import { Mimes } from 'vs/base/common/mime'; -import { MarshalledId } from 'vs/base/common/marshallingIds'; -import { CancellationError } from 'vs/base/common/errors'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { URI } from '../../../../base/common/uri.js'; +import * as types from '../../common/extHostTypes.js'; +import { isWindows } from '../../../../base/common/platform.js'; +import { assertType } from '../../../../base/common/types.js'; +import { Mimes } from '../../../../base/common/mime.js'; +import { MarshalledId } from '../../../../base/common/marshallingIds.js'; +import { CancellationError } from '../../../../base/common/errors.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; function assertToJSON(a: any, expected: any) { const raw = JSON.stringify(a); diff --git a/src/vs/workbench/api/test/browser/extHostWebview.test.ts b/src/vs/workbench/api/test/browser/extHostWebview.test.ts index e87300aeb05..9bbf074c7c6 100644 --- a/src/vs/workbench/api/test/browser/extHostWebview.test.ts +++ b/src/vs/workbench/api/test/browser/extHostWebview.test.ts @@ -4,22 +4,22 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { Schemas } from 'vs/base/common/network'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { MainThreadWebviewManager } from 'vs/workbench/api/browser/mainThreadWebviewManager'; -import { NullApiDeprecationService } from 'vs/workbench/api/common/extHostApiDeprecationService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { ExtHostWebviews } from 'vs/workbench/api/common/extHostWebview'; -import { ExtHostWebviewPanels } from 'vs/workbench/api/common/extHostWebviewPanels'; -import { SingleProxyRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { decodeAuthority, webviewResourceBaseHost } from 'vs/workbench/contrib/webview/common/webview'; -import { EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { URI } from '../../../../base/common/uri.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IExtensionDescription } from '../../../../platform/extensions/common/extensions.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { MainThreadWebviewManager } from '../../browser/mainThreadWebviewManager.js'; +import { NullApiDeprecationService } from '../../common/extHostApiDeprecationService.js'; +import { IExtHostRpcService } from '../../common/extHostRpcService.js'; +import { ExtHostWebviews } from '../../common/extHostWebview.js'; +import { ExtHostWebviewPanels } from '../../common/extHostWebviewPanels.js'; +import { SingleProxyRPCProtocol } from '../common/testRPCProtocol.js'; +import { decodeAuthority, webviewResourceBaseHost } from '../../../contrib/webview/common/webview.js'; +import { EditorGroupColumn } from '../../../services/editor/common/editorGroupColumn.js'; +import { IExtHostContext } from '../../../services/extensions/common/extHostCustomers.js'; import type * as vscode from 'vscode'; suite('ExtHostWebview', () => { diff --git a/src/vs/workbench/api/test/browser/extHostWorkspace.test.ts b/src/vs/workbench/api/test/browser/extHostWorkspace.test.ts index 5b9dd312c74..0c019f59b2c 100644 --- a/src/vs/workbench/api/test/browser/extHostWorkspace.test.ts +++ b/src/vs/workbench/api/test/browser/extHostWorkspace.test.ts @@ -4,28 +4,29 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { basename } from 'vs/base/common/path'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { IWorkspaceFolderData } from 'vs/platform/workspace/common/workspace'; -import { MainThreadWorkspace } from 'vs/workbench/api/browser/mainThreadWorkspace'; -import { IMainContext, IWorkspaceData, MainContext, ITextSearchComplete } from 'vs/workbench/api/common/extHost.protocol'; -import { RelativePattern } from 'vs/workbench/api/common/extHostTypes'; -import { ExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; -import { mock } from 'vs/base/test/common/mock'; -import { TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { ExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IFileQueryBuilderOptions, ITextQueryBuilderOptions } from 'vs/workbench/services/search/common/queryBuilder'; -import { IPatternInfo } from 'vs/workbench/services/search/common/search'; -import { isLinux, isWindows } from 'vs/base/common/platform'; -import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; -import { FileSystemProviderCapabilities } from 'vs/platform/files/common/files'; -import { nullExtensionDescription as extensionDescriptor } from 'vs/workbench/services/extensions/common/extensions'; -import { IURITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { basename } from '../../../../base/common/path.js'; +import { URI, UriComponents } from '../../../../base/common/uri.js'; +import { ExtensionIdentifier } from '../../../../platform/extensions/common/extensions.js'; +import { ILogService, NullLogService } from '../../../../platform/log/common/log.js'; +import { IWorkspaceFolderData } from '../../../../platform/workspace/common/workspace.js'; +import { MainThreadWorkspace } from '../../browser/mainThreadWorkspace.js'; +import { IMainContext, IWorkspaceData, MainContext, ITextSearchComplete } from '../../common/extHost.protocol.js'; +import { RelativePattern } from '../../common/extHostTypes.js'; +import { ExtHostWorkspace } from '../../common/extHostWorkspace.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { ExtHostRpcService } from '../../common/extHostRpcService.js'; +import { IExtHostInitDataService } from '../../common/extHostInitDataService.js'; +import { IFileQueryBuilderOptions, ITextQueryBuilderOptions } from '../../../services/search/common/queryBuilder.js'; +import { IPatternInfo } from '../../../services/search/common/search.js'; +import { isLinux, isWindows } from '../../../../base/common/platform.js'; +import { IExtHostFileSystemInfo } from '../../common/extHostFileSystemInfo.js'; +import { FileSystemProviderCapabilities } from '../../../../platform/files/common/files.js'; +import { nullExtensionDescription as extensionDescriptor } from '../../../services/extensions/common/extensions.js'; +import { IURITransformerService } from '../../common/extHostUriTransformerService.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ExcludeSettingOptions } from '../../../services/search/common/searchExtTypes.js'; function createExtHostWorkspace(mainContext: IMainContext, data: IWorkspaceData, logService: ILogService): ExtHostWorkspace { const result = new ExtHostWorkspace( @@ -577,377 +578,658 @@ suite('ExtHostWorkspace', function () { return { uri, name }; } - test('findFiles - string include', () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(options.includePattern, 'foo'); - assert.strictEqual(_includeFolder, null); - assert.strictEqual(options.excludePattern, ''); - assert.strictEqual(options.disregardExcludeSettings, false); - assert.strictEqual(options.maxResults, 10); - return Promise.resolve(null); - } + suite('findFiles -', function () { + test('string include', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.includePattern, 'foo'); + assert.strictEqual(_includeFolder, null); + assert.strictEqual(options.excludePattern, undefined); + assert.strictEqual(options.disregardExcludeSettings, false); + assert.strictEqual(options.maxResults, 10); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles('foo', undefined, 10, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - return ws.findFiles('foo', undefined, 10, new ExtensionIdentifier('test')).then(() => { - assert(mainThreadCalled, 'mainThreadCalled'); + function testFindFilesInclude(pattern: RelativePattern) { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.includePattern, 'glob/**'); + assert.deepStrictEqual(_includeFolder ? URI.from(_includeFolder).toJSON() : null, URI.file('/other/folder').toJSON()); + assert.strictEqual(options.excludePattern, undefined); + assert.strictEqual(options.disregardExcludeSettings, false); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles(pattern, undefined, 10, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); + } + + test('RelativePattern include (string)', () => { + return testFindFilesInclude(new RelativePattern('/other/folder', 'glob/**')); }); - }); - function testFindFilesInclude(pattern: RelativePattern) { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(options.includePattern, 'glob/**'); - assert.deepStrictEqual(_includeFolder ? URI.from(_includeFolder).toJSON() : null, URI.file('/other/folder').toJSON()); - assert.strictEqual(options.excludePattern, ''); - assert.strictEqual(options.disregardExcludeSettings, false); - return Promise.resolve(null); - } + test('RelativePattern include (URI)', () => { + return testFindFilesInclude(new RelativePattern(URI.file('/other/folder'), 'glob/**')); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - return ws.findFiles(pattern, undefined, 10, new ExtensionIdentifier('test')).then(() => { - assert(mainThreadCalled, 'mainThreadCalled'); + test('no excludes', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.includePattern, 'glob/**'); + assert.deepStrictEqual(URI.revive(_includeFolder!).toString(), URI.file('/other/folder').toString()); + assert.strictEqual(options.excludePattern, undefined); + assert.strictEqual(options.disregardExcludeSettings, true); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles(new RelativePattern('/other/folder', 'glob/**'), null, 10, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); }); - } - test('findFiles - RelativePattern include (string)', () => { - return testFindFilesInclude(new RelativePattern('/other/folder', 'glob/**')); - }); + test('with cancelled token', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); - test('findFiles - RelativePattern include (URI)', () => { - return testFindFilesInclude(new RelativePattern(URI.file('/other/folder'), 'glob/**')); - }); + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + return Promise.resolve(null); + } + }); - test('findFiles - no excludes', () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(options.includePattern, 'glob/**'); - assert.deepStrictEqual(URI.revive(_includeFolder!).toString(), URI.file('/other/folder').toString()); - assert.strictEqual(options.excludePattern, ''); - assert.strictEqual(options.disregardExcludeSettings, true); - return Promise.resolve(null); - } + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + + const token = CancellationToken.Cancelled; + return ws.findFiles(new RelativePattern('/other/folder', 'glob/**'), null, 10, new ExtensionIdentifier('test'), token).then(() => { + assert(!mainThreadCalled, '!mainThreadCalled'); + }); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - return ws.findFiles(new RelativePattern('/other/folder', 'glob/**'), null, 10, new ExtensionIdentifier('test')).then(() => { - assert(mainThreadCalled, 'mainThreadCalled'); + test('RelativePattern exclude', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.disregardExcludeSettings, false); + assert.strictEqual(options.excludePattern?.length, 1); + assert.strictEqual(options.excludePattern[0].pattern, 'glob/**'); // Note that the base portion is ignored, see #52651 + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles('', new RelativePattern(root, 'glob/**'), 10, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); }); }); - test('findFiles - with cancelled token', () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - return Promise.resolve(null); - } + suite('findFiles2 -', function () { + test('string include', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.filePattern, 'foo'); + assert.strictEqual(options.includePattern, undefined); + assert.strictEqual(_includeFolder, null); + assert.strictEqual(options.excludePattern, undefined); + assert.strictEqual(options.disregardExcludeSettings, false); + assert.strictEqual(options.maxResults, 10); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2('foo', { maxResults: 10, useDefaultExcludes: true }, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + function testFindFiles2Include(pattern: RelativePattern) { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.filePattern, 'glob/**'); + assert.strictEqual(options.includePattern, undefined); + assert.deepStrictEqual(_includeFolder ? URI.from(_includeFolder).toJSON() : null, URI.file('/other/folder').toJSON()); + assert.strictEqual(options.excludePattern, undefined); + assert.strictEqual(options.disregardExcludeSettings, false); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2(pattern, { maxResults: 10 }, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); + } - const token = CancellationToken.Cancelled; - return ws.findFiles(new RelativePattern('/other/folder', 'glob/**'), null, 10, new ExtensionIdentifier('test'), token).then(() => { - assert(!mainThreadCalled, '!mainThreadCalled'); + test('RelativePattern include (string)', () => { + return testFindFiles2Include(new RelativePattern('/other/folder', 'glob/**')); }); - }); - test('findFiles - RelativePattern exclude', () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(options.disregardExcludeSettings, false); - assert.strictEqual(options.excludePattern, 'glob/**'); // Note that the base portion is ignored, see #52651 - return Promise.resolve(null); - } + test('RelativePattern include (URI)', () => { + return testFindFiles2Include(new RelativePattern(URI.file('/other/folder'), 'glob/**')); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - return ws.findFiles('', new RelativePattern(root, 'glob/**'), 10, new ExtensionIdentifier('test')).then(() => { - assert(mainThreadCalled, 'mainThreadCalled'); + test('no excludes', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.filePattern, 'glob/**'); + assert.strictEqual(options.includePattern, undefined); + assert.deepStrictEqual(URI.revive(_includeFolder!).toString(), URI.file('/other/folder').toString()); + assert.strictEqual(options.excludePattern, undefined); + assert.strictEqual(options.disregardExcludeSettings, false); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2(new RelativePattern('/other/folder', 'glob/**'), {}, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); }); - }); - test('findFiles2 - string include', () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(options.filePattern, 'foo'); - assert.strictEqual(options.includePattern, undefined); - assert.strictEqual(_includeFolder, null); - assert.strictEqual(options.excludePattern, undefined); - assert.strictEqual(options.disregardExcludeSettings, false); - assert.strictEqual(options.maxResults, 10); - return Promise.resolve(null); - } + + test('with cancelled token', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + + const token = CancellationToken.Cancelled; + return ws.findFiles2(new RelativePattern('/other/folder', 'glob/**'), {}, new ExtensionIdentifier('test'), token).then(() => { + assert(!mainThreadCalled, '!mainThreadCalled'); + }); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - return ws.findFiles2('foo', { maxResults: 10, useDefaultExcludes: true }, new ExtensionIdentifier('test')).then(() => { - assert(mainThreadCalled, 'mainThreadCalled'); + test('RelativePattern exclude', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.disregardExcludeSettings, false); + assert.strictEqual(options.excludePattern?.length, 1); + assert.strictEqual(options.excludePattern[0].pattern, 'glob/**'); // Note that the base portion is ignored, see #52651 + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2('', { exclude: new RelativePattern(root, 'glob/**') }, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); + }); + test('useIgnoreFiles', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.disregardExcludeSettings, false); + assert.strictEqual(options.disregardIgnoreFiles, false); + assert.strictEqual(options.disregardGlobalIgnoreFiles, false); + assert.strictEqual(options.disregardParentIgnoreFiles, false); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2('', { useIgnoreFiles: true, useParentIgnoreFiles: true, useGlobalIgnoreFiles: true }, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); }); - }); - function testFindFiles2Include(pattern: RelativePattern) { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(options.filePattern, 'glob/**'); - assert.strictEqual(options.includePattern, undefined); - assert.deepStrictEqual(_includeFolder ? URI.from(_includeFolder).toJSON() : null, URI.file('/other/folder').toJSON()); - assert.strictEqual(options.excludePattern, undefined); - assert.strictEqual(options.disregardExcludeSettings, false); - return Promise.resolve(null); - } + test('use symlinks', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.ignoreSymlinks, false); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2('', { followSymlinks: true }, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); }); + }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - return ws.findFiles2(pattern, { maxResults: 10 }, new ExtensionIdentifier('test')).then(() => { - assert(mainThreadCalled, 'mainThreadCalled'); + suite('findFiles2New -', function () { + test('string include', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.filePattern, 'foo'); + assert.strictEqual(options.includePattern, undefined); + assert.strictEqual(_includeFolder, null); + assert.strictEqual(options.excludePattern, undefined); + assert.strictEqual(options.disregardExcludeSettings, false); + assert.strictEqual(options.maxResults, 10); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2New(['foo'], { maxResults: 10, useExcludeSettings: ExcludeSettingOptions.FilesExclude }, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); }); - } - test('findFiles2 - RelativePattern include (string)', () => { - return testFindFiles2Include(new RelativePattern('/other/folder', 'glob/**')); - }); + function testFindFiles2NewInclude(pattern: RelativePattern[]) { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.filePattern, 'glob/**'); + assert.strictEqual(options.includePattern, undefined); + assert.deepStrictEqual(_includeFolder ? URI.from(_includeFolder).toJSON() : null, URI.file('/other/folder').toJSON()); + assert.strictEqual(options.excludePattern, undefined); + assert.strictEqual(options.disregardExcludeSettings, false); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2New(pattern, { maxResults: 10 }, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); + } - test('findFiles2 - RelativePattern include (URI)', () => { - return testFindFiles2Include(new RelativePattern(URI.file('/other/folder'), 'glob/**')); - }); + test('RelativePattern include (string)', () => { + return testFindFiles2NewInclude([new RelativePattern('/other/folder', 'glob/**')]); + }); - test('findFiles2 - no excludes', () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(options.filePattern, 'glob/**'); - assert.strictEqual(options.includePattern, undefined); - assert.deepStrictEqual(URI.revive(_includeFolder!).toString(), URI.file('/other/folder').toString()); - assert.strictEqual(options.excludePattern, undefined); - assert.strictEqual(options.disregardExcludeSettings, false); - return Promise.resolve(null); - } + test('RelativePattern include (URI)', () => { + return testFindFiles2NewInclude([new RelativePattern(URI.file('/other/folder'), 'glob/**')]); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - return ws.findFiles2(new RelativePattern('/other/folder', 'glob/**'), {}, new ExtensionIdentifier('test')).then(() => { - assert(mainThreadCalled, 'mainThreadCalled'); + test('no excludes', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.filePattern, 'glob/**'); + assert.strictEqual(options.includePattern, undefined); + assert.deepStrictEqual(URI.revive(_includeFolder!).toString(), URI.file('/other/folder').toString()); + assert.strictEqual(options.excludePattern, undefined); + assert.strictEqual(options.disregardExcludeSettings, false); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2New([new RelativePattern('/other/folder', 'glob/**')], {}, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); }); - }); - test('findFiles2 - with cancelled token', () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); + test('with cancelled token', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - return Promise.resolve(null); - } - }); + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + return Promise.resolve(null); + } + }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - const token = CancellationToken.Cancelled; - return ws.findFiles2(new RelativePattern('/other/folder', 'glob/**'), {}, new ExtensionIdentifier('test'), token).then(() => { - assert(!mainThreadCalled, '!mainThreadCalled'); + const token = CancellationToken.Cancelled; + return ws.findFiles2New([new RelativePattern('/other/folder', 'glob/**')], {}, new ExtensionIdentifier('test'), token).then(() => { + assert(!mainThreadCalled, '!mainThreadCalled'); + }); }); - }); - test('findFiles2 - RelativePattern exclude', () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(options.disregardExcludeSettings, false); - assert.strictEqual(options.excludePattern, 'glob/**'); // Note that the base portion is ignored, see #52651 - return Promise.resolve(null); - } + test('RelativePattern exclude', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.disregardExcludeSettings, false); + assert.strictEqual(options.excludePattern?.length, 1); + assert.strictEqual(options.excludePattern[0].pattern, 'glob/**'); // Note that the base portion is ignored, see #52651 + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2New([''], { exclude: [new RelativePattern(root, 'glob/**')] }, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); + }); + test('useIgnoreFiles', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.disregardExcludeSettings, false); + assert.strictEqual(options.disregardIgnoreFiles, false); + assert.strictEqual(options.disregardGlobalIgnoreFiles, false); + assert.strictEqual(options.disregardParentIgnoreFiles, false); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2New([''], { useIgnoreFiles: { local: true, parent: true, global: true } }, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - return ws.findFiles2('', { exclude: new RelativePattern(root, 'glob/**') }, new ExtensionIdentifier('test')).then(() => { - assert(mainThreadCalled, 'mainThreadCalled'); + test('use symlinks', () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(options.ignoreSymlinks, false); + return Promise.resolve(null); + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + return ws.findFiles2New([''], { followSymlinks: true }, new ExtensionIdentifier('test')).then(() => { + assert(mainThreadCalled, 'mainThreadCalled'); + }); }); + + // todo: add tests with multiple filePatterns and excludes + }); - test('findFiles2 - useIgnoreFiles', () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(options.disregardExcludeSettings, false); - assert.strictEqual(options.disregardIgnoreFiles, false); - assert.strictEqual(options.disregardGlobalIgnoreFiles, false); - assert.strictEqual(options.disregardParentIgnoreFiles, false); - return Promise.resolve(null); - } - }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - return ws.findFiles2('', { useIgnoreFiles: true, useParentIgnoreFiles: true, useGlobalIgnoreFiles: true }, new ExtensionIdentifier('test')).then(() => { + suite('findTextInFiles -', function () { + test('no include', async () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(query.pattern, 'foo'); + assert.strictEqual(folder, null); + assert.strictEqual(options.includePattern, undefined); + assert.strictEqual(options.excludePattern, undefined); + return null; + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + await ws.findTextInFiles({ pattern: 'foo' }, {}, () => { }, new ExtensionIdentifier('test')); assert(mainThreadCalled, 'mainThreadCalled'); }); - }); - - test('findFiles2 - use symlinks', () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override $startFileSearch(_includeFolder: UriComponents | null, options: IFileQueryBuilderOptions, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(options.ignoreSymlinks, false); - return Promise.resolve(null); - } + test('string include', async () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(query.pattern, 'foo'); + assert.strictEqual(folder, null); + assert.strictEqual(options.includePattern, '**/files'); + assert.strictEqual(options.excludePattern, undefined); + return null; + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + await ws.findTextInFiles({ pattern: 'foo' }, { include: '**/files' }, () => { }, new ExtensionIdentifier('test')); + assert(mainThreadCalled, 'mainThreadCalled'); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - return ws.findFiles2('', { followSymlinks: true }, new ExtensionIdentifier('test')).then(() => { + test('RelativePattern include', async () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(query.pattern, 'foo'); + assert.deepStrictEqual(URI.revive(folder!).toString(), URI.file('/other/folder').toString()); + assert.strictEqual(options.includePattern, 'glob/**'); + assert.strictEqual(options.excludePattern, undefined); + return null; + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + await ws.findTextInFiles({ pattern: 'foo' }, { include: new RelativePattern('/other/folder', 'glob/**') }, () => { }, new ExtensionIdentifier('test')); assert(mainThreadCalled, 'mainThreadCalled'); }); - }); - test('findTextInFiles - no include', async () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(query.pattern, 'foo'); - assert.strictEqual(folder, null); - assert.strictEqual(options.includePattern, undefined); - assert.strictEqual(options.excludePattern, undefined); - return null; - } + test('with cancelled token', async () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { + mainThreadCalled = true; + return null; + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + const token = CancellationToken.Cancelled; + await ws.findTextInFiles({ pattern: 'foo' }, {}, () => { }, new ExtensionIdentifier('test'), token); + assert(!mainThreadCalled, '!mainThreadCalled'); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - await ws.findTextInFiles({ pattern: 'foo' }, {}, () => { }, new ExtensionIdentifier('test')); - assert(mainThreadCalled, 'mainThreadCalled'); - }); - - test('findTextInFiles - string include', async () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(query.pattern, 'foo'); - assert.strictEqual(folder, null); - assert.strictEqual(options.includePattern, '**/files'); - assert.strictEqual(options.excludePattern, undefined); - return null; - } + test('RelativePattern exclude', async () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(query.pattern, 'foo'); + assert.deepStrictEqual(folder, null); + assert.strictEqual(options.includePattern, undefined); + assert.strictEqual(options.excludePattern?.length, 1); + assert.strictEqual(options.excludePattern[0].pattern, 'glob/**'); // exclude folder is ignored... + return null; + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + await ws.findTextInFiles({ pattern: 'foo' }, { exclude: new RelativePattern('/other/folder', 'glob/**') }, () => { }, new ExtensionIdentifier('test')); + assert(mainThreadCalled, 'mainThreadCalled'); }); - - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - await ws.findTextInFiles({ pattern: 'foo' }, { include: '**/files' }, () => { }, new ExtensionIdentifier('test')); - assert(mainThreadCalled, 'mainThreadCalled'); }); - test('findTextInFiles - RelativePattern include', async () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(query.pattern, 'foo'); - assert.deepStrictEqual(URI.revive(folder!).toString(), URI.file('/other/folder').toString()); - assert.strictEqual(options.includePattern, 'glob/**'); - assert.strictEqual(options.excludePattern, undefined); - return null; - } + suite('findTextInFilesNew -', function () { + test('no include', async () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(query.pattern, 'foo'); + assert.strictEqual(folder, null); + assert.strictEqual(options.includePattern, undefined); + assert.strictEqual(options.excludePattern, undefined); + return null; + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + await (ws.findTextInFilesNew({ pattern: 'foo' }, {}, new ExtensionIdentifier('test'))).complete; + assert(mainThreadCalled, 'mainThreadCalled'); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - await ws.findTextInFiles({ pattern: 'foo' }, { include: new RelativePattern('/other/folder', 'glob/**') }, () => { }, new ExtensionIdentifier('test')); - assert(mainThreadCalled, 'mainThreadCalled'); - }); - - test('findTextInFiles - with cancelled token', async () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); + test('string include', async () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(query.pattern, 'foo'); + assert.strictEqual(folder, null); + assert.strictEqual(options.includePattern, '**/files'); + assert.strictEqual(options.excludePattern, undefined); + return null; + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + await (ws.findTextInFilesNew({ pattern: 'foo' }, { include: ['**/files'] }, new ExtensionIdentifier('test'))).complete; + assert(mainThreadCalled, 'mainThreadCalled'); + }); - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { - mainThreadCalled = true; - return null; - } + test('RelativePattern include', async () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(query.pattern, 'foo'); + assert.deepStrictEqual(URI.revive(folder!).toString(), URI.file('/other/folder').toString()); + assert.strictEqual(options.includePattern, 'glob/**'); + assert.strictEqual(options.excludePattern, undefined); + return null; + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + await (ws.findTextInFilesNew({ pattern: 'foo' }, { include: [new RelativePattern('/other/folder', 'glob/**')] }, new ExtensionIdentifier('test'))).complete; + assert(mainThreadCalled, 'mainThreadCalled'); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - const token = CancellationToken.Cancelled; - await ws.findTextInFiles({ pattern: 'foo' }, {}, () => { }, new ExtensionIdentifier('test'), token); - assert(!mainThreadCalled, '!mainThreadCalled'); - }); + test('with cancelled token', async () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { + mainThreadCalled = true; + return null; + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + const token = CancellationToken.Cancelled; + await (ws.findTextInFilesNew({ pattern: 'foo' }, undefined, new ExtensionIdentifier('test'), token)).complete; + assert(!mainThreadCalled, '!mainThreadCalled'); + }); - test('findTextInFiles - RelativePattern exclude', async () => { - const root = '/project/foo'; - const rpcProtocol = new TestRPCProtocol(); - - let mainThreadCalled = false; - rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { - override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { - mainThreadCalled = true; - assert.strictEqual(query.pattern, 'foo'); - assert.deepStrictEqual(folder, null); - assert.strictEqual(options.includePattern, undefined); - assert.strictEqual(options.excludePattern, 'glob/**'); // exclude folder is ignored... - return null; - } + test('RelativePattern exclude', async () => { + const root = '/project/foo'; + const rpcProtocol = new TestRPCProtocol(); + + let mainThreadCalled = false; + rpcProtocol.set(MainContext.MainThreadWorkspace, new class extends mock() { + override async $startTextSearch(query: IPatternInfo, folder: UriComponents | null, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise { + mainThreadCalled = true; + assert.strictEqual(query.pattern, 'foo'); + assert.deepStrictEqual(folder, null); + assert.strictEqual(options.includePattern, undefined); + assert.strictEqual(options.excludePattern?.length, 1); + assert.strictEqual(options.excludePattern[0].pattern, 'glob/**'); // exclude folder is ignored... + return null; + } + }); + + const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); + await (ws.findTextInFilesNew({ pattern: 'foo' }, { exclude: [new RelativePattern('/other/folder', 'glob/**')] }, new ExtensionIdentifier('test'))).complete; + assert(mainThreadCalled, 'mainThreadCalled'); }); - const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService()); - await ws.findTextInFiles({ pattern: 'foo' }, { exclude: new RelativePattern('/other/folder', 'glob/**') }, () => { }, new ExtensionIdentifier('test')); - assert(mainThreadCalled, 'mainThreadCalled'); + // TODO: test multiple includes/excludess }); }); diff --git a/src/vs/workbench/api/test/browser/mainThreadBulkEdits.test.ts b/src/vs/workbench/api/test/browser/mainThreadBulkEdits.test.ts index c6ef6939bfe..9ee4d3316ee 100644 --- a/src/vs/workbench/api/test/browser/mainThreadBulkEdits.test.ts +++ b/src/vs/workbench/api/test/browser/mainThreadBulkEdits.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { IWorkspaceTextEditDto } from 'vs/workbench/api/common/extHost.protocol'; -import { mock } from 'vs/base/test/common/mock'; -import { Event } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { FileSystemProviderCapabilities, IFileService } from 'vs/platform/files/common/files'; -import { reviveWorkspaceEditDto } from 'vs/workbench/api/browser/mainThreadBulkEdits'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { IWorkspaceTextEdit } from 'vs/editor/common/languages'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { IWorkspaceTextEditDto } from '../../common/extHost.protocol.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { Event } from '../../../../base/common/event.js'; +import { URI } from '../../../../base/common/uri.js'; +import { FileSystemProviderCapabilities, IFileService } from '../../../../platform/files/common/files.js'; +import { reviveWorkspaceEditDto } from '../../browser/mainThreadBulkEdits.js'; +import { UriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentityService.js'; +import { IWorkspaceTextEdit } from '../../../../editor/common/languages.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('MainThreadBulkEdits', function () { diff --git a/src/vs/workbench/api/test/browser/mainThreadCommands.test.ts b/src/vs/workbench/api/test/browser/mainThreadCommands.test.ts index d7503ca0d50..78cabfcf801 100644 --- a/src/vs/workbench/api/test/browser/mainThreadCommands.test.ts +++ b/src/vs/workbench/api/test/browser/mainThreadCommands.test.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { MainThreadCommands } from 'vs/workbench/api/browser/mainThreadCommands'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { SingleProxyRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { MainThreadCommands } from '../../browser/mainThreadCommands.js'; +import { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js'; +import { SingleProxyRPCProtocol } from '../common/testRPCProtocol.js'; +import { IExtensionService } from '../../../services/extensions/common/extensions.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('MainThreadCommands', function () { diff --git a/src/vs/workbench/api/test/browser/mainThreadConfiguration.test.ts b/src/vs/workbench/api/test/browser/mainThreadConfiguration.test.ts index 0c5a02f6606..a616447bbcc 100644 --- a/src/vs/workbench/api/test/browser/mainThreadConfiguration.test.ts +++ b/src/vs/workbench/api/test/browser/mainThreadConfiguration.test.ts @@ -5,16 +5,16 @@ import assert from 'assert'; import * as sinon from 'sinon'; -import { URI } from 'vs/base/common/uri'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { Extensions, IConfigurationRegistry, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; -import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { MainThreadConfiguration } from 'vs/workbench/api/browser/mainThreadConfiguration'; -import { SingleProxyRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; -import { WorkspaceService } from 'vs/workbench/services/configuration/browser/configurationService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { URI } from '../../../../base/common/uri.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { Extensions, IConfigurationRegistry, ConfigurationScope } from '../../../../platform/configuration/common/configurationRegistry.js'; +import { IWorkspaceContextService, WorkbenchState } from '../../../../platform/workspace/common/workspace.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { MainThreadConfiguration } from '../../browser/mainThreadConfiguration.js'; +import { SingleProxyRPCProtocol } from '../common/testRPCProtocol.js'; +import { IConfigurationService, ConfigurationTarget } from '../../../../platform/configuration/common/configuration.js'; +import { WorkspaceService } from '../../../services/configuration/browser/configurationService.js'; +import { IEnvironmentService } from '../../../../platform/environment/common/environment.js'; suite('MainThreadConfiguration', function () { diff --git a/src/vs/workbench/api/test/browser/mainThreadDiagnostics.test.ts b/src/vs/workbench/api/test/browser/mainThreadDiagnostics.test.ts index 2f89e98e358..9a7e458b41f 100644 --- a/src/vs/workbench/api/test/browser/mainThreadDiagnostics.test.ts +++ b/src/vs/workbench/api/test/browser/mainThreadDiagnostics.test.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { timeout } from 'vs/base/common/async'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { MarkerService } from 'vs/platform/markers/common/markerService'; -import { IMarkerData } from 'vs/platform/markers/common/markers'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { MainThreadDiagnostics } from 'vs/workbench/api/browser/mainThreadDiagnostics'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtensionHostKind } from 'vs/workbench/services/extensions/common/extensionHostKind'; -import { mock } from 'vs/workbench/test/common/workbenchTestServices'; +import { timeout } from '../../../../base/common/async.js'; +import { URI, UriComponents } from '../../../../base/common/uri.js'; +import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { MarkerService } from '../../../../platform/markers/common/markerService.js'; +import { IMarkerData } from '../../../../platform/markers/common/markers.js'; +import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js'; +import { MainThreadDiagnostics } from '../../browser/mainThreadDiagnostics.js'; +import { IExtHostContext } from '../../../services/extensions/common/extHostCustomers.js'; +import { ExtensionHostKind } from '../../../services/extensions/common/extensionHostKind.js'; +import { mock } from '../../../test/common/workbenchTestServices.js'; suite('MainThreadDiagnostics', function () { diff --git a/src/vs/workbench/api/test/browser/mainThreadDocumentContentProviders.test.ts b/src/vs/workbench/api/test/browser/mainThreadDocumentContentProviders.test.ts index 949c2a78ffa..c999d333938 100644 --- a/src/vs/workbench/api/test/browser/mainThreadDocumentContentProviders.test.ts +++ b/src/vs/workbench/api/test/browser/mainThreadDocumentContentProviders.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { URI } from 'vs/base/common/uri'; -import { MainThreadDocumentContentProviders } from 'vs/workbench/api/browser/mainThreadDocumentContentProviders'; -import { createTextModel } from 'vs/editor/test/common/testTextModel'; -import { mock } from 'vs/base/test/common/mock'; -import { IModelService } from 'vs/editor/common/services/model'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { TextEdit } from 'vs/editor/common/languages'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { URI } from '../../../../base/common/uri.js'; +import { MainThreadDocumentContentProviders } from '../../browser/mainThreadDocumentContentProviders.js'; +import { createTextModel } from '../../../../editor/test/common/testTextModel.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { IModelService } from '../../../../editor/common/services/model.js'; +import { IEditorWorkerService } from '../../../../editor/common/services/editorWorker.js'; +import { TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { TextEdit } from '../../../../editor/common/languages.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('MainThreadDocumentContentProviders', function () { diff --git a/src/vs/workbench/api/test/browser/mainThreadDocuments.test.ts b/src/vs/workbench/api/test/browser/mainThreadDocuments.test.ts index fee65f21119..d9d8a76fb52 100644 --- a/src/vs/workbench/api/test/browser/mainThreadDocuments.test.ts +++ b/src/vs/workbench/api/test/browser/mainThreadDocuments.test.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { BoundModelReferenceCollection } from 'vs/workbench/api/browser/mainThreadDocuments'; -import { timeout } from 'vs/base/common/async'; -import { URI } from 'vs/base/common/uri'; -import { extUri } from 'vs/base/common/resources'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { BoundModelReferenceCollection } from '../../browser/mainThreadDocuments.js'; +import { timeout } from '../../../../base/common/async.js'; +import { URI } from '../../../../base/common/uri.js'; +import { extUri } from '../../../../base/common/resources.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; suite('BoundModelReferenceCollection', function () { diff --git a/src/vs/workbench/api/test/browser/mainThreadDocumentsAndEditors.test.ts b/src/vs/workbench/api/test/browser/mainThreadDocumentsAndEditors.test.ts index f0d0538ce22..08a5f0682c6 100644 --- a/src/vs/workbench/api/test/browser/mainThreadDocumentsAndEditors.test.ts +++ b/src/vs/workbench/api/test/browser/mainThreadDocumentsAndEditors.test.ts @@ -4,34 +4,38 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { MainThreadDocumentsAndEditors } from 'vs/workbench/api/browser/mainThreadDocumentsAndEditors'; -import { SingleProxyRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { ModelService } from 'vs/editor/common/services/modelService'; -import { TestCodeEditorService } from 'vs/editor/test/browser/editorTestServices'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { ExtHostDocumentsAndEditorsShape, IDocumentsAndEditorsDelta } from 'vs/workbench/api/common/extHost.protocol'; -import { createTestCodeEditor, ITestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; -import { mock } from 'vs/base/test/common/mock'; -import { TestEditorService, TestEditorGroupsService, TestEnvironmentService, TestPathService } from 'vs/workbench/test/browser/workbenchTestServices'; -import { Event } from 'vs/base/common/event'; -import { ITextModel } from 'vs/editor/common/model'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; -import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService'; -import { TestDialogService } from 'vs/platform/dialogs/test/common/testDialogService'; -import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; -import { TestTextResourcePropertiesService, TestWorkingCopyFileService } from 'vs/workbench/test/common/workbenchTestServices'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { TextModel } from 'vs/editor/common/model/textModel'; -import { LanguageService } from 'vs/editor/common/services/languageService'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; +import { MainThreadDocumentsAndEditors } from '../../browser/mainThreadDocumentsAndEditors.js'; +import { SingleProxyRPCProtocol } from '../common/testRPCProtocol.js'; +import { TestConfigurationService } from '../../../../platform/configuration/test/common/testConfigurationService.js'; +import { ModelService } from '../../../../editor/common/services/modelService.js'; +import { TestCodeEditorService } from '../../../../editor/test/browser/editorTestServices.js'; +import { ITextFileService } from '../../../services/textfile/common/textfiles.js'; +import { ExtHostDocumentsAndEditorsShape, IDocumentsAndEditorsDelta } from '../../common/extHost.protocol.js'; +import { createTestCodeEditor, ITestCodeEditor } from '../../../../editor/test/browser/testCodeEditor.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { TestEditorService, TestEditorGroupsService, TestEnvironmentService, TestPathService } from '../../../test/browser/workbenchTestServices.js'; +import { Event } from '../../../../base/common/event.js'; +import { ITextModel } from '../../../../editor/common/model.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js'; +import { IFileService } from '../../../../platform/files/common/files.js'; +import { TestThemeService } from '../../../../platform/theme/test/common/testThemeService.js'; +import { UndoRedoService } from '../../../../platform/undoRedo/common/undoRedoService.js'; +import { TestDialogService } from '../../../../platform/dialogs/test/common/testDialogService.js'; +import { TestNotificationService } from '../../../../platform/notification/test/common/testNotificationService.js'; +import { TestTextResourcePropertiesService, TestWorkingCopyFileService } from '../../../test/common/workbenchTestServices.js'; +import { UriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentityService.js'; +import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js'; +import { IPaneCompositePartService } from '../../../services/panecomposite/browser/panecomposite.js'; +import { TextModel } from '../../../../editor/common/model/textModel.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { ILanguageService } from '../../../../editor/common/languages/language.js'; +import { LanguageService } from '../../../../editor/common/services/languageService.js'; +import { ILanguageConfigurationService } from '../../../../editor/common/languages/languageConfigurationRegistry.js'; +import { TestLanguageConfigurationService } from '../../../../editor/test/common/modes/testLanguageConfigurationService.js'; +import { IUndoRedoService } from '../../../../platform/undoRedo/common/undoRedo.js'; suite('MainThreadDocumentsAndEditors', () => { @@ -61,12 +65,15 @@ suite('MainThreadDocumentsAndEditors', () => { const notificationService = new TestNotificationService(); const undoRedoService = new UndoRedoService(dialogService, notificationService); const themeService = new TestThemeService(); + const instantiationService = new TestInstantiationService(); + instantiationService.set(ILanguageService, disposables.add(new LanguageService())); + instantiationService.set(ILanguageConfigurationService, new TestLanguageConfigurationService()); + instantiationService.set(IUndoRedoService, undoRedoService); modelService = new ModelService( configService, new TestTextResourcePropertiesService(configService), undoRedoService, - disposables.add(new LanguageService()), - new TestLanguageConfigurationService(), + instantiationService ); codeEditorService = new TestCodeEditorService(themeService); textFileService = new class extends mock() { diff --git a/src/vs/workbench/api/test/browser/mainThreadEditors.test.ts b/src/vs/workbench/api/test/browser/mainThreadEditors.test.ts index 1ca165c1b5f..552b0df1f32 100644 --- a/src/vs/workbench/api/test/browser/mainThreadEditors.test.ts +++ b/src/vs/workbench/api/test/browser/mainThreadEditors.test.ts @@ -4,59 +4,61 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { Event } from 'vs/base/common/event'; -import { DisposableStore, IReference, ImmortalReference } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { EditOperation } from 'vs/editor/common/core/editOperation'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { ITextSnapshot } from 'vs/editor/common/model'; -import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker'; -import { LanguageService } from 'vs/editor/common/services/languageService'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ModelService } from 'vs/editor/common/services/modelService'; -import { IResolvedTextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService'; -import { TestCodeEditorService } from 'vs/editor/test/browser/editorTestServices'; -import { TestLanguageConfigurationService } from 'vs/editor/test/common/modes/testLanguageConfigurationService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { TestDialogService } from 'vs/platform/dialogs/test/common/testDialogService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IFileService } from 'vs/platform/files/common/files'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; -import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; -import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo'; -import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { MainThreadBulkEdits } from 'vs/workbench/api/browser/mainThreadBulkEdits'; -import { IWorkspaceTextEditDto } from 'vs/workbench/api/common/extHost.protocol'; -import { SingleProxyRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { BulkEditService } from 'vs/workbench/contrib/bulkEdit/browser/bulkEditService'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { LabelService } from 'vs/workbench/services/label/common/labelService'; -import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { ICopyOperation, ICreateFileOperation, ICreateOperation, IDeleteOperation, IMoveOperation, IWorkingCopyFileService } from 'vs/workbench/services/workingCopy/common/workingCopyFileService'; -import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; -import { TestEditorGroupsService, TestEditorService, TestEnvironmentService, TestFileService, TestLifecycleService, TestWorkingCopyService } from 'vs/workbench/test/browser/workbenchTestServices'; -import { TestContextService, TestTextResourcePropertiesService } from 'vs/workbench/test/common/workbenchTestServices'; +import { Event } from '../../../../base/common/event.js'; +import { DisposableStore, IReference, ImmortalReference } from '../../../../base/common/lifecycle.js'; +import { URI } from '../../../../base/common/uri.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IBulkEditService } from '../../../../editor/browser/services/bulkEditService.js'; +import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js'; +import { EditOperation } from '../../../../editor/common/core/editOperation.js'; +import { Position } from '../../../../editor/common/core/position.js'; +import { Range } from '../../../../editor/common/core/range.js'; +import { ITextSnapshot } from '../../../../editor/common/model.js'; +import { IEditorWorkerService } from '../../../../editor/common/services/editorWorker.js'; +import { IModelService } from '../../../../editor/common/services/model.js'; +import { ModelService } from '../../../../editor/common/services/modelService.js'; +import { IResolvedTextEditorModel, ITextModelService } from '../../../../editor/common/services/resolverService.js'; +import { TestCodeEditorService } from '../../../../editor/test/browser/editorTestServices.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { TestConfigurationService } from '../../../../platform/configuration/test/common/testConfigurationService.js'; +import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js'; +import { TestDialogService } from '../../../../platform/dialogs/test/common/testDialogService.js'; +import { IEnvironmentService } from '../../../../platform/environment/common/environment.js'; +import { IFileService } from '../../../../platform/files/common/files.js'; +import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js'; +import { InstantiationService } from '../../../../platform/instantiation/common/instantiationService.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { ILabelService } from '../../../../platform/label/common/label.js'; +import { ILogService, NullLogService } from '../../../../platform/log/common/log.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { TestNotificationService } from '../../../../platform/notification/test/common/testNotificationService.js'; +import { TestThemeService } from '../../../../platform/theme/test/common/testThemeService.js'; +import { IUndoRedoService } from '../../../../platform/undoRedo/common/undoRedo.js'; +import { UndoRedoService } from '../../../../platform/undoRedo/common/undoRedoService.js'; +import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js'; +import { UriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentityService.js'; +import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js'; +import { MainThreadBulkEdits } from '../../browser/mainThreadBulkEdits.js'; +import { IWorkspaceTextEditDto } from '../../common/extHost.protocol.js'; +import { SingleProxyRPCProtocol } from '../common/testRPCProtocol.js'; +import { BulkEditService } from '../../../contrib/bulkEdit/browser/bulkEditService.js'; +import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.js'; +import { SerializableObjectWithBuffers } from '../../../services/extensions/common/proxyIdentifier.js'; +import { LabelService } from '../../../services/label/common/labelService.js'; +import { ILifecycleService } from '../../../services/lifecycle/common/lifecycle.js'; +import { IPaneCompositePartService } from '../../../services/panecomposite/browser/panecomposite.js'; +import { ITextFileService } from '../../../services/textfile/common/textfiles.js'; +import { ICopyOperation, ICreateFileOperation, ICreateOperation, IDeleteOperation, IMoveOperation, IWorkingCopyFileService } from '../../../services/workingCopy/common/workingCopyFileService.js'; +import { IWorkingCopyService } from '../../../services/workingCopy/common/workingCopyService.js'; +import { TestEditorGroupsService, TestEditorService, TestEnvironmentService, TestFileService, TestLifecycleService, TestWorkingCopyService } from '../../../test/browser/workbenchTestServices.js'; +import { TestContextService, TestTextResourcePropertiesService } from '../../../test/common/workbenchTestServices.js'; +import { ILanguageService } from '../../../../editor/common/languages/language.js'; +import { LanguageService } from '../../../../editor/common/services/languageService.js'; +import { ILanguageConfigurationService } from '../../../../editor/common/languages/languageConfigurationRegistry.js'; +import { TestLanguageConfigurationService } from '../../../../editor/test/common/modes/testLanguageConfigurationService.js'; suite('MainThreadEditors', () => { @@ -80,19 +82,11 @@ suite('MainThreadEditors', () => { createdResources.clear(); deletedResources.clear(); - const configService = new TestConfigurationService(); const dialogService = new TestDialogService(); const notificationService = new TestNotificationService(); const undoRedoService = new UndoRedoService(dialogService, notificationService); const themeService = new TestThemeService(); - modelService = new ModelService( - configService, - new TestTextResourcePropertiesService(configService), - undoRedoService, - disposables.add(new LanguageService()), - new TestLanguageConfigurationService(), - ); const services = new ServiceCollection(); services.set(IBulkEditService, new SyncDescriptor(BulkEditService)); @@ -178,8 +172,18 @@ suite('MainThreadEditors', () => { } }); + services.set(ILanguageService, disposables.add(new LanguageService())); + services.set(ILanguageConfigurationService, new TestLanguageConfigurationService()); + const instaService = new InstantiationService(services); + modelService = new ModelService( + configService, + new TestTextResourcePropertiesService(configService), + undoRedoService, + instaService + ); + bulkEdits = instaService.createInstance(MainThreadBulkEdits, SingleProxyRPCProtocol(null)); }); diff --git a/src/vs/workbench/api/test/browser/mainThreadManagedSockets.test.ts b/src/vs/workbench/api/test/browser/mainThreadManagedSockets.test.ts index dd20e3cd70c..ddb4b947a5d 100644 --- a/src/vs/workbench/api/test/browser/mainThreadManagedSockets.test.ts +++ b/src/vs/workbench/api/test/browser/mainThreadManagedSockets.test.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { disposableTimeout, timeout } from 'vs/base/common/async'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Emitter } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { SocketCloseEvent } from 'vs/base/parts/ipc/common/ipc.net'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { RemoteSocketHalf } from 'vs/platform/remote/common/managedSocket'; -import { MainThreadManagedSocket } from 'vs/workbench/api/browser/mainThreadManagedSockets'; -import { ExtHostManagedSocketsShape } from 'vs/workbench/api/common/extHost.protocol'; +import { disposableTimeout, timeout } from '../../../../base/common/async.js'; +import { VSBuffer } from '../../../../base/common/buffer.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { SocketCloseEvent } from '../../../../base/parts/ipc/common/ipc.net.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { RemoteSocketHalf } from '../../../../platform/remote/common/managedSocket.js'; +import { MainThreadManagedSocket } from '../../browser/mainThreadManagedSockets.js'; +import { ExtHostManagedSocketsShape } from '../../common/extHost.protocol.js'; suite('MainThreadManagedSockets', () => { diff --git a/src/vs/workbench/api/test/browser/mainThreadTreeViews.test.ts b/src/vs/workbench/api/test/browser/mainThreadTreeViews.test.ts index f4ead1836b2..ee16dbe37d7 100644 --- a/src/vs/workbench/api/test/browser/mainThreadTreeViews.test.ts +++ b/src/vs/workbench/api/test/browser/mainThreadTreeViews.test.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; +import * as nls from '../../../../nls.js'; import assert from 'assert'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { MainThreadTreeViews } from 'vs/workbench/api/browser/mainThreadTreeViews'; -import { ExtHostTreeViewsShape } from 'vs/workbench/api/common/extHost.protocol'; -import { CustomTreeView } from 'vs/workbench/browser/parts/views/treeView'; -import { Extensions, ITreeItem, ITreeView, ITreeViewDescriptor, IViewContainersRegistry, IViewDescriptorService, IViewsRegistry, TreeItemCollapsibleState, ViewContainer, ViewContainerLocation } from 'vs/workbench/common/views'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtensionHostKind } from 'vs/workbench/services/extensions/common/extensionHostKind'; -import { ViewDescriptorService } from 'vs/workbench/services/views/browser/viewDescriptorService'; -import { TestViewsService, workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; -import { TestExtensionService } from 'vs/workbench/test/common/workbenchTestServices'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { TestNotificationService } from '../../../../platform/notification/test/common/testNotificationService.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { MainThreadTreeViews } from '../../browser/mainThreadTreeViews.js'; +import { ExtHostTreeViewsShape } from '../../common/extHost.protocol.js'; +import { CustomTreeView } from '../../../browser/parts/views/treeView.js'; +import { Extensions, ITreeItem, ITreeView, ITreeViewDescriptor, IViewContainersRegistry, IViewDescriptorService, IViewsRegistry, TreeItemCollapsibleState, ViewContainer, ViewContainerLocation } from '../../../common/views.js'; +import { IExtHostContext } from '../../../services/extensions/common/extHostCustomers.js'; +import { ExtensionHostKind } from '../../../services/extensions/common/extensionHostKind.js'; +import { ViewDescriptorService } from '../../../services/views/browser/viewDescriptorService.js'; +import { TestViewsService, workbenchInstantiationService } from '../../../test/browser/workbenchTestServices.js'; +import { TestExtensionService } from '../../../test/common/workbenchTestServices.js'; suite('MainThreadHostTreeView', function () { const testTreeViewId = 'testTreeView'; diff --git a/src/vs/workbench/api/test/browser/mainThreadWorkspace.test.ts b/src/vs/workbench/api/test/browser/mainThreadWorkspace.test.ts index c784f418950..2199a99d557 100644 --- a/src/vs/workbench/api/test/browser/mainThreadWorkspace.test.ts +++ b/src/vs/workbench/api/test/browser/mainThreadWorkspace.test.ts @@ -4,15 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { MainThreadWorkspace } from 'vs/workbench/api/browser/mainThreadWorkspace'; -import { SingleProxyRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { IFileQuery, ISearchService } from 'vs/workbench/services/search/common/search'; -import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { TestConfigurationService } from '../../../../platform/configuration/test/common/testConfigurationService.js'; +import { TestInstantiationService } from '../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { MainThreadWorkspace } from '../../browser/mainThreadWorkspace.js'; +import { SingleProxyRPCProtocol } from '../common/testRPCProtocol.js'; +import { IFileQuery, ISearchService } from '../../../services/search/common/search.js'; +import { workbenchInstantiationService } from '../../../test/browser/workbenchTestServices.js'; +import { URI, UriComponents } from '../../../../base/common/uri.js'; suite('MainThreadWorkspace', () => { const disposables = ensureNoDisposablesAreLeakedInTestSuite(); @@ -56,7 +57,8 @@ suite('MainThreadWorkspace', () => { fileSearch(query: IFileQuery) { assert.strictEqual(query.folderQueries.length, 1); assert.strictEqual(query.folderQueries[0].disregardIgnoreFiles, true); - assert.deepStrictEqual(query.folderQueries[0].excludePattern, { 'filesExclude': true }); + assert.strictEqual(query.folderQueries[0].excludePattern?.length, 1); + assert.deepStrictEqual(query.folderQueries[0].excludePattern[0].pattern, { 'filesExclude': true }); return Promise.resolve({ results: [], messages: [] }); } @@ -76,7 +78,7 @@ suite('MainThreadWorkspace', () => { instantiationService.stub(ISearchService, { fileSearch(query: IFileQuery) { - assert.deepStrictEqual(query.folderQueries[0].excludePattern, undefined); + assert.deepStrictEqual(query.folderQueries[0].excludePattern, []); assert.deepStrictEqual(query.excludePattern, undefined); return Promise.resolve({ results: [], messages: [] }); @@ -99,7 +101,7 @@ suite('MainThreadWorkspace', () => { fileSearch(query: IFileQuery) { assert.strictEqual(query.folderQueries.length, 1); assert.strictEqual(query.folderQueries[0].disregardIgnoreFiles, true); - assert.deepStrictEqual(query.folderQueries[0].excludePattern, undefined); + assert.deepStrictEqual(query.folderQueries[0].excludePattern, []); return Promise.resolve({ results: [], messages: [] }); } @@ -112,7 +114,7 @@ suite('MainThreadWorkspace', () => { test('exclude string', () => { instantiationService.stub(ISearchService, { fileSearch(query: IFileQuery) { - assert.strictEqual(query.folderQueries[0].excludePattern, undefined); + assert.deepStrictEqual(query.folderQueries[0].excludePattern, []); assert.deepStrictEqual({ ...query.excludePattern }, { 'exclude/**': true }); return Promise.resolve({ results: [], messages: [] }); @@ -120,6 +122,25 @@ suite('MainThreadWorkspace', () => { }); const mtw = disposables.add(instantiationService.createInstance(MainThreadWorkspace, SingleProxyRPCProtocol({ $initializeWorkspace: () => { } }))); - return mtw.$startFileSearch(null, { maxResults: 10, includePattern: '', excludePattern: 'exclude/**', disregardSearchExcludeSettings: true }, CancellationToken.None); + return mtw.$startFileSearch(null, { maxResults: 10, includePattern: '', excludePattern: [{ pattern: 'exclude/**' }], disregardSearchExcludeSettings: true }, CancellationToken.None); + }); + test('Valid revived URI after moving to EH', () => { + const uriComponents: UriComponents = { + scheme: 'test', + path: '/Users/username/Downloads', + }; + instantiationService.stub(ISearchService, { + fileSearch(query: IFileQuery) { + assert.strictEqual(query.folderQueries?.length, 1); + assert.ok(URI.isUri(query.folderQueries[0].folder)); + assert.strictEqual(query.folderQueries[0].folder.path, '/Users/username/Downloads'); + assert.strictEqual(query.folderQueries[0].folder.scheme, 'test'); + + return Promise.resolve({ results: [], messages: [] }); + } + }); + + const mtw = disposables.add(instantiationService.createInstance(MainThreadWorkspace, SingleProxyRPCProtocol({ $initializeWorkspace: () => { } }))); + return mtw.$startFileSearch(uriComponents, { filePattern: '*.md' }, CancellationToken.None); }); }); diff --git a/src/vs/workbench/api/test/common/extHostExtensionActivator.test.ts b/src/vs/workbench/api/test/common/extHostExtensionActivator.test.ts index bfd874acf2e..f5c64b4444d 100644 --- a/src/vs/workbench/api/test/common/extHostExtensionActivator.test.ts +++ b/src/vs/workbench/api/test/common/extHostExtensionActivator.test.ts @@ -4,15 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { promiseWithResolvers, timeout } from 'vs/base/common/async'; -import { Mutable } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ExtensionIdentifier, IExtensionDescription, TargetPlatform } from 'vs/platform/extensions/common/extensions'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { ActivatedExtension, EmptyExtension, ExtensionActivationTimes, ExtensionsActivator, IExtensionsActivatorHost } from 'vs/workbench/api/common/extHostExtensionActivator'; -import { ExtensionDescriptionRegistry, IActivationEventsReader } from 'vs/workbench/services/extensions/common/extensionDescriptionRegistry'; -import { ExtensionActivationReason, MissingExtensionDependency } from 'vs/workbench/services/extensions/common/extensions'; +import { promiseWithResolvers, timeout } from '../../../../base/common/async.js'; +import { Mutable } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ExtensionIdentifier, IExtensionDescription, TargetPlatform } from '../../../../platform/extensions/common/extensions.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { ActivatedExtension, EmptyExtension, ExtensionActivationTimes, ExtensionsActivator, IExtensionsActivatorHost } from '../../common/extHostExtensionActivator.js'; +import { ExtensionDescriptionRegistry, IActivationEventsReader } from '../../../services/extensions/common/extensionDescriptionRegistry.js'; +import { ExtensionActivationReason, MissingExtensionDependency } from '../../../services/extensions/common/extensions.js'; suite('ExtensionsActivator', () => { diff --git a/src/vs/workbench/api/test/common/extensionHostMain.test.ts b/src/vs/workbench/api/test/common/extensionHostMain.test.ts index 1608511b527..cda646f07cf 100644 --- a/src/vs/workbench/api/test/common/extensionHostMain.test.ts +++ b/src/vs/workbench/api/test/common/extensionHostMain.test.ts @@ -4,23 +4,23 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { SerializedError, errorHandler, onUnexpectedError } from 'vs/base/common/errors'; -import { isFirefox, isSafari } from 'vs/base/common/platform'; -import { TernarySearchTree } from 'vs/base/common/ternarySearchTree'; -import { URI } from 'vs/base/common/uri'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { MainThreadExtensionServiceShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtensionPaths, IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; -import { ErrorHandler } from 'vs/workbench/api/common/extensionHostMain'; -import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; -import { ProxyIdentifier, Proxied } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { SerializedError, errorHandler, onUnexpectedError } from '../../../../base/common/errors.js'; +import { isFirefox, isSafari } from '../../../../base/common/platform.js'; +import { TernarySearchTree } from '../../../../base/common/ternarySearchTree.js'; +import { URI } from '../../../../base/common/uri.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { ExtensionIdentifier, IExtensionDescription } from '../../../../platform/extensions/common/extensions.js'; +import { InstantiationService } from '../../../../platform/instantiation/common/instantiationService.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { ILogService, NullLogService } from '../../../../platform/log/common/log.js'; +import { MainThreadExtensionServiceShape } from '../../common/extHost.protocol.js'; +import { ExtensionPaths, IExtHostExtensionService } from '../../common/extHostExtensionService.js'; +import { IExtHostRpcService } from '../../common/extHostRpcService.js'; +import { IExtHostTelemetry } from '../../common/extHostTelemetry.js'; +import { ErrorHandler } from '../../common/extensionHostMain.js'; +import { nullExtensionDescription } from '../../../services/extensions/common/extensions.js'; +import { ProxyIdentifier, Proxied } from '../../../services/extensions/common/proxyIdentifier.js'; suite('ExtensionHostMain#ErrorHandler - Wrapping prepareStackTrace can cause slowdown and eventual stack overflow #184926 ', function () { diff --git a/src/vs/workbench/api/test/common/testRPCProtocol.ts b/src/vs/workbench/api/test/common/testRPCProtocol.ts index abf854afa06..16a9af44f91 100644 --- a/src/vs/workbench/api/test/common/testRPCProtocol.ts +++ b/src/vs/workbench/api/test/common/testRPCProtocol.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isThenable } from 'vs/base/common/async'; -import { CharCode } from 'vs/base/common/charCode'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; -import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; -import { ExtensionHostKind } from 'vs/workbench/services/extensions/common/extensionHostKind'; -import { Proxied, ProxyIdentifier, SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier'; -import { parseJsonAndRestoreBufferRefs, stringifyJsonWithBufferRefs } from 'vs/workbench/services/extensions/common/rpcProtocol'; +import { isThenable } from '../../../../base/common/async.js'; +import { CharCode } from '../../../../base/common/charCode.js'; +import { IExtHostRpcService } from '../../common/extHostRpcService.js'; +import { IExtHostContext } from '../../../services/extensions/common/extHostCustomers.js'; +import { ExtensionHostKind } from '../../../services/extensions/common/extensionHostKind.js'; +import { Proxied, ProxyIdentifier, SerializableObjectWithBuffers } from '../../../services/extensions/common/proxyIdentifier.js'; +import { parseJsonAndRestoreBufferRefs, stringifyJsonWithBufferRefs } from '../../../services/extensions/common/rpcProtocol.js'; export function SingleProxyRPCProtocol(thing: any): IExtHostContext & IExtHostRpcService { return { diff --git a/src/vs/workbench/api/test/node/extHostSearch.test.ts b/src/vs/workbench/api/test/node/extHostSearch.test.ts index af20a5e455b..75e6b2f34c6 100644 --- a/src/vs/workbench/api/test/node/extHostSearch.test.ts +++ b/src/vs/workbench/api/test/node/extHostSearch.test.ts @@ -4,27 +4,27 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { mapArrayOrNot } from 'vs/base/common/arrays'; -import { timeout } from 'vs/base/common/async'; -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { isCancellationError } from 'vs/base/common/errors'; -import { revive } from 'vs/base/common/marshalling'; -import { joinPath } from 'vs/base/common/resources'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import * as pfs from 'vs/base/node/pfs'; -import { mock } from 'vs/base/test/common/mock'; -import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; -import { NullLogService } from 'vs/platform/log/common/log'; -import { MainContext, MainThreadSearchShape } from 'vs/workbench/api/common/extHost.protocol'; -import { ExtHostConfigProvider, IExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration.js'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { Range } from 'vs/workbench/api/common/extHostTypes'; -import { URITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; -import { NativeExtHostSearch } from 'vs/workbench/api/node/extHostSearch'; -import { TestRPCProtocol } from 'vs/workbench/api/test/common/testRPCProtocol'; -import { IFileMatch, IFileQuery, IPatternInfo, IRawFileMatch2, ISearchCompleteStats, ISearchQuery, ITextQuery, QueryType, resultIsMatch } from 'vs/workbench/services/search/common/search'; -import { TextSearchManager } from 'vs/workbench/services/search/common/textSearchManager'; -import { NativeTextSearchManager } from 'vs/workbench/services/search/node/textSearchManager'; +import { mapArrayOrNot } from '../../../../base/common/arrays.js'; +import { timeout } from '../../../../base/common/async.js'; +import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { isCancellationError } from '../../../../base/common/errors.js'; +import { revive } from '../../../../base/common/marshalling.js'; +import { joinPath } from '../../../../base/common/resources.js'; +import { URI, UriComponents } from '../../../../base/common/uri.js'; +import * as pfs from '../../../../base/node/pfs.js'; +import { mock } from '../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; +import { NullLogService } from '../../../../platform/log/common/log.js'; +import { MainContext, MainThreadSearchShape } from '../../common/extHost.protocol.js'; +import { ExtHostConfigProvider, IExtHostConfiguration } from '../../common/extHostConfiguration.js'; +import { IExtHostInitDataService } from '../../common/extHostInitDataService.js'; +import { Range } from '../../common/extHostTypes.js'; +import { URITransformerService } from '../../common/extHostUriTransformerService.js'; +import { NativeExtHostSearch } from '../../node/extHostSearch.js'; +import { TestRPCProtocol } from '../common/testRPCProtocol.js'; +import { IFileMatch, IFileQuery, IPatternInfo, IRawFileMatch2, ISearchCompleteStats, ISearchQuery, ITextQuery, QueryType, resultIsMatch } from '../../../services/search/common/search.js'; +import { TextSearchManager } from '../../../services/search/common/textSearchManager.js'; +import { NativeTextSearchManager } from '../../../services/search/node/textSearchManager.js'; import type * as vscode from 'vscode'; let rpcProtocol: TestRPCProtocol; @@ -76,12 +76,12 @@ suite('ExtHostSearch', () => { const disposables = ensureNoDisposablesAreLeakedInTestSuite(); async function registerTestTextSearchProvider(provider: vscode.TextSearchProvider, scheme = 'file'): Promise { - disposables.add(extHostSearch.registerTextSearchProvider(scheme, provider)); + disposables.add(extHostSearch.registerTextSearchProviderOld(scheme, provider)); await rpcProtocol.sync(); } async function registerTestFileSearchProvider(provider: vscode.FileSearchProvider, scheme = 'file'): Promise { - disposables.add(extHostSearch.registerFileSearchProvider(scheme, provider)); + disposables.add(extHostSearch.registerFileSearchProviderOld(scheme, provider)); await rpcProtocol.sync(); } @@ -170,7 +170,7 @@ suite('ExtHostSearch', () => { this._pfs = mockPFS as any; } - protected override createTextSearchManager(query: ITextQuery, provider: vscode.TextSearchProvider): TextSearchManager { + protected override createTextSearchManager(query: ITextQuery, provider: vscode.TextSearchProviderNew): TextSearchManager { return new NativeTextSearchManager(query, provider, this._pfs); } }); @@ -263,6 +263,28 @@ suite('ExtHostSearch', () => { assert(!results.length); }); + test('session cancellation should work', async () => { + let numSessionCancelled = 0; + const disposables: (vscode.Disposable | undefined)[] = []; + await registerTestFileSearchProvider({ + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise { + + disposables.push(options.session?.onCancellationRequested(() => { + numSessionCancelled++; + })); + + return Promise.resolve([]); + } + }); + + + await runFileSearch({ ...getSimpleQuery(), cacheKey: '1' }, true); + await runFileSearch({ ...getSimpleQuery(), cacheKey: '2' }, true); + extHostSearch.$clearCache('1'); + assert.strictEqual(numSessionCancelled, 1); + disposables.forEach(d => d?.dispose()); + }); + test('provider returns null', async () => { await registerTestFileSearchProvider({ provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise { @@ -338,9 +360,11 @@ suite('ExtHostSearch', () => { includePattern: { 'foo': true }, - excludePattern: { - 'bar': true - } + excludePattern: [{ + pattern: { + 'bar': true + } + }] }, { folder: rootFolderB } ] @@ -377,9 +401,11 @@ suite('ExtHostSearch', () => { includePattern: { '*.jsx': true }, - excludePattern: { - '*.js': false - } + excludePattern: [{ + pattern: { + '*.js': false + } + }] } ] }; @@ -495,17 +521,21 @@ suite('ExtHostSearch', () => { folderQueries: [ { folder: rootFolderA, - excludePattern: { - 'folder/*.css': { - when: '$(basename).scss' + excludePattern: [{ + pattern: { + 'folder/*.css': { + when: '$(basename).scss' + } } - } + }] }, { folder: rootFolderB, - excludePattern: { - '*.js': false - } + excludePattern: [{ + pattern: { + '*.js': false + } + }] } ] }; @@ -694,6 +724,24 @@ suite('ExtHostSearch', () => { const { results } = await runFileSearch(query); compareURIs(results, reportedResults); }); + test('if onlyFileScheme is set, do not call custom schemes', async () => { + let fancySchemeCalled = false; + await registerTestFileSearchProvider({ + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise { + fancySchemeCalled = true; + return Promise.resolve([]); + } + }, fancyScheme); + + const query: ISearchQuery = { + type: QueryType.File, + filePattern: '', + folderQueries: [] + }; + + await runFileSearch(query); + assert(!fancySchemeCalled); + }); }); suite('Text:', () => { @@ -738,13 +786,13 @@ suite('ExtHostSearch', () => { if (resultIsMatch(lineResult)) { actualTextSearchResults.push({ preview: { - text: lineResult.preview.text, + text: lineResult.previewText, matches: mapArrayOrNot( - lineResult.preview.matches, + lineResult.rangeLocations.map(r => r.preview), m => new Range(m.startLineNumber, m.startColumn, m.endLineNumber, m.endColumn)) }, ranges: mapArrayOrNot( - lineResult.ranges, + lineResult.rangeLocations.map(r => r.source), r => new Range(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn), ), uri: fileMatch.resource @@ -876,9 +924,11 @@ suite('ExtHostSearch', () => { includePattern: { 'foo': true }, - excludePattern: { - 'bar': true - } + excludePattern: [{ + pattern: { + 'bar': true + } + }] }, { folder: rootFolderB } ] @@ -915,9 +965,11 @@ suite('ExtHostSearch', () => { includePattern: { '*.jsx': true }, - excludePattern: { - '*.js': false - } + excludePattern: [{ + pattern: { + '*.js': false + } + }] } ] }; @@ -1041,17 +1093,21 @@ suite('ExtHostSearch', () => { folderQueries: [ { folder: rootFolderA, - excludePattern: { - 'folder/*.css': { - when: '$(basename).scss' + excludePattern: [{ + pattern: { + 'folder/*.css': { + when: '$(basename).scss' + } } - } + }] }, { folder: rootFolderB, - excludePattern: { - '*.js': false - } + excludePattern: [{ + pattern: { + '*.js': false + } + }] } ] }; diff --git a/src/vs/workbench/api/test/node/extHostTunnelService.test.ts b/src/vs/workbench/api/test/node/extHostTunnelService.test.ts index 57fe15e52b4..d260fbe726e 100644 --- a/src/vs/workbench/api/test/node/extHostTunnelService.test.ts +++ b/src/vs/workbench/api/test/node/extHostTunnelService.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { findPorts, getRootProcesses, getSockets, loadConnectionTable, loadListeningPorts, parseIpAddress, tryFindRootPorts } from 'vs/workbench/api/node/extHostTunnelService'; +import { findPorts, getRootProcesses, getSockets, loadConnectionTable, loadListeningPorts, parseIpAddress, tryFindRootPorts } from '../../node/extHostTunnelService.js'; const tcp = ` sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode diff --git a/src/vs/workbench/api/worker/extHost.worker.services.ts b/src/vs/workbench/api/worker/extHost.worker.services.ts index 20ec7e138a6..85c1a96bb94 100644 --- a/src/vs/workbench/api/worker/extHost.worker.services.ts +++ b/src/vs/workbench/api/worker/extHost.worker.services.ts @@ -3,13 +3,13 @@ * 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'; // ######################################################################### // ### ### diff --git a/src/vs/workbench/api/worker/extHostConsoleForwarder.ts b/src/vs/workbench/api/worker/extHostConsoleForwarder.ts index ea266a94a81..8cfde44fad7 100644 --- a/src/vs/workbench/api/worker/extHostConsoleForwarder.ts +++ b/src/vs/workbench/api/worker/extHostConsoleForwarder.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AbstractExtHostConsoleForwarder } from 'vs/workbench/api/common/extHostConsoleForwarder'; -import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; -import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; +import { AbstractExtHostConsoleForwarder } from '../common/extHostConsoleForwarder.js'; +import { IExtHostInitDataService } from '../common/extHostInitDataService.js'; +import { IExtHostRpcService } from '../common/extHostRpcService.js'; export class ExtHostConsoleForwarder extends AbstractExtHostConsoleForwarder { diff --git a/src/vs/workbench/api/worker/extHostExtensionService.ts b/src/vs/workbench/api/worker/extHostExtensionService.ts index b83a462131d..6f3384ab89c 100644 --- a/src/vs/workbench/api/worker/extHostExtensionService.ts +++ b/src/vs/workbench/api/worker/extHostExtensionService.ts @@ -3,15 +3,15 @@ * 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 { ExtensionActivationTimesBuilder } from 'vs/workbench/api/common/extHostExtensionActivator'; -import { AbstractExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; -import { URI } from 'vs/base/common/uri'; -import { RequireInterceptor } from 'vs/workbench/api/common/extHostRequireInterceptor'; -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 { createApiFactoryAndRegisterActors } 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'; +import { RequireInterceptor } from '../common/extHostRequireInterceptor.js'; +import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; +import { ExtensionRuntime } from '../common/extHostTypes.js'; +import { timeout } from '../../../base/common/async.js'; +import { ExtHostConsoleForwarder } from './extHostConsoleForwarder.js'; class WorkerRequireInterceptor extends RequireInterceptor { diff --git a/extensions/markdown-language-features/server/src/util/schemes.ts b/src/vs/workbench/api/worker/extensionHostWorker.esm.ts similarity index 74% rename from extensions/markdown-language-features/server/src/util/schemes.ts rename to src/vs/workbench/api/worker/extensionHostWorker.esm.ts index 67b75e0a0d6..f7eaf7cfeca 100644 --- a/extensions/markdown-language-features/server/src/util/schemes.ts +++ b/src/vs/workbench/api/worker/extensionHostWorker.esm.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -export const Schemes = Object.freeze({ - notebookCell: 'vscode-notebook-cell', -}); +import { create } from './extensionHostWorker.js'; + +const data = create(); +self.onmessage = (e) => data.onmessage(e.data); diff --git a/src/vs/workbench/api/worker/extensionHostWorker.ts b/src/vs/workbench/api/worker/extensionHostWorker.ts index 86136a080e6..d9953269acb 100644 --- a/src/vs/workbench/api/worker/extensionHostWorker.ts +++ b/src/vs/workbench/api/worker/extensionHostWorker.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc'; -import { VSBuffer } from 'vs/base/common/buffer'; -import { Emitter } from 'vs/base/common/event'; -import { isMessageOfType, MessageType, createMessageOfType, IExtensionHostInitData } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; -import { ExtensionHostMain } from 'vs/workbench/api/common/extensionHostMain'; -import { IHostUtils } from 'vs/workbench/api/common/extHostExtensionService'; -import { NestedWorker } from 'vs/workbench/services/extensions/worker/polyfillNestedWorker'; -import * as path from 'vs/base/common/path'; -import * as performance from 'vs/base/common/performance'; - -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 { IMessagePassingProtocol } from '../../../base/parts/ipc/common/ipc.js'; +import { VSBuffer } from '../../../base/common/buffer.js'; +import { Emitter } from '../../../base/common/event.js'; +import { isMessageOfType, MessageType, createMessageOfType, IExtensionHostInitData } from '../../services/extensions/common/extensionHostProtocol.js'; +import { ExtensionHostMain } from '../common/extensionHostMain.js'; +import { IHostUtils } from '../common/extHostExtensionService.js'; +import { NestedWorker } from '../../services/extensions/worker/polyfillNestedWorker.js'; +import * as path from '../../../base/common/path.js'; +import * as performance from '../../../base/common/performance.js'; + +import '../common/extHost.common.services.js'; +import './extHost.worker.services.js'; +import { FileAccess } from '../../../base/common/network.js'; +import { URI } from '../../../base/common/uri.js'; //#region --- Define, capture, and override some globals @@ -234,6 +234,10 @@ function isInitMessage(a: any): a is IInitMessage { return !!a && typeof a === 'object' && a.type === 'vscode.init' && a.data instanceof Map; } +/** + * Defines the worker entry point. Must be exported and named `create`. + * @skipMangle + */ export function create(): { onmessage: (message: any) => void } { performance.mark(`code/extHost/willConnectToRenderer`); const res = new ExtensionWorker(); diff --git a/src/vs/workbench/browser/actions.ts b/src/vs/workbench/browser/actions.ts index 1e166016ed3..83f4cf4a455 100644 --- a/src/vs/workbench/browser/actions.ts +++ b/src/vs/workbench/browser/actions.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IAction } from 'vs/base/common/actions'; -import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { Emitter, Event } from 'vs/base/common/event'; -import { MenuId, IMenuService, IMenu, SubmenuItemAction, IMenuActionOptions } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; +import { IAction } from '../../base/common/actions.js'; +import { Disposable, DisposableStore, IDisposable } from '../../base/common/lifecycle.js'; +import { Emitter, Event } from '../../base/common/event.js'; +import { MenuId, IMenuService, IMenu, SubmenuItemAction, IMenuActionOptions } from '../../platform/actions/common/actions.js'; +import { IContextKeyService } from '../../platform/contextkey/common/contextkey.js'; +import { createAndFillInActionBarActions } from '../../platform/actions/browser/menuEntryActionViewItem.js'; class MenuActions extends Disposable { @@ -96,9 +96,8 @@ export class CompositeMenuActions extends Disposable { const actions: IAction[] = []; if (this.contextMenuId) { - const menu = this.menuService.createMenu(this.contextMenuId, this.contextKeyService); - createAndFillInActionBarActions(menu, this.options, { primary: [], secondary: actions }); - menu.dispose(); + const menu = this.menuService.getMenuActions(this.contextMenuId, this.contextKeyService, this.options); + createAndFillInActionBarActions(menu, { primary: [], secondary: actions }); } return actions; diff --git a/src/vs/workbench/browser/actions/csAccountActions.ts b/src/vs/workbench/browser/actions/csAccountActions.ts index 88773693b9f..88c72e9be59 100644 --- a/src/vs/workbench/browser/actions/csAccountActions.ts +++ b/src/vs/workbench/browser/actions/csAccountActions.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { localize } from 'vs/nls'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions'; -import { ICSAccountService } from 'vs/platform/codestoryAccount/common/csAccount'; -import { CS_ACCOUNT_CARD_VISIBLE } from 'vs/platform/codestoryAccount/common/csAccountContextKeys'; +import { ServicesAccessor } from '../../../editor/browser/editorExtensions.js'; +import { localize } from '../../../nls.js'; +import { Categories } from '../../../platform/action/common/actionCommonCategories.js'; +import { Action2, MenuId, registerAction2 } from '../../../platform/actions/common/actions.js'; +import { ICSAccountService } from '../../../platform/codestoryAccount/common/csAccount.js'; +import { CS_ACCOUNT_CARD_VISIBLE } from '../../../platform/codestoryAccount/common/csAccountContextKeys.js'; export class ToggleCodestoryAccountCardAction extends Action2 { static readonly ID = 'workbench.action.toggleCodestoryAccountCard'; diff --git a/src/vs/workbench/browser/actions/developerActions.ts b/src/vs/workbench/browser/actions/developerActions.ts index 7823fa988c0..bf0ca0f7b2d 100644 --- a/src/vs/workbench/browser/actions/developerActions.ts +++ b/src/vs/workbench/browser/actions/developerActions.ts @@ -3,43 +3,43 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/actions'; - -import { localize, localize2 } from 'vs/nls'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { DomEmitter } from 'vs/base/browser/event'; -import { Color } from 'vs/base/common/color'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable, toDisposable, dispose, DisposableStore, setDisposableTracker, DisposableTracker, DisposableInfo } from 'vs/base/common/lifecycle'; -import { getDomNodePagePosition, createStyleSheet, createCSSRule, append, $, getActiveDocument, onDidRegisterWindow, getWindows } from 'vs/base/browser/dom'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyExpr, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { Context } from 'vs/platform/contextkey/browser/contextKeyService'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { registerAction2, Action2, MenuRegistry } from 'vs/platform/actions/common/actions'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { clamp } from 'vs/base/common/numbers'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { IWorkingCopyBackupService } from 'vs/workbench/services/workingCopy/common/workingCopyBackup'; -import { ResolutionResult, ResultKind } from 'vs/platform/keybinding/common/keybindingResolver'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { IOutputService } from 'vs/workbench/services/output/common/output'; -import { windowLogId } from 'vs/workbench/services/log/common/logConstants'; -import { ByteSize } from 'vs/platform/files/common/files'; -import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import product from 'vs/platform/product/common/product'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import './media/actions.css'; + +import { localize, localize2 } from '../../../nls.js'; +import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js'; +import { DomEmitter } from '../../../base/browser/event.js'; +import { Color } from '../../../base/common/color.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { IDisposable, toDisposable, dispose, DisposableStore, setDisposableTracker, DisposableTracker, DisposableInfo } from '../../../base/common/lifecycle.js'; +import { getDomNodePagePosition, createStyleSheet, createCSSRule, append, $, getActiveDocument, onDidRegisterWindow, getWindows } from '../../../base/browser/dom.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { ContextKeyExpr, IContextKeyService, RawContextKey } from '../../../platform/contextkey/common/contextkey.js'; +import { Context } from '../../../platform/contextkey/browser/contextKeyService.js'; +import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { ILayoutService } from '../../../platform/layout/browser/layoutService.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { registerAction2, Action2, MenuRegistry } from '../../../platform/actions/common/actions.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../../platform/storage/common/storage.js'; +import { clamp } from '../../../base/common/numbers.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from '../../../platform/configuration/common/configurationRegistry.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IWorkingCopyService } from '../../services/workingCopy/common/workingCopyService.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { Categories } from '../../../platform/action/common/actionCommonCategories.js'; +import { IWorkingCopyBackupService } from '../../services/workingCopy/common/workingCopyBackup.js'; +import { ResolutionResult, ResultKind } from '../../../platform/keybinding/common/keybindingResolver.js'; +import { IDialogService } from '../../../platform/dialogs/common/dialogs.js'; +import { IOutputService } from '../../services/output/common/output.js'; +import { windowLogId } from '../../services/log/common/logConstants.js'; +import { ByteSize } from '../../../platform/files/common/files.js'; +import { IQuickInputService, IQuickPickItem } from '../../../platform/quickinput/common/quickInput.js'; +import { IUserDataProfileService } from '../../services/userDataProfile/common/userDataProfile.js'; +import { IEditorService } from '../../services/editor/common/editorService.js'; +import product from '../../../platform/product/common/product.js'; +import { CommandsRegistry } from '../../../platform/commands/common/commands.js'; +import { IEnvironmentService } from '../../../platform/environment/common/environment.js'; class InspectContextKeysAction extends Action2 { diff --git a/src/vs/workbench/browser/actions/helpActions.ts b/src/vs/workbench/browser/actions/helpActions.ts index fd55b27b185..3a366903e8a 100644 --- a/src/vs/workbench/browser/actions/helpActions.ts +++ b/src/vs/workbench/browser/actions/helpActions.ts @@ -3,18 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize, localize2 } from 'vs/nls'; -import product from 'vs/platform/product/common/product'; -import { isMacintosh, isLinux, language, isWeb } from 'vs/base/common/platform'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { URI } from 'vs/base/common/uri'; -import { MenuId, Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { KeyChord, KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; +import { localize, localize2 } from '../../../nls.js'; +import product from '../../../platform/product/common/product.js'; +import { isMacintosh, isLinux, language, isWeb } from '../../../base/common/platform.js'; +import { ITelemetryService } from '../../../platform/telemetry/common/telemetry.js'; +import { IOpenerService } from '../../../platform/opener/common/opener.js'; +import { URI } from '../../../base/common/uri.js'; +import { MenuId, Action2, registerAction2 } from '../../../platform/actions/common/actions.js'; +import { KeyChord, KeyMod, KeyCode } from '../../../base/common/keyCodes.js'; +import { IProductService } from '../../../platform/product/common/productService.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight } from '../../../platform/keybinding/common/keybindingsRegistry.js'; +import { Categories } from '../../../platform/action/common/actionCommonCategories.js'; +import { ICommandService } from '../../../platform/commands/common/commands.js'; class KeybindingsReferenceAction extends Action2 { @@ -307,6 +308,27 @@ class OpenPrivacyStatementUrlAction extends Action2 { } } +class GetStartedWithAccessibilityFeatures extends Action2 { + static readonly ID = 'workbench.action.getStartedWithAccessibilityFeatures'; + constructor() { + super({ + id: GetStartedWithAccessibilityFeatures.ID, + title: localize2('getStartedWithAccessibilityFeatures', 'Get Started with Accessibility Features'), + category: Categories.Help, + f1: true, + menu: { + id: MenuId.MenubarHelpMenu, + group: '1_welcome', + order: 6 + } + }); + } + run(accessor: ServicesAccessor): void { + const commandService = accessor.get(ICommandService); + commandService.executeCommand('workbench.action.openWalkthrough', 'SetupAccessibility'); + } +} + // --- Actions Registration if (KeybindingsReferenceAction.AVAILABLE) { @@ -344,3 +366,5 @@ if (OpenLicenseUrlAction.AVAILABLE) { if (OpenPrivacyStatementUrlAction.AVAILABE) { registerAction2(OpenPrivacyStatementUrlAction); } + +registerAction2(GetStartedWithAccessibilityFeatures); diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index 77574a6338d..5d7b93cfd86 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -3,34 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ILocalizedString, localize, localize2 } from 'vs/nls'; -import { MenuId, MenuRegistry, registerAction2, Action2 } from 'vs/platform/actions/common/actions'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { EditorActionsLocation, EditorTabsMode, IWorkbenchLayoutService, LayoutSettings, Parts, Position, ZenModeSettings, positionToString } from 'vs/workbench/services/layout/browser/layoutService'; -import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes'; -import { isWindows, isLinux, isWeb, isMacintosh, isNative } from 'vs/base/common/platform'; -import { IsMacNativeContext } from 'vs/platform/contextkey/common/contextkeys'; -import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ContextKeyExpr, ContextKeyExpression, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IViewDescriptorService, ViewContainerLocation, IViewDescriptor, ViewContainerLocationToString } from 'vs/workbench/common/views'; -import { IViewsService } from 'vs/workbench/services/views/common/viewsService'; -import { QuickPickItem, IQuickInputService, IQuickPickItem, IQuickPickSeparator, IQuickPick } from 'vs/platform/quickinput/common/quickInput'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; -import { ToggleAuxiliaryBarAction } from 'vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions'; -import { TogglePanelAction } from 'vs/workbench/browser/parts/panel/panelActions'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { AuxiliaryBarVisibleContext, PanelAlignmentContext, PanelVisibleContext, SideBarVisibleContext, FocusedViewContext, InEditorZenModeContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, IsMainWindowFullscreenContext, PanelPositionContext, IsAuxiliaryWindowFocusedContext, TitleBarStyleContext } from 'vs/workbench/common/contextkeys'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { ICommandActionTitle } from 'vs/platform/action/common/action'; -import { mainWindow } from 'vs/base/browser/window'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { TitlebarStyle } from 'vs/platform/window/common/window'; +import { ILocalizedString, localize, localize2 } from '../../../nls.js'; +import { MenuId, MenuRegistry, registerAction2, Action2 } from '../../../platform/actions/common/actions.js'; +import { Categories } from '../../../platform/action/common/actionCommonCategories.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { EditorActionsLocation, EditorTabsMode, IWorkbenchLayoutService, LayoutSettings, Parts, Position, ZenModeSettings, positionToString } from '../../services/layout/browser/layoutService.js'; +import { ServicesAccessor, IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { KeyMod, KeyCode, KeyChord } from '../../../base/common/keyCodes.js'; +import { isWindows, isLinux, isWeb, isMacintosh, isNative } from '../../../base/common/platform.js'; +import { IsMacNativeContext } from '../../../platform/contextkey/common/contextkeys.js'; +import { KeybindingsRegistry, KeybindingWeight } from '../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ContextKeyExpr, ContextKeyExpression, IContextKeyService } from '../../../platform/contextkey/common/contextkey.js'; +import { IViewDescriptorService, ViewContainerLocation, IViewDescriptor, ViewContainerLocationToString } from '../../common/views.js'; +import { IViewsService } from '../../services/views/common/viewsService.js'; +import { QuickPickItem, IQuickInputService, IQuickPickItem, IQuickPickSeparator, IQuickPick } from '../../../platform/quickinput/common/quickInput.js'; +import { IDialogService } from '../../../platform/dialogs/common/dialogs.js'; +import { IPaneCompositePartService } from '../../services/panecomposite/browser/panecomposite.js'; +import { ToggleAuxiliaryBarAction } from '../parts/auxiliarybar/auxiliaryBarActions.js'; +import { TogglePanelAction } from '../parts/panel/panelActions.js'; +import { ICommandService } from '../../../platform/commands/common/commands.js'; +import { AuxiliaryBarVisibleContext, PanelAlignmentContext, PanelVisibleContext, SideBarVisibleContext, FocusedViewContext, InEditorZenModeContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, IsMainWindowFullscreenContext, PanelPositionContext, IsAuxiliaryWindowFocusedContext, TitleBarStyleContext } from '../../common/contextkeys.js'; +import { Codicon } from '../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { registerIcon } from '../../../platform/theme/common/iconRegistry.js'; +import { ICommandActionTitle } from '../../../platform/action/common/action.js'; +import { mainWindow } from '../../../base/browser/window.js'; +import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js'; +import { TitlebarStyle } from '../../../platform/window/common/window.js'; +import { IPreferencesService } from '../../services/preferences/common/preferences.js'; // Register Icons const menubarIcon = registerIcon('menuBar', Codicon.layoutMenubar, localize('menuBarIcon', "Represents the menu bar")); @@ -673,6 +674,48 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { order: 11 }); +// --- Configure Tabs Layout + +export class ConfigureEditorTabsAction extends Action2 { + + static readonly ID = 'workbench.action.configureEditorTabs'; + + constructor() { + super({ + id: ConfigureEditorTabsAction.ID, + title: localize2('configureTabs', "Configure Tabs"), + category: Categories.View, + }); + } + + run(accessor: ServicesAccessor) { + const preferencesService = accessor.get(IPreferencesService); + preferencesService.openSettings({ jsonEditor: false, query: 'workbench.editor tab' }); + } +} +registerAction2(ConfigureEditorTabsAction); + +// --- Configure Editor + +export class ConfigureEditorAction extends Action2 { + + static readonly ID = 'workbench.action.configureEditor'; + + constructor() { + super({ + id: ConfigureEditorAction.ID, + title: localize2('configureEditors', "Configure Editors"), + category: Categories.View, + }); + } + + run(accessor: ServicesAccessor) { + const preferencesService = accessor.get(IPreferencesService); + preferencesService.openSettings({ jsonEditor: false, query: 'workbench.editor' }); + } +} +registerAction2(ConfigureEditorAction); + // --- Toggle Pinned Tabs On Separate Row registerAction2(class extends Action2 { @@ -923,13 +966,14 @@ registerAction2(class extends Action2 { } private async getView(quickInputService: IQuickInputService, viewDescriptorService: IViewDescriptorService, paneCompositePartService: IPaneCompositePartService, viewId?: string): Promise { - const quickPick = quickInputService.createQuickPick(); + const disposables = new DisposableStore(); + const quickPick = disposables.add(quickInputService.createQuickPick({ useSeparators: true })); quickPick.placeholder = localize('moveFocusedView.selectView', "Select a View to Move"); quickPick.items = this.getViewItems(viewDescriptorService, paneCompositePartService); quickPick.selectedItems = quickPick.items.filter(item => (item as IQuickPickItem).id === viewId) as IQuickPickItem[]; return new Promise((resolve, reject) => { - quickPick.onDidAccept(() => { + disposables.add(quickPick.onDidAccept(() => { const viewId = quickPick.selectedItems[0]; if (viewId.id) { resolve(viewId.id); @@ -938,9 +982,12 @@ registerAction2(class extends Action2 { } quickPick.hide(); - }); + })); - quickPick.onDidHide(() => reject()); + disposables.add(quickPick.onDidHide(() => { + disposables.dispose(); + reject(); + })); quickPick.show(); }); @@ -982,7 +1029,8 @@ class MoveFocusedViewAction extends Action2 { return; } - const quickPick = quickInputService.createQuickPick(); + const disposables = new DisposableStore(); + const quickPick = disposables.add(quickInputService.createQuickPick({ useSeparators: true })); quickPick.placeholder = localize('moveFocusedView.selectDestination', "Select a Destination for the View"); quickPick.title = localize({ key: 'moveFocusedView.title', comment: ['{0} indicates the title of the view the user has selected to move.'] }, "View: Move {0}", viewDescriptor.name.value); @@ -1077,7 +1125,7 @@ class MoveFocusedViewAction extends Action2 { quickPick.items = items; - quickPick.onDidAccept(() => { + disposables.add(quickPick.onDidAccept(() => { const destination = quickPick.selectedItems[0]; if (destination.id === '_.panel.newcontainer') { @@ -1095,7 +1143,9 @@ class MoveFocusedViewAction extends Action2 { } quickPick.hide(); - }); + })); + + disposables.add(quickPick.onDidHide(() => disposables.dispose())); quickPick.show(); } @@ -1368,7 +1418,7 @@ for (const { active } of [...ToggleVisibilityActions, ...MoveSideBarActions, ... registerAction2(class CustomizeLayoutAction extends Action2 { - private _currentQuickPick?: IQuickPick; + private _currentQuickPick?: IQuickPick; constructor() { super({ @@ -1461,7 +1511,10 @@ registerAction2(class CustomizeLayoutAction extends Action2 { const commandService = accessor.get(ICommandService); const quickInputService = accessor.get(IQuickInputService); const keybindingService = accessor.get(IKeybindingService); - const quickPick = quickInputService.createQuickPick(); + + const disposables = new DisposableStore(); + + const quickPick = disposables.add(quickInputService.createQuickPick({ useSeparators: true })); this._currentQuickPick = quickPick; quickPick.items = this.getItems(contextKeyService, keybindingService); @@ -1486,7 +1539,6 @@ registerAction2(class CustomizeLayoutAction extends Action2 { closeButton ]; - const disposables = new DisposableStore(); let selectedItem: CustomizeLayoutItem | undefined = undefined; disposables.add(contextKeyService.onDidChangeContext(changeEvent => { if (changeEvent.affectsSome(LayoutContextKeySet)) { @@ -1499,21 +1551,21 @@ registerAction2(class CustomizeLayoutAction extends Action2 { } })); - quickPick.onDidAccept(event => { + disposables.add(quickPick.onDidAccept(event => { if (quickPick.selectedItems.length) { selectedItem = quickPick.selectedItems[0] as CustomizeLayoutItem; commandService.executeCommand(selectedItem.id); } - }); + })); - quickPick.onDidTriggerItemButton(event => { + disposables.add(quickPick.onDidTriggerItemButton(event => { if (event.item) { selectedItem = event.item as CustomizeLayoutItem; commandService.executeCommand(selectedItem.id); } - }); + })); - quickPick.onDidTriggerButton((button) => { + disposables.add(quickPick.onDidTriggerButton((button) => { if (button === closeButton) { quickPick.hide(); } else if (button === resetButton) { @@ -1535,16 +1587,16 @@ registerAction2(class CustomizeLayoutAction extends Action2 { commandService.executeCommand('workbench.action.alignPanelCenter'); } - }); + })); - quickPick.onDidHide(() => { + disposables.add(quickPick.onDidHide(() => { quickPick.dispose(); - }); + })); - quickPick.onDispose(() => { + disposables.add(quickPick.onDispose(() => { this._currentQuickPick = undefined; disposables.dispose(); - }); + })); quickPick.show(); } diff --git a/src/vs/workbench/browser/actions/listCommands.ts b/src/vs/workbench/browser/actions/listCommands.ts index 188a94e1f51..e87163b7476 100644 --- a/src/vs/workbench/browser/actions/listCommands.ts +++ b/src/vs/workbench/browser/actions/listCommands.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { List } from 'vs/base/browser/ui/list/listWidget'; -import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, ListWidget, WorkbenchListHasSelectionOrFocus, getSelectionKeyboardEvent, WorkbenchListWidget, WorkbenchListSelectionNavigation, WorkbenchTreeElementCanCollapse, WorkbenchTreeElementHasParent, WorkbenchTreeElementHasChild, WorkbenchTreeElementCanExpand, RawWorkbenchListFocusContextKey, WorkbenchTreeFindOpen, WorkbenchListSupportsFind, WorkbenchListScrollAtBottomContextKey, WorkbenchListScrollAtTopContextKey, WorkbenchTreeStickyScrollFocused } from 'vs/platform/list/browser/listService'; -import { PagedList } from 'vs/base/browser/ui/list/listPaging'; -import { equals, range } from 'vs/base/common/arrays'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { ObjectTree } from 'vs/base/browser/ui/tree/objectTree'; -import { AsyncDataTree } from 'vs/base/browser/ui/tree/asyncDataTree'; -import { DataTree } from 'vs/base/browser/ui/tree/dataTree'; -import { ITreeNode } from 'vs/base/browser/ui/tree/tree'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { Table } from 'vs/base/browser/ui/table/tableWidget'; -import { AbstractTree, TreeFindMatchType, TreeFindMode } from 'vs/base/browser/ui/tree/abstractTree'; -import { isActiveElement } from 'vs/base/browser/dom'; -import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { localize, localize2 } from 'vs/nls'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; +import { KeyMod, KeyCode, KeyChord } from '../../../base/common/keyCodes.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { KeybindingsRegistry, KeybindingWeight } from '../../../platform/keybinding/common/keybindingsRegistry.js'; +import { List } from '../../../base/browser/ui/list/listWidget.js'; +import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, ListWidget, WorkbenchListHasSelectionOrFocus, getSelectionKeyboardEvent, WorkbenchListWidget, WorkbenchListSelectionNavigation, WorkbenchTreeElementCanCollapse, WorkbenchTreeElementHasParent, WorkbenchTreeElementHasChild, WorkbenchTreeElementCanExpand, RawWorkbenchListFocusContextKey, WorkbenchTreeFindOpen, WorkbenchListSupportsFind, WorkbenchListScrollAtBottomContextKey, WorkbenchListScrollAtTopContextKey, WorkbenchTreeStickyScrollFocused } from '../../../platform/list/browser/listService.js'; +import { PagedList } from '../../../base/browser/ui/list/listPaging.js'; +import { equals, range } from '../../../base/common/arrays.js'; +import { ContextKeyExpr } from '../../../platform/contextkey/common/contextkey.js'; +import { ObjectTree } from '../../../base/browser/ui/tree/objectTree.js'; +import { AsyncDataTree } from '../../../base/browser/ui/tree/asyncDataTree.js'; +import { DataTree } from '../../../base/browser/ui/tree/dataTree.js'; +import { ITreeNode } from '../../../base/browser/ui/tree/tree.js'; +import { CommandsRegistry } from '../../../platform/commands/common/commands.js'; +import { Table } from '../../../base/browser/ui/table/tableWidget.js'; +import { AbstractTree, TreeFindMatchType, TreeFindMode } from '../../../base/browser/ui/tree/abstractTree.js'; +import { isActiveElement } from '../../../base/browser/dom.js'; +import { Action2, registerAction2 } from '../../../platform/actions/common/actions.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { localize, localize2 } from '../../../nls.js'; +import { IHoverService } from '../../../platform/hover/browser/hover.js'; function ensureDOMFocus(widget: ListWidget | undefined): void { // it can happen that one of the commands is executed while diff --git a/src/vs/workbench/browser/actions/navigationActions.ts b/src/vs/workbench/browser/actions/navigationActions.ts index 56b88fe52d6..08713b71755 100644 --- a/src/vs/workbench/browser/actions/navigationActions.ts +++ b/src/vs/workbench/browser/actions/navigationActions.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize2 } from 'vs/nls'; -import { IEditorGroupsService, GroupDirection, GroupLocation, IFindGroupScope } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; -import { Action2, IAction2Options, registerAction2 } from 'vs/platform/actions/common/actions'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { Direction } from 'vs/base/browser/ui/grid/grid'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IPaneComposite } from 'vs/workbench/common/panecomposite'; -import { IComposite } from 'vs/workbench/common/composite'; -import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; -import { ViewContainerLocation } from 'vs/workbench/common/views'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { getActiveWindow } from 'vs/base/browser/dom'; -import { isAuxiliaryWindow } from 'vs/base/browser/window'; +import { localize2 } from '../../../nls.js'; +import { IEditorGroupsService, GroupDirection, GroupLocation, IFindGroupScope } from '../../services/editor/common/editorGroupsService.js'; +import { IWorkbenchLayoutService, Parts } from '../../services/layout/browser/layoutService.js'; +import { Action2, IAction2Options, registerAction2 } from '../../../platform/actions/common/actions.js'; +import { Categories } from '../../../platform/action/common/actionCommonCategories.js'; +import { Direction } from '../../../base/browser/ui/grid/grid.js'; +import { KeyCode, KeyMod } from '../../../base/common/keyCodes.js'; +import { IEditorService } from '../../services/editor/common/editorService.js'; +import { IPaneComposite } from '../../common/panecomposite.js'; +import { IComposite } from '../../common/composite.js'; +import { IPaneCompositePartService } from '../../services/panecomposite/browser/panecomposite.js'; +import { ViewContainerLocation } from '../../common/views.js'; +import { KeybindingWeight } from '../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { getActiveWindow } from '../../../base/browser/dom.js'; +import { isAuxiliaryWindow } from '../../../base/browser/window.js'; abstract class BaseNavigationAction extends Action2 { diff --git a/src/vs/workbench/browser/actions/quickAccessActions.ts b/src/vs/workbench/browser/actions/quickAccessActions.ts index 9890994cfdf..40bfbae3bdb 100644 --- a/src/vs/workbench/browser/actions/quickAccessActions.ts +++ b/src/vs/workbench/browser/actions/quickAccessActions.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize, localize2 } from 'vs/nls'; -import { MenuId, Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { KeybindingsRegistry, KeybindingWeight, IKeybindingRule } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IQuickInputService, ItemActivation } from 'vs/platform/quickinput/common/quickInput'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { inQuickPickContext, defaultQuickAccessContext, getQuickNavigateHandler } from 'vs/workbench/browser/quickaccess'; -import { ILocalizedString } from 'vs/platform/action/common/action'; -import { AnythingQuickAccessProviderRunOptions } from 'vs/platform/quickinput/common/quickAccess'; -import { Codicon } from 'vs/base/common/codicons'; +import { localize, localize2 } from '../../../nls.js'; +import { MenuId, Action2, registerAction2 } from '../../../platform/actions/common/actions.js'; +import { KeyMod, KeyCode } from '../../../base/common/keyCodes.js'; +import { KeybindingsRegistry, KeybindingWeight, IKeybindingRule } from '../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IQuickInputService, ItemActivation } from '../../../platform/quickinput/common/quickInput.js'; +import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js'; +import { CommandsRegistry } from '../../../platform/commands/common/commands.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { inQuickPickContext, defaultQuickAccessContext, getQuickNavigateHandler } from '../quickaccess.js'; +import { ILocalizedString } from '../../../platform/action/common/action.js'; +import { AnythingQuickAccessProviderRunOptions } from '../../../platform/quickinput/common/quickAccess.js'; +import { Codicon } from '../../../base/common/codicons.js'; //#region Quick access management commands and keys @@ -163,12 +163,13 @@ registerAction2(class QuickAccessAction extends Action2 { run(accessor: ServicesAccessor): void { const quickInputService = accessor.get(IQuickInputService); + const providerOptions: AnythingQuickAccessProviderRunOptions = { + includeHelp: true, + from: 'commandCenter', + }; quickInputService.quickAccess.show(undefined, { preserveValue: true, - providerOptions: { - includeHelp: true, - from: 'commandCenter', - } as AnythingQuickAccessProviderRunOptions + providerOptions }); } }); diff --git a/src/vs/workbench/browser/actions/textInputActions.ts b/src/vs/workbench/browser/actions/textInputActions.ts index c06fb52ca30..20b277dee3c 100644 --- a/src/vs/workbench/browser/actions/textInputActions.ts +++ b/src/vs/workbench/browser/actions/textInputActions.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IAction, Action, Separator } from 'vs/base/common/actions'; -import { localize } from 'vs/nls'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { EventHelper, addDisposableListener, getActiveDocument, getWindow, isHTMLElement, isHTMLInputElement, isHTMLTextAreaElement } from 'vs/base/browser/dom'; -import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; -import { isNative } from 'vs/base/common/platform'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { Event as BaseEvent } from 'vs/base/common/event'; -import { Lazy } from 'vs/base/common/lazy'; +import { IAction, Action, Separator } from '../../../base/common/actions.js'; +import { localize } from '../../../nls.js'; +import { IWorkbenchLayoutService } from '../../services/layout/browser/layoutService.js'; +import { IContextMenuService } from '../../../platform/contextview/browser/contextView.js'; +import { Disposable } from '../../../base/common/lifecycle.js'; +import { EventHelper, addDisposableListener, getActiveDocument, getWindow, isHTMLElement, isHTMLInputElement, isHTMLTextAreaElement } from '../../../base/browser/dom.js'; +import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from '../../common/contributions.js'; +import { isNative } from '../../../base/common/platform.js'; +import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js'; +import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js'; +import { Event as BaseEvent } from '../../../base/common/event.js'; +import { Lazy } from '../../../base/common/lazy.js'; export class TextInputActionsProvider extends Disposable implements IWorkbenchContribution { diff --git a/src/vs/workbench/browser/actions/widgetNavigationCommands.ts b/src/vs/workbench/browser/actions/widgetNavigationCommands.ts index 1657bf72263..3ce130c2c32 100644 --- a/src/vs/workbench/browser/actions/widgetNavigationCommands.ts +++ b/src/vs/workbench/browser/actions/widgetNavigationCommands.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingWeight, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { WorkbenchListFocusContextKey, WorkbenchListScrollAtBottomContextKey, WorkbenchListScrollAtTopContextKey } from 'vs/platform/list/browser/listService'; -import { Event } from 'vs/base/common/event'; -import { combinedDisposable, toDisposable, IDisposable, Disposable } from 'vs/base/common/lifecycle'; -import { WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { KeyMod, KeyCode } from '../../../base/common/keyCodes.js'; +import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from '../../../platform/contextkey/common/contextkey.js'; +import { KeybindingWeight, KeybindingsRegistry } from '../../../platform/keybinding/common/keybindingsRegistry.js'; +import { WorkbenchListFocusContextKey, WorkbenchListScrollAtBottomContextKey, WorkbenchListScrollAtTopContextKey } from '../../../platform/list/browser/listService.js'; +import { Event } from '../../../base/common/event.js'; +import { combinedDisposable, toDisposable, IDisposable, Disposable } from '../../../base/common/lifecycle.js'; +import { WorkbenchPhase, registerWorkbenchContribution2 } from '../../common/contributions.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; /** INavigableContainer represents a logical container composed of widgets that can be navigated back and forth with key shortcuts */ diff --git a/src/vs/workbench/browser/actions/windowActions.ts b/src/vs/workbench/browser/actions/windowActions.ts index 26c0b61d3d1..e2248c750fb 100644 --- a/src/vs/workbench/browser/actions/windowActions.ts +++ b/src/vs/workbench/browser/actions/windowActions.ts @@ -3,38 +3,38 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize, localize2 } from 'vs/nls'; -import { IWindowOpenable } from 'vs/platform/window/common/window'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { MenuRegistry, MenuId, Action2, registerAction2, IAction2Options } from 'vs/platform/actions/common/actions'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { IsMainWindowFullscreenContext } from 'vs/workbench/common/contextkeys'; -import { IsMacNativeContext, IsDevelopmentContext, IsWebContext, IsIOSContext } from 'vs/platform/contextkey/common/contextkeys'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IQuickInputButton, IQuickInputService, IQuickPickSeparator, IKeyMods, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { IWorkspaceContextService, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { ILabelService, Verbosity } from 'vs/platform/label/common/label'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IRecent, isRecentFolder, isRecentWorkspace, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; -import { URI } from 'vs/base/common/uri'; -import { getIconClasses } from 'vs/editor/common/services/getIconClasses'; -import { FileKind } from 'vs/platform/files/common/files'; -import { splitRecentLabel } from 'vs/base/common/labels'; -import { isMacintosh, isWeb, isWindows } from 'vs/base/common/platform'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { inQuickPickContext, getQuickNavigateHandler } from 'vs/workbench/browser/quickaccess'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { ResourceMap } from 'vs/base/common/map'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { isFolderBackupInfo, isWorkspaceBackupInfo } from 'vs/platform/backup/common/backup'; -import { getActiveElement, getActiveWindow, isHTMLElement } from 'vs/base/browser/dom'; +import { localize, localize2 } from '../../../nls.js'; +import { IWindowOpenable } from '../../../platform/window/common/window.js'; +import { IDialogService } from '../../../platform/dialogs/common/dialogs.js'; +import { MenuRegistry, MenuId, Action2, registerAction2, IAction2Options } from '../../../platform/actions/common/actions.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js'; +import { IsMainWindowFullscreenContext } from '../../common/contextkeys.js'; +import { IsMacNativeContext, IsDevelopmentContext, IsWebContext, IsIOSContext } from '../../../platform/contextkey/common/contextkeys.js'; +import { Categories } from '../../../platform/action/common/actionCommonCategories.js'; +import { KeybindingsRegistry, KeybindingWeight } from '../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IQuickInputButton, IQuickInputService, IQuickPickSeparator, IKeyMods, IQuickPickItem } from '../../../platform/quickinput/common/quickInput.js'; +import { IWorkspaceContextService, IWorkspaceIdentifier } from '../../../platform/workspace/common/workspace.js'; +import { ILabelService, Verbosity } from '../../../platform/label/common/label.js'; +import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js'; +import { IModelService } from '../../../editor/common/services/model.js'; +import { ILanguageService } from '../../../editor/common/languages/language.js'; +import { IRecent, isRecentFolder, isRecentWorkspace, IWorkspacesService } from '../../../platform/workspaces/common/workspaces.js'; +import { URI } from '../../../base/common/uri.js'; +import { getIconClasses } from '../../../editor/common/services/getIconClasses.js'; +import { FileKind } from '../../../platform/files/common/files.js'; +import { splitRecentLabel } from '../../../base/common/labels.js'; +import { isMacintosh, isWeb, isWindows } from '../../../base/common/platform.js'; +import { ContextKeyExpr } from '../../../platform/contextkey/common/contextkey.js'; +import { inQuickPickContext, getQuickNavigateHandler } from '../quickaccess.js'; +import { IHostService } from '../../services/host/browser/host.js'; +import { ResourceMap } from '../../../base/common/map.js'; +import { Codicon } from '../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { CommandsRegistry } from '../../../platform/commands/common/commands.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { isFolderBackupInfo, isWorkspaceBackupInfo } from '../../../platform/backup/common/backup.js'; +import { getActiveElement, getActiveWindow, isHTMLElement } from '../../../base/browser/dom.js'; export const inRecentFilesPickerContextKey = 'inRecentFilesPicker'; diff --git a/src/vs/workbench/browser/actions/workspaceActions.ts b/src/vs/workbench/browser/actions/workspaceActions.ts index d3bb8546062..96861a697c1 100644 --- a/src/vs/workbench/browser/actions/workspaceActions.ts +++ b/src/vs/workbench/browser/actions/workspaceActions.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize, localize2 } from 'vs/nls'; -import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; -import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder, hasWorkspaceFileExtension } from 'vs/platform/workspace/common/workspace'; -import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { ADD_ROOT_FOLDER_COMMAND_ID, ADD_ROOT_FOLDER_LABEL, PICK_WORKSPACE_FOLDER_COMMAND_ID, SET_ROOT_FOLDER_COMMAND_ID } from 'vs/workbench/browser/actions/workspaceCommands'; -import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { MenuRegistry, MenuId, Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, OpenFolderWorkspaceSupportContext, WorkbenchStateContext, WorkspaceFolderCountContext } from 'vs/workbench/common/contextkeys'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IsMacNativeContext } from 'vs/platform/contextkey/common/contextkeys'; -import { ILocalizedString } from 'vs/platform/action/common/action'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; +import { localize, localize2 } from '../../../nls.js'; +import { ITelemetryData } from '../../../platform/telemetry/common/telemetry.js'; +import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder, hasWorkspaceFileExtension } from '../../../platform/workspace/common/workspace.js'; +import { IWorkspaceEditingService } from '../../services/workspaces/common/workspaceEditing.js'; +import { IEditorService } from '../../services/editor/common/editorService.js'; +import { ICommandService } from '../../../platform/commands/common/commands.js'; +import { ADD_ROOT_FOLDER_COMMAND_ID, ADD_ROOT_FOLDER_LABEL, PICK_WORKSPACE_FOLDER_COMMAND_ID, SET_ROOT_FOLDER_COMMAND_ID } from './workspaceCommands.js'; +import { IFileDialogService } from '../../../platform/dialogs/common/dialogs.js'; +import { MenuRegistry, MenuId, Action2, registerAction2 } from '../../../platform/actions/common/actions.js'; +import { EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, OpenFolderWorkspaceSupportContext, WorkbenchStateContext, WorkspaceFolderCountContext } from '../../common/contextkeys.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { IHostService } from '../../services/host/browser/host.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../base/common/keyCodes.js'; +import { ContextKeyExpr } from '../../../platform/contextkey/common/contextkey.js'; +import { IWorkbenchEnvironmentService } from '../../services/environment/common/environmentService.js'; +import { IWorkspacesService } from '../../../platform/workspaces/common/workspaces.js'; +import { KeybindingWeight } from '../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IsMacNativeContext } from '../../../platform/contextkey/common/contextkeys.js'; +import { ILocalizedString } from '../../../platform/action/common/action.js'; +import { Categories } from '../../../platform/action/common/actionCommonCategories.js'; const workspacesCategory: ILocalizedString = localize2('workspaces', 'Workspaces'); diff --git a/src/vs/workbench/browser/actions/workspaceCommands.ts b/src/vs/workbench/browser/actions/workspaceCommands.ts index 2ce4f6003b9..41ef3513a9a 100644 --- a/src/vs/workbench/browser/actions/workspaceCommands.ts +++ b/src/vs/workbench/browser/actions/workspaceCommands.ts @@ -3,27 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize, localize2 } from 'vs/nls'; -import { hasWorkspaceFileExtension, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing'; -import { dirname } from 'vs/base/common/resources'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { mnemonicButtonLabel } from 'vs/base/common/labels'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { FileKind } from 'vs/platform/files/common/files'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { IQuickInputService, IPickOptions, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { getIconClasses } from 'vs/editor/common/services/getIconClasses'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IFileDialogService, IPickAndOpenOptions } from 'vs/platform/dialogs/common/dialogs'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { Schemas } from 'vs/base/common/network'; -import { IOpenEmptyWindowOptions, IOpenWindowOptions, IWindowOpenable } from 'vs/platform/window/common/window'; -import { IRecent, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; -import { IPathService } from 'vs/workbench/services/path/common/pathService'; -import { ILocalizedString } from 'vs/platform/action/common/action'; +import { localize, localize2 } from '../../../nls.js'; +import { hasWorkspaceFileExtension, IWorkspaceContextService } from '../../../platform/workspace/common/workspace.js'; +import { IWorkspaceEditingService } from '../../services/workspaces/common/workspaceEditing.js'; +import { dirname } from '../../../base/common/resources.js'; +import { CancellationToken } from '../../../base/common/cancellation.js'; +import { mnemonicButtonLabel } from '../../../base/common/labels.js'; +import { CommandsRegistry, ICommandService } from '../../../platform/commands/common/commands.js'; +import { FileKind } from '../../../platform/files/common/files.js'; +import { ServicesAccessor } from '../../../platform/instantiation/common/instantiation.js'; +import { ILabelService } from '../../../platform/label/common/label.js'; +import { IQuickInputService, IPickOptions, IQuickPickItem } from '../../../platform/quickinput/common/quickInput.js'; +import { getIconClasses } from '../../../editor/common/services/getIconClasses.js'; +import { IModelService } from '../../../editor/common/services/model.js'; +import { ILanguageService } from '../../../editor/common/languages/language.js'; +import { IFileDialogService, IPickAndOpenOptions } from '../../../platform/dialogs/common/dialogs.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { Schemas } from '../../../base/common/network.js'; +import { IOpenEmptyWindowOptions, IOpenWindowOptions, IWindowOpenable } from '../../../platform/window/common/window.js'; +import { IRecent, IWorkspacesService } from '../../../platform/workspaces/common/workspaces.js'; +import { IPathService } from '../../services/path/common/pathService.js'; +import { ILocalizedString } from '../../../platform/action/common/action.js'; export const ADD_ROOT_FOLDER_COMMAND_ID = 'addRootFolder'; export const ADD_ROOT_FOLDER_LABEL: ILocalizedString = localize2('addFolderToWorkspace', 'Add Folder to Workspace...'); diff --git a/src/vs/workbench/browser/aideSelect.ts b/src/vs/workbench/browser/aideSelect.ts index 64fc6010548..a210a9e9ba8 100644 --- a/src/vs/workbench/browser/aideSelect.ts +++ b/src/vs/workbench/browser/aideSelect.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; -import { Disposable, DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { WorkbenchList } from 'vs/platform/list/browser/listService'; +import * as dom from '../../base/browser/dom.js'; +import { IListRenderer, IListVirtualDelegate } from '../../base/browser/ui/list/list.js'; +import { Emitter, Event } from '../../base/common/event.js'; +import { Disposable, DisposableStore, dispose, IDisposable } from '../../base/common/lifecycle.js'; +import { IInstantiationService } from '../../platform/instantiation/common/instantiation.js'; +import { WorkbenchList } from '../../platform/list/browser/listService.js'; const $ = dom.$; diff --git a/src/vs/workbench/browser/codeeditor.ts b/src/vs/workbench/browser/codeeditor.ts index dcce3224ba9..437e01b37a6 100644 --- a/src/vs/workbench/browser/codeeditor.ts +++ b/src/vs/workbench/browser/codeeditor.ts @@ -3,25 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IAction } from 'vs/base/common/actions'; -import { Emitter } from 'vs/base/common/event'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { isEqual } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference, isCodeEditor, isCompositeEditor } from 'vs/editor/browser/editorBrowser'; -import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { IRange } from 'vs/editor/common/core/range'; -import { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { IEditorContribution } from 'vs/editor/common/editorCommon'; -import { IModelDecorationsChangeAccessor, TrackedRangeStickiness } from 'vs/editor/common/model'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { AbstractFloatingClickMenu, FloatingClickWidget } from 'vs/platform/actions/browser/floatingMenu'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { IAction } from '../../base/common/actions.js'; +import { Emitter } from '../../base/common/event.js'; +import { Disposable, DisposableStore } from '../../base/common/lifecycle.js'; +import { isEqual } from '../../base/common/resources.js'; +import { URI } from '../../base/common/uri.js'; +import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference, isCodeEditor, isCompositeEditor } from '../../editor/browser/editorBrowser.js'; +import { EmbeddedCodeEditorWidget } from '../../editor/browser/widget/codeEditor/embeddedCodeEditorWidget.js'; +import { EditorOption } from '../../editor/common/config/editorOptions.js'; +import { IRange } from '../../editor/common/core/range.js'; +import { CursorChangeReason, ICursorPositionChangedEvent } from '../../editor/common/cursorEvents.js'; +import { IEditorContribution } from '../../editor/common/editorCommon.js'; +import { IModelDecorationsChangeAccessor, TrackedRangeStickiness } from '../../editor/common/model.js'; +import { ModelDecorationOptions } from '../../editor/common/model/textModel.js'; +import { AbstractFloatingClickMenu, FloatingClickWidget } from '../../platform/actions/browser/floatingMenu.js'; +import { IMenuService, MenuId } from '../../platform/actions/common/actions.js'; +import { IContextKeyService } from '../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../platform/keybinding/common/keybinding.js'; +import { IEditorService } from '../services/editor/common/editorService.js'; export interface IRangeHighlightDecoration { resource: URI; diff --git a/src/vs/workbench/browser/composite.ts b/src/vs/workbench/browser/composite.ts index d56a31212ed..8be1325c257 100644 --- a/src/vs/workbench/browser/composite.ts +++ b/src/vs/workbench/browser/composite.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IAction, IActionRunner, ActionRunner } from 'vs/base/common/actions'; -import { Component } from 'vs/workbench/common/component'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IComposite, ICompositeControl } from 'vs/workbench/common/composite'; -import { Event, Emitter } from 'vs/base/common/event'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IConstructorSignature, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { trackFocus, Dimension, IDomPosition } from 'vs/base/browser/dom'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { assertIsDefined } from 'vs/base/common/types'; -import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; -import { IBaseActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems'; +import { IAction, IActionRunner, ActionRunner } from '../../base/common/actions.js'; +import { Component } from '../common/component.js'; +import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js'; +import { IComposite, ICompositeControl } from '../common/composite.js'; +import { Event, Emitter } from '../../base/common/event.js'; +import { IThemeService } from '../../platform/theme/common/themeService.js'; +import { IConstructorSignature, IInstantiationService } from '../../platform/instantiation/common/instantiation.js'; +import { trackFocus, Dimension, IDomPosition } from '../../base/browser/dom.js'; +import { IStorageService } from '../../platform/storage/common/storage.js'; +import { Disposable } from '../../base/common/lifecycle.js'; +import { assertIsDefined } from '../../base/common/types.js'; +import { IActionViewItem } from '../../base/browser/ui/actionbar/actionbar.js'; +import { MenuId } from '../../platform/actions/common/actions.js'; +import { IBoundarySashes } from '../../base/browser/ui/sash/sash.js'; +import { IBaseActionViewItemOptions } from '../../base/browser/ui/actionbar/actionViewItems.js'; /** * Composites are layed out in the sidebar and panel part of the workbench. At a time only one composite diff --git a/src/vs/workbench/browser/contextkeys.ts b/src/vs/workbench/browser/contextkeys.ts index c22caa967b3..e5192e1dd69 100644 --- a/src/vs/workbench/browser/contextkeys.ts +++ b/src/vs/workbench/browser/contextkeys.ts @@ -3,28 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys'; -import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext } from 'vs/workbench/common/contextkeys'; -import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow } from 'vs/base/browser/dom'; -import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace'; -import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService'; -import { getRemoteName } from 'vs/platform/remote/common/remoteHosts'; -import { getVirtualWorkspaceScheme } from 'vs/platform/workspace/common/virtualWorkspace'; -import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; -import { isNative } from 'vs/base/common/platform'; -import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; -import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { getTitleBarStyle } from 'vs/platform/window/common/window'; -import { mainWindow } from 'vs/base/browser/window'; -import { isFullscreen, onDidChangeFullscreen } from 'vs/base/browser/browser'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { Event } from '../../base/common/event.js'; +import { Disposable } from '../../base/common/lifecycle.js'; +import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js'; +import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js'; +import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext } from '../common/contextkeys.js'; +import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow, isEditableElement } from '../../base/browser/dom.js'; +import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js'; +import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; +import { IWorkbenchEnvironmentService } from '../services/environment/common/environmentService.js'; +import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from '../../platform/workspace/common/workspace.js'; +import { IWorkbenchLayoutService, Parts, positionToString } from '../services/layout/browser/layoutService.js'; +import { getRemoteName } from '../../platform/remote/common/remoteHosts.js'; +import { getVirtualWorkspaceScheme } from '../../platform/workspace/common/virtualWorkspace.js'; +import { IWorkingCopyService } from '../services/workingCopy/common/workingCopyService.js'; +import { isNative } from '../../base/common/platform.js'; +import { IPaneCompositePartService } from '../services/panecomposite/browser/panecomposite.js'; +import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js'; +import { IProductService } from '../../platform/product/common/productService.js'; +import { getTitleBarStyle } from '../../platform/window/common/window.js'; +import { mainWindow } from '../../base/browser/window.js'; +import { isFullscreen, onDidChangeFullscreen } from '../../base/browser/browser.js'; +import { IEditorService } from '../services/editor/common/editorService.js'; export class WorkbenchContextKeysHandler extends Disposable { private inputFocusedContext: IContextKey; @@ -203,17 +203,16 @@ export class WorkbenchContextKeysHandler extends Disposable { private registerListeners(): void { this.editorGroupService.whenReady.then(() => { this.updateEditorAreaContextKeys(); - this.updateEditorGroupContextKeys(); + this.updateActiveEditorGroupContextKeys(); this.updateVisiblePanesContextKeys(); }); - this._register(this.editorService.onDidActiveEditorChange(() => this.updateEditorGroupContextKeys())); + this._register(this.editorService.onDidActiveEditorChange(() => this.updateActiveEditorGroupContextKeys())); this._register(this.editorService.onDidVisibleEditorsChange(() => this.updateVisiblePanesContextKeys())); - this._register(this.editorGroupService.onDidAddGroup(() => this.updateEditorGroupContextKeys())); - this._register(this.editorGroupService.onDidRemoveGroup(() => this.updateEditorGroupContextKeys())); - this._register(this.editorGroupService.onDidChangeGroupIndex(() => this.updateEditorGroupContextKeys())); - this._register(this.editorGroupService.onDidChangeActiveGroup(() => this.updateEditorGroupsContextKeys())); - this._register(this.editorGroupService.onDidChangeGroupLocked(() => this.updateEditorGroupsContextKeys())); + this._register(this.editorGroupService.onDidAddGroup(() => this.updateEditorGroupsContextKeys())); + this._register(this.editorGroupService.onDidRemoveGroup(() => this.updateEditorGroupsContextKeys())); + this._register(this.editorGroupService.onDidChangeGroupIndex(() => this.updateActiveEditorGroupContextKeys())); + this._register(this.editorGroupService.onDidChangeGroupLocked(() => this.updateActiveEditorGroupContextKeys())); this._register(this.editorGroupService.onDidChangeEditorPartOptions(() => this.updateEditorAreaContextKeys())); @@ -266,15 +265,22 @@ export class WorkbenchContextKeysHandler extends Disposable { } } - private updateEditorGroupContextKeys(): void { + // Context keys depending on the state of the editor group itself + private updateActiveEditorGroupContextKeys(): void { if (!this.editorService.activeEditor) { this.activeEditorGroupEmpty.set(true); } else { this.activeEditorGroupEmpty.reset(); } + + const activeGroup = this.editorGroupService.activeGroup; + this.activeEditorGroupIndex.set(activeGroup.index + 1); // not zero-indexed + this.activeEditorGroupLocked.set(activeGroup.isLocked); + this.updateEditorGroupsContextKeys(); } + // Context keys depending on the state of other editor groups private updateEditorGroupsContextKeys(): void { const groupCount = this.editorGroupService.count; if (groupCount > 1) { @@ -284,9 +290,7 @@ export class WorkbenchContextKeysHandler extends Disposable { } const activeGroup = this.editorGroupService.activeGroup; - this.activeEditorGroupIndex.set(activeGroup.index + 1); // not zero-indexed this.activeEditorGroupLast.set(activeGroup.index === groupCount - 1); - this.activeEditorGroupLocked.set(activeGroup.isLocked); } private updateEditorAreaContextKeys(): void { @@ -296,7 +300,7 @@ export class WorkbenchContextKeysHandler extends Disposable { private updateInputContextKeys(ownerDocument: Document): void { function activeElementIsInput(): boolean { - return !!ownerDocument.activeElement && (ownerDocument.activeElement.tagName === 'INPUT' || ownerDocument.activeElement.tagName === 'TEXTAREA'); + return !!ownerDocument.activeElement && isEditableElement(ownerDocument.activeElement); } const isInputFocused = activeElementIsInput(); diff --git a/src/vs/workbench/browser/dnd.ts b/src/vs/workbench/browser/dnd.ts index 3fa36301d9c..21db5428096 100644 --- a/src/vs/workbench/browser/dnd.ts +++ b/src/vs/workbench/browser/dnd.ts @@ -3,40 +3,40 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DataTransfers, IDragAndDropData } from 'vs/base/browser/dnd'; -import { DragAndDropObserver, EventType, addDisposableListener, onDidRegisterWindow } from 'vs/base/browser/dom'; -import { DragMouseEvent } from 'vs/base/browser/mouseEvent'; -import { IListDragAndDrop } from 'vs/base/browser/ui/list/list'; -import { ElementsDragAndDropData, ListViewTargetSector } from 'vs/base/browser/ui/list/listView'; -import { ITreeDragOverReaction } from 'vs/base/browser/ui/tree/tree'; -import { coalesce } from 'vs/base/common/arrays'; -import { UriList, VSDataTransfer } from 'vs/base/common/dataTransfer'; -import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, IDisposable, markAsSingleton } from 'vs/base/common/lifecycle'; -import { stringify } from 'vs/base/common/marshalling'; -import { Mimes } from 'vs/base/common/mime'; -import { FileAccess, Schemas } from 'vs/base/common/network'; -import { isWindows } from 'vs/base/common/platform'; -import { basename, isEqual } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { CodeDataTransfers, Extensions, IDragAndDropContributionRegistry, IDraggedResourceEditorInput, IResourceStat, LocalSelectionTransfer, createDraggedEditorInputFromRawResourcesData, extractEditorsAndFilesDropData } from 'vs/platform/dnd/browser/dnd'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { extractSelection } from 'vs/platform/opener/common/opener'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IWindowOpenable } from 'vs/platform/window/common/window'; -import { IWorkspaceContextService, hasWorkspaceFileExtension, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace'; -import { IWorkspaceFolderCreationData, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; -import { EditorResourceAccessor, GroupIdentifier, IEditorIdentifier, isEditorIdentifier, isResourceDiffEditorInput, isResourceMergeEditorInput, isResourceSideBySideEditorInput } from 'vs/workbench/common/editor'; -import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing'; -import { IEditorOptions } from 'vs/platform/editor/common/editor'; -import { mainWindow } from 'vs/base/browser/window'; -import { BroadcastDataChannel } from 'vs/base/browser/broadcast'; +import { DataTransfers, IDragAndDropData } from '../../base/browser/dnd.js'; +import { DragAndDropObserver, EventType, addDisposableListener, onDidRegisterWindow } from '../../base/browser/dom.js'; +import { DragMouseEvent } from '../../base/browser/mouseEvent.js'; +import { IListDragAndDrop } from '../../base/browser/ui/list/list.js'; +import { ElementsDragAndDropData, ListViewTargetSector } from '../../base/browser/ui/list/listView.js'; +import { ITreeDragOverReaction } from '../../base/browser/ui/tree/tree.js'; +import { coalesce } from '../../base/common/arrays.js'; +import { UriList, VSDataTransfer } from '../../base/common/dataTransfer.js'; +import { Emitter, Event } from '../../base/common/event.js'; +import { Disposable, DisposableStore, IDisposable, markAsSingleton } from '../../base/common/lifecycle.js'; +import { stringify } from '../../base/common/marshalling.js'; +import { Mimes } from '../../base/common/mime.js'; +import { FileAccess, Schemas } from '../../base/common/network.js'; +import { isWindows } from '../../base/common/platform.js'; +import { basename, isEqual } from '../../base/common/resources.js'; +import { URI } from '../../base/common/uri.js'; +import { CodeDataTransfers, Extensions, IDragAndDropContributionRegistry, IDraggedResourceEditorInput, IResourceStat, LocalSelectionTransfer, createDraggedEditorInputFromRawResourcesData, extractEditorsAndFilesDropData } from '../../platform/dnd/browser/dnd.js'; +import { IFileService } from '../../platform/files/common/files.js'; +import { IInstantiationService, ServicesAccessor } from '../../platform/instantiation/common/instantiation.js'; +import { ILabelService } from '../../platform/label/common/label.js'; +import { extractSelection } from '../../platform/opener/common/opener.js'; +import { Registry } from '../../platform/registry/common/platform.js'; +import { IWindowOpenable } from '../../platform/window/common/window.js'; +import { IWorkspaceContextService, hasWorkspaceFileExtension, isTemporaryWorkspace } from '../../platform/workspace/common/workspace.js'; +import { IWorkspaceFolderCreationData, IWorkspacesService } from '../../platform/workspaces/common/workspaces.js'; +import { EditorResourceAccessor, GroupIdentifier, IEditorIdentifier, isEditorIdentifier, isResourceDiffEditorInput, isResourceMergeEditorInput, isResourceSideBySideEditorInput } from '../common/editor.js'; +import { IEditorGroup } from '../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../services/editor/common/editorService.js'; +import { IHostService } from '../services/host/browser/host.js'; +import { ITextFileService } from '../services/textfile/common/textfiles.js'; +import { IWorkspaceEditingService } from '../services/workspaces/common/workspaceEditing.js'; +import { IEditorOptions } from '../../platform/editor/common/editor.js'; +import { mainWindow } from '../../base/browser/window.js'; +import { BroadcastDataChannel } from '../../base/browser/broadcast.js'; //#region Editor / Resources DND diff --git a/src/vs/workbench/browser/editor.ts b/src/vs/workbench/browser/editor.ts index d5e1a7f3391..0bfa0e3285d 100644 --- a/src/vs/workbench/browser/editor.ts +++ b/src/vs/workbench/browser/editor.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { EditorResourceAccessor, EditorExtensions, SideBySideEditor, IEditorDescriptor as ICommonEditorDescriptor, EditorCloseContext, IWillInstantiateEditorPaneEvent } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane'; -import { IConstructorSignature, IInstantiationService, BrandedService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { Promises } from 'vs/base/common/async'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; -import { URI } from 'vs/base/common/uri'; -import { Schemas } from 'vs/base/common/network'; -import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { Iterable } from 'vs/base/common/iterator'; -import { Emitter } from 'vs/base/common/event'; +import { localize } from '../../nls.js'; +import { EditorResourceAccessor, EditorExtensions, SideBySideEditor, IEditorDescriptor as ICommonEditorDescriptor, EditorCloseContext, IWillInstantiateEditorPaneEvent } from '../common/editor.js'; +import { EditorInput } from '../common/editor/editorInput.js'; +import { SyncDescriptor } from '../../platform/instantiation/common/descriptors.js'; +import { Registry } from '../../platform/registry/common/platform.js'; +import { EditorPane } from './parts/editor/editorPane.js'; +import { IConstructorSignature, IInstantiationService, BrandedService, ServicesAccessor } from '../../platform/instantiation/common/instantiation.js'; +import { IDisposable, toDisposable } from '../../base/common/lifecycle.js'; +import { Promises } from '../../base/common/async.js'; +import { IEditorService } from '../services/editor/common/editorService.js'; +import { IUriIdentityService } from '../../platform/uriIdentity/common/uriIdentity.js'; +import { IWorkingCopyService } from '../services/workingCopy/common/workingCopyService.js'; +import { URI } from '../../base/common/uri.js'; +import { Schemas } from '../../base/common/network.js'; +import { IEditorGroup } from '../services/editor/common/editorGroupsService.js'; +import { Iterable } from '../../base/common/iterator.js'; +import { Emitter } from '../../base/common/event.js'; //#region Editor Pane Registry diff --git a/src/vs/workbench/browser/heroicon.ts b/src/vs/workbench/browser/heroicon.ts index 42b6bb5f100..e14ecbf8845 100644 --- a/src/vs/workbench/browser/heroicon.ts +++ b/src/vs/workbench/browser/heroicon.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SVGSprite } from 'vs/workbench/browser/svgSprite'; +import { SVGSprite } from './svgSprite.js'; function assignSize(id: string) { const size = id.split('/').at(0); diff --git a/src/vs/workbench/browser/labels.ts b/src/vs/workbench/browser/labels.ts index 0c9fc4e9e54..f83bdc050b8 100644 --- a/src/vs/workbench/browser/labels.ts +++ b/src/vs/workbench/browser/labels.ts @@ -3,29 +3,29 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { URI } from 'vs/base/common/uri'; -import { dirname, isEqual, basenameOrAuthority } from 'vs/base/common/resources'; -import { IconLabel, IIconLabelValueOptions, IIconLabelCreationOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IDecoration, IDecorationsService, IResourceDecorationChangeEvent } from 'vs/workbench/services/decorations/common/decorations'; -import { Schemas } from 'vs/base/common/network'; -import { FileKind, FILES_ASSOCIATIONS_CONFIG } from 'vs/platform/files/common/files'; -import { ITextModel } from 'vs/editor/common/model'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { Event, Emitter } from 'vs/base/common/event'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { getIconClasses } from 'vs/editor/common/services/getIconClasses'; -import { Disposable, dispose, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { normalizeDriveLetter } from 'vs/base/common/labels'; -import { IRange } from 'vs/editor/common/core/range'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { INotebookDocumentService } from 'vs/workbench/services/notebook/common/notebookDocumentService'; +import { localize } from '../../nls.js'; +import { URI } from '../../base/common/uri.js'; +import { dirname, isEqual, basenameOrAuthority } from '../../base/common/resources.js'; +import { IconLabel, IIconLabelValueOptions, IIconLabelCreationOptions } from '../../base/browser/ui/iconLabel/iconLabel.js'; +import { ILanguageService } from '../../editor/common/languages/language.js'; +import { IWorkspaceContextService } from '../../platform/workspace/common/workspace.js'; +import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; +import { IModelService } from '../../editor/common/services/model.js'; +import { ITextFileService } from '../services/textfile/common/textfiles.js'; +import { IDecoration, IDecorationsService, IResourceDecorationChangeEvent } from '../services/decorations/common/decorations.js'; +import { Schemas } from '../../base/common/network.js'; +import { FileKind, FILES_ASSOCIATIONS_CONFIG } from '../../platform/files/common/files.js'; +import { ITextModel } from '../../editor/common/model.js'; +import { IThemeService } from '../../platform/theme/common/themeService.js'; +import { Event, Emitter } from '../../base/common/event.js'; +import { ILabelService } from '../../platform/label/common/label.js'; +import { getIconClasses } from '../../editor/common/services/getIconClasses.js'; +import { Disposable, dispose, IDisposable, MutableDisposable } from '../../base/common/lifecycle.js'; +import { IInstantiationService } from '../../platform/instantiation/common/instantiation.js'; +import { normalizeDriveLetter } from '../../base/common/labels.js'; +import { IRange } from '../../editor/common/core/range.js'; +import { ThemeIcon } from '../../base/common/themables.js'; +import { INotebookDocumentService } from '../services/notebook/common/notebookDocumentService.js'; export interface IResourceLabelProps { resource?: URI | { primary?: URI; secondary?: URI }; diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index 2bfa5b121b8..711fbe19e0f 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -3,53 +3,53 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, DisposableMap, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { Event, Emitter } from 'vs/base/common/event'; -import { EventType, addDisposableListener, getClientArea, position, size, IDimension, isAncestorUsingFlowTo, computeScreenAwareSize, getActiveDocument, getWindows, getActiveWindow, isActiveDocument, getWindow, getWindowId, getActiveElement } from 'vs/base/browser/dom'; -import { onDidChangeFullscreen, isFullscreen, isWCOEnabled } from 'vs/base/browser/browser'; -import { IWorkingCopyBackupService } from 'vs/workbench/services/workingCopy/common/workingCopyBackup'; -import { isWindows, isLinux, isMacintosh, isWeb, isIOS } from 'vs/base/common/platform'; -import { EditorInputCapabilities, GroupIdentifier, isResourceEditorInput, IUntypedEditorInput, pathsToEditors } from 'vs/workbench/common/editor'; -import { SidebarPart } from 'vs/workbench/browser/parts/sidebar/sidebarPart'; -import { PanelPart } from 'vs/workbench/browser/parts/panel/panelPart'; -import { Position, Parts, PanelOpensMaximizedOptions, IWorkbenchLayoutService, positionFromString, positionToString, panelOpensMaximizedFromString, PanelAlignment, ActivityBarPosition, LayoutSettings, MULTI_WINDOW_PARTS, SINGLE_WINDOW_PARTS, ZenModeSettings, EditorTabsMode, EditorActionsLocation, shouldShowCustomTitleBar, OverlayedParts } from 'vs/workbench/services/layout/browser/layoutService'; -import { isTemporaryWorkspace, IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ITitleService } from 'vs/workbench/services/title/browser/titleService'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { StartupKind, ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { getMenuBarVisibility, CustomTitleBarVisibility, IPath, hasNativeTitlebar, hasCustomTitlebar, TitleBarSetting } from 'vs/platform/window/common/window'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { EditorGroupLayout, GroupsOrder, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { SerializableGrid, ISerializableView, ISerializedGrid, Orientation, ISerializedNode, ISerializedLeafNode, Direction, IViewSize, Sizing } from 'vs/base/browser/ui/grid/grid'; -import { IObservableView, Part } from 'vs/workbench/browser/part'; -import { IStatusbarService } from 'vs/workbench/services/statusbar/browser/statusbar'; -import { IFileService } from 'vs/platform/files/common/files'; -import { isCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { coalesce } from 'vs/base/common/arrays'; -import { assertIsDefined } from 'vs/base/common/types'; -import { INotificationService, NotificationsFilter } from 'vs/platform/notification/common/notification'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { WINDOW_ACTIVE_BORDER, WINDOW_INACTIVE_BORDER } from 'vs/workbench/common/theme'; -import { LineNumbersType } from 'vs/editor/common/config/editorOptions'; -import { URI } from 'vs/base/common/uri'; -import { IViewDescriptorService, ViewContainerLocation } from 'vs/workbench/common/views'; -import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; -import { mark } from 'vs/base/common/performance'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { ILogService } from 'vs/platform/log/common/log'; -import { DeferredPromise, Promises } from 'vs/base/common/async'; -import { IBannerService } from 'vs/workbench/services/banner/browser/bannerService'; -import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; -import { AuxiliaryBarPart } from 'vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IAuxiliaryWindowService } from 'vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService'; -import { CodeWindow, mainWindow } from 'vs/base/browser/window'; -import { IBottomBarPartService } from 'vs/workbench/services/bottomBarPart/browser/bottomBarPartService'; -import { OverlayedPart } from 'vs/workbench/browser/overlayedPart'; +import { Disposable, DisposableMap, DisposableStore, IDisposable, toDisposable } from '../../base/common/lifecycle.js'; +import { Event, Emitter } from '../../base/common/event.js'; +import { EventType, addDisposableListener, getClientArea, position, size, IDimension, isAncestorUsingFlowTo, computeScreenAwareSize, getActiveDocument, getWindows, getActiveWindow, isActiveDocument, getWindow, getWindowId, getActiveElement } from '../../base/browser/dom.js'; +import { onDidChangeFullscreen, isFullscreen, isWCOEnabled } from '../../base/browser/browser.js'; +import { IWorkingCopyBackupService } from '../services/workingCopy/common/workingCopyBackup.js'; +import { isWindows, isLinux, isMacintosh, isWeb, isIOS } from '../../base/common/platform.js'; +import { EditorInputCapabilities, GroupIdentifier, isResourceEditorInput, IUntypedEditorInput, pathsToEditors } from '../common/editor.js'; +import { SidebarPart } from './parts/sidebar/sidebarPart.js'; +import { PanelPart } from './parts/panel/panelPart.js'; +import { Position, Parts, PanelOpensMaximizedOptions, IWorkbenchLayoutService, positionFromString, positionToString, panelOpensMaximizedFromString, PanelAlignment, ActivityBarPosition, LayoutSettings, MULTI_WINDOW_PARTS, SINGLE_WINDOW_PARTS, ZenModeSettings, EditorTabsMode, EditorActionsLocation, shouldShowCustomTitleBar, isHorizontal, OverlayedParts } from '../services/layout/browser/layoutService.js'; +import { isTemporaryWorkspace, IWorkspaceContextService, WorkbenchState } from '../../platform/workspace/common/workspace.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../platform/storage/common/storage.js'; +import { IConfigurationChangeEvent, IConfigurationService } from '../../platform/configuration/common/configuration.js'; +import { ITitleService } from '../services/title/browser/titleService.js'; +import { ServicesAccessor } from '../../platform/instantiation/common/instantiation.js'; +import { StartupKind, ILifecycleService } from '../services/lifecycle/common/lifecycle.js'; +import { getMenuBarVisibility, IPath, hasNativeTitlebar, hasCustomTitlebar, TitleBarSetting, CustomTitleBarVisibility, useWindowControlsOverlay } from '../../platform/window/common/window.js'; +import { IHostService } from '../services/host/browser/host.js'; +import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService.js'; +import { IEditorService } from '../services/editor/common/editorService.js'; +import { EditorGroupLayout, GroupsOrder, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js'; +import { SerializableGrid, ISerializableView, ISerializedGrid, Orientation, ISerializedNode, ISerializedLeafNode, Direction, IViewSize, Sizing } from '../../base/browser/ui/grid/grid.js'; +import { IObservableView, Part } from './part.js'; +import { IStatusbarService } from '../services/statusbar/browser/statusbar.js'; +import { IFileService } from '../../platform/files/common/files.js'; +import { isCodeEditor } from '../../editor/browser/editorBrowser.js'; +import { coalesce } from '../../base/common/arrays.js'; +import { assertIsDefined } from '../../base/common/types.js'; +import { INotificationService, NotificationsFilter } from '../../platform/notification/common/notification.js'; +import { IThemeService } from '../../platform/theme/common/themeService.js'; +import { WINDOW_ACTIVE_BORDER, WINDOW_INACTIVE_BORDER } from '../common/theme.js'; +import { LineNumbersType } from '../../editor/common/config/editorOptions.js'; +import { URI } from '../../base/common/uri.js'; +import { IViewDescriptorService, ViewContainerLocation } from '../common/views.js'; +import { DiffEditorInput } from '../common/editor/diffEditorInput.js'; +import { mark } from '../../base/common/performance.js'; +import { IExtensionService } from '../services/extensions/common/extensions.js'; +import { ILogService } from '../../platform/log/common/log.js'; +import { DeferredPromise, Promises } from '../../base/common/async.js'; +import { IBannerService } from '../services/banner/browser/bannerService.js'; +import { IPaneCompositePartService } from '../services/panecomposite/browser/panecomposite.js'; +import { AuxiliaryBarPart } from './parts/auxiliarybar/auxiliaryBarPart.js'; +import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js'; +import { IAuxiliaryWindowService } from '../services/auxiliaryWindow/browser/auxiliaryWindowService.js'; +import { CodeWindow, mainWindow } from '../../base/browser/window.js'; +import { OverlayedPart } from './overlayedPart.js'; +import { IBottomBarPartService } from '../services/bottomBarPart/browser/bottomBarPartService.js'; //#region Layout Implementation @@ -565,7 +565,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi private updateWindowsBorder(skipLayout = false) { if ( isWeb || - isWindows || // not working well with zooming and window control overlays + isWindows || // not working well with zooming (border often not visible) + useWindowControlsOverlay(this.configurationService) || // not working with WCO (border cannot draw over the overlay) hasNativeTitlebar(this.configurationService) ) { return; @@ -640,7 +641,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi // Layout Initialization State const initialEditorsState = this.getInitialEditorsState(); if (initialEditorsState) { - this.logService.info('Initial editor state', initialEditorsState); + this.logService.trace('Initial editor state', initialEditorsState); } const initialLayoutState: ILayoutInitializationState = { layout: { @@ -676,6 +677,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi runtime: layoutRuntimeState, }; + const isNewWindow = lifecycleService.startupKind === StartupKind.NewWindow; + const activityBarNotDefault = this.configurationService.getValue(LayoutSettings.ACTIVITY_BAR_LOCATION) !== ActivityBarPosition.DEFAULT; + // Sidebar View Container To Restore if (this.isVisible(Parts.SIDEBAR_PART)) { @@ -697,6 +701,15 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi this.stateModel.setRuntimeValue(LayoutStateKeys.SIDEBAR_HIDDEN, true); } } + // Side bar is hidden and a new window is opened with activity bar not visible (not default) + else if (isNewWindow && activityBarNotDefault) { + // Open side bar if there is a view container to restore + const viewContainerToRestore = this.storageService.get(SidebarPart.activeViewletSettingsKey, StorageScope.WORKSPACE, this.viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id); + if (viewContainerToRestore) { + this.state.initialization.views.containerToRestore.sideBar = viewContainerToRestore; + this.stateModel.setRuntimeValue(LayoutStateKeys.SIDEBAR_HIDDEN, false); + } + } // Panel View Container To Restore if (this.isVisible(Parts.PANEL_PART)) { @@ -1287,18 +1300,17 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi const containerDimension = this.getContainerDimension(container); if (container === this.mainContainer) { - const panelPosition = this.getPanelPosition(); - const isColumn = panelPosition === Position.RIGHT || panelPosition === Position.LEFT; + const isPanelHorizontal = isHorizontal(this.getPanelPosition()); const takenWidth = (this.isVisible(Parts.ACTIVITYBAR_PART) ? this.activityBarPartView.minimumWidth : 0) + (this.isVisible(Parts.SIDEBAR_PART) ? this.sideBarPartView.minimumWidth : 0) + - (this.isVisible(Parts.PANEL_PART) && isColumn ? this.panelPartView.minimumWidth : 0) + + (this.isVisible(Parts.PANEL_PART) && !isPanelHorizontal ? this.panelPartView.minimumWidth : 0) + (this.isVisible(Parts.AUXILIARYBAR_PART) ? this.auxiliaryBarPartView.minimumWidth : 0); const takenHeight = (this.isVisible(Parts.TITLEBAR_PART, targetWindow) ? this.titleBarPartView.minimumHeight : 0) + (this.isVisible(Parts.STATUSBAR_PART, targetWindow) ? this.statusBarPartView.minimumHeight : 0) + - (this.isVisible(Parts.PANEL_PART) && !isColumn ? this.panelPartView.minimumHeight : 0); + (this.isVisible(Parts.PANEL_PART) && isPanelHorizontal ? this.panelPartView.minimumHeight : 0); const availableWidth = containerDimension.width - takenWidth; const availableHeight = containerDimension.height - takenHeight; @@ -1573,7 +1585,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi // Panel Size const panelSize = this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_HIDDEN) ? this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView) - : (this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_POSITION) === Position.BOTTOM ? this.workbenchGrid.getViewSize(this.panelPartView).height : this.workbenchGrid.getViewSize(this.panelPartView).width); + : isHorizontal(this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_POSITION)) + ? this.workbenchGrid.getViewSize(this.panelPartView).height + : this.workbenchGrid.getViewSize(this.panelPartView).width; this.stateModel.setInitializationValue(LayoutStateKeys.PANEL_SIZE, panelSize as number); // Auxiliary Bar Size @@ -1677,8 +1691,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi this.workbenchGrid.resizeView(this.panelPartView, { - width: viewSize.width + (this.getPanelPosition() !== Position.BOTTOM ? sizeChangePxWidth : 0), - height: viewSize.height + (this.getPanelPosition() !== Position.BOTTOM ? 0 : sizeChangePxHeight) + width: viewSize.width + (isHorizontal(this.getPanelPosition()) ? 0 : sizeChangePxWidth), + height: viewSize.height + (isHorizontal(this.getPanelPosition()) ? sizeChangePxHeight : 0) }); break; @@ -1811,8 +1825,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi private adjustPartPositions(sideBarPosition: Position, panelAlignment: PanelAlignment, panelPosition: Position): void { // Move activity bar and side bars - const sideBarSiblingToEditor = panelPosition !== Position.BOTTOM || !(panelAlignment === 'center' || (sideBarPosition === Position.LEFT && panelAlignment === 'right') || (sideBarPosition === Position.RIGHT && panelAlignment === 'left')); - const auxiliaryBarSiblingToEditor = panelPosition !== Position.BOTTOM || !(panelAlignment === 'center' || (sideBarPosition === Position.RIGHT && panelAlignment === 'right') || (sideBarPosition === Position.LEFT && panelAlignment === 'left')); + const isPanelVertical = !isHorizontal(panelPosition); + const sideBarSiblingToEditor = isPanelVertical || !(panelAlignment === 'center' || (sideBarPosition === Position.LEFT && panelAlignment === 'right') || (sideBarPosition === Position.RIGHT && panelAlignment === 'left')); + const auxiliaryBarSiblingToEditor = isPanelVertical || !(panelAlignment === 'center' || (sideBarPosition === Position.RIGHT && panelAlignment === 'right') || (sideBarPosition === Position.LEFT && panelAlignment === 'left')); const preMovePanelWidth = !this.isVisible(Parts.PANEL_PART) ? Sizing.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView) ?? this.panelPartView.minimumWidth) : this.workbenchGrid.getViewSize(this.panelPartView).width; const preMovePanelHeight = !this.isVisible(Parts.PANEL_PART) ? Sizing.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView) ?? this.panelPartView.minimumHeight) : this.workbenchGrid.getViewSize(this.panelPartView).height; const preMoveSideBarSize = !this.isVisible(Parts.SIDEBAR_PART) ? Sizing.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.sideBarPartView) ?? this.sideBarPartView.minimumWidth) : this.workbenchGrid.getViewSize(this.sideBarPartView).width; @@ -1838,7 +1853,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi // We moved all the side parts based on the editor and ignored the panel // Now, we need to put the panel back in the right position when it is next to the editor - if (panelPosition !== Position.BOTTOM) { + if (isPanelVertical) { this.workbenchGrid.moveView(this.panelPartView, preMovePanelWidth, this.editorPartView, panelPosition === Position.LEFT ? Direction.Left : Direction.Right); this.workbenchGrid.resizeView(this.panelPartView, { height: preMovePanelHeight as number, @@ -1865,8 +1880,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi setPanelAlignment(alignment: PanelAlignment, skipLayout?: boolean): void { - // Panel alignment only applies to a panel in the bottom position - if (this.getPanelPosition() !== Position.BOTTOM) { + // Panel alignment only applies to a panel in the top/bottom position + if (!isHorizontal(this.getPanelPosition())) { this.setPanelPosition(Position.BOTTOM); } @@ -1962,7 +1977,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi const isMaximized = this.isPanelMaximized(); if (!isMaximized) { if (this.isVisible(Parts.PANEL_PART)) { - if (panelPosition === Position.BOTTOM) { + if (isHorizontal(panelPosition)) { this.stateModel.setRuntimeValue(LayoutStateKeys.PANEL_LAST_NON_MAXIMIZED_HEIGHT, size.height); } else { this.stateModel.setRuntimeValue(LayoutStateKeys.PANEL_LAST_NON_MAXIMIZED_WIDTH, size.width); @@ -1973,8 +1988,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } else { this.setEditorHidden(false); this.workbenchGrid.resizeView(this.panelPartView, { - width: panelPosition === Position.BOTTOM ? size.width : this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_LAST_NON_MAXIMIZED_WIDTH), - height: panelPosition === Position.BOTTOM ? this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_LAST_NON_MAXIMIZED_HEIGHT) : size.height + width: isHorizontal(panelPosition) ? size.width : this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_LAST_NON_MAXIMIZED_WIDTH), + height: isHorizontal(panelPosition) ? this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_LAST_NON_MAXIMIZED_HEIGHT) : size.height }); } @@ -1984,7 +1999,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi private panelOpensMaximized(): boolean { // The workbench grid currently prevents us from supporting panel maximization with non-center panel alignment - if (this.getPanelAlignment() !== 'center' && this.getPanelPosition() === Position.BOTTOM) { + if (this.getPanelAlignment() !== 'center' && isHorizontal(this.getPanelPosition())) { return false; } @@ -2062,7 +2077,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi isPanelMaximized(): boolean { // the workbench grid currently prevents us from supporting panel maximization with non-center panel alignment - return (this.getPanelAlignment() === 'center' || this.getPanelPosition() !== Position.BOTTOM) && !this.isVisible(Parts.EDITOR_PART, mainWindow); + return (this.getPanelAlignment() === 'center' || !isHorizontal(this.getPanelPosition())) && !this.isVisible(Parts.EDITOR_PART, mainWindow); } getSideBarPosition(): Position { @@ -2138,14 +2153,14 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi // Save the current size of the panel for the new orthogonal direction // If moving down, save the width of the panel // Otherwise, save the height of the panel - if (position === Position.BOTTOM) { + if (isHorizontal(position)) { this.stateModel.setRuntimeValue(LayoutStateKeys.PANEL_LAST_NON_MAXIMIZED_WIDTH, size.width); - } else if (positionFromString(oldPositionValue) === Position.BOTTOM) { + } else if (isHorizontal(positionFromString(oldPositionValue))) { this.stateModel.setRuntimeValue(LayoutStateKeys.PANEL_LAST_NON_MAXIMIZED_HEIGHT, size.height); } } - if (position === Position.BOTTOM && this.getPanelAlignment() !== 'center' && editorHidden) { + if (isHorizontal(position) && this.getPanelAlignment() !== 'center' && editorHidden) { this.toggleMaximizedPanel(); editorHidden = false; } @@ -2157,6 +2172,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi if (position === Position.BOTTOM) { this.workbenchGrid.moveView(this.panelPartView, editorHidden ? size.height : this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_LAST_NON_MAXIMIZED_HEIGHT), this.editorPartView, Direction.Down); + } else if (position === Position.TOP) { + this.workbenchGrid.moveView(this.panelPartView, editorHidden ? size.height : this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_LAST_NON_MAXIMIZED_HEIGHT), this.editorPartView, Direction.Up); } else if (position === Position.RIGHT) { this.workbenchGrid.moveView(this.panelPartView, editorHidden ? size.width : this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_LAST_NON_MAXIMIZED_WIDTH), this.editorPartView, Direction.Right); } else { @@ -2174,7 +2191,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi this.setAuxiliaryBarHidden(true); } - if (position === Position.BOTTOM) { + if (isHorizontal(position)) { this.adjustPartPositions(this.getSideBarPosition(), this.getPanelAlignment(), position); } @@ -2293,17 +2310,20 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi const auxiliaryBarSize = this.stateModel.getRuntimeValue(LayoutStateKeys.AUXILIARYBAR_HIDDEN) ? 0 : nodes.auxiliaryBar.size; const panelSize = this.stateModel.getInitializationValue(LayoutStateKeys.PANEL_SIZE) ? 0 : nodes.panel.size; + const panelPostion = this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_POSITION); + const sideBarPosition = this.stateModel.getRuntimeValue(LayoutStateKeys.SIDEBAR_POSITON); + const result = [] as ISerializedNode[]; - if (this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_POSITION) !== Position.BOTTOM) { + if (!isHorizontal(panelPostion)) { result.push(nodes.editor); nodes.editor.size = availableWidth - activityBarSize - sideBarSize - panelSize - auxiliaryBarSize; - if (this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_POSITION) === Position.RIGHT) { + if (panelPostion === Position.RIGHT) { result.push(nodes.panel); } else { result.splice(0, 0, nodes.panel); } - if (this.stateModel.getRuntimeValue(LayoutStateKeys.SIDEBAR_POSITON) === Position.LEFT) { + if (sideBarPosition === Position.LEFT) { result.push(nodes.auxiliaryBar); result.splice(0, 0, nodes.sideBar); result.splice(0, 0, nodes.activityBar); @@ -2314,18 +2334,20 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } } else { const panelAlignment = this.stateModel.getRuntimeValue(LayoutStateKeys.PANEL_ALIGNMENT); - const sideBarPosition = this.stateModel.getRuntimeValue(LayoutStateKeys.SIDEBAR_POSITON); const sideBarNextToEditor = !(panelAlignment === 'center' || (sideBarPosition === Position.LEFT && panelAlignment === 'right') || (sideBarPosition === Position.RIGHT && panelAlignment === 'left')); const auxiliaryBarNextToEditor = !(panelAlignment === 'center' || (sideBarPosition === Position.RIGHT && panelAlignment === 'right') || (sideBarPosition === Position.LEFT && panelAlignment === 'left')); const editorSectionWidth = availableWidth - activityBarSize - (sideBarNextToEditor ? 0 : sideBarSize) - (auxiliaryBarNextToEditor ? 0 : auxiliaryBarSize); + + const editorNodes = this.arrangeEditorNodes({ + editor: nodes.editor, + sideBar: sideBarNextToEditor ? nodes.sideBar : undefined, + auxiliaryBar: auxiliaryBarNextToEditor ? nodes.auxiliaryBar : undefined + }, availableHeight - panelSize, editorSectionWidth); + result.push({ type: 'branch', - data: [this.arrangeEditorNodes({ - editor: nodes.editor, - sideBar: sideBarNextToEditor ? nodes.sideBar : undefined, - auxiliaryBar: auxiliaryBarNextToEditor ? nodes.auxiliaryBar : undefined - }, availableHeight - panelSize, editorSectionWidth), nodes.bottomBar, nodes.panel], + data: panelPostion === Position.BOTTOM ? [editorNodes, nodes.panel] : [nodes.panel, editorNodes], size: editorSectionWidth }); @@ -2476,7 +2498,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi panelVisible: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether or the not the panel is visible' }; statusbarVisible: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether or the not the status bar is visible' }; sideBarPosition: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the primary side bar is on the left or right' }; - panelPosition: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the panel is on the bottom, left, or right' }; + panelPosition: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the panel is on the top, bottom, left, or right' }; }; const layoutDescriptor: StartupLayoutEvent = { @@ -2684,7 +2706,7 @@ class LayoutStateModel extends Disposable { LayoutStateKeys.GRID_SIZE.defaultValue = { height: workbenchDimensions.height, width: workbenchDimensions.width }; LayoutStateKeys.SIDEBAR_SIZE.defaultValue = Math.min(300, workbenchDimensions.width / 4); LayoutStateKeys.AUXILIARYBAR_SIZE.defaultValue = Math.min(300, workbenchDimensions.width / 4); - LayoutStateKeys.PANEL_SIZE.defaultValue = (this.stateCache.get(LayoutStateKeys.PANEL_POSITION.name) ?? LayoutStateKeys.PANEL_POSITION.defaultValue) === Position.BOTTOM ? workbenchDimensions.height / 3 : workbenchDimensions.width / 4; + LayoutStateKeys.PANEL_SIZE.defaultValue = (this.stateCache.get(LayoutStateKeys.PANEL_POSITION.name) ?? isHorizontal(LayoutStateKeys.PANEL_POSITION.defaultValue)) ? workbenchDimensions.height / 3 : workbenchDimensions.width / 4; LayoutStateKeys.SIDEBAR_HIDDEN.defaultValue = this.contextService.getWorkbenchState() === WorkbenchState.EMPTY; // Apply all defaults diff --git a/src/vs/workbench/browser/overlayedPart.ts b/src/vs/workbench/browser/overlayedPart.ts index b64cf0917e9..05f19bd754e 100644 --- a/src/vs/workbench/browser/overlayedPart.ts +++ b/src/vs/workbench/browser/overlayedPart.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/part'; -import { Component } from 'vs/workbench/common/component'; -import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService'; -import { IDimension } from 'vs/base/browser/dom'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { Emitter } from 'vs/base/common/event'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; +import { IDimension } from '../../base/browser/dom.js'; +import { Emitter } from '../../base/common/event.js'; +import { IStorageService } from '../../platform/storage/common/storage.js'; +import { IColorTheme, IThemeService } from '../../platform/theme/common/themeService.js'; +import { Component } from '../common/component.js'; +import { IWorkbenchLayoutService } from '../services/layout/browser/layoutService.js'; +import './media/part.css'; export interface IPartOptions { readonly hasTitle?: boolean; diff --git a/src/vs/workbench/browser/panecomposite.ts b/src/vs/workbench/browser/panecomposite.ts index 89e701e2d0b..86dbfe14fd9 100644 --- a/src/vs/workbench/browser/panecomposite.ts +++ b/src/vs/workbench/browser/panecomposite.ts @@ -3,26 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Registry } from 'vs/platform/registry/common/platform'; -import { Composite, CompositeDescriptor, CompositeRegistry } from 'vs/workbench/browser/composite'; -import { IConstructorSignature, BrandedService, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { URI } from 'vs/base/common/uri'; -import { Dimension } from 'vs/base/browser/dom'; -import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar'; -import { IAction, Separator } from 'vs/base/common/actions'; -import { MenuId, SubmenuItemAction } from 'vs/platform/actions/common/actions'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { ViewPaneContainer, ViewsSubMenu } from 'vs/workbench/browser/parts/views/viewPaneContainer'; -import { IPaneComposite } from 'vs/workbench/common/panecomposite'; -import { IView } from 'vs/workbench/common/views'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { VIEWPANE_FILTER_ACTION } from 'vs/workbench/browser/parts/views/viewPane'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; -import { IBaseActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems'; +import { Registry } from '../../platform/registry/common/platform.js'; +import { Composite, CompositeDescriptor, CompositeRegistry } from './composite.js'; +import { IConstructorSignature, BrandedService, IInstantiationService } from '../../platform/instantiation/common/instantiation.js'; +import { URI } from '../../base/common/uri.js'; +import { Dimension } from '../../base/browser/dom.js'; +import { IActionViewItem } from '../../base/browser/ui/actionbar/actionbar.js'; +import { IAction, Separator } from '../../base/common/actions.js'; +import { MenuId, SubmenuItemAction } from '../../platform/actions/common/actions.js'; +import { IContextMenuService } from '../../platform/contextview/browser/contextView.js'; +import { IStorageService } from '../../platform/storage/common/storage.js'; +import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js'; +import { IThemeService } from '../../platform/theme/common/themeService.js'; +import { IWorkspaceContextService } from '../../platform/workspace/common/workspace.js'; +import { ViewPaneContainer, ViewsSubMenu } from './parts/views/viewPaneContainer.js'; +import { IPaneComposite } from '../common/panecomposite.js'; +import { IView } from '../common/views.js'; +import { IExtensionService } from '../services/extensions/common/extensions.js'; +import { VIEWPANE_FILTER_ACTION } from './parts/views/viewPane.js'; +import { IBoundarySashes } from '../../base/browser/ui/sash/sash.js'; +import { IBaseActionViewItemOptions } from '../../base/browser/ui/actionbar/actionViewItems.js'; export abstract class PaneComposite extends Composite implements IPaneComposite { diff --git a/src/vs/workbench/browser/part.ts b/src/vs/workbench/browser/part.ts index dea01d426e2..c889f04d30a 100644 --- a/src/vs/workbench/browser/part.ts +++ b/src/vs/workbench/browser/part.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/part'; -import { Component } from 'vs/workbench/common/component'; -import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService'; -import { Dimension, size, IDimension, getActiveDocument, prepend, IDomPosition } from 'vs/base/browser/dom'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ISerializableView, IViewSize } from 'vs/base/browser/ui/grid/grid'; -import { Event, Emitter } from 'vs/base/common/event'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; -import { assertIsDefined } from 'vs/base/common/types'; -import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import './media/part.css'; +import { Component } from '../common/component.js'; +import { IThemeService, IColorTheme } from '../../platform/theme/common/themeService.js'; +import { Dimension, size, IDimension, getActiveDocument, prepend, IDomPosition } from '../../base/browser/dom.js'; +import { IStorageService } from '../../platform/storage/common/storage.js'; +import { ISerializableView, IViewSize } from '../../base/browser/ui/grid/grid.js'; +import { Event, Emitter } from '../../base/common/event.js'; +import { IWorkbenchLayoutService } from '../services/layout/browser/layoutService.js'; +import { assertIsDefined } from '../../base/common/types.js'; +import { IDisposable, toDisposable } from '../../base/common/lifecycle.js'; export interface IPartOptions { readonly hasTitle?: boolean; diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index 4610ddff2c3..ce7ed066b93 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -3,40 +3,41 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/activitybarpart'; -import 'vs/css!./media/activityaction'; -import { localize, localize2 } from 'vs/nls'; -import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; -import { Part } from 'vs/workbench/browser/part'; -import { ActivityBarPosition, IWorkbenchLayoutService, LayoutSettings, Parts, Position } from 'vs/workbench/services/layout/browser/layoutService'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle'; -import { ToggleSidebarPositionAction } from 'vs/workbench/browser/actions/layoutActions'; -import { IThemeService, IColorTheme, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { ACTIVITY_BAR_BACKGROUND, ACTIVITY_BAR_BORDER, ACTIVITY_BAR_FOREGROUND, ACTIVITY_BAR_ACTIVE_BORDER, ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND, ACTIVITY_BAR_INACTIVE_FOREGROUND, ACTIVITY_BAR_ACTIVE_BACKGROUND, ACTIVITY_BAR_DRAG_AND_DROP_BORDER, ACTIVITY_BAR_ACTIVE_FOCUS_BORDER } from 'vs/workbench/common/theme'; -import { activeContrastBorder, contrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry'; -import { addDisposableListener, append, EventType, isAncestor, $, clearNode } from 'vs/base/browser/dom'; -import { assertIsDefined } from 'vs/base/common/types'; -import { CustomMenubarControl } from 'vs/workbench/browser/parts/titlebar/menubarControl'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { getMenuBarVisibility } from 'vs/platform/window/common/window'; -import { IAction, Separator, SubmenuAction, toAction } from 'vs/base/common/actions'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget'; -import { GestureEvent } from 'vs/base/browser/touch'; -import { IPaneCompositePart } from 'vs/workbench/browser/parts/paneCompositePart'; -import { IPaneCompositeBarOptions, PaneCompositeBar } from 'vs/workbench/browser/parts/paneCompositeBar'; -import { GlobalCompositeBar } from 'vs/workbench/browser/parts/globalCompositeBar'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { Action2, IAction2Options, IMenuService, MenuId, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions'; -import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IViewDescriptorService, ViewContainerLocation, ViewContainerLocationToString } from 'vs/workbench/common/views'; -import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; +import './media/activitybarpart.css'; +import './media/activityaction.css'; +import { localize, localize2 } from '../../../../nls.js'; +import { ActionsOrientation } from '../../../../base/browser/ui/actionbar/actionbar.js'; +import { Part } from '../../part.js'; +import { ActivityBarPosition, IWorkbenchLayoutService, LayoutSettings, Parts, Position } from '../../../services/layout/browser/layoutService.js'; +import { IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { DisposableStore, MutableDisposable } from '../../../../base/common/lifecycle.js'; +import { ToggleSidebarPositionAction } from '../../actions/layoutActions.js'; +import { IThemeService, IColorTheme, registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { ACTIVITY_BAR_BACKGROUND, ACTIVITY_BAR_BORDER, ACTIVITY_BAR_FOREGROUND, ACTIVITY_BAR_ACTIVE_BORDER, ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND, ACTIVITY_BAR_INACTIVE_FOREGROUND, ACTIVITY_BAR_ACTIVE_BACKGROUND, ACTIVITY_BAR_DRAG_AND_DROP_BORDER, ACTIVITY_BAR_ACTIVE_FOCUS_BORDER } from '../../../common/theme.js'; +import { activeContrastBorder, contrastBorder, focusBorder } from '../../../../platform/theme/common/colorRegistry.js'; +import { addDisposableListener, append, EventType, isAncestor, $, clearNode } from '../../../../base/browser/dom.js'; +import { assertIsDefined } from '../../../../base/common/types.js'; +import { CustomMenubarControl } from '../titlebar/menubarControl.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { getMenuBarVisibility } from '../../../../platform/window/common/window.js'; +import { IAction, Separator, SubmenuAction, toAction } from '../../../../base/common/actions.js'; +import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { HoverPosition } from '../../../../base/browser/ui/hover/hoverWidget.js'; +import { GestureEvent } from '../../../../base/browser/touch.js'; +import { IPaneCompositePart } from '../paneCompositePart.js'; +import { IPaneCompositeBarOptions, PaneCompositeBar } from '../paneCompositeBar.js'; +import { GlobalCompositeBar } from '../globalCompositeBar.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { Action2, IAction2Options, IMenuService, MenuId, MenuRegistry, registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { ContextKeyExpr, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { Categories } from '../../../../platform/action/common/actionCommonCategories.js'; +import { createAndFillInContextMenuActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { IViewDescriptorService, ViewContainerLocation, ViewContainerLocationToString } from '../../../common/views.js'; +import { IPaneCompositePartService } from '../../../services/panecomposite/browser/panecomposite.js'; +import { IExtensionService } from '../../../services/extensions/common/extensions.js'; +import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.js'; +import { IViewsService } from '../../../services/views/common/viewsService.js'; export class ActivitybarPart extends Part { @@ -205,6 +206,7 @@ export class ActivityBarCompositeBar extends PaneCompositeBar { @IStorageService storageService: IStorageService, @IExtensionService extensionService: IExtensionService, @IViewDescriptorService viewDescriptorService: IViewDescriptorService, + @IViewsService viewService: IViewsService, @IContextKeyService contextKeyService: IContextKeyService, @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, @IConfigurationService private readonly configurationService: IConfigurationService, @@ -217,7 +219,7 @@ export class ActivityBarCompositeBar extends PaneCompositeBar { options.fillExtraContextMenuActions(actions, e); this.fillContextMenuActions(actions, e); } - }, part, paneCompositePart, instantiationService, storageService, extensionService, viewDescriptorService, contextKeyService, environmentService, layoutService); + }, part, paneCompositePart, instantiationService, storageService, extensionService, viewDescriptorService, viewService, contextKeyService, environmentService, layoutService); if (showGlobalActivities) { this.globalCompositeBar = this._register(instantiationService.createInstance(GlobalCompositeBar, () => this.getContextMenuActions(), (theme: IColorTheme) => this.options.colors(theme), this.options.activityHoverOptions)); @@ -363,10 +365,9 @@ export class ActivityBarCompositeBar extends PaneCompositeBar { } getActivityBarContextMenuActions(): IAction[] { - const activityBarPositionMenu = this.menuService.createMenu(MenuId.ActivityBarPositionMenu, this.contextKeyService); + const activityBarPositionMenu = this.menuService.getMenuActions(MenuId.ActivityBarPositionMenu, this.contextKeyService, { shouldForwardArgs: true, renderShortTitle: true }); const positionActions: IAction[] = []; - createAndFillInContextMenuActions(activityBarPositionMenu, { shouldForwardArgs: true, renderShortTitle: true }, { primary: [], secondary: positionActions }); - activityBarPositionMenu.dispose(); + createAndFillInContextMenuActions(activityBarPositionMenu, { primary: [], secondary: positionActions }); return [ new SubmenuAction('workbench.action.panel.position', localize('activity bar position', "Activity Bar Position"), positionActions), toAction({ id: ToggleSidebarPositionAction.ID, label: ToggleSidebarPositionAction.getLabel(this.layoutService), run: () => this.instantiationService.invokeFunction(accessor => new ToggleSidebarPositionAction().run(accessor)) }) diff --git a/src/vs/workbench/browser/parts/activitybar/media/activityaction.css b/src/vs/workbench/browser/parts/activitybar/media/activityaction.css index f42d3307fb7..22cd4083df3 100644 --- a/src/vs/workbench/browser/parts/activitybar/media/activityaction.css +++ b/src/vs/workbench/browser/parts/activitybar/media/activityaction.css @@ -104,7 +104,8 @@ display: none; } -.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.clicked:focus:before { +.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.clicked:focus:before, +.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.clicked:focus .active-item-indicator::before { border-left: none !important; /* no focus feedback when using mouse */ } @@ -168,23 +169,6 @@ text-align: center; } -.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .profile-badge .profile-icon-overlay { - position: absolute; - top: 27px; - right: 6px; - background-color: var(--vscode-activityBar-background); -} - -.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .profile-badge .profile-icon-overlay .codicon { - color: var(--vscode-activityBar-inactiveForeground); -} - -.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.active .profile-badge .profile-icon-overlay .codicon, -.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:focus .profile-badge .profile-icon-overlay .codicon, -.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:hover .profile-badge .profile-icon-overlay .codicon { - color: var(--vscode-activityBar-foreground) !important; -} - .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .profile-badge .profile-text-overlay { position: absolute; font-weight: 600; diff --git a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts index 3de5a2cc2d7..b2c7e5f01c7 100644 --- a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts +++ b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Codicon } from 'vs/base/common/codicons'; -import { localize, localize2 } from 'vs/nls'; -import { Action2, MenuId, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { AuxiliaryBarVisibleContext } from 'vs/workbench/common/contextkeys'; -import { ViewContainerLocation, ViewContainerLocationToString } from 'vs/workbench/common/views'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; -import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { localize, localize2 } from '../../../../nls.js'; +import { Action2, MenuId, MenuRegistry, registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; +import { Categories } from '../../../../platform/action/common/actionCommonCategories.js'; +import { AuxiliaryBarVisibleContext } from '../../../common/contextkeys.js'; +import { ViewContainerLocation, ViewContainerLocationToString } from '../../../common/views.js'; +import { IWorkbenchLayoutService, Parts } from '../../../services/layout/browser/layoutService.js'; +import { IPaneCompositePartService } from '../../../services/panecomposite/browser/panecomposite.js'; +import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; const auxiliaryBarRightIcon = registerIcon('auxiliarybar-right-layout-icon', Codicon.layoutSidebarRight, localize('toggleAuxiliaryIconRight', 'Icon to toggle the auxiliary bar off in its right position.')); diff --git a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.ts b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.ts index 39f2e81a8c9..9bbd09479b6 100644 --- a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.ts +++ b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.ts @@ -3,39 +3,39 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/auxiliaryBarPart'; -import { localize } from 'vs/nls'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { contrastBorder } from 'vs/platform/theme/common/colorRegistry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ActiveAuxiliaryContext, AuxiliaryBarFocusContext } from 'vs/workbench/common/contextkeys'; -import { ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND, ACTIVITY_BAR_TOP_ACTIVE_BORDER, ACTIVITY_BAR_TOP_DRAG_AND_DROP_BORDER, ACTIVITY_BAR_TOP_FOREGROUND, ACTIVITY_BAR_TOP_INACTIVE_FOREGROUND, PANEL_ACTIVE_TITLE_BORDER, PANEL_ACTIVE_TITLE_FOREGROUND, PANEL_BORDER, PANEL_DRAG_AND_DROP_BORDER, PANEL_INACTIVE_TITLE_FOREGROUND, SIDE_BAR_BACKGROUND, SIDE_BAR_BORDER, SIDE_BAR_FOREGROUND } from 'vs/workbench/common/theme'; -import { IViewDescriptorService } from 'vs/workbench/common/views'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { ActivityBarPosition, IWorkbenchLayoutService, LayoutSettings, Parts, Position } from 'vs/workbench/services/layout/browser/layoutService'; -import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget'; -import { IAction, Separator, SubmenuAction, toAction } from 'vs/base/common/actions'; -import { ToggleAuxiliaryBarAction } from 'vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions'; -import { assertIsDefined } from 'vs/base/common/types'; -import { LayoutPriority } from 'vs/base/browser/ui/splitview/splitview'; -import { ToggleSidebarPositionAction } from 'vs/workbench/browser/actions/layoutActions'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { AbstractPaneCompositePart, CompositeBarPosition } from 'vs/workbench/browser/parts/paneCompositePart'; -import { ActionsOrientation, IActionViewItem, prepareActions } from 'vs/base/browser/ui/actionbar/actionbar'; -import { IPaneCompositeBarOptions } from 'vs/workbench/browser/parts/paneCompositeBar'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { $ } from 'vs/base/browser/dom'; -import { HiddenItemStrategy, WorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; -import { ActionViewItem, IActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems'; -import { CompositeMenuActions } from 'vs/workbench/browser/actions'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; +import './media/auxiliaryBarPart.css'; +import { localize } from '../../../../nls.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { contrastBorder } from '../../../../platform/theme/common/colorRegistry.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { ActiveAuxiliaryContext, AuxiliaryBarFocusContext } from '../../../common/contextkeys.js'; +import { ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND, ACTIVITY_BAR_TOP_ACTIVE_BORDER, ACTIVITY_BAR_TOP_DRAG_AND_DROP_BORDER, ACTIVITY_BAR_TOP_FOREGROUND, ACTIVITY_BAR_TOP_INACTIVE_FOREGROUND, PANEL_ACTIVE_TITLE_BORDER, PANEL_ACTIVE_TITLE_FOREGROUND, PANEL_BORDER, PANEL_DRAG_AND_DROP_BORDER, PANEL_INACTIVE_TITLE_FOREGROUND, SIDE_BAR_BACKGROUND, SIDE_BAR_BORDER, SIDE_BAR_FOREGROUND } from '../../../common/theme.js'; +import { IViewDescriptorService } from '../../../common/views.js'; +import { IExtensionService } from '../../../services/extensions/common/extensions.js'; +import { ActivityBarPosition, IWorkbenchLayoutService, LayoutSettings, Parts, Position } from '../../../services/layout/browser/layoutService.js'; +import { HoverPosition } from '../../../../base/browser/ui/hover/hoverWidget.js'; +import { IAction, Separator, SubmenuAction, toAction } from '../../../../base/common/actions.js'; +import { ToggleAuxiliaryBarAction } from './auxiliaryBarActions.js'; +import { assertIsDefined } from '../../../../base/common/types.js'; +import { LayoutPriority } from '../../../../base/browser/ui/splitview/splitview.js'; +import { ToggleSidebarPositionAction } from '../../actions/layoutActions.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { AbstractPaneCompositePart, CompositeBarPosition } from '../paneCompositePart.js'; +import { ActionsOrientation, IActionViewItem, prepareActions } from '../../../../base/browser/ui/actionbar/actionbar.js'; +import { IPaneCompositeBarOptions } from '../paneCompositeBar.js'; +import { IMenuService, MenuId } from '../../../../platform/actions/common/actions.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { createAndFillInContextMenuActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { $ } from '../../../../base/browser/dom.js'; +import { HiddenItemStrategy, WorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js'; +import { ActionViewItem, IActionViewItemOptions } from '../../../../base/browser/ui/actionbar/actionViewItems.js'; +import { CompositeMenuActions } from '../../actions.js'; +import { IHoverService } from '../../../../platform/hover/browser/hover.js'; export class AuxiliaryBarPart extends AbstractPaneCompositePart { @@ -191,10 +191,9 @@ export class AuxiliaryBarPart extends AbstractPaneCompositePart { actions.push(viewsSubmenuAction); } - const activityBarPositionMenu = this.menuService.createMenu(MenuId.ActivityBarPositionMenu, this.contextKeyService); + const activityBarPositionMenu = this.menuService.getMenuActions(MenuId.ActivityBarPositionMenu, this.contextKeyService, { shouldForwardArgs: true, renderShortTitle: true }); const positionActions: IAction[] = []; - createAndFillInContextMenuActions(activityBarPositionMenu, { shouldForwardArgs: true, renderShortTitle: true }, { primary: [], secondary: positionActions }); - activityBarPositionMenu.dispose(); + createAndFillInContextMenuActions(activityBarPositionMenu, { primary: [], secondary: positionActions }); actions.push(...[ new Separator(), @@ -241,14 +240,6 @@ export class AuxiliaryBarPart extends AbstractPaneCompositePart { return headerArea; } - protected override getToolbarWidth(): number { - if (this.getCompositeBarPosition() === CompositeBarPosition.TOP) { - return 22; - } - - return super.getToolbarWidth(); - } - private headerActionViewItemProvider(action: IAction, options: IActionViewItemOptions): IActionViewItem | undefined { if (action.id === ToggleAuxiliaryBarAction.ID) { return this.instantiationService.createInstance(ActionViewItem, undefined, action, options); diff --git a/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css b/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css index ea820a59465..0678e18ac48 100644 --- a/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css +++ b/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css @@ -57,7 +57,7 @@ .monaco-workbench .part.auxiliarybar > .title > .composite-bar-container > .composite-bar > .monaco-action-bar .action-item .action-label::before, .monaco-workbench .part.auxiliarybar > .header-or-footer > .composite-bar-container > .composite-bar > .monaco-action-bar .action-item .action-label::before { position: absolute; - left: 6px; /* place icon in center */ + left: 5px; /* place icon in center */ } .monaco-workbench .part.auxiliarybar > .title > .composite-bar-container > .composite-bar > .monaco-action-bar .action-item.checked:not(:focus) .active-item-indicator:before, diff --git a/src/vs/workbench/browser/parts/banner/bannerPart.ts b/src/vs/workbench/browser/parts/banner/bannerPart.ts index e8957eae627..1f329c4c764 100644 --- a/src/vs/workbench/browser/parts/banner/bannerPart.ts +++ b/src/vs/workbench/browser/parts/banner/bannerPart.ts @@ -3,31 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/bannerpart'; -import { localize2 } from 'vs/nls'; -import { $, addDisposableListener, append, asCSSUrl, clearNode, EventType, isHTMLElement } from 'vs/base/browser/dom'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { Part } from 'vs/workbench/browser/part'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; -import { Action } from 'vs/base/common/actions'; -import { Link } from 'vs/platform/opener/browser/link'; -import { MarkdownString } from 'vs/base/common/htmlContent'; -import { Emitter } from 'vs/base/common/event'; -import { IBannerItem, IBannerService } from 'vs/workbench/services/banner/browser/bannerService'; -import { MarkdownRenderer } from 'vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; -import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { URI } from 'vs/base/common/uri'; -import { widgetClose } from 'vs/platform/theme/common/iconRegistry'; -import { BannerFocused } from 'vs/workbench/common/contextkeys'; +import './media/bannerpart.css'; +import { localize2 } from '../../../../nls.js'; +import { $, addDisposableListener, append, asCSSUrl, clearNode, EventType, isHTMLElement } from '../../../../base/browser/dom.js'; +import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { Part } from '../../part.js'; +import { IWorkbenchLayoutService, Parts } from '../../../services/layout/browser/layoutService.js'; +import { Action } from '../../../../base/common/actions.js'; +import { Link } from '../../../../platform/opener/browser/link.js'; +import { MarkdownString } from '../../../../base/common/htmlContent.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { IBannerItem, IBannerService } from '../../../services/banner/browser/bannerService.js'; +import { MarkdownRenderer } from '../../../../editor/browser/widget/markdownRenderer/browser/markdownRenderer.js'; +import { Action2, registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { Categories } from '../../../../platform/action/common/actionCommonCategories.js'; +import { KeybindingsRegistry, KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { URI } from '../../../../base/common/uri.js'; +import { widgetClose } from '../../../../platform/theme/common/iconRegistry.js'; +import { BannerFocused } from '../../../common/contextkeys.js'; // Banner Part diff --git a/src/vs/workbench/browser/parts/bottombar/bottomBarPart.ts b/src/vs/workbench/browser/parts/bottombar/bottomBarPart.ts index f259202f323..b4276c5b59b 100644 --- a/src/vs/workbench/browser/parts/bottombar/bottomBarPart.ts +++ b/src/vs/workbench/browser/parts/bottombar/bottomBarPart.ts @@ -3,17 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { editorBackground } from 'vs/platform/theme/common/colorRegistry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { MultiWindowParts, Part } from 'vs/workbench/browser/part'; -import { IBottomBarPartService } from 'vs/workbench/services/bottomBarPart/browser/bottomBarPartService'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; - -const $ = dom.$; +import { $, append } from '../../../../base/browser/dom.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { editorBackground } from '../../../../platform/theme/common/colorRegistry.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { IBottomBarPartService } from '../../../services/bottomBarPart/browser/bottomBarPartService.js'; +import { IWorkbenchLayoutService, Parts } from '../../../services/layout/browser/layoutService.js'; +import { MultiWindowParts, Part } from '../../part.js'; export class BottomBarPartService extends MultiWindowParts implements IBottomBarPartService { declare _serviceBrand: undefined; @@ -77,7 +75,7 @@ export class BottomBarPart extends Part implements IDisposable { this.getColor(editorBackground); this.element.style.backgroundColor = this.getColor(editorBackground)?.toString() || 'transparent'; - this._content = dom.append(this.element, $('.content')); + this._content = append(this.element, $('.content')); return this._content; } diff --git a/src/vs/workbench/browser/parts/compositeBar.ts b/src/vs/workbench/browser/parts/compositeBar.ts index a9fc39c84ed..04d7818353d 100644 --- a/src/vs/workbench/browser/parts/compositeBar.ts +++ b/src/vs/workbench/browser/parts/compositeBar.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { IAction, toAction } from 'vs/base/common/actions'; -import { IActivity } from 'vs/workbench/services/activity/common/activity'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ActionBar, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; -import { CompositeActionViewItem, CompositeOverflowActivityAction, CompositeOverflowActivityActionViewItem, CompositeBarAction, ICompositeBar, ICompositeBarColors, IActivityHoverOptions } from 'vs/workbench/browser/parts/compositeBarActions'; -import { Dimension, $, addDisposableListener, EventType, EventHelper, isAncestor, getWindow } from 'vs/base/browser/dom'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { Widget } from 'vs/base/browser/ui/widget'; -import { isUndefinedOrNull } from 'vs/base/common/types'; -import { IColorTheme } from 'vs/platform/theme/common/themeService'; -import { Emitter } from 'vs/base/common/event'; -import { ViewContainerLocation, IViewDescriptorService } from 'vs/workbench/common/views'; -import { IPaneComposite } from 'vs/workbench/common/panecomposite'; -import { IComposite } from 'vs/workbench/common/composite'; -import { CompositeDragAndDropData, CompositeDragAndDropObserver, IDraggedCompositeData, ICompositeDragAndDrop, Before2D, toggleDropEffect } from 'vs/workbench/browser/dnd'; -import { Gesture, EventType as TouchEventType, GestureEvent } from 'vs/base/browser/touch'; +import { localize } from '../../../nls.js'; +import { IAction, toAction } from '../../../base/common/actions.js'; +import { IActivity } from '../../services/activity/common/activity.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { ActionBar, ActionsOrientation } from '../../../base/browser/ui/actionbar/actionbar.js'; +import { CompositeActionViewItem, CompositeOverflowActivityAction, CompositeOverflowActivityActionViewItem, CompositeBarAction, ICompositeBar, ICompositeBarColors, IActivityHoverOptions } from './compositeBarActions.js'; +import { Dimension, $, addDisposableListener, EventType, EventHelper, isAncestor, getWindow } from '../../../base/browser/dom.js'; +import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js'; +import { IContextMenuService } from '../../../platform/contextview/browser/contextView.js'; +import { Widget } from '../../../base/browser/ui/widget.js'; +import { isUndefinedOrNull } from '../../../base/common/types.js'; +import { IColorTheme } from '../../../platform/theme/common/themeService.js'; +import { Emitter } from '../../../base/common/event.js'; +import { ViewContainerLocation, IViewDescriptorService } from '../../common/views.js'; +import { IPaneComposite } from '../../common/panecomposite.js'; +import { IComposite } from '../../common/composite.js'; +import { CompositeDragAndDropData, CompositeDragAndDropObserver, IDraggedCompositeData, ICompositeDragAndDrop, Before2D, toggleDropEffect, ICompositeDragAndDropObserverCallbacks } from '../dnd.js'; +import { Gesture, EventType as TouchEventType, GestureEvent } from '../../../base/browser/touch.js'; export interface ICompositeBarItem { @@ -152,6 +152,78 @@ export interface ICompositeBarOptions { readonly getDefaultCompositeId: () => string | undefined; } +class CompositeBarDndCallbacks implements ICompositeDragAndDropObserverCallbacks { + + private insertDropBefore: Before2D | undefined = undefined; + + constructor( + private readonly compositeBarContainer: HTMLElement, + private readonly actionBarContainer: HTMLElement, + private readonly compositeBarModel: CompositeBarModel, + private readonly dndHandler: ICompositeDragAndDrop, + private readonly orientation: ActionsOrientation, + ) { } + + onDragOver(e: IDraggedCompositeData) { + + // don't add feedback if this is over the composite bar actions or there are no actions + const visibleItems = this.compositeBarModel.visibleItems; + if (!visibleItems.length || (e.eventData.target && isAncestor(e.eventData.target as HTMLElement, this.actionBarContainer))) { + this.insertDropBefore = this.updateFromDragging(this.compositeBarContainer, false, false, true); + return; + } + + const insertAtFront = this.insertAtFront(this.actionBarContainer, e.eventData); + const target = insertAtFront ? visibleItems[0] : visibleItems[visibleItems.length - 1]; + const validDropTarget = this.dndHandler.onDragOver(e.dragAndDropData, target.id, e.eventData); + toggleDropEffect(e.eventData.dataTransfer, 'move', validDropTarget); + this.insertDropBefore = this.updateFromDragging(this.compositeBarContainer, validDropTarget, insertAtFront, true); + } + + onDragLeave(e: IDraggedCompositeData) { + this.insertDropBefore = this.updateFromDragging(this.compositeBarContainer, false, false, false); + } + + onDragEnd(e: IDraggedCompositeData) { + this.insertDropBefore = this.updateFromDragging(this.compositeBarContainer, false, false, false); + } + + onDrop(e: IDraggedCompositeData) { + const visibleItems = this.compositeBarModel.visibleItems; + let targetId = undefined; + if (visibleItems.length) { + targetId = this.insertAtFront(this.actionBarContainer, e.eventData) ? visibleItems[0].id : visibleItems[visibleItems.length - 1].id; + } + this.dndHandler.drop(e.dragAndDropData, targetId, e.eventData, this.insertDropBefore); + this.insertDropBefore = this.updateFromDragging(this.compositeBarContainer, false, false, false); + } + + private insertAtFront(element: HTMLElement, event: DragEvent): boolean { + const rect = element.getBoundingClientRect(); + const posX = event.clientX; + const posY = event.clientY; + + switch (this.orientation) { + case ActionsOrientation.HORIZONTAL: + return posX < rect.left; + case ActionsOrientation.VERTICAL: + return posY < rect.top; + } + } + + private updateFromDragging(element: HTMLElement, showFeedback: boolean, front: boolean, isDragging: boolean): Before2D | undefined { + element.classList.toggle('dragged-over', isDragging); + element.classList.toggle('dragged-over-head', showFeedback && front); + element.classList.toggle('dragged-over-tail', showFeedback && !front); + + if (!showFeedback) { + return undefined; + } + + return { verticallyBefore: front, horizontallyBefore: front }; + } +} + export class CompositeBar extends Widget implements ICompositeBar { private readonly _onDidChange = this._register(new Emitter()); @@ -232,67 +304,12 @@ export class CompositeBar extends Widget implements ICompositeBar { this._register(addDisposableListener(parent, TouchEventType.Contextmenu, e => this.showContextMenu(getWindow(parent), e))); // Register a drop target on the whole bar to prevent forbidden feedback - let insertDropBefore: Before2D | undefined = undefined; - this._register(CompositeDragAndDropObserver.INSTANCE.registerTarget(parent, { - onDragOver: (e: IDraggedCompositeData) => { - - // don't add feedback if this is over the composite bar actions or there are no actions - const visibleItems = this.getVisibleComposites(); - if (!visibleItems.length || (e.eventData.target && isAncestor(e.eventData.target as HTMLElement, actionBarDiv))) { - insertDropBefore = this.updateFromDragging(parent, false, false, true); - return; - } - - const insertAtFront = this.insertAtFront(actionBarDiv, e.eventData); - const target = insertAtFront ? visibleItems[0] : visibleItems[visibleItems.length - 1]; - const validDropTarget = this.options.dndHandler.onDragOver(e.dragAndDropData, target.id, e.eventData); - toggleDropEffect(e.eventData.dataTransfer, 'move', validDropTarget); - insertDropBefore = this.updateFromDragging(parent, validDropTarget, insertAtFront, true); - }, - onDragLeave: (e: IDraggedCompositeData) => { - insertDropBefore = this.updateFromDragging(parent, false, false, false); - }, - onDragEnd: (e: IDraggedCompositeData) => { - insertDropBefore = this.updateFromDragging(parent, false, false, false); - }, - onDrop: (e: IDraggedCompositeData) => { - const visibleItems = this.getVisibleComposites(); - if (visibleItems.length) { - const target = this.insertAtFront(actionBarDiv, e.eventData) ? visibleItems[0] : visibleItems[visibleItems.length - 1]; - this.options.dndHandler.drop(e.dragAndDropData, target.id, e.eventData, insertDropBefore); - } - insertDropBefore = this.updateFromDragging(parent, false, false, false); - } - })); + const dndCallback = new CompositeBarDndCallbacks(parent, actionBarDiv, this.model, this.options.dndHandler, this.options.orientation); + this._register(CompositeDragAndDropObserver.INSTANCE.registerTarget(parent, dndCallback)); return actionBarDiv; } - private insertAtFront(element: HTMLElement, event: DragEvent): boolean { - const rect = element.getBoundingClientRect(); - const posX = event.clientX; - const posY = event.clientY; - - switch (this.options.orientation) { - case ActionsOrientation.HORIZONTAL: - return posX < rect.left; - case ActionsOrientation.VERTICAL: - return posY < rect.top; - } - } - - private updateFromDragging(element: HTMLElement, showFeedback: boolean, front: boolean, isDragging: boolean): Before2D | undefined { - element.classList.toggle('dragged-over', isDragging); - element.classList.toggle('dragged-over-head', showFeedback && front); - element.classList.toggle('dragged-over-tail', showFeedback && !front); - - if (!showFeedback) { - return undefined; - } - - return { verticallyBefore: front, horizontallyBefore: front }; - } - focus(index?: number): void { this.compositeSwitcherBar?.focus(index); } diff --git a/src/vs/workbench/browser/parts/compositeBarActions.ts b/src/vs/workbench/browser/parts/compositeBarActions.ts index de10721d07c..15f6b06331c 100644 --- a/src/vs/workbench/browser/parts/compositeBarActions.ts +++ b/src/vs/workbench/browser/parts/compositeBarActions.ts @@ -3,30 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { Action, IAction, Separator } from 'vs/base/common/actions'; -import { $, addDisposableListener, append, clearNode, EventHelper, EventType, getDomNodePagePosition, hide, show } from 'vs/base/browser/dom'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { toDisposable, DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService'; -import { NumberBadge, IBadge, IActivity, ProgressBadge } from 'vs/workbench/services/activity/common/activity'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { DelayedDragHandler } from 'vs/base/browser/dnd'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { Emitter, Event } from 'vs/base/common/event'; -import { CompositeDragAndDropObserver, ICompositeDragAndDrop, Before2D, toggleDropEffect } from 'vs/workbench/browser/dnd'; -import { Color } from 'vs/base/common/color'; -import { BaseActionViewItem, IActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget'; -import { URI } from 'vs/base/common/uri'; -import { badgeBackground, badgeForeground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; -import type { IHoverWidget } from 'vs/base/browser/ui/hover/hover'; +import { localize } from '../../../nls.js'; +import { Action, IAction, Separator } from '../../../base/common/actions.js'; +import { $, addDisposableListener, append, clearNode, EventHelper, EventType, getDomNodePagePosition, hide, show } from '../../../base/browser/dom.js'; +import { ICommandService } from '../../../platform/commands/common/commands.js'; +import { toDisposable, DisposableStore, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { IContextMenuService } from '../../../platform/contextview/browser/contextView.js'; +import { IThemeService, IColorTheme } from '../../../platform/theme/common/themeService.js'; +import { NumberBadge, IBadge, IActivity, ProgressBadge, IconBadge } from '../../services/activity/common/activity.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { DelayedDragHandler } from '../../../base/browser/dnd.js'; +import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js'; +import { Emitter, Event } from '../../../base/common/event.js'; +import { CompositeDragAndDropObserver, ICompositeDragAndDrop, Before2D, toggleDropEffect } from '../dnd.js'; +import { Color } from '../../../base/common/color.js'; +import { BaseActionViewItem, IActionViewItemOptions } from '../../../base/browser/ui/actionbar/actionViewItems.js'; +import { Codicon } from '../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { IHoverService } from '../../../platform/hover/browser/hover.js'; +import { RunOnceScheduler } from '../../../base/common/async.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { HoverPosition } from '../../../base/browser/ui/hover/hoverWidget.js'; +import { URI } from '../../../base/common/uri.js'; +import { badgeBackground, badgeForeground, contrastBorder } from '../../../platform/theme/common/colorRegistry.js'; +import type { IHoverWidget } from '../../../base/browser/ui/hover/hover.js'; export interface ICompositeBar { @@ -154,7 +154,7 @@ export class CompositeBarActionViewItem extends BaseActionViewItem { protected override readonly options: ICompositeBarActionViewItemOptions; private badgeContent: HTMLElement | undefined; - private readonly badgeDisposable = this._register(new MutableDisposable()); + private readonly badgeDisposable = this._register(new MutableDisposable()); private mouseUpTimeout: any; private keybindingLabel: string | undefined | null; @@ -214,9 +214,10 @@ export class CompositeBarActionViewItem extends BaseActionViewItem { // Badge if (this.badgeContent) { - const badgeFg = colors.badgeForeground ?? theme.getColor(badgeForeground); - const badgeBg = colors.badgeBackground ?? theme.getColor(badgeBackground); - const contrastBorderColor = theme.getColor(contrastBorder); + const badgeStyles = this.getActivity()?.badge.getColors(theme); + const badgeFg = badgeStyles?.badgeForeground ?? colors.badgeForeground ?? theme.getColor(badgeForeground); + const badgeBg = badgeStyles?.badgeBackground ?? colors.badgeBackground ?? theme.getColor(badgeBackground); + const contrastBorderColor = badgeStyles?.badgeBorder ?? theme.getColor(contrastBorder); this.badgeContent.style.color = badgeFg ? badgeFg.toString() : ''; this.badgeContent.style.backgroundColor = badgeBg ? badgeBg.toString() : ''; @@ -285,15 +286,21 @@ export class CompositeBarActionViewItem extends BaseActionViewItem { this.updateStyles(); } + private getActivity(): IActivity | undefined { + if (this._action instanceof CompositeBarAction) { + return this._action.activity; + } + return undefined; + } + protected updateActivity(): void { - const action = this.action; - if (!this.badge || !this.badgeContent || !(action instanceof CompositeBarAction)) { + if (!this.badge || !this.badgeContent || !(this._action instanceof CompositeBarAction)) { return; } - const activity = action.activity; + const activity = this.getActivity(); - this.badgeDisposable.clear(); + this.badgeDisposable.value = new DisposableStore(); clearNode(this.badgeContent); hide(this.badge); @@ -319,11 +326,7 @@ export class CompositeBarActionViewItem extends BaseActionViewItem { else if (badge instanceof NumberBadge) { if (badge.number) { let number = badge.number.toString(); - if (this.options.compact) { - if (badge.number > 99) { - number = ''; - } - } else if (badge.number > 999) { + if (badge.number > 999) { const noOfThousands = badge.number / 1000; const floor = Math.floor(noOfThousands); if (noOfThousands > floor) { @@ -332,19 +335,32 @@ export class CompositeBarActionViewItem extends BaseActionViewItem { number = `${noOfThousands}K`; } } + if (this.options.compact && number.length >= 3) { + classes.push('compact-content'); + } this.badgeContent.textContent = number; show(this.badge); } } + // Icon + else if (badge instanceof IconBadge) { + classes.push('icon-badge'); + const badgeContentClassess = ['icon-overlay', ...ThemeIcon.asClassNameArray(badge.icon)]; + this.badgeContent.classList.add(...badgeContentClassess); + this.badgeDisposable.value.add(toDisposable(() => this.badgeContent?.classList.remove(...badgeContentClassess))); + show(this.badge); + } + if (classes.length) { this.badge.classList.add(...classes); - this.badgeDisposable.value = toDisposable(() => this.badge.classList.remove(...classes)); + this.badgeDisposable.value.add(toDisposable(() => this.badge.classList.remove(...classes))); } } this.updateTitle(); + this.updateStyles(); } protected override updateLabel(): void { diff --git a/src/vs/workbench/browser/parts/compositePart.ts b/src/vs/workbench/browser/parts/compositePart.ts index cbc4783066e..fc483b4d326 100644 --- a/src/vs/workbench/browser/parts/compositePart.ts +++ b/src/vs/workbench/browser/parts/compositePart.ts @@ -3,39 +3,39 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/compositepart'; -import { localize } from 'vs/nls'; -import { defaultGenerator } from 'vs/base/common/idGenerator'; -import { IDisposable, dispose, DisposableStore, MutableDisposable, } from 'vs/base/common/lifecycle'; -import { Emitter } from 'vs/base/common/event'; -import { isCancellationError } from 'vs/base/common/errors'; -import { ActionsOrientation, IActionViewItem, prepareActions } from 'vs/base/browser/ui/actionbar/actionbar'; -import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar'; -import { IAction } from 'vs/base/common/actions'; -import { Part, IPartOptions } from 'vs/workbench/browser/part'; -import { Composite, CompositeRegistry } from 'vs/workbench/browser/composite'; -import { IComposite } from 'vs/workbench/common/composite'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IProgressIndicator, IEditorProgressService } from 'vs/platform/progress/common/progress'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { Dimension, append, $, hide, show } from 'vs/base/browser/dom'; -import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview'; -import { assertIsDefined } from 'vs/base/common/types'; -import { createActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { AbstractProgressScope, ScopedProgressIndicator } from 'vs/workbench/services/progress/browser/progressIndicator'; -import { WorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; -import { defaultProgressBarStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; -import { IBaseActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems'; -import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate'; -import { createInstantHoverDelegate, getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; -import type { IHoverService } from 'vs/platform/hover/browser/hover'; +import './media/compositepart.css'; +import { localize } from '../../../nls.js'; +import { defaultGenerator } from '../../../base/common/idGenerator.js'; +import { IDisposable, dispose, DisposableStore, MutableDisposable, } from '../../../base/common/lifecycle.js'; +import { Emitter } from '../../../base/common/event.js'; +import { isCancellationError } from '../../../base/common/errors.js'; +import { ActionsOrientation, IActionViewItem, prepareActions } from '../../../base/browser/ui/actionbar/actionbar.js'; +import { ProgressBar } from '../../../base/browser/ui/progressbar/progressbar.js'; +import { IAction } from '../../../base/common/actions.js'; +import { Part, IPartOptions } from '../part.js'; +import { Composite, CompositeRegistry } from '../composite.js'; +import { IComposite } from '../../common/composite.js'; +import { IWorkbenchLayoutService } from '../../services/layout/browser/layoutService.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../../platform/storage/common/storage.js'; +import { IContextMenuService } from '../../../platform/contextview/browser/contextView.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { ServiceCollection } from '../../../platform/instantiation/common/serviceCollection.js'; +import { IProgressIndicator, IEditorProgressService } from '../../../platform/progress/common/progress.js'; +import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js'; +import { IThemeService } from '../../../platform/theme/common/themeService.js'; +import { INotificationService } from '../../../platform/notification/common/notification.js'; +import { Dimension, append, $, hide, show } from '../../../base/browser/dom.js'; +import { AnchorAlignment } from '../../../base/browser/ui/contextview/contextview.js'; +import { assertIsDefined } from '../../../base/common/types.js'; +import { createActionViewItem } from '../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { AbstractProgressScope, ScopedProgressIndicator } from '../../services/progress/browser/progressIndicator.js'; +import { WorkbenchToolBar } from '../../../platform/actions/browser/toolbar.js'; +import { defaultProgressBarStyles } from '../../../platform/theme/browser/defaultStyles.js'; +import { IBoundarySashes } from '../../../base/browser/ui/sash/sash.js'; +import { IBaseActionViewItemOptions } from '../../../base/browser/ui/actionbar/actionViewItems.js'; +import { IHoverDelegate } from '../../../base/browser/ui/hover/hoverDelegate.js'; +import { createInstantHoverDelegate, getDefaultHoverDelegate } from '../../../base/browser/ui/hover/hoverDelegateFactory.js'; +import type { IHoverService } from '../../../platform/hover/browser/hover.js'; export interface ICompositeTitleLabel { diff --git a/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.ts b/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.ts index a97e57d2cbe..b4806127adf 100644 --- a/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.ts +++ b/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { IDialogHandler, IDialogResult, IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; -import { IDialogsModel, IDialogViewItem } from 'vs/workbench/common/dialogs'; -import { BrowserDialogHandler } from 'vs/workbench/browser/parts/dialogs/dialogHandler'; -import { DialogService } from 'vs/workbench/services/dialogs/common/dialogService'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { Lazy } from 'vs/base/common/lazy'; +import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js'; +import { IDialogHandler, IDialogResult, IDialogService } from '../../../../platform/dialogs/common/dialogs.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { ILayoutService } from '../../../../platform/layout/browser/layoutService.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { IProductService } from '../../../../platform/product/common/productService.js'; +import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from '../../../common/contributions.js'; +import { IDialogsModel, IDialogViewItem } from '../../../common/dialogs.js'; +import { BrowserDialogHandler } from './dialogHandler.js'; +import { DialogService } from '../../../services/dialogs/common/dialogService.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { Lazy } from '../../../../base/common/lazy.js'; export class DialogHandlerContribution extends Disposable implements IWorkbenchContribution { diff --git a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts index c064ebced0c..21f62b646c2 100644 --- a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts +++ b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { IConfirmation, IConfirmationResult, IInputResult, ICheckbox, IInputElement, ICustomDialogOptions, IInput, AbstractDialogHandler, DialogType, IPrompt, IAsyncPromptResult } from 'vs/platform/dialogs/common/dialogs'; -import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; -import { ILogService } from 'vs/platform/log/common/log'; -import Severity from 'vs/base/common/severity'; -import { Dialog, IDialogResult } from 'vs/base/browser/ui/dialog/dialog'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { EventHelper } from 'vs/base/browser/dom'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { fromNow } from 'vs/base/common/date'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { MarkdownRenderer } from 'vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; -import { defaultButtonStyles, defaultCheckboxStyles, defaultDialogStyles, defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver'; +import { localize } from '../../../../nls.js'; +import { IConfirmation, IConfirmationResult, IInputResult, ICheckbox, IInputElement, ICustomDialogOptions, IInput, AbstractDialogHandler, DialogType, IPrompt, IAsyncPromptResult } from '../../../../platform/dialogs/common/dialogs.js'; +import { ILayoutService } from '../../../../platform/layout/browser/layoutService.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import Severity from '../../../../base/common/severity.js'; +import { Dialog, IDialogResult } from '../../../../base/browser/ui/dialog/dialog.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import { EventHelper } from '../../../../base/browser/dom.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { IProductService } from '../../../../platform/product/common/productService.js'; +import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js'; +import { fromNow } from '../../../../base/common/date.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { MarkdownRenderer } from '../../../../editor/browser/widget/markdownRenderer/browser/markdownRenderer.js'; +import { defaultButtonStyles, defaultCheckboxStyles, defaultDialogStyles, defaultInputBoxStyles } from '../../../../platform/theme/browser/defaultStyles.js'; +import { ResultKind } from '../../../../platform/keybinding/common/keybindingResolver.js'; export class BrowserDialogHandler extends AbstractDialogHandler { diff --git a/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.ts b/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.ts index d4fbd08a6b8..dc61c0d81a7 100644 --- a/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.ts +++ b/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.ts @@ -3,31 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { onDidChangeFullscreen } from 'vs/base/browser/browser'; -import { hide, show } from 'vs/base/browser/dom'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { isNative } from 'vs/base/common/platform'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { hasCustomTitlebar } from 'vs/platform/window/common/window'; -import { IEditorGroupView, IEditorPartsView } from 'vs/workbench/browser/parts/editor/editor'; -import { EditorPart, IEditorPartUIState } from 'vs/workbench/browser/parts/editor/editorPart'; -import { IAuxiliaryTitlebarPart } from 'vs/workbench/browser/parts/titlebar/titlebarPart'; -import { WindowTitle } from 'vs/workbench/browser/parts/titlebar/windowTitle'; -import { IBottomBarPartService } from 'vs/workbench/services/bottomBarPart/browser/bottomBarPartService'; -import { IAuxiliaryWindowOpenOptions, IAuxiliaryWindowService } from 'vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService'; -import { GroupDirection, GroupsOrder, IAuxiliaryEditorPart } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { IWorkbenchLayoutService, shouldShowCustomTitleBar } from 'vs/workbench/services/layout/browser/layoutService'; -import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { IStatusbarService } from 'vs/workbench/services/statusbar/browser/statusbar'; -import { ITitleService } from 'vs/workbench/services/title/browser/titleService'; +import { onDidChangeFullscreen } from '../../../../base/browser/browser.js'; +import { hide, show } from '../../../../base/browser/dom.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { isNative } from '../../../../base/common/platform.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { hasCustomTitlebar } from '../../../../platform/window/common/window.js'; +import { IAuxiliaryWindowOpenOptions, IAuxiliaryWindowService } from '../../../services/auxiliaryWindow/browser/auxiliaryWindowService.js'; +import { IBottomBarPartService } from '../../../services/bottomBarPart/browser/bottomBarPartService.js'; +import { GroupDirection, GroupsOrder, IAuxiliaryEditorPart } from '../../../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { IHostService } from '../../../services/host/browser/host.js'; +import { IWorkbenchLayoutService, shouldShowCustomTitleBar } from '../../../services/layout/browser/layoutService.js'; +import { ILifecycleService } from '../../../services/lifecycle/common/lifecycle.js'; +import { IStatusbarService } from '../../../services/statusbar/browser/statusbar.js'; +import { ITitleService } from '../../../services/title/browser/titleService.js'; +import { IAuxiliaryTitlebarPart } from '../titlebar/titlebarPart.js'; +import { WindowTitle } from '../titlebar/windowTitle.js'; +import { IEditorGroupView, IEditorPartsView } from './editor.js'; +import { EditorPart, IEditorPartUIState } from './editorPart.js'; export interface IAuxiliaryEditorPartOpenOptions extends IAuxiliaryWindowOpenOptions { readonly state?: IEditorPartUIState; diff --git a/src/vs/workbench/browser/parts/editor/binaryDiffEditor.ts b/src/vs/workbench/browser/parts/editor/binaryDiffEditor.ts index f4314ae0dbb..894e4b51e22 100644 --- a/src/vs/workbench/browser/parts/editor/binaryDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/binaryDiffEditor.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { BINARY_DIFF_EDITOR_ID } from 'vs/workbench/common/editor'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { SideBySideEditor } from 'vs/workbench/browser/parts/editor/sideBySideEditor'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { BaseBinaryResourceEditor } from 'vs/workbench/browser/parts/editor/binaryEditor'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { localize } from '../../../../nls.js'; +import { BINARY_DIFF_EDITOR_ID } from '../../../common/editor.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { SideBySideEditor } from './sideBySideEditor.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { BaseBinaryResourceEditor } from './binaryEditor.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { ITextResourceConfigurationService } from '../../../../editor/common/services/textResourceConfiguration.js'; +import { IEditorGroup, IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; /** * An implementation of editor for diffing binary files like images or videos. diff --git a/src/vs/workbench/browser/parts/editor/binaryEditor.ts b/src/vs/workbench/browser/parts/editor/binaryEditor.ts index 52a01908818..a1205e7aa6d 100644 --- a/src/vs/workbench/browser/parts/editor/binaryEditor.ts +++ b/src/vs/workbench/browser/parts/editor/binaryEditor.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { Emitter } from 'vs/base/common/event'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ByteSize } from 'vs/platform/files/common/files'; -import { IEditorOptions } from 'vs/platform/editor/common/editor'; -import { EditorPlaceholder, IEditorPlaceholderContents } from 'vs/workbench/browser/parts/editor/editorPlaceholder'; -import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService'; +import { localize } from '../../../../nls.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { BinaryEditorModel } from '../../../common/editor/binaryEditorModel.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { ByteSize } from '../../../../platform/files/common/files.js'; +import { IEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { EditorPlaceholder, IEditorPlaceholderContents } from './editorPlaceholder.js'; +import { IEditorGroup } from '../../../services/editor/common/editorGroupsService.js'; export interface IOpenCallbacks { openInternal: (input: EditorInput, options: IEditorOptions | undefined) => Promise; diff --git a/src/vs/workbench/browser/parts/editor/breadcrumbs.ts b/src/vs/workbench/browser/parts/editor/breadcrumbs.ts index 10046b04a13..4e650d81e83 100644 --- a/src/vs/workbench/browser/parts/editor/breadcrumbs.ts +++ b/src/vs/workbench/browser/parts/editor/breadcrumbs.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BreadcrumbsWidget } from 'vs/base/browser/ui/breadcrumbs/breadcrumbsWidget'; -import { Emitter, Event } from 'vs/base/common/event'; -import * as glob from 'vs/base/common/glob'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { localize } from 'vs/nls'; -import { IConfigurationOverrides, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { Extensions, IConfigurationRegistry, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { GroupIdentifier, IEditorPartOptions } from 'vs/workbench/common/editor'; +import { BreadcrumbsWidget } from '../../../../base/browser/ui/breadcrumbs/breadcrumbsWidget.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import * as glob from '../../../../base/common/glob.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { localize } from '../../../../nls.js'; +import { IConfigurationOverrides, IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { Extensions, IConfigurationRegistry, ConfigurationScope } from '../../../../platform/configuration/common/configurationRegistry.js'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { GroupIdentifier, IEditorPartOptions } from '../../../common/editor.js'; export const IBreadcrumbsService = createDecorator('IEditorBreadcrumbsService'); diff --git a/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts b/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts index e2fefb174e6..8fa44fe2e1b 100644 --- a/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts +++ b/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts @@ -3,45 +3,44 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as dom from 'vs/base/browser/dom'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { BreadcrumbsItem, BreadcrumbsWidget, IBreadcrumbsItemEvent, IBreadcrumbsWidgetStyles } from 'vs/base/browser/ui/breadcrumbs/breadcrumbsWidget'; -import { tail } from 'vs/base/common/arrays'; -import { timeout } from 'vs/base/common/async'; -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { combinedDisposable, DisposableStore, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { extUri } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import 'vs/css!./media/breadcrumbscontrol'; -import { localize, localize2 } from 'vs/nls'; -import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { FileKind, IFileService, IFileStat } from 'vs/platform/files/common/files'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IListService, WorkbenchAsyncDataTree, WorkbenchDataTree, WorkbenchListFocusContextKey } from 'vs/platform/list/browser/listService'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { DEFAULT_LABELS_CONTAINER, ResourceLabels } from 'vs/workbench/browser/labels'; -import { BreadcrumbsConfig, IBreadcrumbsService } from 'vs/workbench/browser/parts/editor/breadcrumbs'; -import { BreadcrumbsModel, FileElement, OutlineElement2 } from 'vs/workbench/browser/parts/editor/breadcrumbsModel'; -import { BreadcrumbsFilePicker, BreadcrumbsOutlinePicker, BreadcrumbsPicker } from 'vs/workbench/browser/parts/editor/breadcrumbsPicker'; -import { IEditorPartOptions, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor'; -import { ACTIVE_GROUP, ACTIVE_GROUP_TYPE, IEditorService, SIDE_GROUP, SIDE_GROUP_TYPE } from 'vs/workbench/services/editor/common/editorService'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor'; -import { PixelRatio } from 'vs/base/browser/pixelRatio'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { ITreeNode } from 'vs/base/browser/ui/tree/tree'; -import { IOutline } from 'vs/workbench/services/outline/browser/outline'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { Codicon } from 'vs/base/common/codicons'; -import { defaultBreadcrumbsWidgetStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { Emitter } from 'vs/base/common/event'; -import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate'; -import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; +import * as dom from '../../../../base/browser/dom.js'; +import { StandardMouseEvent } from '../../../../base/browser/mouseEvent.js'; +import { BreadcrumbsItem, BreadcrumbsWidget, IBreadcrumbsItemEvent, IBreadcrumbsWidgetStyles } from '../../../../base/browser/ui/breadcrumbs/breadcrumbsWidget.js'; +import { tail } from '../../../../base/common/arrays.js'; +import { timeout } from '../../../../base/common/async.js'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { combinedDisposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { extUri } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import './media/breadcrumbscontrol.css'; +import { localize, localize2 } from '../../../../nls.js'; +import { Action2, MenuId, registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { IContextViewService } from '../../../../platform/contextview/browser/contextView.js'; +import { FileKind, IFileService, IFileStat } from '../../../../platform/files/common/files.js'; +import { IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingsRegistry, KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IListService, WorkbenchAsyncDataTree, WorkbenchDataTree, WorkbenchListFocusContextKey } from '../../../../platform/list/browser/listService.js'; +import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; +import { DEFAULT_LABELS_CONTAINER, ResourceLabels } from '../../labels.js'; +import { BreadcrumbsConfig, IBreadcrumbsService } from './breadcrumbs.js'; +import { BreadcrumbsModel, FileElement, OutlineElement2 } from './breadcrumbsModel.js'; +import { BreadcrumbsFilePicker, BreadcrumbsOutlinePicker, BreadcrumbsPicker } from './breadcrumbsPicker.js'; +import { IEditorPartOptions, EditorResourceAccessor, SideBySideEditor } from '../../../common/editor.js'; +import { ACTIVE_GROUP, ACTIVE_GROUP_TYPE, IEditorService, SIDE_GROUP, SIDE_GROUP_TYPE } from '../../../services/editor/common/editorService.js'; +import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; +import { IEditorGroupView } from './editor.js'; +import { PixelRatio } from '../../../../base/browser/pixelRatio.js'; +import { ILabelService } from '../../../../platform/label/common/label.js'; +import { Categories } from '../../../../platform/action/common/actionCommonCategories.js'; +import { IOutline } from '../../../services/outline/browser/outline.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { defaultBreadcrumbsWidgetStyles } from '../../../../platform/theme/browser/defaultStyles.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { IHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegate.js'; +import { getDefaultHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js'; class OutlineItem extends BreadcrumbsItem { @@ -85,7 +84,7 @@ class OutlineItem extends BreadcrumbsItem { } const template = renderer.renderTemplate(container); - renderer.renderElement(>{ + renderer.renderElement({ element, children: [], depth: 0, diff --git a/src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts b/src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts index 22f155f85c7..f49b2301ea5 100644 --- a/src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts +++ b/src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { DisposableStore, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { Schemas, matchesSomeScheme } from 'vs/base/common/network'; -import { dirname, isEqual } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { FileKind } from 'vs/platform/files/common/files'; -import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace'; -import { BreadcrumbsConfig } from 'vs/workbench/browser/parts/editor/breadcrumbs'; -import { IEditorPane } from 'vs/workbench/common/editor'; -import { IOutline, IOutlineService, OutlineTarget } from 'vs/workbench/services/outline/browser/outline'; +import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { DisposableStore, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { Schemas, matchesSomeScheme } from '../../../../base/common/network.js'; +import { dirname, isEqual } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { FileKind } from '../../../../platform/files/common/files.js'; +import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from '../../../../platform/workspace/common/workspace.js'; +import { BreadcrumbsConfig } from './breadcrumbs.js'; +import { IEditorPane } from '../../../common/editor.js'; +import { IOutline, IOutlineService, OutlineTarget } from '../../../services/outline/browser/outline.js'; export class FileElement { constructor( diff --git a/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts b/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts index 13c2df31119..6fd6bb2a076 100644 --- a/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts +++ b/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts @@ -3,34 +3,34 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { compareFileNames } from 'vs/base/common/comparers'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; -import { createMatches, FuzzyScore } from 'vs/base/common/filters'; -import * as glob from 'vs/base/common/glob'; -import { IDisposable, DisposableStore, MutableDisposable, Disposable } from 'vs/base/common/lifecycle'; -import { posix, relative } from 'vs/base/common/path'; -import { basename, dirname, isEqual } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import 'vs/css!./media/breadcrumbscontrol'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { FileKind, IFileService, IFileStat } from 'vs/platform/files/common/files'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { WorkbenchDataTree, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService'; -import { breadcrumbsPickerBackground, widgetBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry'; -import { isWorkspace, isWorkspaceFolder, IWorkspace, IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { ResourceLabels, IResourceLabel, DEFAULT_LABELS_CONTAINER } from 'vs/workbench/browser/labels'; -import { BreadcrumbsConfig } from 'vs/workbench/browser/parts/editor/breadcrumbs'; -import { OutlineElement2, FileElement } from 'vs/workbench/browser/parts/editor/breadcrumbsModel'; -import { IAsyncDataSource, ITreeRenderer, ITreeNode, ITreeFilter, TreeVisibility, ITreeSorter } from 'vs/base/browser/ui/tree/tree'; -import { IIdentityProvider, IListVirtualDelegate, IKeyboardNavigationLabelProvider } from 'vs/base/browser/ui/list/list'; -import { IFileIconTheme, IThemeService } from 'vs/platform/theme/common/themeService'; -import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; -import { localize } from 'vs/nls'; -import { IOutline, IOutlineComparator } from 'vs/workbench/services/outline/browser/outline'; -import { IEditorOptions } from 'vs/platform/editor/common/editor'; -import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; +import { compareFileNames } from '../../../../base/common/comparers.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { createMatches, FuzzyScore } from '../../../../base/common/filters.js'; +import * as glob from '../../../../base/common/glob.js'; +import { IDisposable, DisposableStore, MutableDisposable, Disposable } from '../../../../base/common/lifecycle.js'; +import { posix, relative } from '../../../../base/common/path.js'; +import { basename, dirname, isEqual } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import './media/breadcrumbscontrol.css'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { FileKind, IFileService, IFileStat } from '../../../../platform/files/common/files.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { WorkbenchDataTree, WorkbenchAsyncDataTree } from '../../../../platform/list/browser/listService.js'; +import { breadcrumbsPickerBackground, widgetBorder, widgetShadow } from '../../../../platform/theme/common/colorRegistry.js'; +import { isWorkspace, isWorkspaceFolder, IWorkspace, IWorkspaceContextService, IWorkspaceFolder } from '../../../../platform/workspace/common/workspace.js'; +import { ResourceLabels, IResourceLabel, DEFAULT_LABELS_CONTAINER } from '../../labels.js'; +import { BreadcrumbsConfig } from './breadcrumbs.js'; +import { OutlineElement2, FileElement } from './breadcrumbsModel.js'; +import { IAsyncDataSource, ITreeRenderer, ITreeNode, ITreeFilter, TreeVisibility, ITreeSorter } from '../../../../base/browser/ui/tree/tree.js'; +import { IIdentityProvider, IListVirtualDelegate, IKeyboardNavigationLabelProvider } from '../../../../base/browser/ui/list/list.js'; +import { IFileIconTheme, IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { IListAccessibilityProvider } from '../../../../base/browser/ui/list/listWidget.js'; +import { localize } from '../../../../nls.js'; +import { IOutline, IOutlineComparator } from '../../../services/outline/browser/outline.js'; +import { IEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { IEditorService, SIDE_GROUP } from '../../../services/editor/common/editorService.js'; +import { ITextResourceConfigurationService } from '../../../../editor/common/services/textResourceConfiguration.js'; interface ILayoutInfo { maxHeight: number; diff --git a/src/vs/workbench/browser/parts/editor/diffEditorCommands.ts b/src/vs/workbench/browser/parts/editor/diffEditorCommands.ts index 378552f35e0..dc3f83afe6c 100644 --- a/src/vs/workbench/browser/parts/editor/diffEditorCommands.ts +++ b/src/vs/workbench/browser/parts/editor/diffEditorCommands.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { isEqual } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { localize, localize2 } from 'vs/nls'; -import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { TextDiffEditor } from 'vs/workbench/browser/parts/editor/textDiffEditor'; -import { ActiveCompareEditorCanSwapContext, TextCompareEditorActiveContext, TextCompareEditorVisibleContext } from 'vs/workbench/common/contextkeys'; -import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { isEqual } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ITextResourceConfigurationService } from '../../../../editor/common/services/textResourceConfiguration.js'; +import { localize, localize2 } from '../../../../nls.js'; +import { MenuId, MenuRegistry } from '../../../../platform/actions/common/actions.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingsRegistry, KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { TextDiffEditor } from './textDiffEditor.js'; +import { ActiveCompareEditorCanSwapContext, TextCompareEditorActiveContext, TextCompareEditorVisibleContext } from '../../../common/contextkeys.js'; +import { DiffEditorInput } from '../../../common/editor/diffEditorInput.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; export const TOGGLE_DIFF_SIDE_BY_SIDE = 'toggle.diff.renderSideBySide'; export const GOTO_NEXT_CHANGE = 'workbench.action.compareEditor.nextChange'; diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index dfb20dc68fb..1c777faacaf 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -3,29 +3,29 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Registry } from 'vs/platform/registry/common/platform'; -import { localize, localize2 } from 'vs/nls'; -import { IEditorPaneRegistry, EditorPaneDescriptor } from 'vs/workbench/browser/editor'; -import { IEditorFactoryRegistry, EditorExtensions } from 'vs/workbench/common/editor'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { localize, localize2 } from '../../../../nls.js'; +import { IEditorPaneRegistry, EditorPaneDescriptor } from '../../editor.js'; +import { IEditorFactoryRegistry, EditorExtensions } from '../../../common/editor.js'; import { TextCompareEditorActiveContext, ActiveEditorPinnedContext, EditorGroupEditorsCountContext, ActiveEditorStickyContext, ActiveEditorAvailableEditorIdsContext, EditorPartMultipleEditorGroupsContext, ActiveEditorDirtyContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, EditorTabsVisibleContext, ActiveEditorLastInGroupContext, EditorPartMaximizedEditorGroupContext, MultipleEditorGroupsContext, InEditorZenModeContext, IsAuxiliaryEditorPartContext, ActiveCompareEditorCanSwapContext, MultipleEditorsSelectedInGroupContext -} from 'vs/workbench/common/contextkeys'; -import { SideBySideEditorInput, SideBySideEditorInputSerializer } from 'vs/workbench/common/editor/sideBySideEditorInput'; -import { TextResourceEditor } from 'vs/workbench/browser/parts/editor/textResourceEditor'; -import { SideBySideEditor } from 'vs/workbench/browser/parts/editor/sideBySideEditor'; -import { DiffEditorInput, DiffEditorInputSerializer } from 'vs/workbench/common/editor/diffEditorInput'; -import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput'; -import { TextResourceEditorInput } from 'vs/workbench/common/editor/textResourceEditorInput'; -import { TextDiffEditor } from 'vs/workbench/browser/parts/editor/textDiffEditor'; -import { BinaryResourceDiffEditor } from 'vs/workbench/browser/parts/editor/binaryDiffEditor'; -import { ChangeEncodingAction, ChangeEOLAction, ChangeLanguageAction, EditorStatusContribution } from 'vs/workbench/browser/parts/editor/editorStatus'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { MenuRegistry, MenuId, IMenuItem, registerAction2 } from 'vs/platform/actions/common/actions'; -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; +} from '../../../common/contextkeys.js'; +import { SideBySideEditorInput, SideBySideEditorInputSerializer } from '../../../common/editor/sideBySideEditorInput.js'; +import { TextResourceEditor } from './textResourceEditor.js'; +import { SideBySideEditor } from './sideBySideEditor.js'; +import { DiffEditorInput, DiffEditorInputSerializer } from '../../../common/editor/diffEditorInput.js'; +import { UntitledTextEditorInput } from '../../../services/untitled/common/untitledTextEditorInput.js'; +import { TextResourceEditorInput } from '../../../common/editor/textResourceEditorInput.js'; +import { TextDiffEditor } from './textDiffEditor.js'; +import { BinaryResourceDiffEditor } from './binaryDiffEditor.js'; +import { ChangeEncodingAction, ChangeEOLAction, ChangeLanguageAction, EditorStatusContribution } from './editorStatus.js'; +import { Categories } from '../../../../platform/action/common/actionCommonCategories.js'; +import { MenuRegistry, MenuId, IMenuItem, registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js'; +import { KeyMod, KeyCode } from '../../../../base/common/keyCodes.js'; import { CloseEditorsInOtherGroupsAction, CloseAllEditorsAction, MoveGroupLeftAction, MoveGroupRightAction, SplitEditorAction, JoinTwoGroupsAction, RevertAndCloseEditorAction, NavigateBetweenGroupsAction, FocusActiveGroupAction, FocusFirstGroupAction, ResetGroupSizesAction, MinimizeOtherGroupsAction, FocusPreviousGroup, FocusNextGroup, @@ -44,7 +44,7 @@ import { NavigateBackwardsInEditsAction, NavigateForwardInNavigationsAction, NavigateBackwardsInNavigationsAction, NavigatePreviousInNavigationsAction, NavigatePreviousInEditsAction, NavigateToLastNavigationLocationAction, MaximizeGroupHideSidebarAction, MoveEditorToNewWindowAction, CopyEditorToNewindowAction, RestoreEditorsToMainWindowAction, ToggleMaximizeEditorGroupAction, MinimizeOtherGroupsHideSidebarAction, CopyEditorGroupToNewWindowAction, MoveEditorGroupToNewWindowAction, NewEmptyEditorWindowAction -} from 'vs/workbench/browser/parts/editor/editorActions'; +} from './editorActions.js'; import { CLOSE_EDITORS_AND_GROUP_COMMAND_ID, CLOSE_EDITORS_IN_GROUP_COMMAND_ID, CLOSE_EDITORS_TO_THE_RIGHT_COMMAND_ID, CLOSE_EDITOR_COMMAND_ID, CLOSE_EDITOR_GROUP_COMMAND_ID, CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, CLOSE_PINNED_EDITOR_COMMAND_ID, CLOSE_SAVED_EDITORS_COMMAND_ID, KEEP_EDITOR_COMMAND_ID, PIN_EDITOR_COMMAND_ID, SHOW_EDITORS_IN_GROUP, SPLIT_EDITOR_DOWN, SPLIT_EDITOR_LEFT, @@ -52,26 +52,26 @@ import { TOGGLE_LOCK_GROUP_COMMAND_ID, UNLOCK_GROUP_COMMAND_ID, SPLIT_EDITOR_IN_GROUP, JOIN_EDITOR_IN_GROUP, FOCUS_FIRST_SIDE_EDITOR, FOCUS_SECOND_SIDE_EDITOR, TOGGLE_SPLIT_EDITOR_IN_GROUP_LAYOUT, LOCK_GROUP_COMMAND_ID, SPLIT_EDITOR, TOGGLE_MAXIMIZE_EDITOR_GROUP, MOVE_EDITOR_INTO_NEW_WINDOW_COMMAND_ID, COPY_EDITOR_INTO_NEW_WINDOW_COMMAND_ID, MOVE_EDITOR_GROUP_INTO_NEW_WINDOW_COMMAND_ID, COPY_EDITOR_GROUP_INTO_NEW_WINDOW_COMMAND_ID, NEW_EMPTY_EDITOR_WINDOW_COMMAND_ID -} from 'vs/workbench/browser/parts/editor/editorCommands'; -import { GOTO_NEXT_CHANGE, GOTO_PREVIOUS_CHANGE, TOGGLE_DIFF_IGNORE_TRIM_WHITESPACE, TOGGLE_DIFF_SIDE_BY_SIDE, DIFF_SWAP_SIDES } from './diffEditorCommands'; -import { inQuickPickContext, getQuickNavigateHandler } from 'vs/workbench/browser/quickaccess'; -import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ContextKeyExpr, ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey'; -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'; -import { Codicon } from 'vs/base/common/codicons'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { UntitledTextEditorInputSerializer, UntitledTextEditorWorkingCopyEditorHandler } from 'vs/workbench/services/untitled/common/untitledTextEditorHandler'; -import { DynamicEditorConfigurations } from 'vs/workbench/browser/parts/editor/editorConfiguration'; -import { 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'; +} from './editorCommands.js'; +import { GOTO_NEXT_CHANGE, GOTO_PREVIOUS_CHANGE, TOGGLE_DIFF_IGNORE_TRIM_WHITESPACE, TOGGLE_DIFF_SIDE_BY_SIDE, DIFF_SWAP_SIDES } from './diffEditorCommands.js'; +import { inQuickPickContext, getQuickNavigateHandler } from '../../quickaccess.js'; +import { KeybindingsRegistry, KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ContextKeyExpr, ContextKeyExpression } from '../../../../platform/contextkey/common/contextkey.js'; +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'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; +import { UntitledTextEditorInputSerializer, UntitledTextEditorWorkingCopyEditorHandler } from '../../../services/untitled/common/untitledTextEditorHandler.js'; +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'; //#region Editor Registrations @@ -385,6 +385,8 @@ MenuRegistry.appendMenuItem(MenuId.EditorActionsPositionSubmenu, { command: { id MenuRegistry.appendMenuItem(MenuId.EditorActionsPositionSubmenu, { command: { id: EditorActionsTitleBarAction.ID, title: localize('titleBar', "Title Bar"), toggled: ContextKeyExpr.or(ContextKeyExpr.equals('config.workbench.editor.editorActionsLocation', 'titleBar'), ContextKeyExpr.and(ContextKeyExpr.equals('config.workbench.editor.showTabs', 'none'), ContextKeyExpr.equals('config.workbench.editor.editorActionsLocation', 'default'))) }, group: '1_config', order: 20 }); MenuRegistry.appendMenuItem(MenuId.EditorActionsPositionSubmenu, { command: { id: HideEditorActionsAction.ID, title: localize('hidden', "Hidden"), toggled: ContextKeyExpr.equals('config.workbench.editor.editorActionsLocation', 'hidden') }, group: '1_config', order: 30 }); +MenuRegistry.appendMenuItem(MenuId.EditorTabsBarContext, { command: { id: ConfigureEditorTabsAction.ID, title: localize('configureTabs', "Configure Tabs") }, group: '9_configure', order: 10 }); + // Editor Title Context Menu MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: CLOSE_EDITOR_COMMAND_ID, title: localize('close', "Close") }, group: '1_close', order: 10 }); MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, title: localize('closeOthers', "Close Others"), precondition: EditorGroupEditorsCountContext.notEqualsTo('1') }, group: '1_close', order: 20 }); @@ -414,6 +416,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: TOGGLE_KEEP_EDI MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: TOGGLE_MAXIMIZE_EDITOR_GROUP, title: localize('maximizeGroup', "Maximize Group") }, group: '8_group_operations', order: 5, when: ContextKeyExpr.and(EditorPartMaximizedEditorGroupContext.negate(), EditorPartMultipleEditorGroupsContext) }); MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: TOGGLE_MAXIMIZE_EDITOR_GROUP, title: localize('unmaximizeGroup', "Unmaximize Group") }, group: '8_group_operations', order: 5, when: EditorPartMaximizedEditorGroupContext }); MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: TOGGLE_LOCK_GROUP_COMMAND_ID, title: localize('lockGroup', "Lock Group"), toggled: ActiveEditorGroupLockedContext }, group: '8_group_operations', order: 10, when: IsAuxiliaryEditorPartContext.toNegated() /* already a primary action for aux windows */ }); +MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: ConfigureEditorAction.ID, title: localize('configureEditors', "Configure Editors") }, group: '9_configure', order: 10 }); function appendEditorToolItem(primary: ICommandAction, when: ContextKeyExpression | undefined, order: number, alternative?: ICommandAction, precondition?: ContextKeyExpression | undefined): void { const item: IMenuItem = { diff --git a/src/vs/workbench/browser/parts/editor/editor.ts b/src/vs/workbench/browser/parts/editor/editor.ts index 066385368f8..d6f477d64f0 100644 --- a/src/vs/workbench/browser/parts/editor/editor.ts +++ b/src/vs/workbench/browser/parts/editor/editor.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { GroupIdentifier, IWorkbenchEditorConfiguration, IEditorIdentifier, IEditorCloseEvent, IEditorPartOptions, IEditorPartOptionsChangeEvent, SideBySideEditor, EditorCloseContext, IEditorPane, IEditorPartLimitOptions, IEditorPartDecorationOptions, IEditorWillOpenEvent } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { IEditorGroup, GroupDirection, IMergeGroupOptions, GroupsOrder, GroupsArrangement, IAuxiliaryEditorPart, IEditorPart } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { Dimension } from 'vs/base/browser/dom'; -import { Event } from 'vs/base/common/event'; -import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ISerializableView } from 'vs/base/browser/ui/grid/grid'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { isObject } from 'vs/base/common/types'; -import { IEditorOptions } from 'vs/platform/editor/common/editor'; -import { IWindowsConfiguration } from 'vs/platform/window/common/window'; -import { BooleanVerifier, EnumVerifier, NumberVerifier, ObjectVerifier, SetVerifier, verifyObject } from 'vs/base/common/verifier'; -import { IAuxiliaryWindowOpenOptions } from 'vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService'; -import { ContextKeyValue, IContextKey, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { GroupIdentifier, IWorkbenchEditorConfiguration, IEditorIdentifier, IEditorCloseEvent, IEditorPartOptions, IEditorPartOptionsChangeEvent, SideBySideEditor, EditorCloseContext, IEditorPane, IEditorPartLimitOptions, IEditorPartDecorationOptions, IEditorWillOpenEvent } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { IEditorGroup, GroupDirection, IMergeGroupOptions, GroupsOrder, GroupsArrangement, IAuxiliaryEditorPart, IEditorPart } from '../../../services/editor/common/editorGroupsService.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { Dimension } from '../../../../base/browser/dom.js'; +import { Event } from '../../../../base/common/event.js'; +import { IConfigurationChangeEvent, IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { ISerializableView } from '../../../../base/browser/ui/grid/grid.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { isObject } from '../../../../base/common/types.js'; +import { IEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { IWindowsConfiguration } from '../../../../platform/window/common/window.js'; +import { BooleanVerifier, EnumVerifier, NumberVerifier, ObjectVerifier, SetVerifier, verifyObject } from '../../../../base/common/verifier.js'; +import { IAuxiliaryWindowOpenOptions } from '../../../services/auxiliaryWindow/browser/auxiliaryWindowService.js'; +import { ContextKeyValue, IContextKey, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; export interface IEditorPartCreationOptions { readonly restorePreviousState: boolean; diff --git a/src/vs/workbench/browser/parts/editor/editorActions.ts b/src/vs/workbench/browser/parts/editor/editorActions.ts index 63e2103bcee..1b1a39b30ca 100644 --- a/src/vs/workbench/browser/parts/editor/editorActions.ts +++ b/src/vs/workbench/browser/parts/editor/editorActions.ts @@ -3,41 +3,41 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize, localize2 } from 'vs/nls'; -import { Action } from 'vs/base/common/actions'; -import { firstOrDefault } from 'vs/base/common/arrays'; -import { IEditorIdentifier, IEditorCommandsContext, CloseDirection, SaveReason, EditorsOrder, EditorInputCapabilities, DEFAULT_EDITOR_ASSOCIATION, GroupIdentifier, EditorResourceAccessor } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; -import { GoFilter, IHistoryService } from 'vs/workbench/services/history/common/history'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { CLOSE_EDITOR_COMMAND_ID, MOVE_ACTIVE_EDITOR_COMMAND_ID, ActiveEditorMoveCopyArguments, SPLIT_EDITOR_LEFT, SPLIT_EDITOR_RIGHT, SPLIT_EDITOR_UP, SPLIT_EDITOR_DOWN, splitEditor, LAYOUT_EDITOR_GROUPS_COMMAND_ID, UNPIN_EDITOR_COMMAND_ID, COPY_ACTIVE_EDITOR_COMMAND_ID, SPLIT_EDITOR, resolveCommandsContext, getCommandsContext, TOGGLE_MAXIMIZE_EDITOR_GROUP, MOVE_EDITOR_INTO_NEW_WINDOW_COMMAND_ID, COPY_EDITOR_INTO_NEW_WINDOW_COMMAND_ID, MOVE_EDITOR_GROUP_INTO_NEW_WINDOW_COMMAND_ID, COPY_EDITOR_GROUP_INTO_NEW_WINDOW_COMMAND_ID, NEW_EMPTY_EDITOR_WINDOW_COMMAND_ID as NEW_EMPTY_EDITOR_WINDOW_COMMAND_ID, resolveEditorsContext, getEditorsContext } from 'vs/workbench/browser/parts/editor/editorCommands'; -import { IEditorGroupsService, IEditorGroup, GroupsArrangement, GroupLocation, GroupDirection, preferredSideBySideGroupDirection, IFindGroupScope, GroupOrientation, EditorGroupLayout, GroupsOrder, MergeGroupMode } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; -import { IFileDialogService, ConfirmResult, IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { ItemActivation, IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { AllEditorsByMostRecentlyUsedQuickAccess, ActiveGroupEditorsByMostRecentlyUsedQuickAccess, AllEditorsByAppearanceQuickAccess } from 'vs/workbench/browser/parts/editor/editorQuickAccess'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IFilesConfigurationService, AutoSaveMode } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; -import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService'; -import { isLinux, isNative, isWindows } from 'vs/base/common/platform'; -import { Action2, IAction2Options, MenuId } from 'vs/platform/actions/common/actions'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { IKeybindingRule, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ILogService } from 'vs/platform/log/common/log'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { ActiveEditorAvailableEditorIdsContext, ActiveEditorContext, ActiveEditorGroupEmptyContext, AuxiliaryBarVisibleContext, EditorPartMaximizedEditorGroupContext, EditorPartMultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, MultipleEditorGroupsContext, SideBarVisibleContext } from 'vs/workbench/common/contextkeys'; -import { URI } from 'vs/base/common/uri'; -import { getActiveDocument } from 'vs/base/browser/dom'; -import { ICommandActionTitle } from 'vs/platform/action/common/action'; -import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; +import { localize, localize2 } from '../../../../nls.js'; +import { Action } from '../../../../base/common/actions.js'; +import { IEditorIdentifier, IEditorCommandsContext, CloseDirection, SaveReason, EditorsOrder, EditorInputCapabilities, DEFAULT_EDITOR_ASSOCIATION, GroupIdentifier, EditorResourceAccessor } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { SideBySideEditorInput } from '../../../common/editor/sideBySideEditorInput.js'; +import { IWorkbenchLayoutService, Parts } from '../../../services/layout/browser/layoutService.js'; +import { GoFilter, IHistoryService } from '../../../services/history/common/history.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { CLOSE_EDITOR_COMMAND_ID, MOVE_ACTIVE_EDITOR_COMMAND_ID, ActiveEditorMoveCopyArguments, SPLIT_EDITOR_LEFT, SPLIT_EDITOR_RIGHT, SPLIT_EDITOR_UP, SPLIT_EDITOR_DOWN, splitEditor, LAYOUT_EDITOR_GROUPS_COMMAND_ID, UNPIN_EDITOR_COMMAND_ID, COPY_ACTIVE_EDITOR_COMMAND_ID, SPLIT_EDITOR, TOGGLE_MAXIMIZE_EDITOR_GROUP, MOVE_EDITOR_INTO_NEW_WINDOW_COMMAND_ID, COPY_EDITOR_INTO_NEW_WINDOW_COMMAND_ID, MOVE_EDITOR_GROUP_INTO_NEW_WINDOW_COMMAND_ID, COPY_EDITOR_GROUP_INTO_NEW_WINDOW_COMMAND_ID, NEW_EMPTY_EDITOR_WINDOW_COMMAND_ID as NEW_EMPTY_EDITOR_WINDOW_COMMAND_ID } from './editorCommands.js'; +import { IEditorGroupsService, IEditorGroup, GroupsArrangement, GroupLocation, GroupDirection, preferredSideBySideGroupDirection, IFindGroupScope, GroupOrientation, EditorGroupLayout, GroupsOrder, MergeGroupMode } from '../../../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IWorkspacesService } from '../../../../platform/workspaces/common/workspaces.js'; +import { IFileDialogService, ConfirmResult, IDialogService } from '../../../../platform/dialogs/common/dialogs.js'; +import { ItemActivation, IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; +import { AllEditorsByMostRecentlyUsedQuickAccess, ActiveGroupEditorsByMostRecentlyUsedQuickAccess, AllEditorsByAppearanceQuickAccess } from './editorQuickAccess.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { IFilesConfigurationService, AutoSaveMode } from '../../../services/filesConfiguration/common/filesConfigurationService.js'; +import { IEditorResolverService } from '../../../services/editor/common/editorResolverService.js'; +import { isLinux, isNative, isWindows } from '../../../../base/common/platform.js'; +import { Action2, IAction2Options, MenuId } from '../../../../platform/actions/common/actions.js'; +import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { IKeybindingRule, KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { Categories } from '../../../../platform/action/common/actionCommonCategories.js'; +import { ActiveEditorAvailableEditorIdsContext, ActiveEditorContext, ActiveEditorGroupEmptyContext, AuxiliaryBarVisibleContext, EditorPartMaximizedEditorGroupContext, EditorPartMultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, MultipleEditorGroupsContext, SideBarVisibleContext } from '../../../common/contextkeys.js'; +import { getActiveDocument } from '../../../../base/browser/dom.js'; +import { ICommandActionTitle } from '../../../../platform/action/common/action.js'; +import { IProgressService, ProgressLocation } from '../../../../platform/progress/common/progress.js'; +import { resolveCommandsContext } from './editorCommandsContext.js'; +import { IListService } from '../../../../platform/list/browser/listService.js'; class ExecuteCommandAction extends Action2 { @@ -62,12 +62,14 @@ abstract class AbstractSplitEditorAction extends Action2 { return preferredSideBySideGroupDirection(configurationService); } - override async run(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): Promise { - const editorGroupService = accessor.get(IEditorGroupsService); + override async run(accessor: ServicesAccessor, ...args: unknown[]): Promise { + const editorGroupsService = accessor.get(IEditorGroupsService); const configurationService = accessor.get(IConfigurationService); - const commandContext = getCommandsContext(accessor, resourceOrContext, context); - splitEditor(editorGroupService, this.getDirection(configurationService), commandContext ? [commandContext] : undefined); + const direction = this.getDirection(configurationService); + const commandContext = resolveCommandsContext(args, accessor.get(IEditorService), editorGroupsService, accessor.get(IListService)); + + splitEditor(editorGroupsService, direction, commandContext); } } @@ -653,7 +655,7 @@ abstract class AbstractCloseAllAction extends Action2 { await this.revealEditorsToConfirm(editors, editorGroupService); // help user make a decision by revealing editors - const confirmation = await firstOrDefault(editors)?.editor.closeHandler?.confirm?.(editors); + const confirmation = await editors.at(0)?.editor.closeHandler?.confirm?.(editors); if (typeof confirmation === 'number') { switch (confirmation) { case ConfirmResult.CANCEL: @@ -1169,11 +1171,13 @@ export class ToggleMaximizeEditorGroupAction extends Action2 { }); } - override async run(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): Promise { + override async run(accessor: ServicesAccessor, ...args: unknown[]): Promise { const editorGroupsService = accessor.get(IEditorGroupsService); - const { group } = resolveCommandsContext(editorGroupsService, getCommandsContext(accessor, resourceOrContext, context)); - editorGroupsService.toggleMaximizeGroup(group); + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), editorGroupsService, accessor.get(IListService)); + if (resolvedContext.groupedEditors.length) { + editorGroupsService.toggleMaximizeGroup(resolvedContext.groupedEditors[0].group); + } } } @@ -2538,21 +2542,24 @@ abstract class BaseMoveCopyEditorToNewWindowAction extends Action2 { }); } - override async run(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) { + override async run(accessor: ServicesAccessor, ...args: unknown[]) { const editorGroupService = accessor.get(IEditorGroupsService); - const editorsContext = resolveEditorsContext(getEditorsContext(accessor, resourceOrContext, context)); - if (editorsContext.length === 0) { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), editorGroupService, accessor.get(IListService)); + if (!resolvedContext.groupedEditors.length) { return; } const auxiliaryEditorPart = await editorGroupService.createAuxiliaryEditorPart(); - const sourceGroup = editorsContext[0].group; // only single group supported for move/copy for now - const sourceEditors = editorsContext.filter(({ group }) => group === sourceGroup); + // only single group supported for move/copy for now + const { group, editors } = resolvedContext.groupedEditors[0]; + const options = { preserveFocus: resolvedContext.preserveFocus }; + const editorsWithOptions = editors.map(editor => ({ editor, options })); + if (this.move) { - sourceGroup.moveEditors(sourceEditors, auxiliaryEditorPart.activeGroup); + group.moveEditors(editorsWithOptions, auxiliaryEditorPart.activeGroup); } else { - sourceGroup.copyEditors(sourceEditors, auxiliaryEditorPart.activeGroup); + group.copyEditors(editorsWithOptions, auxiliaryEditorPart.activeGroup); } auxiliaryEditorPart.activeGroup.focus(); diff --git a/src/vs/workbench/browser/parts/editor/editorAutoSave.ts b/src/vs/workbench/browser/parts/editor/editorAutoSave.ts index 2b3de674cb9..a7698154133 100644 --- a/src/vs/workbench/browser/parts/editor/editorAutoSave.ts +++ b/src/vs/workbench/browser/parts/editor/editorAutoSave.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { Disposable, DisposableStore, IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; -import { IFilesConfigurationService, AutoSaveMode, AutoSaveDisabledReason } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { SaveReason, IEditorIdentifier, GroupIdentifier, EditorInputCapabilities } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; -import { IWorkingCopy, WorkingCopyCapabilities } from 'vs/workbench/services/workingCopy/common/workingCopy'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IMarkerService } from 'vs/platform/markers/common/markers'; -import { URI } from 'vs/base/common/uri'; -import { ResourceMap } from 'vs/base/common/map'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; +import { IWorkbenchContribution } from '../../../common/contributions.js'; +import { Disposable, DisposableStore, IDisposable, dispose, toDisposable } from '../../../../base/common/lifecycle.js'; +import { IFilesConfigurationService, AutoSaveMode, AutoSaveDisabledReason } from '../../../services/filesConfiguration/common/filesConfigurationService.js'; +import { IHostService } from '../../../services/host/browser/host.js'; +import { SaveReason, IEditorIdentifier, GroupIdentifier, EditorInputCapabilities } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; +import { IWorkingCopyService } from '../../../services/workingCopy/common/workingCopyService.js'; +import { IWorkingCopy, WorkingCopyCapabilities } from '../../../services/workingCopy/common/workingCopy.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { IMarkerService } from '../../../../platform/markers/common/markers.js'; +import { URI } from '../../../../base/common/uri.js'; +import { ResourceMap } from '../../../../base/common/map.js'; +import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js'; export class EditorAutoSave extends Disposable implements IWorkbenchContribution { @@ -84,7 +84,7 @@ export class EditorAutoSave extends Disposable implements IWorkbenchContribution ) { this.discardAutoSave(workingCopyResult.workingCopy); - this.logService.info(`[editor auto save] running auto save from condition change event`, workingCopyResult.workingCopy.resource.toString(), workingCopyResult.workingCopy.typeId); + this.logService.trace(`[editor auto save] running auto save from condition change event`, workingCopyResult.workingCopy.resource.toString(), workingCopyResult.workingCopy.typeId); workingCopyResult.workingCopy.save({ reason: workingCopyResult.reason }); } } @@ -100,7 +100,7 @@ export class EditorAutoSave extends Disposable implements IWorkbenchContribution ) { this.waitingOnConditionAutoSaveEditors.delete(resource); - this.logService.info(`[editor auto save] running auto save from condition change event with reason ${editorResult.reason}`); + this.logService.trace(`[editor auto save] running auto save from condition change event with reason ${editorResult.reason}`); this.editorService.save(editorResult.editor, { reason: editorResult.reason }); } } diff --git a/src/vs/workbench/browser/parts/editor/editorCommands.ts b/src/vs/workbench/browser/parts/editor/editorCommands.ts index a8ba531496e..6dda6ad5348 100644 --- a/src/vs/workbench/browser/parts/editor/editorCommands.ts +++ b/src/vs/workbench/browser/parts/editor/editorCommands.ts @@ -3,45 +3,43 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getActiveElement } from 'vs/base/browser/dom'; -import { List } from 'vs/base/browser/ui/list/listWidget'; -import { coalesce, distinct } from 'vs/base/common/arrays'; -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Schemas, matchesScheme } from 'vs/base/common/network'; -import { extname, isEqual } from 'vs/base/common/resources'; -import { isNumber, isObject, isString, isUndefined } from 'vs/base/common/types'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { isDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { localize, localize2 } from 'vs/nls'; -import { Categories } from 'vs/platform/action/common/actionCommonCategories'; -import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { CommandsRegistry, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { EditorResolution, IEditorOptions, IResourceEditorInput, ITextEditorOptions } from 'vs/platform/editor/common/editor'; -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { KeybindingWeight, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IListService, IOpenEvent } from 'vs/platform/list/browser/listService'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ActiveGroupEditorsByMostRecentlyUsedQuickAccess } from 'vs/workbench/browser/parts/editor/editorQuickAccess'; -import { SideBySideEditor } from 'vs/workbench/browser/parts/editor/sideBySideEditor'; -import { TextDiffEditor } from 'vs/workbench/browser/parts/editor/textDiffEditor'; -import { ActiveEditorCanSplitInGroupContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupLockedContext, ActiveEditorStickyContext, MultipleEditorGroupsContext, SideBySideEditorActiveContext, TextCompareEditorActiveContext } from 'vs/workbench/common/contextkeys'; -import { CloseDirection, EditorInputCapabilities, EditorsOrder, IEditorCommandsContext, IEditorIdentifier, IResourceDiffEditorInput, IUntitledTextResourceEditorInput, IVisibleEditorPane, isEditorCommandsContext, isEditorIdentifier, isEditorInputWithOptionsAndGroup } from 'vs/workbench/common/editor'; -import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput'; -import { EditorGroupColumn, columnToEditorGroup } from 'vs/workbench/services/editor/common/editorGroupColumn'; -import { EditorGroupLayout, GroupDirection, GroupLocation, GroupsOrder, IEditorGroup, IEditorGroupsService, IEditorReplacement, isEditorGroup, preferredSideBySideGroupDirection } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService'; -import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { IPathService } from 'vs/workbench/services/path/common/pathService'; -import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService'; -import { DIFF_FOCUS_OTHER_SIDE, DIFF_FOCUS_PRIMARY_SIDE, DIFF_FOCUS_SECONDARY_SIDE, DIFF_OPEN_SIDE, registerDiffEditorCommands } from './diffEditorCommands'; +import { IJSONSchema } from '../../../../base/common/jsonSchema.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { Schemas, matchesScheme } from '../../../../base/common/network.js'; +import { extname } from '../../../../base/common/resources.js'; +import { isNumber, isObject, isString, isUndefined } from '../../../../base/common/types.js'; +import { URI, UriComponents } from '../../../../base/common/uri.js'; +import { isDiffEditor } from '../../../../editor/browser/editorBrowser.js'; +import { EditorContextKeys } from '../../../../editor/common/editorContextKeys.js'; +import { localize, localize2 } from '../../../../nls.js'; +import { Categories } from '../../../../platform/action/common/actionCommonCategories.js'; +import { Action2, registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { CommandsRegistry, ICommandHandler, ICommandService } from '../../../../platform/commands/common/commands.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { EditorResolution, IEditorOptions, IResourceEditorInput, ITextEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { KeybindingWeight, KeybindingsRegistry } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { IListService, IOpenEvent } from '../../../../platform/list/browser/listService.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { ActiveGroupEditorsByMostRecentlyUsedQuickAccess } from './editorQuickAccess.js'; +import { SideBySideEditor } from './sideBySideEditor.js'; +import { TextDiffEditor } from './textDiffEditor.js'; +import { ActiveEditorCanSplitInGroupContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupLockedContext, ActiveEditorStickyContext, MultipleEditorGroupsContext, SideBySideEditorActiveContext, TextCompareEditorActiveContext } from '../../../common/contextkeys.js'; +import { CloseDirection, EditorInputCapabilities, EditorsOrder, IResourceDiffEditorInput, IUntitledTextResourceEditorInput, IVisibleEditorPane, isEditorInputWithOptionsAndGroup } from '../../../common/editor.js'; +import { DiffEditorInput } from '../../../common/editor/diffEditorInput.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { SideBySideEditorInput } from '../../../common/editor/sideBySideEditorInput.js'; +import { EditorGroupColumn, columnToEditorGroup } from '../../../services/editor/common/editorGroupColumn.js'; +import { EditorGroupLayout, GroupDirection, GroupLocation, GroupsOrder, IEditorGroup, IEditorGroupsService, IEditorReplacement, preferredSideBySideGroupDirection } from '../../../services/editor/common/editorGroupsService.js'; +import { IEditorResolverService } from '../../../services/editor/common/editorResolverService.js'; +import { IEditorService, SIDE_GROUP } from '../../../services/editor/common/editorService.js'; +import { IPathService } from '../../../services/path/common/pathService.js'; +import { IUntitledTextEditorService } from '../../../services/untitled/common/untitledTextEditorService.js'; +import { DIFF_FOCUS_OTHER_SIDE, DIFF_FOCUS_PRIMARY_SIDE, DIFF_FOCUS_SECONDARY_SIDE, DIFF_OPEN_SIDE, registerDiffEditorCommands } from './diffEditorCommands.js'; +import { IResolvedEditorCommandsContext, resolveCommandsContext } from './editorCommandsContext.js'; export const CLOSE_SAVED_EDITORS_COMMAND_ID = 'workbench.action.closeUnmodifiedEditors'; export const CLOSE_EDITORS_IN_GROUP_COMMAND_ID = 'workbench.action.closeEditorsInGroup'; @@ -242,7 +240,7 @@ function registerActiveEditorMoveCopyCommand(): void { } function moveCopyActiveEditorToGroup(isMove: boolean, args: ActiveEditorMoveCopyArguments, control: IVisibleEditorPane, accessor: ServicesAccessor): void { - const editorGroupService = accessor.get(IEditorGroupsService); + const editorGroupsService = accessor.get(IEditorGroupsService); const configurationService = accessor.get(IConfigurationService); const sourceGroup = control.group; @@ -250,49 +248,49 @@ function registerActiveEditorMoveCopyCommand(): void { switch (args.to) { case 'left': - targetGroup = editorGroupService.findGroup({ direction: GroupDirection.LEFT }, sourceGroup); + targetGroup = editorGroupsService.findGroup({ direction: GroupDirection.LEFT }, sourceGroup); if (!targetGroup) { - targetGroup = editorGroupService.addGroup(sourceGroup, GroupDirection.LEFT); + targetGroup = editorGroupsService.addGroup(sourceGroup, GroupDirection.LEFT); } break; case 'right': - targetGroup = editorGroupService.findGroup({ direction: GroupDirection.RIGHT }, sourceGroup); + targetGroup = editorGroupsService.findGroup({ direction: GroupDirection.RIGHT }, sourceGroup); if (!targetGroup) { - targetGroup = editorGroupService.addGroup(sourceGroup, GroupDirection.RIGHT); + targetGroup = editorGroupsService.addGroup(sourceGroup, GroupDirection.RIGHT); } break; case 'up': - targetGroup = editorGroupService.findGroup({ direction: GroupDirection.UP }, sourceGroup); + targetGroup = editorGroupsService.findGroup({ direction: GroupDirection.UP }, sourceGroup); if (!targetGroup) { - targetGroup = editorGroupService.addGroup(sourceGroup, GroupDirection.UP); + targetGroup = editorGroupsService.addGroup(sourceGroup, GroupDirection.UP); } break; case 'down': - targetGroup = editorGroupService.findGroup({ direction: GroupDirection.DOWN }, sourceGroup); + targetGroup = editorGroupsService.findGroup({ direction: GroupDirection.DOWN }, sourceGroup); if (!targetGroup) { - targetGroup = editorGroupService.addGroup(sourceGroup, GroupDirection.DOWN); + targetGroup = editorGroupsService.addGroup(sourceGroup, GroupDirection.DOWN); } break; case 'first': - targetGroup = editorGroupService.findGroup({ location: GroupLocation.FIRST }, sourceGroup); + targetGroup = editorGroupsService.findGroup({ location: GroupLocation.FIRST }, sourceGroup); break; case 'last': - targetGroup = editorGroupService.findGroup({ location: GroupLocation.LAST }, sourceGroup); + targetGroup = editorGroupsService.findGroup({ location: GroupLocation.LAST }, sourceGroup); break; case 'previous': - targetGroup = editorGroupService.findGroup({ location: GroupLocation.PREVIOUS }, sourceGroup); + targetGroup = editorGroupsService.findGroup({ location: GroupLocation.PREVIOUS }, sourceGroup); break; case 'next': - targetGroup = editorGroupService.findGroup({ location: GroupLocation.NEXT }, sourceGroup); + targetGroup = editorGroupsService.findGroup({ location: GroupLocation.NEXT }, sourceGroup); if (!targetGroup) { - targetGroup = editorGroupService.addGroup(sourceGroup, preferredSideBySideGroupDirection(configurationService)); + targetGroup = editorGroupsService.addGroup(sourceGroup, preferredSideBySideGroupDirection(configurationService)); } break; case 'center': - targetGroup = editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE)[(editorGroupService.count / 2) - 1]; + targetGroup = editorGroupsService.getGroups(GroupsOrder.GRID_APPEARANCE)[(editorGroupsService.count / 2) - 1]; break; case 'position': - targetGroup = editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE)[(args.value ?? 1) - 1]; + targetGroup = editorGroupsService.getGroups(GroupsOrder.GRID_APPEARANCE)[(args.value ?? 1) - 1]; break; } @@ -314,8 +312,8 @@ function registerEditorGroupsLayoutCommands(): void { return; } - const editorGroupService = accessor.get(IEditorGroupsService); - editorGroupService.applyLayout(layout); + const editorGroupsService = accessor.get(IEditorGroupsService); + editorGroupsService.applyLayout(layout); } CommandsRegistry.registerCommand(LAYOUT_EDITOR_GROUPS_COMMAND_ID, (accessor: ServicesAccessor, args: EditorGroupLayout) => { @@ -352,9 +350,9 @@ function registerEditorGroupsLayoutCommands(): void { CommandsRegistry.registerCommand({ id: 'vscode.getEditorLayout', handler: (accessor: ServicesAccessor) => { - const editorGroupService = accessor.get(IEditorGroupsService); + const editorGroupsService = accessor.get(IEditorGroupsService); - return editorGroupService.getLayout(); + return editorGroupsService.getLayout(); }, metadata: { description: 'Get Editor Layout', @@ -392,7 +390,7 @@ function registerOpenEditorAPICommands(): void { CommandsRegistry.registerCommand(API_OPEN_EDITOR_COMMAND_ID, async function (accessor: ServicesAccessor, resourceArg: UriComponents | string, columnAndOptions?: [EditorGroupColumn?, ITextEditorOptions?], label?: string, context?: IOpenEvent) { const editorService = accessor.get(IEditorService); - const editorGroupService = accessor.get(IEditorGroupsService); + const editorGroupsService = accessor.get(IEditorGroupsService); const openerService = accessor.get(IOpenerService); const pathService = accessor.get(IPathService); const configurationService = accessor.get(IConfigurationService); @@ -421,7 +419,7 @@ function registerOpenEditorAPICommands(): void { input = { resource, options, label }; } - await editorService.openEditor(input, columnToEditorGroup(editorGroupService, configurationService, column)); + await editorService.openEditor(input, columnToEditorGroup(editorGroupsService, configurationService, column)); } // do not allow to execute commands from here @@ -454,7 +452,7 @@ function registerOpenEditorAPICommands(): void { CommandsRegistry.registerCommand(API_OPEN_DIFF_EDITOR_COMMAND_ID, async function (accessor: ServicesAccessor, originalResource: UriComponents, modifiedResource: UriComponents, labelAndOrDescription?: string | { label: string; description: string }, columnAndOptions?: [EditorGroupColumn?, ITextEditorOptions?], context?: IOpenEvent) { const editorService = accessor.get(IEditorService); - const editorGroupService = accessor.get(IEditorGroupsService); + const editorGroupsService = accessor.get(IEditorGroupsService); const configurationService = accessor.get(IConfigurationService); const [columnArg, optionsArg] = columnAndOptions ?? []; @@ -475,7 +473,7 @@ function registerOpenEditorAPICommands(): void { label, description, options - }, columnToEditorGroup(editorGroupService, configurationService, column)); + }, columnToEditorGroup(editorGroupsService, configurationService, column)); }); CommandsRegistry.registerCommand(API_OPEN_WITH_EDITOR_COMMAND_ID, async (accessor: ServicesAccessor, resource: UriComponents, id: string, columnAndOptions?: [EditorGroupColumn?, ITextEditorOptions?]) => { @@ -596,30 +594,30 @@ function registerFocusEditorGroupAtIndexCommands(): void { when: undefined, primary: KeyMod.CtrlCmd | toKeyCode(groupIndex), handler: accessor => { - const editorGroupService = accessor.get(IEditorGroupsService); + const editorGroupsService = accessor.get(IEditorGroupsService); const configurationService = accessor.get(IConfigurationService); // To keep backwards compatibility (pre-grid), allow to focus a group // that does not exist as long as it is the next group after the last // opened group. Otherwise we return. - if (groupIndex > editorGroupService.count) { + if (groupIndex > editorGroupsService.count) { return; } // Group exists: just focus - const groups = editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE); + const groups = editorGroupsService.getGroups(GroupsOrder.GRID_APPEARANCE); if (groups[groupIndex]) { return groups[groupIndex].focus(); } // Group does not exist: create new by splitting the active one of the last group const direction = preferredSideBySideGroupDirection(configurationService); - const lastGroup = editorGroupService.findGroup({ location: GroupLocation.LAST }); + const lastGroup = editorGroupsService.findGroup({ location: GroupLocation.LAST }); if (!lastGroup) { return; } - const newGroup = editorGroupService.addGroup(lastGroup, direction); + const newGroup = editorGroupsService.addGroup(lastGroup, direction); // Focus newGroup.focus(); @@ -656,50 +654,25 @@ function registerFocusEditorGroupAtIndexCommands(): void { } } -export function splitEditor(editorGroupService: IEditorGroupsService, direction: GroupDirection, contexts?: IEditorCommandsContext[]): void { - let newGroup: IEditorGroup | undefined; - let sourceGroup: IEditorGroup | undefined; - - for (const context of contexts ?? [undefined]) { - let currentGroup: IEditorGroup | undefined; - - if (context) { - currentGroup = editorGroupService.getGroup(context.groupId); - } else { - currentGroup = editorGroupService.activeGroup; - } - - if (!currentGroup) { - continue; - } - - if (!sourceGroup) { - sourceGroup = currentGroup; - } else if (sourceGroup.id !== currentGroup.id) { - continue; // Only support splitting from the same group - } +export function splitEditor(editorGroupsService: IEditorGroupsService, direction: GroupDirection, resolvedContext: IResolvedEditorCommandsContext): void { + if (!resolvedContext.groupedEditors.length) { + return; + } - // Add group - if (!newGroup) { - newGroup = editorGroupService.addGroup(currentGroup, direction); - } + // Only support splitting from one source group + const { group, editors } = resolvedContext.groupedEditors[0]; + const preserveFocus = resolvedContext.preserveFocus; + const newGroup = editorGroupsService.addGroup(group, direction); + for (const editorToCopy of editors) { // Split editor (if it can be split) - let editorToCopy: EditorInput | undefined; - if (context && typeof context.editorIndex === 'number') { - editorToCopy = currentGroup.getEditorByIndex(context.editorIndex); - } else { - editorToCopy = currentGroup.activeEditor ?? undefined; - } - - // Copy the editor to the new group, else create an empty group if (editorToCopy && !editorToCopy.hasCapability(EditorInputCapabilities.Singleton)) { - currentGroup.copyEditor(editorToCopy, newGroup, { preserveFocus: context?.preserveFocus }); + group.copyEditor(editorToCopy, newGroup, { preserveFocus }); } } // Focus - newGroup?.focus(); + newGroup.focus(); } function registerSplitEditorCommands() { @@ -709,9 +682,9 @@ function registerSplitEditorCommands() { { id: SPLIT_EDITOR_LEFT, direction: GroupDirection.LEFT }, { id: SPLIT_EDITOR_RIGHT, direction: GroupDirection.RIGHT } ].forEach(({ id, direction }) => { - CommandsRegistry.registerCommand(id, function (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) { - const { editors } = getEditorsContext(accessor, resourceOrContext, context); - splitEditor(accessor.get(IEditorGroupsService), direction, editors); + CommandsRegistry.registerCommand(id, function (accessor, ...args) { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService)); + splitEditor(accessor.get(IEditorGroupsService), direction, resolvedContext); }); }); } @@ -721,14 +694,14 @@ function registerCloseEditorCommands() { // A special handler for "Close Editor" depending on context // - keybindining: do not close sticky editors, rather open the next non-sticky editor // - menu: always close editor, even sticky ones - function closeEditorHandler(accessor: ServicesAccessor, forceCloseStickyEditors: boolean, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): Promise { + function closeEditorHandler(accessor: ServicesAccessor, forceCloseStickyEditors: boolean, ...args: unknown[]): Promise { const editorGroupsService = accessor.get(IEditorGroupsService); const editorService = accessor.get(IEditorService); let keepStickyEditors: boolean | undefined = undefined; if (forceCloseStickyEditors) { keepStickyEditors = false; // explicitly close sticky editors - } else if (resourceOrContext || context) { + } else if (args.length) { keepStickyEditors = false; // we have a context, as such this command was used e.g. from the tab context menu } else { keepStickyEditors = editorGroupsService.partOptions.preventPinnedEditorClose === 'keyboard' || editorGroupsService.partOptions.preventPinnedEditorClose === 'keyboardAndMouse'; // respect setting otherwise @@ -756,17 +729,12 @@ function registerCloseEditorCommands() { } // With context: proceed to close editors as instructed - const { editors, groups } = getEditorsContext(accessor, resourceOrContext, context); + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService)); + const preserveFocus = resolvedContext.preserveFocus; - return Promise.all(groups.map(async group => { - if (group) { - const editorsToClose = coalesce(editors - .filter(editor => editor.groupId === group.id) - .map(editor => typeof editor.editorIndex === 'number' ? group.getEditorByIndex(editor.editorIndex) : group.activeEditor)) - .filter(editor => !keepStickyEditors || !group.isSticky(editor)); - - await group.closeEditors(editorsToClose, { preserveFocus: context?.preserveFocus }); - } + return Promise.all(resolvedContext.groupedEditors.map(async ({ group, editors }) => { + const editorsToClose = editors.filter(editor => !keepStickyEditors || !group.isSticky(editor)); + await group.closeEditors(editorsToClose, { preserveFocus }); })); } @@ -776,13 +744,13 @@ function registerCloseEditorCommands() { when: undefined, primary: KeyMod.CtrlCmd | KeyCode.KeyW, win: { primary: KeyMod.CtrlCmd | KeyCode.F4, secondary: [KeyMod.CtrlCmd | KeyCode.KeyW] }, - handler: (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - return closeEditorHandler(accessor, false, resourceOrContext, context); + handler: (accessor, ...args: unknown[]) => { + return closeEditorHandler(accessor, false, ...args); } }); - CommandsRegistry.registerCommand(CLOSE_PINNED_EDITOR_COMMAND_ID, (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - return closeEditorHandler(accessor, true /* force close pinned editors */, resourceOrContext, context); + CommandsRegistry.registerCommand(CLOSE_PINNED_EDITOR_COMMAND_ID, (accessor, ...args: unknown[]) => { + return closeEditorHandler(accessor, true /* force close pinned editors */, ...args); }); KeybindingsRegistry.registerCommandAndKeybindingRule({ @@ -790,12 +758,10 @@ function registerCloseEditorCommands() { weight: KeybindingWeight.WorkbenchContrib, when: undefined, primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyW), - handler: (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - return Promise.all(getEditorsContext(accessor, resourceOrContext, context).groups.map(async group => { - if (group) { - await group.closeAllEditors({ excludeSticky: true }); - return; - } + handler: (accessor, ...args: unknown[]) => { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService)); + return Promise.all(resolvedContext.groupedEditors.map(async ({ group }) => { + await group.closeAllEditors({ excludeSticky: true }); })); } }); @@ -806,19 +772,12 @@ function registerCloseEditorCommands() { when: ContextKeyExpr.and(ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext), primary: KeyMod.CtrlCmd | KeyCode.KeyW, win: { primary: KeyMod.CtrlCmd | KeyCode.F4, secondary: [KeyMod.CtrlCmd | KeyCode.KeyW] }, - handler: (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - const editorGroupService = accessor.get(IEditorGroupsService); - const commandsContext = getCommandsContext(accessor, resourceOrContext, context); + handler: (accessor, ...args: unknown[]) => { + const editorGroupsService = accessor.get(IEditorGroupsService); + const commandsContext = resolveCommandsContext(args, accessor.get(IEditorService), editorGroupsService, accessor.get(IListService)); - let group: IEditorGroup | undefined; - if (commandsContext && typeof commandsContext.groupId === 'number') { - group = editorGroupService.getGroup(commandsContext.groupId); - } else { - group = editorGroupService.activeGroup; - } - - if (group) { - editorGroupService.removeGroup(group); + if (commandsContext.groupedEditors.length) { + editorGroupsService.removeGroup(commandsContext.groupedEditors[0].group); } } }); @@ -828,11 +787,10 @@ function registerCloseEditorCommands() { weight: KeybindingWeight.WorkbenchContrib, when: undefined, primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyU), - handler: (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - return Promise.all(getEditorsContext(accessor, resourceOrContext, context).groups.map(async group => { - if (group) { - await group.closeEditors({ savedOnly: true, excludeSticky: true }, { preserveFocus: context?.preserveFocus }); - } + handler: (accessor, ...args: unknown[]) => { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService)); + return Promise.all(resolvedContext.groupedEditors.map(async ({ group }) => { + await group.closeEditors({ savedOnly: true, excludeSticky: true }, { preserveFocus: resolvedContext.preserveFocus }); })); } }); @@ -843,24 +801,19 @@ function registerCloseEditorCommands() { when: undefined, primary: undefined, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyT }, - handler: (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - const { editors, groups } = getEditorsContext(accessor, resourceOrContext, context); - return Promise.all(groups.map(async group => { - if (group) { - const editorsToKeep = editors - .filter(editor => editor.groupId === group.id) - .map(editor => typeof editor.editorIndex === 'number' ? group.getEditorByIndex(editor.editorIndex) : group.activeEditor); - - const editorsToClose = group.getEditors(EditorsOrder.SEQUENTIAL, { excludeSticky: true }).filter(editor => !editorsToKeep.includes(editor)); - - for (const editorToKeep of editorsToKeep) { - if (editorToKeep) { - group.pinEditor(editorToKeep); - } - } + handler: (accessor, ...args: unknown[]) => { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService)); + + return Promise.all(resolvedContext.groupedEditors.map(async ({ group, editors }) => { + const editorsToClose = group.getEditors(EditorsOrder.SEQUENTIAL, { excludeSticky: true }).filter(editor => !editors.includes(editor)); - await group.closeEditors(editorsToClose, { preserveFocus: context?.preserveFocus }); + for (const editorToKeep of editors) { + if (editorToKeep) { + group.pinEditor(editorToKeep); + } } + + await group.closeEditors(editorsToClose, { preserveFocus: resolvedContext.preserveFocus }); })); } }); @@ -870,16 +823,15 @@ function registerCloseEditorCommands() { weight: KeybindingWeight.WorkbenchContrib, when: undefined, primary: undefined, - handler: async (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - const editorGroupService = accessor.get(IEditorGroupsService); - - const { group, editor } = resolveCommandsContext(editorGroupService, getCommandsContext(accessor, resourceOrContext, context)); - if (group && editor) { + handler: async (accessor, ...args: unknown[]) => { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService)); + if (resolvedContext.groupedEditors.length) { + const { group, editors } = resolvedContext.groupedEditors[0]; if (group.activeEditor) { group.pinEditor(group.activeEditor); } - await group.closeEditors({ direction: CloseDirection.RIGHT, except: editor, excludeSticky: true }, { preserveFocus: context?.preserveFocus }); + await group.closeEditors({ direction: CloseDirection.RIGHT, except: editors[0], excludeSticky: true }, { preserveFocus: resolvedContext.preserveFocus }); } } }); @@ -889,62 +841,64 @@ function registerCloseEditorCommands() { weight: KeybindingWeight.WorkbenchContrib, when: undefined, primary: undefined, - handler: async (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { + handler: async (accessor, ...args: unknown[]) => { const editorService = accessor.get(IEditorService); const editorResolverService = accessor.get(IEditorResolverService); const telemetryService = accessor.get(ITelemetryService); - const editorsAndGroup = resolveEditorsContext(getEditorsContext(accessor, resourceOrContext, context)); + const resolvedContext = resolveCommandsContext(args, editorService, accessor.get(IEditorGroupsService), accessor.get(IListService)); const editorReplacements = new Map(); - for (const { editor, group } of editorsAndGroup) { - const untypedEditor = editor.toUntyped(); - if (!untypedEditor) { - return; // Resolver can only resolve untyped editors - } + for (const { group, editors } of resolvedContext.groupedEditors) { + for (const editor of editors) { + const untypedEditor = editor.toUntyped(); + if (!untypedEditor) { + return; // Resolver can only resolve untyped editors + } - untypedEditor.options = { ...editorService.activeEditorPane?.options, override: EditorResolution.PICK }; - const resolvedEditor = await editorResolverService.resolveEditor(untypedEditor, group); - if (!isEditorInputWithOptionsAndGroup(resolvedEditor)) { - return; - } + untypedEditor.options = { ...editorService.activeEditorPane?.options, override: EditorResolution.PICK }; + const resolvedEditor = await editorResolverService.resolveEditor(untypedEditor, group); + if (!isEditorInputWithOptionsAndGroup(resolvedEditor)) { + return; + } - let editorReplacementsInGroup = editorReplacements.get(group); - if (!editorReplacementsInGroup) { - editorReplacementsInGroup = []; - editorReplacements.set(group, editorReplacementsInGroup); - } + let editorReplacementsInGroup = editorReplacements.get(group); + if (!editorReplacementsInGroup) { + editorReplacementsInGroup = []; + editorReplacements.set(group, editorReplacementsInGroup); + } - editorReplacementsInGroup.push({ - editor: editor, - replacement: resolvedEditor.editor, - forceReplaceDirty: editor.resource?.scheme === Schemas.untitled, - options: resolvedEditor.options - }); - - // Telemetry - type WorkbenchEditorReopenClassification = { - owner: 'rebornix'; - comment: 'Identify how a document is reopened'; - scheme: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'File system provider scheme for the resource' }; - ext: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'File extension for the resource' }; - from: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The editor view type the resource is switched from' }; - to: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The editor view type the resource is switched to' }; - }; - - type WorkbenchEditorReopenEvent = { - scheme: string; - ext: string; - from: string; - to: string; - }; - - telemetryService.publicLog2('workbenchEditorReopen', { - scheme: editor.resource?.scheme ?? '', - ext: editor.resource ? extname(editor.resource) : '', - from: editor.editorId ?? '', - to: resolvedEditor.editor.editorId ?? '' - }); + editorReplacementsInGroup.push({ + editor: editor, + replacement: resolvedEditor.editor, + forceReplaceDirty: editor.resource?.scheme === Schemas.untitled, + options: resolvedEditor.options + }); + + // Telemetry + type WorkbenchEditorReopenClassification = { + owner: 'rebornix'; + comment: 'Identify how a document is reopened'; + scheme: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'File system provider scheme for the resource' }; + ext: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'File extension for the resource' }; + from: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The editor view type the resource is switched from' }; + to: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The editor view type the resource is switched to' }; + }; + + type WorkbenchEditorReopenEvent = { + scheme: string; + ext: string; + from: string; + to: string; + }; + + telemetryService.publicLog2('workbenchEditorReopen', { + scheme: editor.resource?.scheme ?? '', + ext: editor.resource ? extname(editor.resource) : '', + from: editor.editorId ?? '', + to: resolvedEditor.editor.editorId ?? '' + }); + } } // Replace editor with resolved one and make active @@ -955,15 +909,16 @@ function registerCloseEditorCommands() { } }); - CommandsRegistry.registerCommand(CLOSE_EDITORS_AND_GROUP_COMMAND_ID, async (accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - const editorGroupService = accessor.get(IEditorGroupsService); + CommandsRegistry.registerCommand(CLOSE_EDITORS_AND_GROUP_COMMAND_ID, async (accessor: ServicesAccessor, ...args: unknown[]) => { + const editorGroupsService = accessor.get(IEditorGroupsService); - const { group } = resolveCommandsContext(editorGroupService, getCommandsContext(accessor, resourceOrContext, context)); - if (group) { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), editorGroupsService, accessor.get(IListService)); + if (resolvedContext.groupedEditors.length) { + const { group } = resolvedContext.groupedEditors[0]; await group.closeAllEditors(); - if (group.count === 0 && editorGroupService.getGroup(group.id) /* could be gone by now */) { - editorGroupService.removeGroup(group); // only remove group if it is now empty + if (group.count === 0 && editorGroupsService.getGroup(group.id) /* could be gone by now */) { + editorGroupsService.removeGroup(group); // only remove group if it is now empty } } }); @@ -992,9 +947,9 @@ function registerFocusEditorGroupWihoutWrapCommands(): void { for (const command of commands) { CommandsRegistry.registerCommand(command.id, async (accessor: ServicesAccessor) => { - const editorGroupService = accessor.get(IEditorGroupsService); + const editorGroupsService = accessor.get(IEditorGroupsService); - const group = editorGroupService.findGroup({ direction: command.direction }, editorGroupService.activeGroup, false); + const group = editorGroupsService.findGroup({ direction: command.direction }, editorGroupsService.activeGroup, false); group?.focus(); }); } @@ -1002,11 +957,15 @@ function registerFocusEditorGroupWihoutWrapCommands(): void { function registerSplitEditorInGroupCommands(): void { - async function splitEditorInGroup(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): Promise { - const editorGroupService = accessor.get(IEditorGroupsService); + async function splitEditorInGroup(accessor: ServicesAccessor, resolvedContext: IResolvedEditorCommandsContext): Promise { const instantiationService = accessor.get(IInstantiationService); - const { group, editor } = resolveCommandsContext(editorGroupService, getCommandsContext(accessor, resourceOrContext, context)); + if (!resolvedContext.groupedEditors.length) { + return; + } + + const { group, editors } = resolvedContext.groupedEditors[0]; + const editor = editors[0]; if (!editor) { return; } @@ -1033,15 +992,22 @@ function registerSplitEditorInGroupCommands(): void { } }); } - run(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): Promise { - return splitEditorInGroup(accessor, resourceOrContext, context); + run(accessor: ServicesAccessor, ...args: unknown[]): Promise { + return splitEditorInGroup(accessor, resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService))); } }); - async function joinEditorInGroup(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): Promise { - const editorGroupService = accessor.get(IEditorGroupsService); + async function joinEditorInGroup(resolvedContext: IResolvedEditorCommandsContext): Promise { + if (!resolvedContext.groupedEditors.length) { + return; + } + + const { group, editors } = resolvedContext.groupedEditors[0]; + const editor = editors[0]; + if (!editor) { + return; + } - const { group, editor } = resolveCommandsContext(editorGroupService, getCommandsContext(accessor, resourceOrContext, context)); if (!(editor instanceof SideBySideEditorInput)) { return; } @@ -1079,8 +1045,8 @@ function registerSplitEditorInGroupCommands(): void { } }); } - run(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): Promise { - return joinEditorInGroup(accessor, resourceOrContext, context); + run(accessor: ServicesAccessor, ...args: unknown[]): Promise { + return joinEditorInGroup(resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService))); } }); @@ -1094,14 +1060,18 @@ function registerSplitEditorInGroupCommands(): void { f1: true }); } - async run(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): Promise { - const editorGroupService = accessor.get(IEditorGroupsService); + async run(accessor: ServicesAccessor, ...args: unknown[]): Promise { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService)); + if (!resolvedContext.groupedEditors.length) { + return; + } + + const { editors } = resolvedContext.groupedEditors[0]; - const { editor } = resolveCommandsContext(editorGroupService, getCommandsContext(accessor, resourceOrContext, context)); - if (editor instanceof SideBySideEditorInput) { - await joinEditorInGroup(accessor, resourceOrContext, context); - } else if (editor) { - await splitEditorInGroup(accessor, resourceOrContext, context); + if (editors[0] instanceof SideBySideEditorInput) { + await joinEditorInGroup(resolvedContext); + } else if (editors[0]) { + await splitEditorInGroup(accessor, resolvedContext); } } }); @@ -1215,12 +1185,12 @@ function registerOtherEditorCommands(): void { weight: KeybindingWeight.WorkbenchContrib, when: undefined, primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.Enter), - handler: async (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - const editorGroupService = accessor.get(IEditorGroupsService); - - const { group, editor } = resolveCommandsContext(editorGroupService, getCommandsContext(accessor, resourceOrContext, context)); - if (group && editor) { - return group.pinEditor(editor); + handler: async (accessor, ...args: unknown[]) => { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService)); + for (const { group, editors } of resolvedContext.groupedEditors) { + for (const editor of editors) { + group.pinEditor(editor); + } } } }); @@ -1236,10 +1206,9 @@ function registerOtherEditorCommands(): void { } }); - function setEditorGroupLock(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext, locked?: boolean): void { - const editorGroupService = accessor.get(IEditorGroupsService); - - const { group } = resolveCommandsContext(editorGroupService, getCommandsContext(accessor, resourceOrContext, context)); + function setEditorGroupLock(accessor: ServicesAccessor, locked: boolean | undefined, ...args: unknown[]): void { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService)); + const group = resolvedContext.groupedEditors[0]?.group; group?.lock(locked ?? !group.isLocked); } @@ -1252,8 +1221,8 @@ function registerOtherEditorCommands(): void { f1: true }); } - async run(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): Promise { - setEditorGroupLock(accessor, resourceOrContext, context); + async run(accessor: ServicesAccessor, ...args: unknown[]): Promise { + setEditorGroupLock(accessor, undefined, ...args); } }); @@ -1267,8 +1236,8 @@ function registerOtherEditorCommands(): void { f1: true }); } - async run(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): Promise { - setEditorGroupLock(accessor, resourceOrContext, context, true); + async run(accessor: ServicesAccessor, ...args: unknown[]): Promise { + setEditorGroupLock(accessor, true, ...args); } }); @@ -1282,8 +1251,8 @@ function registerOtherEditorCommands(): void { f1: true }); } - async run(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): Promise { - setEditorGroupLock(accessor, resourceOrContext, context, false); + async run(accessor: ServicesAccessor, ...args: unknown[]): Promise { + setEditorGroupLock(accessor, false, ...args); } }); @@ -1292,9 +1261,12 @@ function registerOtherEditorCommands(): void { weight: KeybindingWeight.WorkbenchContrib, when: ActiveEditorStickyContext.toNegated(), primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.Shift | KeyCode.Enter), - handler: async (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - for (const { editor, group } of resolveEditorsContext(getEditorsContext(accessor, resourceOrContext, context))) { - group.stickEditor(editor); + handler: async (accessor, ...args: unknown[]) => { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService)); + for (const { group, editors } of resolvedContext.groupedEditors) { + for (const editor of editors) { + group.stickEditor(editor); + } } } }); @@ -1306,7 +1278,7 @@ function registerOtherEditorCommands(): void { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.Shift | KeyCode.KeyO), handler: async accessor => { const editorService = accessor.get(IEditorService); - const editorGroupService = accessor.get(IEditorGroupsService); + const editorGroupsService = accessor.get(IEditorGroupsService); const activeEditor = editorService.activeEditor; const activeTextEditorControl = editorService.activeTextEditorControl; @@ -1322,7 +1294,7 @@ function registerOtherEditorCommands(): void { editor = activeEditor.modified; } - return editorGroupService.activeGroup.openEditor(editor); + return editorGroupsService.activeGroup.openEditor(editor); } }); @@ -1331,9 +1303,12 @@ function registerOtherEditorCommands(): void { weight: KeybindingWeight.WorkbenchContrib, when: ActiveEditorStickyContext, primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.Shift | KeyCode.Enter), - handler: async (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - for (const { editor, group } of resolveEditorsContext(getEditorsContext(accessor, resourceOrContext, context))) { - group.unstickEditor(editor); + handler: async (accessor, ...args: unknown[]) => { + const resolvedContext = resolveCommandsContext(args, accessor.get(IEditorService), accessor.get(IEditorGroupsService), accessor.get(IListService)); + for (const { group, editors } of resolvedContext.groupedEditors) { + for (const editor of editors) { + group.unstickEditor(editor); + } } } }); @@ -1343,16 +1318,14 @@ function registerOtherEditorCommands(): void { weight: KeybindingWeight.WorkbenchContrib, when: undefined, primary: undefined, - handler: (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => { - const editorGroupService = accessor.get(IEditorGroupsService); + handler: (accessor, ...args: unknown[]) => { + const editorGroupsService = accessor.get(IEditorGroupsService); const quickInputService = accessor.get(IQuickInputService); - const commandsContext = getCommandsContext(accessor, resourceOrContext, context); - if (commandsContext && typeof commandsContext.groupId === 'number') { - const group = editorGroupService.getGroup(commandsContext.groupId); - if (group) { - editorGroupService.activateGroup(group); // we need the group to be active - } + const commandsContext = resolveCommandsContext(args, accessor.get(IEditorService), editorGroupsService, accessor.get(IListService)); + const group = commandsContext.groupedEditors[0]?.group; + if (group) { + editorGroupsService.activateGroup(group); // we need the group to be active } return quickInputService.quickAccess.show(ActiveGroupEditorsByMostRecentlyUsedQuickAccess.PREFIX); @@ -1360,130 +1333,6 @@ function registerOtherEditorCommands(): void { }); } -type EditorsContext = { editors: IEditorCommandsContext[]; groups: Array }; -export function getEditorsContext(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): EditorsContext { - const editorGroupService = accessor.get(IEditorGroupsService); - const listService = accessor.get(IListService); - - const editorContext = getMultiSelectedEditorContexts(getCommandsContext(accessor, resourceOrContext, context), listService, editorGroupService); - - const activeGroup = editorGroupService.activeGroup; - if (editorContext.length === 0 && activeGroup.activeEditor) { - // add the active editor as fallback - editorContext.push({ - groupId: activeGroup.id, - editorIndex: activeGroup.getIndexOfEditor(activeGroup.activeEditor) - }); - } - - return { - editors: editorContext, - groups: distinct(editorContext.map(context => context.groupId)).map(groupId => editorGroupService.getGroup(groupId)) - }; -} - -export function resolveEditorsContext(context: EditorsContext): { editor: EditorInput; group: IEditorGroup }[] { - const { editors, groups } = context; - - const editorsAndGroup = editors.map(e => { - if (e.editorIndex === undefined) { - return undefined; - } - const group = groups.find(group => group && group.id === e.groupId); - const editor = group?.getEditorByIndex(e.editorIndex); - if (!editor || !group) { - return undefined; - } - return { editor, group }; - }); - - return coalesce(editorsAndGroup); -} - -export function getCommandsContext(accessor: ServicesAccessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext): IEditorCommandsContext | undefined { - const isUri = URI.isUri(resourceOrContext); - - const editorCommandsContext = isUri ? context : resourceOrContext ? resourceOrContext : context; - if (editorCommandsContext && isEditorCommandsContext(editorCommandsContext)) { - return editorCommandsContext; - } - - if (isUri) { - const editorGroupService = accessor.get(IEditorGroupsService); - const editorGroup = editorGroupService.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE).find(group => isEqual(group.activeEditor?.resource, resourceOrContext)); - if (editorGroup) { - return { groupId: editorGroup.index, editorIndex: editorGroup.getIndexOfEditor(editorGroup.activeEditor!) }; - } - } - - return undefined; -} - -export function resolveCommandsContext(editorGroupService: IEditorGroupsService, context?: IEditorCommandsContext): { group: IEditorGroup; editor?: EditorInput } { - - // Resolve from context - let group = context && typeof context.groupId === 'number' ? editorGroupService.getGroup(context.groupId) : undefined; - let editor = group && context && typeof context.editorIndex === 'number' ? group.getEditorByIndex(context.editorIndex) ?? undefined : undefined; - - // Fallback to active group as needed - if (!group) { - group = editorGroupService.activeGroup; - } - - // Fallback to active editor as needed - if (!editor) { - editor = group.activeEditor ?? undefined; - } - - return { group, editor }; -} - -export function getMultiSelectedEditorContexts(editorContext: IEditorCommandsContext | undefined, listService: IListService, editorGroupService: IEditorGroupsService): IEditorCommandsContext[] { - - // First check for a focused list to return the selected items from - const list = listService.lastFocusedList; - if (list instanceof List && list.getHTMLElement() === getActiveElement()) { - const elementToContext = (element: IEditorIdentifier | IEditorGroup) => { - if (isEditorGroup(element)) { - return { groupId: element.id, editorIndex: undefined }; - } - - const group = editorGroupService.getGroup(element.groupId); - - return { groupId: element.groupId, editorIndex: group ? group.getIndexOfEditor(element.editor) : -1 }; - }; - - const onlyEditorGroupAndEditor = (e: IEditorIdentifier | IEditorGroup) => isEditorGroup(e) || isEditorIdentifier(e); - - const focusedElements: Array = list.getFocusedElements().filter(onlyEditorGroupAndEditor); - const focus = editorContext ? editorContext : focusedElements.length ? focusedElements.map(elementToContext)[0] : undefined; // need to take into account when editor context is { group: group } - - if (focus) { - const selection: Array = list.getSelectedElements().filter(onlyEditorGroupAndEditor); - - if (selection.length > 1) { - return selection.map(elementToContext); - } - - return [focus]; - } - } - // Check editors selected in the group (tabs) - else { - const group = editorContext ? editorGroupService.getGroup(editorContext.groupId) : editorGroupService.activeGroup; - const editor = editorContext && editorContext.editorIndex !== undefined ? group?.getEditorByIndex(editorContext.editorIndex) : group?.activeEditor; - // If the editor is selected, return all selected editors otherwise only use the editors context - if (group && editor) { - if (group.isSelected(editor)) { - return group.selectedEditors.map(se => ({ groupId: group.id, editorIndex: group.getIndexOfEditor(se) })); - } - } - } - - // Otherwise go with passed in context - return !!editorContext ? [editorContext] : []; -} - export function setup(): void { registerActiveEditorMoveCopyCommand(); registerEditorGroupsLayoutCommands(); diff --git a/src/vs/workbench/browser/parts/editor/editorCommandsContext.ts b/src/vs/workbench/browser/parts/editor/editorCommandsContext.ts new file mode 100644 index 00000000000..1fec47d1cf6 --- /dev/null +++ b/src/vs/workbench/browser/parts/editor/editorCommandsContext.ts @@ -0,0 +1,200 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { getActiveElement } from '../../../../base/browser/dom.js'; +import { List } from '../../../../base/browser/ui/list/listWidget.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IListService } from '../../../../platform/list/browser/listService.js'; +import { IEditorCommandsContext, isEditorCommandsContext, IEditorIdentifier, isEditorIdentifier } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { IEditorGroup, IEditorGroupsService, isEditorGroup } from '../../../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; + +export interface IResolvedEditorCommandsContext { + readonly groupedEditors: { + readonly group: IEditorGroup; + readonly editors: EditorInput[]; + }[]; + readonly preserveFocus: boolean; +} + +export function resolveCommandsContext(commandArgs: unknown[], editorService: IEditorService, editorGroupsService: IEditorGroupsService, listService: IListService): IResolvedEditorCommandsContext { + + const commandContext = getCommandsContext(commandArgs, editorService, editorGroupsService, listService); + const preserveFocus = commandContext.length ? commandContext[0].preserveFocus || false : false; + const resolvedContext: IResolvedEditorCommandsContext = { groupedEditors: [], preserveFocus }; + + for (const editorContext of commandContext) { + const groupAndEditor = getEditorAndGroupFromContext(editorContext, editorGroupsService); + if (!groupAndEditor) { + continue; + } + + const { group, editor } = groupAndEditor; + + // Find group context if already added + let groupContext = undefined; + for (const targetGroupContext of resolvedContext.groupedEditors) { + if (targetGroupContext.group.id === group.id) { + groupContext = targetGroupContext; + break; + } + } + + // Otherwise add new group context + if (!groupContext) { + groupContext = { group, editors: [] }; + resolvedContext.groupedEditors.push(groupContext); + } + + // Add editor to group context + if (editor) { + groupContext.editors.push(editor); + } + } + + return resolvedContext; +} + +function getCommandsContext(commandArgs: unknown[], editorService: IEditorService, editorGroupsService: IEditorGroupsService, listService: IListService): IEditorCommandsContext[] { + // Figure out if command is executed from a list + const list = listService.lastFocusedList; + let isListAction = list instanceof List && list.getHTMLElement() === getActiveElement(); + + // Get editor context for which the command was triggered + let editorContext = getEditorContextFromCommandArgs(commandArgs, isListAction, editorService, editorGroupsService, listService); + + // If the editor context can not be determind use the active editor + if (!editorContext) { + const activeGroup = editorGroupsService.activeGroup; + const activeEditor = activeGroup.activeEditor; + editorContext = { groupId: activeGroup.id, editorIndex: activeEditor ? activeGroup.getIndexOfEditor(activeEditor) : undefined }; + isListAction = false; + } + + const multiEditorContext = getMultiSelectContext(editorContext, isListAction, editorService, editorGroupsService, listService); + + // Make sure the command context is the first one in the list + return moveCurrentEditorContextToFront(editorContext, multiEditorContext); +} + +function moveCurrentEditorContextToFront(editorContext: IEditorCommandsContext, multiEditorContext: IEditorCommandsContext[]): IEditorCommandsContext[] { + if (multiEditorContext.length <= 1) { + return multiEditorContext; + } + + const editorContextIndex = multiEditorContext.findIndex(context => + context.groupId === editorContext.groupId && + context.editorIndex === editorContext.editorIndex + ); + + if (editorContextIndex !== -1) { + multiEditorContext.splice(editorContextIndex, 1); + multiEditorContext.unshift(editorContext); + } else if (editorContext.editorIndex === undefined) { + multiEditorContext.unshift(editorContext); + } else { + throw new Error('Editor context not found in multi editor context'); + } + + return multiEditorContext; +} + +function getEditorContextFromCommandArgs(commandArgs: unknown[], isListAction: boolean, editorService: IEditorService, editorGroupsService: IEditorGroupsService, listService: IListService): IEditorCommandsContext | undefined { + // We only know how to extraxt the command context from URI and IEditorCommandsContext arguments + const filteredArgs = commandArgs.filter(arg => isEditorCommandsContext(arg) || URI.isUri(arg)); + + // If the command arguments contain an editor context, use it + for (const arg of filteredArgs) { + if (isEditorCommandsContext(arg)) { + return arg; + } + } + + // Otherwise, try to find the editor group by the URI of the resource + for (const uri of filteredArgs as URI[]) { + const editorIdentifiers = editorService.findEditors(uri); + if (editorIdentifiers.length) { + const editorIdentifier = editorIdentifiers[0]; + const group = editorGroupsService.getGroup(editorIdentifier.groupId); + return { groupId: editorIdentifier.groupId, editorIndex: group?.getIndexOfEditor(editorIdentifier.editor) }; + } + } + + // If there is no context in the arguments, try to find the context from the focused list + // if the action was executed from a list + if (isListAction) { + const list = listService.lastFocusedList as List; + for (const focusedElement of list.getFocusedElements()) { + if (isGroupOrEditor(focusedElement)) { + return groupOrEditorToEditorContext(focusedElement, undefined, editorGroupsService); + } + } + } + + return undefined; +} + +function getMultiSelectContext(editorContext: IEditorCommandsContext, isListAction: boolean, editorService: IEditorService, editorGroupsService: IEditorGroupsService, listService: IListService): IEditorCommandsContext[] { + + // If the action was executed from a list, return all selected editors + if (isListAction) { + const list = listService.lastFocusedList as List; + const selection = list.getSelectedElements().filter(isGroupOrEditor); + + if (selection.length > 1) { + return selection.map(e => groupOrEditorToEditorContext(e, editorContext.preserveFocus, editorGroupsService)); + } + + if (selection.length === 0) { + // TODO@benibenj workaround for https://github.com/microsoft/vscode/issues/224050 + // Explainer: the `isListAction` flag can be a false positive in certain cases because + // it will be `true` if the active element is a `List` even if it is part of the editor + // area. The workaround here is to fallback to `isListAction: false` if the list is not + // having any editor or group selected. + return getMultiSelectContext(editorContext, false, editorService, editorGroupsService, listService); + } + } + // Check editors selected in the group (tabs) + else { + const group = editorGroupsService.getGroup(editorContext.groupId); + const editor = editorContext.editorIndex !== undefined ? group?.getEditorByIndex(editorContext.editorIndex) : group?.activeEditor; + // If the editor is selected, return all selected editors otherwise only use the editors context + if (group && editor && group.isSelected(editor)) { + return group.selectedEditors.map(editor => groupOrEditorToEditorContext({ editor, groupId: group.id }, editorContext.preserveFocus, editorGroupsService)); + } + } + + // Otherwise go with passed in context + return [editorContext]; +} + +function groupOrEditorToEditorContext(element: IEditorIdentifier | IEditorGroup, preserveFocus: boolean | undefined, editorGroupsService: IEditorGroupsService): IEditorCommandsContext { + if (isEditorGroup(element)) { + return { groupId: element.id, editorIndex: undefined, preserveFocus }; + } + + const group = editorGroupsService.getGroup(element.groupId); + + return { groupId: element.groupId, editorIndex: group ? group.getIndexOfEditor(element.editor) : -1, preserveFocus }; +} + +function isGroupOrEditor(element: unknown): element is IEditorIdentifier | IEditorGroup { + return isEditorGroup(element) || isEditorIdentifier(element); +} + +function getEditorAndGroupFromContext(commandContext: IEditorCommandsContext, editorGroupsService: IEditorGroupsService): { group: IEditorGroup; editor: EditorInput | undefined } | undefined { + const group = editorGroupsService.getGroup(commandContext.groupId); + if (!group) { + return undefined; + } + + if (commandContext.editorIndex === undefined) { + return { group, editor: undefined }; + } + + const editor = group.getEditorByIndex(commandContext.editorIndex); + return { group, editor }; +} diff --git a/src/vs/workbench/browser/parts/editor/editorConfiguration.ts b/src/vs/workbench/browser/parts/editor/editorConfiguration.ts index 0df198dd6de..c235e44adcd 100644 --- a/src/vs/workbench/browser/parts/editor/editorConfiguration.ts +++ b/src/vs/workbench/browser/parts/editor/editorConfiguration.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { IConfigurationRegistry, Extensions as ConfigurationExtensions, IConfigurationNode, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; -import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration'; -import { IEditorResolverService, RegisteredEditorInfo, RegisteredEditorPriority } from 'vs/workbench/services/editor/common/editorResolverService'; -import { IJSONSchemaMap } from 'vs/base/common/jsonSchema'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { coalesce } from 'vs/base/common/arrays'; -import { Event } from 'vs/base/common/event'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { ByteSize, getLargeFileConfirmationLimit } from 'vs/platform/files/common/files'; +import { localize } from '../../../../nls.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { IWorkbenchContribution } from '../../../common/contributions.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { IConfigurationRegistry, Extensions as ConfigurationExtensions, IConfigurationNode, ConfigurationScope } from '../../../../platform/configuration/common/configurationRegistry.js'; +import { workbenchConfigurationNodeBase } from '../../../common/configuration.js'; +import { IEditorResolverService, RegisteredEditorInfo, RegisteredEditorPriority } from '../../../services/editor/common/editorResolverService.js'; +import { IJSONSchemaMap } from '../../../../base/common/jsonSchema.js'; +import { IExtensionService } from '../../../services/extensions/common/extensions.js'; +import { coalesce } from '../../../../base/common/arrays.js'; +import { Event } from '../../../../base/common/event.js'; +import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.js'; +import { ByteSize, getLargeFileConfirmationLimit } from '../../../../platform/files/common/files.js'; export class DynamicEditorConfigurations extends Disposable implements IWorkbenchContribution { diff --git a/src/vs/workbench/browser/parts/editor/editorDropTarget.ts b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts index b11c66e6057..ed286ff7f17 100644 --- a/src/vs/workbench/browser/parts/editor/editorDropTarget.ts +++ b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts @@ -3,30 +3,30 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/editordroptarget'; -import { DataTransfers } from 'vs/base/browser/dnd'; -import { addDisposableListener, DragAndDropObserver, EventHelper, EventType, getWindow, isAncestor } from 'vs/base/browser/dom'; -import { renderFormattedText } from 'vs/base/browser/formattedTextRenderer'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import { isMacintosh, isWeb } from 'vs/base/common/platform'; -import { assertAllDefined, assertIsDefined } from 'vs/base/common/types'; -import { localize } from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; -import { IThemeService, Themable } from 'vs/platform/theme/common/themeService'; -import { isTemporaryWorkspace, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { CodeDataTransfers, containsDragType, Extensions as DragAndDropExtensions, IDragAndDropContributionRegistry, LocalSelectionTransfer } from 'vs/platform/dnd/browser/dnd'; -import { DraggedEditorGroupIdentifier, DraggedEditorIdentifier, extractTreeDropData, ResourcesDropHandler } from 'vs/workbench/browser/dnd'; -import { fillActiveEditorViewState, IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor'; -import { EditorInputCapabilities, IEditorIdentifier, IUntypedEditorInput } from 'vs/workbench/common/editor'; -import { EDITOR_DRAG_AND_DROP_BACKGROUND, EDITOR_DROP_INTO_PROMPT_BACKGROUND, EDITOR_DROP_INTO_PROMPT_BORDER, EDITOR_DROP_INTO_PROMPT_FOREGROUND } from 'vs/workbench/common/theme'; -import { GroupDirection, IEditorDropTargetDelegate, IEditorGroup, IEditorGroupsService, IMergeGroupOptions, MergeGroupMode } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { ITreeViewsDnDService } from 'vs/editor/common/services/treeViewsDndService'; -import { DraggedTreeItemsIdentifier } from 'vs/editor/common/services/treeViewsDnd'; +import './media/editordroptarget.css'; +import { DataTransfers } from '../../../../base/browser/dnd.js'; +import { addDisposableListener, DragAndDropObserver, EventHelper, EventType, getWindow, isAncestor } from '../../../../base/browser/dom.js'; +import { renderFormattedText } from '../../../../base/browser/formattedTextRenderer.js'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { toDisposable } from '../../../../base/common/lifecycle.js'; +import { isMacintosh, isWeb } from '../../../../base/common/platform.js'; +import { assertAllDefined, assertIsDefined } from '../../../../base/common/types.js'; +import { localize } from '../../../../nls.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { activeContrastBorder } from '../../../../platform/theme/common/colorRegistry.js'; +import { IThemeService, Themable } from '../../../../platform/theme/common/themeService.js'; +import { isTemporaryWorkspace, IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js'; +import { CodeDataTransfers, containsDragType, Extensions as DragAndDropExtensions, IDragAndDropContributionRegistry, LocalSelectionTransfer } from '../../../../platform/dnd/browser/dnd.js'; +import { DraggedEditorGroupIdentifier, DraggedEditorIdentifier, extractTreeDropData, ResourcesDropHandler } from '../../dnd.js'; +import { fillActiveEditorViewState, IEditorGroupView } from './editor.js'; +import { EditorInputCapabilities, IEditorIdentifier, IUntypedEditorInput } from '../../../common/editor.js'; +import { EDITOR_DRAG_AND_DROP_BACKGROUND, EDITOR_DROP_INTO_PROMPT_BACKGROUND, EDITOR_DROP_INTO_PROMPT_BORDER, EDITOR_DROP_INTO_PROMPT_FOREGROUND } from '../../../common/theme.js'; +import { GroupDirection, IEditorDropTargetDelegate, IEditorGroup, IEditorGroupsService, IMergeGroupOptions, MergeGroupMode } from '../../../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { ITreeViewsDnDService } from '../../../../editor/common/services/treeViewsDndService.js'; +import { DraggedTreeItemsIdentifier } from '../../../../editor/common/services/treeViewsDnd.js'; interface IDropOperation { splitDirection?: GroupDirection; diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index 6c8c42ec330..8e9756045fb 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -3,61 +3,61 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/editorgroupview'; -import { EditorGroupModel, IEditorOpenOptions, IGroupModelChangeEvent, ISerializedEditorGroupModel, isGroupEditorCloseEvent, isGroupEditorOpenEvent, isSerializedEditorGroupModel } from 'vs/workbench/common/editor/editorGroupModel'; -import { GroupIdentifier, CloseDirection, IEditorCloseEvent, IEditorPane, SaveReason, IEditorPartOptionsChangeEvent, EditorsOrder, IVisibleEditorPane, EditorResourceAccessor, EditorInputCapabilities, IUntypedEditorInput, DEFAULT_EDITOR_ASSOCIATION, SideBySideEditor, EditorCloseContext, IEditorWillMoveEvent, IEditorWillOpenEvent, IMatchEditorOptions, GroupModelChangeKind, IActiveEditorChangeEvent, IFindEditorOptions, IToolbarActions, TEXT_DIFF_EDITOR_ID } from 'vs/workbench/common/editor'; -import { ActiveEditorGroupLockedContext, ActiveEditorDirtyContext, EditorGroupEditorsCountContext, ActiveEditorStickyContext, ActiveEditorPinnedContext, ActiveEditorLastInGroupContext, ActiveEditorFirstInGroupContext, ResourceContextKey, applyAvailableEditorIds, ActiveEditorAvailableEditorIdsContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorContext, ActiveEditorReadonlyContext, ActiveEditorCanRevertContext, ActiveEditorCanToggleReadonlyContext, ActiveCompareEditorCanSwapContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext } from 'vs/workbench/common/contextkeys'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput'; -import { Emitter, Relay } from 'vs/base/common/event'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { Dimension, trackFocus, addDisposableListener, EventType, EventHelper, findParentWithClass, isAncestor, IDomNodePagePosition, isMouseEvent, isActiveElement, getWindow, getActiveElement } from 'vs/base/browser/dom'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar'; -import { IThemeService, Themable } from 'vs/platform/theme/common/themeService'; -import { editorBackground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; -import { EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND, EDITOR_GROUP_EMPTY_BACKGROUND, EDITOR_GROUP_HEADER_BORDER } from 'vs/workbench/common/theme'; -import { ICloseEditorsFilter, GroupsOrder, ICloseEditorOptions, ICloseAllEditorsOptions, IEditorReplacement, IActiveEditorActions } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { EditorPanes } from 'vs/workbench/browser/parts/editor/editorPanes'; -import { IEditorProgressService } from 'vs/platform/progress/common/progress'; -import { EditorProgressIndicator } from 'vs/workbench/services/progress/browser/progressIndicator'; -import { localize } from 'vs/nls'; -import { coalesce, firstOrDefault } from 'vs/base/common/arrays'; -import { DisposableStore, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { DeferredPromise, Promises, RunOnceWorker } from 'vs/base/common/async'; -import { EventType as TouchEventType, GestureEvent } from 'vs/base/browser/touch'; -import { IEditorGroupsView, IEditorGroupView, fillActiveEditorViewState, EditorServiceImpl, IEditorGroupTitleHeight, IInternalEditorOpenOptions, IInternalMoveCopyOptions, IInternalEditorCloseOptions, IInternalEditorTitleControlOptions, IEditorPartsView, IEditorGroupViewOptions } from 'vs/workbench/browser/parts/editor/editor'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IAction, SubmenuAction } from 'vs/base/common/actions'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { hash } from 'vs/base/common/hash'; -import { getMimeTypes } from 'vs/editor/common/services/languagesAssociations'; -import { extname, isEqual } from 'vs/base/common/resources'; -import { Schemas } from 'vs/base/common/network'; -import { EditorActivation, IEditorOptions } from 'vs/platform/editor/common/editor'; -import { IFileDialogService, ConfirmResult, IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { IFilesConfigurationService, AutoSaveMode } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; -import { URI } from 'vs/base/common/uri'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { isLinux, isMacintosh, isNative, isWindows } from 'vs/base/common/platform'; -import { ILogService } from 'vs/platform/log/common/log'; -import { TelemetryTrustedValue } from 'vs/platform/telemetry/common/telemetryUtils'; -import { defaultProgressBarStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; -import { EditorGroupWatermark } from 'vs/workbench/browser/parts/editor/editorGroupWatermark'; -import { EditorTitleControl } from 'vs/workbench/browser/parts/editor/editorTitleControl'; -import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane'; -import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; -import { FileSystemProviderCapabilities, IFileService } from 'vs/platform/files/common/files'; +import './media/editorgroupview.css'; +import { EditorGroupModel, IEditorOpenOptions, IGroupModelChangeEvent, ISerializedEditorGroupModel, isGroupEditorCloseEvent, isGroupEditorOpenEvent, isSerializedEditorGroupModel } from '../../../common/editor/editorGroupModel.js'; +import { GroupIdentifier, CloseDirection, IEditorCloseEvent, IEditorPane, SaveReason, IEditorPartOptionsChangeEvent, EditorsOrder, IVisibleEditorPane, EditorResourceAccessor, EditorInputCapabilities, IUntypedEditorInput, DEFAULT_EDITOR_ASSOCIATION, SideBySideEditor, EditorCloseContext, IEditorWillMoveEvent, IEditorWillOpenEvent, IMatchEditorOptions, GroupModelChangeKind, IActiveEditorChangeEvent, IFindEditorOptions, IToolbarActions, TEXT_DIFF_EDITOR_ID } from '../../../common/editor.js'; +import { ActiveEditorGroupLockedContext, ActiveEditorDirtyContext, EditorGroupEditorsCountContext, ActiveEditorStickyContext, ActiveEditorPinnedContext, ActiveEditorLastInGroupContext, ActiveEditorFirstInGroupContext, ResourceContextKey, applyAvailableEditorIds, ActiveEditorAvailableEditorIdsContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorContext, ActiveEditorReadonlyContext, ActiveEditorCanRevertContext, ActiveEditorCanToggleReadonlyContext, ActiveCompareEditorCanSwapContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from '../../../common/contextkeys.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { SideBySideEditorInput } from '../../../common/editor/sideBySideEditorInput.js'; +import { Emitter, Relay } from '../../../../base/common/event.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { Dimension, trackFocus, addDisposableListener, EventType, EventHelper, findParentWithClass, isAncestor, IDomNodePagePosition, isMouseEvent, isActiveElement, getWindow, getActiveElement } from '../../../../base/browser/dom.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { ProgressBar } from '../../../../base/browser/ui/progressbar/progressbar.js'; +import { IThemeService, Themable } from '../../../../platform/theme/common/themeService.js'; +import { editorBackground, contrastBorder } from '../../../../platform/theme/common/colorRegistry.js'; +import { EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND, EDITOR_GROUP_EMPTY_BACKGROUND, EDITOR_GROUP_HEADER_BORDER } from '../../../common/theme.js'; +import { ICloseEditorsFilter, GroupsOrder, ICloseEditorOptions, ICloseAllEditorsOptions, IEditorReplacement, IActiveEditorActions } from '../../../services/editor/common/editorGroupsService.js'; +import { EditorPanes } from './editorPanes.js'; +import { IEditorProgressService } from '../../../../platform/progress/common/progress.js'; +import { EditorProgressIndicator } from '../../../services/progress/browser/progressIndicator.js'; +import { localize } from '../../../../nls.js'; +import { coalesce } from '../../../../base/common/arrays.js'; +import { DisposableStore, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { DeferredPromise, Promises, RunOnceWorker } from '../../../../base/common/async.js'; +import { EventType as TouchEventType, GestureEvent } from '../../../../base/browser/touch.js'; +import { IEditorGroupsView, IEditorGroupView, fillActiveEditorViewState, EditorServiceImpl, IEditorGroupTitleHeight, IInternalEditorOpenOptions, IInternalMoveCopyOptions, IInternalEditorCloseOptions, IInternalEditorTitleControlOptions, IEditorPartsView, IEditorGroupViewOptions } from './editor.js'; +import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { IAction, SubmenuAction } from '../../../../base/common/actions.js'; +import { IMenuService, MenuId } from '../../../../platform/actions/common/actions.js'; +import { StandardMouseEvent } from '../../../../base/browser/mouseEvent.js'; +import { createAndFillInActionBarActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { hash } from '../../../../base/common/hash.js'; +import { getMimeTypes } from '../../../../editor/common/services/languagesAssociations.js'; +import { extname, isEqual } from '../../../../base/common/resources.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { EditorActivation, IEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { IFileDialogService, ConfirmResult, IDialogService } from '../../../../platform/dialogs/common/dialogs.js'; +import { IFilesConfigurationService, AutoSaveMode } from '../../../services/filesConfiguration/common/filesConfigurationService.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js'; +import { isLinux, isMacintosh, isNative, isWindows } from '../../../../base/common/platform.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { TelemetryTrustedValue } from '../../../../platform/telemetry/common/telemetryUtils.js'; +import { defaultProgressBarStyles } from '../../../../platform/theme/browser/defaultStyles.js'; +import { IBoundarySashes } from '../../../../base/browser/ui/sash/sash.js'; +import { EditorGroupWatermark } from './editorGroupWatermark.js'; +import { EditorTitleControl } from './editorTitleControl.js'; +import { EditorPane } from './editorPane.js'; +import { IEditorResolverService } from '../../../services/editor/common/editorResolverService.js'; +import { IHostService } from '../../../services/host/browser/host.js'; +import { DiffEditorInput } from '../../../common/editor/diffEditorInput.js'; +import { FileSystemProviderCapabilities, IFileService } from '../../../../platform/files/common/files.js'; export class EditorGroupView extends Themable implements IEditorGroupView { @@ -259,6 +259,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { const multipleEditorsSelectedContext = MultipleEditorsSelectedInGroupContext.bindTo(this.scopedContextKeyService); const twoEditorsSelectedContext = TwoEditorsSelectedInGroupContext.bindTo(this.scopedContextKeyService); + const selectedEditorsHaveFileOrUntitledResourceContext = SelectedEditorsInGroupFileOrUntitledResourceContextKey.bindTo(this.scopedContextKeyService); const groupActiveEditorContext = this.editorPartsView.bind(ActiveEditorContext, this); const groupActiveEditorIsReadonly = this.editorPartsView.bind(ActiveEditorReadonlyContext, this); @@ -355,6 +356,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { case GroupModelChangeKind.EDITORS_SELECTION: multipleEditorsSelectedContext.set(this.model.selectedEditors.length > 1); twoEditorsSelectedContext.set(this.model.selectedEditors.length === 2); + selectedEditorsHaveFileOrUntitledResourceContext.set(this.model.selectedEditors.every(e => e.resource && (this.fileService.hasProvider(e.resource) || e.resource.scheme === Schemas.untitled))); break; } @@ -558,14 +560,15 @@ export class EditorGroupView extends Themable implements IEditorGroupView { options.preserveFocus = true; // handle focus after editor is restored const internalOptions: IInternalEditorOpenOptions = { - preserveWindowOrder: true // handle window order after editor is restored + preserveWindowOrder: true, // handle window order after editor is restored + skipTitleUpdate: true, // update the title later for all editors at once }; const activeElement = getActiveElement(); // Show active editor (intentionally not using async to keep // `restoreEditors` from executing in same stack) - return this.doShowEditor(activeEditor, { active: true, isNew: false /* restored */ }, options, internalOptions).then(() => { + const result = this.doShowEditor(activeEditor, { active: true, isNew: false /* restored */ }, options, internalOptions).then(() => { // Set focused now if this is the active group and focus has // not changed meanwhile. This prevents focus from being @@ -576,6 +579,11 @@ export class EditorGroupView extends Themable implements IEditorGroupView { this.focus(); } }); + + // Restore editors in title control + this.titleControl.openEditors(this.editors); + + return result; } //#region event handling @@ -827,7 +835,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { // Ensure to show active editor if any if (this.model.activeEditor) { - this.titleControl.openEditor(this.model.activeEditor); + this.titleControl.openEditors(this.model.getEditors(EditorsOrder.SEQUENTIAL)); } } @@ -1316,7 +1324,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { const editorsToOpen = coalesce(editors).filter(({ editor }) => !editor.isDisposed()); // Use the first editor as active editor - const firstEditor = firstOrDefault(editorsToOpen); + const firstEditor = editorsToOpen.at(0); if (!firstEditor) { return; } diff --git a/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts b/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts index c9ac110bc23..db8ede5ffa8 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { isMacintosh, isWeb, OS } from 'vs/base/common/platform'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { append, clearNode, $, h } from 'vs/base/browser/dom'; -import { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpr, ContextKeyExpression, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { defaultKeybindingLabelStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { editorForeground, registerColor, transparent } from 'vs/platform/theme/common/colorRegistry'; +import { localize } from '../../../../nls.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { isMacintosh, isWeb, OS } from '../../../../base/common/platform.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { IWorkspaceContextService, WorkbenchState } from '../../../../platform/workspace/common/workspace.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { append, clearNode, $, h } from '../../../../base/browser/dom.js'; +import { KeybindingLabel } from '../../../../base/browser/ui/keybindingLabel/keybindingLabel.js'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { ContextKeyExpr, ContextKeyExpression, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { defaultKeybindingLabelStyles } from '../../../../platform/theme/browser/defaultStyles.js'; +import { editorForeground, registerColor, transparent } from '../../../../platform/theme/common/colorRegistry.js'; registerColor('editorWatermark.foreground', { dark: transparent(editorForeground, 0.6), light: transparent(editorForeground, 0.68), hcDark: editorForeground, hcLight: editorForeground }, localize('editorLineHighlight', 'Foreground color for the labels in the editor watermark.')); diff --git a/src/vs/workbench/browser/parts/editor/editorPane.ts b/src/vs/workbench/browser/parts/editor/editorPane.ts index 7a73fe46fc5..bb868efd2f1 100644 --- a/src/vs/workbench/browser/parts/editor/editorPane.ts +++ b/src/vs/workbench/browser/parts/editor/editorPane.ts @@ -3,28 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Composite } from 'vs/workbench/browser/composite'; -import { IEditorPane, GroupIdentifier, IEditorMemento, IEditorOpenContext, isEditorInput } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { LRUCache, Touch } from 'vs/base/common/map'; -import { URI } from 'vs/base/common/uri'; -import { Emitter, Event } from 'vs/base/common/event'; -import { isEmptyObject } from 'vs/base/common/types'; -import { DEFAULT_EDITOR_MIN_DIMENSIONS, DEFAULT_EDITOR_MAX_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor'; -import { MementoObject } from 'vs/workbench/common/memento'; -import { joinPath, IExtUri, isEqual } from 'vs/base/common/resources'; -import { indexOfPath } from 'vs/base/common/extpath'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IEditorOptions } from 'vs/platform/editor/common/editor'; -import { ITextResourceConfigurationChangeEvent, ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; -import { getWindowById } from 'vs/base/browser/dom'; +import { Composite } from '../../composite.js'; +import { IEditorPane, GroupIdentifier, IEditorMemento, IEditorOpenContext, isEditorInput } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { IEditorGroup, IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js'; +import { LRUCache, Touch } from '../../../../base/common/map.js'; +import { URI } from '../../../../base/common/uri.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { isEmptyObject } from '../../../../base/common/types.js'; +import { DEFAULT_EDITOR_MIN_DIMENSIONS, DEFAULT_EDITOR_MAX_DIMENSIONS } from './editor.js'; +import { MementoObject } from '../../../common/memento.js'; +import { joinPath, IExtUri, isEqual } from '../../../../base/common/resources.js'; +import { indexOfPath } from '../../../../base/common/extpath.js'; +import { Disposable, IDisposable } from '../../../../base/common/lifecycle.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { IEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { ITextResourceConfigurationChangeEvent, ITextResourceConfigurationService } from '../../../../editor/common/services/textResourceConfiguration.js'; +import { IBoundarySashes } from '../../../../base/browser/ui/sash/sash.js'; +import { getWindowById } from '../../../../base/browser/dom.js'; /** * The base class of editors in the workbench. Editors register themselves for specific editor inputs. diff --git a/src/vs/workbench/browser/parts/editor/editorPanes.ts b/src/vs/workbench/browser/parts/editor/editorPanes.ts index ef1b25dd681..68b73d9a588 100644 --- a/src/vs/workbench/browser/parts/editor/editorPanes.ts +++ b/src/vs/workbench/browser/parts/editor/editorPanes.ts @@ -3,31 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { IAction } from 'vs/base/common/actions'; -import { Emitter } from 'vs/base/common/event'; -import Severity from 'vs/base/common/severity'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { EditorExtensions, EditorInputCapabilities, IEditorOpenContext, IVisibleEditorPane, isEditorOpenError } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { Dimension, show, hide, IDomNodePagePosition, isAncestor, getActiveElement, getWindowById } from 'vs/base/browser/dom'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IEditorPaneRegistry, IEditorPaneDescriptor } from 'vs/workbench/browser/editor'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; -import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IEditorProgressService, LongRunningOperation } from 'vs/platform/progress/common/progress'; -import { IEditorGroupView, DEFAULT_EDITOR_MIN_DIMENSIONS, DEFAULT_EDITOR_MAX_DIMENSIONS, IInternalEditorOpenOptions } from 'vs/workbench/browser/parts/editor/editor'; -import { assertIsDefined } from 'vs/base/common/types'; -import { IWorkspaceTrustManagementService } from 'vs/platform/workspace/common/workspaceTrust'; -import { ErrorPlaceholderEditor, IErrorEditorPlaceholderOptions, WorkspaceTrustRequiredPlaceholderEditor } from 'vs/workbench/browser/parts/editor/editorPlaceholder'; -import { EditorOpenSource, IEditorOptions } from 'vs/platform/editor/common/editor'; -import { isCancellationError } from 'vs/base/common/errors'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IDialogService, IPromptButton, IPromptCancelButton } from 'vs/platform/dialogs/common/dialogs'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; +import { localize } from '../../../../nls.js'; +import { IAction } from '../../../../base/common/actions.js'; +import { Emitter } from '../../../../base/common/event.js'; +import Severity from '../../../../base/common/severity.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { EditorExtensions, EditorInputCapabilities, IEditorOpenContext, IVisibleEditorPane, isEditorOpenError } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { Dimension, show, hide, IDomNodePagePosition, isAncestor, getActiveElement, getWindowById, isEditableElement } from '../../../../base/browser/dom.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { IEditorPaneRegistry, IEditorPaneDescriptor } from '../../editor.js'; +import { IWorkbenchLayoutService } from '../../../services/layout/browser/layoutService.js'; +import { EditorPane } from './editorPane.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IEditorProgressService, LongRunningOperation } from '../../../../platform/progress/common/progress.js'; +import { IEditorGroupView, DEFAULT_EDITOR_MIN_DIMENSIONS, DEFAULT_EDITOR_MAX_DIMENSIONS, IInternalEditorOpenOptions } from './editor.js'; +import { assertIsDefined } from '../../../../base/common/types.js'; +import { IWorkspaceTrustManagementService } from '../../../../platform/workspace/common/workspaceTrust.js'; +import { ErrorPlaceholderEditor, IErrorEditorPlaceholderOptions, WorkspaceTrustRequiredPlaceholderEditor } from './editorPlaceholder.js'; +import { EditorOpenSource, IEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { isCancellationError } from '../../../../base/common/errors.js'; +import { toErrorMessage } from '../../../../base/common/errorMessage.js'; +import { ILogService } from '../../../../platform/log/common/log.js'; +import { IDialogService, IPromptButton, IPromptCancelButton } from '../../../../platform/dialogs/common/dialogs.js'; +import { IBoundarySashes } from '../../../../base/browser/ui/sash/sash.js'; +import { IHostService } from '../../../services/host/browser/host.js'; export interface IOpenEditorResult { @@ -84,6 +84,7 @@ export class EditorPanes extends Disposable { get activeEditorPane(): IVisibleEditorPane | null { return this._activeEditorPane as IVisibleEditorPane | null; } private readonly editorPanes: EditorPane[] = []; + private readonly mapEditorPaneToPendingSetInput = new Map>(); private readonly activeEditorPaneDisposables = this._register(new DisposableStore()); private pagePosition: IDomNodePagePosition | undefined; @@ -287,7 +288,7 @@ export class EditorPanes extends Disposable { return true; // restore focus if same element is still active } - if (activeElement.tagName !== 'INPUT' && activeElement.tagName !== 'TEXTAREA') { + if (!isEditableElement(activeElement)) { // This is to avoid regressions from not restoring focus as we used to: // Only allow a different input element (or textarea) to remain focused @@ -409,11 +410,23 @@ export class EditorPanes extends Disposable { // If the input did not change, return early and only // apply the options unless the options instruct us to // force open it even if it is the same - const inputMatches = editorPane.input?.matches(editor); + let inputMatches = editorPane.input?.matches(editor); if (inputMatches && !options?.forceReload) { - editorPane.setOptions(options); - return { changed: false, cancelled: false }; + // We have to await a pending `setInput()` call for this + // pane before we can call into `setOptions()`, otherwise + // we risk calling when the input is not yet fully applied. + if (this.mapEditorPaneToPendingSetInput.has(editorPane)) { + await this.mapEditorPaneToPendingSetInput.get(editorPane); + } + + // At this point, the input might have changed, so we check again + inputMatches = editorPane.input?.matches(editor); + if (inputMatches) { + editorPane.setOptions(options); + } + + return { changed: false, cancelled: !inputMatches }; } // Start a new editor input operation to report progress @@ -430,8 +443,10 @@ export class EditorPanes extends Disposable { // load (https://github.com/microsoft/vscode/issues/34697) editorPane.clearInput(); - // Set the input to the editor pane - await editorPane.setInput(editor, options, context, operation.token); + // Set the input to the editor pane and keep track of it + const pendingSetInput = editorPane.setInput(editor, options, context, operation.token); + this.mapEditorPaneToPendingSetInput.set(editorPane, pendingSetInput); + await pendingSetInput; if (!operation.isCurrent()) { cancelled = true; @@ -443,6 +458,9 @@ export class EditorPanes extends Disposable { throw error; } } finally { + if (operation.isCurrent()) { + this.mapEditorPaneToPendingSetInput.delete(editorPane); + } operation.stop(); } @@ -463,6 +481,9 @@ export class EditorPanes extends Disposable { this.safeRun(() => this._activeEditorPane?.clearInput()); this.safeRun(() => this._activeEditorPane?.setVisible(false)); + // Clear any pending setInput promise + this.mapEditorPaneToPendingSetInput.delete(this._activeEditorPane); + // Remove editor pane from parent const editorPaneContainer = this._activeEditorPane.getContainer(); if (editorPaneContainer) { diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index d785a513798..5aeb5e50be4 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -3,39 +3,39 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { Part } from 'vs/workbench/browser/part'; -import { Dimension, $, EventHelper, addDisposableGenericMouseDownListener, getWindow, isAncestorOfActiveElement, getActiveElement, isHTMLElement } from 'vs/base/browser/dom'; -import { Event, Emitter, Relay, PauseableEmitter } from 'vs/base/common/event'; -import { contrastBorder, editorBackground } from 'vs/platform/theme/common/colorRegistry'; -import { GroupDirection, GroupsArrangement, GroupOrientation, IMergeGroupOptions, MergeGroupMode, GroupsOrder, GroupLocation, IFindGroupScope, EditorGroupLayout, GroupLayoutArgument, IEditorSideGroup, IEditorDropTargetDelegate, IEditorPart } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IView, orthogonal, LayoutPriority, IViewSize, Direction, SerializableGrid, Sizing, ISerializedGrid, ISerializedNode, Orientation, GridBranchNode, isGridBranchNode, GridNode, createSerializedGrid, Grid } from 'vs/base/browser/ui/grid/grid'; -import { GroupIdentifier, EditorInputWithOptions, IEditorPartOptions, IEditorPartOptionsChangeEvent, GroupModelChangeKind } from 'vs/workbench/common/editor'; -import { EDITOR_GROUP_BORDER, EDITOR_PANE_BACKGROUND } from 'vs/workbench/common/theme'; -import { distinct, coalesce } from 'vs/base/common/arrays'; -import { IEditorGroupView, getEditorPartOptions, impactsEditorPartOptions, IEditorPartCreationOptions, IEditorPartsView, IEditorGroupsView, IEditorGroupViewOptions } from 'vs/workbench/browser/parts/editor/editor'; -import { EditorGroupView } from 'vs/workbench/browser/parts/editor/editorGroupView'; -import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; -import { IDisposable, dispose, toDisposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { IStorageService, IStorageValueChangeEvent, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { ISerializedEditorGroupModel, isSerializedEditorGroupModel } from 'vs/workbench/common/editor/editorGroupModel'; -import { EditorDropTarget } from 'vs/workbench/browser/parts/editor/editorDropTarget'; -import { Color } from 'vs/base/common/color'; -import { CenteredViewLayout } from 'vs/base/browser/ui/centered/centeredViewLayout'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Parts, IWorkbenchLayoutService, Position } from 'vs/workbench/services/layout/browser/layoutService'; -import { DeepPartial, assertIsDefined, assertType } from 'vs/base/common/types'; -import { CompositeDragAndDropObserver } from 'vs/workbench/browser/dnd'; -import { DeferredPromise, Promises } from 'vs/base/common/async'; -import { findGroup } from 'vs/workbench/services/editor/common/editorGroupFinder'; -import { SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { EditorPartMaximizedEditorGroupContext, EditorPartMultipleEditorGroupsContext, IsAuxiliaryEditorPartContext } from 'vs/workbench/common/contextkeys'; -import { mainWindow } from 'vs/base/browser/window'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { Part } from '../../part.js'; +import { Dimension, $, EventHelper, addDisposableGenericMouseDownListener, getWindow, isAncestorOfActiveElement, getActiveElement, isHTMLElement } from '../../../../base/browser/dom.js'; +import { Event, Emitter, Relay, PauseableEmitter } from '../../../../base/common/event.js'; +import { contrastBorder, editorBackground } from '../../../../platform/theme/common/colorRegistry.js'; +import { GroupDirection, GroupsArrangement, GroupOrientation, IMergeGroupOptions, MergeGroupMode, GroupsOrder, GroupLocation, IFindGroupScope, EditorGroupLayout, GroupLayoutArgument, IEditorSideGroup, IEditorDropTargetDelegate, IEditorPart } from '../../../services/editor/common/editorGroupsService.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IView, orthogonal, LayoutPriority, IViewSize, Direction, SerializableGrid, Sizing, ISerializedGrid, ISerializedNode, Orientation, GridBranchNode, isGridBranchNode, GridNode, createSerializedGrid, Grid } from '../../../../base/browser/ui/grid/grid.js'; +import { GroupIdentifier, EditorInputWithOptions, IEditorPartOptions, IEditorPartOptionsChangeEvent, GroupModelChangeKind } from '../../../common/editor.js'; +import { EDITOR_GROUP_BORDER, EDITOR_PANE_BACKGROUND } from '../../../common/theme.js'; +import { distinct, coalesce } from '../../../../base/common/arrays.js'; +import { IEditorGroupView, getEditorPartOptions, impactsEditorPartOptions, IEditorPartCreationOptions, IEditorPartsView, IEditorGroupsView, IEditorGroupViewOptions } from './editor.js'; +import { EditorGroupView } from './editorGroupView.js'; +import { IConfigurationService, IConfigurationChangeEvent } from '../../../../platform/configuration/common/configuration.js'; +import { IDisposable, dispose, toDisposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { IStorageService, IStorageValueChangeEvent, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js'; +import { ISerializedEditorGroupModel, isSerializedEditorGroupModel } from '../../../common/editor/editorGroupModel.js'; +import { EditorDropTarget } from './editorDropTarget.js'; +import { Color } from '../../../../base/common/color.js'; +import { CenteredViewLayout } from '../../../../base/browser/ui/centered/centeredViewLayout.js'; +import { onUnexpectedError } from '../../../../base/common/errors.js'; +import { Parts, IWorkbenchLayoutService, Position } from '../../../services/layout/browser/layoutService.js'; +import { DeepPartial, assertIsDefined, assertType } from '../../../../base/common/types.js'; +import { CompositeDragAndDropObserver } from '../../dnd.js'; +import { DeferredPromise, Promises } from '../../../../base/common/async.js'; +import { findGroup } from '../../../services/editor/common/editorGroupFinder.js'; +import { SIDE_GROUP } from '../../../services/editor/common/editorService.js'; +import { IBoundarySashes } from '../../../../base/browser/ui/sash/sash.js'; +import { IHostService } from '../../../services/host/browser/host.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { EditorPartMaximizedEditorGroupContext, EditorPartMultipleEditorGroupsContext, IsAuxiliaryEditorPartContext } from '../../../common/contextkeys.js'; +import { mainWindow } from '../../../../base/browser/window.js'; export interface IEditorPartUIState { readonly serializedGrid: ISerializedGrid; @@ -114,7 +114,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView { private readonly _onDidActivateGroup = this._register(new Emitter()); readonly onDidActivateGroup = this._onDidActivateGroup.event; - private readonly _onDidAddGroup = this._register(new Emitter()); + private readonly _onDidAddGroup = this._register(new PauseableEmitter()); readonly onDidAddGroup = this._onDidAddGroup.event; private readonly _onDidRemoveGroup = this._register(new PauseableEmitter()); @@ -134,6 +134,9 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView { private readonly _onDidChangeEditorPartOptions = this._register(new Emitter()); readonly onDidChangeEditorPartOptions = this._onDidChangeEditorPartOptions.event; + private readonly _onWillDispose = this._register(new Emitter()); + readonly onWillDispose = this._onWillDispose.event; + //#endregion private readonly workspaceMemento = this.getMemento(StorageScope.WORKSPACE, StorageTarget.USER); @@ -1103,6 +1106,10 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView { openVerticalPosition = Position.BOTTOM; } + if (e.eventData.clientY < boundingRect.top + proximity) { + openVerticalPosition = Position.TOP; + } + if (horizontalOpenerTimeout && openHorizontalPosition !== lastOpenHorizontalPosition) { clearTimeout(horizontalOpenerTimeout); horizontalOpenerTimeout = undefined; @@ -1352,7 +1359,17 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView { private async doApplyState(state: IEditorPartUIState, options?: IEditorGroupViewOptions): Promise { const groups = await this.doPrepareApplyState(); - const resumeEvents = this.disposeGroups(true /* suspress events for the duration of applying state */); + + // Pause add/remove events for groups during the duration of applying the state + // This ensures that we can do this transition atomically with the new state + // being ready when the events are fired. This is important because usually there + // is never the state where no groups are present, but for this transition we + // need to temporarily dispose all groups to restore the new set. + + this._onDidAddGroup.pause(); + this._onDidRemoveGroup.pause(); + + this.disposeGroups(); // MRU this.mostRecentActiveGroups = state.mostRecentActiveGroups; @@ -1361,7 +1378,12 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView { try { this.doApplyGridState(state.serializedGrid, state.activeGroup, undefined, options); } finally { - resumeEvents(); + // It is very important to keep this order: first resume the events for + // removed groups and then for added groups. Many listeners may store + // groups in sets by their identifier and groups can have the same + // identifier before and after. + this._onDidRemoveGroup.resume(); + this._onDidAddGroup.resume(); } // Restore editors that were not closed before and are now opened now @@ -1435,13 +1457,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView { }; } - private disposeGroups(): void; - private disposeGroups(surpressEvents: boolean): Function; - private disposeGroups(surpressEvents?: boolean): Function | void { - if (surpressEvents) { - this._onDidRemoveGroup.pause(); - } - + private disposeGroups(): void { for (const group of this.groups) { group.dispose(); @@ -1450,14 +1466,13 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView { this.groupViews.clear(); this.mostRecentActiveGroups = []; - - if (surpressEvents) { - return () => this._onDidRemoveGroup.resume(); - } } override dispose(): void { + // Event + this._onWillDispose.fire(); + // Forward to all groups this.disposeGroups(); diff --git a/src/vs/workbench/browser/parts/editor/editorParts.ts b/src/vs/workbench/browser/parts/editor/editorParts.ts index 18123131e5b..3684686bdf2 100644 --- a/src/vs/workbench/browser/parts/editor/editorParts.ts +++ b/src/vs/workbench/browser/parts/editor/editorParts.ts @@ -3,25 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { EditorGroupLayout, GroupDirection, GroupLocation, GroupOrientation, GroupsArrangement, GroupsOrder, IAuxiliaryEditorPart, IAuxiliaryEditorPartCreateEvent, IEditorGroupContextKeyProvider, IEditorDropTargetDelegate, IEditorGroupsService, IEditorSideGroup, IEditorWorkingSet, IFindGroupScope, IMergeGroupOptions, IEditorWorkingSetOptions } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { Emitter } from 'vs/base/common/event'; -import { DisposableMap, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { GroupIdentifier } from 'vs/workbench/common/editor'; -import { EditorPart, IEditorPartUIState, MainEditorPart } from 'vs/workbench/browser/parts/editor/editorPart'; -import { IEditorGroupView, IEditorPartsView } from 'vs/workbench/browser/parts/editor/editor'; -import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { distinct, firstOrDefault } from 'vs/base/common/arrays'; -import { AuxiliaryEditorPart, IAuxiliaryEditorPartOpenOptions } from 'vs/workbench/browser/parts/editor/auxiliaryEditorPart'; -import { MultiWindowParts } from 'vs/workbench/browser/part'; -import { DeferredPromise } from 'vs/base/common/async'; -import { IStorageService, IStorageValueChangeEvent, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IAuxiliaryWindowOpenOptions, IAuxiliaryWindowService } from 'vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService'; -import { generateUuid } from 'vs/base/common/uuid'; -import { ContextKeyValue, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { isHTMLElement } from 'vs/base/browser/dom'; +import { localize } from '../../../../nls.js'; +import { EditorGroupLayout, GroupDirection, GroupLocation, GroupOrientation, GroupsArrangement, GroupsOrder, IAuxiliaryEditorPart, IEditorGroupContextKeyProvider, IEditorDropTargetDelegate, IEditorGroupsService, IEditorSideGroup, IEditorWorkingSet, IFindGroupScope, IMergeGroupOptions, IEditorWorkingSetOptions, IEditorPart } from '../../../services/editor/common/editorGroupsService.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { DisposableMap, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { GroupIdentifier } from '../../../common/editor.js'; +import { EditorPart, IEditorPartUIState, MainEditorPart } from './editorPart.js'; +import { IEditorGroupView, IEditorPartsView } from './editor.js'; +import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { distinct } from '../../../../base/common/arrays.js'; +import { AuxiliaryEditorPart, IAuxiliaryEditorPartOpenOptions } from './auxiliaryEditorPart.js'; +import { MultiWindowParts } from '../../part.js'; +import { DeferredPromise } from '../../../../base/common/async.js'; +import { IStorageService, IStorageValueChangeEvent, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { IAuxiliaryWindowOpenOptions, IAuxiliaryWindowService } from '../../../services/auxiliaryWindow/browser/auxiliaryWindowService.js'; +import { generateUuid } from '../../../../base/common/uuid.js'; +import { ContextKeyValue, IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { isHTMLElement } from '../../../../base/browser/dom.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; interface IEditorPartsUIState { readonly auxiliary: IAuxiliaryEditorPartState[]; @@ -70,19 +72,44 @@ export class EditorParts extends MultiWindowParts implements IEditor return this.instantiationService.createInstance(MainEditorPart, this); } + //#region Scoped Instantiation Services + + private readonly mapPartToInstantiationService = new Map(); + + getScopedInstantiationService(part: IEditorPart): IInstantiationService { + if (part === this.mainPart) { + if (!this.mapPartToInstantiationService.has(part.windowId)) { + this.instantiationService.invokeFunction(accessor => { + const editorService = accessor.get(IEditorService); // using `invokeFunction` to get hold of `IEditorService` lazily + + this.mapPartToInstantiationService.set(part.windowId, this._register(this.instantiationService.createChild(new ServiceCollection( + [IEditorService, editorService.createScoped('main', this._store)] + )))); + }); + } + } + + return this.mapPartToInstantiationService.get(part.windowId) ?? this.instantiationService; + } + + //#endregion + //#region Auxiliary Editor Parts - private readonly _onDidCreateAuxiliaryEditorPart = this._register(new Emitter()); + private readonly _onDidCreateAuxiliaryEditorPart = this._register(new Emitter()); readonly onDidCreateAuxiliaryEditorPart = this._onDidCreateAuxiliaryEditorPart.event; async createAuxiliaryEditorPart(options?: IAuxiliaryEditorPartOpenOptions): Promise { const { part, instantiationService, disposables } = await this.instantiationService.createInstance(AuxiliaryEditorPart, this).create(this.getGroupsLabel(this._parts.size), options); + // Keep instantiation service + this.mapPartToInstantiationService.set(part.windowId, instantiationService); + disposables.add(toDisposable(() => this.mapPartToInstantiationService.delete(part.windowId))); + // Events this._onDidAddGroup.fire(part.activeGroup); - const eventDisposables = disposables.add(new DisposableStore()); - this._onDidCreateAuxiliaryEditorPart.fire({ part, instantiationService, disposables: eventDisposables }); + this._onDidCreateAuxiliaryEditorPart.fire(part); return part; } @@ -223,7 +250,7 @@ export class EditorParts extends MultiWindowParts implements IEditor } } - const mostRecentActivePart = firstOrDefault(this.mostRecentActiveParts); + const mostRecentActivePart = this.mostRecentActiveParts.at(0); mostRecentActivePart?.activeGroup.focus(); this._isReady = true; @@ -400,7 +427,7 @@ export class EditorParts extends MultiWindowParts implements IEditor // Restore Focus unless instructed otherwise if (!options?.preserveFocus) { - const mostRecentActivePart = firstOrDefault(this.mostRecentActiveParts); + const mostRecentActivePart = this.mostRecentActiveParts.at(0); if (mostRecentActivePart) { await mostRecentActivePart.whenReady; mostRecentActivePart.activeGroup.focus(); diff --git a/src/vs/workbench/browser/parts/editor/editorPlaceholder.ts b/src/vs/workbench/browser/parts/editor/editorPlaceholder.ts index def52c5b61e..6c100075472 100644 --- a/src/vs/workbench/browser/parts/editor/editorPlaceholder.ts +++ b/src/vs/workbench/browser/parts/editor/editorPlaceholder.ts @@ -3,33 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/editorplaceholder'; -import { localize } from 'vs/nls'; -import { truncate, truncateMiddle } from 'vs/base/common/strings'; -import Severity from 'vs/base/common/severity'; -import { IEditorOpenContext, isEditorOpenError } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; -import { ScrollbarVisibility } from 'vs/base/common/scrollable'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { Dimension, size, clearNode, $, EventHelper } from 'vs/base/browser/dom'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { assertAllDefined } from 'vs/base/common/types'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IWorkspaceContextService, isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; -import { EditorOpenSource, IEditorOptions } from 'vs/platform/editor/common/editor'; -import { computeEditorAriaLabel, EditorPaneDescriptor } from 'vs/workbench/browser/editor'; -import { ButtonBar } from 'vs/base/browser/ui/button/button'; -import { defaultButtonStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { SimpleIconLabel } from 'vs/base/browser/ui/iconLabel/simpleIconLabel'; -import { FileChangeType, FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService'; +import './media/editorplaceholder.css'; +import { localize } from '../../../../nls.js'; +import { truncate, truncateMiddle } from '../../../../base/common/strings.js'; +import Severity from '../../../../base/common/severity.js'; +import { IEditorOpenContext, isEditorOpenError } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { EditorPane } from './editorPane.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { DomScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js'; +import { ScrollbarVisibility } from '../../../../base/common/scrollable.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { Dimension, size, clearNode, $, EventHelper } from '../../../../base/browser/dom.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { DisposableStore, IDisposable, MutableDisposable } from '../../../../base/common/lifecycle.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { assertAllDefined } from '../../../../base/common/types.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { IWorkspaceContextService, isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier } from '../../../../platform/workspace/common/workspace.js'; +import { EditorOpenSource, IEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { computeEditorAriaLabel, EditorPaneDescriptor } from '../../editor.js'; +import { ButtonBar } from '../../../../base/browser/ui/button/button.js'; +import { defaultButtonStyles } from '../../../../platform/theme/browser/defaultStyles.js'; +import { SimpleIconLabel } from '../../../../base/browser/ui/iconLabel/simpleIconLabel.js'; +import { FileChangeType, FileOperationError, FileOperationResult, IFileService } from '../../../../platform/files/common/files.js'; +import { toErrorMessage } from '../../../../base/common/errorMessage.js'; +import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js'; +import { IEditorGroup } from '../../../services/editor/common/editorGroupsService.js'; export interface IEditorPlaceholderContents { icon: string; @@ -185,7 +185,7 @@ export class WorkspaceTrustRequiredPlaceholderEditor extends EditorPlaceholder { static readonly ID = 'workbench.editors.workspaceTrustRequiredEditor'; private static readonly LABEL = localize('trustRequiredEditor', "Workspace Trust Required"); - static readonly DESCRIPTOR = EditorPaneDescriptor.create(WorkspaceTrustRequiredPlaceholderEditor, WorkspaceTrustRequiredPlaceholderEditor.ID, WorkspaceTrustRequiredPlaceholderEditor.LABEL); + static readonly DESCRIPTOR = EditorPaneDescriptor.create(WorkspaceTrustRequiredPlaceholderEditor, this.ID, this.LABEL); constructor( group: IEditorGroup, @@ -223,7 +223,7 @@ export class ErrorPlaceholderEditor extends EditorPlaceholder { private static readonly ID = 'workbench.editors.errorEditor'; private static readonly LABEL = localize('errorEditor', "Error Editor"); - static readonly DESCRIPTOR = EditorPaneDescriptor.create(ErrorPlaceholderEditor, ErrorPlaceholderEditor.ID, ErrorPlaceholderEditor.LABEL); + static readonly DESCRIPTOR = EditorPaneDescriptor.create(ErrorPlaceholderEditor, this.ID, this.LABEL); constructor( group: IEditorGroup, diff --git a/src/vs/workbench/browser/parts/editor/editorQuickAccess.ts b/src/vs/workbench/browser/parts/editor/editorQuickAccess.ts index 225330438f6..bbab2a62d6e 100644 --- a/src/vs/workbench/browser/parts/editor/editorQuickAccess.ts +++ b/src/vs/workbench/browser/parts/editor/editorQuickAccess.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/editorquickaccess'; -import { localize } from 'vs/nls'; -import { IQuickPickSeparator, quickPickItemScorerAccessor, IQuickPickItemWithResource, IQuickPick } from 'vs/platform/quickinput/common/quickInput'; -import { PickerQuickAccessProvider, IPickerQuickAccessItem, TriggerAction } from 'vs/platform/quickinput/browser/pickerQuickAccess'; -import { IEditorGroupsService, GroupsOrder } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { EditorsOrder, IEditorIdentifier, EditorResourceAccessor, SideBySideEditor, GroupIdentifier } from 'vs/workbench/common/editor'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { getIconClasses } from 'vs/editor/common/services/getIconClasses'; -import { prepareQuery, scoreItemFuzzy, compareItemsByFuzzyScore, FuzzyScorerCache } from 'vs/base/common/fuzzyScorer'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; +import './media/editorquickaccess.css'; +import { localize } from '../../../../nls.js'; +import { IQuickPickSeparator, quickPickItemScorerAccessor, IQuickPickItemWithResource, IQuickPick } from '../../../../platform/quickinput/common/quickInput.js'; +import { PickerQuickAccessProvider, IPickerQuickAccessItem, TriggerAction } from '../../../../platform/quickinput/browser/pickerQuickAccess.js'; +import { IEditorGroupsService, GroupsOrder } from '../../../services/editor/common/editorGroupsService.js'; +import { EditorsOrder, IEditorIdentifier, EditorResourceAccessor, SideBySideEditor, GroupIdentifier } from '../../../common/editor.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { IModelService } from '../../../../editor/common/services/model.js'; +import { ILanguageService } from '../../../../editor/common/languages/language.js'; +import { getIconClasses } from '../../../../editor/common/services/getIconClasses.js'; +import { prepareQuery, scoreItemFuzzy, compareItemsByFuzzyScore, FuzzyScorerCache } from '../../../../base/common/fuzzyScorer.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { IDisposable } from '../../../../base/common/lifecycle.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; interface IEditorQuickPickItem extends IQuickPickItemWithResource, IPickerQuickAccessItem { groupId: GroupIdentifier; @@ -60,7 +60,7 @@ export abstract class BaseEditorQuickAccessProvider extends PickerQuickAccessPro ); } - override provide(picker: IQuickPick, token: CancellationToken): IDisposable { + override provide(picker: IQuickPick, token: CancellationToken): IDisposable { // Reset the pick state for this run this.pickState.reset(!!picker.quickNavigate); diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index 42523245283..64c17195e49 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -3,61 +3,59 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/editorstatus'; -import { localize, localize2 } from 'vs/nls'; -import { getWindowById, runAtThisOrScheduleAtNextAnimationFrame } from 'vs/base/browser/dom'; -import { format, compare, splitLines } from 'vs/base/common/strings'; -import { extname, basename, isEqual } from 'vs/base/common/resources'; -import { areFunctions, assertIsDefined } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; -import { Action } from 'vs/base/common/actions'; -import { Language } from 'vs/base/common/platform'; -import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput'; -import { IFileEditorInput, EditorResourceAccessor, IEditorPane, SideBySideEditor } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { Disposable, MutableDisposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { IEditorAction } from 'vs/editor/common/editorCommon'; -import { EndOfLineSequence } from 'vs/editor/common/model'; -import { TrimTrailingWhitespaceAction } from 'vs/editor/contrib/linesOperations/browser/linesOperations'; -import { IndentUsingSpaces, IndentUsingTabs, ChangeTabDisplaySize, DetectIndentation, IndentationToSpacesAction, IndentationToTabsAction } from 'vs/editor/contrib/indentation/browser/indentation'; -import { BaseBinaryResourceEditor } from 'vs/workbench/browser/parts/editor/binaryEditor'; -import { BinaryResourceDiffEditor } from 'vs/workbench/browser/parts/editor/binaryDiffEditor'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IFileService, FILES_ASSOCIATIONS_CONFIG } from 'vs/platform/files/common/files'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILanguageService, ILanguageSelection } from 'vs/editor/common/languages/language'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { EncodingMode, IEncodingSupport, ILanguageSupport, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { SUPPORTED_ENCODINGS } from 'vs/workbench/services/textfile/common/encoding'; -import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; -import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { deepClone } from 'vs/base/common/objects'; -import { ICodeEditor, getCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Schemas } from 'vs/base/common/network'; -import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; -import { IQuickInputService, IQuickPickItem, QuickPickInput } from 'vs/platform/quickinput/common/quickInput'; -import { getIconClassesForLanguageId } from 'vs/editor/common/services/getIconClasses'; -import { Promises, timeout } from 'vs/base/common/async'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { IStatusbarEntryAccessor, IStatusbarService, StatusbarAlignment, IStatusbarEntry } from 'vs/workbench/services/statusbar/browser/statusbar'; -import { IMarker, IMarkerService, MarkerSeverity, IMarkerData } from 'vs/platform/markers/common/markers'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput'; -import { AutomaticLanguageDetectionLikelyWrongClassification, AutomaticLanguageDetectionLikelyWrongId, IAutomaticLanguageDetectionLikelyWrongData, ILanguageDetectionService } from 'vs/workbench/services/languageDetection/common/languageDetectionWorkerService'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { Action2 } from 'vs/platform/actions/common/actions'; -import { ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { TabFocus } from 'vs/editor/browser/config/tabFocus'; -import { mainWindow } from 'vs/base/browser/window'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; +import './media/editorstatus.css'; +import { localize, localize2 } from '../../../../nls.js'; +import { getWindowById, runAtThisOrScheduleAtNextAnimationFrame } from '../../../../base/browser/dom.js'; +import { format, compare, splitLines } from '../../../../base/common/strings.js'; +import { extname, basename, isEqual } from '../../../../base/common/resources.js'; +import { areFunctions, assertIsDefined } from '../../../../base/common/types.js'; +import { URI } from '../../../../base/common/uri.js'; +import { Action } from '../../../../base/common/actions.js'; +import { Language } from '../../../../base/common/platform.js'; +import { UntitledTextEditorInput } from '../../../services/untitled/common/untitledTextEditorInput.js'; +import { IFileEditorInput, EditorResourceAccessor, IEditorPane, SideBySideEditor } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { Disposable, MutableDisposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { IEditorAction } from '../../../../editor/common/editorCommon.js'; +import { EndOfLineSequence } from '../../../../editor/common/model.js'; +import { TrimTrailingWhitespaceAction } from '../../../../editor/contrib/linesOperations/browser/linesOperations.js'; +import { IndentUsingSpaces, IndentUsingTabs, ChangeTabDisplaySize, DetectIndentation, IndentationToSpacesAction, IndentationToTabsAction } from '../../../../editor/contrib/indentation/browser/indentation.js'; +import { BaseBinaryResourceEditor } from './binaryEditor.js'; +import { BinaryResourceDiffEditor } from './binaryDiffEditor.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { IFileService, FILES_ASSOCIATIONS_CONFIG } from '../../../../platform/files/common/files.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ILanguageService, ILanguageSelection } from '../../../../editor/common/languages/language.js'; +import { Range } from '../../../../editor/common/core/range.js'; +import { Selection } from '../../../../editor/common/core/selection.js'; +import { ICommandService, CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { IExtensionGalleryService } from '../../../../platform/extensionManagement/common/extensionManagement.js'; +import { EncodingMode, IEncodingSupport, ILanguageSupport, ITextFileService } from '../../../services/textfile/common/textfiles.js'; +import { SUPPORTED_ENCODINGS } from '../../../services/textfile/common/encoding.js'; +import { ConfigurationChangedEvent, EditorOption } from '../../../../editor/common/config/editorOptions.js'; +import { ITextResourceConfigurationService } from '../../../../editor/common/services/textResourceConfiguration.js'; +import { ConfigurationTarget, IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { deepClone } from '../../../../base/common/objects.js'; +import { ICodeEditor, getCodeEditor } from '../../../../editor/browser/editorBrowser.js'; +import { Schemas } from '../../../../base/common/network.js'; +import { IPreferencesService } from '../../../services/preferences/common/preferences.js'; +import { IQuickInputService, IQuickPickItem, QuickPickInput } from '../../../../platform/quickinput/common/quickInput.js'; +import { getIconClassesForLanguageId } from '../../../../editor/common/services/getIconClasses.js'; +import { Promises, timeout } from '../../../../base/common/async.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { IWorkbenchContribution } from '../../../common/contributions.js'; +import { IStatusbarEntryAccessor, IStatusbarService, StatusbarAlignment, IStatusbarEntry } from '../../../services/statusbar/browser/statusbar.js'; +import { IMarker, IMarkerService, MarkerSeverity, IMarkerData } from '../../../../platform/markers/common/markers.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { SideBySideEditorInput } from '../../../common/editor/sideBySideEditorInput.js'; +import { AutomaticLanguageDetectionLikelyWrongClassification, AutomaticLanguageDetectionLikelyWrongId, IAutomaticLanguageDetectionLikelyWrongData, ILanguageDetectionService } from '../../../services/languageDetection/common/languageDetectionWorkerService.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { Action2 } from '../../../../platform/actions/common/actions.js'; +import { ServicesAccessor } from '../../../../editor/browser/editorExtensions.js'; +import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { TabFocus } from '../../../../editor/browser/config/tabFocus.js'; +import { IEditorGroupsService, IEditorPart } from '../../../services/editor/common/editorGroupsService.js'; class SideBySideEditorEncodingSupport implements IEncodingSupport { constructor(private primary: IEncodingSupport, private secondary: IEncodingSupport) { } @@ -886,22 +884,23 @@ export class EditorStatusContribution extends Disposable implements IWorkbenchCo static readonly ID = 'workbench.contrib.editorStatus'; constructor( - @IInstantiationService instantiationService: IInstantiationService, - @IEditorGroupsService editorGroupService: IEditorGroupsService, - @IEditorService editorService: IEditorService + @IEditorGroupsService private readonly editorGroupService: IEditorGroupsService, ) { super(); - // Main Editor Status - const mainInstantiationService = this._register(instantiationService.createChild(new ServiceCollection( - [IEditorService, editorService.createScoped('main', this._store)] - ))); - this._register(mainInstantiationService.createInstance(EditorStatus, mainWindow.vscodeWindowId)); + for (const part of editorGroupService.parts) { + this.createEditorStatus(part); + } - // Auxiliary Editor Status - this._register(editorGroupService.onDidCreateAuxiliaryEditorPart(({ part, instantiationService, disposables }) => { - disposables.add(instantiationService.createInstance(EditorStatus, part.windowId)); - })); + this._register(editorGroupService.onDidCreateAuxiliaryEditorPart(part => this.createEditorStatus(part))); + } + + private createEditorStatus(part: IEditorPart): void { + const disposables = new DisposableStore(); + Event.once(part.onWillDispose)(() => disposables.dispose()); + + const scopedInstantiationService = this.editorGroupService.getScopedInstantiationService(part); + disposables.add(scopedInstantiationService.createInstance(EditorStatus, part.windowId)); } } diff --git a/src/vs/workbench/browser/parts/editor/editorTabsControl.ts b/src/vs/workbench/browser/parts/editor/editorTabsControl.ts index e5e4f7774de..d03297e004f 100644 --- a/src/vs/workbench/browser/parts/editor/editorTabsControl.ts +++ b/src/vs/workbench/browser/parts/editor/editorTabsControl.ts @@ -3,50 +3,52 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/editortabscontrol'; -import { localize } from 'vs/nls'; -import { applyDragImage, DataTransfers } from 'vs/base/browser/dnd'; -import { Dimension, getActiveWindow, getWindow, isMouseEvent } from 'vs/base/browser/dom'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { ActionsOrientation, IActionViewItem, prepareActions } from 'vs/base/browser/ui/actionbar/actionbar'; -import { IAction, ActionRunner } from 'vs/base/common/actions'; -import { ResolvedKeybinding } from 'vs/base/common/keybindings'; -import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { createActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { listActiveSelectionBackground, listActiveSelectionForeground } from 'vs/platform/theme/common/colorRegistry'; -import { IThemeService, Themable } from 'vs/platform/theme/common/themeService'; -import { DraggedEditorGroupIdentifier, DraggedEditorIdentifier, fillEditorsDragData, isWindowDraggedOver } from 'vs/workbench/browser/dnd'; -import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane'; -import { IEditorGroupsView, IEditorGroupView, IEditorPartsView, IInternalEditorOpenOptions } from 'vs/workbench/browser/parts/editor/editor'; -import { IEditorCommandsContext, EditorResourceAccessor, IEditorPartOptions, SideBySideEditor, EditorsOrder, EditorInputCapabilities, IToolbarActions, GroupIdentifier, Verbosity } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { ResourceContextKey, ActiveEditorPinnedContext, ActiveEditorStickyContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, ActiveEditorFirstInGroupContext, ActiveEditorAvailableEditorIdsContext, applyAvailableEditorIds, ActiveEditorLastInGroupContext } from 'vs/workbench/common/contextkeys'; -import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview'; -import { assertIsDefined } from 'vs/base/common/types'; -import { isFirefox } from 'vs/base/browser/browser'; -import { isCancellationError } from 'vs/base/common/errors'; -import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput'; -import { WorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; -import { LocalSelectionTransfer } from 'vs/platform/dnd/browser/dnd'; -import { DraggedTreeItemsIdentifier } from 'vs/editor/common/services/treeViewsDnd'; -import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService'; -import { IEditorTitleControlDimensions } from 'vs/workbench/browser/parts/editor/editorTitleControl'; -import { IReadonlyEditorGroupModel } from 'vs/workbench/common/editor/editorGroupModel'; -import { EDITOR_CORE_NAVIGATION_COMMANDS } from 'vs/workbench/browser/parts/editor/editorCommands'; -import { IAuxiliaryEditorPart, MergeGroupMode } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { isMacintosh } from 'vs/base/common/platform'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate'; -import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; -import { IBaseActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems'; +import './media/editortabscontrol.css'; +import { localize } from '../../../../nls.js'; +import { applyDragImage, DataTransfers } from '../../../../base/browser/dnd.js'; +import { Dimension, getActiveWindow, getWindow, isMouseEvent } from '../../../../base/browser/dom.js'; +import { StandardMouseEvent } from '../../../../base/browser/mouseEvent.js'; +import { ActionsOrientation, IActionViewItem, prepareActions } from '../../../../base/browser/ui/actionbar/actionbar.js'; +import { IAction, ActionRunner } from '../../../../base/common/actions.js'; +import { ResolvedKeybinding } from '../../../../base/common/keybindings.js'; +import { DisposableStore, IDisposable } from '../../../../base/common/lifecycle.js'; +import { createActionViewItem } from '../../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { IContextKeyService, IContextKey } from '../../../../platform/contextkey/common/contextkey.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; +import { listActiveSelectionBackground, listActiveSelectionForeground } from '../../../../platform/theme/common/colorRegistry.js'; +import { IThemeService, Themable } from '../../../../platform/theme/common/themeService.js'; +import { DraggedEditorGroupIdentifier, DraggedEditorIdentifier, fillEditorsDragData, isWindowDraggedOver } from '../../dnd.js'; +import { EditorPane } from './editorPane.js'; +import { IEditorGroupsView, IEditorGroupView, IEditorPartsView, IInternalEditorOpenOptions } from './editor.js'; +import { IEditorCommandsContext, EditorResourceAccessor, IEditorPartOptions, SideBySideEditor, EditorsOrder, EditorInputCapabilities, IToolbarActions, GroupIdentifier, Verbosity } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { ResourceContextKey, ActiveEditorPinnedContext, ActiveEditorStickyContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, ActiveEditorFirstInGroupContext, ActiveEditorAvailableEditorIdsContext, applyAvailableEditorIds, ActiveEditorLastInGroupContext } from '../../../common/contextkeys.js'; +import { AnchorAlignment } from '../../../../base/browser/ui/contextview/contextview.js'; +import { assertIsDefined } from '../../../../base/common/types.js'; +import { isFirefox } from '../../../../base/browser/browser.js'; +import { isCancellationError } from '../../../../base/common/errors.js'; +import { SideBySideEditorInput } from '../../../common/editor/sideBySideEditorInput.js'; +import { WorkbenchToolBar } from '../../../../platform/actions/browser/toolbar.js'; +import { LocalSelectionTransfer } from '../../../../platform/dnd/browser/dnd.js'; +import { DraggedTreeItemsIdentifier } from '../../../../editor/common/services/treeViewsDnd.js'; +import { IEditorResolverService } from '../../../services/editor/common/editorResolverService.js'; +import { IEditorTitleControlDimensions } from './editorTitleControl.js'; +import { IReadonlyEditorGroupModel } from '../../../common/editor/editorGroupModel.js'; +import { EDITOR_CORE_NAVIGATION_COMMANDS } from './editorCommands.js'; +import { IAuxiliaryEditorPart, MergeGroupMode } from '../../../services/editor/common/editorGroupsService.js'; +import { isMacintosh } from '../../../../base/common/platform.js'; +import { IHostService } from '../../../services/host/browser/host.js'; +import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js'; +import { IHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegate.js'; +import { getDefaultHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js'; +import { IBaseActionViewItemOptions } from '../../../../base/browser/ui/actionbar/actionViewItems.js'; +import { MarkdownString } from '../../../../base/common/htmlContent.js'; +import { IManagedHoverTooltipMarkdownString } from '../../../../base/browser/ui/hover/hover.js'; export class EditorCommandsContextActionRunner extends ActionRunner { @@ -452,8 +454,17 @@ export abstract class EditorTabsControl extends Themable implements IEditorTabsC return this.groupsView.partOptions.tabHeight !== 'compact' ? EditorTabsControl.EDITOR_TAB_HEIGHT.normal : EditorTabsControl.EDITOR_TAB_HEIGHT.compact; } - protected getHoverTitle(editor: EditorInput): string { - return editor.getTitle(Verbosity.LONG); + protected getHoverTitle(editor: EditorInput): string | IManagedHoverTooltipMarkdownString { + const title = editor.getTitle(Verbosity.LONG); + if (!this.tabsModel.isPinned(editor)) { + return { + markdown: new MarkdownString('', { supportThemeIcons: true, isTrusted: true }). + appendText(title). + appendMarkdown(' (_preview_ [$(gear)](command:workbench.action.openSettings?%5B%22workbench.editor.enablePreview%22%5D "Configure Preview Mode"))'), + markdownNotSupportedFallback: title + ' (preview)' + }; + } + return title; } protected getHoverDelegate(): IHoverDelegate { diff --git a/src/vs/workbench/browser/parts/editor/editorTitleControl.ts b/src/vs/workbench/browser/parts/editor/editorTitleControl.ts index d134e9b6175..ac74f9b7728 100644 --- a/src/vs/workbench/browser/parts/editor/editorTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/editorTitleControl.ts @@ -3,21 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/editortitlecontrol'; -import { Dimension, clearNode } from 'vs/base/browser/dom'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IThemeService, Themable } from 'vs/platform/theme/common/themeService'; -import { BreadcrumbsControl, BreadcrumbsControlFactory } from 'vs/workbench/browser/parts/editor/breadcrumbsControl'; -import { IEditorGroupsView, IEditorGroupTitleHeight, IEditorGroupView, IEditorPartsView, IInternalEditorOpenOptions } from 'vs/workbench/browser/parts/editor/editor'; -import { IEditorTabsControl } from 'vs/workbench/browser/parts/editor/editorTabsControl'; -import { MultiEditorTabsControl } from 'vs/workbench/browser/parts/editor/multiEditorTabsControl'; -import { SingleEditorTabsControl } from 'vs/workbench/browser/parts/editor/singleEditorTabsControl'; -import { IEditorPartOptions } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { MultiRowEditorControl } from 'vs/workbench/browser/parts/editor/multiRowEditorTabsControl'; -import { IReadonlyEditorGroupModel } from 'vs/workbench/common/editor/editorGroupModel'; -import { NoEditorTabsControl } from 'vs/workbench/browser/parts/editor/noEditorTabsControl'; +import './media/editortitlecontrol.css'; +import { Dimension, clearNode } from '../../../../base/browser/dom.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IThemeService, Themable } from '../../../../platform/theme/common/themeService.js'; +import { BreadcrumbsControl, BreadcrumbsControlFactory } from './breadcrumbsControl.js'; +import { IEditorGroupsView, IEditorGroupTitleHeight, IEditorGroupView, IEditorPartsView, IInternalEditorOpenOptions } from './editor.js'; +import { IEditorTabsControl } from './editorTabsControl.js'; +import { MultiEditorTabsControl } from './multiEditorTabsControl.js'; +import { SingleEditorTabsControl } from './singleEditorTabsControl.js'; +import { IEditorPartOptions } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { MultiRowEditorControl } from './multiRowEditorTabsControl.js'; +import { IReadonlyEditorGroupModel } from '../../../common/editor/editorGroupModel.js'; +import { NoEditorTabsControl } from './noEditorTabsControl.js'; export interface IEditorTitleControlDimensions { diff --git a/src/vs/workbench/browser/parts/editor/editorWithViewState.ts b/src/vs/workbench/browser/parts/editor/editorWithViewState.ts index e31756007e9..8cfd84b64c1 100644 --- a/src/vs/workbench/browser/parts/editor/editorWithViewState.ts +++ b/src/vs/workbench/browser/parts/editor/editorWithViewState.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { URI } from 'vs/base/common/uri'; -import { Event } from 'vs/base/common/event'; -import { IEditorMemento, IEditorCloseEvent, IEditorOpenContext, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor'; -import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { IEditorGroupsService, IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IExtUri } from 'vs/base/common/resources'; -import { IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; +import { URI } from '../../../../base/common/uri.js'; +import { Event } from '../../../../base/common/event.js'; +import { IEditorMemento, IEditorCloseEvent, IEditorOpenContext, EditorResourceAccessor, SideBySideEditor } from '../../../common/editor.js'; +import { EditorPane } from './editorPane.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { ITextResourceConfigurationService } from '../../../../editor/common/services/textResourceConfiguration.js'; +import { IEditorGroupsService, IEditorGroup } from '../../../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { IExtUri } from '../../../../base/common/resources.js'; +import { IDisposable, MutableDisposable } from '../../../../base/common/lifecycle.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; /** * Base class of editors that want to store and restore view state. diff --git a/src/vs/workbench/browser/parts/editor/editorsObserver.ts b/src/vs/workbench/browser/parts/editor/editorsObserver.ts index ac30da415d2..19dd4c3b511 100644 --- a/src/vs/workbench/browser/parts/editor/editorsObserver.ts +++ b/src/vs/workbench/browser/parts/editor/editorsObserver.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IEditorFactoryRegistry, IEditorIdentifier, GroupIdentifier, EditorExtensions, IEditorPartOptionsChangeEvent, EditorsOrder, GroupModelChangeKind, EditorInputCapabilities } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput'; -import { dispose, Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { Event, Emitter } from 'vs/base/common/event'; -import { IEditorGroupsService, IEditorGroup, GroupsOrder, IEditorGroupsContainer } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { coalesce } from 'vs/base/common/arrays'; -import { LinkedMap, Touch, ResourceMap } from 'vs/base/common/map'; -import { equals } from 'vs/base/common/objects'; -import { IResourceEditorInputIdentifier } from 'vs/platform/editor/common/editor'; -import { URI } from 'vs/base/common/uri'; +import { IEditorFactoryRegistry, IEditorIdentifier, GroupIdentifier, EditorExtensions, IEditorPartOptionsChangeEvent, EditorsOrder, GroupModelChangeKind, EditorInputCapabilities } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { SideBySideEditorInput } from '../../../common/editor/sideBySideEditorInput.js'; +import { dispose, Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { Event, Emitter } from '../../../../base/common/event.js'; +import { IEditorGroupsService, IEditorGroup, GroupsOrder, IEditorGroupsContainer } from '../../../services/editor/common/editorGroupsService.js'; +import { coalesce } from '../../../../base/common/arrays.js'; +import { LinkedMap, Touch, ResourceMap } from '../../../../base/common/map.js'; +import { equals } from '../../../../base/common/objects.js'; +import { IResourceEditorInputIdentifier } from '../../../../platform/editor/common/editor.js'; +import { URI } from '../../../../base/common/uri.js'; interface ISerializedEditorsList { entries: ISerializedEditorIdentifier[]; diff --git a/src/vs/workbench/browser/parts/editor/media/editorplaceholder.css b/src/vs/workbench/browser/parts/editor/media/editorplaceholder.css index d4db8eaff00..4861d184353 100644 --- a/src/vs/workbench/browser/parts/editor/media/editorplaceholder.css +++ b/src/vs/workbench/browser/parts/editor/media/editorplaceholder.css @@ -18,7 +18,7 @@ } .monaco-editor-pane-placeholder .editor-placeholder-icon-container .codicon { - font-size: 48px; + font-size: 48px !important; } .monaco-editor-pane-placeholder .editor-placeholder-icon-container .codicon.codicon-error { diff --git a/src/vs/workbench/browser/parts/editor/media/editortabscontrol.css b/src/vs/workbench/browser/parts/editor/media/editortabscontrol.css index 24de0a1f384..eb4033f6095 100644 --- a/src/vs/workbench/browser/parts/editor/media/editortabscontrol.css +++ b/src/vs/workbench/browser/parts/editor/media/editortabscontrol.css @@ -11,10 +11,14 @@ .monaco-workbench .part.editor > .content .editor-group-container > .title .title-label, .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab .tab-label { - white-space: nowrap; flex: 1; } +.monaco-workbench .part.editor > .content .editor-group-container > .title .title-label .label-name, +.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab .tab-label .label-name { + white-space: nowrap; +} + .monaco-workbench .part.editor > .content .editor-group-container > .title .title-label a, .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab .tab-label a { font-size: 13px; diff --git a/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts b/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts index 46f53b0343f..18400237f4e 100644 --- a/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts +++ b/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts @@ -3,61 +3,61 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/multieditortabscontrol'; -import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; -import { shorten } from 'vs/base/common/labels'; -import { EditorResourceAccessor, Verbosity, IEditorPartOptions, SideBySideEditor, DEFAULT_EDITOR_ASSOCIATION, EditorInputCapabilities, IUntypedEditorInput, preventEditorClose, EditorCloseMethod, EditorsOrder, IToolbarActions } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { computeEditorAriaLabel } from 'vs/workbench/browser/editor'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { EventType as TouchEventType, GestureEvent, Gesture } from 'vs/base/browser/touch'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { ResourceLabels, IResourceLabel, DEFAULT_LABELS_CONTAINER } from 'vs/workbench/browser/labels'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { EditorCommandsContextActionRunner, EditorTabsControl } from 'vs/workbench/browser/parts/editor/editorTabsControl'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { IDisposable, dispose, DisposableStore, combinedDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; -import { ScrollbarVisibility } from 'vs/base/common/scrollable'; -import { getOrSet } from 'vs/base/common/map'; -import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, TAB_UNFOCUSED_ACTIVE_BACKGROUND, TAB_UNFOCUSED_ACTIVE_BORDER, TAB_ACTIVE_BORDER, TAB_HOVER_BACKGROUND, TAB_HOVER_BORDER, TAB_UNFOCUSED_HOVER_BACKGROUND, TAB_UNFOCUSED_HOVER_BORDER, EDITOR_GROUP_HEADER_TABS_BACKGROUND, WORKBENCH_BACKGROUND, TAB_ACTIVE_BORDER_TOP, TAB_UNFOCUSED_ACTIVE_BORDER_TOP, TAB_ACTIVE_MODIFIED_BORDER, TAB_INACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_INACTIVE_BACKGROUND, TAB_HOVER_FOREGROUND, TAB_UNFOCUSED_HOVER_FOREGROUND, TAB_LAST_PINNED_BORDER, TAB_SELECTED_BORDER_TOP, PANEL_BORDER } from 'vs/workbench/common/theme'; -import { activeContrastBorder, contrastBorder, editorBackground, listActiveSelectionBackground, listActiveSelectionForeground } from 'vs/platform/theme/common/colorRegistry'; -import { ResourcesDropHandler, DraggedEditorIdentifier, DraggedEditorGroupIdentifier, extractTreeDropData, isWindowDraggedOver } from 'vs/workbench/browser/dnd'; -import { Color } from 'vs/base/common/color'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { MergeGroupMode, IMergeGroupOptions } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { addDisposableListener, EventType, EventHelper, Dimension, scheduleAtNextAnimationFrame, findParentWithClass, clearNode, DragAndDropObserver, isMouseEvent, getWindow } from 'vs/base/browser/dom'; -import { localize } from 'vs/nls'; -import { IEditorGroupsView, EditorServiceImpl, IEditorGroupView, IInternalEditorOpenOptions, IEditorPartsView } from 'vs/workbench/browser/parts/editor/editor'; -import { CloseEditorTabAction, UnpinEditorAction } from 'vs/workbench/browser/parts/editor/editorActions'; -import { assertAllDefined, assertIsDefined } from 'vs/base/common/types'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { basenameOrAuthority } from 'vs/base/common/resources'; -import { RunOnceScheduler } from 'vs/base/common/async'; -import { IPathService } from 'vs/workbench/services/path/common/pathService'; -import { IPath, win32, posix } from 'vs/base/common/path'; -import { coalesce, insert } from 'vs/base/common/arrays'; -import { isHighContrast } from 'vs/platform/theme/common/theme'; -import { isSafari } from 'vs/base/browser/browser'; -import { equals } from 'vs/base/common/objects'; -import { EditorActivation, IEditorOptions } from 'vs/platform/editor/common/editor'; -import { UNLOCK_GROUP_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { ITreeViewsDnDService } from 'vs/editor/common/services/treeViewsDndService'; -import { DraggedTreeItemsIdentifier } from 'vs/editor/common/services/treeViewsDnd'; -import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService'; -import { IEditorTitleControlDimensions } from 'vs/workbench/browser/parts/editor/editorTitleControl'; -import { StickyEditorGroupModel, UnstickyEditorGroupModel } from 'vs/workbench/common/editor/filteredEditorGroupModel'; -import { IReadonlyEditorGroupModel } from 'vs/workbench/common/editor/editorGroupModel'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { BugIndicatingError } from 'vs/base/common/errors'; -import { applyDragImage } from 'vs/base/browser/dnd'; +import './media/multieditortabscontrol.css'; +import { isLinux, isMacintosh, isWindows } from '../../../../base/common/platform.js'; +import { shorten } from '../../../../base/common/labels.js'; +import { EditorResourceAccessor, Verbosity, IEditorPartOptions, SideBySideEditor, DEFAULT_EDITOR_ASSOCIATION, EditorInputCapabilities, IUntypedEditorInput, preventEditorClose, EditorCloseMethod, EditorsOrder, IToolbarActions } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { computeEditorAriaLabel } from '../../editor.js'; +import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import { EventType as TouchEventType, GestureEvent, Gesture } from '../../../../base/browser/touch.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { ResourceLabels, IResourceLabel, DEFAULT_LABELS_CONTAINER } from '../../labels.js'; +import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { MenuId } from '../../../../platform/actions/common/actions.js'; +import { EditorCommandsContextActionRunner, EditorTabsControl } from './editorTabsControl.js'; +import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; +import { IDisposable, dispose, DisposableStore, combinedDisposable, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { ScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js'; +import { ScrollbarVisibility } from '../../../../base/common/scrollable.js'; +import { getOrSet } from '../../../../base/common/map.js'; +import { IThemeService, registerThemingParticipant } from '../../../../platform/theme/common/themeService.js'; +import { TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, TAB_UNFOCUSED_ACTIVE_BACKGROUND, TAB_UNFOCUSED_ACTIVE_BORDER, TAB_ACTIVE_BORDER, TAB_HOVER_BACKGROUND, TAB_HOVER_BORDER, TAB_UNFOCUSED_HOVER_BACKGROUND, TAB_UNFOCUSED_HOVER_BORDER, EDITOR_GROUP_HEADER_TABS_BACKGROUND, WORKBENCH_BACKGROUND, TAB_ACTIVE_BORDER_TOP, TAB_UNFOCUSED_ACTIVE_BORDER_TOP, TAB_ACTIVE_MODIFIED_BORDER, TAB_INACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_INACTIVE_BACKGROUND, TAB_HOVER_FOREGROUND, TAB_UNFOCUSED_HOVER_FOREGROUND, TAB_LAST_PINNED_BORDER, TAB_SELECTED_BORDER_TOP, PANEL_BORDER } from '../../../common/theme.js'; +import { activeContrastBorder, contrastBorder, editorBackground, listActiveSelectionBackground, listActiveSelectionForeground } from '../../../../platform/theme/common/colorRegistry.js'; +import { ResourcesDropHandler, DraggedEditorIdentifier, DraggedEditorGroupIdentifier, extractTreeDropData, isWindowDraggedOver } from '../../dnd.js'; +import { Color } from '../../../../base/common/color.js'; +import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { MergeGroupMode, IMergeGroupOptions } from '../../../services/editor/common/editorGroupsService.js'; +import { addDisposableListener, EventType, EventHelper, Dimension, scheduleAtNextAnimationFrame, findParentWithClass, clearNode, DragAndDropObserver, isMouseEvent, getWindow } from '../../../../base/browser/dom.js'; +import { localize } from '../../../../nls.js'; +import { IEditorGroupsView, EditorServiceImpl, IEditorGroupView, IInternalEditorOpenOptions, IEditorPartsView } from './editor.js'; +import { CloseEditorTabAction, UnpinEditorAction } from './editorActions.js'; +import { assertAllDefined, assertIsDefined } from '../../../../base/common/types.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { basenameOrAuthority } from '../../../../base/common/resources.js'; +import { RunOnceScheduler } from '../../../../base/common/async.js'; +import { IPathService } from '../../../services/path/common/pathService.js'; +import { IPath, win32, posix } from '../../../../base/common/path.js'; +import { coalesce, insert } from '../../../../base/common/arrays.js'; +import { isHighContrast } from '../../../../platform/theme/common/theme.js'; +import { isSafari } from '../../../../base/browser/browser.js'; +import { equals } from '../../../../base/common/objects.js'; +import { EditorActivation, IEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { UNLOCK_GROUP_COMMAND_ID } from './editorCommands.js'; +import { StandardMouseEvent } from '../../../../base/browser/mouseEvent.js'; +import { ITreeViewsDnDService } from '../../../../editor/common/services/treeViewsDndService.js'; +import { DraggedTreeItemsIdentifier } from '../../../../editor/common/services/treeViewsDnd.js'; +import { IEditorResolverService } from '../../../services/editor/common/editorResolverService.js'; +import { IEditorTitleControlDimensions } from './editorTitleControl.js'; +import { StickyEditorGroupModel, UnstickyEditorGroupModel } from '../../../common/editor/filteredEditorGroupModel.js'; +import { IReadonlyEditorGroupModel } from '../../../common/editor/editorGroupModel.js'; +import { IHostService } from '../../../services/host/browser/host.js'; +import { BugIndicatingError } from '../../../../base/common/errors.js'; +import { applyDragImage } from '../../../../base/browser/dnd.js'; interface IEditorInputLabel { readonly editor: EditorInput; @@ -1093,7 +1093,7 @@ export class MultiEditorTabsControl extends EditorTabsControl { } // Apply some datatransfer types to allow for dragging the element outside of the application - this.doFillResourceDataTransfers([editor], e, isNewWindowOperation); + this.doFillResourceDataTransfers(selectedEditors, e, isNewWindowOperation); scheduleAtNextAnimationFrame(getWindow(this.parent), () => this.updateDropFeedback(tab, false, e, tabIndex)); }, @@ -1288,24 +1288,24 @@ export class MultiEditorTabsControl extends EditorTabsControl { throw new BugIndicatingError(); } - const anchorIndex = this.groupView.getIndexOfEditor(anchor); - if (anchorIndex === -1) { + const anchorEditorIndex = this.groupView.getIndexOfEditor(anchor); + if (anchorEditorIndex === -1) { throw new BugIndicatingError(); } let selection = this.groupView.selectedEditors; // Unselect editors on other side of anchor in relation to the target - let currentIndex = anchorIndex; - while (currentIndex >= 0 && currentIndex <= this.groupView.count - 1) { - currentIndex = anchorIndex < editorIndex ? currentIndex - 1 : currentIndex + 1; + let currentEditorIndex = anchorEditorIndex; + while (currentEditorIndex >= 0 && currentEditorIndex <= this.groupView.count - 1) { + currentEditorIndex = anchorEditorIndex < editorIndex ? currentEditorIndex - 1 : currentEditorIndex + 1; - if (!this.tabsModel.isSelected(currentIndex)) { + const currentEditor = this.groupView.getEditorByIndex(currentEditorIndex); + if (!currentEditor) { break; } - const currentEditor = this.groupView.getEditorByIndex(currentIndex); - if (!currentEditor) { + if (!this.groupView.isSelected(currentEditor)) { break; } @@ -1313,12 +1313,12 @@ export class MultiEditorTabsControl extends EditorTabsControl { } // Select editors between anchor and target - const fromIndex = anchorIndex < editorIndex ? anchorIndex : editorIndex; - const toIndex = anchorIndex < editorIndex ? editorIndex : anchorIndex; + const fromEditorIndex = anchorEditorIndex < editorIndex ? anchorEditorIndex : editorIndex; + const toEditorIndex = anchorEditorIndex < editorIndex ? editorIndex : anchorEditorIndex; - const editorsToSelect = this.groupView.getEditors(EditorsOrder.SEQUENTIAL).slice(fromIndex, toIndex + 1); + const editorsToSelect = this.groupView.getEditors(EditorsOrder.SEQUENTIAL).slice(fromEditorIndex, toEditorIndex + 1); for (const editor of editorsToSelect) { - if (!this.tabsModel.isSelected(editor)) { + if (!this.groupView.isSelected(editor)) { selection.push(editor); } } @@ -1343,7 +1343,7 @@ export class MultiEditorTabsControl extends EditorTabsControl { const recentEditors = this.groupView.getEditors(EditorsOrder.MOST_RECENTLY_ACTIVE); for (let i = 1; i < recentEditors.length; i++) { // First one is the active editor const recentEditor = recentEditors[i]; - if (this.tabsModel.isSelected(recentEditor)) { + if (this.groupView.isSelected(recentEditor)) { newActiveEditor = recentEditor; break; } diff --git a/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.ts b/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.ts index 83823d3ec8f..d4d58f1ef55 100644 --- a/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.ts +++ b/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.ts @@ -3,23 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Dimension } from 'vs/base/browser/dom'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IEditorGroupsView, IEditorGroupView, IEditorPartsView, IInternalEditorOpenOptions } from 'vs/workbench/browser/parts/editor/editor'; -import { IEditorTabsControl } from 'vs/workbench/browser/parts/editor/editorTabsControl'; -import { MultiEditorTabsControl } from 'vs/workbench/browser/parts/editor/multiEditorTabsControl'; -import { IEditorPartOptions } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { StickyEditorGroupModel, UnstickyEditorGroupModel } from 'vs/workbench/common/editor/filteredEditorGroupModel'; -import { IEditorTitleControlDimensions } from 'vs/workbench/browser/parts/editor/editorTitleControl'; -import { IReadonlyEditorGroupModel } from 'vs/workbench/common/editor/editorGroupModel'; +import { Dimension } from '../../../../base/browser/dom.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IEditorGroupsView, IEditorGroupView, IEditorPartsView, IInternalEditorOpenOptions } from './editor.js'; +import { IEditorTabsControl } from './editorTabsControl.js'; +import { MultiEditorTabsControl } from './multiEditorTabsControl.js'; +import { IEditorPartOptions } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { StickyEditorGroupModel, UnstickyEditorGroupModel } from '../../../common/editor/filteredEditorGroupModel.js'; +import { IEditorTitleControlDimensions } from './editorTitleControl.js'; +import { IReadonlyEditorGroupModel } from '../../../common/editor/editorGroupModel.js'; export class MultiRowEditorControl extends Disposable implements IEditorTabsControl { private readonly stickyEditorTabsControl: IEditorTabsControl; private readonly unstickyEditorTabsControl: IEditorTabsControl; + private activeControl: IEditorTabsControl | undefined; + constructor( private readonly parent: HTMLElement, editorPartsView: IEditorPartsView, @@ -36,10 +38,15 @@ export class MultiRowEditorControl extends Disposable implements IEditorTabsCont this.stickyEditorTabsControl = this._register(this.instantiationService.createInstance(MultiEditorTabsControl, this.parent, editorPartsView, this.groupsView, this.groupView, stickyModel)); this.unstickyEditorTabsControl = this._register(this.instantiationService.createInstance(MultiEditorTabsControl, this.parent, editorPartsView, this.groupsView, this.groupView, unstickyModel)); - this.handlePinnedTabsLayoutChange(); + this.handleTabBarsStateChange(); + } + + private handleTabBarsStateChange(): void { + this.activeControl = this.model.activeEditor ? this.getEditorTabsController(this.model.activeEditor) : undefined; + this.handleTabBarsLayoutChange(); } - private handlePinnedTabsLayoutChange(): void { + private handleTabBarsLayoutChange(): void { if (this.groupView.count === 0) { // Do nothing as no tab bar is visible return; @@ -56,17 +63,20 @@ export class MultiRowEditorControl extends Disposable implements IEditorTabsCont } } + private didActiveControlChange() { + return this.activeControl !== (this.model.activeEditor ? this.getEditorTabsController(this.model.activeEditor) : undefined); + } + private getEditorTabsController(editor: EditorInput): IEditorTabsControl { return this.model.isSticky(editor) ? this.stickyEditorTabsControl : this.unstickyEditorTabsControl; } openEditor(editor: EditorInput, options: IInternalEditorOpenOptions): boolean { - const [editorTabController, otherTabController] = this.model.isSticky(editor) ? [this.stickyEditorTabsControl, this.unstickyEditorTabsControl] : [this.unstickyEditorTabsControl, this.stickyEditorTabsControl]; - const didChange = editorTabController.openEditor(editor, options); - if (didChange) { - // HACK: To render all editor tabs on startup, otherwise only one row gets rendered - otherTabController.openEditors([]); + const didActiveControlChange = this.didActiveControlChange(); + const didOpenEditorChange = this.getEditorTabsController(editor).openEditor(editor, options); + const didChange = didOpenEditorChange || didActiveControlChange; + if (didChange) { this.handleOpenedEditors(); } return didChange; @@ -76,11 +86,11 @@ export class MultiRowEditorControl extends Disposable implements IEditorTabsCont const stickyEditors = editors.filter(e => this.model.isSticky(e)); const unstickyEditors = editors.filter(e => !this.model.isSticky(e)); + const didActiveControlChange = this.didActiveControlChange(); const didChangeOpenEditorsSticky = this.stickyEditorTabsControl.openEditors(stickyEditors); const didChangeOpenEditorsUnSticky = this.unstickyEditorTabsControl.openEditors(unstickyEditors); - const didChange = didChangeOpenEditorsSticky || didChangeOpenEditorsUnSticky; - + const didChange = didChangeOpenEditorsSticky || didChangeOpenEditorsUnSticky || didActiveControlChange; if (didChange) { this.handleOpenedEditors(); } @@ -89,7 +99,7 @@ export class MultiRowEditorControl extends Disposable implements IEditorTabsCont } private handleOpenedEditors(): void { - this.handlePinnedTabsLayoutChange(); + this.handleTabBarsStateChange(); } beforeCloseEditor(editor: EditorInput): void { @@ -115,7 +125,7 @@ export class MultiRowEditorControl extends Disposable implements IEditorTabsCont } private handleClosedEditors(): void { - this.handlePinnedTabsLayoutChange(); + this.handleTabBarsStateChange(); } moveEditor(editor: EditorInput, fromIndex: number, targetIndex: number, stickyStateChange: boolean): void { @@ -129,7 +139,7 @@ export class MultiRowEditorControl extends Disposable implements IEditorTabsCont this.unstickyEditorTabsControl.openEditor(editor); } - this.handlePinnedTabsLayoutChange(); + this.handleTabBarsStateChange(); } else { if (this.model.isSticky(editor)) { @@ -148,14 +158,14 @@ export class MultiRowEditorControl extends Disposable implements IEditorTabsCont this.unstickyEditorTabsControl.closeEditor(editor); this.stickyEditorTabsControl.openEditor(editor); - this.handlePinnedTabsLayoutChange(); + this.handleTabBarsStateChange(); } unstickEditor(editor: EditorInput): void { this.stickyEditorTabsControl.closeEditor(editor); this.unstickyEditorTabsControl.openEditor(editor); - this.handlePinnedTabsLayoutChange(); + this.handleTabBarsStateChange(); } setActive(isActive: boolean): void { diff --git a/src/vs/workbench/browser/parts/editor/noEditorTabsControl.ts b/src/vs/workbench/browser/parts/editor/noEditorTabsControl.ts index 6a0859cd3ec..af16587fdb0 100644 --- a/src/vs/workbench/browser/parts/editor/noEditorTabsControl.ts +++ b/src/vs/workbench/browser/parts/editor/noEditorTabsControl.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/singleeditortabscontrol'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { EditorTabsControl } from 'vs/workbench/browser/parts/editor/editorTabsControl'; -import { Dimension } from 'vs/base/browser/dom'; -import { IEditorTitleControlDimensions } from 'vs/workbench/browser/parts/editor/editorTitleControl'; -import { IToolbarActions } from 'vs/workbench/common/editor'; +import './media/singleeditortabscontrol.css'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { EditorTabsControl } from './editorTabsControl.js'; +import { Dimension } from '../../../../base/browser/dom.js'; +import { IEditorTitleControlDimensions } from './editorTitleControl.js'; +import { IToolbarActions } from '../../../common/editor.js'; export class NoEditorTabsControl extends EditorTabsControl { private activeEditor: EditorInput | null = null; @@ -47,9 +47,17 @@ export class NoEditorTabsControl extends EditorTabsControl { beforeCloseEditor(editor: EditorInput): void { } - closeEditor(editor: EditorInput): void { } + closeEditor(editor: EditorInput): void { + this.handleClosedEditors(); + } + + closeEditors(editors: EditorInput[]): void { + this.handleClosedEditors(); + } - closeEditors(editors: EditorInput[]): void { } + private handleClosedEditors(): void { + this.activeEditor = this.tabsModel.activeEditor; + } moveEditor(editor: EditorInput, fromIndex: number, targetIndex: number): void { } diff --git a/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts b/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts index 2dab828b50a..b373fd8b051 100644 --- a/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts +++ b/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts @@ -3,35 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/sidebysideeditor'; -import { localize } from 'vs/nls'; -import { Dimension, $, clearNode, multibyteAwareBtoa } from 'vs/base/browser/dom'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IEditorControl, IEditorPane, IEditorOpenContext, EditorExtensions, SIDE_BY_SIDE_EDITOR_ID, SideBySideEditor as Side, IEditorPaneSelection, IEditorPaneWithSelection, IEditorPaneSelectionChangeEvent, isEditorPaneWithSelection, EditorPaneSelectionCompareResult } from 'vs/workbench/common/editor'; -import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IEditorPaneRegistry } from 'vs/workbench/browser/editor'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { SplitView, Sizing, Orientation } from 'vs/base/browser/ui/splitview/splitview'; -import { Event, Relay, Emitter } from 'vs/base/common/event'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { assertIsDefined } from 'vs/base/common/types'; -import { IEditorOptions } from 'vs/platform/editor/common/editor'; -import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { DEFAULT_EDITOR_MIN_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { SIDE_BY_SIDE_EDITOR_HORIZONTAL_BORDER, SIDE_BY_SIDE_EDITOR_VERTICAL_BORDER } from 'vs/workbench/common/theme'; -import { AbstractEditorWithViewState } from 'vs/workbench/browser/parts/editor/editorWithViewState'; -import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { isEqual } from 'vs/base/common/resources'; -import { URI } from 'vs/base/common/uri'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; +import './media/sidebysideeditor.css'; +import { localize } from '../../../../nls.js'; +import { Dimension, $, clearNode, multibyteAwareBtoa } from '../../../../base/browser/dom.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { IEditorControl, IEditorPane, IEditorOpenContext, EditorExtensions, SIDE_BY_SIDE_EDITOR_ID, SideBySideEditor as Side, IEditorPaneSelection, IEditorPaneWithSelection, IEditorPaneSelectionChangeEvent, isEditorPaneWithSelection, EditorPaneSelectionCompareResult } from '../../../common/editor.js'; +import { SideBySideEditorInput } from '../../../common/editor/sideBySideEditorInput.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { EditorPane } from './editorPane.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { IEditorPaneRegistry } from '../../editor.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { IEditorGroup, IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; +import { SplitView, Sizing, Orientation } from '../../../../base/browser/ui/splitview/splitview.js'; +import { Event, Relay, Emitter } from '../../../../base/common/event.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { assertIsDefined } from '../../../../base/common/types.js'; +import { IEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { IConfigurationChangeEvent, IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; +import { DEFAULT_EDITOR_MIN_DIMENSIONS } from './editor.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { SIDE_BY_SIDE_EDITOR_HORIZONTAL_BORDER, SIDE_BY_SIDE_EDITOR_VERTICAL_BORDER } from '../../../common/theme.js'; +import { AbstractEditorWithViewState } from './editorWithViewState.js'; +import { ITextResourceConfigurationService } from '../../../../editor/common/services/textResourceConfiguration.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { isEqual } from '../../../../base/common/resources.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IBoundarySashes } from '../../../../base/browser/ui/sash/sash.js'; interface ISideBySideEditorViewState { primary: object; diff --git a/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.ts b/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.ts index cfbf35f736a..57ee640af7d 100644 --- a/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.ts +++ b/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/singleeditortabscontrol'; -import { EditorResourceAccessor, Verbosity, IEditorPartOptions, SideBySideEditor, preventEditorClose, EditorCloseMethod, IToolbarActions } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { EditorTabsControl } from 'vs/workbench/browser/parts/editor/editorTabsControl'; -import { ResourceLabel, IResourceLabel } from 'vs/workbench/browser/labels'; -import { TAB_ACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND } from 'vs/workbench/common/theme'; -import { EventType as TouchEventType, GestureEvent, Gesture } from 'vs/base/browser/touch'; -import { addDisposableListener, EventType, EventHelper, Dimension, isAncestor, DragAndDropObserver, isHTMLElement } from 'vs/base/browser/dom'; -import { CLOSE_EDITOR_COMMAND_ID, UNLOCK_GROUP_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands'; -import { Color } from 'vs/base/common/color'; -import { assertIsDefined, assertAllDefined } from 'vs/base/common/types'; -import { equals } from 'vs/base/common/objects'; -import { toDisposable } from 'vs/base/common/lifecycle'; -import { defaultBreadcrumbsWidgetStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { IEditorTitleControlDimensions } from 'vs/workbench/browser/parts/editor/editorTitleControl'; -import { BreadcrumbsControlFactory } from 'vs/workbench/browser/parts/editor/breadcrumbsControl'; +import './media/singleeditortabscontrol.css'; +import { EditorResourceAccessor, Verbosity, IEditorPartOptions, SideBySideEditor, preventEditorClose, EditorCloseMethod, IToolbarActions } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { EditorTabsControl } from './editorTabsControl.js'; +import { ResourceLabel, IResourceLabel } from '../../labels.js'; +import { TAB_ACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND } from '../../../common/theme.js'; +import { EventType as TouchEventType, GestureEvent, Gesture } from '../../../../base/browser/touch.js'; +import { addDisposableListener, EventType, EventHelper, Dimension, isAncestor, DragAndDropObserver, isHTMLElement } from '../../../../base/browser/dom.js'; +import { CLOSE_EDITOR_COMMAND_ID, UNLOCK_GROUP_COMMAND_ID } from './editorCommands.js'; +import { Color } from '../../../../base/common/color.js'; +import { assertIsDefined, assertAllDefined } from '../../../../base/common/types.js'; +import { equals } from '../../../../base/common/objects.js'; +import { toDisposable } from '../../../../base/common/lifecycle.js'; +import { defaultBreadcrumbsWidgetStyles } from '../../../../platform/theme/browser/defaultStyles.js'; +import { IEditorTitleControlDimensions } from './editorTitleControl.js'; +import { BreadcrumbsControlFactory } from './breadcrumbsControl.js'; interface IRenderedEditorLabel { readonly editor?: EditorInput; diff --git a/src/vs/workbench/browser/parts/editor/textCodeEditor.ts b/src/vs/workbench/browser/parts/editor/textCodeEditor.ts index c3846b6faf2..e7ace5f1af3 100644 --- a/src/vs/workbench/browser/parts/editor/textCodeEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textCodeEditor.ts @@ -3,20 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { URI } from 'vs/base/common/uri'; -import { assertIsDefined } from 'vs/base/common/types'; -import { ITextEditorPane } from 'vs/workbench/common/editor'; -import { applyTextEditorOptions } from 'vs/workbench/common/editor/editorOptions'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; -import { isEqual } from 'vs/base/common/resources'; -import { IEditorOptions as ICodeEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { CodeEditorWidget, ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget'; -import { IEditorViewState, ScrollType } from 'vs/editor/common/editorCommon'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { AbstractTextEditor } from 'vs/workbench/browser/parts/editor/textEditor'; -import { Dimension } from 'vs/base/browser/dom'; +import { localize } from '../../../../nls.js'; +import { URI } from '../../../../base/common/uri.js'; +import { assertIsDefined } from '../../../../base/common/types.js'; +import { ITextEditorPane } from '../../../common/editor.js'; +import { applyTextEditorOptions } from '../../../common/editor/editorOptions.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { ITextEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { isEqual } from '../../../../base/common/resources.js'; +import { IEditorOptions as ICodeEditorOptions } from '../../../../editor/common/config/editorOptions.js'; +import { CodeEditorWidget, ICodeEditorWidgetOptions } from '../../../../editor/browser/widget/codeEditor/codeEditorWidget.js'; +import { IEditorViewState, ScrollType } from '../../../../editor/common/editorCommon.js'; +import { ICodeEditor } from '../../../../editor/browser/editorBrowser.js'; +import { AbstractTextEditor } from './textEditor.js'; +import { Dimension } from '../../../../base/browser/dom.js'; /** * A text editor using the code editor widget. diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index 5743ac16f7a..63b7b0d6f70 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -3,38 +3,38 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { deepClone } from 'vs/base/common/objects'; -import { isObject, assertIsDefined } from 'vs/base/common/types'; -import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { IDiffEditorOptions, IEditorOptions as ICodeEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { AbstractTextEditor, IEditorConfiguration } from 'vs/workbench/browser/parts/editor/textEditor'; -import { TEXT_DIFF_EDITOR_ID, IEditorFactoryRegistry, EditorExtensions, ITextDiffEditorPane, IEditorOpenContext, isEditorInput, isTextEditorViewState, createTooLargeFileError } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { applyTextEditorOptions } from 'vs/workbench/common/editor/editorOptions'; -import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; -import { TextDiffEditorModel } from 'vs/workbench/common/editor/textDiffEditorModel'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITextResourceConfigurationChangeEvent, ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { TextFileOperationError, TextFileOperationResult } from 'vs/workbench/services/textfile/common/textfiles'; -import { ScrollType, IDiffEditorViewState, IDiffEditorModel, IDiffEditorViewModel } from 'vs/editor/common/editorCommon'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { URI } from 'vs/base/common/uri'; -import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { EditorActivation, ITextEditorOptions } from 'vs/platform/editor/common/editor'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { isEqual } from 'vs/base/common/resources'; -import { Dimension, multibyteAwareBtoa } from 'vs/base/browser/dom'; -import { ByteSize, FileOperationError, FileOperationResult, IFileService, TooLargeFileOperationError } from 'vs/platform/files/common/files'; -import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash'; -import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; -import { StopWatch } from 'vs/base/common/stopwatch'; -import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget'; +import { localize } from '../../../../nls.js'; +import { deepClone } from '../../../../base/common/objects.js'; +import { isObject, assertIsDefined } from '../../../../base/common/types.js'; +import { ICodeEditor, IDiffEditor } from '../../../../editor/browser/editorBrowser.js'; +import { IDiffEditorOptions, IEditorOptions as ICodeEditorOptions } from '../../../../editor/common/config/editorOptions.js'; +import { AbstractTextEditor, IEditorConfiguration } from './textEditor.js'; +import { TEXT_DIFF_EDITOR_ID, IEditorFactoryRegistry, EditorExtensions, ITextDiffEditorPane, IEditorOpenContext, isEditorInput, isTextEditorViewState, createTooLargeFileError } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { applyTextEditorOptions } from '../../../common/editor/editorOptions.js'; +import { DiffEditorInput } from '../../../common/editor/diffEditorInput.js'; +import { TextDiffEditorModel } from '../../../common/editor/textDiffEditorModel.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { ITextResourceConfigurationChangeEvent, ITextResourceConfigurationService } from '../../../../editor/common/services/textResourceConfiguration.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { TextFileOperationError, TextFileOperationResult } from '../../../services/textfile/common/textfiles.js'; +import { ScrollType, IDiffEditorViewState, IDiffEditorModel, IDiffEditorViewModel } from '../../../../editor/common/editorCommon.js'; +import { Registry } from '../../../../platform/registry/common/platform.js'; +import { URI } from '../../../../base/common/uri.js'; +import { IEditorGroup, IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { EditorActivation, ITextEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { isEqual } from '../../../../base/common/resources.js'; +import { Dimension, multibyteAwareBtoa } from '../../../../base/browser/dom.js'; +import { ByteSize, FileOperationError, FileOperationResult, IFileService, TooLargeFileOperationError } from '../../../../platform/files/common/files.js'; +import { IBoundarySashes } from '../../../../base/browser/ui/sash/sash.js'; +import { IPreferencesService } from '../../../services/preferences/common/preferences.js'; +import { StopWatch } from '../../../../base/common/stopwatch.js'; +import { DiffEditorWidget } from '../../../../editor/browser/widget/diffEditor/diffEditorWidget.js'; /** * The text editor that leverages the diff text editor for the editing experience. diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index 629d430bbec..e0a45755595 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -3,32 +3,32 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { URI } from 'vs/base/common/uri'; -import { distinct, deepClone } from 'vs/base/common/objects'; -import { Emitter, Event } from 'vs/base/common/event'; -import { isObject, assertIsDefined } from 'vs/base/common/types'; -import { MutableDisposable } from 'vs/base/common/lifecycle'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IEditorOpenContext, IEditorPaneSelection, EditorPaneSelectionCompareResult, EditorPaneSelectionChangeReason, IEditorPaneWithSelection, IEditorPaneSelectionChangeEvent, IEditorPaneScrollPosition, IEditorPaneWithScrolling } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { computeEditorAriaLabel } from 'vs/workbench/browser/editor'; -import { AbstractEditorWithViewState } from 'vs/workbench/browser/parts/editor/editorWithViewState'; -import { IEditorViewState } from 'vs/editor/common/editorCommon'; -import { Selection } from 'vs/editor/common/core/selection'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ITextResourceConfigurationChangeEvent, ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { IEditorOptions as ICodeEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IEditorOptions, ITextEditorOptions, TextEditorSelectionRevealType, TextEditorSelectionSource } from 'vs/platform/editor/common/editor'; -import { ICursorPositionChangedEvent } from 'vs/editor/common/cursorEvents'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IMarkdownString } from 'vs/base/common/htmlContent'; +import { localize } from '../../../../nls.js'; +import { URI } from '../../../../base/common/uri.js'; +import { distinct, deepClone } from '../../../../base/common/objects.js'; +import { Emitter, Event } from '../../../../base/common/event.js'; +import { isObject, assertIsDefined } from '../../../../base/common/types.js'; +import { MutableDisposable } from '../../../../base/common/lifecycle.js'; +import { ICodeEditor } from '../../../../editor/browser/editorBrowser.js'; +import { IEditorOpenContext, IEditorPaneSelection, EditorPaneSelectionCompareResult, EditorPaneSelectionChangeReason, IEditorPaneWithSelection, IEditorPaneSelectionChangeEvent, IEditorPaneScrollPosition, IEditorPaneWithScrolling } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { computeEditorAriaLabel } from '../../editor.js'; +import { AbstractEditorWithViewState } from './editorWithViewState.js'; +import { IEditorViewState } from '../../../../editor/common/editorCommon.js'; +import { Selection } from '../../../../editor/common/core/selection.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { ITextResourceConfigurationChangeEvent, ITextResourceConfigurationService } from '../../../../editor/common/services/textResourceConfiguration.js'; +import { IEditorOptions as ICodeEditorOptions } from '../../../../editor/common/config/editorOptions.js'; +import { IEditorGroup, IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { IEditorOptions, ITextEditorOptions, TextEditorSelectionRevealType, TextEditorSelectionSource } from '../../../../platform/editor/common/editor.js'; +import { ICursorPositionChangedEvent } from '../../../../editor/common/cursorEvents.js'; +import { IFileService } from '../../../../platform/files/common/files.js'; +import { IMarkdownString } from '../../../../base/common/htmlContent.js'; export interface IEditorConfiguration { editor: object; diff --git a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts index 0a3b885e01d..f828e558722 100644 --- a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts @@ -3,31 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { assertIsDefined } from 'vs/base/common/types'; -import { ICodeEditor, IPasteEvent } from 'vs/editor/browser/editorBrowser'; -import { IEditorOpenContext, isTextEditorViewState } from 'vs/workbench/common/editor'; -import { EditorInput } from 'vs/workbench/common/editor/editorInput'; -import { applyTextEditorOptions } from 'vs/workbench/common/editor/editorOptions'; -import { AbstractTextResourceEditorInput, TextResourceEditorInput } from 'vs/workbench/common/editor/textResourceEditorInput'; -import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; -import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput'; -import { AbstractTextCodeEditor } from 'vs/workbench/browser/parts/editor/textCodeEditor'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ScrollType, ICodeEditorViewState } from 'vs/editor/common/editorCommon'; -import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IModelService } from 'vs/editor/common/services/model'; -import { ILanguageService } from 'vs/editor/common/languages/language'; -import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry'; -import { EditorOption, IEditorOptions as ICodeEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { ModelConstants } from 'vs/editor/common/model'; -import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; -import { IFileService } from 'vs/platform/files/common/files'; +import { assertIsDefined } from '../../../../base/common/types.js'; +import { ICodeEditor, IPasteEvent } from '../../../../editor/browser/editorBrowser.js'; +import { IEditorOpenContext, isTextEditorViewState } from '../../../common/editor.js'; +import { EditorInput } from '../../../common/editor/editorInput.js'; +import { applyTextEditorOptions } from '../../../common/editor/editorOptions.js'; +import { AbstractTextResourceEditorInput, TextResourceEditorInput } from '../../../common/editor/textResourceEditorInput.js'; +import { BaseTextEditorModel } from '../../../common/editor/textEditorModel.js'; +import { UntitledTextEditorInput } from '../../../services/untitled/common/untitledTextEditorInput.js'; +import { AbstractTextCodeEditor } from './textCodeEditor.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { IStorageService } from '../../../../platform/storage/common/storage.js'; +import { ITextResourceConfigurationService } from '../../../../editor/common/services/textResourceConfiguration.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +import { ScrollType, ICodeEditorViewState } from '../../../../editor/common/editorCommon.js'; +import { IEditorGroup, IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; +import { CancellationToken } from '../../../../base/common/cancellation.js'; +import { IEditorService } from '../../../services/editor/common/editorService.js'; +import { IModelService } from '../../../../editor/common/services/model.js'; +import { ILanguageService } from '../../../../editor/common/languages/language.js'; +import { PLAINTEXT_LANGUAGE_ID } from '../../../../editor/common/languages/modesRegistry.js'; +import { EditorOption, IEditorOptions as ICodeEditorOptions } from '../../../../editor/common/config/editorOptions.js'; +import { ModelConstants } from '../../../../editor/common/model.js'; +import { ITextEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { IFileService } from '../../../../platform/files/common/files.js'; /** * An editor implementation that is capable of showing the contents of resource inputs. Uses diff --git a/src/vs/workbench/browser/parts/globalCompositeBar.ts b/src/vs/workbench/browser/parts/globalCompositeBar.ts index 533fbd07508..8c96ab3e461 100644 --- a/src/vs/workbench/browser/parts/globalCompositeBar.ts +++ b/src/vs/workbench/browser/parts/globalCompositeBar.ts @@ -3,47 +3,47 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { ActionBar, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; -import { ACCOUNTS_ACTIVITY_ID, GLOBAL_ACTIVITY_ID } from 'vs/workbench/common/activity'; -import { IActivity, IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { DisposableStore, Disposable } from 'vs/base/common/lifecycle'; -import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { CompositeBarActionViewItem, CompositeBarAction, IActivityHoverOptions, ICompositeBarActionViewItemOptions, ICompositeBarColors } from 'vs/workbench/browser/parts/compositeBarActions'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { Action, IAction, Separator, SubmenuAction, toAction } from 'vs/base/common/actions'; -import { IMenu, IMenuService, MenuId } from 'vs/platform/actions/common/actions'; -import { addDisposableListener, EventType, append, clearNode, hide, show, EventHelper, $, runWhenWindowIdle, getWindow } from 'vs/base/browser/dom'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { EventType as TouchEventType, GestureEvent } from 'vs/base/browser/touch'; -import { AnchorAlignment, AnchorAxisAlignment } from 'vs/base/browser/ui/contextview/contextview'; -import { Lazy } from 'vs/base/common/lazy'; -import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { ISecretStorageService } from 'vs/platform/secrets/common/secrets'; -import { AuthenticationSessionInfo, getCurrentAuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService'; -import { AuthenticationSessionAccount, IAuthenticationService } from 'vs/workbench/services/authentication/common/authentication'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; -import { ILifecycleService, LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; -import { DEFAULT_ICON } from 'vs/workbench/services/userDataProfile/common/userDataProfileIcons'; -import { isString } from 'vs/base/common/types'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND } from 'vs/workbench/common/theme'; -import { IBaseActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems'; -import { ICommandService } from 'vs/platform/commands/common/commands'; +import { localize } from '../../../nls.js'; +import { ActionBar, ActionsOrientation } from '../../../base/browser/ui/actionbar/actionbar.js'; +import { ACCOUNTS_ACTIVITY_ID, GLOBAL_ACTIVITY_ID } from '../../common/activity.js'; +import { IActivity, IActivityService, NumberBadge } from '../../services/activity/common/activity.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { DisposableStore, Disposable } from '../../../base/common/lifecycle.js'; +import { IColorTheme, IThemeService } from '../../../platform/theme/common/themeService.js'; +import { IStorageService, StorageScope, StorageTarget } from '../../../platform/storage/common/storage.js'; +import { IExtensionService } from '../../services/extensions/common/extensions.js'; +import { CompositeBarActionViewItem, CompositeBarAction, IActivityHoverOptions, ICompositeBarActionViewItemOptions, ICompositeBarColors } from './compositeBarActions.js'; +import { Codicon } from '../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { registerIcon } from '../../../platform/theme/common/iconRegistry.js'; +import { Action, IAction, Separator, SubmenuAction, toAction } from '../../../base/common/actions.js'; +import { IMenu, IMenuService, MenuId } from '../../../platform/actions/common/actions.js'; +import { addDisposableListener, EventType, append, clearNode, hide, show, EventHelper, $, runWhenWindowIdle, getWindow } from '../../../base/browser/dom.js'; +import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; +import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js'; +import { EventType as TouchEventType, GestureEvent } from '../../../base/browser/touch.js'; +import { AnchorAlignment, AnchorAxisAlignment } from '../../../base/browser/ui/contextview/contextview.js'; +import { Lazy } from '../../../base/common/lazy.js'; +import { createAndFillInActionBarActions } from '../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { IContextKeyService } from '../../../platform/contextkey/common/contextkey.js'; +import { IContextMenuService } from '../../../platform/contextview/browser/contextView.js'; +import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js'; +import { ILogService } from '../../../platform/log/common/log.js'; +import { IProductService } from '../../../platform/product/common/productService.js'; +import { ISecretStorageService } from '../../../platform/secrets/common/secrets.js'; +import { AuthenticationSessionInfo, getCurrentAuthenticationSessionInfo } from '../../services/authentication/browser/authenticationService.js'; +import { AuthenticationSessionAccount, IAuthenticationService } from '../../services/authentication/common/authentication.js'; +import { IWorkbenchEnvironmentService } from '../../services/environment/common/environmentService.js'; +import { IHoverService } from '../../../platform/hover/browser/hover.js'; +import { ILifecycleService, LifecyclePhase } from '../../services/lifecycle/common/lifecycle.js'; +import { IUserDataProfileService } from '../../services/userDataProfile/common/userDataProfile.js'; +import { DEFAULT_ICON } from '../../services/userDataProfile/common/userDataProfileIcons.js'; +import { isString } from '../../../base/common/types.js'; +import { KeyCode } from '../../../base/common/keyCodes.js'; +import { ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND } from '../../common/theme.js'; +import { IBaseActionViewItemOptions } from '../../../base/browser/ui/actionbar/actionViewItems.js'; +import { ICommandService } from '../../../platform/commands/common/commands.js'; export class GlobalCompositeBar extends Disposable { @@ -602,8 +602,7 @@ export class GlobalActivityActionViewItem extends AbstractGlobalActivityActionVi } show(this.profileBadge); - this.profileBadgeContent.classList.toggle('profile-text-overlay', true); - this.profileBadgeContent.classList.toggle('profile-icon-overlay', false); + this.profileBadgeContent.classList.add('profile-text-overlay'); this.profileBadgeContent.textContent = this.userDataProfileService.currentProfile.name.substring(0, 2).toUpperCase(); } diff --git a/src/vs/workbench/browser/parts/media/paneCompositePart.css b/src/vs/workbench/browser/parts/media/paneCompositePart.css index 52baa5324f7..1f2bd9ee9d5 100644 --- a/src/vs/workbench/browser/parts/media/paneCompositePart.css +++ b/src/vs/workbench/browser/parts/media/paneCompositePart.css @@ -73,13 +73,9 @@ .monaco-workbench .pane-composite-part > .title > .composite-bar-container >.composite-bar > .monaco-action-bar .action-item.icon, .monaco-workbench .pane-composite-part > .header-or-footer > .composite-bar-container >.composite-bar > .monaco-action-bar .action-item.icon { height: 35px; /* matches height of composite container */ - padding: 0 5px; + padding: 0 3px; } -.monaco-workbench .pane-composite-part > .title > .composite-bar-container >.composite-bar .monaco-action-bar .action-label.codicon, -.monaco-workbench .pane-composite-part > .header-or-footer > .composite-bar-container >.composite-bar .monaco-action-bar .action-label.codicon { - font-size: 18px; -} .monaco-workbench .pane-composite-part > .title > .composite-bar-container > .composite-bar > .monaco-action-bar .action-item.icon .action-label:not(.codicon), .monaco-workbench .pane-composite-part > .header-or-footer > .composite-bar-container > .composite-bar > .monaco-action-bar .action-item.icon .action-label:not(.codicon) { @@ -209,6 +205,10 @@ position: relative; } +.monaco-workbench .pane-composite-part > .title > .composite-bar-container > .composite-bar > .monaco-action-bar .icon-badge .badge-content { + padding: 3px; +} + .monaco-workbench .pane-composite-part > .title > .composite-bar-container > .composite-bar > .monaco-action-bar .action-item.icon .badge.compact, .monaco-workbench .pane-composite-part > .header-or-footer > .composite-bar-container > .composite-bar > .monaco-action-bar .action-item.icon .badge.compact { position: absolute; @@ -237,6 +237,12 @@ text-align: center; } +.monaco-workbench .pane-composite-part > .title > .composite-bar-container > .composite-bar > .monaco-action-bar .action-item.icon .badge.compact.compact-content .badge-content, +.monaco-workbench .pane-composite-part > .header-or-footer > .composite-bar-container > .composite-bar > .monaco-action-bar .action-item.icon .badge.compact.compact-content .badge-content { + font-size: 8px; + padding: 0 3px; +} + .monaco-workbench .pane-composite-part > .title > .composite-bar-container > .composite-bar > .monaco-action-bar .action-item.icon .badge.compact.progress-badge .badge-content::before, .monaco-workbench .pane-composite-part > .header-or-footer > .composite-bar-container > .composite-bar > .monaco-action-bar .action-item.icon .badge.compact.progress-badge .badge-content::before { mask-size: 11px; diff --git a/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css b/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css index b4ac21708ba..a9e4fd0ebb0 100644 --- a/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css +++ b/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css @@ -44,14 +44,12 @@ justify-content: flex-end; } -.monaco-workbench > .notifications-center .notifications-list-container .monaco-list-row[data-last-element="false"] > .notification-list-item { +.monaco-workbench > .notifications-center .notifications-list-container .monaco-list-row:not(:last-child) > .notification-list-item { border-bottom: 1px solid var(--vscode-notifications-border); } -.monaco-workbench > .notifications-center .notifications-list-container, -.monaco-workbench > .notifications-center .notifications-list-container .monaco-scrollable-element, -.monaco-workbench > .notifications-center .notifications-list-container .notification-list-item { - border-radius: 0; +.monaco-workbench > .notifications-center .notifications-list-container .monaco-list-row:last-child { + border-radius: 0px 0px 4px 4px; /* adopt the border radius at the end of the notifications center */ } /* Icons */ diff --git a/src/vs/workbench/browser/parts/notifications/media/notificationsList.css b/src/vs/workbench/browser/parts/notifications/media/notificationsList.css index 1e46a103a1d..c5b4faf8e49 100644 --- a/src/vs/workbench/browser/parts/notifications/media/notificationsList.css +++ b/src/vs/workbench/browser/parts/notifications/media/notificationsList.css @@ -9,7 +9,6 @@ color: var(--vscode-notifications-foreground); background: var(--vscode-notifications-background); outline-color: var(--vscode-contrastBorder); - border-radius: inherit; } .monaco-workbench .notifications-list-container .notification-list-item { @@ -19,7 +18,6 @@ padding: 10px 5px; height: 100%; box-sizing: border-box; - border-radius: 4px; } .monaco-workbench .notifications-list-container .notification-offset-helper { @@ -29,10 +27,6 @@ word-wrap: break-word; /* never overflow long words, but break to next line */ } -.monaco-workbench .notifications-list-container .monaco-scrollable-element { - border-radius: 4px; -} - /** Notification: Main Row */ .monaco-workbench .notifications-list-container .notification-list-item > .notification-list-item-main-row { diff --git a/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css b/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css index 89ce01ed02b..d4ef2314bc5 100644 --- a/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css +++ b/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css @@ -30,6 +30,13 @@ transform: translate3d(0px, 100%, 0px); /* move the notification 50px to the bottom (to prevent bleed through) */ opacity: 0; /* fade the toast in */ transition: transform 300ms ease-out, opacity 300ms ease-out; +} + +.monaco-workbench > .notifications-toasts .notifications-list-container, +.monaco-workbench > .notifications-toasts .notification-toast-container > .notification-toast, +.monaco-workbench > .notifications-toasts .notification-toast-container > .notification-toast .monaco-scrollable-element, +.monaco-workbench > .notifications-toasts .notification-toast-container > .notification-toast .monaco-list:not(.element-focused):focus:before, +.monaco-workbench > .notifications-toasts .notification-toast-container > .notification-toast .monaco-list-row { border-radius: 4px; } diff --git a/src/vs/workbench/browser/parts/notifications/notificationAccessibleView.ts b/src/vs/workbench/browser/parts/notifications/notificationAccessibleView.ts index 15a240f9150..0e206216e58 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationAccessibleView.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationAccessibleView.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IAction } from 'vs/base/common/actions'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { localize } from 'vs/nls'; -import { IAccessibleViewService, AccessibleViewProviderId, AccessibleViewType } from 'vs/platform/accessibility/browser/accessibleView'; -import { IAccessibleViewImplentation, alertAccessibleViewFocusChange } from 'vs/platform/accessibility/browser/accessibleViewRegistry'; -import { IAccessibilitySignalService, AccessibilitySignal } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IListService, WorkbenchList } from 'vs/platform/list/browser/listService'; -import { getNotificationFromContext } from 'vs/workbench/browser/parts/notifications/notificationsCommands'; -import { NotificationFocusedContext } from 'vs/workbench/common/contextkeys'; -import { INotificationViewItem } from 'vs/workbench/common/notifications'; +import { IAction } from '../../../../base/common/actions.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { localize } from '../../../../nls.js'; +import { IAccessibleViewService, AccessibleViewProviderId, AccessibleViewType, AccessibleContentProvider } from '../../../../platform/accessibility/browser/accessibleView.js'; +import { IAccessibleViewImplentation } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js'; +import { IAccessibilitySignalService, AccessibilitySignal } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { IListService, WorkbenchList } from '../../../../platform/list/browser/listService.js'; +import { getNotificationFromContext } from './notificationsCommands.js'; +import { NotificationFocusedContext } from '../../../common/contextkeys.js'; +import { INotificationViewItem } from '../../../common/notifications.js'; export class NotificationAccessibleView implements IAccessibleViewImplentation { readonly priority = 90; @@ -35,11 +35,9 @@ export class NotificationAccessibleView implements IAccessibleViewImplentation { } commandService.executeCommand('notifications.showList'); let notificationIndex: number | undefined; - let length: number | undefined; const list = listService.lastFocusedList; if (list instanceof WorkbenchList) { notificationIndex = list.indexOf(notification); - length = list.length; } if (notificationIndex === undefined) { return; @@ -54,45 +52,48 @@ export class NotificationAccessibleView implements IAccessibleViewImplentation { } catch { } } } - const message = notification.message.original.toString(); - if (!message) { + + function getContentForNotification(): string | undefined { + const notification = getNotificationFromContext(listService); + const message = notification?.message.original.toString(); + if (!notification) { + return; + } + return notification.source ? localize('notification.accessibleViewSrc', '{0} Source: {1}', message, notification.source) : localize('notification.accessibleView', '{0}', message); + } + const content = getContentForNotification(); + if (!content) { return; } notification.onDidClose(() => accessibleViewService.next()); - return { - id: AccessibleViewProviderId.Notification, - provideContent: () => { - return notification.source ? localize('notification.accessibleViewSrc', '{0} Source: {1}', message, notification.source) : localize('notification.accessibleView', '{0}', message); - }, - onClose(): void { - focusList(); - }, - next(): void { + return new AccessibleContentProvider( + AccessibleViewProviderId.Notification, + { type: AccessibleViewType.View }, + () => content, + () => focusList(), + 'accessibility.verbosity.notification', + undefined, + getActionsFromNotification(notification, accessibilitySignalService), + () => { if (!list) { return; } focusList(); list.focusNext(); - alertAccessibleViewFocusChange(notificationIndex, length, 'next'); - getProvider(); + return getContentForNotification(); }, - previous(): void { + () => { if (!list) { return; } focusList(); list.focusPrevious(); - alertAccessibleViewFocusChange(notificationIndex, length, 'previous'); - getProvider(); + return getContentForNotification(); }, - verbositySettingKey: 'accessibility.verbosity.notification', - options: { type: AccessibleViewType.View }, - actions: getActionsFromNotification(notification, accessibilitySignalService) - }; + ); } return getProvider(); } - dispose() { } } diff --git a/src/vs/workbench/browser/parts/notifications/notificationsActions.ts b/src/vs/workbench/browser/parts/notifications/notificationsActions.ts index a6295ba424b..e07546c56bc 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsActions.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsActions.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/notificationsActions'; -import { INotificationViewItem } from 'vs/workbench/common/notifications'; -import { localize } from 'vs/nls'; -import { Action } from 'vs/base/common/actions'; -import { CLEAR_NOTIFICATION, EXPAND_NOTIFICATION, COLLAPSE_NOTIFICATION, CLEAR_ALL_NOTIFICATIONS, HIDE_NOTIFICATIONS_CENTER, TOGGLE_DO_NOT_DISTURB_MODE, TOGGLE_DO_NOT_DISTURB_MODE_BY_SOURCE } from 'vs/workbench/browser/parts/notifications/notificationsCommands'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { Codicon } from 'vs/base/common/codicons'; -import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { ThemeIcon } from 'vs/base/common/themables'; +import './media/notificationsActions.css'; +import { INotificationViewItem } from '../../../common/notifications.js'; +import { localize } from '../../../../nls.js'; +import { Action } from '../../../../base/common/actions.js'; +import { CLEAR_NOTIFICATION, EXPAND_NOTIFICATION, COLLAPSE_NOTIFICATION, CLEAR_ALL_NOTIFICATIONS, HIDE_NOTIFICATIONS_CENTER, TOGGLE_DO_NOT_DISTURB_MODE, TOGGLE_DO_NOT_DISTURB_MODE_BY_SOURCE } from './notificationsCommands.js'; +import { ICommandService } from '../../../../platform/commands/common/commands.js'; +import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; const clearIcon = registerIcon('notifications-clear', Codicon.close, localize('clearIcon', 'Icon for the clear action in notifications.')); const clearAllIcon = registerIcon('notifications-clear-all', Codicon.clearAll, localize('clearAllIcon', 'Icon for the clear all action in notifications.')); diff --git a/src/vs/workbench/browser/parts/notifications/notificationsAlerts.ts b/src/vs/workbench/browser/parts/notifications/notificationsAlerts.ts index 0238b6aa05a..bd4ff0b1e2c 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsAlerts.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsAlerts.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { alert } from 'vs/base/browser/ui/aria/aria'; -import { localize } from 'vs/nls'; -import { INotificationViewItem, INotificationsModel, NotificationChangeType, INotificationChangeEvent, NotificationViewItemContentChangeKind } from 'vs/workbench/common/notifications'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { NotificationPriority, Severity } from 'vs/platform/notification/common/notification'; -import { Event } from 'vs/base/common/event'; +import { alert } from '../../../../base/browser/ui/aria/aria.js'; +import { localize } from '../../../../nls.js'; +import { INotificationViewItem, INotificationsModel, NotificationChangeType, INotificationChangeEvent, NotificationViewItemContentChangeKind } from '../../../common/notifications.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { toErrorMessage } from '../../../../base/common/errorMessage.js'; +import { NotificationPriority, Severity } from '../../../../platform/notification/common/notification.js'; +import { Event } from '../../../../base/common/event.js'; export class NotificationsAlerts extends Disposable { diff --git a/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts b/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts index 40bcde5fdb4..85356ca85d9 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsCenter.ts @@ -3,32 +3,32 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/notificationsCenter'; -import 'vs/css!./media/notificationsActions'; -import { NOTIFICATIONS_CENTER_HEADER_FOREGROUND, NOTIFICATIONS_CENTER_HEADER_BACKGROUND, NOTIFICATIONS_CENTER_BORDER } from 'vs/workbench/common/theme'; -import { IThemeService, Themable } from 'vs/platform/theme/common/themeService'; -import { INotificationsModel, INotificationChangeEvent, NotificationChangeType, NotificationViewItemContentChangeKind } from 'vs/workbench/common/notifications'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; -import { Emitter } from 'vs/base/common/event'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { INotificationsCenterController, NotificationActionRunner } from 'vs/workbench/browser/parts/notifications/notificationsCommands'; -import { NotificationsList } from 'vs/workbench/browser/parts/notifications/notificationsList'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { Dimension, isAncestorOfActiveElement } from 'vs/base/browser/dom'; -import { widgetShadow } from 'vs/platform/theme/common/colorRegistry'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { localize } from 'vs/nls'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { ClearAllNotificationsAction, ConfigureDoNotDisturbAction, ToggleDoNotDisturbBySourceAction, HideNotificationsCenterAction, ToggleDoNotDisturbAction } from 'vs/workbench/browser/parts/notifications/notificationsActions'; -import { IAction, Separator, toAction } from 'vs/base/common/actions'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { assertAllDefined, assertIsDefined } from 'vs/base/common/types'; -import { NotificationsCenterVisibleContext } from 'vs/workbench/common/contextkeys'; -import { INotificationService, NotificationsFilter } from 'vs/platform/notification/common/notification'; -import { mainWindow } from 'vs/base/browser/window'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { DropdownMenuActionViewItem } from 'vs/base/browser/ui/dropdown/dropdownActionViewItem'; -import { AccessibilitySignal, IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; +import './media/notificationsCenter.css'; +import './media/notificationsActions.css'; +import { NOTIFICATIONS_CENTER_HEADER_FOREGROUND, NOTIFICATIONS_CENTER_HEADER_BACKGROUND, NOTIFICATIONS_CENTER_BORDER } from '../../../common/theme.js'; +import { IThemeService, Themable } from '../../../../platform/theme/common/themeService.js'; +import { INotificationsModel, INotificationChangeEvent, NotificationChangeType, NotificationViewItemContentChangeKind } from '../../../common/notifications.js'; +import { IWorkbenchLayoutService, Parts } from '../../../services/layout/browser/layoutService.js'; +import { Emitter } from '../../../../base/common/event.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { INotificationsCenterController, NotificationActionRunner } from './notificationsCommands.js'; +import { NotificationsList } from './notificationsList.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { Dimension, isAncestorOfActiveElement } from '../../../../base/browser/dom.js'; +import { widgetShadow } from '../../../../platform/theme/common/colorRegistry.js'; +import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; +import { localize } from '../../../../nls.js'; +import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js'; +import { ClearAllNotificationsAction, ConfigureDoNotDisturbAction, ToggleDoNotDisturbBySourceAction, HideNotificationsCenterAction, ToggleDoNotDisturbAction } from './notificationsActions.js'; +import { IAction, Separator, toAction } from '../../../../base/common/actions.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { assertAllDefined, assertIsDefined } from '../../../../base/common/types.js'; +import { NotificationsCenterVisibleContext } from '../../../common/contextkeys.js'; +import { INotificationService, NotificationsFilter } from '../../../../platform/notification/common/notification.js'; +import { mainWindow } from '../../../../base/browser/window.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { DropdownMenuActionViewItem } from '../../../../base/browser/ui/dropdown/dropdownActionViewItem.js'; +import { AccessibilitySignal, IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; export class NotificationsCenter extends Themable implements INotificationsCenterController { diff --git a/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts b/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts index 92b1b45d184..c80c3561c46 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts @@ -3,25 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { INotificationViewItem, isNotificationViewItem, NotificationsModel } from 'vs/workbench/common/notifications'; -import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; -import { localize, localize2 } from 'vs/nls'; -import { IListService, WorkbenchList } from 'vs/platform/list/browser/listService'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { NotificationMetrics, NotificationMetricsClassification, notificationToMetrics } from 'vs/workbench/browser/parts/notifications/notificationsTelemetry'; -import { NotificationFocusedContext, NotificationsCenterVisibleContext, NotificationsToastsVisibleContext } from 'vs/workbench/common/contextkeys'; -import { INotificationService, INotificationSourceFilter, NotificationPriority, NotificationsFilter } from 'vs/platform/notification/common/notification'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ActionRunner, IAction, WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions'; -import { hash } from 'vs/base/common/hash'; -import { firstOrDefault } from 'vs/base/common/arrays'; -import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { DisposableStore } from 'vs/base/common/lifecycle'; -import { AccessibilitySignal, IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; +import { CommandsRegistry } from '../../../../platform/commands/common/commands.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { KeybindingsRegistry, KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { INotificationViewItem, isNotificationViewItem, NotificationsModel } from '../../../common/notifications.js'; +import { MenuRegistry, MenuId } from '../../../../platform/actions/common/actions.js'; +import { localize, localize2 } from '../../../../nls.js'; +import { IListService, WorkbenchList } from '../../../../platform/list/browser/listService.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { NotificationMetrics, NotificationMetricsClassification, notificationToMetrics } from './notificationsTelemetry.js'; +import { NotificationFocusedContext, NotificationsCenterVisibleContext, NotificationsToastsVisibleContext } from '../../../common/contextkeys.js'; +import { INotificationService, INotificationSourceFilter, NotificationPriority, NotificationsFilter } from '../../../../platform/notification/common/notification.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { ActionRunner, IAction, WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from '../../../../base/common/actions.js'; +import { hash } from '../../../../base/common/hash.js'; +import { IQuickInputService, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js'; +import { DisposableStore } from '../../../../base/common/lifecycle.js'; +import { AccessibilitySignal, IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js'; // Center export const SHOW_NOTIFICATIONS_CENTER = 'notifications.showList'; @@ -171,11 +170,11 @@ export function registerNotificationCommands(center: INotificationsCenterControl primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyA, handler: (accessor) => { const actionRunner = accessor.get(IInstantiationService).createInstance(NotificationActionRunner); - const notification = getNotificationFromContext(accessor.get(IListService)) || firstOrDefault(model.notifications); + const notification = getNotificationFromContext(accessor.get(IListService)) || model.notifications.at(0); if (!notification) { return; } - const primaryAction = notification.actions?.primary ? firstOrDefault(notification.actions.primary) : undefined; + const primaryAction = notification.actions?.primary ? notification.actions.primary.at(0) : undefined; if (!primaryAction) { return; } @@ -312,12 +311,12 @@ export function registerNotificationCommands(center: INotificationsCenterControl picker.canSelectMany = true; picker.placeholder = localize('selectSources', "Select sources to enable all notifications from"); - picker.selectedItems = picker.items.filter(item => (item as INotificationSourceFilter).filter === NotificationsFilter.OFF) as (IQuickPickItem & INotificationSourceFilter)[]; + picker.selectedItems = picker.items.filter(item => item.filter === NotificationsFilter.OFF); picker.show(); disposables.add(picker.onDidAccept(async () => { - for (const item of picker.items as (IQuickPickItem & INotificationSourceFilter)[]) { + for (const item of picker.items) { notificationService.setFilter({ id: item.id, label: item.label, diff --git a/src/vs/workbench/browser/parts/notifications/notificationsList.ts b/src/vs/workbench/browser/parts/notifications/notificationsList.ts index 4dad9770b06..e39aa5755c3 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsList.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsList.ts @@ -3,24 +3,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/notificationsList'; -import { localize } from 'vs/nls'; -import { getWindow, isAncestorOfActiveElement, trackFocus } from 'vs/base/browser/dom'; -import { WorkbenchList } from 'vs/platform/list/browser/listService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IListAccessibilityProvider, IListOptions } from 'vs/base/browser/ui/list/listWidget'; -import { NOTIFICATIONS_BACKGROUND } from 'vs/workbench/common/theme'; -import { INotificationViewItem } from 'vs/workbench/common/notifications'; -import { NotificationsListDelegate, NotificationRenderer } from 'vs/workbench/browser/parts/notifications/notificationsViewer'; -import { CopyNotificationMessageAction } from 'vs/workbench/browser/parts/notifications/notificationsActions'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { assertAllDefined } from 'vs/base/common/types'; -import { NotificationFocusedContext } from 'vs/workbench/common/contextkeys'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { AriaRole } from 'vs/base/browser/ui/aria/aria'; -import { NotificationActionRunner } from 'vs/workbench/browser/parts/notifications/notificationsCommands'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import './media/notificationsList.css'; +import { localize } from '../../../../nls.js'; +import { getWindow, isAncestorOfActiveElement, trackFocus } from '../../../../base/browser/dom.js'; +import { WorkbenchList } from '../../../../platform/list/browser/listService.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { IListAccessibilityProvider, IListOptions } from '../../../../base/browser/ui/list/listWidget.js'; +import { NOTIFICATIONS_BACKGROUND } from '../../../common/theme.js'; +import { INotificationViewItem } from '../../../common/notifications.js'; +import { NotificationsListDelegate, NotificationRenderer } from './notificationsViewer.js'; +import { CopyNotificationMessageAction } from './notificationsActions.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { assertAllDefined } from '../../../../base/common/types.js'; +import { NotificationFocusedContext } from '../../../common/contextkeys.js'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { AriaRole } from '../../../../base/browser/ui/aria/aria.js'; +import { NotificationActionRunner } from './notificationsCommands.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; export interface INotificationsListOptions extends IListOptions { readonly widgetAriaLabel?: string; diff --git a/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts b/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts index 71b8a59aa62..3e0ec62380d 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { INotificationsModel, INotificationChangeEvent, NotificationChangeType, IStatusMessageChangeEvent, StatusMessageChangeType, IStatusMessageViewItem } from 'vs/workbench/common/notifications'; -import { IStatusbarService, StatusbarAlignment, IStatusbarEntryAccessor, IStatusbarEntry } from 'vs/workbench/services/statusbar/browser/statusbar'; -import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { HIDE_NOTIFICATIONS_CENTER, SHOW_NOTIFICATIONS_CENTER } from 'vs/workbench/browser/parts/notifications/notificationsCommands'; -import { localize } from 'vs/nls'; -import { INotificationService, NotificationsFilter } from 'vs/platform/notification/common/notification'; +import { INotificationsModel, INotificationChangeEvent, NotificationChangeType, IStatusMessageChangeEvent, StatusMessageChangeType, IStatusMessageViewItem } from '../../../common/notifications.js'; +import { IStatusbarService, StatusbarAlignment, IStatusbarEntryAccessor, IStatusbarEntry } from '../../../services/statusbar/browser/statusbar.js'; +import { Disposable, IDisposable, dispose } from '../../../../base/common/lifecycle.js'; +import { HIDE_NOTIFICATIONS_CENTER, SHOW_NOTIFICATIONS_CENTER } from './notificationsCommands.js'; +import { localize } from '../../../../nls.js'; +import { INotificationService, NotificationsFilter } from '../../../../platform/notification/common/notification.js'; export class NotificationsStatus extends Disposable { diff --git a/src/vs/workbench/browser/parts/notifications/notificationsTelemetry.ts b/src/vs/workbench/browser/parts/notifications/notificationsTelemetry.ts index 97d1d6a18c8..fd7b3f3da3a 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsTelemetry.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsTelemetry.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { INotificationService, NotificationMessage, NotificationPriority } from 'vs/platform/notification/common/notification'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { hash } from 'vs/base/common/hash'; +import { Disposable } from '../../../../base/common/lifecycle.js'; +import { INotificationService, NotificationMessage, NotificationPriority } from '../../../../platform/notification/common/notification.js'; +import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; +import { IWorkbenchContribution } from '../../../common/contributions.js'; +import { hash } from '../../../../base/common/hash.js'; export interface NotificationMetrics { readonly id: string; diff --git a/src/vs/workbench/browser/parts/notifications/notificationsToasts.ts b/src/vs/workbench/browser/parts/notifications/notificationsToasts.ts index c42e49f2629..f0dda3b44cb 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsToasts.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsToasts.ts @@ -3,29 +3,29 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/notificationsToasts'; -import { localize } from 'vs/nls'; -import { INotificationsModel, NotificationChangeType, INotificationChangeEvent, INotificationViewItem, NotificationViewItemContentChangeKind } from 'vs/workbench/common/notifications'; -import { IDisposable, dispose, toDisposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { addDisposableListener, EventType, Dimension, scheduleAtNextAnimationFrame, isAncestorOfActiveElement, getWindow } from 'vs/base/browser/dom'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { NotificationsList } from 'vs/workbench/browser/parts/notifications/notificationsList'; -import { Event, Emitter } from 'vs/base/common/event'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; -import { NOTIFICATIONS_TOAST_BORDER, NOTIFICATIONS_BACKGROUND } from 'vs/workbench/common/theme'; -import { IThemeService, Themable } from 'vs/platform/theme/common/themeService'; -import { widgetShadow } from 'vs/platform/theme/common/colorRegistry'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { INotificationsToastController } from 'vs/workbench/browser/parts/notifications/notificationsCommands'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { Severity, NotificationsFilter, NotificationPriority } from 'vs/platform/notification/common/notification'; -import { ScrollbarVisibility } from 'vs/base/common/scrollable'; -import { ILifecycleService, LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { IntervalCounter } from 'vs/base/common/async'; -import { assertIsDefined } from 'vs/base/common/types'; -import { NotificationsToastsVisibleContext } from 'vs/workbench/common/contextkeys'; -import { mainWindow } from 'vs/base/browser/window'; +import './media/notificationsToasts.css'; +import { localize } from '../../../../nls.js'; +import { INotificationsModel, NotificationChangeType, INotificationChangeEvent, INotificationViewItem, NotificationViewItemContentChangeKind } from '../../../common/notifications.js'; +import { IDisposable, dispose, toDisposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { addDisposableListener, EventType, Dimension, scheduleAtNextAnimationFrame, isAncestorOfActiveElement, getWindow } from '../../../../base/browser/dom.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { NotificationsList } from './notificationsList.js'; +import { Event, Emitter } from '../../../../base/common/event.js'; +import { IWorkbenchLayoutService, Parts } from '../../../services/layout/browser/layoutService.js'; +import { NOTIFICATIONS_TOAST_BORDER, NOTIFICATIONS_BACKGROUND } from '../../../common/theme.js'; +import { IThemeService, Themable } from '../../../../platform/theme/common/themeService.js'; +import { widgetShadow } from '../../../../platform/theme/common/colorRegistry.js'; +import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; +import { INotificationsToastController } from './notificationsCommands.js'; +import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; +import { Severity, NotificationsFilter, NotificationPriority } from '../../../../platform/notification/common/notification.js'; +import { ScrollbarVisibility } from '../../../../base/common/scrollable.js'; +import { ILifecycleService, LifecyclePhase } from '../../../services/lifecycle/common/lifecycle.js'; +import { IHostService } from '../../../services/host/browser/host.js'; +import { IntervalCounter } from '../../../../base/common/async.js'; +import { assertIsDefined } from '../../../../base/common/types.js'; +import { NotificationsToastsVisibleContext } from '../../../common/contextkeys.js'; +import { mainWindow } from '../../../../base/browser/window.js'; interface INotificationToast { readonly item: INotificationViewItem; @@ -55,7 +55,7 @@ export class NotificationsToasts extends Themable implements INotificationsToast // Count for the number of notifications over 800ms... interval: 800, // ...and ensure we are not showing more than MAX_NOTIFICATIONS - limit: NotificationsToasts.MAX_NOTIFICATIONS + limit: this.MAX_NOTIFICATIONS }; private readonly _onDidChangeVisibility = this._register(new Emitter()); diff --git a/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts b/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts index c1fda244291..c1880ef981b 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts @@ -3,35 +3,35 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IListVirtualDelegate, IListRenderer } from 'vs/base/browser/ui/list/list'; -import { clearNode, addDisposableListener, EventType, EventHelper, $, isEventLike } from 'vs/base/browser/dom'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { ButtonBar, IButtonOptions } from 'vs/base/browser/ui/button/button'; -import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { ActionRunner, IAction, IActionRunner, Separator, toAction } from 'vs/base/common/actions'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { dispose, DisposableStore, Disposable } from 'vs/base/common/lifecycle'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { INotificationViewItem, NotificationViewItem, NotificationViewItemContentChangeKind, INotificationMessage, ChoiceAction } from 'vs/workbench/common/notifications'; -import { ClearNotificationAction, ExpandNotificationAction, CollapseNotificationAction, ConfigureNotificationAction } from 'vs/workbench/browser/parts/notifications/notificationsActions'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar'; -import { INotificationService, NotificationsFilter, Severity, isNotificationSource } from 'vs/platform/notification/common/notification'; -import { isNonEmptyArray } from 'vs/base/common/arrays'; -import { Codicon } from 'vs/base/common/codicons'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { DropdownMenuActionViewItem } from 'vs/base/browser/ui/dropdown/dropdownActionViewItem'; -import { DomEmitter } from 'vs/base/browser/event'; -import { Gesture, EventType as GestureEventType } from 'vs/base/browser/touch'; -import { Event } from 'vs/base/common/event'; -import { defaultButtonStyles, defaultProgressBarStyles } from 'vs/platform/theme/browser/defaultStyles'; -import { KeyCode } from 'vs/base/common/keyCodes'; -import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; -import type { IManagedHover } from 'vs/base/browser/ui/hover/hover'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; +import { IListVirtualDelegate, IListRenderer } from '../../../../base/browser/ui/list/list.js'; +import { clearNode, addDisposableListener, EventType, EventHelper, $, isEventLike } from '../../../../base/browser/dom.js'; +import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import { URI } from '../../../../base/common/uri.js'; +import { localize } from '../../../../nls.js'; +import { ButtonBar, IButtonOptions } from '../../../../base/browser/ui/button/button.js'; +import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js'; +import { ActionRunner, IAction, IActionRunner, Separator, toAction } from '../../../../base/common/actions.js'; +import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; +import { dispose, DisposableStore, Disposable } from '../../../../base/common/lifecycle.js'; +import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; +import { INotificationViewItem, NotificationViewItem, NotificationViewItemContentChangeKind, INotificationMessage, ChoiceAction } from '../../../common/notifications.js'; +import { ClearNotificationAction, ExpandNotificationAction, CollapseNotificationAction, ConfigureNotificationAction } from './notificationsActions.js'; +import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; +import { ProgressBar } from '../../../../base/browser/ui/progressbar/progressbar.js'; +import { INotificationService, NotificationsFilter, Severity, isNotificationSource } from '../../../../platform/notification/common/notification.js'; +import { isNonEmptyArray } from '../../../../base/common/arrays.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { DropdownMenuActionViewItem } from '../../../../base/browser/ui/dropdown/dropdownActionViewItem.js'; +import { DomEmitter } from '../../../../base/browser/event.js'; +import { Gesture, EventType as GestureEventType } from '../../../../base/browser/touch.js'; +import { Event } from '../../../../base/common/event.js'; +import { defaultButtonStyles, defaultProgressBarStyles } from '../../../../platform/theme/browser/defaultStyles.js'; +import { KeyCode } from '../../../../base/common/keyCodes.js'; +import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; +import { getDefaultHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js'; +import type { IManagedHover } from '../../../../base/browser/ui/hover/hover.js'; +import { IHoverService } from '../../../../platform/hover/browser/hover.js'; export class NotificationsListDelegate implements IListVirtualDelegate { diff --git a/src/vs/workbench/browser/parts/paneCompositeBar.ts b/src/vs/workbench/browser/parts/paneCompositeBar.ts index 999ec66db58..22cce772ccf 100644 --- a/src/vs/workbench/browser/parts/paneCompositeBar.ts +++ b/src/vs/workbench/browser/parts/paneCompositeBar.ts @@ -3,32 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; -import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; -import { IActivityService } from 'vs/workbench/services/activity/common/activity'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IDisposable, DisposableStore, Disposable, DisposableMap } from 'vs/base/common/lifecycle'; -import { IColorTheme } from 'vs/platform/theme/common/themeService'; -import { CompositeBar, ICompositeBarItem, CompositeDragAndDrop } from 'vs/workbench/browser/parts/compositeBar'; -import { Dimension, createCSSRule, asCSSUrl, isMouseEvent } from 'vs/base/browser/dom'; -import { IStorageService, StorageScope, StorageTarget, IProfileStorageValueChangeEvent } from 'vs/platform/storage/common/storage'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ToggleCompositePinnedAction, ICompositeBarColors, IActivityHoverOptions, ToggleCompositeBadgeAction, CompositeBarAction, ICompositeBar, ICompositeBarActionItem } from 'vs/workbench/browser/parts/compositeBarActions'; -import { IViewDescriptorService, ViewContainer, IViewContainerModel, ViewContainerLocation } from 'vs/workbench/common/views'; -import { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { isString } from 'vs/base/common/types'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { isNative } from 'vs/base/common/platform'; -import { Before2D, ICompositeDragAndDrop } from 'vs/workbench/browser/dnd'; -import { ThemeIcon } from 'vs/base/common/themables'; -import { IAction, toAction } from 'vs/base/common/actions'; -import { StringSHA1 } from 'vs/base/common/hash'; -import { GestureEvent } from 'vs/base/browser/touch'; -import { IPaneCompositePart } from 'vs/workbench/browser/parts/paneCompositePart'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { localize } from '../../../nls.js'; +import { ActionsOrientation } from '../../../base/browser/ui/actionbar/actionbar.js'; +import { IActivityService } from '../../services/activity/common/activity.js'; +import { IWorkbenchLayoutService, Parts } from '../../services/layout/browser/layoutService.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { IDisposable, DisposableStore, Disposable, DisposableMap } from '../../../base/common/lifecycle.js'; +import { IColorTheme } from '../../../platform/theme/common/themeService.js'; +import { CompositeBar, ICompositeBarItem, CompositeDragAndDrop } from './compositeBar.js'; +import { Dimension, createCSSRule, asCSSUrl, isMouseEvent } from '../../../base/browser/dom.js'; +import { IStorageService, StorageScope, StorageTarget, IProfileStorageValueChangeEvent } from '../../../platform/storage/common/storage.js'; +import { IExtensionService } from '../../services/extensions/common/extensions.js'; +import { URI, UriComponents } from '../../../base/common/uri.js'; +import { ToggleCompositePinnedAction, ICompositeBarColors, IActivityHoverOptions, ToggleCompositeBadgeAction, CompositeBarAction, ICompositeBar, ICompositeBarActionItem } from './compositeBarActions.js'; +import { IViewDescriptorService, ViewContainer, IViewContainerModel, ViewContainerLocation } from '../../common/views.js'; +import { IContextKeyService, ContextKeyExpr } from '../../../platform/contextkey/common/contextkey.js'; +import { isString } from '../../../base/common/types.js'; +import { IWorkbenchEnvironmentService } from '../../services/environment/common/environmentService.js'; +import { isNative } from '../../../base/common/platform.js'; +import { Before2D, ICompositeDragAndDrop } from '../dnd.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { IAction, toAction } from '../../../base/common/actions.js'; +import { StringSHA1 } from '../../../base/common/hash.js'; +import { GestureEvent } from '../../../base/browser/touch.js'; +import { IPaneCompositePart } from './paneCompositePart.js'; +import { ITelemetryService } from '../../../platform/telemetry/common/telemetry.js'; +import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; +import { IViewsService } from '../../services/views/common/viewsService.js'; interface IPlaceholderViewContainer { readonly id: string; @@ -102,6 +103,7 @@ export class PaneCompositeBar extends Disposable { @IStorageService private readonly storageService: IStorageService, @IExtensionService private readonly extensionService: IExtensionService, @IViewDescriptorService private readonly viewDescriptorService: IViewDescriptorService, + @IViewsService private readonly viewService: IViewsService, @IContextKeyService protected readonly contextKeyService: IContextKeyService, @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService, @IWorkbenchLayoutService protected readonly layoutService: IWorkbenchLayoutService, @@ -383,7 +385,7 @@ export class PaneCompositeBar extends Disposable { if (viewContainer) { if (viewContainer.hideIfEmpty) { - if (this.viewDescriptorService.getViewContainerModel(viewContainer).activeViewDescriptors.length > 0) { + if (this.viewService.isViewContainerActive(viewContainerId)) { return false; } } else { diff --git a/src/vs/workbench/browser/parts/paneCompositePart.ts b/src/vs/workbench/browser/parts/paneCompositePart.ts index 0ab4a55d849..baef928de1a 100644 --- a/src/vs/workbench/browser/parts/paneCompositePart.ts +++ b/src/vs/workbench/browser/parts/paneCompositePart.ts @@ -3,43 +3,43 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!./media/paneCompositePart'; -import { Event } from 'vs/base/common/event'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IProgressIndicator } from 'vs/platform/progress/common/progress'; -import { Extensions, PaneComposite, PaneCompositeDescriptor, PaneCompositeRegistry } from 'vs/workbench/browser/panecomposite'; -import { IPaneComposite } from 'vs/workbench/common/panecomposite'; -import { IViewDescriptorService, ViewContainerLocation } from 'vs/workbench/common/views'; -import { DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle'; -import { IView } from 'vs/base/browser/ui/grid/grid'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; -import { CompositePart, ICompositeTitleLabel } from 'vs/workbench/browser/parts/compositePart'; -import { IPaneCompositeBarOptions, PaneCompositeBar } from 'vs/workbench/browser/parts/paneCompositeBar'; -import { Dimension, EventHelper, trackFocus, $, addDisposableListener, EventType, prepend, getWindow } from 'vs/base/browser/dom'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { IComposite } from 'vs/workbench/common/composite'; -import { localize } from 'vs/nls'; -import { CompositeDragAndDropObserver, toggleDropEffect } from 'vs/workbench/browser/dnd'; -import { EDITOR_DRAG_AND_DROP_BACKGROUND } from 'vs/workbench/common/theme'; -import { IPartOptions } from 'vs/workbench/browser/part'; -import { CompositeMenuActions } from 'vs/workbench/browser/actions'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; -import { ActionsOrientation, prepareActions } from 'vs/base/browser/ui/actionbar/actionbar'; -import { Gesture, EventType as GestureEventType } from 'vs/base/browser/touch'; -import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { IAction, SubmenuAction } from 'vs/base/common/actions'; -import { Composite } from 'vs/workbench/browser/composite'; -import { ViewsSubMenu } from 'vs/workbench/browser/parts/views/viewPaneContainer'; -import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IHoverService } from 'vs/platform/hover/browser/hover'; -import { HiddenItemStrategy, WorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; +import './media/paneCompositePart.css'; +import { Event } from '../../../base/common/event.js'; +import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; +import { IProgressIndicator } from '../../../platform/progress/common/progress.js'; +import { Extensions, PaneComposite, PaneCompositeDescriptor, PaneCompositeRegistry } from '../panecomposite.js'; +import { IPaneComposite } from '../../common/panecomposite.js'; +import { IViewDescriptorService, ViewContainerLocation } from '../../common/views.js'; +import { DisposableStore, MutableDisposable } from '../../../base/common/lifecycle.js'; +import { IView } from '../../../base/browser/ui/grid/grid.js'; +import { IWorkbenchLayoutService, Parts } from '../../services/layout/browser/layoutService.js'; +import { CompositePart, ICompositeTitleLabel } from './compositePart.js'; +import { IPaneCompositeBarOptions, PaneCompositeBar } from './paneCompositeBar.js'; +import { Dimension, EventHelper, trackFocus, $, addDisposableListener, EventType, prepend, getWindow } from '../../../base/browser/dom.js'; +import { Registry } from '../../../platform/registry/common/platform.js'; +import { INotificationService } from '../../../platform/notification/common/notification.js'; +import { IStorageService } from '../../../platform/storage/common/storage.js'; +import { IContextMenuService } from '../../../platform/contextview/browser/contextView.js'; +import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js'; +import { IThemeService } from '../../../platform/theme/common/themeService.js'; +import { IContextKey, IContextKeyService } from '../../../platform/contextkey/common/contextkey.js'; +import { IExtensionService } from '../../services/extensions/common/extensions.js'; +import { IComposite } from '../../common/composite.js'; +import { localize } from '../../../nls.js'; +import { CompositeDragAndDropObserver, toggleDropEffect } from '../dnd.js'; +import { EDITOR_DRAG_AND_DROP_BACKGROUND } from '../../common/theme.js'; +import { IPartOptions } from '../part.js'; +import { CompositeMenuActions } from '../actions.js'; +import { IMenuService, MenuId } from '../../../platform/actions/common/actions.js'; +import { ActionsOrientation, prepareActions } from '../../../base/browser/ui/actionbar/actionbar.js'; +import { Gesture, EventType as GestureEventType } from '../../../base/browser/touch.js'; +import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js'; +import { IAction, SubmenuAction } from '../../../base/common/actions.js'; +import { Composite } from '../composite.js'; +import { ViewsSubMenu } from './views/viewPaneContainer.js'; +import { createAndFillInActionBarActions } from '../../../platform/actions/browser/menuEntryActionViewItem.js'; +import { IHoverService } from '../../../platform/hover/browser/hover.js'; +import { HiddenItemStrategy, WorkbenchToolBar } from '../../../platform/actions/browser/toolbar.js'; export enum CompositeBarPosition { TOP, @@ -268,7 +268,7 @@ export abstract class AbstractPaneCompositePart extends CompositePart { EventHelper.stop(e.eventData, true); if (this.paneCompositeBar.value) { @@ -296,6 +296,28 @@ export abstract class AbstractPaneCompositePart extends CompositePart